feat(calculator): split wire wage, expected profit, and VAT
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -37,17 +37,25 @@
|
||||
|
||||
<BasicInput
|
||||
v-model:value="feePercent"
|
||||
title="اجرت ساخت (%)"
|
||||
title="اجرت ساخت مفتول (%)"
|
||||
type="tel"
|
||||
place-holder="مثلاً ۷"
|
||||
inputmode="decimal"
|
||||
/>
|
||||
|
||||
<BasicInput
|
||||
v-model:value="taxPercent"
|
||||
title="سود و مالیات (%)"
|
||||
v-model:value="profitPercent"
|
||||
title="سود مورد انتظار (%)"
|
||||
type="tel"
|
||||
place-holder="مثلاً ۹"
|
||||
place-holder="مثلاً ۵"
|
||||
inputmode="decimal"
|
||||
/>
|
||||
|
||||
<BasicInput
|
||||
v-model:value="taxPercent"
|
||||
title="مالیات ارزش افزوده (%)"
|
||||
type="tel"
|
||||
place-holder="مثلاً ۱۰"
|
||||
inputmode="decimal"
|
||||
/>
|
||||
|
||||
@@ -63,11 +71,15 @@
|
||||
<span class="gold-day-calc__num">{{ formatRial(breakdown.goldCost) }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between gap-2">
|
||||
<span>اجرت</span>
|
||||
<span>اجرت ساخت مفتول</span>
|
||||
<span class="gold-day-calc__num">{{ formatRial(breakdown.feeCost) }}</span>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -109,6 +121,7 @@ const weightUnit = computed(() => settingsStore.tradeWeightUnit)
|
||||
|
||||
const weight = ref<string | number>('')
|
||||
const feePercent = ref<string | number>('')
|
||||
const profitPercent = ref<string | number>('')
|
||||
const taxPercent = ref<string | number>('')
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user