fix(contentinvoice): Fixed currency display issues in invoice content rendering.
This commit is contained in:
		| @@ -1,5 +1,11 @@ | ||||
| # Changelog | ||||
|  | ||||
| ## 2024-11-27 - 1.0.102 - fix(contentinvoice) | ||||
| Fixed currency display issues in invoice content rendering. | ||||
|  | ||||
| - Corrected the usage of currency property to consistently pull from letterData content for invoice items. | ||||
| - Ensured currency is correctly displayed in the invoice PDF generation. | ||||
|  | ||||
| ## 2024-11-27 - 1.0.101 - fix(shared) | ||||
| Fixed the demo letter item details by replacing `currency` with `position` to correctly define the item position. | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@design.estate/dees-document', | ||||
|   version: '1.0.101', | ||||
|   version: '1.0.102', | ||||
|   description: 'A comprehensive solution for generating documents like invoices, integrating elements, templates, and services to streamline document creation.' | ||||
| } | ||||
|   | ||||
| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@design.estate/dees-document', | ||||
|   version: '1.0.101', | ||||
|   version: '1.0.102', | ||||
|   description: 'A comprehensive solution for generating documents like invoices, integrating elements, templates, and services to streamline document creation.' | ||||
| } | ||||
|   | ||||
| @@ -292,9 +292,9 @@ export class DeContentInvoice extends DeesElement { | ||||
|                 <div class="lineItem">${invoiceItem.name}</div> | ||||
|                 <div class="lineItem">${invoiceItem.unitQuantity}</div> | ||||
|                 <div class="lineItem">${invoiceItem.unitType}</div> | ||||
|                 <div class="lineItem">${invoiceItem.unitNetPrice} ${invoiceItem.currency}</div> | ||||
|                 <div class="lineItem">${invoiceItem.unitNetPrice} ${this.letterData?.content.invoiceData.currency}</div> | ||||
|                 <div class="lineItem"> | ||||
|                   ${invoiceItem.unitQuantity * invoiceItem.unitNetPrice} ${invoiceItem.currency} | ||||
|                   ${invoiceItem.unitQuantity * invoiceItem.unitNetPrice} ${this.letterData?.content.invoiceData.currency} | ||||
|                 </div> | ||||
|               </div> | ||||
|             ` | ||||
| @@ -343,7 +343,7 @@ export class DeContentInvoice extends DeesElement { | ||||
|           IBAN: ${this.letterData?.from?.sepaConnection?.iban}<br /> | ||||
|           BIC: ${this.letterData?.from?.sepaConnection?.bic}<br /> | ||||
|           Description: ${this.letterData?.content.invoiceData?.id}<br /> | ||||
|           Amount: ${this.getTotalGross()} ${this.letterData?.content.invoiceData.items[0].currency} | ||||
|           Amount: ${this.getTotalGross()} ${this.letterData?.content.invoiceData.currency} | ||||
|         </div> | ||||
|         ${this.letterData?.content?.contractData?.contractDate | ||||
|           ? html` | ||||
|   | ||||
| @@ -121,17 +121,20 @@ export class DeDocument extends DeesElement { | ||||
|   } | ||||
|  | ||||
|   public latestRenderedLetterData: plugins.tsclass.business.ILetter = null; | ||||
|  | ||||
|  | ||||
|   public async renderDocument() { | ||||
|     const domtools = await this.domtoolsPromise; | ||||
|     const documentContainer = this.shadowRoot.querySelector('.documentContainer'); | ||||
|     let pages: DePage[] = []; | ||||
|     let pageCounter = 0; | ||||
|     let complete = false; | ||||
|     const content: DeContentInvoice = document.createElement( | ||||
|       'dedocument-contentinvoice' | ||||
|     ) as DeContentInvoice; | ||||
|      | ||||
|     // lets append the content | ||||
|     const content: DeContentInvoice = new DeContentInvoice(); | ||||
|     content.letterData = this.letterData; | ||||
|     document.body.appendChild(content); | ||||
|  | ||||
|     await domtools.convenience.smartdelay.delayFor(0); | ||||
|     let overallContentOffset: number = 0; | ||||
|     let currentContentOffset: number; | ||||
| @@ -179,7 +182,7 @@ export class DeDocument extends DeesElement { | ||||
|     this.latestRenderedLetterData = this.letterData; | ||||
|   } | ||||
|  | ||||
|   async updated(changedProperties: Map<string | number | symbol, unknown>): void { | ||||
|   async updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void> { | ||||
|     super.updated(changedProperties); | ||||
|     const domtools = await this.domtoolsPromise; | ||||
|     const renderedDocIsUpToDate = domtools.convenience.smartjson.deepEqualObjects(this.letterData, this.latestRenderedLetterData); | ||||
|   | ||||
| @@ -59,11 +59,13 @@ export const demoLetter: tsclass.business.ILetter = { | ||||
|       deliveryDate: new Date().getTime(), | ||||
|       periodOfPerformance: null, | ||||
|       printResult: null, | ||||
|        | ||||
|       currency: 'EUR', | ||||
|       notes: [], | ||||
|       type: 'debitnote', | ||||
|       items: [ | ||||
|         { | ||||
|           name: 'Item with 19% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitQuantity: 2, | ||||
|           unitNetPrice: 100, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 19, | ||||
| @@ -71,7 +73,7 @@ export const demoLetter: tsclass.business.ILetter = { | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 7% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitQuantity: 4, | ||||
|           unitNetPrice: 100, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 7, | ||||
| @@ -79,7 +81,7 @@ export const demoLetter: tsclass.business.ILetter = { | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 7% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitQuantity: 3, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 7, | ||||
| @@ -95,14 +97,14 @@ export const demoLetter: tsclass.business.ILetter = { | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 0% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitQuantity: 6, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 0, | ||||
|           position: 4, | ||||
|         },{ | ||||
|           name: 'Item with 19% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitQuantity: 8, | ||||
|           unitNetPrice: 100, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 19, | ||||
| @@ -110,7 +112,7 @@ export const demoLetter: tsclass.business.ILetter = { | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 7% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitQuantity: 9, | ||||
|           unitNetPrice: 100, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 7, | ||||
| @@ -118,7 +120,7 @@ export const demoLetter: tsclass.business.ILetter = { | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 7% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitQuantity: 4, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 7, | ||||
| @@ -126,7 +128,7 @@ export const demoLetter: tsclass.business.ILetter = { | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 21% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitQuantity: 3, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 21, | ||||
| @@ -140,6 +142,54 @@ export const demoLetter: tsclass.business.ILetter = { | ||||
|           vatPercentage: 0, | ||||
|           position: 10, | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 0% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 0, | ||||
|           position: 10, | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 0% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 0, | ||||
|           position: 10, | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 0% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 0, | ||||
|           position: 10, | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 0% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 0, | ||||
|           position: 10, | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 0% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 0, | ||||
|           position: 10, | ||||
|         }, | ||||
|         { | ||||
|           name: 'Item with 0% VAT', | ||||
|           unitQuantity: 1, | ||||
|           unitNetPrice: 230, | ||||
|           unitType: 'hours', | ||||
|           vatPercentage: 0, | ||||
|           position: 10, | ||||
|         }, | ||||
|       ], | ||||
|     } | ||||
|   }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user