导出样式

This commit is contained in:
liu
2026-09-03 22:00:58 +08:00
parent 1370926780
commit c986c86ed5
7 changed files with 438 additions and 50 deletions
+3 -3
View File
@@ -142,7 +142,7 @@ class ExportTest extends ProcurementTestCase
{
[$purchase, $veg, $meat, $storeA, $storeB] = $this->buildPurchaseWithSuppliers();
// 无订货的上架商品也应出现在导出中
$extra = ProductModel::factory()->create(['status' => ProductModel::STATUS_ON, 'cost_price' => '7.00']);
$extra = ProductModel::factory()->create(['status' => ProductModel::STATUS_ON, 'cost_price' => '7.00', 'spec' => '10斤/箱']);
Excel::fake();
$this->actingAsSysUser();
@@ -170,10 +170,10 @@ class ExportTest extends ProcurementTestCase
|| (float) $vegRow[12] !== 2.0 || (float) $vegRow[13] !== 3.0) {
return false;
}
// 无订货商品行:数量 0、单价留空、门店列 0
// 无订货商品行:数量 0、单价按成本价÷包规显示(7÷10=0.70)、门店列 0
$extraRow = $rows->firstWhere(2, $extra->name);
if ($extraRow === null
|| (float) $extraRow[9] !== 0.0 || $extraRow[8] !== ''
|| (float) $extraRow[9] !== 0.0 || (float) $extraRow[8] !== 0.7
|| (float) $extraRow[12] !== 0.0) {
return false;
}