web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

facing an issue while completing the payment for a return order

(3) ShareShare
ReportReport
Posted on by 30

I'm facing an issue while completing the payment for a return order. The system is throwing the following exception:

"Not more than 0.00 can be reversed."

"The refund invoice total 522.58 is greater than the total refundable amount 493.00."

 

Could you please help me understand and resolve this?
public void createCallCenterReturnPayment(SalesId _returnsalesId,SalesId _origSalesTable)
{
MCRCustPaymTable mcrCustPaymTable,origMcrCustPaymTable;
SalesTable returnSalesTableBuf = SalesTable::find(_returnsalesId);
SalesTable origSalesTableBuf = SalesTable::find(_origSalesTable);
RetailChannelTable retailChannelTable;

select firstonly retailChannelTable
where retailChannelTable.RecId == returnSalesTableBuf.RetailChannelTable;

if(retailChannelTable.ChannelType == RetailChannelType::MCRCallCenter)
{
MCRCustPaymStatus mcrCustPaymStatus = MCRCustPaymStatus::NotSubmitted;

SalesTotals salesTotals = salesTotals::construct(returnSalesTableBuf,SalesUpdate::All);
Total totalAmount = salesTotals.totalAmount();
//Total totalAmount1 = salesTotals.totalAmount() - salesTotals.totalMarkup() - salesTotals.totalTaxAmount();

select firstonly origMcrCustPaymTable
where origMcrCustPaymTable.RefTableId == origSalesTableBuf.TableId
&& origMcrCustPaymTable.RefRecId == origSalesTableBuf.RecId;

try
{
ttsbegin;
mcrCustPaymTable.clear();
mcrCustPaymTable.Channel = returnSalesTableBuf.retailSalesTable().RetailChannel;
mcrCustPaymTable.CurrencyCode = returnSalesTableBuf.CurrencyCode;
mcrCustPaymTable.TenderTypeId = "2";
mcrCustPaymTable.RefTableId = returnSalesTableBuf.TableId;
mcrCustPaymTable.RefRecId = returnSalesTableBuf.RecId;
mcrCustPaymTable.CustAccount = returnSalesTableBuf.CustAccount;
mcrCustPaymTable.OrigRefundRecID = origMcrCustPaymTable.RecId;
mcrCustPaymTable.Status = mcrCustPaymStatus;
mcrCustPaymTable.CustPaymType = MCRCustPaymType::RefundCheck;

switch (mcrCustPaymStatus)
{
case MCRCustPaymStatus::NotSubmitted:
case MCRCustPaymStatus::Authorized:

mcrCustPaymTable.Amount = CurrencyExchange::round(totalAmount, returnSalesTableBuf.CurrencyCode);
break;
}

mcrCustPaymTable.insert();
ttscommit;

MCRSalesOrderTotals mcrSalesOrderTotals = new MCRSalesOrderTotals(returnSalesTableBuf, true);
//complete
MCREndOrder::endOrder(returnSalesTableBuf.SalesId, true, mcrSalesOrderTotals, false);

}
catch
{
Error("@BASIS_SOCancellation:NewLabel1");
}
}
}

Categories:
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,538 Super User 2025 Season 2 on at
    Good morning, afternoon, or evening depending on your location!
     
    Based on the error message, the issue seems to be related to the refund amount exceeding the refundable limit. Here are some steps to troubleshoot --
    Possible Causes & Solutions:
    1. Mismatch Between Refundable Amount and Invoice Total:
      • The system is preventing a refund greater than the allowable amount. Verify the original transaction details to ensure the refund amount aligns with the expected refundable value.
    2. Check Refund Calculation Logic:
      • In your code, totalAmount is being used to determine the refund. Ensure that the calculation correctly considers discounts, taxes, and adjustments.
      • You might need to subtract markup and tax amounts explicitly to avoid exceeding the refundable limit.
    3. Validate Payment Table Entries:
      • Ensure that OrigRefundRecID correctly references the original payment record. If the system is unable to match the refund to the correct transaction, it may trigger this error.
    4. Review Currency Rounding:
      • The rounding logic in CurrencyExchange::round(totalAmount, returnSalesTableBuf.CurrencyCode) might be causing a slight discrepancy. Try manually verifying the rounded values before inserting the payment record.
    5. Check System Configuration for Refund Limits:
      • Some configurations in Dynamics 365 Finance and Operations enforce refund limits. Check if there are any restrictions set in the Accounts Payable or Retail Payment Setup modules.
    Next Steps:
    • Try adjusting the refund calculation to ensure it does not exceed the refundable amount.
    • If the issue persists, check the transaction history for discrepancies in the original purchase and refund records.
    • If needed, manually adjust the refund amount to match the allowable limit before processing the payment.
     
    Hope this is helpful :)
  • Jonas "Jones" Melgaard Profile Picture
    4,986 Most Valuable Professional on at
     
    My advice is to debug this, it's difficult to troubleshoot without having access to your application.
    If you are unsure where to place your breakpoint, start by placing it in info.add.
     
    Have you tried to debug it?
  • Suggested answer
    Ramesh Kumar Profile Picture
    7,529 Super User 2025 Season 2 on at
    I agree with what Jones mentioned — it's difficult to understand the issue without access to the environment. You’ll need to collaborate with a developer to investigate further.
     
    Thanks
    Ramesh
     
    If this was helpful, please check the "Does this answer your question?" box and mark it as verified.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 301 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 118 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans