From 0c238ab88722f1b7be9c2d25121a3c38b3ba03e8 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Tue, 14 Sep 2021 16:01:07 +0200 Subject: [PATCH 1/4] BIG-83: remove duplicate alert message in payment receive. --- .../Purchases/PaymentMades/PaymentForm/PaymentMadeForm.js | 2 +- .../PaymentReceives/PaymentReceiveForm/PaymentReceiveForm.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeForm.js b/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeForm.js index 78a7e5c84..887652c82 100644 --- a/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeForm.js +++ b/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeForm.js @@ -84,7 +84,7 @@ function PaymentMadeForm({ if (totalPaymentAmount <= 0) { AppToaster.show({ message: intl.get('you_cannot_make_payment_with_zero_total_amount'), - intent: Intent.WARNING, + intent: Intent.DANGER, }); return; } diff --git a/client/src/containers/Sales/PaymentReceives/PaymentReceiveForm/PaymentReceiveForm.js b/client/src/containers/Sales/PaymentReceives/PaymentReceiveForm/PaymentReceiveForm.js index 3998bf8aa..2ef789189 100644 --- a/client/src/containers/Sales/PaymentReceives/PaymentReceiveForm/PaymentReceiveForm.js +++ b/client/src/containers/Sales/PaymentReceives/PaymentReceiveForm/PaymentReceiveForm.js @@ -106,7 +106,6 @@ function PaymentReceiveForm({ message: intl.get('you_cannot_make_payment_with_zero_total_amount'), intent: Intent.DANGER, }); - setSubmitting(false); return; } const form = { From 48c77fcea2dd84f540d26ce1bba228490e709279 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Tue, 14 Sep 2021 16:18:37 +0200 Subject: [PATCH 2/4] BIG-84: remove number sign. --- client/src/containers/Accounting/JournalsLanding/utils.js | 2 +- .../src/containers/Purchases/Bills/BillsLanding/components.js | 2 +- .../Purchases/PaymentMades/PaymentsLanding/components.js | 2 +- .../containers/Sales/Estimates/EstimatesLanding/components.js | 2 +- .../Sales/PaymentReceives/PaymentsLanding/components.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/containers/Accounting/JournalsLanding/utils.js b/client/src/containers/Accounting/JournalsLanding/utils.js index b616edf08..781f0d0ef 100644 --- a/client/src/containers/Accounting/JournalsLanding/utils.js +++ b/client/src/containers/Accounting/JournalsLanding/utils.js @@ -29,7 +29,7 @@ export const useManualJournalsColumns = () => { { id: 'journal_number', Header: intl.get('journal_no'), - accessor: (row) => `#${row.journal_number}`, + accessor: (row) => `${row.journal_number}`, className: 'journal_number', width: 100, clickable: true, diff --git a/client/src/containers/Purchases/Bills/BillsLanding/components.js b/client/src/containers/Purchases/Bills/BillsLanding/components.js index 327a1cc56..63f83ab6a 100644 --- a/client/src/containers/Purchases/Bills/BillsLanding/components.js +++ b/client/src/containers/Purchases/Bills/BillsLanding/components.js @@ -172,7 +172,7 @@ export function useBillsTableColumns() { { id: 'bill_number', Header: intl.get('bill_number'), - accessor: (row) => (row.bill_number ? `#${row.bill_number}` : null), + accessor: (row) => (row.bill_number ? `${row.bill_number}` : null), width: 100, className: 'bill_number', clickable: true, diff --git a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/components.js b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/components.js index 29e521b80..f83f04ff1 100644 --- a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/components.js +++ b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/components.js @@ -93,7 +93,7 @@ export function usePaymentMadesTableColumns() { id: 'payment_number', Header: intl.get('payment_number'), accessor: (row) => - row.payment_number ? `#${row.payment_number}` : null, + row.payment_number ? `${row.payment_number}` : null, width: 140, className: 'payment_number', clickable: true, diff --git a/client/src/containers/Sales/Estimates/EstimatesLanding/components.js b/client/src/containers/Sales/Estimates/EstimatesLanding/components.js index 1a63a86fa..1eb10dcb0 100644 --- a/client/src/containers/Sales/Estimates/EstimatesLanding/components.js +++ b/client/src/containers/Sales/Estimates/EstimatesLanding/components.js @@ -185,7 +185,7 @@ export function useEstiamtesTableColumns() { id: 'estimate_number', Header: intl.get('estimate_number'), accessor: (row) => - row.estimate_number ? `#${row.estimate_number}` : null, + row.estimate_number ? `${row.estimate_number}` : null, width: 140, className: 'estimate_number', clickable: true, diff --git a/client/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js b/client/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js index 4611db50d..717651946 100644 --- a/client/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js +++ b/client/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js @@ -114,7 +114,7 @@ export function usePaymentReceivesColumns() { id: 'payment_receive_no', Header: intl.get('payment_receive_no'), accessor: (row) => - row.payment_receive_no ? `#${row.payment_receive_no}` : null, + row.payment_receive_no ? `${row.payment_receive_no}` : null, width: 140, className: 'payment_receive_no', clickable: true, From af492310e88aa136d57dfb1dab9bc1b32a179253 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Tue, 14 Sep 2021 16:50:22 +0200 Subject: [PATCH 3/4] BIG-81: handle error message. --- client/src/common/errors.js | 3 ++- .../Sales/Estimates/EstimateForm/EstimateForm.js | 7 +++++++ .../Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.js | 1 + client/src/containers/Sales/Invoices/InvoiceForm/utils.js | 3 +-- client/src/lang/en/index.json | 4 +++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/client/src/common/errors.js b/client/src/common/errors.js index 5b50b487a..e69a3f199 100644 --- a/client/src/common/errors.js +++ b/client/src/common/errors.js @@ -1,6 +1,7 @@ export const ERROR = { // Sales Estimates ESTIMATE_NUMBER_IS_NOT_UNQIUE: 'ESTIMATE.NUMBER.IS.NOT.UNQIUE', + SALE_ESTIMATE_NO_IS_REQUIRED: 'SALE_ESTIMATE_NO_IS_REQUIRED', // Sales Invoices SALE_INVOICE_NUMBER_IS_EXISTS: 'SALE.INVOICE.NUMBER.IS.EXISTS', @@ -13,5 +14,5 @@ export const ERROR = { // Bills BILL_NUMBER_EXISTS: 'BILL.NUMBER.EXISTS', - SALE_INVOICE_NO_IS_REQUIRED: 'SALE_INVOICE_NO_IS_REQUIRED' + SALE_INVOICE_NO_IS_REQUIRED: 'SALE_INVOICE_NO_IS_REQUIRED', }; diff --git a/client/src/containers/Sales/Estimates/EstimateForm/EstimateForm.js b/client/src/containers/Sales/Estimates/EstimateForm/EstimateForm.js index 4bb8f542b..eb9b9578c 100644 --- a/client/src/containers/Sales/Estimates/EstimateForm/EstimateForm.js +++ b/client/src/containers/Sales/Estimates/EstimateForm/EstimateForm.js @@ -78,6 +78,13 @@ function EstimateForm({ estimate_number: intl.get('estimate_number_is_not_unqiue'), }); } + if ( + errors.some((error) => error.type === ERROR.SALE_ESTIMATE_NO_IS_REQUIRED) + ) { + setErrors({ + estimate_number: intl.get('estimate.field.error.estimate_number'), + }); + } }; // Handles form submit. diff --git a/client/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.js b/client/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.js index 96594a06c..1775d8d78 100644 --- a/client/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.js +++ b/client/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.js @@ -153,6 +153,7 @@ function InvoiceFormHeaderFields({ {({ form, field, meta: { error, touched } }) => ( } + labelInfo={} inline={true} className={classNames('form-group--invoice-no', CLASSES.FILL)} intent={inputIntent({ error, touched })} diff --git a/client/src/containers/Sales/Invoices/InvoiceForm/utils.js b/client/src/containers/Sales/Invoices/InvoiceForm/utils.js index 96f658788..6ac7682bd 100644 --- a/client/src/containers/Sales/Invoices/InvoiceForm/utils.js +++ b/client/src/containers/Sales/Invoices/InvoiceForm/utils.js @@ -93,8 +93,7 @@ export const transformErrors = (errors, { setErrors }) => { errors.some((error) => error.type === ERROR.SALE_INVOICE_NO_IS_REQUIRED) ) { setErrors({ - invoice_no: - 'Invoice number is required, use auto-increment mode or enter manually.', + invoice_no: intl.get('invoice.field.error.invoice_no'), }); } }; diff --git a/client/src/lang/en/index.json b/client/src/lang/en/index.json index fc5514fe8..4ed207dc5 100644 --- a/client/src/lang/en/index.json +++ b/client/src/lang/en/index.json @@ -1323,5 +1323,7 @@ "payment_receive.auto_increment.manually": "Yor payment numbers are set on manual mode. Are you sure chaning this settings?", "auto_increment.field.manually": "I will enter them manually each time", "auto_increment.field.manual_this_transaction": "Manual entering for this transaction.", - "auto_increment.field.auto": "Auto-incrementing number." + "auto_increment.field.auto": "Auto-incrementing number.", + "estimate.field.error.estimate_number":"Estimate number is required, use auto-increment mode or enter manually.", + "invoice.field.error.invoice_no":"Invoice number is required, use auto-increment mode or enter manually" } \ No newline at end of file From 98c887cbebfd9cd1a205cd6ef0673fb0b7c13122 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Tue, 14 Sep 2021 16:59:37 +0200 Subject: [PATCH 4/4] BIG-81: fix error message. --- .../containers/Sales/Estimates/EstimateForm/EstimateForm.js | 2 +- client/src/containers/Sales/Invoices/InvoiceForm/utils.js | 2 +- client/src/lang/en/index.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/containers/Sales/Estimates/EstimateForm/EstimateForm.js b/client/src/containers/Sales/Estimates/EstimateForm/EstimateForm.js index eb9b9578c..0ee6b7979 100644 --- a/client/src/containers/Sales/Estimates/EstimateForm/EstimateForm.js +++ b/client/src/containers/Sales/Estimates/EstimateForm/EstimateForm.js @@ -82,7 +82,7 @@ function EstimateForm({ errors.some((error) => error.type === ERROR.SALE_ESTIMATE_NO_IS_REQUIRED) ) { setErrors({ - estimate_number: intl.get('estimate.field.error.estimate_number'), + estimate_number: intl.get('estimate.field.error.estimate_number_required'), }); } }; diff --git a/client/src/containers/Sales/Invoices/InvoiceForm/utils.js b/client/src/containers/Sales/Invoices/InvoiceForm/utils.js index 6ac7682bd..6874b6b0a 100644 --- a/client/src/containers/Sales/Invoices/InvoiceForm/utils.js +++ b/client/src/containers/Sales/Invoices/InvoiceForm/utils.js @@ -93,7 +93,7 @@ export const transformErrors = (errors, { setErrors }) => { errors.some((error) => error.type === ERROR.SALE_INVOICE_NO_IS_REQUIRED) ) { setErrors({ - invoice_no: intl.get('invoice.field.error.invoice_no'), + invoice_no: intl.get('invoice.field.error.invoice_no_required'), }); } }; diff --git a/client/src/lang/en/index.json b/client/src/lang/en/index.json index 4ed207dc5..348906c28 100644 --- a/client/src/lang/en/index.json +++ b/client/src/lang/en/index.json @@ -1324,6 +1324,6 @@ "auto_increment.field.manually": "I will enter them manually each time", "auto_increment.field.manual_this_transaction": "Manual entering for this transaction.", "auto_increment.field.auto": "Auto-incrementing number.", - "estimate.field.error.estimate_number":"Estimate number is required, use auto-increment mode or enter manually.", - "invoice.field.error.invoice_no":"Invoice number is required, use auto-increment mode or enter manually" + "estimate.field.error.estimate_number_required":"Estimate number is required, use auto-increment mode or enter manually.", + "invoice.field.error.invoice_no_required":"Invoice number is required, use auto-increment mode or enter manually" } \ No newline at end of file