mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
17 lines
454 B
JavaScript
17 lines
454 B
JavaScript
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),
|
|
),
|
|
],
|
|
};
|
|
} |