From 3f4ffdc99569b372554e4d1207181e78a50328f2 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:04:55 +0200 Subject: [PATCH 01/11] BIG-237: Validate invoice due date. --- .../Sales/Invoices/InvoiceForm/InvoiceForm.schema.js | 11 ++++++++++- src/lang/ar/index.json | 6 ++++-- src/lang/en/index.json | 4 +++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/containers/Sales/Invoices/InvoiceForm/InvoiceForm.schema.js b/src/containers/Sales/Invoices/InvoiceForm/InvoiceForm.schema.js index eaedac85f..9d68c079a 100644 --- a/src/containers/Sales/Invoices/InvoiceForm/InvoiceForm.schema.js +++ b/src/containers/Sales/Invoices/InvoiceForm/InvoiceForm.schema.js @@ -1,4 +1,5 @@ import * as Yup from 'yup'; +import moment from 'moment'; import intl from 'react-intl-universal'; import { DATATYPES_LENGTH } from 'common/dataTypes'; import { isBlank } from 'utils'; @@ -7,7 +8,15 @@ const getSchema = () => Yup.object().shape({ customer_id: Yup.string().label(intl.get('customer_name_')).required(), invoice_date: Yup.date().required().label(intl.get('invoice_date_')), - due_date: Yup.date().required().label(intl.get('due_date_')), + due_date: Yup.date() + .min(Yup.ref('invoice_date'), ({ path, min }) => + intl.get('invoice.validation.due_date', { + path, + min: moment(min).format('YYYY/MM/DD'), + }), + ) + .required() + .label(intl.get('due_date_')), invoice_no: Yup.string() .max(DATATYPES_LENGTH.STRING) .label(intl.get('invoice_no_')), diff --git a/src/lang/ar/index.json b/src/lang/ar/index.json index cf6eb0632..b732b125b 100644 --- a/src/lang/ar/index.json +++ b/src/lang/ar/index.json @@ -1361,6 +1361,7 @@ "item.field.sell_account.hint": "أدخل السعر الذي ستبيعه لهذا العنصر.", "item_entries.products_services.hint": "أدخل المنتجات أو الخدمات التي تبيعها أو تشتريها لتتبع ما قمت ببيعه أو شرائه.", "item_entries.landed.hint": "يتيح لك هذه الخيار إمكانية إضافة تكلفة اضافية علي فاتورة الشراء متال علي ذلك تكاليف الشحن ، ثم تحديد هذه التكلفة لتحميلها علي فاتورة الشراء.", + "item_entries.remove_row": "حذف الصف", "invoice.auto_increment.auto": "يتم تعيين أرقام الفواتير على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟", "invoice.auto_increment.manually": "يتم تعيين أرقام فواتيرك يدوياً. هل أنت متأكد من تغيير هذه الإعدادات؟", "manual_journals.auto_increment.auto": "يتم تعيين أرقام القيود على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟", @@ -1847,6 +1848,7 @@ "warehouse_transfer.column.transfer_quantity": "الكمية ", "warehouse_transfer.column.source_warehouse": "المصدر", "warehouse_transfer.column.destination_warehouse": "الوجهة", + "warehouse_transfer.column.cost_price": "سعر التكلفة", "warehouse_transfer.auto_increment.auto": "يتم تعيين أرقام النقل على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟", "warehouse_transfer.auto_increment.manually": "يتم تعيين أرقام النقل يدوياً. هل أنت متأكد من تغيير هذه الإعدادات؟", "warehouse_transfer.setting_your_auto_generated_transfer_no": "تعيين رقم النقل الذي تم إنشاؤه تلقائيًا", @@ -2006,6 +2008,6 @@ "warehouse_transfer.empty_status.title": "إدارة عمليات النقل بين المستودعات", "warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.", "item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ", - "warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة." - + "warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.", + "invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}" } \ No newline at end of file diff --git a/src/lang/en/index.json b/src/lang/en/index.json index 5911e4753..9d46f4090 100644 --- a/src/lang/en/index.json +++ b/src/lang/en/index.json @@ -1338,6 +1338,7 @@ "item.field.sell_account.hint": "Enter price which you goint to sell this item.", "item_entries.products_services.hint": "Enter products or services you sell or buy to keep tracking what your sold or purchased.", "item_entries.landed.hint": "This options allows you to be able to add additional cost eg. freight then allocate cost to the items in your bills.", + "item_entries.remove_row": "Remove line", "invoice.auto_increment.auto": "Your invoice numbers are set on auto-increment mode. Are you sure changing this setting?", "invoice.auto_increment.manually": "Your invoice numbers are set on manual mode. Are you sure chaning this settings?", "manual_journals.auto_increment.auto": "Your Jouranl numbers are set on auto-increment mode. Are you sure changing this setting?", @@ -2007,5 +2008,6 @@ "warehouse_transfer.empty_status.description": "Business with multiply warehouses often transfers items from on warehouse to another when they are in immediate need of vendors.", "warehouse_transfer.form.reason.label": "Reason", "warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.", - "warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty." + "warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty.", + "invoice.validation.due_date": "{path} field must be later than {min}" } \ No newline at end of file From 373a695c4cf1af71bb4676a4adef525ac8cdcfc3 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:06:58 +0200 Subject: [PATCH 02/11] BIG-236: Validate estimate expiration date. --- .../Estimates/EstimateForm/EstimateForm.schema.js | 15 +++++++++------ src/lang/ar/index.json | 3 ++- src/lang/en/index.json | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/containers/Sales/Estimates/EstimateForm/EstimateForm.schema.js b/src/containers/Sales/Estimates/EstimateForm/EstimateForm.schema.js index 46bd23f5f..78cc4139d 100644 --- a/src/containers/Sales/Estimates/EstimateForm/EstimateForm.schema.js +++ b/src/containers/Sales/Estimates/EstimateForm/EstimateForm.schema.js @@ -2,16 +2,19 @@ import * as Yup from 'yup'; import intl from 'react-intl-universal'; import { DATATYPES_LENGTH } from 'common/dataTypes'; import { isBlank } from 'utils'; +import moment from 'moment'; const Schema = Yup.object().shape({ - customer_id: Yup.number() - .label(intl.get('customer_name_')) - .required(), - estimate_date: Yup.date() - .required() - .label(intl.get('estimate_date_')), + customer_id: Yup.number().label(intl.get('customer_name_')).required(), + estimate_date: Yup.date().required().label(intl.get('estimate_date_')), expiration_date: Yup.date() .required() + .min(Yup.ref('estimate_date'), ({ path, min }) => + intl.get('estimate.validation.expiration_date', { + path, + min: moment(min).format('YYYY/MM/DD'), + }), + ) .label(intl.get('expiration_date_')), estimate_number: Yup.string() .max(DATATYPES_LENGTH.STRING) diff --git a/src/lang/ar/index.json b/src/lang/ar/index.json index b732b125b..944d6ea7a 100644 --- a/src/lang/ar/index.json +++ b/src/lang/ar/index.json @@ -2009,5 +2009,6 @@ "warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.", "item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ", "warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.", - "invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}" + "invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}", + "estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}" } \ No newline at end of file diff --git a/src/lang/en/index.json b/src/lang/en/index.json index 9d46f4090..2a4d0b094 100644 --- a/src/lang/en/index.json +++ b/src/lang/en/index.json @@ -2009,5 +2009,6 @@ "warehouse_transfer.form.reason.label": "Reason", "warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.", "warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty.", - "invoice.validation.due_date": "{path} field must be later than {min}" + "invoice.validation.due_date": "{path} field must be later than {min}", + "estimate.validation.expiration_date": "{path} field must be later than {min}" } \ No newline at end of file From ce674466fedf8f2f9fa46012ae282963b46cbf62 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:09:11 +0200 Subject: [PATCH 03/11] BIG-238: Validate bill due date. --- .../Purchases/Bills/BillForm/BillForm.schema.js | 17 ++++++++++------- src/lang/ar/index.json | 3 ++- src/lang/en/index.json | 3 ++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/containers/Purchases/Bills/BillForm/BillForm.schema.js b/src/containers/Purchases/Bills/BillForm/BillForm.schema.js index 6f77262b2..258ad5be4 100644 --- a/src/containers/Purchases/Bills/BillForm/BillForm.schema.js +++ b/src/containers/Purchases/Bills/BillForm/BillForm.schema.js @@ -1,16 +1,19 @@ import * as Yup from 'yup'; +import moment from 'moment'; import intl from 'react-intl-universal'; import { DATATYPES_LENGTH } from 'common/dataTypes'; import { isBlank } from 'utils'; const BillFormSchema = Yup.object().shape({ - vendor_id: Yup.number() - .required() - .label(intl.get('vendor_name_')), - bill_date: Yup.date() - .required() - .label(intl.get('bill_date_')), + vendor_id: Yup.number().required().label(intl.get('vendor_name_')), + bill_date: Yup.date().required().label(intl.get('bill_date_')), due_date: Yup.date() + .min(Yup.ref('bill_date'), ({ path, min }) => + intl.get('bill.validation.due_date', { + path, + min: moment(min).format('YYYY/MM/DD'), + }), + ) .required() .label(intl.get('due_date_')), bill_number: Yup.string() @@ -25,7 +28,7 @@ const BillFormSchema = Yup.object().shape({ open: Yup.boolean(), branch_id: Yup.string(), warehouse_id: Yup.string(), - exchange_rate:Yup.number(), + exchange_rate: Yup.number(), entries: Yup.array().of( Yup.object().shape({ quantity: Yup.number() diff --git a/src/lang/ar/index.json b/src/lang/ar/index.json index 944d6ea7a..ca3cb74aa 100644 --- a/src/lang/ar/index.json +++ b/src/lang/ar/index.json @@ -2010,5 +2010,6 @@ "item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ", "warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.", "invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}", - "estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}" + "estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}", + "bill.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}" } \ No newline at end of file diff --git a/src/lang/en/index.json b/src/lang/en/index.json index 2a4d0b094..7c10a8e5b 100644 --- a/src/lang/en/index.json +++ b/src/lang/en/index.json @@ -2010,5 +2010,6 @@ "warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.", "warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty.", "invoice.validation.due_date": "{path} field must be later than {min}", - "estimate.validation.expiration_date": "{path} field must be later than {min}" + "estimate.validation.expiration_date": "{path} field must be later than {min}", + "bill.validation.due_date": "{path} field must be later than {min}" } \ No newline at end of file From 30b17d697f55fb236ef3f058162e17214a417e24 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:28:42 +0200 Subject: [PATCH 04/11] BIG-355: remove expandable in item categories. --- src/containers/ItemsCategories/ItemCategoriesTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/ItemsCategories/ItemCategoriesTable.js b/src/containers/ItemsCategories/ItemCategoriesTable.js index 5f2436e91..654500e24 100644 --- a/src/containers/ItemsCategories/ItemCategoriesTable.js +++ b/src/containers/ItemsCategories/ItemCategoriesTable.js @@ -50,7 +50,7 @@ function ItemsCategoryTable({ loading={isCategoriesLoading} headerLoading={isCategoriesLoading} progressBarLoading={isCategoriesFetching} - expandable={true} + // expandable={false} sticky={true} selectionColumn={true} TableLoadingRenderer={TableSkeletonRows} From 9bd13b0d4691e5967d64277cf3077c5c92ae1580 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:31:34 +0200 Subject: [PATCH 05/11] BIG-355: remove expandable in item categories. --- src/containers/ItemsCategories/ItemCategoriesTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/ItemsCategories/ItemCategoriesTable.js b/src/containers/ItemsCategories/ItemCategoriesTable.js index 654500e24..305865f45 100644 --- a/src/containers/ItemsCategories/ItemCategoriesTable.js +++ b/src/containers/ItemsCategories/ItemCategoriesTable.js @@ -50,7 +50,7 @@ function ItemsCategoryTable({ loading={isCategoriesLoading} headerLoading={isCategoriesLoading} progressBarLoading={isCategoriesFetching} - // expandable={false} + expandable={false} sticky={true} selectionColumn={true} TableLoadingRenderer={TableSkeletonRows} From 86c6de361bf3899edfea696fa010bbecb14746b3 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:34:51 +0200 Subject: [PATCH 06/11] BIG-356: add localize remove line entries. --- src/containers/Accounting/MakeJournal/components.js | 12 ++++++++++-- src/containers/Entries/components.js | 2 +- src/containers/Expenses/ExpenseForm/components.js | 7 +++++-- src/containers/WarehouseTransfers/utils.js | 5 ++++- src/lang/ar/index.json | 5 ++++- src/lang/en/index.json | 5 ++++- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/containers/Accounting/MakeJournal/components.js b/src/containers/Accounting/MakeJournal/components.js index cec39f28c..260adddd4 100644 --- a/src/containers/Accounting/MakeJournal/components.js +++ b/src/containers/Accounting/MakeJournal/components.js @@ -4,7 +4,12 @@ import { Popover2 } from '@blueprintjs/popover2'; import { useFormikContext } from 'formik'; import intl from 'react-intl-universal'; -import { ExchangeRateInputGroup, Icon, Hint, FormattedMessage as T } from 'components'; +import { + ExchangeRateInputGroup, + Icon, + Hint, + FormattedMessage as T, +} from 'components'; import { AccountsListFieldCell, MoneyFieldCell, @@ -63,7 +68,10 @@ export const ActionsCellRenderer = ({ }; const exampleMenu = ( - + ); return ( diff --git a/src/containers/Entries/components.js b/src/containers/Entries/components.js index bb0bc53a2..d7877cd1b 100644 --- a/src/containers/Entries/components.js +++ b/src/containers/Entries/components.js @@ -43,7 +43,7 @@ export function ActionsCellRenderer({ const exampleMenu = ( - + ); diff --git a/src/containers/Expenses/ExpenseForm/components.js b/src/containers/Expenses/ExpenseForm/components.js index 417d81506..c0426d9a3 100644 --- a/src/containers/Expenses/ExpenseForm/components.js +++ b/src/containers/Expenses/ExpenseForm/components.js @@ -48,7 +48,10 @@ const ActionsCellRenderer = ({ }; const exampleMenu = ( - + ); return ( @@ -163,4 +166,4 @@ export function ExpensesExchangeRateInputField({ ...props }) { /> ); } -ExpensesExchangeRateInputField.cellType = CellType.Field; \ No newline at end of file +ExpensesExchangeRateInputField.cellType = CellType.Field; diff --git a/src/containers/WarehouseTransfers/utils.js b/src/containers/WarehouseTransfers/utils.js index cc118fdd7..638a55a22 100644 --- a/src/containers/WarehouseTransfers/utils.js +++ b/src/containers/WarehouseTransfers/utils.js @@ -21,7 +21,10 @@ export function ActionsCellRenderer({ const exampleMenu = ( - + ); diff --git a/src/lang/ar/index.json b/src/lang/ar/index.json index 944d6ea7a..9d09a3bff 100644 --- a/src/lang/ar/index.json +++ b/src/lang/ar/index.json @@ -2010,5 +2010,8 @@ "item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ", "warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.", "invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}", - "estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}" + "estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}", + "make_journal.entries.remove_row": "حذف الصف", + "expense.entries.remove_row": "حذف الصف", + "warehouse_transfer.entries.remove_row": "حذف الصف" } \ No newline at end of file diff --git a/src/lang/en/index.json b/src/lang/en/index.json index 2a4d0b094..dbd9b1e32 100644 --- a/src/lang/en/index.json +++ b/src/lang/en/index.json @@ -2010,5 +2010,8 @@ "warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.", "warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty.", "invoice.validation.due_date": "{path} field must be later than {min}", - "estimate.validation.expiration_date": "{path} field must be later than {min}" + "estimate.validation.expiration_date": "{path} field must be later than {min}", + "make_journal.entries.remove_row": "Remove line", + "expense.entries.remove_row": "Remove line", + "warehouse_transfer.entries.remove_row": "Remove line" } \ No newline at end of file From 2db32b8ee85769da6d92a92fe58e8b39f307c646 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Wed, 30 Mar 2022 17:17:23 +0200 Subject: [PATCH 07/11] BIG-141: add inactive status to item details. --- .../ItemDetailDrawerProvider.js | 6 ++++- .../Drawers/ItemDetailDrawer/utlis.js | 27 +++++++++++++++++++ src/lang/ar/index.json | 3 ++- src/lang/en/index.json | 3 ++- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 src/containers/Drawers/ItemDetailDrawer/utlis.js diff --git a/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerProvider.js b/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerProvider.js index c748e559b..fa811cf1d 100644 --- a/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerProvider.js +++ b/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerProvider.js @@ -1,6 +1,7 @@ import React from 'react'; import { DrawerHeaderContent, DrawerLoading } from 'components'; import { useItem } from 'hooks/query'; +import { inactiveStatus } from './utlis'; const ItemDetailDrawerContext = React.createContext(); @@ -27,7 +28,10 @@ function ItemDetailDrawerProvider({ itemId, ...props }) { return ( - + ); diff --git a/src/containers/Drawers/ItemDetailDrawer/utlis.js b/src/containers/Drawers/ItemDetailDrawer/utlis.js new file mode 100644 index 000000000..72b46fe3d --- /dev/null +++ b/src/containers/Drawers/ItemDetailDrawer/utlis.js @@ -0,0 +1,27 @@ +import React from 'react'; +import styled from 'styled-components'; +import { Intent, Tag } from '@blueprintjs/core'; +import { Choose, FormattedMessage as T } from '../../../components'; + +/** + * items inactive status. + * @returns {React.JSX} + */ +export function inactiveStatus(item) { + return ( + + + {item.name} + + + + + {item.name} + + ); +} + +const StatusTag = styled(Tag)` + font-size: 11px; + margin-left: 10px; +`; diff --git a/src/lang/ar/index.json b/src/lang/ar/index.json index 9d09a3bff..2e870609f 100644 --- a/src/lang/ar/index.json +++ b/src/lang/ar/index.json @@ -2013,5 +2013,6 @@ "estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}", "make_journal.entries.remove_row": "حذف الصف", "expense.entries.remove_row": "حذف الصف", - "warehouse_transfer.entries.remove_row": "حذف الصف" + "warehouse_transfer.entries.remove_row": "حذف الصف", + "item.details.inactive": "غير نشط" } \ No newline at end of file diff --git a/src/lang/en/index.json b/src/lang/en/index.json index dbd9b1e32..664036468 100644 --- a/src/lang/en/index.json +++ b/src/lang/en/index.json @@ -2013,5 +2013,6 @@ "estimate.validation.expiration_date": "{path} field must be later than {min}", "make_journal.entries.remove_row": "Remove line", "expense.entries.remove_row": "Remove line", - "warehouse_transfer.entries.remove_row": "Remove line" + "warehouse_transfer.entries.remove_row": "Remove line", + "item.details.inactive": "Inactive" } \ No newline at end of file From b849bfaa951788d9d72a33975d440eea8e30c9dc Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Thu, 31 Mar 2022 13:39:15 +0200 Subject: [PATCH 08/11] BIG-344: add branch to manual journal & expense. --- .../ExpenseDrawer/ExpenseDrawerProvider.js | 19 ++++++++++++++++- src/containers/Drawers/ExpenseDrawer/index.js | 3 --- .../Drawers/ManualJournalDrawer/utils.js | 21 ++++++++++++++++--- src/lang/ar/index.json | 6 ++++-- src/lang/en/index.json | 1 + 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerProvider.js b/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerProvider.js index 90e4b87a1..f5da42cc8 100644 --- a/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerProvider.js +++ b/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerProvider.js @@ -1,6 +1,9 @@ import React from 'react'; +import intl from 'react-intl-universal'; import { useExpense } from 'hooks/query'; -import { DrawerLoading } from 'components'; +import { DrawerHeaderContent, DrawerLoading } from 'components'; +import { Features } from 'common'; +import { useFeatureCan } from 'hooks/state'; const ExpenseDrawerDrawerContext = React.createContext(); @@ -8,6 +11,9 @@ const ExpenseDrawerDrawerContext = React.createContext(); * Expense drawer provider. */ function ExpenseDrawerProvider({ expenseId, ...props }) { + // Features guard. + const { featureCan } = useFeatureCan(); + // Fetch the expense details. const { data: expense, @@ -28,6 +34,17 @@ function ExpenseDrawerProvider({ expenseId, ...props }) { return ( + ); diff --git a/src/containers/Drawers/ExpenseDrawer/index.js b/src/containers/Drawers/ExpenseDrawer/index.js index cb3c56f66..92ad685b6 100644 --- a/src/containers/Drawers/ExpenseDrawer/index.js +++ b/src/containers/Drawers/ExpenseDrawer/index.js @@ -1,6 +1,4 @@ import React, { lazy } from 'react'; -import intl from 'react-intl-universal'; - import { Drawer, DrawerSuspense } from 'components'; import withDrawers from 'containers/Drawer/withDrawers'; @@ -22,7 +20,6 @@ function ExpenseDrawer({ diff --git a/src/containers/Drawers/ManualJournalDrawer/utils.js b/src/containers/Drawers/ManualJournalDrawer/utils.js index 944c4f784..31e38ccf0 100644 --- a/src/containers/Drawers/ManualJournalDrawer/utils.js +++ b/src/containers/Drawers/ManualJournalDrawer/utils.js @@ -3,6 +3,8 @@ import React from 'react'; import { Tag, Intent, Classes, Tooltip, Position } from '@blueprintjs/core'; import { T, Choose, FormatNumberCell, If, Icon } from '../../../components'; +import { Features } from 'common'; +import { useFeatureCan } from 'hooks/state'; /** * Note column accessor. @@ -46,8 +48,9 @@ export function ManualJournalDetailsStatus({ manualJournal }) { /** * Retrieve read-only manual journal entries columns. */ -export const useManualJournalEntriesColumns = () => - React.useMemo( +export const useManualJournalEntriesColumns = () => { + const { featureCan } = useFeatureCan(); + return React.useMemo( () => [ { Header: intl.get('account_name'), @@ -70,6 +73,17 @@ export const useManualJournalEntriesColumns = () => disableSortBy: true, className: 'note', }, + ...(featureCan(Features.Branches) + ? [ + { + Header: intl.get('branch'), + width: 130, + accessor: 'branch.name', + disableSortBy: true, + className: 'branch', + }, + ] + : []), { Header: intl.get('credit'), accessor: 'credit', @@ -93,5 +107,6 @@ export const useManualJournalEntriesColumns = () => align: 'right', }, ], - [], + [featureCan], ); +}; diff --git a/src/lang/ar/index.json b/src/lang/ar/index.json index cfb865514..9e069b70f 100644 --- a/src/lang/ar/index.json +++ b/src/lang/ar/index.json @@ -2005,8 +2005,10 @@ "estimate.warehouse_button.label": "المخزن: {label}", "receipt.branch_button.label": "الفرع: {label}", "receipt.warehouse_button.label": "المخزن: {label}", - "warehouse_transfer.empty_status.title": "إدارة عمليات النقل بين المستودعات", - "warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.", + "warehouse_transfer.empty_status.title": "إدارة عمليات النقل بين المخازن", + "warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مخازن متعددة لطلبات نقل البضائع من مخزن إلى آخر عندما تكون في حاجة ماسة إلى البائعين.", + "warehouse_transfer.form.reason.label": "أسباب النقل", + "warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.", "item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ", "warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.", "invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}", diff --git a/src/lang/en/index.json b/src/lang/en/index.json index 850a6313d..eb8483918 100644 --- a/src/lang/en/index.json +++ b/src/lang/en/index.json @@ -1756,6 +1756,7 @@ "payment_made.drawer.subtitle": "Branch: {value}", "manual_journal.drawer.title": "Manual journal details ({number})", "expense.drawer.title": "Expense details", + "expense.drawer.subtitle": "Branch: {value}", "global_error.you_dont_have_permissions": "You do not have permissions to access this page.", "global_error.transactions_locked": "Transactions before {lockedToDate} has been locked. Hence action cannot be performed.", "global_error.authorized_user_inactive": "The authorized user is inactive.", From 872b98fb0dc37a95922183db2e977416faa651c3 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Thu, 31 Mar 2022 13:57:07 +0200 Subject: [PATCH 09/11] BIG-278: add created_at in expense details. --- .../Drawers/ExpenseDrawer/ExpenseDrawerHeader.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerHeader.js b/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerHeader.js index 816970709..f8187b2a5 100644 --- a/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerHeader.js +++ b/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerHeader.js @@ -10,6 +10,7 @@ import { Col, DetailItem, DetailsMenu, + FormatDate, ExchangeRateDetailItem, FormattedMessage as T, } from 'components'; @@ -64,10 +65,12 @@ export default function ExpenseDrawerHeader() { minLabelSize={'180px'} > }> - {moment(expense.published_at).format('YYYY MMM DD')} + - }>2021 Aug 24 + }> + + From b903aa3eb2d577447ac41c80eec0c04fdb8c3e0c Mon Sep 17 00:00:00 2001 From: "a.bouhuolia" Date: Thu, 31 Mar 2022 14:07:17 +0200 Subject: [PATCH 10/11] dump v1.7.2 version with changelogs. --- CHANGELOG.md | 20 ++++++++++++++++++++ package.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab70adcb0..4bb04704e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ All notable changes to Bigcapital server-side will be in this file. +## [1.7.1-rc.2] - 30-03-2022 + +## Added + - `BIG-141` Add inactive status to item drawer details. + - `BIG-278` Add created at date on expense details. + - `BIG-350` Add empty status content of warehouse transfers service. +## Fixed + - `BIG-221` Remove Non-inventory radio choice on item form. + - `BIG-236` Validate estimate expiration date should be equal or bigger than estimate date. + - `BIG-237` Validate invoice due date should be equal or bigger than invoice date. + - `BIG-238` Validate bill due date should be equal or bigger than bill date. + - `BIG-280` Optimize style of multi-select accounts menu. + - `BIG-284` Cashflow statement loading bar. + - `BIG-296` Creating a new child account from accounts list. + - `BIG-301` Navigation bar divider on actions bar hide with permissions control. + - `BIG-304` Adding cash or bank account from cash flow service. + - `BIG-351` Invalid date in the inventory adjustment detail. + - `BIG-352` Fix terms and notes fields on footer of all services. + - `BIG-354` Validate the warehouse transfer quantity should be above zero. + ## [1.7.0-rc.1] - 24-03-2022 ## Added diff --git a/package.json b/package.json index d4a827375..cf7f8a161 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bigcapital-client", - "version": "1.6.3", + "version": "1.7.1", "private": true, "dependencies": { "@babel/core": "7.8.4", From 41d2fc63cb0f8d0040f09a7eeff40b19e4abe6b6 Mon Sep 17 00:00:00 2001 From: "a.bouhuolia" Date: Thu, 31 Mar 2022 14:08:22 +0200 Subject: [PATCH 11/11] chore(Changelog): add the missing logs. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bb04704e..8b1592013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to Bigcapital server-side will be in this file. - `BIG-141` Add inactive status to item drawer details. - `BIG-278` Add created at date on expense details. - `BIG-350` Add empty status content of warehouse transfers service. + - `BIG-344` Add branch details to manual journal and expense details. ## Fixed - `BIG-221` Remove Non-inventory radio choice on item form. - `BIG-236` Validate estimate expiration date should be equal or bigger than estimate date.