Skip to content
Snippets Groups Projects
Commit d24ef6f2 authored by Matthieu Fesselier's avatar Matthieu Fesselier
Browse files

bugfix: duplicate with new form structure

parent a0988da9
No related branches found
No related tags found
1 merge request!32various bugfixes
......@@ -64,12 +64,16 @@ export function cleanInvoiceBeforeDuplicate(invoice) {
invoice.invoicingDate = formatDateForPost(new Date());
delete invoice["@id"];
delete invoice.batches["@id"];
invoice.batches.forEach((batch, indexb) => {
delete invoice.batches[indexb]["@id"];
batch.tasks.forEach((task, indext) => {
delete invoice.batches[indexb].tasks[indext]["@id"];
if (invoice.batches['ldp:contains']) {
invoice.batches['ldp:contains'].forEach((batch, indexb) => {
delete invoice.batches['ldp:contains'][indexb]["@id"];
if (batch.tasks['ldp:contains']) {
batch.tasks['ldp:contains'].forEach((task, indext) => {
delete invoice.batches['ldp:contains'][indexb].tasks['ldp:contains'][indext]["@id"];
});
}
});
});
}
return invoice;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment