采购单优化

This commit is contained in:
liu
2026-08-12 23:20:05 +08:00
parent c2c56408a0
commit 0211e5e98d
22 changed files with 768 additions and 1425 deletions
+2 -1
View File
@@ -58,8 +58,9 @@ readonly class PurchaseGenerateService
static fn (string $carry, $item): string => bcadd($carry, (string) $item->quantity, 2),
'0'
);
// 预估金额 = Σ订货金额(明细金额 price×quantity),与采购单修改重算口径一致
$estimateAmount = $items->reduce(
static fn (string $carry, $item): string => bcadd($carry, bcmul($item->quantity, (string) $item->cost_price, 2), 2),
static fn (string $carry, $item): string => bcadd($carry, (string) $item->amount, 2),
'0'
);