mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
refactoring: account form.
refactoring: expense form. refactoring: manual journal form. refactoring: invoice form.
This commit is contained in:
17
client/src/containers/Sales/Invoices/InvoiceForm/utils.js
Normal file
17
client/src/containers/Sales/Invoices/InvoiceForm/utils.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { transformToForm, repeatValue } from 'utils';
|
||||
|
||||
|
||||
export function transformToEditForm(invoice, defaultInvoice, linesNumber) {
|
||||
return {
|
||||
...transformToForm(invoice, defaultInvoice),
|
||||
entries: [
|
||||
...invoice.entries.map((invoice) => ({
|
||||
...transformToForm(invoice, defaultInvoice.entries[0]),
|
||||
})),
|
||||
...repeatValue(
|
||||
defaultInvoice,
|
||||
Math.max(linesNumber - invoice.entries.length, 0),
|
||||
),
|
||||
],
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user