@design.estate/dees-document 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_bundle/bundle.js +177 -172
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.pdfservice.js +2 -1
- package/dist_ts_shared/accountingdoc.d.ts +10 -0
- package/dist_ts_shared/accountingdoc.js +20 -1
- package/dist_ts_shared/interfaces/document.d.ts +10 -0
- package/dist_ts_shared/translation.d.ts +3 -0
- package/dist_ts_shared/translation.js +8 -1
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/contentinvoice.js +40 -22
- package/package.json +1 -1
- package/readme.md +3 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.pdfservice.ts +1 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/contentinvoice.ts +40 -21
|
@@ -143,6 +143,9 @@ const positionColumns: IColumnLayout = {
|
|
|
143
143
|
flexibleMinWidth: 120,
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
+
/** The positions of a document without VAT (`withoutVat`): the same, without the VAT rate's 50 px. */
|
|
147
|
+
const positionColumnsWithoutVat: IColumnLayout = { ...positionColumns, fixedWidth: 40 };
|
|
148
|
+
|
|
146
149
|
/**
|
|
147
150
|
* A reminder's claims, and its charges and sums, which share the last column;
|
|
148
151
|
* the document label is flexible with at least 150 px (as the grid in the
|
|
@@ -354,6 +357,11 @@ export class DeContentInvoice extends DeesElement {
|
|
|
354
357
|
grid-template-columns: 40px minmax(120px, 1fr) var(--quantity-column-width, 50px) var(--unit-column-width, 50px) var(--unit-price-column-width, 100px) 50px var(--amount-column-width, 100px);
|
|
355
358
|
}
|
|
356
359
|
|
|
360
|
+
/* a document without VAT (\`withoutVat\`) has no VAT column */
|
|
361
|
+
.grid.withoutVat {
|
|
362
|
+
grid-template-columns: 40px minmax(120px, 1fr) var(--quantity-column-width, 50px) var(--unit-column-width, 50px) var(--unit-price-column-width, 100px) var(--amount-column-width, 100px);
|
|
363
|
+
}
|
|
364
|
+
|
|
357
365
|
.topLine {
|
|
358
366
|
margin-top: 5px;
|
|
359
367
|
background: #e7e7e7;
|
|
@@ -1435,6 +1443,11 @@ export class DeContentInvoice extends DeesElement {
|
|
|
1435
1443
|
return;
|
|
1436
1444
|
}
|
|
1437
1445
|
const accountingDoc = this.accountingDoc;
|
|
1446
|
+
// a document without VAT prints no VAT column, no VAT line and one total; one that states tax is refused
|
|
1447
|
+
if (accountingDoc) {
|
|
1448
|
+
plugins.shared.assertWithoutVatStatesNoTax(accountingDoc, this.documentSettings);
|
|
1449
|
+
}
|
|
1450
|
+
const withoutVat = this.documentSettings.withoutVat === true;
|
|
1438
1451
|
// throws when the advance payments do not add up to the paid amount
|
|
1439
1452
|
const paidAmountSummary = accountingDoc
|
|
1440
1453
|
? plugins.shared.getPaidAmountSummary(accountingDoc, this.getTotalGross())
|
|
@@ -1444,7 +1457,7 @@ export class DeContentInvoice extends DeesElement {
|
|
|
1444
1457
|
${this.renderCorrection()}
|
|
1445
1458
|
<div>${this.translateKey(this.docContent.introStatement)}</div>
|
|
1446
1459
|
${this.renderRelatedDocuments()}
|
|
1447
|
-
<div class="grid topLine dataHeader">
|
|
1460
|
+
<div class="grid topLine dataHeader ${withoutVat ? "withoutVat" : ""}">
|
|
1448
1461
|
<div class="lineItem rightAlign">
|
|
1449
1462
|
${this.translateKey("invoice@@item.position")}
|
|
1450
1463
|
</div>
|
|
@@ -1458,18 +1471,20 @@ export class DeContentInvoice extends DeesElement {
|
|
|
1458
1471
|
${this.translateKey("invoice@@unit.type")}
|
|
1459
1472
|
</div>
|
|
1460
1473
|
<div class="lineItem rightAlign unitPriceCell">
|
|
1461
|
-
${this.translateKey("invoice@@price.unit.net")}
|
|
1462
|
-
</div>
|
|
1463
|
-
<div class="lineItem rightAlign">
|
|
1464
|
-
${this.translateKey("invoice@@vat.short")}
|
|
1474
|
+
${this.translateKey(withoutVat ? "invoice@@price.unit.withoutVat" : "invoice@@price.unit.net")}
|
|
1465
1475
|
</div>
|
|
1476
|
+
${withoutVat
|
|
1477
|
+
? html``
|
|
1478
|
+
: html`<div class="lineItem rightAlign">
|
|
1479
|
+
${this.translateKey("invoice@@vat.short")}
|
|
1480
|
+
</div>`}
|
|
1466
1481
|
<div class="lineItem rightAlign amountCell">
|
|
1467
|
-
${this.translateKey("invoice@@price.total.net")}
|
|
1482
|
+
${this.translateKey(withoutVat ? "invoice@@price.total.withoutVat" : "invoice@@price.total.net")}
|
|
1468
1483
|
</div>
|
|
1469
1484
|
</div>
|
|
1470
1485
|
${accountingDoc?.items?.map(
|
|
1471
1486
|
(invoiceItem, index) => html`
|
|
1472
|
-
<div class="grid needsDataHeader">
|
|
1487
|
+
<div class="grid needsDataHeader ${withoutVat ? "withoutVat" : ""}">
|
|
1473
1488
|
<div class="lineItem rightAlign">${index + 1}</div>
|
|
1474
1489
|
<div class="lineItem descriptionCell">${invoiceItem.name}</div>
|
|
1475
1490
|
<div class="lineItem rightAlign quantityCell">
|
|
@@ -1485,9 +1500,11 @@ export class DeContentInvoice extends DeesElement {
|
|
|
1485
1500
|
<div class="lineItem rightAlign unitPriceCell">
|
|
1486
1501
|
${this.formatPrice(invoiceItem.unitNetPrice)}
|
|
1487
1502
|
</div>
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1503
|
+
${withoutVat
|
|
1504
|
+
? html``
|
|
1505
|
+
: html`<div class="lineItem rightAlign">
|
|
1506
|
+
${invoiceItem.vatPercentage}%
|
|
1507
|
+
</div>`}
|
|
1491
1508
|
<div class="lineItem rightAlign amountCell">
|
|
1492
1509
|
${this.formatPrice(
|
|
1493
1510
|
invoiceItem.unitQuantity * invoiceItem.unitNetPrice
|
|
@@ -1497,15 +1514,17 @@ export class DeContentInvoice extends DeesElement {
|
|
|
1497
1514
|
`
|
|
1498
1515
|
)}
|
|
1499
1516
|
<div class="sums">
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1517
|
+
${withoutVat
|
|
1518
|
+
? html``
|
|
1519
|
+
: html`<div class="sumline">
|
|
1520
|
+
<div class="label">
|
|
1521
|
+
${this.translateKey("invoice@@sum.total.net")}
|
|
1522
|
+
</div>
|
|
1523
|
+
<div class="value value--total rightAlign amountCell">
|
|
1524
|
+
${this.formatPrice(this.getTotalNet())}
|
|
1525
|
+
</div>
|
|
1526
|
+
</div>`}
|
|
1527
|
+
${(withoutVat ? [] : this.getVatGroups()).map((vatGroupArg) => {
|
|
1509
1528
|
let itemNumbers = vatGroupArg.items
|
|
1510
1529
|
.map((item) => (accountingDoc?.items.indexOf(item) ?? -1) + 1)
|
|
1511
1530
|
.join(", ");
|
|
@@ -1529,7 +1548,7 @@ export class DeContentInvoice extends DeesElement {
|
|
|
1529
1548
|
`;
|
|
1530
1549
|
})}
|
|
1531
1550
|
<div class="sumline">
|
|
1532
|
-
<div class="label">${this.translateKey("invoice@@totalGross")}</div>
|
|
1551
|
+
<div class="label">${this.translateKey(withoutVat ? "invoice@@totalWithoutVat" : "invoice@@totalGross")}</div>
|
|
1533
1552
|
<div class="value value--total rightAlign amountCell">
|
|
1534
1553
|
${this.formatPrice(this.getTotalGross())}
|
|
1535
1554
|
</div>
|
|
@@ -1558,7 +1577,7 @@ export class DeContentInvoice extends DeesElement {
|
|
|
1558
1577
|
this.fitColumns(
|
|
1559
1578
|
contentNodes.currentContent,
|
|
1560
1579
|
".grid.dataHeader",
|
|
1561
|
-
positionColumns
|
|
1580
|
+
withoutVat ? positionColumnsWithoutVat : positionColumns
|
|
1562
1581
|
);
|
|
1563
1582
|
}
|
|
1564
1583
|
|