fix(compliance): Improve compliance
This commit is contained in:
@ -20,7 +20,7 @@ export class FacturXEncoder extends CIIBaseEncoder {
|
||||
this.setDocumentTypeCode(xmlDoc, '381');
|
||||
|
||||
// Add common invoice data
|
||||
this.addCommonInvoiceData(xmlDoc, creditNote);
|
||||
this.addCommonInvoiceData(xmlDoc, creditNote as unknown as TInvoice);
|
||||
|
||||
// Serialize to string
|
||||
return new XMLSerializer().serializeToString(xmlDoc);
|
||||
@ -39,7 +39,7 @@ export class FacturXEncoder extends CIIBaseEncoder {
|
||||
this.setDocumentTypeCode(xmlDoc, '380');
|
||||
|
||||
// Add common invoice data
|
||||
this.addCommonInvoiceData(xmlDoc, debitNote);
|
||||
this.addCommonInvoiceData(xmlDoc, debitNote as unknown as TInvoice);
|
||||
|
||||
// Serialize to string
|
||||
return new XMLSerializer().serializeToString(xmlDoc);
|
||||
@ -145,6 +145,17 @@ export class FacturXEncoder extends CIIBaseEncoder {
|
||||
issueDateElement.appendChild(dateStringElement);
|
||||
documentElement.appendChild(issueDateElement);
|
||||
|
||||
// Add notes if present
|
||||
if (invoice.notes && invoice.notes.length > 0) {
|
||||
for (const note of invoice.notes) {
|
||||
const noteElement = doc.createElement('ram:IncludedNote');
|
||||
const contentElement = doc.createElement('ram:Content');
|
||||
contentElement.textContent = note;
|
||||
noteElement.appendChild(contentElement);
|
||||
documentElement.appendChild(noteElement);
|
||||
}
|
||||
}
|
||||
|
||||
// Create transaction element if it doesn't exist
|
||||
let transactionElement = root.getElementsByTagName('rsm:SupplyChainTradeTransaction')[0];
|
||||
if (!transactionElement) {
|
||||
|
Reference in New Issue
Block a user