refactor: simplify total calculation logic in quotation and debit note pages
This commit is contained in:
parent
a8f11d158b
commit
8dd3268738
2 changed files with 7 additions and 10 deletions
|
|
@ -390,15 +390,7 @@ async function storeDataLocal(id: string) {
|
|||
color: hsl(var(--info-bg));
|
||||
"
|
||||
>
|
||||
{{
|
||||
quotationStats[
|
||||
pageState.currentTab === 'Invoice'
|
||||
? 'paymentInProcess'
|
||||
: (toCamelCase(
|
||||
pageState.currentTab,
|
||||
) as keyof typeof quotationStats)
|
||||
]
|
||||
}}
|
||||
{{ Object.values(quotationStats).reduce((a, c) => a + c, 0) }}
|
||||
</q-badge>
|
||||
<q-btn
|
||||
class="q-ml-sm"
|
||||
|
|
|
|||
|
|
@ -172,7 +172,12 @@ watch(
|
|||
color: hsl(var(--info-bg));
|
||||
"
|
||||
>
|
||||
{{ pageState.total }}
|
||||
{{
|
||||
Object.entries(stats).reduce(
|
||||
(sum, [key, value]) => (key === 'canceled' ? sum : sum + value),
|
||||
0,
|
||||
)
|
||||
}}
|
||||
</q-badge>
|
||||
<q-btn
|
||||
class="q-ml-sm"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue