Merge pull request #19663 from frederic34/patch-1

add url in receipt printer options
This commit is contained in:
Laurent Destailleur 2021-12-21 15:52:25 +01:00 committed by GitHub
commit d3b429bef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,6 +221,7 @@ class dolReceiptPrinter extends Printer
'dol_value_mysoc_idprof6' => 'ProfId6',
'dol_value_mysoc_tva_intra' => 'VATIntra',
'dol_value_mysoc_capital' => 'Capital',
'dol_value_mysoc_url' => 'Web',
'dol_value_vendor_lastname' => 'VendorLastname',
'dol_value_vendor_firstname' => 'VendorFirstname',
'dol_value_vendor_mail' => 'VendorEmail',
@ -607,6 +608,7 @@ class dolReceiptPrinter extends Printer
$this->template = str_replace('{dol_value_mysoc_idprof6}', $mysoc->idprof6, $this->template);
$this->template = str_replace('{dol_value_mysoc_tva_intra}', $mysoc->tva_intra, $this->template);
$this->template = str_replace('{dol_value_mysoc_capital}', $mysoc->capital, $this->template);
$this->template = str_replace('{dol_value_mysoc_url}', $mysoc->url, $this->template);
$this->template = str_replace('{dol_value_vendor_firstname}', $user->firstname, $this->template);
$this->template = str_replace('{dol_value_vendor_lastname}', $user->lastname, $this->template);
@ -672,9 +674,9 @@ class dolReceiptPrinter extends Printer
$vatarray[$line->tva_tx] += $line->total_tva;
}
foreach ($vatarray as $vatkey => $vatvalue) {
$spacestoadd = $nbcharactbyline - strlen($vatkey) - 12;
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
$this->printer->text($spaces.$vatkey.'% '.str_pad(price($vatvalue), 10, ' ', STR_PAD_LEFT)."\n");
$spacestoadd = $nbcharactbyline - strlen($vatkey) - 12;
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
$this->printer->text($spaces.$vatkey.'% '.str_pad(price($vatvalue), 10, ' ', STR_PAD_LEFT)."\n");
}
break;
case 'DOL_PRINT_OBJECT_TAX1':