fix(copper): update havale and order controller unit labels to kilogram

This commit is contained in:
2026-11-18 10:14:59 +03:30
parent 6159ddf490
commit 0004192cbc
2 changed files with 8 additions and 8 deletions
@@ -70,7 +70,7 @@ class havaleController extends Controller
'expire_at' => now(), 'expire_at' => now(),
'active' => true, 'active' => true,
'start_at' => now(), 'start_at' => now(),
'note' => " حواله از $sender->name به $receiver->name به مقدار $request->amount گرم", 'note' => " حواله از $sender->name به $receiver->name به مقدار $request->amount کیلوگرم",
], 10, false); ], 10, false);
// dump($sender_wallet->wallet->gold); // dump($sender_wallet->wallet->gold);
$receiverWallet = new WalletInterface($receiver->id, 2); $receiverWallet = new WalletInterface($receiver->id, 2);
@@ -81,7 +81,7 @@ class havaleController extends Controller
'expire_at' => now(), 'expire_at' => now(),
'active' => true, 'active' => true,
'start_at' => now(), 'start_at' => now(),
'note' => " حواله از $sender->name به $receiver->name به مقدار $request->amount گرم", 'note' => " حواله از $sender->name به $receiver->name به مقدار $request->amount کیلوگرم",
], 10, true); ], 10, true);
// dump($reciverWallet->wallet->gold); // dump($reciverWallet->wallet->gold);
return "تراکنش موفق"; return "تراکنش موفق";
@@ -939,7 +939,7 @@ class SingleOrderController extends Controller
$amountLabel = self::formatSmsGoldWeight($amount); $amountLabel = self::formatSmsGoldWeight($amount);
$message = "کاربر {$customer->name} با شماره موبایل {$customer->mobile} اقدام به $transactionType {$subjectTitle} به مقدار " . $message = "کاربر {$customer->name} با شماره موبایل {$customer->mobile} اقدام به $transactionType {$subjectTitle} به مقدار " .
"{$amountLabel} گرم به مبلغ " . number_format($totalPrice) . "{$amountLabel} کیلوگرم به مبلغ " . number_format($totalPrice) .
" ریال کرد. با تشکر، $companyName"; " ریال کرد. با تشکر، $companyName";
if (self::isSmsNotifEnabled('sms_notif_order_admin')) { if (self::isSmsNotifEnabled('sms_notif_order_admin')) {
User::where('send_sms', 1)->get()->each(function ($admin) use ($message) { User::where('send_sms', 1)->get()->each(function ($admin) use ($message) {
@@ -954,7 +954,7 @@ class SingleOrderController extends Controller
$goldBalance = $wallet ? ($wallet->gold ?? 0) : 0; $goldBalance = $wallet ? ($wallet->gold ?? 0) : 0;
$cashBalance = $wallet ? ($wallet->cash ?? 0) : 0; $cashBalance = $wallet ? ($wallet->cash ?? 0) : 0;
$goldBalanceLabel = self::formatSmsGoldWeight($goldBalance); $goldBalanceLabel = self::formatSmsGoldWeight($goldBalance);
$customerMessage = "$companyName\n$transactionType {$subjectTitle}\nگرم: {$amountLabel}\n" . $customerMessage = "$companyName\n$transactionType {$subjectTitle}\nکیلوگرم: {$amountLabel}\n" .
"مبلغ کل: " . number_format($totalPrice) . "\n\n" . "مبلغ کل: " . number_format($totalPrice) . "\n\n" .
"موجودی {$balanceLabel}: {$goldBalanceLabel}\n" . "موجودی {$balanceLabel}: {$goldBalanceLabel}\n" .
"مانده ریالی: " . number_format($cashBalance) . "\n" . "مانده ریالی: " . number_format($cashBalance) . "\n" .
@@ -969,7 +969,7 @@ class SingleOrderController extends Controller
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer( app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
(int) $customer->id, (int) $customer->id,
$transactionType . ' ' . $subjectTitle, $transactionType . ' ' . $subjectTitle,
"گرم: {$amount}\nمبلغ کل: " . number_format((float) $totalPrice) . " ریال", "کیلوگرم: {$amount}\nمبلغ کل: " . number_format((float) $totalPrice) . " ریال",
'success' 'success'
); );
} catch (\Throwable $e) { } catch (\Throwable $e) {
@@ -1206,7 +1206,7 @@ class SingleOrderController extends Controller
$companyName = $this->Config('name_fa'); // Company name from configuration $companyName = $this->Config('name_fa'); // Company name from configuration
// Constructing the SMS message // Constructing the SMS message
$message = "کاربر $userName با شماره موبایل $userMobile اقدام به $transactionType طلا به مقدار " . $chargedAmountGold . " گرم به مبلغ " . number_format($chargedAmount) . " ریال کرد. با تشکر، $companyName"; $message = "کاربر $userName با شماره موبایل $userMobile اقدام به $transactionType طلا به مقدار " . $chargedAmountGold . " کیلوگرم به مبلغ " . number_format($chargedAmount) . " ریال کرد. با تشکر، $companyName";
// Getting admin mobile numbers and sending the SMS // Getting admin mobile numbers and sending the SMS
@@ -1228,8 +1228,8 @@ class SingleOrderController extends Controller
$message = "$companyName\n"; $message = "$companyName\n";
$message .= "خرید آبشده\n"; $message .= "خرید آبشده\n";
$message .= "گرم: $weightLabel\n"; $message .= "کیلوگرم: $weightLabel\n";
$message .= "قیمت گرم: " . number_format($pricePerGram) . "\n"; $message .= "قیمت کیلوگرم: " . number_format($pricePerGram) . "\n";
$message .= "مبلغ کل: " . number_format($totalAmount) . "\n\n"; $message .= "مبلغ کل: " . number_format($totalAmount) . "\n\n";
$message .= "موجودی طلایی: $goldBalance\n"; $message .= "موجودی طلایی: $goldBalance\n";
$message .= "مانده ریالی: " . number_format($remainingBalance) . "\n"; $message .= "مانده ریالی: " . number_format($remainingBalance) . "\n";