náhrada EPC QR za CZ SPD QR, úprava generátoru kódu
This commit is contained in:
parent
573b4a7901
commit
57f5f13472
2 changed files with 79 additions and 56 deletions
|
|
@ -474,7 +474,25 @@ class pdf_sponge_czqr extends ModelePDFFactures
|
|||
}
|
||||
} elseif (getDolGlobalString('INVOICE_ADD_EPC_QR_CODE') == '1' && (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')) {
|
||||
if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) {
|
||||
$qrcodestring = $object->buildEPCQrCodeString();
|
||||
require_once DOL_DOCUMENT_ROOT.'/custom/czqrpay/lib/czqrpay.lib.php';
|
||||
|
||||
$accountNumber = '';
|
||||
if (!empty($account->account_number)) {
|
||||
$accountNumber = $account->account_number;
|
||||
} elseif (!empty($account->iban)) {
|
||||
$accountNumber = czqrpay_iban_to_cz($account->iban);
|
||||
}
|
||||
|
||||
$vs = preg_replace('/\D/', '', $object->ref);
|
||||
$msg = "Faktura ".$object->ref;
|
||||
|
||||
$qrcodestring = czqrpay_build_spd(
|
||||
$accountNumber,
|
||||
$object->total_ttc,
|
||||
$vs,
|
||||
$msg
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1579,60 +1597,60 @@ class pdf_sponge_czqr extends ModelePDFFactures
|
|||
|
||||
$posy += 2;
|
||||
|
||||
// ============================================
|
||||
// CZ QR PLATBA (náhrada EPC QR)
|
||||
// ============================================
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/custom/czqrpay/lib/czqrpay.lib.php';
|
||||
|
||||
// vezmeme účet z aktuální faktury
|
||||
$accountNumber = '';
|
||||
if (!empty($account->account_number)) {
|
||||
$accountNumber = $account->account_number;
|
||||
} elseif (!empty($account->iban)) {
|
||||
$accountNumber = czqrpay_iban_to_cz($account->iban);
|
||||
}
|
||||
|
||||
if (!empty($accountNumber) && !empty($object->total_ttc)) {
|
||||
|
||||
// VS jen čísla
|
||||
$vs = preg_replace('/\D/', '', $object->ref);
|
||||
|
||||
// zpráva pro příjemce
|
||||
$msg = "Faktura ".$object->ref;
|
||||
|
||||
// SPD string
|
||||
$spd = czqrpay_build_spd(
|
||||
$accountNumber,
|
||||
$object->total_ttc,
|
||||
$vs,
|
||||
$msg
|
||||
);
|
||||
|
||||
$qrPosX = 120;
|
||||
$qrPosY = $posy;
|
||||
|
||||
$qrCodeColor = array('25', '25', '25');
|
||||
|
||||
$styleQr = array(
|
||||
'border' => false,
|
||||
'padding' => 0,
|
||||
'fgcolor' => $qrCodeColor,
|
||||
'bgcolor' => false,
|
||||
'module_width' => 1,
|
||||
'module_height' => 1
|
||||
);
|
||||
|
||||
// vykreslení QR
|
||||
$pdf->write2DBarcode($spd, 'QRCODE,M', $qrPosX, $qrPosY, 30, 30, $styleQr, 'N');
|
||||
|
||||
// popisek vedle QR
|
||||
$pdf->SetXY($qrPosX + 35, $posy + 6);
|
||||
$pdf->SetFont('', '', $default_font_size - 5);
|
||||
$pdf->MultiCell(40, 3, "QR platba", 0, 'L', false);
|
||||
|
||||
$posy = $pdf->GetY() + 2;
|
||||
}
|
||||
//// ============================================
|
||||
//// CZ QR PLATBA (náhrada EPC QR)
|
||||
//// ============================================
|
||||
//
|
||||
//require_once DOL_DOCUMENT_ROOT.'/custom/czqrpay/lib/czqrpay.lib.php';
|
||||
//
|
||||
//// vezmeme účet z aktuální faktury
|
||||
//$accountNumber = '';
|
||||
//if (!empty($account->account_number)) {
|
||||
// $accountNumber = $account->account_number;
|
||||
//} elseif (!empty($account->iban)) {
|
||||
// $accountNumber = czqrpay_iban_to_cz($account->iban);
|
||||
//}
|
||||
//
|
||||
//if (!empty($accountNumber) && !empty($object->total_ttc)) {
|
||||
//
|
||||
// // VS jen čísla
|
||||
// $vs = preg_replace('/\D/', '', $object->ref);
|
||||
//
|
||||
// // zpráva pro příjemce
|
||||
// $msg = "Faktura ".$object->ref;
|
||||
//
|
||||
// // SPD string
|
||||
// $spd = czqrpay_build_spd(
|
||||
// $accountNumber,
|
||||
// $object->total_ttc,
|
||||
// $vs,
|
||||
// $msg
|
||||
// );
|
||||
//
|
||||
// $qrPosX = 120;
|
||||
// $qrPosY = $posy;
|
||||
//
|
||||
// $qrCodeColor = array('25', '25', '25');
|
||||
//
|
||||
// $styleQr = array(
|
||||
// 'border' => false,
|
||||
// 'padding' => 0,
|
||||
// 'fgcolor' => $qrCodeColor,
|
||||
// 'bgcolor' => false,
|
||||
// 'module_width' => 1,
|
||||
// 'module_height' => 1
|
||||
// );
|
||||
//
|
||||
// // vykreslení QR
|
||||
// $pdf->write2DBarcode($spd, 'QRCODE,M', $qrPosX, $qrPosY, 30, 30, $styleQr, 'N');
|
||||
//
|
||||
// // popisek vedle QR
|
||||
// $pdf->SetXY($qrPosX + 35, $posy + 6);
|
||||
// $pdf->SetFont('', '', $default_font_size - 5);
|
||||
// $pdf->MultiCell(40, 3, "QR platba", 0, 'L', false);
|
||||
//
|
||||
// $posy = $pdf->GetY() + 2;
|
||||
//}
|
||||
|
||||
|
||||
// SHOW EPC QR CODE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue