业绩明细:实收对不上账单时也退回按应付/已付核对(覆盖拆单主单实收为空、子单有值的情况)

This commit is contained in:
yueyang 2026-10-15 15:37:59 +08:00
parent f41a8fa6ba
commit 3e222e0035

View File

@ -758,7 +758,9 @@ class SyncStoreReceiptOrderMatches extends Command
$altValue = $altMatched ? (float) $altAmount : 0.0;
// 实收有值且能对上 → 按实收核对;实收缺失(0/空)时退回「应付/已付」核对(拆单主单实收常为空)。
$payAmount = null;
if (! ($altMatched && $altValue > 0.005)) {
// 实收缺失、或实收对不上账单时,都退回去试「应付/已付」(拆单主单实收为空、
// 或主单没写实收而子单写了值的情况都覆盖到)。
if (! ($altMatched && abs($income + $promoAmount - $altValue) <= 0.02)) {
[$payStatus, $payValue] = $this->matchOrderSide(
$core,
(string) $group['shop_key'],