úprava pro sponge
This commit is contained in:
parent
872ca92934
commit
32801ca4a6
1 changed files with 14 additions and 7 deletions
|
|
@ -3,25 +3,32 @@ require_once DOL_DOCUMENT_ROOT.'/custom/czqrpay/lib/czqrpay.lib.php';
|
||||||
|
|
||||||
class ActionsCzQrPay
|
class ActionsCzQrPay
|
||||||
{
|
{
|
||||||
function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager)
|
function afterPDFCreation($parameters, &$object, &$action, $hookmanager)
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
function beforePDFCreation($parameters, &$object, &$action, $hookmanager)
|
|
||||||
{
|
{
|
||||||
global $db, $pdf;
|
global $db, $pdf;
|
||||||
|
|
||||||
|
// Jen vydané faktury
|
||||||
if ($object->element != 'facture') return 0;
|
if ($object->element != 'facture') return 0;
|
||||||
|
|
||||||
|
// účet
|
||||||
$account = czqrpay_get_bank_account($db);
|
$account = czqrpay_get_bank_account($db);
|
||||||
if (!$account) return 0;
|
if (!$account) return 0;
|
||||||
|
|
||||||
|
// VS = jen čísla z ref
|
||||||
$vs = preg_replace('/\D/', '', $object->ref);
|
$vs = preg_replace('/\D/', '', $object->ref);
|
||||||
|
|
||||||
|
// zpráva
|
||||||
$msg = "Faktura ".$object->ref;
|
$msg = "Faktura ".$object->ref;
|
||||||
|
|
||||||
|
// SPD string
|
||||||
$spd = czqrpay_build_spd($account, $object->total_ttc, $vs, $msg);
|
$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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue