update
This commit is contained in:
@ -145,15 +145,22 @@ export class FacturXEncoder extends CIIBaseEncoder {
|
||||
issueDateElement.appendChild(dateStringElement);
|
||||
documentElement.appendChild(issueDateElement);
|
||||
|
||||
// Add notes if present
|
||||
// Add 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) {
|
||||
const noteElement = doc.createElement('ram:IncludedNote');
|
||||
const contentElement = doc.createElement('ram:Content');
|
||||
contentElement.textContent = note;
|
||||
noteElement.appendChild(contentElement);
|
||||
documentElement.appendChild(noteElement);
|
||||
}
|
||||
allNotes.push(...invoice.notes);
|
||||
}
|
||||
|
||||
// Write all notes
|
||||
for (const note of allNotes) {
|
||||
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
|
||||
|
Reference in New Issue
Block a user