From 45088b2d3ba4bef2af58b8c8183120ce1d3c0a58 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sat, 22 Aug 2020 11:58:08 +0200 Subject: [PATCH] feat: Item validate cost, income and inventory account type. feat: Style sales and purchases forms - 80% progress. feat: Validate purchase-able and sell-able items in invoices and bills. feat: Fix bugs in inventory FIFO/LIFO cost methods. --- client/src/components/classes.js | 4 + .../src/containers/Purchases/Bill/BillForm.js | 26 +- .../Purchases/Bill/BillFormFooter.js | 2 +- .../Purchases/Bill/BillFormHeader.js | 8 +- client/src/containers/Purchases/BillForm.js | 30 +- .../Sales/Estimate/EntriesItemsTable.js | 14 +- .../Sales/Estimate/Estimate.schema.js | 0 .../containers/Sales/Estimate/EstimateForm.js | 59 +-- .../Sales/Estimate/EstimateFormFooter.js | 2 +- .../Sales/Estimate/EstimateFormHeader.js | 31 +- .../containers/Sales/Estimate/Estimates.js | 1 + .../Sales/Estimate/withEstimates.js | 1 + .../containers/Sales/Invoice/InvoiceForm.js | 56 +-- .../Sales/Invoice/InvoiceFormFooter.js | 2 +- .../Sales/Invoice/InvoiceFormHeader.js | 4 +- .../containers/Sales/Receipt/ReceiptForm.js | 56 +-- .../Sales/Receipt/ReceiptFormFooter.js | 2 +- .../Sales/Receipt/ReceiptFormHeader.js | 18 +- client/src/style/App.scss | 9 +- client/src/style/pages/estimate.scss | 379 ------------------ client/src/style/pages/estimates.scss | 159 ++++++++ client/src/style/pages/invoices.scss | 0 client/src/style/pages/receipts.scss | 0 server/src/database/seeds/seed_accounts.js | 20 + server/src/http/controllers/Items.ts | 31 +- .../src/http/controllers/Purchases/Bills.js | 28 ++ .../http/controllers/Sales/SalesInvoices.js | 30 +- server/src/jobs/ComputeItemCost.ts | 2 +- server/src/models/InventoryCostLotTracker.js | 22 + server/src/models/InventoryTransaction.js | 23 ++ .../services/Accounting/JournalCommands.ts | 60 +++ server/src/services/Inventory/Inventory.ts | 9 +- .../Inventory/InventoryCostLotTracker.ts | 317 ++++++++++----- server/src/services/Sales/SalesInvoices.ts | 72 +++- 34 files changed, 841 insertions(+), 636 deletions(-) create mode 100644 client/src/components/classes.js create mode 100644 client/src/containers/Sales/Estimate/Estimate.schema.js delete mode 100644 client/src/style/pages/estimate.scss create mode 100644 client/src/style/pages/estimates.scss create mode 100644 client/src/style/pages/invoices.scss create mode 100644 client/src/style/pages/receipts.scss diff --git a/client/src/components/classes.js b/client/src/components/classes.js new file mode 100644 index 000000000..bc79e55b1 --- /dev/null +++ b/client/src/components/classes.js @@ -0,0 +1,4 @@ + +export default { + DATATABLE_EDITOR: 'datatable-editor', +}; \ No newline at end of file diff --git a/client/src/containers/Purchases/Bill/BillForm.js b/client/src/containers/Purchases/Bill/BillForm.js index a05f79137..23e362d98 100644 --- a/client/src/containers/Purchases/Bill/BillForm.js +++ b/client/src/containers/Purchases/Bill/BillForm.js @@ -9,6 +9,7 @@ import * as Yup from 'yup'; import { useFormik } from 'formik'; import moment from 'moment'; import { Intent, FormGroup, TextArea } from '@blueprintjs/core'; +import { Row, Col } from 'react-grid-system'; import { FormattedMessage as T, useIntl } from 'react-intl'; import { pick } from 'lodash'; @@ -291,15 +292,22 @@ function BillForm({ onClickAddNewRow={onClickAddNewRow} onClickClearAllLines={onClickCleanAllLines} /> - } className={'form-group--'}> -