@dangl/angular-ava 1.1.2-beta0137 → 1.1.2-beta0146
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/fesm2022/dangl-angular-ava.mjs +100 -171
- package/fesm2022/dangl-angular-ava.mjs.map +1 -1
- package/lib/invoice/components/invoice-display/invoice-display.component.d.ts +7 -11
- package/lib/invoice/components/invoice-documents/invoice-documents.component.d.ts +21 -0
- package/lib/invoice/model/configInvoice.model.d.ts +4 -3
- package/lib/invoice/model/index.d.ts +2 -2
- package/lib/invoice/services/configuration-invoice.service.d.ts +18 -0
- package/package.json +1 -1
|
@@ -13,15 +13,16 @@ import { MatInputModule } from '@angular/material/input';
|
|
|
13
13
|
import * as i10 from '@angular/material/tooltip';
|
|
14
14
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
15
15
|
import { ReplaySubject, of, BehaviorSubject, Subject, takeUntil, debounceTime, fromEvent, filter } from 'rxjs';
|
|
16
|
-
import { NgTemplateOutlet, NgClass, DecimalPipe, CurrencyPipe, DatePipe, PercentPipe } from '@angular/common';
|
|
16
|
+
import { NgTemplateOutlet, NgClass, DecimalPipe, CurrencyPipe, DatePipe, PercentPipe, AsyncPipe } from '@angular/common';
|
|
17
17
|
import * as i3 from '@angular/material/checkbox';
|
|
18
18
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
19
19
|
import * as i3$1 from '@angular/material/table';
|
|
20
20
|
import { MatTableModule } from '@angular/material/table';
|
|
21
|
-
import * as
|
|
21
|
+
import * as i2 from '@angular/material/divider';
|
|
22
22
|
import { MatDividerModule } from '@angular/material/divider';
|
|
23
|
-
import
|
|
24
|
-
import
|
|
23
|
+
import { InvoiceDocumentsComponent } from 'projects/angular-ava/src/lib/invoice/components/invoice-documents/invoice-documents.component';
|
|
24
|
+
import * as i1 from 'projects/angular-ava/src/lib/invoice/services/configuration-invoice.service';
|
|
25
|
+
import { ConfigurationInvoiceService } from 'projects/angular-ava/src/lib/invoice/services/configuration-invoice.service';
|
|
25
26
|
|
|
26
27
|
//----------------------
|
|
27
28
|
// <auto-generated>
|
|
@@ -238,12 +239,12 @@ var ModeViewType;
|
|
|
238
239
|
|
|
239
240
|
// This file is automatically generated as part of the build process
|
|
240
241
|
const version = {
|
|
241
|
-
version: "1.1.2-
|
|
242
|
-
commitInfo: "Branch.develop.Sha.
|
|
242
|
+
version: "1.1.2-beta0146",
|
|
243
|
+
commitInfo: "Branch.develop.Sha.b082444da4aefdf7aa8b079bd5fab829a42961aa",
|
|
243
244
|
commitDate: "2025-01-14",
|
|
244
|
-
commitHash: "
|
|
245
|
-
informationalVersion: "1.1.2-beta.
|
|
246
|
-
buildDateUtc: new Date(Date.UTC(2025, 0, 14, 10,
|
|
245
|
+
commitHash: "b082444da4aefdf7aa8b079bd5fab829a42961aa",
|
|
246
|
+
informationalVersion: "1.1.2-beta.146+Branch.develop.Sha.b082444da4aefdf7aa8b079bd5fab829a42961aa",
|
|
247
|
+
buildDateUtc: new Date(Date.UTC(2025, 0, 14, 10, 47, 7))
|
|
247
248
|
};
|
|
248
249
|
|
|
249
250
|
const DEFAULT_FILTERS = [
|
|
@@ -1765,6 +1766,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImpor
|
|
|
1765
1766
|
args: ['avaTreeFilterInput']
|
|
1766
1767
|
}] } });
|
|
1767
1768
|
|
|
1769
|
+
class InvoiceDisplayComponent {
|
|
1770
|
+
/**
|
|
1771
|
+
* You can supply a map of strings to be used for the text in the tree. This allows you to translate
|
|
1772
|
+
* the text in the tree to other languages.
|
|
1773
|
+
* {
|
|
1774
|
+
* invoiceTitle: string;
|
|
1775
|
+
* vatId: string;
|
|
1776
|
+
* detailsInvoiceNumber: string;
|
|
1777
|
+
* detailsInvoiceDate: string;
|
|
1778
|
+
* detailsPaymentDueDate: string;
|
|
1779
|
+
* detailsCurrencyCode: string;
|
|
1780
|
+
* detailsPaymentTerms: string;
|
|
1781
|
+
* referencesTopic: string;
|
|
1782
|
+
* referencesBuyerReference: string;
|
|
1783
|
+
* referencesProjectReference: string;
|
|
1784
|
+
* referencesContractReference: string;
|
|
1785
|
+
* referencesPurchaseOrderReference: string;
|
|
1786
|
+
* referencesSalesOrderReference: string;
|
|
1787
|
+
* referencesReceivingAdviceReference: string;
|
|
1788
|
+
* referencesDispatchAdviceReference: string;
|
|
1789
|
+
* referencesTenderOrLotReference: string;
|
|
1790
|
+
* referencesInvoicedObjectIdentifier: string;
|
|
1791
|
+
* tableHeadDescription: string;
|
|
1792
|
+
* tableHeadQuantity: string;
|
|
1793
|
+
* tableHeadUnit: string;
|
|
1794
|
+
* tableHeadNetPrice: string;
|
|
1795
|
+
* tableHeadNetAmount: string;
|
|
1796
|
+
* totalsTopic: string;
|
|
1797
|
+
* totalsTotalNet: string;
|
|
1798
|
+
* totalsTotalAllowances: string;
|
|
1799
|
+
* totalsTotalCharges: string;
|
|
1800
|
+
* totalsTotalAfterDeductions: string;
|
|
1801
|
+
* totalsTotalVatAmount: string;
|
|
1802
|
+
* totalsTotalGross: string;
|
|
1803
|
+
* totalsAlreadyPaidTotal: string;
|
|
1804
|
+
* totalsTotalToBePaid: string;
|
|
1805
|
+
* instructionsTopic: string;
|
|
1806
|
+
* instructionsAccountIdentifier: string;
|
|
1807
|
+
* instructionsAccountName: string;
|
|
1808
|
+
* instructionsServiceProviderIdentifier: string;
|
|
1809
|
+
* notesTopic: string;
|
|
1810
|
+
* attachmentsHeading: string;
|
|
1811
|
+
* attachmentsName: string;
|
|
1812
|
+
* attachmentsDescription: string;
|
|
1813
|
+
* attachmentsUrl: string;
|
|
1814
|
+
* attachmentsDataSize: string;
|
|
1815
|
+
* attachmentsMimeType: string;
|
|
1816
|
+
* attachmentsFileName: string;
|
|
1817
|
+
* attachmentsDownloadButton: string;
|
|
1818
|
+
*
|
|
1819
|
+
* }
|
|
1820
|
+
*/
|
|
1821
|
+
set config(configObject) {
|
|
1822
|
+
if (this.configurationInvoiceService.getCurrentInvoiceConfig()) {
|
|
1823
|
+
const config = { ...this.configurationInvoiceService.getCurrentInvoiceConfig(), ...configObject };
|
|
1824
|
+
this.configurationInvoiceService.setInvoiceConfig(config);
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
constructor(configurationInvoiceService) {
|
|
1828
|
+
this.configurationInvoiceService = configurationInvoiceService;
|
|
1829
|
+
// TODO remove type any after TODO under will be resolved
|
|
1830
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1831
|
+
this.invoice = input.required();
|
|
1832
|
+
this.textWords$ = this.configurationInvoiceService.getTextWordsFromConfig();
|
|
1833
|
+
/**TODO: For setting invoice instead:
|
|
1834
|
+
* <ava-invoice-display id="invoice"></ava-invoice-display>
|
|
1835
|
+
* invoice = document.getElementById('invoice');
|
|
1836
|
+
* invoice.invoice = INVOICE;
|
|
1837
|
+
* we should pass value to global window variable
|
|
1838
|
+
* window['InvoiceGlobalVariable'] = INVOICE;
|
|
1839
|
+
* Temporary solution until the problem of setting the value for InputSignal is solved. See this PR https://github.com/angular/angular/pull/55067
|
|
1840
|
+
*/
|
|
1841
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1842
|
+
if (window['InvoiceGlobalVariable']) {
|
|
1843
|
+
this.invoice = () => {
|
|
1844
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1845
|
+
return window['InvoiceGlobalVariable'];
|
|
1846
|
+
};
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: InvoiceDisplayComponent, deps: [{ token: i1.ConfigurationInvoiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1850
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: InvoiceDisplayComponent, isStandalone: true, selector: "ava-invoice-display", inputs: { invoice: { classPropertyName: "invoice", publicName: "invoice", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null } }, providers: [ConfigurationInvoiceService], ngImport: i0, template: "@if (textWords$ | async; as textWords) {\n <div class=\"invoice-container\">\n <!-- Seller and Buyer Information -->\n <h1 class=\"invoice-title\">{{ textWords.invoiceTitle }}</h1>\n <header class=\"invoice-header\">\n <div class=\"buyer-info\">\n <h2 class=\"header-title\">{{ textWords.invoiceBuyerTitle }}</h2>\n <p>\n <strong>{{ invoice().buyer?.name }}</strong>\n </p>\n <p>{{ invoice().buyer?.address }}</p>\n <p>{{ invoice().buyer?.city }}, {{ invoice().buyer?.zipCode }}</p>\n <p>{{ invoice().buyer?.countryCode }}</p>\n @if (invoice().buyer?.vatId) {\n <p>\n <strong>{{ textWords.vatId }}: </strong>\n <span>{{ invoice().buyer?.vatId }}</span>\n </p>\n }\n <mat-divider></mat-divider>\n @if (invoice().buyer?.contactPersonName) {\n <p>\n <strong>{{ textWords.contactPersonName }}: </strong>\n <span>{{ invoice().buyer?.contactPersonName }}</span>\n </p>\n }\n @if (invoice().buyer?.contactPersonPhone) {\n <p>\n <strong>{{ textWords.contactPersonPhone }}: </strong>\n <span>{{ invoice().buyer?.contactPersonPhone }}</span>\n </p>\n }\n @if (invoice().buyer?.contactPersonEmail) {\n <p>\n <strong>{{ textWords.contactPersonEmail }}: </strong>\n <span>{{ invoice().buyer?.contactPersonEmail }}</span>\n </p>\n }\n </div>\n <div class=\"invoice-details\">\n <h2 [class.header]=\"textWords.invoiceBuyerTitle.trim() || textWords.invoiceSellerTitle.trim()\"></h2>\n @if (invoice().invoiceNumber) {\n <p>\n <strong>{{ textWords.detailsInvoiceNumber }}: </strong>\n <span>{{ invoice().invoiceNumber }}</span>\n </p>\n }\n @if (invoice().invoiceDate) {\n <p>\n <strong>{{ textWords.detailsInvoiceDate }}: </strong>\n <span>{{ invoice().invoiceDate | date: 'dd.MM.yyyy' }}</span>\n </p>\n }\n @if (invoice().paymentDueDate) {\n <p>\n <strong>{{ textWords.detailsPaymentDueDate }}: </strong>\n <span>{{ invoice().paymentDueDate | date: 'dd.MM.yyyy' }}</span>\n </p>\n }\n @if (invoice().currencyCode) {\n <p>\n <strong>{{ textWords.detailsCurrencyCode }}: </strong>\n <span>{{ invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().paymentTerms) {\n <p>\n <strong>{{ textWords.detailsPaymentTerms }}: </strong>\n <span>{{ invoice().paymentTerms }}</span>\n </p>\n }\n </div>\n <div class=\"seller-info\">\n <h2 class=\"header-title\">{{ textWords.invoiceSellerTitle }}</h2>\n <p>\n <strong>{{ invoice().seller?.name }}</strong>\n </p>\n <p>{{ invoice().seller?.address }}</p>\n <p>{{ invoice().seller?.city }}, {{ invoice().seller?.zipCode }}</p>\n <p>{{ invoice().seller?.countryCode }}</p>\n @if (invoice().seller?.vatId) {\n <p>\n <strong>{{ textWords.vatId }}: </strong>\n <span>{{ invoice().seller?.vatId }}</span>\n </p>\n }\n <mat-divider></mat-divider>\n @if (invoice().seller?.contactPersonName) {\n <p>\n <strong>{{ textWords.contactPersonName }}: </strong>\n <span>{{ invoice().seller?.contactPersonName }}</span>\n </p>\n }\n @if (invoice().seller?.contactPersonPhone) {\n <p>\n <strong>{{ textWords.contactPersonPhone }}: </strong>\n <span>{{ invoice().seller?.contactPersonPhone }}</span>\n </p>\n }\n @if (invoice().seller?.contactPersonEmail) {\n <p>\n <strong>{{ textWords.contactPersonEmail }}: </strong>\n <span>{{ invoice().seller?.contactPersonEmail }}</span>\n </p>\n }\n </div>\n </header>\n <mat-divider></mat-divider>\n <div class=\"invoice-info\">\n <section class=\"invoice-references\">\n @if (textWords.referencesTopic) {\n <h2 class=\"info-title\">{{ textWords.referencesTopic }}</h2>\n }\n @if (invoice().references?.buyerReference) {\n <p>\n <strong>{{ textWords.referencesBuyerReference }}: </strong>\n <span>{{ invoice().references?.buyerReference }}</span>\n </p>\n }\n @if (invoice().references?.projectReference) {\n <p>\n <strong>{{ textWords.referencesProjectReference }}: </strong>\n <span>{{ invoice().references?.projectReference }}</span>\n </p>\n }\n @if (invoice().references?.contractReference) {\n <p>\n <strong>{{ textWords.referencesContractReference }}: </strong>\n <span>{{ invoice().references?.contractReference }}</span>\n </p>\n }\n @if (invoice().references?.purchaseOrderReference) {\n <p>\n <strong>{{ textWords.referencesPurchaseOrderReference }}: </strong>\n <span>{{ invoice().references?.purchaseOrderReference }}</span>\n </p>\n }\n @if (invoice().references?.salesOrderReference) {\n <p>\n <strong>{{ textWords.referencesSalesOrderReference }}: </strong>\n <span>{{ invoice().references?.salesOrderReference }}</span>\n </p>\n }\n @if (invoice().references?.receivingAdviceReference) {\n <p>\n <strong>{{ textWords.referencesReceivingAdviceReference }}: </strong>\n <span>{{ invoice().references?.receivingAdviceReference }}</span>\n </p>\n }\n @if (invoice().references?.dispatchAdviceReference) {\n <p>\n <strong>{{ textWords.referencesDispatchAdviceReference }}: </strong>\n <span> {{ invoice().references?.dispatchAdviceReference }}</span>\n </p>\n }\n @if (invoice().references?.tenderOrLotReference) {\n <p>\n <strong>{{ textWords.referencesTenderOrLotReference }}: </strong>\n <span>{{ invoice().references?.tenderOrLotReference }}</span>\n </p>\n }\n @if (invoice().references?.invoicedObjectIdentifier) {\n <p>\n <strong>{{ textWords.referencesInvoicedObjectIdentifier }}: </strong>\n <span>{{ invoice().references?.invoicedObjectIdentifier }}</span>\n </p>\n }\n </section>\n @if (invoice().deliveryInformation) {\n <section class=\"invoice-delivery\">\n <h2 class=\"info-title\">{{ textWords.deliveryInformationTitle }}</h2>\n\n @if (invoice().deliveryInformation?.deliverToName) {\n <p>\n <strong>{{ textWords.deliverToName }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliverToName }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliverToLocationIdentifier) {\n <p>\n <strong>{{ textWords.deliverToLocationIdentifier }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliverToLocationIdentifier }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliveryDate) {\n <p>\n <strong>{{ textWords.deliveryDate }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliveryDate | date: 'shortDate' }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliveryAddress) {\n <p>\n <strong>{{ textWords.deliveryAddress }}: </strong>\n <span>\n @if (invoice().deliveryInformation?.deliveryAddress?.address) {\n <p>{{ invoice().deliveryInformation?.deliveryAddress?.address }}</p>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.city) {\n <span>{{ invoice().deliveryInformation?.deliveryAddress?.city }},</span>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.zipCode) {\n <span>{{ invoice().deliveryInformation?.deliveryAddress?.zipCode }}</span>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.countryCode) {\n <p>{{ invoice().deliveryInformation?.deliveryAddress?.countryCode }}</p>\n }\n </span>\n </p>\n }\n </section>\n }\n </div>\n\n <table class=\"invoice-table\">\n <thead>\n <tr>\n <th>#</th>\n <th>{{ textWords.tableHeadDescription }}</th>\n <th>{{ textWords.tableHeadQuantity }}</th>\n <th>{{ textWords.tableHeadUnit }}</th>\n <th>{{ textWords.tableHeadNetPrice }}</th>\n <th>{{ textWords.tableHeadNetAmount }}</th>\n <th>{{ textWords.vat }}</th>\n </tr>\n </thead>\n <tbody>\n @for (item of invoice().lineItems; track item; let i = $index) {\n <tr>\n <td>{{ i + 1 }}</td>\n <td>{{ item.itemInformation?.description }}</td>\n <td>{{ item.quantity }}</td>\n <td>{{ item.unitCode }}</td>\n <td>{{ item.priceDetails?.netPrice | currency: invoice().currencyCode }}</td>\n <td>{{ item.netAmount | currency: invoice().currencyCode }}</td>\n <td>{{ item.vatInformation[0]?.vatRate | percent: '1.0-2' }}</td>\n </tr>\n }\n </tbody>\n </table>\n\n <div class=\"addition-info\">\n <section class=\"invoice-totals\">\n <h2 class=\"info-title\">{{ textWords.totalsTopic }}</h2>\n\n @if (invoice().totals?.totalNet) {\n <p>\n <strong>{{ textWords.totalsTotalNet }}: </strong>\n <span>{{ invoice().totals?.totalNet | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalAllowances) {\n <p>\n <strong>{{ textWords.totalsTotalAllowances }}: </strong>\n <span> {{ invoice().totals?.totalAllowances | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalCharges) {\n <p>\n <strong>{{ textWords.totalsTotalCharges }}: </strong>\n <span> {{ invoice().totals?.totalCharges | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalAfterDeductions) {\n <p>\n <strong>{{ textWords.totalsTotalAfterDeductions }}: </strong>\n <span>{{ invoice().totals?.totalAfterDeductions | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalVatAmount) {\n <p>\n <strong>{{ textWords.totalsTotalVatAmount }}: </strong>\n <span>{{ invoice().totals?.totalVatAmount | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalGross) {\n <p>\n <strong>{{ textWords.totalsTotalGross }}: </strong>\n <span> {{ invoice().totals?.totalGross | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.alreadyPaidTotal) {\n <p>\n <strong>{{ textWords.totalsAlreadyPaidTotal }}: </strong>\n <span>{{ invoice().totals?.alreadyPaidTotal | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalToBePaid) {\n <p class=\"total\">\n <strong>{{ textWords.totalsTotalToBePaid }}: </strong>\n <strong> {{ invoice().totals?.totalToBePaid | currency: invoice().currencyCode }}</strong>\n </p>\n }\n </section>\n <section class=\"taxes\">\n <h2 class=\"info-title\">{{ textWords.taxesHeading }}</h2>\n <table class=\"tax-report-table\">\n <thead>\n <tr>\n <th>{{ textWords.vat }}</th>\n <th>{{ textWords.totalsTotalNet }}</th>\n <th>{{ textWords.totalsTotalVatAmount }}</th>\n </tr>\n </thead>\n <tbody>\n @for (tax of invoice().vatBreakdown; track tax.taxRate) {\n <tr>\n <td>\n @if (tax.taxRate) {\n <span>{{ tax.taxRate | percent: '1.0-2' }}</span>\n }\n </td>\n <td>\n @if (tax.netTaxableAmount) {\n <span>{{ tax.netTaxableAmount | currency: invoice().currencyCode }}</span>\n }\n </td>\n <td>\n @if (tax.vatAmount) {\n <span>{{ tax.vatAmount | currency: invoice().currencyCode }}</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </section>\n\n <section class=\"payment-instructions\">\n <h2 class=\"info-title\">{{ textWords.instructionsTopic }}</h2>\n @if (invoice().paymentInstructions?.description) {\n <p>{{ invoice().paymentInstructions?.description }}</p>\n }\n @for (means of invoice().paymentInstructions?.paymentMeans; track means) {\n <div>\n @if (means.accountIdentifier) {\n <p>\n <strong>{{ textWords.instructionsAccountIdentifier }}: </strong>\n <span>{{ means.accountIdentifier }}</span>\n </p>\n }\n @if (means.accountName) {\n <p>\n <strong>{{ textWords.instructionsAccountName }}: </strong>\n <span>{{ means.accountName }}</span>\n </p>\n }\n @if (means.serviceProviderIdentifier) {\n <p>\n <strong>{{ textWords.instructionsServiceProviderIdentifier }}: </strong>\n <span>{{ means.serviceProviderIdentifier }}</span>\n </p>\n }\n </div>\n }\n </section>\n </div>\n\n <section class=\"invoice-notes\">\n <h2>{{ textWords.notesTopic }}</h2>\n @for (note of invoice().invoiceNotes; track note) {\n <div>\n @if (note?.shortText) {\n <p>\n <strong>{{ note?.shortText }}</strong>\n </p>\n }\n @if (note?.longText) {\n <p>{{ note?.longText }}</p>\n }\n </div>\n }\n </section>\n @if (invoice().documents?.length) {\n <section class=\"invoice-attachments\">\n <ava-invoice-documents [documents]=\"invoice().documents\"></ava-invoice-documents>\n </section>\n }\n </div>\n}\n", styles: [".invoice-container{width:100%;max-width:800px;margin:auto;font-family:Arial,sans-serif;line-height:1.5}.invoice-header{display:flex;justify-content:space-between;margin-bottom:20px}.invoice-header .header{height:32px}.invoice-header .header-title{background:var(--color-primary);color:#fff;text-align:center}.seller-info,.buyer-info,.invoice-details{width:30%}.seller-info,.invoice-delivery,.payment-instructions{text-align:right}.invoice-title{font-size:48px;margin:20px 0}.invoice-references,.invoice-totals,.payment-instructions,.invoice-notes,.taxes,.invoice-delivery{margin:20px 0}.invoice-table{width:100%;border-collapse:collapse;margin:20px 0}.invoice-table th,.invoice-table td{border:1px solid #000;padding:8px;text-align:left}.invoice-table th{background-color:var(--color-primary)}.invoice-totals p,.payment-instructions p,.invoice-notes p{margin:5px 0}h2{font-size:18px;margin-bottom:10px}.addition-info{display:flex;justify-content:space-between;gap:10px}.total{background-color:var(--color-primary);color:#fff;padding:5px;border-radius:5px}th{color:#fff;text-wrap:nowrap}.invoice-attachments{padding-bottom:15px}.invoice-info{display:flex;justify-content:space-between;margin-bottom:20px}.info-title{border-bottom:2px solid var(--color-primary);text-align:center}.tax-report-table{width:100%;border-collapse:collapse;margin-top:10px}.tax-report-table th,.tax-report-table td{padding:12px;text-align:center;border:1px solid #ddd}.tax-report-table th{background-color:var(--color-primary);color:#fff;font-weight:700;border:1px solid #000}.tax-report-table td{font-size:14px;color:#333;border:1px solid #000}\n"], dependencies: [{ kind: "pipe", type: CurrencyPipe, name: "currency" }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: PercentPipe, name: "percent" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: InvoiceDocumentsComponent, selector: "ava-invoice-documents", inputs: ["documents"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1851
|
+
}
|
|
1852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: InvoiceDisplayComponent, decorators: [{
|
|
1853
|
+
type: Component,
|
|
1854
|
+
args: [{ selector: 'ava-invoice-display', imports: [CurrencyPipe, DatePipe, PercentPipe, AsyncPipe, MatDividerModule, InvoiceDocumentsComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfigurationInvoiceService], template: "@if (textWords$ | async; as textWords) {\n <div class=\"invoice-container\">\n <!-- Seller and Buyer Information -->\n <h1 class=\"invoice-title\">{{ textWords.invoiceTitle }}</h1>\n <header class=\"invoice-header\">\n <div class=\"buyer-info\">\n <h2 class=\"header-title\">{{ textWords.invoiceBuyerTitle }}</h2>\n <p>\n <strong>{{ invoice().buyer?.name }}</strong>\n </p>\n <p>{{ invoice().buyer?.address }}</p>\n <p>{{ invoice().buyer?.city }}, {{ invoice().buyer?.zipCode }}</p>\n <p>{{ invoice().buyer?.countryCode }}</p>\n @if (invoice().buyer?.vatId) {\n <p>\n <strong>{{ textWords.vatId }}: </strong>\n <span>{{ invoice().buyer?.vatId }}</span>\n </p>\n }\n <mat-divider></mat-divider>\n @if (invoice().buyer?.contactPersonName) {\n <p>\n <strong>{{ textWords.contactPersonName }}: </strong>\n <span>{{ invoice().buyer?.contactPersonName }}</span>\n </p>\n }\n @if (invoice().buyer?.contactPersonPhone) {\n <p>\n <strong>{{ textWords.contactPersonPhone }}: </strong>\n <span>{{ invoice().buyer?.contactPersonPhone }}</span>\n </p>\n }\n @if (invoice().buyer?.contactPersonEmail) {\n <p>\n <strong>{{ textWords.contactPersonEmail }}: </strong>\n <span>{{ invoice().buyer?.contactPersonEmail }}</span>\n </p>\n }\n </div>\n <div class=\"invoice-details\">\n <h2 [class.header]=\"textWords.invoiceBuyerTitle.trim() || textWords.invoiceSellerTitle.trim()\"></h2>\n @if (invoice().invoiceNumber) {\n <p>\n <strong>{{ textWords.detailsInvoiceNumber }}: </strong>\n <span>{{ invoice().invoiceNumber }}</span>\n </p>\n }\n @if (invoice().invoiceDate) {\n <p>\n <strong>{{ textWords.detailsInvoiceDate }}: </strong>\n <span>{{ invoice().invoiceDate | date: 'dd.MM.yyyy' }}</span>\n </p>\n }\n @if (invoice().paymentDueDate) {\n <p>\n <strong>{{ textWords.detailsPaymentDueDate }}: </strong>\n <span>{{ invoice().paymentDueDate | date: 'dd.MM.yyyy' }}</span>\n </p>\n }\n @if (invoice().currencyCode) {\n <p>\n <strong>{{ textWords.detailsCurrencyCode }}: </strong>\n <span>{{ invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().paymentTerms) {\n <p>\n <strong>{{ textWords.detailsPaymentTerms }}: </strong>\n <span>{{ invoice().paymentTerms }}</span>\n </p>\n }\n </div>\n <div class=\"seller-info\">\n <h2 class=\"header-title\">{{ textWords.invoiceSellerTitle }}</h2>\n <p>\n <strong>{{ invoice().seller?.name }}</strong>\n </p>\n <p>{{ invoice().seller?.address }}</p>\n <p>{{ invoice().seller?.city }}, {{ invoice().seller?.zipCode }}</p>\n <p>{{ invoice().seller?.countryCode }}</p>\n @if (invoice().seller?.vatId) {\n <p>\n <strong>{{ textWords.vatId }}: </strong>\n <span>{{ invoice().seller?.vatId }}</span>\n </p>\n }\n <mat-divider></mat-divider>\n @if (invoice().seller?.contactPersonName) {\n <p>\n <strong>{{ textWords.contactPersonName }}: </strong>\n <span>{{ invoice().seller?.contactPersonName }}</span>\n </p>\n }\n @if (invoice().seller?.contactPersonPhone) {\n <p>\n <strong>{{ textWords.contactPersonPhone }}: </strong>\n <span>{{ invoice().seller?.contactPersonPhone }}</span>\n </p>\n }\n @if (invoice().seller?.contactPersonEmail) {\n <p>\n <strong>{{ textWords.contactPersonEmail }}: </strong>\n <span>{{ invoice().seller?.contactPersonEmail }}</span>\n </p>\n }\n </div>\n </header>\n <mat-divider></mat-divider>\n <div class=\"invoice-info\">\n <section class=\"invoice-references\">\n @if (textWords.referencesTopic) {\n <h2 class=\"info-title\">{{ textWords.referencesTopic }}</h2>\n }\n @if (invoice().references?.buyerReference) {\n <p>\n <strong>{{ textWords.referencesBuyerReference }}: </strong>\n <span>{{ invoice().references?.buyerReference }}</span>\n </p>\n }\n @if (invoice().references?.projectReference) {\n <p>\n <strong>{{ textWords.referencesProjectReference }}: </strong>\n <span>{{ invoice().references?.projectReference }}</span>\n </p>\n }\n @if (invoice().references?.contractReference) {\n <p>\n <strong>{{ textWords.referencesContractReference }}: </strong>\n <span>{{ invoice().references?.contractReference }}</span>\n </p>\n }\n @if (invoice().references?.purchaseOrderReference) {\n <p>\n <strong>{{ textWords.referencesPurchaseOrderReference }}: </strong>\n <span>{{ invoice().references?.purchaseOrderReference }}</span>\n </p>\n }\n @if (invoice().references?.salesOrderReference) {\n <p>\n <strong>{{ textWords.referencesSalesOrderReference }}: </strong>\n <span>{{ invoice().references?.salesOrderReference }}</span>\n </p>\n }\n @if (invoice().references?.receivingAdviceReference) {\n <p>\n <strong>{{ textWords.referencesReceivingAdviceReference }}: </strong>\n <span>{{ invoice().references?.receivingAdviceReference }}</span>\n </p>\n }\n @if (invoice().references?.dispatchAdviceReference) {\n <p>\n <strong>{{ textWords.referencesDispatchAdviceReference }}: </strong>\n <span> {{ invoice().references?.dispatchAdviceReference }}</span>\n </p>\n }\n @if (invoice().references?.tenderOrLotReference) {\n <p>\n <strong>{{ textWords.referencesTenderOrLotReference }}: </strong>\n <span>{{ invoice().references?.tenderOrLotReference }}</span>\n </p>\n }\n @if (invoice().references?.invoicedObjectIdentifier) {\n <p>\n <strong>{{ textWords.referencesInvoicedObjectIdentifier }}: </strong>\n <span>{{ invoice().references?.invoicedObjectIdentifier }}</span>\n </p>\n }\n </section>\n @if (invoice().deliveryInformation) {\n <section class=\"invoice-delivery\">\n <h2 class=\"info-title\">{{ textWords.deliveryInformationTitle }}</h2>\n\n @if (invoice().deliveryInformation?.deliverToName) {\n <p>\n <strong>{{ textWords.deliverToName }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliverToName }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliverToLocationIdentifier) {\n <p>\n <strong>{{ textWords.deliverToLocationIdentifier }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliverToLocationIdentifier }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliveryDate) {\n <p>\n <strong>{{ textWords.deliveryDate }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliveryDate | date: 'shortDate' }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliveryAddress) {\n <p>\n <strong>{{ textWords.deliveryAddress }}: </strong>\n <span>\n @if (invoice().deliveryInformation?.deliveryAddress?.address) {\n <p>{{ invoice().deliveryInformation?.deliveryAddress?.address }}</p>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.city) {\n <span>{{ invoice().deliveryInformation?.deliveryAddress?.city }},</span>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.zipCode) {\n <span>{{ invoice().deliveryInformation?.deliveryAddress?.zipCode }}</span>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.countryCode) {\n <p>{{ invoice().deliveryInformation?.deliveryAddress?.countryCode }}</p>\n }\n </span>\n </p>\n }\n </section>\n }\n </div>\n\n <table class=\"invoice-table\">\n <thead>\n <tr>\n <th>#</th>\n <th>{{ textWords.tableHeadDescription }}</th>\n <th>{{ textWords.tableHeadQuantity }}</th>\n <th>{{ textWords.tableHeadUnit }}</th>\n <th>{{ textWords.tableHeadNetPrice }}</th>\n <th>{{ textWords.tableHeadNetAmount }}</th>\n <th>{{ textWords.vat }}</th>\n </tr>\n </thead>\n <tbody>\n @for (item of invoice().lineItems; track item; let i = $index) {\n <tr>\n <td>{{ i + 1 }}</td>\n <td>{{ item.itemInformation?.description }}</td>\n <td>{{ item.quantity }}</td>\n <td>{{ item.unitCode }}</td>\n <td>{{ item.priceDetails?.netPrice | currency: invoice().currencyCode }}</td>\n <td>{{ item.netAmount | currency: invoice().currencyCode }}</td>\n <td>{{ item.vatInformation[0]?.vatRate | percent: '1.0-2' }}</td>\n </tr>\n }\n </tbody>\n </table>\n\n <div class=\"addition-info\">\n <section class=\"invoice-totals\">\n <h2 class=\"info-title\">{{ textWords.totalsTopic }}</h2>\n\n @if (invoice().totals?.totalNet) {\n <p>\n <strong>{{ textWords.totalsTotalNet }}: </strong>\n <span>{{ invoice().totals?.totalNet | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalAllowances) {\n <p>\n <strong>{{ textWords.totalsTotalAllowances }}: </strong>\n <span> {{ invoice().totals?.totalAllowances | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalCharges) {\n <p>\n <strong>{{ textWords.totalsTotalCharges }}: </strong>\n <span> {{ invoice().totals?.totalCharges | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalAfterDeductions) {\n <p>\n <strong>{{ textWords.totalsTotalAfterDeductions }}: </strong>\n <span>{{ invoice().totals?.totalAfterDeductions | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalVatAmount) {\n <p>\n <strong>{{ textWords.totalsTotalVatAmount }}: </strong>\n <span>{{ invoice().totals?.totalVatAmount | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalGross) {\n <p>\n <strong>{{ textWords.totalsTotalGross }}: </strong>\n <span> {{ invoice().totals?.totalGross | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.alreadyPaidTotal) {\n <p>\n <strong>{{ textWords.totalsAlreadyPaidTotal }}: </strong>\n <span>{{ invoice().totals?.alreadyPaidTotal | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalToBePaid) {\n <p class=\"total\">\n <strong>{{ textWords.totalsTotalToBePaid }}: </strong>\n <strong> {{ invoice().totals?.totalToBePaid | currency: invoice().currencyCode }}</strong>\n </p>\n }\n </section>\n <section class=\"taxes\">\n <h2 class=\"info-title\">{{ textWords.taxesHeading }}</h2>\n <table class=\"tax-report-table\">\n <thead>\n <tr>\n <th>{{ textWords.vat }}</th>\n <th>{{ textWords.totalsTotalNet }}</th>\n <th>{{ textWords.totalsTotalVatAmount }}</th>\n </tr>\n </thead>\n <tbody>\n @for (tax of invoice().vatBreakdown; track tax.taxRate) {\n <tr>\n <td>\n @if (tax.taxRate) {\n <span>{{ tax.taxRate | percent: '1.0-2' }}</span>\n }\n </td>\n <td>\n @if (tax.netTaxableAmount) {\n <span>{{ tax.netTaxableAmount | currency: invoice().currencyCode }}</span>\n }\n </td>\n <td>\n @if (tax.vatAmount) {\n <span>{{ tax.vatAmount | currency: invoice().currencyCode }}</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </section>\n\n <section class=\"payment-instructions\">\n <h2 class=\"info-title\">{{ textWords.instructionsTopic }}</h2>\n @if (invoice().paymentInstructions?.description) {\n <p>{{ invoice().paymentInstructions?.description }}</p>\n }\n @for (means of invoice().paymentInstructions?.paymentMeans; track means) {\n <div>\n @if (means.accountIdentifier) {\n <p>\n <strong>{{ textWords.instructionsAccountIdentifier }}: </strong>\n <span>{{ means.accountIdentifier }}</span>\n </p>\n }\n @if (means.accountName) {\n <p>\n <strong>{{ textWords.instructionsAccountName }}: </strong>\n <span>{{ means.accountName }}</span>\n </p>\n }\n @if (means.serviceProviderIdentifier) {\n <p>\n <strong>{{ textWords.instructionsServiceProviderIdentifier }}: </strong>\n <span>{{ means.serviceProviderIdentifier }}</span>\n </p>\n }\n </div>\n }\n </section>\n </div>\n\n <section class=\"invoice-notes\">\n <h2>{{ textWords.notesTopic }}</h2>\n @for (note of invoice().invoiceNotes; track note) {\n <div>\n @if (note?.shortText) {\n <p>\n <strong>{{ note?.shortText }}</strong>\n </p>\n }\n @if (note?.longText) {\n <p>{{ note?.longText }}</p>\n }\n </div>\n }\n </section>\n @if (invoice().documents?.length) {\n <section class=\"invoice-attachments\">\n <ava-invoice-documents [documents]=\"invoice().documents\"></ava-invoice-documents>\n </section>\n }\n </div>\n}\n", styles: [".invoice-container{width:100%;max-width:800px;margin:auto;font-family:Arial,sans-serif;line-height:1.5}.invoice-header{display:flex;justify-content:space-between;margin-bottom:20px}.invoice-header .header{height:32px}.invoice-header .header-title{background:var(--color-primary);color:#fff;text-align:center}.seller-info,.buyer-info,.invoice-details{width:30%}.seller-info,.invoice-delivery,.payment-instructions{text-align:right}.invoice-title{font-size:48px;margin:20px 0}.invoice-references,.invoice-totals,.payment-instructions,.invoice-notes,.taxes,.invoice-delivery{margin:20px 0}.invoice-table{width:100%;border-collapse:collapse;margin:20px 0}.invoice-table th,.invoice-table td{border:1px solid #000;padding:8px;text-align:left}.invoice-table th{background-color:var(--color-primary)}.invoice-totals p,.payment-instructions p,.invoice-notes p{margin:5px 0}h2{font-size:18px;margin-bottom:10px}.addition-info{display:flex;justify-content:space-between;gap:10px}.total{background-color:var(--color-primary);color:#fff;padding:5px;border-radius:5px}th{color:#fff;text-wrap:nowrap}.invoice-attachments{padding-bottom:15px}.invoice-info{display:flex;justify-content:space-between;margin-bottom:20px}.info-title{border-bottom:2px solid var(--color-primary);text-align:center}.tax-report-table{width:100%;border-collapse:collapse;margin-top:10px}.tax-report-table th,.tax-report-table td{padding:12px;text-align:center;border:1px solid #ddd}.tax-report-table th{background-color:var(--color-primary);color:#fff;font-weight:700;border:1px solid #000}.tax-report-table td{font-size:14px;color:#333;border:1px solid #000}\n"] }]
|
|
1855
|
+
}], ctorParameters: () => [{ type: i1.ConfigurationInvoiceService }], propDecorators: { config: [{
|
|
1856
|
+
type: Input
|
|
1857
|
+
}] } });
|
|
1858
|
+
|
|
1768
1859
|
const DEFAULT_TEXT_WORD_INVOICE = {
|
|
1769
1860
|
invoiceTitle: 'Invoice',
|
|
1770
1861
|
invoiceBuyerTitle: 'Receiver',
|
|
@@ -1929,168 +2020,6 @@ var SourceType;
|
|
|
1929
2020
|
SourceType[SourceType["Cii"] = 2] = "Cii";
|
|
1930
2021
|
})(SourceType || (SourceType = {}));
|
|
1931
2022
|
|
|
1932
|
-
class InvoiceAttachmentMimeTypePipe {
|
|
1933
|
-
transform(attachmentMimeType) {
|
|
1934
|
-
switch (attachmentMimeType) {
|
|
1935
|
-
case AttachmentMimeType.Pdf:
|
|
1936
|
-
return 'PDF';
|
|
1937
|
-
case AttachmentMimeType.Png:
|
|
1938
|
-
return 'PNG';
|
|
1939
|
-
case AttachmentMimeType.Jpeg:
|
|
1940
|
-
return 'JPEG';
|
|
1941
|
-
case AttachmentMimeType.Csv:
|
|
1942
|
-
return 'CSV';
|
|
1943
|
-
case AttachmentMimeType.Excel:
|
|
1944
|
-
return 'Excel';
|
|
1945
|
-
case AttachmentMimeType.OpenOfficeSpreadsheet:
|
|
1946
|
-
return 'Open Office Spreadsheet';
|
|
1947
|
-
case AttachmentMimeType.Unknown:
|
|
1948
|
-
default:
|
|
1949
|
-
return 'Unknown';
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: InvoiceAttachmentMimeTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1953
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: InvoiceAttachmentMimeTypePipe, isStandalone: true, name: "invoiceAttachmentMimeType" }); }
|
|
1954
|
-
}
|
|
1955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: InvoiceAttachmentMimeTypePipe, decorators: [{
|
|
1956
|
-
type: Pipe,
|
|
1957
|
-
args: [{
|
|
1958
|
-
name: 'invoiceAttachmentMimeType',
|
|
1959
|
-
standalone: true
|
|
1960
|
-
}]
|
|
1961
|
-
}] });
|
|
1962
|
-
|
|
1963
|
-
class InvoiceDisplayComponent {
|
|
1964
|
-
/**
|
|
1965
|
-
* You can supply a map of strings to be used for the text in the tree. This allows you to translate
|
|
1966
|
-
* the text in the tree to other languages.
|
|
1967
|
-
* {
|
|
1968
|
-
* invoiceTitle: string;
|
|
1969
|
-
* vatId: string;
|
|
1970
|
-
* detailsInvoiceNumber: string;
|
|
1971
|
-
* detailsInvoiceDate: string;
|
|
1972
|
-
* detailsPaymentDueDate: string;
|
|
1973
|
-
* detailsCurrencyCode: string;
|
|
1974
|
-
* detailsPaymentTerms: string;
|
|
1975
|
-
* referencesTopic: string;
|
|
1976
|
-
* referencesBuyerReference: string;
|
|
1977
|
-
* referencesProjectReference: string;
|
|
1978
|
-
* referencesContractReference: string;
|
|
1979
|
-
* referencesPurchaseOrderReference: string;
|
|
1980
|
-
* referencesSalesOrderReference: string;
|
|
1981
|
-
* referencesReceivingAdviceReference: string;
|
|
1982
|
-
* referencesDispatchAdviceReference: string;
|
|
1983
|
-
* referencesTenderOrLotReference: string;
|
|
1984
|
-
* referencesInvoicedObjectIdentifier: string;
|
|
1985
|
-
* tableHeadDescription: string;
|
|
1986
|
-
* tableHeadQuantity: string;
|
|
1987
|
-
* tableHeadUnit: string;
|
|
1988
|
-
* tableHeadNetPrice: string;
|
|
1989
|
-
* tableHeadNetAmount: string;
|
|
1990
|
-
* totalsTopic: string;
|
|
1991
|
-
* totalsTotalNet: string;
|
|
1992
|
-
* totalsTotalAllowances: string;
|
|
1993
|
-
* totalsTotalCharges: string;
|
|
1994
|
-
* totalsTotalAfterDeductions: string;
|
|
1995
|
-
* totalsTotalVatAmount: string;
|
|
1996
|
-
* totalsTotalGross: string;
|
|
1997
|
-
* totalsAlreadyPaidTotal: string;
|
|
1998
|
-
* totalsTotalToBePaid: string;
|
|
1999
|
-
* instructionsTopic: string;
|
|
2000
|
-
* instructionsAccountIdentifier: string;
|
|
2001
|
-
* instructionsAccountName: string;
|
|
2002
|
-
* instructionsServiceProviderIdentifier: string;
|
|
2003
|
-
* notesTopic: string;
|
|
2004
|
-
* attachmentsHeading: string;
|
|
2005
|
-
* attachmentsName: string;
|
|
2006
|
-
* attachmentsDescription: string;
|
|
2007
|
-
* attachmentsUrl: string;
|
|
2008
|
-
* attachmentsDataSize: string;
|
|
2009
|
-
* attachmentsMimeType: string;
|
|
2010
|
-
* attachmentsFileName: string;
|
|
2011
|
-
* attachmentsDownloadButton: string;
|
|
2012
|
-
*
|
|
2013
|
-
* }
|
|
2014
|
-
*/
|
|
2015
|
-
get textWords() {
|
|
2016
|
-
return this._textWords;
|
|
2017
|
-
}
|
|
2018
|
-
set config(configObject) {
|
|
2019
|
-
if (configObject?.textWords) {
|
|
2020
|
-
this._textWords = { ...configObject?.textWords };
|
|
2021
|
-
}
|
|
2022
|
-
if ('isAttachmentDownload' in configObject) {
|
|
2023
|
-
this.isAttachmentDownload = !!configObject.isAttachmentDownload;
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
constructor() {
|
|
2027
|
-
// TODO remove type any after TODO under will be resolved
|
|
2028
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2029
|
-
this.invoice = input.required();
|
|
2030
|
-
this.isAttachmentDownload = false;
|
|
2031
|
-
this._textWords = { ...DEFAULT_TEXT_WORD_INVOICE };
|
|
2032
|
-
/**TODO: For setting invoice instead:
|
|
2033
|
-
* <ava-invoice-display id="invoice"></ava-invoice-display>
|
|
2034
|
-
* invoice = document.getElementById('invoice');
|
|
2035
|
-
* invoice.invoice = INVOICE;
|
|
2036
|
-
* we should pass value to global window variable
|
|
2037
|
-
* window['InvoiceGlobalVariable'] = INVOICE;
|
|
2038
|
-
* Temporary solution until the problem of setting the value for InputSignal is solved. See this PR https://github.com/angular/angular/pull/55067
|
|
2039
|
-
*/
|
|
2040
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2041
|
-
if (window['InvoiceGlobalVariable']) {
|
|
2042
|
-
this.invoice = () => {
|
|
2043
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2044
|
-
return window['InvoiceGlobalVariable'];
|
|
2045
|
-
};
|
|
2046
|
-
}
|
|
2047
|
-
}
|
|
2048
|
-
download(documentValue) {
|
|
2049
|
-
if (documentValue.externalDocumentUrl) {
|
|
2050
|
-
this.downloadLink(documentValue);
|
|
2051
|
-
}
|
|
2052
|
-
else {
|
|
2053
|
-
this.downloadAny(documentValue);
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2056
|
-
downloadAny(documentValue) {
|
|
2057
|
-
if (documentValue.documentBase64) {
|
|
2058
|
-
const byteCharacters = atob(documentValue.documentBase64);
|
|
2059
|
-
const byteNumbers = new Array(byteCharacters.length);
|
|
2060
|
-
for (let i = 0; i < byteCharacters.length; i++) {
|
|
2061
|
-
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
2062
|
-
}
|
|
2063
|
-
const byteArray = new Uint8Array(byteNumbers);
|
|
2064
|
-
const blob = new Blob([byteArray], { type: 'application/octet-stream' });
|
|
2065
|
-
this.saveAs(blob, documentValue.fileName);
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
async downloadLink(documentValue) {
|
|
2069
|
-
try {
|
|
2070
|
-
const response = await fetch(documentValue.externalDocumentUrl);
|
|
2071
|
-
const blob = await response.blob();
|
|
2072
|
-
this.saveAs(blob, documentValue.fileName);
|
|
2073
|
-
}
|
|
2074
|
-
catch (error) {
|
|
2075
|
-
console.error(error);
|
|
2076
|
-
}
|
|
2077
|
-
}
|
|
2078
|
-
saveAs(blob, fileName) {
|
|
2079
|
-
const link = document.createElement('a');
|
|
2080
|
-
link.href = URL.createObjectURL(blob);
|
|
2081
|
-
link.download = fileName;
|
|
2082
|
-
link.click();
|
|
2083
|
-
}
|
|
2084
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: InvoiceDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2085
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: InvoiceDisplayComponent, isStandalone: true, selector: "ava-invoice-display", inputs: { invoice: { classPropertyName: "invoice", publicName: "invoice", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"invoice-container\">\n <!-- Seller and Buyer Information -->\n <h1 class=\"invoice-title\">{{ textWords.invoiceTitle }}</h1>\n <header class=\"invoice-header\">\n <div class=\"buyer-info\">\n <h2 class=\"header-title\">{{ textWords.invoiceBuyerTitle }}</h2>\n <p>\n <strong>{{ invoice().buyer?.name }}</strong>\n </p>\n <p>{{ invoice().buyer?.address }}</p>\n <p>{{ invoice().buyer?.city }}, {{ invoice().buyer?.zipCode }}</p>\n <p>{{ invoice().buyer?.countryCode }}</p>\n @if (invoice().buyer?.vatId) {\n <p>\n <strong>{{ textWords.vatId }}: </strong>\n <span>{{ invoice().buyer?.vatId }}</span>\n </p>\n }\n <mat-divider></mat-divider>\n @if (invoice().buyer?.contactPersonName) {\n <p>\n <strong>{{ textWords.contactPersonName }}: </strong>\n <span>{{ invoice().buyer?.contactPersonName }}</span>\n </p>\n }\n @if (invoice().buyer?.contactPersonPhone) {\n <p>\n <strong>{{ textWords.contactPersonPhone }}: </strong>\n <span>{{ invoice().buyer?.contactPersonPhone }}</span>\n </p>\n }\n @if (invoice().buyer?.contactPersonEmail) {\n <p>\n <strong>{{ textWords.contactPersonEmail }}: </strong>\n <span>{{ invoice().buyer?.contactPersonEmail }}</span>\n </p>\n }\n </div>\n <div class=\"invoice-details\">\n <h2 [class.header]=\"textWords.invoiceBuyerTitle.trim() || textWords.invoiceSellerTitle.trim()\"></h2>\n @if (invoice().invoiceNumber) {\n <p>\n <strong>{{ textWords.detailsInvoiceNumber }}: </strong>\n <span>{{ invoice().invoiceNumber }}</span>\n </p>\n }\n @if (invoice().invoiceDate) {\n <p>\n <strong>{{ textWords.detailsInvoiceDate }}: </strong>\n <span>{{ invoice().invoiceDate | date: 'dd.MM.yyyy' }}</span>\n </p>\n }\n @if (invoice().paymentDueDate) {\n <p>\n <strong>{{ textWords.detailsPaymentDueDate }}: </strong>\n <span>{{ invoice().paymentDueDate | date: 'dd.MM.yyyy' }}</span>\n </p>\n }\n @if (invoice().currencyCode) {\n <p>\n <strong>{{ textWords.detailsCurrencyCode }}: </strong>\n <span>{{ invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().paymentTerms) {\n <p>\n <strong>{{ textWords.detailsPaymentTerms }}: </strong>\n <span>{{ invoice().paymentTerms }}</span>\n </p>\n }\n </div>\n <div class=\"seller-info\">\n <h2 class=\"header-title\">{{ textWords.invoiceSellerTitle }}</h2>\n <p>\n <strong>{{ invoice().seller?.name }}</strong>\n </p>\n <p>{{ invoice().seller?.address }}</p>\n <p>{{ invoice().seller?.city }}, {{ invoice().seller?.zipCode }}</p>\n <p>{{ invoice().seller?.countryCode }}</p>\n @if (invoice().seller?.vatId) {\n <p>\n <strong>{{ textWords.vatId }}: </strong>\n <span>{{ invoice().seller?.vatId }}</span>\n </p>\n }\n <mat-divider></mat-divider>\n @if (invoice().seller?.contactPersonName) {\n <p>\n <strong>{{ textWords.contactPersonName }}: </strong>\n <span>{{ invoice().seller?.contactPersonName }}</span>\n </p>\n }\n @if (invoice().seller?.contactPersonPhone) {\n <p>\n <strong>{{ textWords.contactPersonPhone }}: </strong>\n <span>{{ invoice().seller?.contactPersonPhone }}</span>\n </p>\n }\n @if (invoice().seller?.contactPersonEmail) {\n <p>\n <strong>{{ textWords.contactPersonEmail }}: </strong>\n <span>{{ invoice().seller?.contactPersonEmail }}</span>\n </p>\n }\n </div>\n </header>\n <mat-divider></mat-divider>\n <div class=\"invoice-info\">\n <section class=\"invoice-references\">\n @if (textWords.referencesTopic) {\n <h2 class=\"info-title\">{{ textWords.referencesTopic }}</h2>\n }\n @if (invoice().references?.buyerReference) {\n <p>\n <strong>{{ textWords.referencesBuyerReference }}: </strong>\n <span>{{ invoice().references?.buyerReference }}</span>\n </p>\n }\n @if (invoice().references?.projectReference) {\n <p>\n <strong>{{ textWords.referencesProjectReference }}: </strong>\n <span>{{ invoice().references?.projectReference }}</span>\n </p>\n }\n @if (invoice().references?.contractReference) {\n <p>\n <strong>{{ textWords.referencesContractReference }}: </strong>\n <span>{{ invoice().references?.contractReference }}</span>\n </p>\n }\n @if (invoice().references?.purchaseOrderReference) {\n <p>\n <strong>{{ textWords.referencesPurchaseOrderReference }}: </strong>\n <span>{{ invoice().references?.purchaseOrderReference }}</span>\n </p>\n }\n @if (invoice().references?.salesOrderReference) {\n <p>\n <strong>{{ textWords.referencesSalesOrderReference }}: </strong>\n <span>{{ invoice().references?.salesOrderReference }}</span>\n </p>\n }\n @if (invoice().references?.receivingAdviceReference) {\n <p>\n <strong>{{ textWords.referencesReceivingAdviceReference }}: </strong>\n <span>{{ invoice().references?.receivingAdviceReference }}</span>\n </p>\n }\n @if (invoice().references?.dispatchAdviceReference) {\n <p>\n <strong>{{ textWords.referencesDispatchAdviceReference }}: </strong>\n <span> {{ invoice().references?.dispatchAdviceReference }}</span>\n </p>\n }\n @if (invoice().references?.tenderOrLotReference) {\n <p>\n <strong>{{ textWords.referencesTenderOrLotReference }}: </strong>\n <span>{{ invoice().references?.tenderOrLotReference }}</span>\n </p>\n }\n @if (invoice().references?.invoicedObjectIdentifier) {\n <p>\n <strong>{{ textWords.referencesInvoicedObjectIdentifier }}: </strong>\n <span>{{ invoice().references?.invoicedObjectIdentifier }}</span>\n </p>\n }\n </section>\n @if (invoice().deliveryInformation) {\n <section class=\"invoice-delivery\">\n <h2 class=\"info-title\">{{ textWords.deliveryInformationTitle }}</h2>\n\n @if (invoice().deliveryInformation?.deliverToName) {\n <p>\n <strong>{{ textWords.deliverToName }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliverToName }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliverToLocationIdentifier) {\n <p>\n <strong>{{ textWords.deliverToLocationIdentifier }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliverToLocationIdentifier }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliveryDate) {\n <p>\n <strong>{{ textWords.deliveryDate }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliveryDate | date: 'shortDate' }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliveryAddress) {\n <p>\n <strong>{{ textWords.deliveryAddress }}: </strong>\n <span>\n @if (invoice().deliveryInformation?.deliveryAddress?.address) {\n <p>{{ invoice().deliveryInformation?.deliveryAddress?.address }}</p>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.city) {\n <span>{{ invoice().deliveryInformation?.deliveryAddress?.city }},</span>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.zipCode) {\n <span>{{ invoice().deliveryInformation?.deliveryAddress?.zipCode }}</span>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.countryCode) {\n <p>{{ invoice().deliveryInformation?.deliveryAddress?.countryCode }}</p>\n }\n </span>\n </p>\n }\n </section>\n }\n </div>\n\n <table class=\"invoice-table\">\n <thead>\n <tr>\n <th>#</th>\n <th>{{ textWords.tableHeadDescription }}</th>\n <th>{{ textWords.tableHeadQuantity }}</th>\n <th>{{ textWords.tableHeadUnit }}</th>\n <th>{{ textWords.tableHeadNetPrice }}</th>\n <th>{{ textWords.tableHeadNetAmount }}</th>\n <th>{{ textWords.vat }}</th>\n </tr>\n </thead>\n <tbody>\n @for (item of invoice().lineItems; track item; let i = $index) {\n <tr>\n <td>{{ i + 1 }}</td>\n <td>{{ item.itemInformation?.description }}</td>\n <td>{{ item.quantity }}</td>\n <td>{{ item.unitCode }}</td>\n <td>{{ item.priceDetails?.netPrice | currency: invoice().currencyCode }}</td>\n <td>{{ item.netAmount | currency: invoice().currencyCode }}</td>\n <td>{{ item.vatInformation[0]?.vatRate | percent: '1.0-2' }}</td>\n </tr>\n }\n </tbody>\n </table>\n\n <div class=\"addition-info\">\n <section class=\"invoice-totals\">\n <h2 class=\"info-title\">{{ textWords.totalsTopic }}</h2>\n\n @if (invoice().totals?.totalNet) {\n <p>\n <strong>{{ textWords.totalsTotalNet }}: </strong>\n <span>{{ invoice().totals?.totalNet | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalAllowances) {\n <p>\n <strong>{{ textWords.totalsTotalAllowances }}: </strong>\n <span> {{ invoice().totals?.totalAllowances | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalCharges) {\n <p>\n <strong>{{ textWords.totalsTotalCharges }}: </strong>\n <span> {{ invoice().totals?.totalCharges | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalAfterDeductions) {\n <p>\n <strong>{{ textWords.totalsTotalAfterDeductions }}: </strong>\n <span>{{ invoice().totals?.totalAfterDeductions | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalVatAmount) {\n <p>\n <strong>{{ textWords.totalsTotalVatAmount }}: </strong>\n <span>{{ invoice().totals?.totalVatAmount | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalGross) {\n <p>\n <strong>{{ textWords.totalsTotalGross }}: </strong>\n <span> {{ invoice().totals?.totalGross | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.alreadyPaidTotal) {\n <p>\n <strong>{{ textWords.totalsAlreadyPaidTotal }}: </strong>\n <span>{{ invoice().totals?.alreadyPaidTotal | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalToBePaid) {\n <p class=\"total\">\n <strong>{{ textWords.totalsTotalToBePaid }}: </strong>\n <strong> {{ invoice().totals?.totalToBePaid | currency: invoice().currencyCode }}</strong>\n </p>\n }\n </section>\n <section class=\"taxes\">\n <h2 class=\"info-title\">{{ textWords.taxesHeading }}</h2>\n <table class=\"tax-report-table\">\n <thead>\n <tr>\n <th>{{ textWords.vat }}</th>\n <th>{{ textWords.totalsTotalNet }}</th>\n <th>{{ textWords.totalsTotalVatAmount }}</th>\n </tr>\n </thead>\n <tbody>\n @for (tax of invoice().vatBreakdown; track tax.taxRate) {\n <tr>\n <td>\n @if (tax.taxRate) {\n <span>{{ tax.taxRate | percent: '1.0-2' }}</span>\n }\n </td>\n <td>\n @if (tax.netTaxableAmount) {\n <span>{{ tax.netTaxableAmount | currency: invoice().currencyCode }}</span>\n }\n </td>\n <td>\n @if (tax.vatAmount) {\n <span>{{ tax.vatAmount | currency: invoice().currencyCode }}</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </section>\n\n <section class=\"payment-instructions\">\n <h2 class=\"info-title\">{{ textWords.instructionsTopic }}</h2>\n @if (invoice().paymentInstructions?.description) {\n <p>{{ invoice().paymentInstructions?.description }}</p>\n }\n @for (means of invoice().paymentInstructions?.paymentMeans; track means) {\n <div>\n @if (means.accountIdentifier) {\n <p>\n <strong>{{ textWords.instructionsAccountIdentifier }}: </strong>\n <span>{{ means.accountIdentifier }}</span>\n </p>\n }\n @if (means.accountName) {\n <p>\n <strong>{{ textWords.instructionsAccountName }}: </strong>\n <span>{{ means.accountName }}</span>\n </p>\n }\n @if (means.serviceProviderIdentifier) {\n <p>\n <strong>{{ textWords.instructionsServiceProviderIdentifier }}: </strong>\n <span>{{ means.serviceProviderIdentifier }}</span>\n </p>\n }\n </div>\n }\n </section>\n </div>\n\n <section class=\"invoice-notes\">\n <h2>{{ textWords.notesTopic }}</h2>\n @for (note of invoice().invoiceNotes; track note) {\n <div>\n @if (note?.shortText) {\n <p>\n <strong>{{ note?.shortText }}</strong>\n </p>\n }\n @if (note?.longText) {\n <p>{{ note?.longText }}</p>\n }\n </div>\n }\n </section>\n\n @if (invoice().documents?.length) {\n <section class=\"invoice-attachments\">\n <mat-accordion>\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>{{ textWords.attachmentsHeading }}</mat-panel-title>\n </mat-expansion-panel-header>\n @for (document of invoice().documents; track document) {\n <div class=\"document\">\n @if (document.documentReference) {\n <div>\n <strong>{{ textWords.attachmentsName }}: </strong>\n <span>{{ document.documentReference }}</span>\n </div>\n }\n @if (document.description) {\n <div>\n <strong>{{ textWords.attachmentsDescription }}: </strong>\n <span>{{ document.description }}</span>\n </div>\n }\n @if (document.externalDocumentUrl) {\n <div>\n <strong>{{ textWords.attachmentsUrl }}: </strong>\n <span>{{ document.externalDocumentUrl }}</span>\n </div>\n } @else if (document.documentBase64) {\n <div>\n <strong>{{ textWords.attachmentsDataSize }}: </strong>\n <span>{{ document.documentBase64.length }}</span>\n </div>\n\n @if (document.documentMimeType) {\n <div>\n <strong>{{ textWords.attachmentsMimeType }}: </strong>\n <span>{{ document.documentMimeType | invoiceAttachmentMimeType }}</span>\n </div>\n }\n }\n @if (document.fileName) {\n <div>\n <strong>{{ textWords.attachmentsFileName }}: </strong>\n <span>{{ document.fileName }}</span>\n </div>\n }\n @if (isAttachmentDownload) {\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"download(document)\"\n [disabled]=\"!document.externalDocumentUrl && !document.documentBase64\"\n >\n {{ textWords.attachmentsDownloadButton }}\n </button>\n }\n </div>\n }\n <pre id=\"fileContent\"></pre>\n </mat-expansion-panel>\n </mat-accordion>\n </section>\n }\n</div>\n", styles: [".invoice-container{width:100%;max-width:800px;margin:auto;font-family:Arial,sans-serif;line-height:1.5}.invoice-header{display:flex;justify-content:space-between;margin-bottom:20px}.invoice-header .header{height:32px}.invoice-header .header-title{background:var(--color-primary);color:#fff;text-align:center}.seller-info,.buyer-info,.invoice-details{width:30%}.seller-info,.invoice-delivery,.payment-instructions{text-align:right}.invoice-title{font-size:48px;margin:20px 0}.invoice-references,.invoice-totals,.payment-instructions,.invoice-notes,.taxes,.invoice-delivery{margin:20px 0}.invoice-table{width:100%;border-collapse:collapse;margin:20px 0}.invoice-table th,.invoice-table td{border:1px solid #000;padding:8px;text-align:left}.invoice-table th{background-color:var(--color-primary)}.invoice-totals p,.payment-instructions p,.invoice-notes p{margin:5px 0}h2{font-size:18px;margin-bottom:10px}.addition-info{display:flex;justify-content:space-between;gap:10px}.total{background-color:var(--color-primary);color:#fff;padding:5px;border-radius:5px}th{color:#fff;text-wrap:nowrap}.invoice-attachments,.document{padding-bottom:15px}.invoice-info{display:flex;justify-content:space-between;margin-bottom:20px}.info-title{border-bottom:2px solid var(--color-primary);text-align:center}.tax-report-table{width:100%;border-collapse:collapse;margin-top:10px}.tax-report-table th,.tax-report-table td{padding:12px;text-align:center;border:1px solid #ddd}.tax-report-table th{background-color:var(--color-primary);color:#fff;font-weight:700;border:1px solid #000}.tax-report-table td{font-size:14px;color:#333;border:1px solid #000}\n"], dependencies: [{ kind: "pipe", type: CurrencyPipe, name: "currency" }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: PercentPipe, name: "percent" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i2.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i2.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "pipe", type: InvoiceAttachmentMimeTypePipe, name: "invoiceAttachmentMimeType" }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i3$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2086
|
-
}
|
|
2087
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: InvoiceDisplayComponent, decorators: [{
|
|
2088
|
-
type: Component,
|
|
2089
|
-
args: [{ selector: 'ava-invoice-display', imports: [CurrencyPipe, DatePipe, PercentPipe, MatButtonModule, MatExpansionModule, InvoiceAttachmentMimeTypePipe, MatDividerModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"invoice-container\">\n <!-- Seller and Buyer Information -->\n <h1 class=\"invoice-title\">{{ textWords.invoiceTitle }}</h1>\n <header class=\"invoice-header\">\n <div class=\"buyer-info\">\n <h2 class=\"header-title\">{{ textWords.invoiceBuyerTitle }}</h2>\n <p>\n <strong>{{ invoice().buyer?.name }}</strong>\n </p>\n <p>{{ invoice().buyer?.address }}</p>\n <p>{{ invoice().buyer?.city }}, {{ invoice().buyer?.zipCode }}</p>\n <p>{{ invoice().buyer?.countryCode }}</p>\n @if (invoice().buyer?.vatId) {\n <p>\n <strong>{{ textWords.vatId }}: </strong>\n <span>{{ invoice().buyer?.vatId }}</span>\n </p>\n }\n <mat-divider></mat-divider>\n @if (invoice().buyer?.contactPersonName) {\n <p>\n <strong>{{ textWords.contactPersonName }}: </strong>\n <span>{{ invoice().buyer?.contactPersonName }}</span>\n </p>\n }\n @if (invoice().buyer?.contactPersonPhone) {\n <p>\n <strong>{{ textWords.contactPersonPhone }}: </strong>\n <span>{{ invoice().buyer?.contactPersonPhone }}</span>\n </p>\n }\n @if (invoice().buyer?.contactPersonEmail) {\n <p>\n <strong>{{ textWords.contactPersonEmail }}: </strong>\n <span>{{ invoice().buyer?.contactPersonEmail }}</span>\n </p>\n }\n </div>\n <div class=\"invoice-details\">\n <h2 [class.header]=\"textWords.invoiceBuyerTitle.trim() || textWords.invoiceSellerTitle.trim()\"></h2>\n @if (invoice().invoiceNumber) {\n <p>\n <strong>{{ textWords.detailsInvoiceNumber }}: </strong>\n <span>{{ invoice().invoiceNumber }}</span>\n </p>\n }\n @if (invoice().invoiceDate) {\n <p>\n <strong>{{ textWords.detailsInvoiceDate }}: </strong>\n <span>{{ invoice().invoiceDate | date: 'dd.MM.yyyy' }}</span>\n </p>\n }\n @if (invoice().paymentDueDate) {\n <p>\n <strong>{{ textWords.detailsPaymentDueDate }}: </strong>\n <span>{{ invoice().paymentDueDate | date: 'dd.MM.yyyy' }}</span>\n </p>\n }\n @if (invoice().currencyCode) {\n <p>\n <strong>{{ textWords.detailsCurrencyCode }}: </strong>\n <span>{{ invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().paymentTerms) {\n <p>\n <strong>{{ textWords.detailsPaymentTerms }}: </strong>\n <span>{{ invoice().paymentTerms }}</span>\n </p>\n }\n </div>\n <div class=\"seller-info\">\n <h2 class=\"header-title\">{{ textWords.invoiceSellerTitle }}</h2>\n <p>\n <strong>{{ invoice().seller?.name }}</strong>\n </p>\n <p>{{ invoice().seller?.address }}</p>\n <p>{{ invoice().seller?.city }}, {{ invoice().seller?.zipCode }}</p>\n <p>{{ invoice().seller?.countryCode }}</p>\n @if (invoice().seller?.vatId) {\n <p>\n <strong>{{ textWords.vatId }}: </strong>\n <span>{{ invoice().seller?.vatId }}</span>\n </p>\n }\n <mat-divider></mat-divider>\n @if (invoice().seller?.contactPersonName) {\n <p>\n <strong>{{ textWords.contactPersonName }}: </strong>\n <span>{{ invoice().seller?.contactPersonName }}</span>\n </p>\n }\n @if (invoice().seller?.contactPersonPhone) {\n <p>\n <strong>{{ textWords.contactPersonPhone }}: </strong>\n <span>{{ invoice().seller?.contactPersonPhone }}</span>\n </p>\n }\n @if (invoice().seller?.contactPersonEmail) {\n <p>\n <strong>{{ textWords.contactPersonEmail }}: </strong>\n <span>{{ invoice().seller?.contactPersonEmail }}</span>\n </p>\n }\n </div>\n </header>\n <mat-divider></mat-divider>\n <div class=\"invoice-info\">\n <section class=\"invoice-references\">\n @if (textWords.referencesTopic) {\n <h2 class=\"info-title\">{{ textWords.referencesTopic }}</h2>\n }\n @if (invoice().references?.buyerReference) {\n <p>\n <strong>{{ textWords.referencesBuyerReference }}: </strong>\n <span>{{ invoice().references?.buyerReference }}</span>\n </p>\n }\n @if (invoice().references?.projectReference) {\n <p>\n <strong>{{ textWords.referencesProjectReference }}: </strong>\n <span>{{ invoice().references?.projectReference }}</span>\n </p>\n }\n @if (invoice().references?.contractReference) {\n <p>\n <strong>{{ textWords.referencesContractReference }}: </strong>\n <span>{{ invoice().references?.contractReference }}</span>\n </p>\n }\n @if (invoice().references?.purchaseOrderReference) {\n <p>\n <strong>{{ textWords.referencesPurchaseOrderReference }}: </strong>\n <span>{{ invoice().references?.purchaseOrderReference }}</span>\n </p>\n }\n @if (invoice().references?.salesOrderReference) {\n <p>\n <strong>{{ textWords.referencesSalesOrderReference }}: </strong>\n <span>{{ invoice().references?.salesOrderReference }}</span>\n </p>\n }\n @if (invoice().references?.receivingAdviceReference) {\n <p>\n <strong>{{ textWords.referencesReceivingAdviceReference }}: </strong>\n <span>{{ invoice().references?.receivingAdviceReference }}</span>\n </p>\n }\n @if (invoice().references?.dispatchAdviceReference) {\n <p>\n <strong>{{ textWords.referencesDispatchAdviceReference }}: </strong>\n <span> {{ invoice().references?.dispatchAdviceReference }}</span>\n </p>\n }\n @if (invoice().references?.tenderOrLotReference) {\n <p>\n <strong>{{ textWords.referencesTenderOrLotReference }}: </strong>\n <span>{{ invoice().references?.tenderOrLotReference }}</span>\n </p>\n }\n @if (invoice().references?.invoicedObjectIdentifier) {\n <p>\n <strong>{{ textWords.referencesInvoicedObjectIdentifier }}: </strong>\n <span>{{ invoice().references?.invoicedObjectIdentifier }}</span>\n </p>\n }\n </section>\n @if (invoice().deliveryInformation) {\n <section class=\"invoice-delivery\">\n <h2 class=\"info-title\">{{ textWords.deliveryInformationTitle }}</h2>\n\n @if (invoice().deliveryInformation?.deliverToName) {\n <p>\n <strong>{{ textWords.deliverToName }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliverToName }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliverToLocationIdentifier) {\n <p>\n <strong>{{ textWords.deliverToLocationIdentifier }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliverToLocationIdentifier }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliveryDate) {\n <p>\n <strong>{{ textWords.deliveryDate }}: </strong>\n <span>{{ invoice().deliveryInformation?.deliveryDate | date: 'shortDate' }}</span>\n </p>\n }\n @if (invoice().deliveryInformation?.deliveryAddress) {\n <p>\n <strong>{{ textWords.deliveryAddress }}: </strong>\n <span>\n @if (invoice().deliveryInformation?.deliveryAddress?.address) {\n <p>{{ invoice().deliveryInformation?.deliveryAddress?.address }}</p>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.city) {\n <span>{{ invoice().deliveryInformation?.deliveryAddress?.city }},</span>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.zipCode) {\n <span>{{ invoice().deliveryInformation?.deliveryAddress?.zipCode }}</span>\n }\n @if (invoice().deliveryInformation?.deliveryAddress?.countryCode) {\n <p>{{ invoice().deliveryInformation?.deliveryAddress?.countryCode }}</p>\n }\n </span>\n </p>\n }\n </section>\n }\n </div>\n\n <table class=\"invoice-table\">\n <thead>\n <tr>\n <th>#</th>\n <th>{{ textWords.tableHeadDescription }}</th>\n <th>{{ textWords.tableHeadQuantity }}</th>\n <th>{{ textWords.tableHeadUnit }}</th>\n <th>{{ textWords.tableHeadNetPrice }}</th>\n <th>{{ textWords.tableHeadNetAmount }}</th>\n <th>{{ textWords.vat }}</th>\n </tr>\n </thead>\n <tbody>\n @for (item of invoice().lineItems; track item; let i = $index) {\n <tr>\n <td>{{ i + 1 }}</td>\n <td>{{ item.itemInformation?.description }}</td>\n <td>{{ item.quantity }}</td>\n <td>{{ item.unitCode }}</td>\n <td>{{ item.priceDetails?.netPrice | currency: invoice().currencyCode }}</td>\n <td>{{ item.netAmount | currency: invoice().currencyCode }}</td>\n <td>{{ item.vatInformation[0]?.vatRate | percent: '1.0-2' }}</td>\n </tr>\n }\n </tbody>\n </table>\n\n <div class=\"addition-info\">\n <section class=\"invoice-totals\">\n <h2 class=\"info-title\">{{ textWords.totalsTopic }}</h2>\n\n @if (invoice().totals?.totalNet) {\n <p>\n <strong>{{ textWords.totalsTotalNet }}: </strong>\n <span>{{ invoice().totals?.totalNet | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalAllowances) {\n <p>\n <strong>{{ textWords.totalsTotalAllowances }}: </strong>\n <span> {{ invoice().totals?.totalAllowances | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalCharges) {\n <p>\n <strong>{{ textWords.totalsTotalCharges }}: </strong>\n <span> {{ invoice().totals?.totalCharges | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalAfterDeductions) {\n <p>\n <strong>{{ textWords.totalsTotalAfterDeductions }}: </strong>\n <span>{{ invoice().totals?.totalAfterDeductions | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalVatAmount) {\n <p>\n <strong>{{ textWords.totalsTotalVatAmount }}: </strong>\n <span>{{ invoice().totals?.totalVatAmount | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalGross) {\n <p>\n <strong>{{ textWords.totalsTotalGross }}: </strong>\n <span> {{ invoice().totals?.totalGross | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.alreadyPaidTotal) {\n <p>\n <strong>{{ textWords.totalsAlreadyPaidTotal }}: </strong>\n <span>{{ invoice().totals?.alreadyPaidTotal | currency: invoice().currencyCode }}</span>\n </p>\n }\n @if (invoice().totals?.totalToBePaid) {\n <p class=\"total\">\n <strong>{{ textWords.totalsTotalToBePaid }}: </strong>\n <strong> {{ invoice().totals?.totalToBePaid | currency: invoice().currencyCode }}</strong>\n </p>\n }\n </section>\n <section class=\"taxes\">\n <h2 class=\"info-title\">{{ textWords.taxesHeading }}</h2>\n <table class=\"tax-report-table\">\n <thead>\n <tr>\n <th>{{ textWords.vat }}</th>\n <th>{{ textWords.totalsTotalNet }}</th>\n <th>{{ textWords.totalsTotalVatAmount }}</th>\n </tr>\n </thead>\n <tbody>\n @for (tax of invoice().vatBreakdown; track tax.taxRate) {\n <tr>\n <td>\n @if (tax.taxRate) {\n <span>{{ tax.taxRate | percent: '1.0-2' }}</span>\n }\n </td>\n <td>\n @if (tax.netTaxableAmount) {\n <span>{{ tax.netTaxableAmount | currency: invoice().currencyCode }}</span>\n }\n </td>\n <td>\n @if (tax.vatAmount) {\n <span>{{ tax.vatAmount | currency: invoice().currencyCode }}</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </section>\n\n <section class=\"payment-instructions\">\n <h2 class=\"info-title\">{{ textWords.instructionsTopic }}</h2>\n @if (invoice().paymentInstructions?.description) {\n <p>{{ invoice().paymentInstructions?.description }}</p>\n }\n @for (means of invoice().paymentInstructions?.paymentMeans; track means) {\n <div>\n @if (means.accountIdentifier) {\n <p>\n <strong>{{ textWords.instructionsAccountIdentifier }}: </strong>\n <span>{{ means.accountIdentifier }}</span>\n </p>\n }\n @if (means.accountName) {\n <p>\n <strong>{{ textWords.instructionsAccountName }}: </strong>\n <span>{{ means.accountName }}</span>\n </p>\n }\n @if (means.serviceProviderIdentifier) {\n <p>\n <strong>{{ textWords.instructionsServiceProviderIdentifier }}: </strong>\n <span>{{ means.serviceProviderIdentifier }}</span>\n </p>\n }\n </div>\n }\n </section>\n </div>\n\n <section class=\"invoice-notes\">\n <h2>{{ textWords.notesTopic }}</h2>\n @for (note of invoice().invoiceNotes; track note) {\n <div>\n @if (note?.shortText) {\n <p>\n <strong>{{ note?.shortText }}</strong>\n </p>\n }\n @if (note?.longText) {\n <p>{{ note?.longText }}</p>\n }\n </div>\n }\n </section>\n\n @if (invoice().documents?.length) {\n <section class=\"invoice-attachments\">\n <mat-accordion>\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>{{ textWords.attachmentsHeading }}</mat-panel-title>\n </mat-expansion-panel-header>\n @for (document of invoice().documents; track document) {\n <div class=\"document\">\n @if (document.documentReference) {\n <div>\n <strong>{{ textWords.attachmentsName }}: </strong>\n <span>{{ document.documentReference }}</span>\n </div>\n }\n @if (document.description) {\n <div>\n <strong>{{ textWords.attachmentsDescription }}: </strong>\n <span>{{ document.description }}</span>\n </div>\n }\n @if (document.externalDocumentUrl) {\n <div>\n <strong>{{ textWords.attachmentsUrl }}: </strong>\n <span>{{ document.externalDocumentUrl }}</span>\n </div>\n } @else if (document.documentBase64) {\n <div>\n <strong>{{ textWords.attachmentsDataSize }}: </strong>\n <span>{{ document.documentBase64.length }}</span>\n </div>\n\n @if (document.documentMimeType) {\n <div>\n <strong>{{ textWords.attachmentsMimeType }}: </strong>\n <span>{{ document.documentMimeType | invoiceAttachmentMimeType }}</span>\n </div>\n }\n }\n @if (document.fileName) {\n <div>\n <strong>{{ textWords.attachmentsFileName }}: </strong>\n <span>{{ document.fileName }}</span>\n </div>\n }\n @if (isAttachmentDownload) {\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"download(document)\"\n [disabled]=\"!document.externalDocumentUrl && !document.documentBase64\"\n >\n {{ textWords.attachmentsDownloadButton }}\n </button>\n }\n </div>\n }\n <pre id=\"fileContent\"></pre>\n </mat-expansion-panel>\n </mat-accordion>\n </section>\n }\n</div>\n", styles: [".invoice-container{width:100%;max-width:800px;margin:auto;font-family:Arial,sans-serif;line-height:1.5}.invoice-header{display:flex;justify-content:space-between;margin-bottom:20px}.invoice-header .header{height:32px}.invoice-header .header-title{background:var(--color-primary);color:#fff;text-align:center}.seller-info,.buyer-info,.invoice-details{width:30%}.seller-info,.invoice-delivery,.payment-instructions{text-align:right}.invoice-title{font-size:48px;margin:20px 0}.invoice-references,.invoice-totals,.payment-instructions,.invoice-notes,.taxes,.invoice-delivery{margin:20px 0}.invoice-table{width:100%;border-collapse:collapse;margin:20px 0}.invoice-table th,.invoice-table td{border:1px solid #000;padding:8px;text-align:left}.invoice-table th{background-color:var(--color-primary)}.invoice-totals p,.payment-instructions p,.invoice-notes p{margin:5px 0}h2{font-size:18px;margin-bottom:10px}.addition-info{display:flex;justify-content:space-between;gap:10px}.total{background-color:var(--color-primary);color:#fff;padding:5px;border-radius:5px}th{color:#fff;text-wrap:nowrap}.invoice-attachments,.document{padding-bottom:15px}.invoice-info{display:flex;justify-content:space-between;margin-bottom:20px}.info-title{border-bottom:2px solid var(--color-primary);text-align:center}.tax-report-table{width:100%;border-collapse:collapse;margin-top:10px}.tax-report-table th,.tax-report-table td{padding:12px;text-align:center;border:1px solid #ddd}.tax-report-table th{background-color:var(--color-primary);color:#fff;font-weight:700;border:1px solid #000}.tax-report-table td{font-size:14px;color:#333;border:1px solid #000}\n"] }]
|
|
2090
|
-
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
2091
|
-
type: Input
|
|
2092
|
-
}] } });
|
|
2093
|
-
|
|
2094
2023
|
/*
|
|
2095
2024
|
* Public API Surface of angular-ava
|
|
2096
2025
|
*/
|