28 lines
725 B
PHP
28 lines
725 B
PHP
<?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;
|
|
}
|
|
}
|