fix some bugs
This commit is contained in:
@@ -596,6 +596,12 @@ class SingleOrderController extends Controller
|
||||
// سمت کسر کارمزد برای گزارش تفکیکشده در داشبورد
|
||||
$data['fee_asset'] = $rialLocked ? 'gold' : 'rial';
|
||||
|
||||
if (!$rialLocked && (float) $data['total_price'] < 0) {
|
||||
throw new UnprocessableEntityHttpException(
|
||||
'مبلغ دریافتی فروش پس از کارمزد منفی شد. درصد کارمزد سفارش را بررسی کنید (باید اعشاری باشد؛ مثلاً ۰٫۰۱ برای ۱٪).'
|
||||
);
|
||||
}
|
||||
|
||||
$grossTotal = $data['amount'] * $data['price'];
|
||||
$this->enforceProductOrderLimits($data, (float) $grossTotal);
|
||||
|
||||
@@ -675,6 +681,11 @@ class SingleOrderController extends Controller
|
||||
$data['total_price'] = $data['amount'] * $data['price'] - $data['service_charge_price'];
|
||||
$data['payment_amount'] = $data['total_price'];
|
||||
$data['fee_asset'] = 'rial';
|
||||
if ($data['total_price'] < 0) {
|
||||
throw new UnprocessableEntityHttpException(
|
||||
'مبلغ دریافتی فروش پس از کارمزد منفی شد. درصد کارمزد سفارش را بررسی کنید (باید اعشاری باشد؛ مثلاً ۰٫۰۱ برای ۱٪).'
|
||||
);
|
||||
}
|
||||
$grossTotal = (float) ($data['amount'] * $data['price']);
|
||||
$this->enforceProductOrderLimits($data, $grossTotal);
|
||||
$wallet_interface_product = $this->productWalletInterface((int) $data["product_id"]);
|
||||
|
||||
Reference in New Issue
Block a user