added pargar accounting
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user