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