lsretailomni / lsmag-two

LS Ecommerce - Magento, an ecommerce interface for integrating Magento with LS Central.
https://www.lsretail.com/
10 stars 16 forks source link

Partial invoice and Partial refund #35

Closed sergii-zheleznytskyi closed 3 years ago

sergii-zheleznytskyi commented 3 years ago

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

lsretailomni commented 3 years ago

Hi @sergii-zheleznytskyi ,

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

sergii-zheleznytskyi commented 3 years ago

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

lsretailomni commented 3 years ago

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