feat(calculator): split wire wage, expected profit, and VAT

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-01 19:30:04 +03:30
co-authored by Cursor
parent 0fba52f3e7
commit e08af043e0
+25 -9
View File
@@ -37,17 +37,25 @@
<BasicInput <BasicInput
v-model:value="feePercent" v-model:value="feePercent"
title="اجرت ساخت (%)" title="اجرت ساخت مفتول (%)"
type="tel" type="tel"
place-holder="مثلاً ۷" place-holder="مثلاً ۷"
inputmode="decimal" inputmode="decimal"
/> />
<BasicInput <BasicInput
v-model:value="taxPercent" v-model:value="profitPercent"
title="سود و مالیات (%)" title="سود مورد انتظار (%)"
type="tel" type="tel"
place-holder="مثلاً ۹" place-holder="مثلاً ۵"
inputmode="decimal"
/>
<BasicInput
v-model:value="taxPercent"
title="مالیات ارزش افزوده (%)"
type="tel"
place-holder="مثلاً ۱۰"
inputmode="decimal" inputmode="decimal"
/> />
@@ -63,11 +71,15 @@
<span class="gold-day-calc__num">{{ formatRial(breakdown.goldCost) }}</span> <span class="gold-day-calc__num">{{ formatRial(breakdown.goldCost) }}</span>
</div> </div>
<div class="flex justify-between gap-2"> <div class="flex justify-between gap-2">
<span>اجرت</span> <span>اجرت ساخت مفتول</span>
<span class="gold-day-calc__num">{{ formatRial(breakdown.feeCost) }}</span> <span class="gold-day-calc__num">{{ formatRial(breakdown.feeCost) }}</span>
</div> </div>
<div class="flex justify-between gap-2"> <div class="flex justify-between gap-2">
<span>سود و مالیات</span> <span>سود مورد انتظار</span>
<span class="gold-day-calc__num">{{ formatRial(breakdown.profitCost) }}</span>
</div>
<div class="flex justify-between gap-2">
<span>مالیات ارزش افزوده</span>
<span class="gold-day-calc__num">{{ formatRial(breakdown.taxCost) }}</span> <span class="gold-day-calc__num">{{ formatRial(breakdown.taxCost) }}</span>
</div> </div>
</div> </div>
@@ -109,6 +121,7 @@ const weightUnit = computed(() => settingsStore.tradeWeightUnit)
const weight = ref<string | number>('') const weight = ref<string | number>('')
const feePercent = ref<string | number>('') const feePercent = ref<string | number>('')
const profitPercent = ref<string | number>('')
const taxPercent = ref<string | number>('') const taxPercent = ref<string | number>('')
const tick = ref(0) const tick = ref(0)
@@ -139,13 +152,16 @@ const breakdown = computed(() => {
void tick.value void tick.value
const w = parseNum(weight.value) const w = parseNum(weight.value)
const fee = parseNum(feePercent.value) const fee = parseNum(feePercent.value)
const profit = parseNum(profitPercent.value)
const tax = parseNum(taxPercent.value) const tax = parseNum(taxPercent.value)
const unit = liveUnitPrice.value const unit = liveUnitPrice.value
const goldCost = w * unit const goldCost = w * unit
const feeCost = goldCost * (fee / 100) const feeCost = goldCost * (fee / 100)
const taxCost = (goldCost + feeCost) * (tax / 100) const afterFee = goldCost + feeCost
const total = goldCost + feeCost + taxCost const profitCost = afterFee * (profit / 100)
return { goldCost, feeCost, taxCost, total } const taxCost = (afterFee + profitCost) * (tax / 100)
const total = afterFee + profitCost + taxCost
return { goldCost, feeCost, profitCost, taxCost, total }
}) })
const formattedTotal = computed(() => formatRial(breakdown.value.total)) const formattedTotal = computed(() => formatRial(breakdown.value.total))