it4mage / CashOnDelivery

Cash on delivery module for Magento 2
25 stars 19 forks source link

Price in Sales Order and Backend is wrong when exclude taxes #4

Open giacmir opened 6 years ago

giacmir commented 6 years ago

From @zenomordiante on February 26, 2018 9:21

ON it4mage page we can not open Issue.

Preconditions

  1. Magento 2.2.2
  2. Fee is 6€ Taxes included
  3. Check on Delivery csv: country,region,from_amount,fee,website ,,0.0000,4.92,*

Steps to reproduce

  1. I have set to display Subtotals Excluded taxes as: schermata 2018-02-26 alle 10 16 54

schermata 2018-02-26 alle 10 17 01

Expected result

  1. Price in cart and checkout is ok, but in Backend orders and Sales mail is wrong

Actual result

  1. CHECKOUT IS OK img-7381

  2. SALES MAIL IS WRONG img-7383

  3. BACKEND AREA ORDER IS WRONG img-7382

  4. TOTALS IS OK

_Copied from original issue: magespecialist/m2-MSPCashOnDelivery#58

syabdullah commented 5 years ago

Hello

I Solve this issue :

1- please go to

msp/cashondelivery/Block/Sales/Cashondelivery.php

change line 48 ` - to +
From
'value' => $source->getBaseMspCodAmount() - $source->getBaseMspCodTaxAmount(), To 'value' => $source->getBaseMspCodAmount() + $source->getBaseMspCodTaxAmount(),

this it will fix the price on order page and mail.


To Get Base price with tax Tax in customer order page 'value' => $source->getBaseMspCodAmount() + $source->getBaseMspCodTaxAmount(),

To Get Base price without tax in customer order page 'value' => $source->getBaseMspCodAmount() , `*** 2- Show price with tax or without tax in checkout page

go to

msp/cashondelivery/Model/Total/Quote/Cashondelivery.php

Change in line 100 from From : without tax 'value' => $total->getBaseMspCodAmount() , To: with tax 'value' => $total->getBaseMspCodAmount() + $total->getBaseMspCodTaxAmount(),


Abdullah Almohammad