账单导出

This commit is contained in:
2026-11-01 16:17:12 +08:00
parent f91939f1f0
commit c73910ba74
8 changed files with 69 additions and 9 deletions
+17
View File
@@ -13,6 +13,7 @@ use App\Models\StoreOrderModel;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Facades\Excel;
use Modules\SystemTool\Services\SysSiteConfigService;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
/**
* 压回筐记录:周转筐/托盘跟账单走(生成账单时写入完整快照,只读);
@@ -243,6 +244,22 @@ class ContainerReturnTest extends ProcurementTestCase
);
}
/** 汇总导出标题按日期、门店及合计列的总宽度合并 */
public function test_export_title_is_merged_across_dynamic_columns(): void
{
$export = new ContainerReturnExport(
collect(),
[1 => '门店A', 2 => '门店B'],
'2026-08-01',
'2026-08-03',
);
$sheet = (new Spreadsheet())->getActiveSheet();
$export->styles($sheet);
$this->assertArrayHasKey('A1:D1', $sheet->getMergeCells());
}
/** 指定门店导出:仅所选门店成列,未选门店记录忽略;所选门店无记录整列填 0 */
public function test_export_filters_by_selected_stores(): void
{