Skip to content

Commit

Permalink
Prevent crash of sponge module when url is not populated
Browse files Browse the repository at this point in the history
  • Loading branch information
evansgl committed Jan 3, 2024
1 parent 1ea11a8 commit a925393
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mydata/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# CHANGELOG MYDATA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org)

#1.8
#1.8.1
Bug: Prevent crash of sponge module when aade url is not present.

##1.8
Feature: Print QR AADE Code into pdf
<br>
Feature: Show AADE Link to verify invoice
Expand All @@ -14,7 +17,7 @@ Bug: Handle large descriptions that are not allowed by AADE
Bug: Fix date and time to comply AADDE API
<br>

# 1.7
## 1.7
Feature: Support negative values in invoices
<br>
Feature: Support πιστωτικές αποδείξεις.
Expand Down
3 changes: 3 additions & 0 deletions mydata/core/modules/facture/doc/pdf_sponge.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1076,13 +1076,16 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede

$aade_invoiceUid = $object->array_options['options_mydata_reply_invoiceUid'] . " MARK " . $mark_result;
$doc = new DOMDocument();

if (!empty(url) {
$doc->loadHTML($url);
$aTags = $doc->getElementsByTagName('a');
$qrcodestring = $aTags->item(0)->getAttribute('href');

$pdf->write2DBarcode($qrcodestring, 'QRCODE,M', $this->marge_gauche, 245, 200, 25, $styleQr, 'N');
$pdf->SetXY(55,275);
$pdf->writeHTMLCell(200, 10, '', '', $aade_invoiceUid, 0, 1);
}
}

$pdf->Close();
Expand Down

0 comments on commit a925393

Please sign in to comment.