forked from Wavyzz/dolibarr
NEW: Implement EPC QR Code on Invoices (#29445)
* Add EPC QR code to sponge invoices based on config * fix code style issue (replace spaces by tab) * fix code style issue (Opening brace should be on a new line) * Fix translation issue --------- Co-authored-by: Quentin Lombat <Quentin.Lombat@itzy.be>
This commit is contained in:
@@ -1418,6 +1418,29 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$posy = pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
|
||||
|
||||
$posy += 2;
|
||||
|
||||
// SHOW EPC QR CODE
|
||||
if (getDolGlobalString('INVOICE_ADD_EPC_QR_CODE')) {
|
||||
$qrPosX = 120;
|
||||
$qrPosY = $posy;
|
||||
$qrCodeColor = array('25', '25', '25');
|
||||
$styleQr = array(
|
||||
'border' => false,
|
||||
'padding' => 0,
|
||||
'fgcolor' => $qrCodeColor,
|
||||
'bgcolor' => false, //array(255,255,255)
|
||||
'module_width' => 1, // width of a single module in points
|
||||
'module_height' => 1 // height of a single module in points
|
||||
);
|
||||
|
||||
$EPCQrCodeString = $object->buildEPCQrCodeString();
|
||||
$pdf->write2DBarcode($EPCQrCodeString, 'QRCODE,M', $qrPosX, $qrPosY, 25, 25, $styleQr, 'N');
|
||||
|
||||
$pdf->SetXY($qrPosX + 5, $posy);
|
||||
$pdf->SetFont('', '', $default_font_size - 5);
|
||||
$pdf->MultiCell(30, 3, $langs->trans("INVOICE_ADD_EPC_QR_CODEPay"), 0, 'L', 0);
|
||||
$posy = $pdf->GetY() + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user