From 73feee2048e7a4d463ba5172f06e57e8c7e12bc1 Mon Sep 17 00:00:00 2001 From: adonis Date: Thu, 23 Jul 2026 12:28:48 +0330 Subject: [PATCH] fix edits for borsemes --- src/model/dashboard.ts | 24 ++- .../components/DashboardProfitSplit.vue | 137 ++++++++++++++---- .../DashboardTradingIncomeSummary.vue | 34 ++++- src/pages/menuPages/configuration/index.vue | 42 ++++-- .../menuPages/configuration/settingTypes.ts | 14 +- src/utils/config.ts | 17 +++ 6 files changed, 210 insertions(+), 58 deletions(-) diff --git a/src/model/dashboard.ts b/src/model/dashboard.ts index d24ca9d..65b800b 100644 --- a/src/model/dashboard.ts +++ b/src/model/dashboard.ts @@ -31,15 +31,33 @@ export interface DashboardMaster { }> } +export interface DashboardQuantityProductProfit { + product_id: number + title: string + group_type?: string | null + /** کارمزد کسرشده از کیف همان محصول (گرم/واحد) */ + grams: number + value_rial: number + unit?: string +} + +export interface DashboardDailyProductProfit { + product_id: number + title: string + grams: number +} + export interface DashboardDailyProfit { date: string - /** سود طلایی روز: کارمزد کسرشده از طلا (گرم) */ + /** سود فلزی روز: کارمزد کسرشده از فلز (گرم) */ profit_gold: number /** سود ریالی روز: کارمزد کسرشده از ریال */ profit_rial: number /** سود اختلاف قیمت روز (ریال) */ spread_rial: number order_count: number + /** تفکیک سود مقداری به‌ازای هر محصول در همان روز */ + profit_by_product?: DashboardDailyProductProfit[] } export interface DashboardFinance { @@ -54,7 +72,7 @@ export interface DashboardFinance { Gifts?: string GiftsPrise?: number sumAll?: number - /** سود طلایی: مجموع کارمزدهای کسرشده از طلا (گرم) */ + /** سود طلایی/فلزی: مجموع کارمزدهای کسرشده از فلز (گرم) */ profitGoldGrams?: number /** سود ریالی: مجموع کارمزدهای کسرشده از ریال */ profitRial?: number @@ -68,6 +86,8 @@ export interface DashboardFinance { profitGoldConvertedGram?: number /** ارزش ریالی سود طلایی با قیمت روز */ profitGoldValueRial?: number + /** سود کارمزد فلزی به‌ازای هر محصول مقداری/آبشده */ + profitQuantityProducts?: DashboardQuantityProductProfit[] /** تفکیک روزانهٔ سود طلایی/ریالی */ daily?: DashboardDailyProfit[] } diff --git a/src/pages/dashboard/components/DashboardProfitSplit.vue b/src/pages/dashboard/components/DashboardProfitSplit.vue index f07e7e3..be3917a 100644 --- a/src/pages/dashboard/components/DashboardProfitSplit.vue +++ b/src/pages/dashboard/components/DashboardProfitSplit.vue @@ -3,10 +3,10 @@
- + ثبت سند تبدیل سود به طلا
@@ -40,22 +40,48 @@
- +
-
+
+

+ کارمزد کسرشده از کیف این محصول در بازهٔ انتخابی +

+

+ {{ formatGram(item.grams) }} + {{ item.unit || 'گرم' }} +

+

≈ {{ formatDashboardAmount(item.value_rial) }} ریال

+
+ +
+ -

کارمزد کسرشده از طلا در بازهٔ انتخابی

+

+ کارمزد کسرشده از {{ metalShortLabel }} در بازهٔ انتخابی +

{{ formatGram(profitGoldGrams) }} گرم

≈ {{ formatDashboardAmount(profitGoldValueRial) }} ریال

-

+

شامل {{ formatGram(profitGoldConvertedGram) }} گرم از تبدیل سود ریالی

@@ -73,7 +99,7 @@ ریال

-