I'm trying to implement a little thing that was requested by a client.

They would like to see the tax/vat totalized per tax-rule (they are using the uc_vat and uc_vat_taxonomy modules) right under the order lines.

I've already added the fields I needed to the orderlines-view, and made the excluded, so that I can totalize them in $static by using php-code in the field.
Here's what I have so far:

print uc_price($data->uc_order_products_qty * $data->uc_order_products_price);
$static->taxes[$data->uc_order_line_items_tax_title] += $data->uc_order_line_items_tax_amount;
$static->shipping[$data->uc_order_line_items_shipping_title] += $data->uc_order_line_items_shipping_amount;

Note that the first line is to allow me to display a subtotal per product on each line.
The next to lines should give me the values I need in the $static.

Here's where I'm stuck at the moment: I thought that by using these static-items in de pdf_invoice view that I would be able to display them there right before the order total....
But it looks like the $static is only available within the same view, and not upon returning.

Can anybody kick me in the right direction?

Comments

abeltov’s picture

Hi! I have the same problem, but I also want to display the subtotal of the order.
How you could resolve it?

Thanks and regards!

abeltov’s picture

Issue summary: View changes

typo made in code =+ -> +=