应付款终版货款对账:采购单号后新增「日期」列 #358

Merged
renshen merged 1 commits from feature/sumu-payment-reconciliation-date-column into main 2026-10-16 22:34:03 +08:00
2 changed files with 10 additions and 6 deletions

View File

@ -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'],

View File

@ -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());
}