From 69a39ff37130502a7c79c1172c7bd5a0d957b376 Mon Sep 17 00:00:00 2001 From: adonis Date: Tue, 23 Jun 2026 22:30:51 +0330 Subject: [PATCH] fix some bugs --- src/utils/productAssets.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/productAssets.ts b/src/utils/productAssets.ts index e60ae7c..c0b5572 100644 --- a/src/utils/productAssets.ts +++ b/src/utils/productAssets.ts @@ -327,7 +327,10 @@ export function buildBoursecuHomeAssetRows( const metalTotals = summary.metal_totals ?? [] const copperMetal = findMetalTotalById(metalTotals, METAL_COPPER) const weightUnit = copperMetal?.unit || 'کیلوگرم' - const totalCopperWeight = sumBoursecuHomeProductInventories(inventoryCards, countProducts) + const totalCopperWeight = + copperMetal != null + ? Number(copperMetal.total_weight ?? 0) + : sumBoursecuHomeProductInventories(inventoryCards, countProducts) const cash = Number(summary.cash_wallet ?? 0) const metalRial = resolveAssetsRialValue(summary, liveCopperPrice)