fix(wallet): use kilogram as default unit for copper exchange
This commit is contained in:
@@ -1458,7 +1458,7 @@ class WalletController extends Controller
|
||||
'allows_decimal' => !$isCountBased,
|
||||
'unit' => $product
|
||||
? self::productQuantityUnit(self::productUnitPayload($product))
|
||||
: 'گرم',
|
||||
: 'کیلوگرم',
|
||||
];
|
||||
})->values();
|
||||
|
||||
|
||||
@@ -546,7 +546,7 @@ class Controller extends BaseController
|
||||
return $unit;
|
||||
}
|
||||
|
||||
return 'گرم';
|
||||
return 'کیلوگرم';
|
||||
}
|
||||
|
||||
public static function productLineWeightToGrams($product, $quantity): float
|
||||
|
||||
@@ -183,14 +183,14 @@ class WalletController extends Controller
|
||||
if (empty($record->title) || $record->title == "تعریف نشده") {
|
||||
|
||||
$record->title = $record->type_str;
|
||||
$record->unit = "گرم";
|
||||
$record->unit = "کیلوگرم";
|
||||
|
||||
if ((int) ($record->type ?? 0) === 22) {
|
||||
$record->title = 'تعدیل حسابداری پرگار';
|
||||
$record->unit = 'گرم';
|
||||
$record->unit = 'کیلوگرم';
|
||||
} elseif ((int) ($record->type ?? 0) === 23) {
|
||||
$record->title = 'تعدیل حسابداری تهحساب';
|
||||
$record->unit = 'گرم';
|
||||
$record->unit = 'کیلوگرم';
|
||||
} elseif ((int) ($record->type ?? 0) === 12) {
|
||||
$record->title = 'برداشت وجه نقد';
|
||||
$record->unit = 'ریال';
|
||||
|
||||
@@ -157,7 +157,7 @@ class AutomationCatalog
|
||||
'name' => 'موجودی طلا کیف اصلی',
|
||||
'inputs' => [
|
||||
['key' => 'op', 'type' => 'operator', 'label' => 'مقایسه'],
|
||||
['key' => 'value', 'type' => 'number', 'label' => 'مقدار (گرم)'],
|
||||
['key' => 'value', 'type' => 'number', 'label' => 'مقدار (کیلوگرم)'],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
@@ -39,10 +39,10 @@ class BalanceReportService
|
||||
return self::METAL_LABELS[$metalId] ?? "فلز {$metalId}";
|
||||
}
|
||||
|
||||
/** واحد نمایش موجودی/تراز هر فلز در ادمین — مس کیلوگرم، بقیه گرم */
|
||||
/** واحد نمایش موجودی/تراز هر فلز در ادمین — کیلوگرم */
|
||||
public function metalDisplayUnit(int $metalId): string
|
||||
{
|
||||
return (int) $metalId === 3 ? 'کیلوگرم' : 'گرم';
|
||||
return 'کیلوگرم';
|
||||
}
|
||||
|
||||
public function gramsToMetalDisplay(float $grams, int $metalId): float
|
||||
|
||||
Reference in New Issue
Block a user