From 73fdbdfc574236be44e3cf667e845ed01525803d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=9C=A8?= <594326199@qq.com> Date: Fri, 16 Oct 2026 22:33:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E4=BB=98=E6=AC=BE=E7=BB=88=E7=89=88?= =?UTF-8?q?=E8=B4=A7=E6=AC=BE=E5=AF=B9=E8=B4=A6=EF=BC=9A=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E5=90=8E=E6=96=B0=E5=A2=9E=E3=80=8C=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E3=80=8D=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 「月份」后依次为入库单号、采购单号、日期;导入模板/表格/导入/编辑/导出同一套字段,只作用于终版目录。 --- .../Services/PayablesFinalRegistry.php | 3 ++- .../Business/SupplierPayableFinalPagesTest.php | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/EcommerceFinance/Services/PayablesFinalRegistry.php b/modules/EcommerceFinance/Services/PayablesFinalRegistry.php index 98c9e9bb..74d8c444 100644 --- a/modules/EcommerceFinance/Services/PayablesFinalRegistry.php +++ b/modules/EcommerceFinance/Services/PayablesFinalRegistry.php @@ -40,7 +40,7 @@ class PayablesFinalRegistry * - remove:去掉的列; * - insert:锚点列之后插入的列(锚点列名 => 列定义); * - append:追加到末尾的列。 - * 货款对账在「月份」后补入库单号、采购单号,末尾补未发出、对账人; + * 货款对账在「月份」后补入库单号、采购单号、日期,末尾补未发出、对账人; * 退货对账去掉「快递名称」,在「标题」后插入 wms 配货单号,在「标记多标签」后补创建人。 */ private const SUPPLIER_FIELD_PATCHES = [ @@ -48,6 +48,7 @@ class PayablesFinalRegistry 'prepend' => [ 'stockNo' => ['label' => '入库单号', 'type' => 'text'], 'purchaseNo' => ['label' => '采购单号', 'type' => 'text'], + 'date' => ['label' => '日期', 'type' => 'date'], ], 'append' => [ 'unsent' => ['label' => '未发出', 'type' => 'text'], diff --git a/tests/Feature/Business/SupplierPayableFinalPagesTest.php b/tests/Feature/Business/SupplierPayableFinalPagesTest.php index 40ed0237..6ce261c3 100644 --- a/tests/Feature/Business/SupplierPayableFinalPagesTest.php +++ b/tests/Feature/Business/SupplierPayableFinalPagesTest.php @@ -84,12 +84,12 @@ class SupplierPayableFinalPagesTest extends FeatureTestCase try { file_put_contents($path, $response->streamedContent()); $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($path); - $header = $spreadsheet->getSheet(0)->rangeToArray('A1:T1')[0]; + $header = $spreadsheet->getSheet(0)->rangeToArray('A1:U1')[0]; $spreadsheet->disconnectWorksheets(); $this->assertSame([ - '记录标识', '月份', '入库单号', '采购单号', '供应商', '货号', '商品编码', '规格名称', '数量', '单价', - '金额', '预估单价', '预估金额', '供应商商品编码', '备注', '仓库名称', '快递名称', '快递单号', + '记录标识', '月份', '入库单号', '采购单号', '日期', '供应商', '货号', '商品编码', '规格名称', '数量', + '单价', '金额', '预估单价', '预估金额', '供应商商品编码', '备注', '仓库名称', '快递名称', '快递单号', '未发出', '对账人', ], $header); } finally { @@ -101,8 +101,8 @@ class SupplierPayableFinalPagesTest extends FeatureTestCase { $file = UploadedFile::fake()->createWithContent( 'payment-reconciliation.csv', - "\xEF\xBB\xBF月份,入库单号,采购单号,供应商,货号,商品编码,规格名称,数量,单价,金额,预估单价,预估金额,供应商商品编码,备注,仓库名称,快递名称,快递单号,未发出,对账人\n" - . "2026-09,RK-1,CG-1,终版供应商,X-1,P-1,规格甲,2,10,20,9,18,SC-1,备注甲,华东仓,顺丰,SF-1,未发出,对账人甲\n", + "\xEF\xBB\xBF月份,入库单号,采购单号,日期,供应商,货号,商品编码,规格名称,数量,单价,金额,预估单价,预估金额,供应商商品编码,备注,仓库名称,快递名称,快递单号,未发出,对账人\n" + . "2026-09,RK-1,CG-1,2026-09-08,终版供应商,X-1,P-1,规格甲,2,10,20,9,18,SC-1,备注甲,华东仓,顺丰,SF-1,未发出,对账人甲\n", ); $this->loginAs() @@ -123,15 +123,18 @@ class SupplierPayableFinalPagesTest extends FeatureTestCase ->assertOk() ->assertSeeText('入库单号') ->assertSeeText('采购单号') + ->assertSeeText('日期') ->assertSeeText('对账人') ->assertSeeText('RK-1') ->assertSeeText('CG-1') + ->assertSeeText('2026-09-08') ->assertSeeText('未发出') ->assertSeeText('对账人甲') ->assertSeeText('SF-1'); $export = $this->loginAs()->get(route('business.supplier-payables-final.payment-reconciliation.export')); $export->assertOk(); + $this->assertStringContainsString('采购单号,日期,供应商', $export->streamedContent()); $this->assertStringContainsString('快递单号,未发出,对账人', $export->streamedContent()); } -- 2.47.2