Hi!
after searching around for hours and with a hint from Jan I did the changes by myself:
Edit file /plugins/phocapdf/virtuemart/virtuemartpdfoutput.php
search the following lines:
Code: Select all
$price_with_tax['item'] = $value->product_final_price;
$price_with_tax['sum'] = $value->product_final_price * $value->product_quantity_delivered;
$price_without_tax['item'] = $value->product_item_price;
$price_without_tax['sum'] = $value->product_item_price * $value->product_quantity_delivered;
$price_tax['item'] = $price_with_tax['item'] - $price_without_tax['item'];
$price_tax['sum'] = $price_with_tax['sum'] - $price_without_tax['sum'];
$without_tax['item_total'] += $price_without_tax['sum'];
$with_tax['item_total'] += $price_with_tax['sum'];
$tax['item_total'] += $price_tax['sum'];
and change it to:
Code: Select all
$price_with_tax['item'] = $value->product_final_price;
$price_with_tax['sum'] = $value->product_final_price * $value->product_quantity_delivered;
$price_without_tax['item'] = $value->product_item_price;
$price_without_tax['sum'] = $value->product_item_price * $value->product_quantity_delivered;
$price_tax['item'] = $price_with_tax['item'] - $price_without_tax['item'];
$price_tax['sum'] = $price_with_tax['sum'] - $price_without_tax['sum'];
[b]$price_taxrate = 100 * $price_tax['item'] / $price_without_tax['item'];[/b]
$without_tax['item_total'] += $price_without_tax['sum'];
$with_tax['item_total'] += $price_with_tax['sum'];
$tax['item_total'] += $price_tax['sum'];
The output to invoice is in line ~150. Search for this code:
Code: Select all
$i[$j]['price_without_tax']['item'] = $CURRENCY_DISPLAY->getFullValue($price_without_tax['item'], '', $c);
$i[$j]['price_without_tax']['sum'] = $CURRENCY_DISPLAY->getFullValue($price_without_tax['sum'], '', $c);
$i[$j]['price_tax']['sum'] = $CURRENCY_DISPLAY->getFullValue($price_tax['sum'], '', $c);
$i[$j]['price_with_tax']['sum'] = $CURRENCY_DISPLAY->getFullValue($price_with_tax['sum'], '', $c);
and change it to:
Code: Select all
$i[$j]['price_without_tax']['item'] = $CURRENCY_DISPLAY->getFullValue($price_without_tax['item'], '', $c);
$i[$j]['price_without_tax']['sum'] = $CURRENCY_DISPLAY->getFullValue($price_without_tax['sum'], '', $c);
$i[$j]['price_tax']['sum'] = $CURRENCY_DISPLAY->getFullValue($price_tax['sum'], '', $c);
[b] $i[$j]['price_tax']['sum'] .= "\n(".round($price_taxrate)."%)";[/b]
$i[$j]['price_with_tax']['sum'] = $CURRENCY_DISPLAY->getFullValue($price_with_tax['sum'], '', $c);
The highlighted line CALCULATES the taxrate, so its a hack and not really pretty, but should work for most cases. I used this cause otherwise I would have to change a lot of code, to read out the taxrate-id from VM database and searching with that ID in a new table for the value.
The output is rounded with no decimals and formatted to the german form, f.e. (7%)
Maybe this helps somebody out
Nukem36