initial commit, code generated by AI

This commit is contained in:
daaric 2026-02-08 19:00:38 +01:00
commit 872ca92934
3 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,28 @@
<?php
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)
{
global $db, $pdf;
if ($object->element != 'facture') return 0;
$account = czqrpay_get_bank_account($db);
if (!$account) return 0;
$vs = preg_replace('/\D/', '', $object->ref);
$msg = "Faktura ".$object->ref;
$spd = czqrpay_build_spd($account, $object->total_ttc, $vs, $msg);
$pdf->write2DBarcode($spd, 'QRCODE,M', 160, 230, 35, 35);
return 1;
}
}