added pargar accounting

This commit is contained in:
2026-07-05 16:42:33 +03:30
parent 223c67426d
commit 6a0379e226
+14 -6
View File
@@ -782,11 +782,11 @@ export function getRialCashAmount(
walletInfo?: Record<string, unknown> | null, walletInfo?: Record<string, unknown> | null,
wallets?: UserWalletLine[] | null wallets?: UserWalletLine[] | null
): number { ): number {
const aggregated = walletInfo?.count_cash_wallet ?? walletInfo?.count_cash const directCash = walletInfo?.cash
if (aggregated != null && aggregated !== '') { if (directCash != null && directCash !== '') {
const parsed = Number(aggregated) const parsedDirect = Number(directCash)
if (!Number.isNaN(parsed)) { if (!Number.isNaN(parsedDirect)) {
return parsed return parsedDirect
} }
} }
@@ -795,7 +795,15 @@ export function getRialCashAmount(
return mainCash return mainCash
} }
return Number(walletInfo?.cash ?? 0) const aggregated = walletInfo?.count_cash_wallet ?? walletInfo?.count_cash
if (aggregated != null && aggregated !== '') {
const parsed = Number(aggregated)
if (!Number.isNaN(parsed)) {
return parsed
}
}
return 0
} }
export function getCashWalletBalance( export function getCashWalletBalance(