refactoring: WIP payment receive and made form.

This commit is contained in:
a.bouhuolia
2021-02-16 17:31:18 +02:00
parent a75177b9d1
commit d60429f5e0
17 changed files with 441 additions and 657 deletions

View File

@@ -119,3 +119,26 @@ export function useOpenBill(props) {
},
);
}
/**
* Retrieve the due bills of the given vendor id.
* @param {number} vendorId -
*/
export function useDueBills(vendorId, props) {
const states = useQuery(
['BILLS_DUE', vendorId],
() =>
ApiService.get(`purchases/bills/due`, {
params: { vendor_id: vendorId },
}),
{
select: (res) => res.data.bills,
...props,
},
);
return {
...states,
data: defaultTo(states.data, []),
};
}