获取焦点
This commit is contained in:
@@ -750,19 +750,21 @@ class PurchaseEditTest extends ProcurementTestCase
|
||||
|
||||
// 未生成账单 → null
|
||||
$this->getJson('/purchase/order')
|
||||
->assertJsonPath('data.data.0.bill_product_amount', null);
|
||||
->assertJsonPath('data.data.0.bill_product_amount', null)
|
||||
->assertJsonPath('data.data.0.bill_total_amount', null);
|
||||
|
||||
// 完成采购单并生成两店账单(各店商品金额 = 数量 × 等级价 10.00)
|
||||
$purchase->update(['status' => PurchaseOrderModel::STATUS_COMPLETED]);
|
||||
$this->postJson("/purchase/order/{$purchase->id}/bill", [
|
||||
'stores' => [
|
||||
['store_id' => $stores[0]->id, 'delivery_fee' => 0, 'box_num' => 0, 'tray_num' => 0],
|
||||
['store_id' => $stores[1]->id, 'delivery_fee' => 0, 'box_num' => 0, 'tray_num' => 0],
|
||||
['store_id' => $stores[0]->id, 'delivery_fee' => 5, 'box_num' => 0, 'tray_num' => 0],
|
||||
['store_id' => $stores[1]->id, 'delivery_fee' => 3, 'box_num' => 0, 'tray_num' => 0],
|
||||
],
|
||||
])->assertJsonPath('success', true);
|
||||
|
||||
// 列表回显:2×10.00 + 3×10.00 = 50.00
|
||||
// 列表回显:商品金额 2×10.00 + 3×10.00 = 50.00;账单总金额 50.00 + 配送费 8.00 = 58.00
|
||||
$this->getJson('/purchase/order')
|
||||
->assertJsonPath('data.data.0.bill_product_amount', '50.00');
|
||||
->assertJsonPath('data.data.0.bill_product_amount', '50.00')
|
||||
->assertJsonPath('data.data.0.bill_total_amount', '58.00');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user