FIX Zatca QR code must use company name/vat

This commit is contained in:
Laurent Destailleur 2022-05-22 12:38:52 +02:00
parent 98d22ed31b
commit f65f63b562

View File

@ -820,7 +820,7 @@ abstract class CommonInvoice extends CommonObject
*/
public function buildZATCAQRString()
{
global $conf;
global $conf, $mysoc;
$tmplang = new Translate('', $conf);
$tmplang->setDefaultLang('en_US');
@ -857,8 +857,8 @@ abstract class CommonInvoice extends CommonObject
*/
// Using TLV format
$s = pack('C1', 1).pack('C1', strlen($this->thirdparty->name)).$this->thirdparty->name;
$s .= pack('C1', 2).pack('C1', strlen($this->thirdparty->tva_intra)).$this->thirdparty->tva_intra;
$s = pack('C1', 1).pack('C1', strlen($this->thirdparty->name)).$mysoc->name;
$s .= pack('C1', 2).pack('C1', strlen($this->thirdparty->tva_intra)).$mysoc->tva_intra;
$s .= pack('C1', 3).pack('C1', strlen($datestring)).$datestring;
$s .= pack('C1', 4).pack('C1', strlen($pricewithtaxstring)).$pricewithtaxstring;
$s .= pack('C1', 5).pack('C1', strlen($pricetaxstring)).$pricetaxstring;