How to default to VAT included display

Hi, new user from China.
The idea behind Dolibarr looks brilliant.
I love the way how information are organized.
Thank you for this wonderful software.

But CN user is likely to experience some culture shock.

In china, the VAT is not directly charged on the end customer, but the manufactures.
( This doesn’t sound very reasonable, but that`s another question )
So in China nearly every price you see on tags are VAT included.
When Chinese people discussing about price, 8/10 times, they are
talking about VAT included price. This is especially true for
company to company business, unless one side declare they
dont want the VAT (specific) invoice.
(In China, therere 2 VAT invoices: the common one which is useless but a proof of the deal,
and VAT specific invoice which companies can use to deduct tax amount)

Dolibarr`s Purchase/Sales related features seems to default to
VAT EXcluded price in many places, which is annoying when you try to
compare price, talking with the customer, etc.
PRICEx1.17=? is a bit difficult for a quick math.

Is there any way to display VAT included price everywhere by default ?
If not, what about hacking the php files, is there any quick and easy hack possible?

thanks

1 Like

came to China, too. had the same problem,Have you found the solution?

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.

2 Likes

great! i will try this, same problem in brazil

Excellent ! Same problem in India too, I have tried It is working!!!
Thanks

Hello!
In versión 14 is Line 199
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->subprice, 0, ‘’, 0)).’"’;
if ($situationinvoicelinewithparent) {
print ’ readonly’;
}
print ‘>’

Also there is a module you can get in dolistore.com that will help you just buying it.
I’ll give you the link. Convert Price