Hello.
In Peru we also works with taxes includes to show prices to the customers.
I made some changes in the code. So maybe you can try it.
CODE:
If you want to edit a product price to see taxes included
You have to do these changes
First.
core/tpl/objectline_edit.tpl.php - Line 155 (version 13, less version you have to find it in the code) (change subprice por “pu_ttc”)
print ‘<input type=“text” class=“flat right” size=“5” id=“price_ht” name=“price_ht” value="’ . (isset($line->pu_ht)?price($line->pu_ht, 0, ‘’, 0):price($line->pu_ttc, 0, ‘’, 0)) . ‘"’;
Then change facture in:
compta/facture/card.php // line 2193 (version 13, less version you have to find it in the code) change ‘HT’ to ‘TTC’
$result = $object->updateline(GETPOST(‘lineid’), $description, $pu_ht, $qty, GETPOST(‘remise_percent’),
$date_start, $date_end, $vat_rate, $localtax1_rate, $localtax2_rate, ‘TTC’, $info_bits, $type,
GETPOST(‘fk_parent_line’), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST(‘progress’),
$_POST[‘units’], $pu_ht_devise); // HT had been changed to TTC - tthat will let you put the price with taxes when you edit the line.
If you want to do the same change in commande:
commande/card.php // line 1086 ‘HT’ to ‘TTC’
$result = $object->updateline(GETPOST(‘lineid’), $description, $pu_ht, GETPOST(‘qty’), GETPOST(‘remise_percent’), $vat_rate, $localtax1_rate, $localtax2_rate, ‘TTC’, $info_bits, $date_start, $date_end, $type, GETPOST(‘fk_parent_line’), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST(‘units’), $pu_ht_devise);
If you want to do the same change in propals:
comm/propal/card.php // line 1272 ‘HT’ to ‘TTC’
$result = $object->updateline(GETPOST(‘lineid’), $pu_ht, GETPOST(‘qty’), GETPOST(‘remise_percent’), $vat_rate, $localtax1_rate, $localtax2_rate, $description, ‘TTC’, $info_bits, $special_code, GETPOST(‘fk_parent_line’), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, $_POST[“units”], $pu_ht_devise);
//with this changes when you edit the price of a product in lines you can put price with taxes directly and dolibarr will calcualte price without taxes and taxes as usual. But, will be easily put prices now, cause you don’t need to calcualte prices without taxes if you want to modify prices in the line of facture.
if you want to see the price with taxes just as a view in the facture lines you have to add some lines
Go to
htdocs/core/tpl/objectline_view.tpl.php Line 216
add
<td class="linecoluht nowrap right"><?php $coldisplay++; ?><?php print price($line->pu_ttc); ?></td>
and
htdocs/core/tpl/objectline_title.tpl.php Line 73
add
// Price TTC
print ‘’.$langs->trans(“U.P.(t.i)”).’’; // U.P.(t.i.) measn Unit Price (taxex includes) - you can put the label as you prefer.