lsretailomni/lsmag-two

Partial invoice and Partial refund

Closed this issue · 3 comments

Preconditions (*)

When the order has multiple items, and you try to create a partial invoice and partial refund, the invoice total or credit memo will be calculated in a wrong way

Steps to reproduce (*)

  1. Create an order with multiple items
  2. Create a partial invoice or Partial refund

Expected result (*)

  1. Total calculation is correct

Actual result (*)

  1. Total calculation is wrong

Code that causes the issue:
for invoice: src/Omni/Model/Invoice/Total/GiftCardLoyaltyPoints.php
for a refund: src/Omni/Model/Creditmemo/Total/GiftCardLoyaltyPoints.php

$grandTotalAmount = $invoice->getOrder()->getGrandTotal();
$baseGrandTotalAmount = $invoice->getOrder()->getBaseGrandTotal();
$invoice->setGrandTotal($grandTotalAmount); // we are re-seting grand total from order regardles the items we are invpoicing
$invoice->setBaseGrandTotal($baseGrandTotalAmount); // we are re-seting base grand total from order regardles the items we are invoicing

Hi @sergii-zheleznytskyi ,

Thanks for sharing the details, we are currently looking into it and will get back to you on this shortly.

Hello @lsretailomni
Do you have an updates on the issue?

@sergii-zheleznytskyi this has been fixed and released in 1.9.0.