exactly which values ?
tax per each product ?
tax on total ?
Printable View
exactly which values ?
tax per each product ?
tax on total ?
Rumbling along.... It would seem like - in edit_orders.php - that it would be smarter to use table orders_products instead of table orders_total, because the former contains real tax values. Assuming one wants to solve the problem!
Forgot to mention that "order totals" is the area, which doesn't work! Every different tax class has the same value. It is the correct value for one of the tax classes, but now it's "everywhere".
Somewhere in the old support thread are Scott's old messages on taxes and Edit Orders WHY it's not as "easy" a fix as it appears (and thus why he did not address this). If I get some time I'll try to look them up and post 'em (I may have already post some of these links here). If you want a FULL understanding of the issue, you should search the old support thread for the search terms "taxes" and "sturner"..
OK, but using table orders_products instead of table orders_total to keep the taxes apart, would seem a good way to go!? What then remains is to update the table orders_total with the new values. Yes?
can u show an example of how u want the total to display ?
Because im not understanding what you are trying to acheive.
Do u want to use different tax classes for the products or display different (multiple) tax totals ?
In the current edit_orders it will only display 1 tax total called "ot_tax", as it overwrites.
edit_orders 3.5
PHP Code:
if ($sendtotaltoorders == 2) {
// Update Taxes in TABLE_ORDERS
$Query = "UPDATE " . TABLE_ORDERS . " SET order_tax = '".ot_value."' WHERE orders_id = '".$oID."'";
//die("Line:954: ".$Query);
$db -> Execute($Query);
}
from orders.php
PHP Code:
/*********************************************
* Calculate taxes for this product
*********************************************/
$shown_price = (zen_add_tax($this->products[$index]['final_price'] * $this->products[$index]['qty'], $this->products[$index]['tax']))
+ zen_add_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']);
$this->info['subtotal'] += $shown_price;
$this->notify('NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE', array('shown_price'=>$shown_price));
// find product's tax rate and description
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
if (DISPLAY_PRICE_WITH_TAX == 'true') {
// calculate the amount of tax "inc"luded in price (used if tax-in pricing is enabled)
$tax_add = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
} else {
// calculate the amount of tax for this product (assuming tax is NOT included in the price)
// $tax_add = zen_round(($products_tax / 100) * $shown_price, $currencies->currencies[$this->info['currency']]['decimal_places']);
$tax_add = ($products_tax/100) * $shown_price;
}
$this->info['tax'] += $tax_add;
foreach ($taxRates as $taxDescription=>$taxRate)
{
$taxAdd = zen_calculate_tax($this->products[$index]['final_price']*$this->products[$index]['qty'], $taxRate)
+ zen_calculate_tax($this->products[$index]['onetime_charges'], $taxRate);
if (isset($this->info['tax_groups'][$taxDescription]))
{
$this->info['tax_groups'][$taxDescription] += $taxAdd;
} else
{
$this->info['tax_groups'][$taxDescription] = $taxAdd;
}
}
/*********************************************
* END: Calculate taxes for this product
*********************************************/
$index++;
}
https://www.parempikauppa.fi/uploads/products/taxes.jpg
Yes, we do have 4 different tax classes. The only one in the picture that should contain a value other than 0 is "13%".
.. i can fix that. (will need array dumps or dev access)
Are you having the following issue:
after you edit the order, the tax values get changed / overwritten ?
Again you should find Scott's old posts on this topic.. there is a VERY GOOD reason why this doesn't work the way YOU think it should work.. Now I don't remember all details of these old posts, but I do remember that multiple taxes appeared to be a LOT MORE complicated to resolve and that's why Scott never tackled it..
Are you having the following issue:
after you edit the order, the tax values get changed / overwritten ?
Might be, but then again maybe not... I assume "can be done" if I don't see any major flaw. Tax info is per product and the necessary tax values are saved in orders_products for each product. Updating the orders_total is the only hassle!Quote:
... there is a VERY GOOD reason why this doesn't work the way YOU think it should work ...
What exactly are you going to fix? A new version of edit_order.php would seem enough.Quote:
.. i can fix that. (will need array dumps or dev access)
Didn't see your code examples before - current question "3.5"? I'm using Edit Orders V3.03!Quote:
edit_orders 3.5