@xen.dk@drupal.org: How far are you? This development sounds very interesting to me.
My opinion about what we really need to display taxes:
- First issue is about rounding on a per product/item base, so this means in uc_taxes_workflow.inc 3 if/else statements. That simple if you know where it happens. To get an idea what about it should look like see the attached patch
- Next is for discussion: To get the taxed Subtotal for the checkout process I added 3 lines in uc_cart_checkout_pane.inc. Target is to collect the subtotal where I already have the values taxed (through my module) and save it in a $_SESSION['taxed_subtotal']. This works now already 2 or 3 weeks without any issues for me. Maybe this could be done by a module also, but not in 3 lines.
- Probably not a much bigger thing, but I still didn't have time to look into it how it could be done: In the order we need for every product and every line-item the tax rate(s) at time the order was submitted. Tax rates are no diamonds, so this is needed to get old orders displayed right if tax rates changed.
- Where I am totally lost are the 2 Javascripts on /checkout: Both should save the values without tax (as is), but call Workflow-ng for the tax rules and then display the taxed values. This any solution will need. If someone has a better relationship with JS than me and wants to help out - you are warmly welcome!!!
- If we talk about Europe I would like to mention that currencies still are a very big issue, so my +1 for xen.dk@drupal.org's efforts or I start in a couple of weeks a thread about "opening uc_currency_formt()".

To get things finally started independent on which module base this are the basic requirements. More core support or a more sophisticated approach would make our life easier for keeping our module up to date, but only the above things are the real show stoppers.
Ok, from whatever reason the second patch doesn't generate, so inline. Sorry. Base is uc_taxes_workflow.inc, v 1.1.2.5 2008/04/23 19:38:13
line 89
<?php
$amount += $item->price * $item->qty * $tax->rate;
?>gets line 89-95
<?php
// EU support
if (variable_get('uc_taxes_per_item', '0')) {
$amount += round($item->price * $tax->rate, variable_get('uc_currency_prec', '2')) * $item->qty;
}
else {
$amount += $item->price * $item->qty * $tax->rate;
}
?>line 101
<?php
$amount += $line_item['amount'] * $tax->rate;
?>gets line 108-114
<?php
// EU support
if (variable_get('uc_taxes_per_item', '0')) {
$amount += round($line_item['amount'] * $tax->rate, variable_get('uc_currency_prec', '2'));
}
else {
$amount += $line_item['amount'] * $tax->rate;
}
?>line 107
<?php
$amount += $other_tax['amount'] * $tax->rate;
?>gets line 122-128
<?php
// EU support
if (variable_get('uc_taxes_per_item', '0')) {
$amount += round($other_tax['amount'] * $tax->rate, variable_get('uc_currency_prec', '2'));
}
else {
$amount += $other_tax['amount'] * $tax->rate;
}
?>| Attachment | Size |
|---|---|
| uc_cart_checkout_pane.inc_.patch | 1.08 KB |


