Compare commits

...

2 Commits

Author SHA1 Message Date
25ec37482c Merge remote-tracking branch 'origin/main' into fix/limeng-patch38-bookkeeping-headers 2026-12-03 15:24:01 +08:00
Claude
db4ea26b0e 快递应付(终版)记账明细:表头改成财务手工「记账」表的 34 列
物流单号、快递单号整理、物流公司、线上订单号、记账原因、商品编码、商品名称、记账金额、记账数据、收货人、发起人、发起时间、
店铺名称、买家昵称、省份、扣单时间、成本、重量、损耗、负责人、平台商品id、订单发货仓库、供应商、未发出、退回单号、报废、
成本记账、结算记账、结算运费、记账分析、是否代发、快递反馈、客服回复、原因(前面仍有「月份」)。
去掉原来的工单编号、记账原因一~三级选项等列。数据仍存 supplier_payable_overrides,无迁移。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNTa9mVziToe5w52mmrrar
2026-12-03 15:07:59 +08:00
2 changed files with 23 additions and 26 deletions

View File

@ -27,27 +27,19 @@ class CourierPayableFinalRegistry
$month = static fn (string $label): array => ['label' => $label, 'type' => 'month'];
return match ($dataset) {
// 表头照财务手工「记账」表(2026 年 10 月起)
'bookkeeping-details' => [
'started_at' => $text('发起时间'), 'work_order_no' => $text('工单编号'), 'initiator' => $text('发起人'),
'bookkeeping_reason' => $text('记账原因'), 'reason_level_1' => $text('记账原因-一级选项'),
'reason_level_2' => $text('记账原因-二级选项'), 'reason_level_3' => $text('记账原因-三级选项'),
'bookkeeping_type' => $text('记账类型'), 'executor' => $text('执行人'), 'source' => $text('记账来源'),
'amount' => $money('记账金额'), 'remark' => $text('记账备注说明'), 'attachment' => $text('上传附件'),
'attachment_preview' => $text('上传附件(预览)'), 'online_order_no' => $text('线上订单号'),
'internal_order_no' => $text('内部单号'), 'actual_paid_amount' => $money('实付金额'),
'carrier' => $text('物流公司'), 'tracking_no' => $text('物流单号'), 'shop_name' => $text('店铺名称'),
'platform' => $text('平台'), 'shipping_warehouse' => $text('订单发货仓库'),
'processing_status' => $text('记账处理状态'), 'counterparty_agreed' => $text('被记账方是否同意记账'),
'counterparty_note' => $text('被记账方处理说明'), 'specialist_result' => $text('专员记账判定结果'),
'specialist_note' => $text('专员处理说明'), 'updated_at' => $text('修改时间'),
'work_order_type' => $text('工单类型'), 'product_image' => $text('商品图片'),
'product_code' => $text('商品编码'), 'style_code' => $text('款式编码'),
'other_attribute_6' => $text('其它属性6'), 'product_name' => $text('商品名称'),
'platform_sku_id' => $text('平台商品skuid'), 'platform_product_id' => $text('平台商品id'),
'product_quantity' => $money('商品数量'), 'product_price' => $money('商品价格'),
'product_amount' => $money('商品金额'), 'buyer_paid_amount' => $money('买家实付'),
'supplier' => $text('供应商'), 'accepting_department' => $text('受理部门'),
'order_shipped_at' => $text('订单发货时间'), 'work_order_remark' => $text('工单备注'),
'tracking_no' => $text('物流单号'), 'tracking_no_clean' => $text('快递单号整理'), 'carrier' => $text('物流公司'),
'online_order_no' => $text('线上订单号'), 'bookkeeping_reason' => $text('记账原因'), 'product_code' => $text('商品编码'),
'product_name' => $text('商品名称'), 'amount' => $money('记账金额'), 'bookkeeping_data' => $text('记账数据'),
'receiver' => $text('收货人'), 'initiator' => $text('发起人'), 'started_at' => $text('发起时间'),
'shop_name' => $text('店铺名称'), 'buyer_nick' => $text('买家昵称'), 'province' => $text('省份'),
'deducted_at' => $text('扣单时间'), 'cost' => $money('成本'), 'weight' => $money('重量'), 'loss' => $money('损耗'),
'owner' => $text('负责人'), 'platform_product_id' => $text('平台商品id'), 'shipping_warehouse' => $text('订单发货仓库'),
'supplier' => $text('供应商'), 'unshipped' => $text('未发出'), 'return_no' => $text('退回单号'), 'scrapped' => $text('报废'),
'cost_bookkeeping' => $money('成本记账'), 'settle_bookkeeping' => $money('结算记账'), 'settle_freight' => $money('结算运费'),
'analysis' => $text('记账分析'), 'dropship' => $text('是否代发'), 'courier_feedback' => $text('快递反馈'),
'cs_reply' => $text('客服回复'), 'cause' => $text('原因'),
],
'compensation-details' => [
'paid_at' => $date('赔付日期'), 'carrier' => $text('承运商'), 'tracking_no' => $text('快递单号'),

View File

@ -33,8 +33,12 @@ class CourierPayableFinalPagesTest extends FeatureTestCase
->assertSeeText('编辑')
->assertSeeText('下载导入模板')
->assertSeeText('月份')
->assertSeeText('工单编号')
->assertSeeText('记账金额')
->assertSeeTextInOrder(['物流单号', '快递单号整理', '物流公司', '线上订单号', '记账原因', '商品编码', '商品名称', '记账金额',
'记账数据', '收货人', '发起人', '发起时间', '店铺名称', '买家昵称', '省份', '扣单时间', '成本', '重量', '损耗', '负责人',
'平台商品id', '订单发货仓库', '供应商', '未发出', '退回单号', '报废', '成本记账', '结算记账', '结算运费', '记账分析',
'是否代发', '快递反馈', '客服回复', '原因'])
->assertDontSeeText('工单编号')
->assertDontSeeText('记账原因-一级选项')
->assertSeeText('暂无数据,请点击“导入”上传本表数据。')
->assertSee('workspace/courier-payables-final/actions/bookkeeping-details/template', false);
}
@ -43,14 +47,15 @@ class CourierPayableFinalPagesTest extends FeatureTestCase
{
$file = UploadedFile::fake()->createWithContent(
'bookkeeping-details.csv',
"\xEF\xBB\xBF月份,发起时间,工单编号,发起人,记账金额,备注\n"
. "2026-09,2026-09-20 10:00:00,WO-FINAL-1,终版发起人,88.88,终版备注\n",
"\xEF\xBB\xBF记录标识,月份,物流单号,物流公司,发起人,发起时间,记账金额,成本,损耗,记账分析\n"
. "2026-10:1,2026-10,WO-FINAL-1,新北中通,终版发起人,2026-10-31 22:59:09,88.88,44.6,8.92,原单退回改0\n"
. "2026-10:2,2026-10,WO-FINAL-1,新北中通,终版发起人,2026-10-31 22:59:09,88.88,44.6,8.92,原单退回改0\n",
);
$this->loginAs()
->post(route('business.courier-payables-final.bookkeeping-details.import'), ['import' => $file])
->assertStatus(302)
->assertSessionHas('success', '导入完成:新增 1 条,更新 0 条。');
->assertSessionHas('success', '导入完成:新增 2 条,更新 0 条。'); // 有记录标识,完全一样的两行也各记一条
$this->assertDatabaseHas('supplier_payable_overrides', [
'company_id' => $this->company->id,
@ -63,7 +68,7 @@ class CourierPayableFinalPagesTest extends FeatureTestCase
'page' => 'bookkeeping-details',
]))
->assertOk()
->assertSeeText('2026-09')
->assertSeeText('2026-10')
->assertSeeText('WO-FINAL-1')
->assertSeeText('终版发起人')
->assertDontSeeText('暂无数据,请点击“导入”上传本表数据。');