
Originally Posted by
murrah
I seem to have fixed the problem where the tax on the order lines was rounding to 00 ...
Thanks Murray, your a legend. That fixed the Tax on mine that was also rounding to 0.
What are the other rounding problems you are talking about when using Product Line Items option? I've noticed that when there is an item with quantity greater than 1, the calculation for "Total" is incorrect due to the fact that the "Base Price" is not rounded before multiplying by the quantity. I just added PHP round function to the calculation for 'total' array value.
I also changed 'base_price' array value to use $final_price instead of $products->fields['products_price']. This fixes my problem with products that are priced by attribute.
See code below for changes.
admin/includes/classes/sales_report.php - lines 330 - 337
Code:
$this_product = array('id' => $pID,
'name' => $products->fields['products_name'],
'model' => $model,
'base_price' => $final_price,
'quantity' => $quantity,
'tax' => $product_tax,
'onetime_charges' => $onetime_charges,
'total' => ( (round($final_price,2) * $quantity) + $onetime_charges) );
I'm still testing Sales Reports. I've got to make some changes to the calculations for Order Line Items as well. My shipping value on my site includes Tax, so for Sales Reports I will need to remove tax for it's calculations. This will only affect you if you have setup your store like mine.
Also watch the admin console timing out. Sales Reports makes no indication that it has happened, it just stops returning new data, just keeps returning the same old stale data.
Bookmarks