fix: update status handling in debit note list retrieval and remove unused issued stats calculation
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s

This commit is contained in:
puriphatt 2025-07-07 16:22:21 +07:00
parent 84591ae719
commit 34f5b6474b

View file

@ -66,9 +66,7 @@ async function getList(opts?: { page?: number; pageSize?: number }) {
page: opts?.page || page.value, page: opts?.page || page.value,
pageSize: opts?.pageSize || pageSize.value, pageSize: opts?.pageSize || pageSize.value,
query: pageState.inputSearch === '' ? undefined : pageState.inputSearch, query: pageState.inputSearch === '' ? undefined : pageState.inputSearch,
status: (pageState.currentTab === DebitNoteStatus.Issued status: pageState.currentTab,
? undefined
: pageState.currentTab) as DebitNoteStatus,
includeRegisteredBranch: true, includeRegisteredBranch: true,
startDate: pageState.searchDate[0], startDate: pageState.searchDate[0],
endDate: pageState.searchDate[1], endDate: pageState.searchDate[1],
@ -137,10 +135,10 @@ onMounted(async () => {
if (res) { if (res) {
stats.value = res; stats.value = res;
stats.value['issued'] = Object.values(res).reduce( // stats.value['issued'] = Object.values(res).reduce(
(sum, value) => sum + value, // (sum, value) => sum + value,
0, // 0,
); // );
} }
}); });