Merge branch 'develop' into print-resources

This commit is contained in:
Ahmed Bouhuolia
2024-05-30 19:50:05 +02:00
154 changed files with 9748 additions and 6369 deletions

View File

@@ -7,6 +7,7 @@ import { CLASSES } from '@/constants/classes';
import { Paper, Row, Col } from '@/components';
import { InvoiceFormFooterLeft } from './InvoiceFormFooterLeft';
import { InvoiceFormFooterRight } from './InvoiceFormFooterRight';
import { UploadAttachmentButton } from '../../../Attachments/UploadAttachmentButton';
export default function InvoiceFormFooter() {
return (
@@ -15,6 +16,7 @@ export default function InvoiceFormFooter() {
<Row>
<Col md={8}>
<InvoiceFormFooterLeft />
<UploadAttachmentButton />
</Col>
<Col md={4}>

View File

@@ -5,7 +5,7 @@ import intl from 'react-intl-universal';
import moment from 'moment';
import * as R from 'ramda';
import { Intent } from '@blueprintjs/core';
import { omit, first, sumBy, round } from 'lodash';
import { omit, first, sumBy } from 'lodash';
import {
compose,
transformToForm,
@@ -27,6 +27,10 @@ import {
ensureEntriesHaveEmptyLine,
} from '@/containers/Entries/utils';
import { TaxType } from '@/interfaces/TaxRates';
import {
transformAttachmentsToForm,
transformAttachmentsToRequest,
} from '@/containers/Attachments/utils';
export const MIN_LINES_NUMBER = 1;
@@ -63,6 +67,7 @@ export const defaultInvoice = {
warehouse_id: '',
project_id: '',
entries: [...repeatValue(defaultInvoiceEntry, MIN_LINES_NUMBER)],
attachments: [],
};
/**
@@ -89,6 +94,7 @@ export function transformToEditForm(invoice) {
? TaxType.Inclusive
: TaxType.Exclusive,
entries,
attachments: transformAttachmentsToForm(invoice),
};
}
@@ -192,6 +198,7 @@ export function transformValueToRequest(values) {
...omit(entry, ['amount', 'tax_amount', 'tax_rate']),
})),
delivered: false,
attachments: transformAttachmentsToRequest(values),
};
}