admin: 单笔标记支付并生效回执差额安全阀按容差配置化对齐
This commit is contained in:
@@ -463,7 +463,12 @@ class PlatformOrderController extends Controller
|
||||
$expectedPaid = (float) (($order->paid_amount ?? 0) > 0 ? $order->paid_amount : $order->payable_amount);
|
||||
$receiptCents = (int) round($receiptTotal * 100);
|
||||
$expectedCents = (int) round($expectedPaid * 100);
|
||||
if ($receiptCents > 0 && abs($receiptCents - $expectedCents) >= 1) {
|
||||
|
||||
$tol = (float) config('saasshop.amounts.tolerance', 0.01);
|
||||
$tolCents = (int) round($tol * 100);
|
||||
$tolCents = max(1, $tolCents);
|
||||
|
||||
if ($receiptCents > 0 && abs($receiptCents - $expectedCents) >= $tolCents) {
|
||||
return redirect()->back()->with('warning', '当前订单已存在支付回执,但回执总额与订单金额不一致。为避免带病推进,请先补齐/修正支付回执后再执行「标记支付并生效」。');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user