Skip to content

Commit bb24573

Browse files
committed
allow disabling swissqrbill
1 parent c32cc88 commit bb24573

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ invoiceSettings:
677677
-
678678
- Name
679679
bankAccount: "Bitte den Betrag auf unser Konto... IBAN .."
680+
SwissQRBill: false
680681
```
681682
682683
### Time format

src/output/invoice.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ class invoice extends Base {
128128
}
129129
}
130130

131+
let qrDivContent = "";
132+
131133
const data = {
132134
currency: "CHF",
133135
amount: this.totalForInvoice,
@@ -151,11 +153,16 @@ class invoice extends Base {
151153
const options = {
152154
language: "DE"
153155
};
154-
const svg = new SwissQRBill(data, options);
155-
// make svg scalable, by adding viewBox and removing height/width attributes
156-
svg.instance.viewBox(0,0,740,420)
157-
svg.instance.height("");
158-
svg.instance.width("");
156+
157+
if(this.config.get('invoiceSettings').SwissQRBill) {
158+
const svg = new SwissQRBill(data, options);
159+
// make svg scalable, by adding viewBox and removing height/width attributes
160+
svg.instance.viewBox(0,0,740,420)
161+
svg.instance.height("");
162+
svg.instance.width("");
163+
qrDivContent = svg.toString();
164+
}
165+
159166
let positions ="";
160167
let positionIids = Object.keys(this.invoicePositions);
161168
positionIids.sort();
@@ -214,7 +221,7 @@ ${this.config.get('invoiceSettings').bankAccount}
214221
${closing}
215222
216223
217-
<div class="qr-div">${svg.toString()}</div>`
224+
<div class="qr-div">${qrDivContent}</div>`
218225

219226
}
220227

0 commit comments

Comments
 (0)