initial commit, code generated by AI
This commit is contained in:
commit
872ca92934
3 changed files with 85 additions and 0 deletions
28
class/actions_czqrpay.class.php
Normal file
28
class/actions_czqrpay.class.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue