fix report

This commit is contained in:
2026-06-24 01:17:34 +03:30
parent f44cb7263b
commit 7a18d76ad9
5 changed files with 256 additions and 34 deletions
+38 -3
View File
@@ -206,6 +206,27 @@ class Controller extends BaseController
return self::metalTypeSettingValue() ?? 'طلا';
}
public static function metalIdLabel(int $metalId): string
{
return match ($metalId) {
1 => 'طلا',
2 => 'نقره',
3 => 'مس',
default => self::metalTypeLabel(),
};
}
/** برچسب فلز کیف اصلی از `main_wallet_products` یا setting */
public static function mainWalletMetalLabel(): string
{
$product = app(ConfigService::class)->mainWalletRepresentativeProduct();
if ($product && (int) ($product->metal_id ?? 0) > 0) {
return self::metalIdLabel((int) $product->metal_id);
}
return self::metalTypeLabel();
}
/** برچسب معاملات آبشده: مقدار setting یا «آبشده» */
public static function meltedGoldLabel(): string
{
@@ -239,10 +260,14 @@ class Controller extends BaseController
public static function genericMetalTransactionTitles(): array
{
$titles = self::legacyMeltedTransactionTitles();
$titles = array_merge(self::legacyMeltedTransactionTitles(), [
'واریز طلایی',
'برداشت طلایی',
]);
foreach (self::metalLabelVariants() as $label) {
$titles[] = "موجودی {$label}";
$titles[] = "واریز {$label}";
$titles[] = "برداشت {$label}";
$titles[] = "خرید {$label}";
$titles[] = "فروش {$label}";
@@ -277,12 +302,22 @@ class Controller extends BaseController
public static function mainMetalBuyTitle(): string
{
return self::productBuyTitle(self::metalTypeLabel());
return self::productBuyTitle(self::mainWalletMetalLabel());
}
public static function mainMetalSellTitle(): string
{
return self::productSellTitle(self::metalTypeLabel());
return self::productSellTitle(self::mainWalletMetalLabel());
}
public static function mainMetalDepositTitle(): string
{
return 'واریز ' . self::mainWalletMetalLabel();
}
public static function mainMetalWithdrawTitle(): string
{
return 'برداشت ' . self::mainWalletMetalLabel();
}
/**