update
This commit is contained in:
@ -82,11 +82,18 @@ export class UBLEncoder extends UBLBaseEncoder {
|
||||
const typeCode = documentType === UBLDocumentType.INVOICE ? '380' : '381';
|
||||
this.appendElement(doc, root, 'cbc:InvoiceTypeCode', typeCode);
|
||||
|
||||
// Notes
|
||||
// Notes - include subject as first note if it exists
|
||||
const allNotes: string[] = [];
|
||||
if (invoice.subject && invoice.subject.trim()) {
|
||||
allNotes.push(invoice.subject);
|
||||
}
|
||||
if (invoice.notes && invoice.notes.length > 0) {
|
||||
for (const note of invoice.notes) {
|
||||
this.appendElement(doc, root, 'cbc:Note', note);
|
||||
}
|
||||
allNotes.push(...invoice.notes);
|
||||
}
|
||||
|
||||
// Write all notes
|
||||
for (const note of allNotes) {
|
||||
this.appendElement(doc, root, 'cbc:Note', note);
|
||||
}
|
||||
|
||||
// Document Currency Code
|
||||
|
Reference in New Issue
Block a user