Jump to content

Shipping cost add to total tax amount


Recommended Posts

Hi,
I have one problem, how to add shipping cost in to generated invoice pdf?

Now, just after pressing order (tab) -> order -> shipping price (button) that button shipping cost adds to amount where counting tax (21%).

 

example, what is now:

total products (tax. excl.) = 424,80

total shipping (tax. excl.) = 39,67  <where tax incl. = 48>

total (tax excl.) = 464,47

PVM / VAT (21%) = 89,21 (there tax is counting from  424,80 * 21% = 89,21)

Total (tax incl.) = 562,00

 

I need:

total products (tax. excl.) = 424,80

total shipping (tax. excl.) = 39,67  <where tax incl. = 48>

total (tax excl.) = 464,47

PVM / VAT (21%) = 97,53  (464,47 * 21% = 97,53)

Total (tax incl.) = 562,00

I don't need to do that after pushing  "change button" on shipping price, how is it now. Tried to modify  TaxCalculator.php.

$total_shipping = (double) $_POST['shipping_cost'];
foreach ($this->taxes as $tax)
        {
            if ($this->computation_method == TaxCalculator::ONE_AFTER_ANOTHER_METHOD)
            {
                $taxes_amounts[$tax->id] = $price_te * (abs($tax->rate) / 100);
                $price_te = $price_te + $taxes_amounts[$tax->id];
            }
            else
                $taxes_amounts[$tax->id] = ($price_te * (abs($tax->rate) / 100))+$_POST['shipping_cost'];
        }

I need to show  all taxes from product and shipping together. How to do that.

Edited by Dzinyna (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...