Display prices with VAT during invoice (proposal, order) creation

Dear all,

could you pinpoint me in a direction where I potentially could see the following information in the invoice (proposal, order) module (prices WITH VAT). I would be very happy to modify the ledger on my own - but I just do not know where to start?

Background is, that I work with final customers in a store and they ask me - what does the article XYZ cost (and they want to know what to pay WITH VAT). I have either to enter the article and then open the PDF or I have to use a calculator (which is also annoying).

Especially stressful is the procedure, while having a customer on the phone negotiating prices. I would say - the final price is e.g. 15.00 (instead of 16.85) and then I have to calculate while the customer jumps to next position.

I highly appreciate your help.
Best regards, Chris

I found the following code snippet:

Where would I add this code (hook)?

function doActions($parameters, $object, $action) 
{ 
    global $conf,$langs, $db, $user;
		
    if($parameters['currentcontext']=='propalcard' || $parameters['currentcontext']=='ordercard' || $parameters['currentcontext']=='invoicecard')
    {
	global $inputalsopricewithtax;
	$inputalsopricewithtax=1;
	$pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
	if(($action=='addline' || $action=='updateline') && $pu_ttc!=0)
        {
	        $tva_tx = GETPOST('tva_tx');
		$pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings
		$_POST["price_ht"]=$pu_ht;
	}
    }
}
1 Like

Hey

you can try this plugin : Input tax line
with this link : Login @ 13.0.0

Good continuation

the dolitools module also propose this feature : Dolitools

Hi. Good day. I hope you’ve received my message. I would like to know if the Dolitools will going to generate/ change all the reports on Dolibarr where all prices are VAT inccluded.

Good question !
Am noob but a hook is a function

Yes you can buy a module/plugin or you can learn (and be free)
Tuto/Wiki ;

for me, I just want to see VAT in pdf so I do…
in core/lib/pdf.lib.php you can find pdf_getlineupwithtax()
so, in core/modules/facture/doc/pdf_crabe.modules.php I insert sometihing like this (after posxqty)

$pu_ht = pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails);|
$pdf->SetXY($this->postax, $curY);
$pdf->MultiCell($this->posxqty - $this->postax - 0.8, 3, $pu_ht, 0, 'R', 0);|

(+plus doing the positioning manualy… littel bit complexe)

I know a hook doing it during invoice creation, adding it to database and interfaces… So maybe you can purchase Input tax line I dont test it, maybe it’s a winning time…

Hi @vincentb
Nice work there but you should change pu_ht with pu_ttc in this case because in Dolibarr codebase pu_ht is unit price without taxes and pu_ttc is unit price with taxes