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));
|
color: hsl(var(--info-bg));
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{
|
{{ Object.values(quotationStats).reduce((a, c) => a + c, 0) }}
|
||||||
quotationStats[
|
|
||||||
pageState.currentTab === 'Invoice'
|
|
||||||
? 'paymentInProcess'
|
|
||||||
: (toCamelCase(
|
|
||||||
pageState.currentTab,
|
|
||||||
) as keyof typeof quotationStats)
|
|
||||||
]
|
|
||||||
}}
|
|
||||||
</q-badge>
|
</q-badge>
|
||||||
<q-btn
|
<q-btn
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,12 @@ watch(
|
||||||
color: hsl(var(--info-bg));
|
color: hsl(var(--info-bg));
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ pageState.total }}
|
{{
|
||||||
|
Object.entries(stats).reduce(
|
||||||
|
(sum, [key, value]) => (key === 'canceled' ? sum : sum + value),
|
||||||
|
0,
|
||||||
|
)
|
||||||
|
}}
|
||||||
</q-badge>
|
</q-badge>
|
||||||
<q-btn
|
<q-btn
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue