Task #19481
openTask #19558: Sprint Planning for 23/03/2026 - 30/03/2026
Refund Request for Air
17%
Description
A refund request is sent to the Finance Department when a partial credit note is issued against an invoice, 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.
Note that the MFreight system does not process the refund 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:
- A Credit Note exists
- The Credit Note is PARTIAL (i.e., Credit Note Amount < Invoice Amount)
- A payment has been recorded against the invoice
- Refundable Amount > 0
- 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¶
- 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) |
- Add a filter by Refund Status: [All | Requested | Not Requested]
4. 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. Functional Behaviour¶
5.1 Send Refund Request¶
A "Send Refund Request" button should be visible on the Credit Note screen only if:
- A payment exists for the related invoice
- Refund Status = Not Requested
When the user clicks the button:
- The system performs validation.
- 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
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
| Field | Description | Required |
|---|---|---|
| Email To |
Finance department email user can enter 1 or several emails |
Yes |
| Email CC | Optional additional recipients | No |
- Once the user clicks "Send Email":
The system must:
- Send the email to the recipient provided. This will be same as in current process in the ocean module.
- Update the refund request information.
5.3 Email¶
Enhance the existing email structure.
Current:
{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 |
- 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"
-
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¶
- User clicks Resend Refund Request
- The system opens email popup
- The user enters the email address
- 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:
|
Activity Date & Time |
Activity By |
Activity |
|---|---|---|
| 26-01-2026 13:38 | supervisor |
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. |
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.
Acceptance Criteria
- A Refund request is only allowed for partial credit notes
- 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
- 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 button hidden after first send
- Resend button available after first send
- Tooltip shows request details + amount
- 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¶
- Partial Credit Note is issued for Invoice MACCS26INV02326.
- Partial Credit Note MACCS26CRN02063 is issued.
- Payment already exists for the invoice.
- User clicks Send Refund Request.
- Email popup appears.
- 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¶
| 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
- Request date and relevant details stored in the 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
GitLab Sync Log
[{"id": "39682", "author": "Nihaal Ramfoll", "hours": 2.0, "created": "2026-03-04T06:09:13.131Z", "log_date": "2026-02-26", "comment": "Imported from GitLab by @Nihaal Ramfoll on 2026-03-04T06:09:13.131Z: 2h-(2.0)h spend at: 2026-02-26", "status": "active", "deleted_by": "", "redmine_entry_id": 12497}, {"id": "40698", "author": "Nihaal Ramfoll", "hours": 1.0, "created": "2026-03-23T07:00:39.888Z", "log_date": "2026-03-23", "comment": "Imported from GitLab by @Nihaal Ramfoll on 2026-03-23T07:00:39.888Z: 1h-(1.0)h spend at: 2026-03-23", "status": "active", "deleted_by": "", "redmine_entry_id": 12704}, {"id": "41374", "author": "Nihaal Ramfoll", "hours": 2.0, "created": "2026-04-01T05:40:18.323Z", "log_date": "2026-03-23", "comment": "Imported from GitLab by @Nihaal Ramfoll on 2026-04-01T05:40:18.323Z: 2h-(2.0)h spend at: 2026-03-23", "status": "active", "deleted_by": "", "redmine_entry_id": 12858}, {"id": "44798", "author": "Nihaal Ramfoll", "hours": 1.0, "created": "2026-05-20T11:00:17.396Z", "log_date": "2026-05-20", "comment": "Imported from GitLab by @Nihaal Ramfoll on 2026-05-20T11:00:17.396Z: 1h-(1.0)h spend at: 2026-05-20", "status": "active", "deleted_by": "", "redmine_entry_id": 13689}]