there is a problem with invoices if customer changes his infos after the order: the PDF is created with his new infos (jos_vm_user_info) instead of those when he created the order (jos_vm_order_user_info)
So the invoice could become completely incoherent (regarding VAT, ...)
I made slight modifications in administrator/components/com_virtuemart/pdf/phoca.tcpdf.php
1°BILL TO
- I inserted a request before: // begin bill to
Code: Select all
$dbstc = new ps_DB;
$qt = "SELECT * FROM #__{vm}_order_user_info WHERE order_id=".$hD['dbo']->f("order_id")." AND address_type='BT'";
$dbstc->query($qt);
$dbstc->next_record();
- changed this line for country :
$this->Cell(0,0,$hD['vmBTCountry'],0,0,'L'); replaced by: $this->Cell(0,0,$dbbtc->f("country"),0,0,'L');
2°SHIP TO
- a request before: // begin ship to
Code: Select all
$dbstc = new ps_DB;
$qt = "SELECT * FROM #__{vm}_order_user_info WHERE order_id=".$hD['dbo']->f("order_id")." AND address_type='ST'";
$dbstc->query($qt);
$dbstc->next_record();
- this line for country :
$this->Cell(0,0,$hD['vmSTCountry'],0,0,'L'); replaced by: $this->Cell(0,0,$dbstc->f("country"),0,0,'L');