diff --git a/src/components/Branches/BranchMultiSelect.js b/src/components/Branches/BranchMultiSelect.js index fca8b168c..db880b32e 100644 --- a/src/components/Branches/BranchMultiSelect.js +++ b/src/components/Branches/BranchMultiSelect.js @@ -38,8 +38,8 @@ const branchItemRenderer = ( active={modifiers.active} disabled={modifiers.disabled} icon={isSelected ? 'tick' : 'blank'} - text={branch.name.toString()} - label={branch.code.toString()} + text={branch.name} + label={branch.code} key={branch.id} onClick={handleClick} /> @@ -50,7 +50,7 @@ const branchSelectProps = { itemPredicate: branchItemPredicate, itemRenderer: branchItemRenderer, valueAccessor: (item) => item.id, - labelAccessor: (item) => item.label, + labelAccessor: (item) => item.code, tagRenderer: (item) => item.name, }; diff --git a/src/components/Warehouses/WarehouseMultiSelect.js b/src/components/Warehouses/WarehouseMultiSelect.js index e39651e94..0a24eeef7 100644 --- a/src/components/Warehouses/WarehouseMultiSelect.js +++ b/src/components/Warehouses/WarehouseMultiSelect.js @@ -40,8 +40,8 @@ const warehouseItemRenderer = ( active={modifiers.active} disabled={modifiers.disabled} icon={isSelected ? 'tick' : 'blank'} - text={warehouse.name.toString()} - label={warehouse.code.toString()} + text={warehouse.name} + label={warehouse.code} key={warehouse.id} onClick={handleClick} /> @@ -52,7 +52,7 @@ const warehouseSelectProps = { itemPredicate: warehouseItemPredicate, itemRenderer: warehouseItemRenderer, valueAccessor: (item) => item.id, - labelAccessor: (item) => item.label, + labelAccessor: (item) => item.code, tagRenderer: (item) => item.name, }; diff --git a/src/containers/FinancialStatements/APAgingSummary/APAgingSummaryHeader.js b/src/containers/FinancialStatements/APAgingSummary/APAgingSummaryHeader.js index 0039713fb..ba5aaeb86 100644 --- a/src/containers/FinancialStatements/APAgingSummary/APAgingSummaryHeader.js +++ b/src/containers/FinancialStatements/APAgingSummary/APAgingSummaryHeader.js @@ -54,10 +54,7 @@ function APAgingSummaryHeader({ filterByOption: 'without-zero-balance', }; // Formik initial values. - const initialValues = transformToForm( - { ...pageFilter, branchesIds: [] }, - defaultValues, - ); + const initialValues = transformToForm({ ...pageFilter }, defaultValues); // Handle form submit. const handleSubmit = (values, { setSubmitting }) => { diff --git a/src/containers/FinancialStatements/APAgingSummary/common.js b/src/containers/FinancialStatements/APAgingSummary/common.js index 82ef7dee5..f07e5049b 100644 --- a/src/containers/FinancialStatements/APAgingSummary/common.js +++ b/src/containers/FinancialStatements/APAgingSummary/common.js @@ -11,6 +11,7 @@ export const getDefaultAPAgingSummaryQuery = () => { agingDaysBefore: 30, agingPeriods: 3, vendorsIds: [], + branchesIds: [], filterByOption: 'without-zero-balance', } } \ No newline at end of file diff --git a/src/containers/FinancialStatements/ARAgingSummary/ARAgingSummaryHeader.js b/src/containers/FinancialStatements/ARAgingSummary/ARAgingSummaryHeader.js index 6b688849c..fcaa5886f 100644 --- a/src/containers/FinancialStatements/ARAgingSummary/ARAgingSummaryHeader.js +++ b/src/containers/FinancialStatements/ARAgingSummary/ARAgingSummaryHeader.js @@ -51,13 +51,12 @@ function ARAgingSummaryHeader({ branchesIds: [], filterByOption: 'without-zero-balance', }; - + // Initial values. const initialValues = transformToForm( { ...pageFilter, asDate: moment(pageFilter.asDate).toDate(), - branchesIds: [], }, defaultValues, ); diff --git a/src/containers/FinancialStatements/ARAgingSummary/common.js b/src/containers/FinancialStatements/ARAgingSummary/common.js index 0c9fd1685..592c253b0 100644 --- a/src/containers/FinancialStatements/ARAgingSummary/common.js +++ b/src/containers/FinancialStatements/ARAgingSummary/common.js @@ -15,5 +15,6 @@ export const getDefaultARAgingSummaryQuery = () => { agingPeriods: 3, customersIds: [], filterByOption: 'without-zero-balance', + branchesIds: [], }; }; diff --git a/src/containers/FinancialStatements/BalanceSheet/utils.js b/src/containers/FinancialStatements/BalanceSheet/utils.js index a9d2f1892..ce6547c1c 100644 --- a/src/containers/FinancialStatements/BalanceSheet/utils.js +++ b/src/containers/FinancialStatements/BalanceSheet/utils.js @@ -47,6 +47,7 @@ export const useBalanceSheetQuery = () => { return { ...defaultQuery, ...transformToForm(locationQuery, defaultQuery), + branchesIds: [], }; }, [locationQuery]); diff --git a/src/containers/FinancialStatements/ProfitLossSheet/utils.js b/src/containers/FinancialStatements/ProfitLossSheet/utils.js index f40d5c1cb..413ba31d6 100644 --- a/src/containers/FinancialStatements/ProfitLossSheet/utils.js +++ b/src/containers/FinancialStatements/ProfitLossSheet/utils.js @@ -49,6 +49,7 @@ export const useProfitLossSheetQuery = () => { return { ...defaultQuery, ...transformToForm(locationQuery, defaultQuery), + branchesIds: [], }; }, [locationQuery]); diff --git a/src/containers/FinancialStatements/TrialBalanceSheet/utils.js b/src/containers/FinancialStatements/TrialBalanceSheet/utils.js index 13413f4cc..894c527c0 100644 --- a/src/containers/FinancialStatements/TrialBalanceSheet/utils.js +++ b/src/containers/FinancialStatements/TrialBalanceSheet/utils.js @@ -6,5 +6,7 @@ export function getDefaultTrialBalanceQuery() { toDate: moment().endOf('year').format('YYYY-MM-DD'), basis: 'accural', filterByOption: 'with-transactions', + branchesIds: [], + }; }