From e08af043e0991253b8160b09f4c717312d40c69e Mon Sep 17 00:00:00 2001 From: safavimohadeseh78 Date: Sun, 1 Nov 2026 19:30:04 +0330 Subject: [PATCH] feat(calculator): split wire wage, expected profit, and VAT Co-authored-by: Cursor --- src/components/GoldDayCalculatorModal.vue | 34 +++++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/components/GoldDayCalculatorModal.vue b/src/components/GoldDayCalculatorModal.vue index 71b752f..9df5f6a 100644 --- a/src/components/GoldDayCalculatorModal.vue +++ b/src/components/GoldDayCalculatorModal.vue @@ -37,17 +37,25 @@ + + @@ -63,11 +71,15 @@ {{ formatRial(breakdown.goldCost) }}
- اجرت + اجرت ساخت مفتول {{ formatRial(breakdown.feeCost) }}
- سود و مالیات + سود مورد انتظار + {{ formatRial(breakdown.profitCost) }} +
+
+ مالیات ارزش افزوده {{ formatRial(breakdown.taxCost) }}
@@ -109,6 +121,7 @@ const weightUnit = computed(() => settingsStore.tradeWeightUnit) const weight = ref('') const feePercent = ref('') +const profitPercent = ref('') const taxPercent = ref('') const tick = ref(0) @@ -139,13 +152,16 @@ const breakdown = computed(() => { void tick.value const w = parseNum(weight.value) const fee = parseNum(feePercent.value) + const profit = parseNum(profitPercent.value) const tax = parseNum(taxPercent.value) const unit = liveUnitPrice.value const goldCost = w * unit const feeCost = goldCost * (fee / 100) - const taxCost = (goldCost + feeCost) * (tax / 100) - const total = goldCost + feeCost + taxCost - return { goldCost, feeCost, taxCost, total } + const afterFee = goldCost + feeCost + const profitCost = afterFee * (profit / 100) + const taxCost = (afterFee + profitCost) * (tax / 100) + const total = afterFee + profitCost + taxCost + return { goldCost, feeCost, profitCost, taxCost, total } }) const formattedTotal = computed(() => formatRial(breakdown.value.total))