mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
fix: branch & warehouse multi select.
This commit is contained in:
@@ -38,8 +38,8 @@ const branchItemRenderer = (
|
|||||||
active={modifiers.active}
|
active={modifiers.active}
|
||||||
disabled={modifiers.disabled}
|
disabled={modifiers.disabled}
|
||||||
icon={isSelected ? 'tick' : 'blank'}
|
icon={isSelected ? 'tick' : 'blank'}
|
||||||
text={branch.name.toString()}
|
text={branch.name}
|
||||||
label={branch.code.toString()}
|
label={branch.code}
|
||||||
key={branch.id}
|
key={branch.id}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
/>
|
/>
|
||||||
@@ -50,7 +50,7 @@ const branchSelectProps = {
|
|||||||
itemPredicate: branchItemPredicate,
|
itemPredicate: branchItemPredicate,
|
||||||
itemRenderer: branchItemRenderer,
|
itemRenderer: branchItemRenderer,
|
||||||
valueAccessor: (item) => item.id,
|
valueAccessor: (item) => item.id,
|
||||||
labelAccessor: (item) => item.label,
|
labelAccessor: (item) => item.code,
|
||||||
tagRenderer: (item) => item.name,
|
tagRenderer: (item) => item.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ const warehouseItemRenderer = (
|
|||||||
active={modifiers.active}
|
active={modifiers.active}
|
||||||
disabled={modifiers.disabled}
|
disabled={modifiers.disabled}
|
||||||
icon={isSelected ? 'tick' : 'blank'}
|
icon={isSelected ? 'tick' : 'blank'}
|
||||||
text={warehouse.name.toString()}
|
text={warehouse.name}
|
||||||
label={warehouse.code.toString()}
|
label={warehouse.code}
|
||||||
key={warehouse.id}
|
key={warehouse.id}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
/>
|
/>
|
||||||
@@ -52,7 +52,7 @@ const warehouseSelectProps = {
|
|||||||
itemPredicate: warehouseItemPredicate,
|
itemPredicate: warehouseItemPredicate,
|
||||||
itemRenderer: warehouseItemRenderer,
|
itemRenderer: warehouseItemRenderer,
|
||||||
valueAccessor: (item) => item.id,
|
valueAccessor: (item) => item.id,
|
||||||
labelAccessor: (item) => item.label,
|
labelAccessor: (item) => item.code,
|
||||||
tagRenderer: (item) => item.name,
|
tagRenderer: (item) => item.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -54,10 +54,7 @@ function APAgingSummaryHeader({
|
|||||||
filterByOption: 'without-zero-balance',
|
filterByOption: 'without-zero-balance',
|
||||||
};
|
};
|
||||||
// Formik initial values.
|
// Formik initial values.
|
||||||
const initialValues = transformToForm(
|
const initialValues = transformToForm({ ...pageFilter }, defaultValues);
|
||||||
{ ...pageFilter, branchesIds: [] },
|
|
||||||
defaultValues,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Handle form submit.
|
// Handle form submit.
|
||||||
const handleSubmit = (values, { setSubmitting }) => {
|
const handleSubmit = (values, { setSubmitting }) => {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export const getDefaultAPAgingSummaryQuery = () => {
|
|||||||
agingDaysBefore: 30,
|
agingDaysBefore: 30,
|
||||||
agingPeriods: 3,
|
agingPeriods: 3,
|
||||||
vendorsIds: [],
|
vendorsIds: [],
|
||||||
|
branchesIds: [],
|
||||||
filterByOption: 'without-zero-balance',
|
filterByOption: 'without-zero-balance',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,6 @@ function ARAgingSummaryHeader({
|
|||||||
{
|
{
|
||||||
...pageFilter,
|
...pageFilter,
|
||||||
asDate: moment(pageFilter.asDate).toDate(),
|
asDate: moment(pageFilter.asDate).toDate(),
|
||||||
branchesIds: [],
|
|
||||||
},
|
},
|
||||||
defaultValues,
|
defaultValues,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,5 +15,6 @@ export const getDefaultARAgingSummaryQuery = () => {
|
|||||||
agingPeriods: 3,
|
agingPeriods: 3,
|
||||||
customersIds: [],
|
customersIds: [],
|
||||||
filterByOption: 'without-zero-balance',
|
filterByOption: 'without-zero-balance',
|
||||||
|
branchesIds: [],
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export const useBalanceSheetQuery = () => {
|
|||||||
return {
|
return {
|
||||||
...defaultQuery,
|
...defaultQuery,
|
||||||
...transformToForm(locationQuery, defaultQuery),
|
...transformToForm(locationQuery, defaultQuery),
|
||||||
|
branchesIds: [],
|
||||||
};
|
};
|
||||||
}, [locationQuery]);
|
}, [locationQuery]);
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export const useProfitLossSheetQuery = () => {
|
|||||||
return {
|
return {
|
||||||
...defaultQuery,
|
...defaultQuery,
|
||||||
...transformToForm(locationQuery, defaultQuery),
|
...transformToForm(locationQuery, defaultQuery),
|
||||||
|
branchesIds: [],
|
||||||
};
|
};
|
||||||
}, [locationQuery]);
|
}, [locationQuery]);
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,7 @@ export function getDefaultTrialBalanceQuery() {
|
|||||||
toDate: moment().endOf('year').format('YYYY-MM-DD'),
|
toDate: moment().endOf('year').format('YYYY-MM-DD'),
|
||||||
basis: 'accural',
|
basis: 'accural',
|
||||||
filterByOption: 'with-transactions',
|
filterByOption: 'with-transactions',
|
||||||
|
branchesIds: [],
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user