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,
wallets?: UserWalletLine[] | null
): number {
const aggregated = walletInfo?.count_cash_wallet ?? walletInfo?.count_cash
if (aggregated != null && aggregated !== '') {
const parsed = Number(aggregated)
if (!Number.isNaN(parsed)) {
return parsed
const directCash = walletInfo?.cash
if (directCash != null && directCash !== '') {
const parsedDirect = Number(directCash)
if (!Number.isNaN(parsedDirect)) {
return parsedDirect
}
}
@@ -795,7 +795,15 @@ export function getRialCashAmount(
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(