From 32801ca4a641a09067efb61eaa066bd5a747a326 Mon Sep 17 00:00:00 2001 From: daaric Date: Sun, 8 Feb 2026 20:51:07 +0100 Subject: [PATCH] =?UTF-8?q?=C3=BAprava=20pro=20sponge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/actions_czqrpay.class.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/class/actions_czqrpay.class.php b/class/actions_czqrpay.class.php index 74bdf04..458543e 100644 --- a/class/actions_czqrpay.class.php +++ b/class/actions_czqrpay.class.php @@ -3,25 +3,32 @@ require_once DOL_DOCUMENT_ROOT.'/custom/czqrpay/lib/czqrpay.lib.php'; class ActionsCzQrPay { - function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager) - { - return 0; - } - - function beforePDFCreation($parameters, &$object, &$action, $hookmanager) + function afterPDFCreation($parameters, &$object, &$action, $hookmanager) { global $db, $pdf; + // Jen vydané faktury if ($object->element != 'facture') return 0; + // účet $account = czqrpay_get_bank_account($db); if (!$account) return 0; + // VS = jen čísla z ref $vs = preg_replace('/\D/', '', $object->ref); + + // zpráva $msg = "Faktura ".$object->ref; + + // SPD string $spd = czqrpay_build_spd($account, $object->total_ttc, $vs, $msg); - $pdf->write2DBarcode($spd, 'QRCODE,M', 160, 230, 35, 35); + // pozice QR (Sponge layout) + $x = 150; + $y = 240; + $size = 40; + + $pdf->write2DBarcode($spd, 'QRCODE,M', $x, $y, $size, $size); return 1; }