This commit is contained in:
2026-07-02 01:25:29 +03:30
parent e5995939f4
commit 7ea7fa9ae9
6 changed files with 28 additions and 28 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ export interface DashboardFinance {
fullPriceSood?: number fullPriceSood?: number
fullPriceKarmozd?: number fullPriceKarmozd?: number
fullPriceKaermozd?: number fullPriceKaermozd?: number
/** سود اسپرد + کارمزد */ /** سود اختلاف قیمت + کارمزد */
totalTradingProfit?: number totalTradingProfit?: number
orderCount?: number orderCount?: number
Gifts?: string Gifts?: string
@@ -2,7 +2,7 @@
<section class="dashboard-income-summary"> <section class="dashboard-income-summary">
<DashboardSectionHeader title="خلاصه درآمد معاملات" :help="help" /> <DashboardSectionHeader title="خلاصه درآمد معاملات" :help="help" />
<p class="dashboard-income-summary__intro"> <p class="dashboard-income-summary__intro">
سود اسپرد (اختلاف قیمت) و کارمزد جدا محاسبه می‌شوند. جمع = هر دو. همه مبالغ سود اختلاف قیمت و کارمزد جدا محاسبه می‌شوند. جمع = هر دو. همه مبالغ
<strong>ریال</strong> هستند (نه تومان). <strong>ریال</strong> هستند (نه تومان).
</p> </p>
@@ -49,21 +49,21 @@ const props = defineProps<{
const help = dashboardTradingIncomeSummary const help = dashboardTradingIncomeSummary
const unit = DASHBOARD_RIAL_UNIT const unit = DASHBOARD_RIAL_UNIT
const spreadRial = computed(() => Number(props.finance?.fullPriceSood ?? 0)) const priceDiffRial = computed(() => Number(props.finance?.fullPriceSood ?? 0))
const commissionRial = computed(() => const commissionRial = computed(() =>
Number(props.finance?.fullPriceKarmozd ?? props.finance?.fullPriceKaermozd ?? 0) Number(props.finance?.fullPriceKarmozd ?? props.finance?.fullPriceKaermozd ?? 0)
) )
const totalRial = computed(() => const totalRial = computed(() =>
Number(props.finance?.totalTradingProfit ?? spreadRial.value + commissionRial.value) Number(props.finance?.totalTradingProfit ?? priceDiffRial.value + commissionRial.value)
) )
const rows = computed(() => [ const rows = computed(() => [
{ {
key: 'spread', key: 'priceDiff',
label: 'سود اسپرد', label: 'سود اختلاف قیمت',
hint: 'اختلاف قیمت پایه و قیمت مشتری', hint: 'فاصله بین قیمت پایه و قیمت مشتری',
amount: formatDashboardAmount(spreadRial.value), amount: formatDashboardAmount(priceDiffRial.value),
help: dashboardKpi.spreadProfit, help: dashboardKpi.priceDiffProfit,
isTotal: false, isTotal: false,
}, },
{ {
@@ -77,7 +77,7 @@ const rows = computed(() => [
{ {
key: 'total', key: 'total',
label: 'جمع سود', label: 'جمع سود',
hint: 'اسپرد + کارمزد', hint: 'اختلاف قیمت + کارمزد',
amount: formatDashboardAmount(totalRial.value), amount: formatDashboardAmount(totalRial.value),
help: dashboardKpi.totalTradingProfit, help: dashboardKpi.totalTradingProfit,
isTotal: true, isTotal: true,
@@ -284,7 +284,7 @@ export function useDashboardPage() {
return { return {
...chartSurfaceOptions(), ...chartSurfaceOptions(),
chart: { type: 'donut', fontFamily: 'inherit', offsetY: 4, foreColor: chartSurfaceOptions().chart.foreColor }, chart: { type: 'donut', fontFamily: 'inherit', offsetY: 4, foreColor: chartSurfaceOptions().chart.foreColor },
labels: ['سود اسپرد', 'کارمزد معامله', 'ارزش هدایا (گرم)'], labels: ['سود اختلاف قیمت', 'کارمزد معامله', 'ارزش هدایا (گرم)'],
colors: ['#10b981', '#f59e0b', '#8b5cf6'], colors: ['#10b981', '#f59e0b', '#8b5cf6'],
legend: { legend: {
position: 'bottom', position: 'bottom',
+12 -12
View File
@@ -27,17 +27,17 @@ export const dashboardGateway = help(
) )
export const dashboardKpi = { export const dashboardKpi = {
spreadProfit: help( priceDiffProfit: help(
'مجموع سود اسپرد (اختلاف قیمت پایه و قیمت مشتری) — فقط از تفاوت buy/sell price. کارمزد جداگانه در کارت «کارمزد معامله» است.', 'مجموع سود اختلاف قیمت (فاصله بین قیمت پایه و قیمت مشتری) — فقط از تفاوت buy/sell price. کارمزد جداگانه در کارت «کارمزد معامله» است.',
'سود اسپرد = جمع «سود کل» (total_fee) هر سفارش در بازه' 'سود اختلاف قیمت = جمع «سود کل» (total_fee) هر سفارش در بازه'
), ),
commission: help( commission: help(
'مجموع کارمزد ریالی معاملات (درصد/وزن کارمزد) — جدا از سود اسپرد.', 'مجموع کارمزد ریالی معاملات (درصد/وزن کارمزد) — جدا از سود اختلاف قیمت.',
'کارمزد = جمع service_charge_price هر سفارش در بازه' 'کارمزد = جمع service_charge_price هر سفارش در بازه'
), ),
totalTradingProfit: help( totalTradingProfit: help(
'مجموع سود اسپرد و کارمزد — همان ردیف «جمع» در خلاصه درآمد.', 'مجموع سود اختلاف قیمت و کارمزد — همان ردیف «جمع» در خلاصه درآمد.',
'جمع = سود اسپرد + کارمزد معاملات' 'جمع = سود اختلاف قیمت + کارمزد معاملات'
), ),
orderCount: help( orderCount: help(
'تعداد همه سفارش‌هایی که در بازه انتخابی ثبت شده‌اند (هر وضعیتی).', 'تعداد همه سفارش‌هایی که در بازه انتخابی ثبت شده‌اند (هر وضعیتی).',
@@ -58,8 +58,8 @@ export const dashboardKpi = {
} as const satisfies Record<string, DashboardHelp> } as const satisfies Record<string, DashboardHelp>
export const dashboardTradingIncomeSummary = help( export const dashboardTradingIncomeSummary = help(
'تفکیک درآمد از معاملات در بازه انتخابی: سود اسپرد (اختلاف قیمت) و کارمزد ریالی جدا، و جمع هر دو.', 'تفکیک درآمد از معاملات در بازه انتخابی: سود اختلاف قیمت و کارمزد ریالی جدا، و جمع هر دو.',
'جمع سود معاملات = سود اسپرد + کارمزد معاملات' 'جمع سود معاملات = سود اختلاف قیمت + کارمزد معاملات'
) )
export const dashboardDateRange = help( export const dashboardDateRange = help(
@@ -77,7 +77,7 @@ export const dashboardDateMetrics = {
'تراز قیمت−پرداخت = جمع |قیمت اصلی − پرداختی| − (گرم هدیه × مظنه)' 'تراز قیمت−پرداخت = جمع |قیمت اصلی − پرداختی| − (گرم هدیه × مظنه)'
), ),
totalTradingProfit: help( totalTradingProfit: help(
'همان «جمع سود معاملات» در خلاصه بالا — اسپرد + کارمزد.', 'همان «جمع سود معاملات» در خلاصه بالا — اختلاف قیمت + کارمزد.',
'جمع = fullPriceSood + fullPriceKarmozd' 'جمع = fullPriceSood + fullPriceKarmozd'
), ),
gifts: help( gifts: help(
@@ -88,8 +88,8 @@ export const dashboardDateMetrics = {
export const dashboardCharts = { export const dashboardCharts = {
incomeMix: help( incomeMix: help(
'تفکیک درآمد: سود اسپرد (اختلاف قیمت)، کارمزد ریالی، و ارزش هدایا.', 'تفکیک درآمد: سود اختلاف قیمت، کارمزد ریالی، و ارزش هدایا.',
'درآمد = سود اسپرد + کارمزد + (گرم هدیه × مظنه)' 'درآمد = سود اختلاف قیمت + کارمزد + (گرم هدیه × مظنه)'
), ),
buySellVolume: help( buySellVolume: help(
'مقدار طلای خرید و فروش مشتری در هر روز (فقط سفارش موفق).', 'مقدار طلای خرید و فروش مشتری در هر روز (فقط سفارش موفق).',
@@ -112,7 +112,7 @@ export const dashboardOrders = {
), ),
recent: help( recent: help(
'۱۴ سفارش آخر با جزئیات مظنه و سود.', '۱۴ سفارش آخر با جزئیات مظنه و سود.',
'مظنه = قیمت پایه | قیمت مشتری = مظنه ± اسپرد | سود/گرم = تفاوت اسپرد' 'مظنه = قیمت پایه | قیمت مشتری = مظنه ± اختلاف قیمت | سود/گرم = همان اختلاف قیمت'
), ),
} as const satisfies Record<string, DashboardHelp> } as const satisfies Record<string, DashboardHelp>
+4 -4
View File
@@ -341,8 +341,8 @@
<th class="px-2 py-2 text-right">مقدار</th> <th class="px-2 py-2 text-right">مقدار</th>
<th class="px-2 py-2 text-right">مظنه/گرم</th> <th class="px-2 py-2 text-right">مظنه/گرم</th>
<th class="px-2 py-2 text-right">قیمت مشتری</th> <th class="px-2 py-2 text-right">قیمت مشتری</th>
<th class="px-2 py-2 text-right">سود اسپرد/گرم</th> <th class="px-2 py-2 text-right">سود اختلاف قیمت/گرم</th>
<th class="px-2 py-2 text-right">سود اسپرد کل</th> <th class="px-2 py-2 text-right">سود کل اختلاف قیمت</th>
<th class="px-2 py-2 text-right">کارمزد (ریال)</th> <th class="px-2 py-2 text-right">کارمزد (ریال)</th>
<th class="px-2 py-2 text-right">وضعیت</th> <th class="px-2 py-2 text-right">وضعیت</th>
<th class="px-2 py-2 text-right">تاریخ</th> <th class="px-2 py-2 text-right">تاریخ</th>
@@ -522,9 +522,9 @@ const {
} = useDashboardPage() } = useDashboardPage()
const tradingProfitTotal = computed(() => { const tradingProfitTotal = computed(() => {
const spread = Number(finance.value?.fullPriceSood ?? 0) const priceDiff = Number(finance.value?.fullPriceSood ?? 0)
const commission = Number(finance.value?.fullPriceKarmozd ?? finance.value?.fullPriceKaermozd ?? 0) const commission = Number(finance.value?.fullPriceKarmozd ?? finance.value?.fullPriceKaermozd ?? 0)
return Number(finance.value?.totalTradingProfit ?? spread + commission) return Number(finance.value?.totalTradingProfit ?? priceDiff + commission)
}) })
const { const {
@@ -279,7 +279,7 @@ const KEY_HELP_FALLBACK: Record<string, string> = {
show_last_price: show_last_price:
'وقتی قیمت زنده در دسترس نباشد: روشن = آخرین قیمت ذخیره‌شده نشان داده می‌شود؛ خاموش = به‌جای صفر پیام «مظنه در دسترس نیست» نمایش داده می‌شود.', 'وقتی قیمت زنده در دسترس نباشد: روشن = آخرین قیمت ذخیره‌شده نشان داده می‌شود؛ خاموش = به‌جای صفر پیام «مظنه در دسترس نیست» نمایش داده می‌شود.',
fee_single: fee_single:
'اختلاف پایه (ریال) بین قیمت خرید و فروش روی مظنه. معمولاً نصف فاصله اسپرد کل است.', 'اختلاف پایه (ریال) بین قیمت خرید و فروش روی مظنه. معمولاً نصف مجموع اختلاف قیمت خرید و فروش است.',
buy_fee: buy_fee:
'مبلغ اضافه (ریال) روی قیمت پایه برای سمت خرید. اگر خالی بگذارید، از «اختلاف پایه» استفاده می‌شود.', 'مبلغ اضافه (ریال) روی قیمت پایه برای سمت خرید. اگر خالی بگذارید، از «اختلاف پایه» استفاده می‌شود.',
sell_fee: sell_fee: