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

bugfix: duplicate date #34

parent 38461349
No related branches found
No related tags found
1 merge request!22bugfix: duplicate date #34
......@@ -60,7 +60,8 @@ export function openInvoiceWindow(type, base_url) {
* @returns {object} invoice object cleaned
*/
export function cleanInvoiceBeforeDuplicate(invoice) {
invoice.title= invoice.title + " - 2"
invoice.title = invoice.title + " - 2"
invoice.invoicingDate = formatDateForPost(new Date());
delete invoice["@id"];
delete invoice.batches["@id"];
invoice.batches.forEach((batch, indexb) => {
......@@ -70,4 +71,8 @@ export function cleanInvoiceBeforeDuplicate(invoice) {
});
});
return invoice;
}
function formatDateForPost(date) {
return date.toISOString().split('T')[0];
}
\ No newline at end of file
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