mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix error management
This commit is contained in:
parent
32101ea885
commit
066df875bc
|
|
@ -907,7 +907,11 @@ class pdf_crabe extends ModelePDFFactures
|
|||
}
|
||||
|
||||
if (getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE') == 'bottom') {
|
||||
$this->addBottomQRInvoice($pdf, $object, $outputlangs);
|
||||
$result = $this->addBottomQRInvoice($pdf, $object, $outputlangs);
|
||||
if (!$result) {
|
||||
$pdf->Close();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
$pdf->Close();
|
||||
|
||||
|
|
|
|||
|
|
@ -89,14 +89,17 @@ abstract class ModelePDFFactures extends CommonDocGenerator
|
|||
*/
|
||||
private function getSwissQrBill(Facture $object, Translate $langs)
|
||||
{
|
||||
global $conf;
|
||||
if (getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE') != 'bottom') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($object->mode_reglement_code != 'VIR') {
|
||||
$this->error = $langs->transnoentities("SwissQrOnlyVIR");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) {
|
||||
if (empty($object->fk_account)) {
|
||||
$this->error = 'Bank account must be defined to use this experimental feature';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user