fix(厂家记账): 成本价工单运费使用空值

This commit is contained in:
limeng 2026-11-27 11:14:30 +08:00
parent 5e9218184c
commit 725a0aedfe
2 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ class SupplierBookkeepingValuation
$row['matched_tracking_no'] = implode("\n", array_values(array_unique(array_column($pool, 'express_no'))));
if ($costOnly) {
$row['matched_cost'] = self::money($cost);
$row['matched_freight'] = '';
$row['matched_freight'] = null;
$row['amount'] = self::money($cost);
$basis = implode('、', self::COST_ONLY_SUPPLIERS) . '只记成本价:按发货数量×商品成本价记账,不含运费';
} elseif ($freightOnly) {

View File

@ -373,7 +373,7 @@ class SupplierBookkeepingValuationTest extends TestCase
$row = $service->apply([$this->row(['supplier' => '沐野竹木', 'bookkeeping_type' => $type, 'amount' => $amount])])[0];
$this->assertSame('40.00', $row['amount'], $type);
$this->assertSame('40.00', $row['matched_cost']);
$this->assertSame('', $row['matched_freight']);
$this->assertNull($row['matched_freight']);
$this->assertSame('2', $row['matched_quantity']);
$this->assertSame('扣款', $row['deduction_status']);
$this->assertStringContainsString('沐野竹木只记成本价', $row['remark']);