Magento – Incorrect Subtotal calculated

Update vom 24.02.2014

Even with Magento 1.8.1.0 This problem exists even. But it fell so far only in connection with the delivery of extension at an additional fee was calculated. We now have concerning whether the below possible solution. made the code change and not copied the other version of the file.

Once again a Magentophänomen:

An order has been generated. There is not an invoice. Until now, everything looks good. Subtotal is correct, Tax is correctly, Overall result is correct.

If one then “Account” click, An incorrect subtotal displayed. Then the invoice will be generated, is also available on the PDF invoice the wrong subtotal.

To fix this, I have the file from the folder subtotal.php /app / code / core / Mage / Sales / Model / Open Order / Invoice / Total, and then about. in line 64

if ($invoice->isLast()) {
$subtotal = $allowedSubtotal;
$baseSubtotal = $baseAllowedSubtotal;
$subtotalInclTax = $allowedSubtotalInclTax;
$baseSubtotalInclTax = $baseAllowedSubtotalInclTax;

to

if ($invoice->isLast()) {
$subtotal = $allowedSubtotal;
$baseSubtotal = $baseAllowedSubtotal;
/*$subtotalInclTax = $allowedSubtotalInclTax;*/
$baseSubtotalInclTax = $baseAllowedSubtotalInclTax;

change. Then save, Upload and possibly. Reload cache. To make the whole upgradable and not to play directly in the core, best to copy the full path in your own Mage / Sales / Model / Order / Invoice / Total in local folder and not in the core.

Another solution, I have, however, been tested only slightly: The subtotal.php from Magento 1.7.0.2 use (BACKUP the old version!). I have them here once attached as Zip (do not take any warranty, best code view and manually inputting of) Subtotal

Invoices, which has already been generated, are not changed. This would have played in the database are. New accounts are now created correctly but.

Used in Magento Version 1.5.1.0 Comments? Additions? Notes? Gladly!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

9 comments on “Magento – Incorrect Subtotal calculated”

  1. No, at 1.7. Sry, was hoping, that for even 1.7 works, because after
    same error appears. You do not know what happened to the error in 1.7 ?

  2. Hi,

    I have an update from 1.4.2 on 1.7.0.2 accomplished. The taxes I have with no further extensions as, as in the RackSpeed ​​Guide (http://rackspeed.de/forum/magento-faq-backend/mwst-deutschland-einrichten-21) described. But now I have the problem, that the control is not displayed correctly in the cart and in the checkout, but will be deducted multiple times:


    Subtotal 238,00 €
    Total excl. VAT. 162,00 €
    Tax 38,00 €
    Total included. VAT. 200,00 €

    What I have set wrong and how to fix it?

    Regards

    Hahni

    1. Hmmm, that is without insight into the system hard to say. Various sources of error are often the definition, whether it is registered with the backend gross prices- or net values ​​are, as the Shipment is considered, how to calculate and how detailed calculation should be etc.

  3. Hi,

    Thanks for the above tips. You had indeed indicated, that older invoices can be matched only by database modifications. Since I currently but would have to print previous invoices to document purposes: there is not the opportunity for these temporary expression of the subtotal to the shipping costs VAT. to reduce? For feedback, I would be extremely grateful.

    Kind regards,
    Marcus

    1. Hi, at first would not even occur to me here, how to do that later “quickly” could adapt. If there are very many orders, then you could possibly orders including. Positionen etc. export and a series document the bills eg. to generate in Excel? Had there so ad hoc no better idea and also this is just an idea 🙂 Maybe it helps but.

  4. of, okay. That would actually but a solution which should give me.

    Thanks in any case for the tip,
    Reading your blog always eager.

    Kind regards,
    Marcus

  5. Pah ich dachte schon ich steh auf Mond weil plötzlich die Nachnahmerechnungen ne höhere Zwischensumme ausgewiesen hatte, kurz gegoggelt, found it here, eingebaut, runs. 1.8.1.0

    THANK YOU!!

Leave a Reply

Your email address will not be published. Required fields are marked *