diff --git a/modules/EcommerceFinance/Services/SupplierBookkeepingValuation.php b/modules/EcommerceFinance/Services/SupplierBookkeepingValuation.php index 03511029..d0fd146d 100644 --- a/modules/EcommerceFinance/Services/SupplierBookkeepingValuation.php +++ b/modules/EcommerceFinance/Services/SupplierBookkeepingValuation.php @@ -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) { diff --git a/tests/Unit/EcommerceFinance/SupplierBookkeepingValuationTest.php b/tests/Unit/EcommerceFinance/SupplierBookkeepingValuationTest.php index 5319e7ab..8c81e775 100644 --- a/tests/Unit/EcommerceFinance/SupplierBookkeepingValuationTest.php +++ b/tests/Unit/EcommerceFinance/SupplierBookkeepingValuationTest.php @@ -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']);