优化采购单

This commit is contained in:
liu
2026-08-13 12:34:32 +08:00
parent 099e92b1ff
commit 61a70319a0
14 changed files with 628 additions and 276 deletions
+2 -2
View File
@@ -58,9 +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, (string) $item->amount, 2),
static fn (string $carry, $item): string => bcadd($carry, bcmul($item->quantity, $item->cost_price, 2), 2),
'0'
);