Project

General

Profile

Task #19481

Updated by Redmine Admin 5 months ago

A refund request is sent to the Finance Department when an invoice is cancelled and a partial full credit note is issued against an invoice, issued, so that Finance can process the refund of the refundable amount previously paid by the customer. 

 This functionality allows users to send a refund request email to the Finance Department when a partial Credit Note has been issued. issued for a cancelled invoice. 

 **_Note that the The MFreight system does not process the refund itself._** itself. It only notifies Finance and records the request for tracking and audit purposes. 

 This functionality applies to: 

 * Ocean Module 
 * Air Module 

 The Refund Request will follow the same rules already implemented in the Ocean module, with enhancements for tracking and status visibility. 

 #### 1. Preconditions 

 A refund request can only be created when all conditions below are met: if: 

 1. The invoice status = Cancelled 
 2. A Credit Note exists for the full invoice amount 
 2. The Credit Note is PARTIAL (i.e., Credit Note Amount \< Invoice Amount) 
 3. A payment has been recorded against the invoice initial invoice. 
 4. Refundable Amount \> 0 
 5. A refund request has not already been sent 

 If any of these conditions are not met, the Send Refund Request button must not be available. 

 A refund request can ONLY be sent if Refundable Amount \> 0. 

 #### 2. Refundable Amount Rule 

 The system must calculate the following: 

 Refundable Amount = MIN(Credit Note Amount, Available Refund Balance) 

 Rules: 

 * Refund request allowed only if Refundable Amount \> 0 
 * Refund amount must never exceed Available Refund Balance 

 ##### 2.1 Total Amount Paid (Invoice Level) 

 Total amount received against the invoice. 

 ##### 2.2 Total Refund Requested 

 Sum of all refund requests created for: 

 * All Credit Notes linked to the same invoice 
 * Regardless of whether they were sent or resent 

 ##### 2.3 Available Refund Balance 

 Available Refund Balance = Total Amount Paid – Total Refund Requested 

 ##### 2.4 If Available Refund Balance = 0 

 Then: 

 * Send Refund Request button must be disabled 
 * System must display: 

 No refundable balance available for this invoice. 

 ##### 2.5 If Credit Note Amount \> Available Refund Balance 

 Then: 

 * System must automatically limit Refundable Amount 
 * User must NOT be allowed to override the amlunt in the email popup 

 #### 3. Credit Note Retrieve Screen Enhancement 

 1. The Credit Note Retrieve Screen must include two additional columns: 

 | Column | Description | 
 |--------|-------------| 
 | Amount Paid | Total payment received | 
 | Refundable Amount | Amount for refund | 
 | Available Refund Balance | Remaining refundable amount | 
 | Refund Status | Indicates whether a refund request has already been sent | 
 | Download / Preview Refund Request | Allows the user to view or download the PDF sent to the recipient and allows sending the request again. | 

 ##### Example UI - Additional columns 

 | CRN | Invoice | .... | CN Amount | Paid | Refundable | Available Balance | Action | 
 |-----|---------|------|-----------|------|------------|-------------------|--------| 
 | CRN1 | INV01 | .... | 30,000 | 80,000 | 30,000 | 50,000 | Send | 
 | CRN2 | INV01 | .... | 40,000 | 80,000 | 40,000 | 10,000 | Send | 
 | CRN3 | INV01 | ... | 30,000 | 80,000 | 10,000 | 0 | Send (limited amount) | 

 2. Add a filter by Refund Status: \[All | Requested | Not Requested\] 

 #### 4. 3. Refund Request Status 

 The Credit Notes for which payment has already been made against the invoice must include a Refund Request Status field. 

 Possible values: 

 | Refund Status | Description | 
 |---------------|-------------| 
 | Not Requested | No refund request has been sent | 
 | Requested | Refund request has been sent to Finance | 

 **Default value:** 

 Not Requested 

 #### 5. 4. Functional Behaviour 

 ##### 5.1 #### Send Refund Request 

 A "Send Refund Request" button should be visible available on the Credit Note screen only if: 

 * A if a payment exists for the related invoice 
 * Refund Status = Not Requested invoice. 

 When the user clicks the button: 

 1. The system performs validation. 
 2. If validation succeeds, an email popup window is displayed. 

 ##### 5.2 Email Popup 

 The popup must contain the following: 

 This section should be displayed clearly on top and be read only. 

 Credit Note Ref : MACCS26CRN01057\ | Field | Description | Required | 
 Invoice Ref : MACCS26INV02326\ |-------|-------------|----------| 
 Customer : ABC Logistics Ltd\ 
 Currency : MUR\ 
 Credit Note Amount : 30,000.00\ 
 Amount Paid : 80,000.00\ 
 Refundable Amount : 30,000.00 or less depending on the available refund amount 

 <table> 
 <tr> 
 <th>Field</th> 
 <th>Description</th> 
 <th>Required</th> 
 </tr> 
 <tr> 
 <td>Email To</td> 
 <td> 

 | Email To | Finance department email 

 user can enter 1 or several emails | Yes | 
 </td> 
 <td>Yes</td> 
 </tr> 
 <tr> 
 <td>Email CC</td> 
 <td>Optional | Email CC | Optional additional recipients</td> 
 <td>No</td> 
 </tr> 
 </table> recipients | No | 

 3. Once the user clicks "Send Email": 

 The system must: 

 1. Send the email to the recipient provided. This will be same as in current process in the ocean module. 
 2. Update the refund request information. 

 ##### 5.3 Email 

 Enhance the existing email structure. 

 **Current:** 

 ![image.png](/uploads/3e7f0fbd652e84297a0ffeffbc14643f/image.png){width="461" height="209"} 

 **Enhancement:** 

 **Subject:** 

 Refund Request – Credit Note \<CRN Ref\> 

 **Body:** 

 Greetings, 

 Please process the refund request for the below credit note. 

 Credit Note : \<CRN Ref\> 

 Invoice : \<Invoice Ref\> 

 Customer : \<Customer Info\> 

 Credit Note Amount : MUR 30,000.00\ 
 Amount Paid : MUR 80,000.00\ 
 Refundable Amount : \<Amount\> 

 The following information must be recorded: 

 | Field | Description | 
 |-------|-------------| 
 | Refund Request Status | Requested | 
 | Refund Request Date | Date request was sent | 
 | Refund Requested By | System user | 
 | Email Sent To | Finance email | 
 | Email CC | CC emails | 
 | Refundable Amount | Amount | 

 4. Once a refund request has been sent: 

 * The Refund Request Status column must display "Requested" 
 * The Send Refund Request button must be hidden or renamed to "Resend Refund Request" disabled 
 * Show buttons: 
   * Preview / Download Refund Request 
 * The following information must be available via tooltip on hover: 

   | Tooltip Information | 
   |---------------------| 
   | Refund Request Date | 
   | Refund Requested By | 
   | Email Sent To | 
   | Refundable Amount | 


 **Example tooltip:** 

 Refund Requested On: 26-01-2026\ 
 Requested By: supervisor\ 
 Email Sent To: finance@maccs.mu 

 Refundable Amount: MUR 5000 

 #### 6. Resend Refund Request 

 Allow the user to resend the same request if the email was not received. 

 ##### Preconditions 

 * Refund Status = Requested 

 ##### Process 

 1. User clicks Resend Refund Request 
 2. The system opens email popup 
 3. The user enters the email address 
 4. Email is resent 

 ##### Outcome 

 * Refund status remains Requested 
 * Last Refund Request Date updated 
 * Last Refund Requested By updated 
 * Activity log updated 

 #### 7. Activity Log 

 All refund request actions must be recorded in the Activity Log. 

 The system must log the following information: 

 <table> 
 <tr> 
 <th> 

 **Activity Date & Time** 
 </th> 
 <th> 

 **Activity By** 
 </th> 
 <th> 

 **Activity** 
 </th> 
 </tr> 
 <tr> 
 <td>26-01-2026 13:38</td> 
 <td>supervisor</td> 
 <td> 

 Refund Request sent to \<Email Recicipient\> for \<Credit Note Refrence\> - Amount \<Currency\>\<Refundable Amount\> 

 e.g, Refund Request sent to Jack@gmail.com for MACCS26CRN01057 - Amount MUR 5000. MACCS26CRN01057. 
 </td> 
 </tr> 
 </table> 

 **_Note Note that the activity log will not be on this screen; instead, all logs will be updated on the invoice screen to their corresponding invoice._** invoice. 

 \ 
 **Acceptance Criteria** 

 * A Refund refund request is can only allowed for partial credit notes be sent once per Credit Note 
 * The system validates Credit Note status before sending request 
 * Refund request only available if payment exists 
 * Total refund must never exceed total amount paid 
 * System must block refund if no balance remains 
 * The system records request date,user and email recipients 
 * Refund Request Status visible in the Credit Note screen only if if payment exists 
 * Send Refund request can be resent multiple times 
 * Resend must not create a new request record 
 * Refund Status visible in screen 
 * Available Refund Balance must be visible 
 * Refund amount must be automatically adjusted if needed 
 * User cannot override refund amount 
 * Validation must consider all previous refund requests 
 * Send Request button hidden disabled after first send 
 * Resend button available after first send 
 * Tooltip shows request details + amount is sent 
 * Email popup displayed for inputting recipient details before sending request 
 * Activity log created for refund request event and available in Invoice screen 
 * Activity log updated for both send and resend 

 #### Example Scenario 1 

 1. Partial Credit Note Invoice **MACCS26INV02326** is issued for Invoice MACCS26INV02326. cancelled. 
 2. Partial Credit Note MACCS26CRN02063 **MACCS26CRN02063** is issued. 
 3. Payment already exists for the invoice. 
 4. User clicks Send **Send Refund Request. Request**. 
 5. Email popup appears. 
 6. User enters email and sends request. 

 * Invoice = Rs 100,000 
 * Payment received = Rs 80,000 
 * Credit Note issued = Rs 30,000 (Partial) 

 The system calculates: 

 Refundable Amount = 30,000 

 #### Example Scenario 2 

 ##### Initial State 

 * Invoice = 100,000 
 * Payment = 80,000 

 ##### Credit Notes 

 | Credit Note | Amount | 
 |-------------|--------| 
 | CN1 | 30,000 | 
 | CN2 | 40,000 | 
 | CN3 | 30,000 | 

 ##### System Behaviour outcome: 

 | CN | Refund Allowed | 
 |----|----------------| 
 | CN1 | 30,000 | 
 | CN2 | 40,000 | 
 | CN3 | 10,000 | 

 ### Final State 

 * Total Refund Requested = 80,000 
 * Available Balance = 0 

 **System outcome:** 

 * Email sent to recipient 
 * Refund Request Status = Requested **Requested** 
 * Request date and relevant details stored in the system. system 
 * Activity log updated 
 * No duplicate request created 

 **_Note that if there are multiple partial credit notes, the system MUST ensure that Total Refund Requested ≤ Total Amount Paid; otherwise, there is the risk of Over-refunding clients_**

Back