Skip to content

Commit

Permalink
Merge branch 'bugfix/set-tax-invoiced' into release-week-22
Browse files Browse the repository at this point in the history
  • Loading branch information
michielgerritsen committed May 31, 2021
2 parents 508bfc1 + deb9457 commit c0619ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/code/community/Mollie/Mpm/Model/Client/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,11 @@ public function createShipment(Mage_Sales_Model_Order_Shipment $shipment, Mage_S
$payment->setTransactionId($transactionId);
$payment->registerCaptureNotification($captureAmount, true);

// Set the tax_invoiced and base_tax_invoiced. Normally this is done by calling $invoice->register(),
// but because the invoice is already exists this does not work. So, set it manually.
$order->setTaxInvoiced($order->getTaxInvoiced() + $invoice->getTaxAmount());
$order->setBaseTaxInvoiced($order->getBaseTaxInvoiced() + $invoice->getBaseTaxAmount());

foreach ($invoice->getAllItems() as $item) {
if ($item->getQty() > 0) {
$item->register();
Expand Down

0 comments on commit c0619ff

Please sign in to comment.