账单价格
This commit is contained in:
@@ -22,6 +22,7 @@ class BillDetailService
|
||||
{
|
||||
$items = StoreOrderItemModel::query()
|
||||
->where('bill_id', $bill->id)
|
||||
->where('quantity', '>', 0)
|
||||
->orderBy('id')
|
||||
->get();
|
||||
|
||||
@@ -39,6 +40,7 @@ class BillDetailService
|
||||
{
|
||||
$items = StoreOrderItemModel::query()
|
||||
->whereIn('bill_id', $billIds)
|
||||
->where('quantity', '>', 0)
|
||||
->orderBy('id')
|
||||
->get();
|
||||
|
||||
@@ -73,15 +75,14 @@ class BillDetailService
|
||||
$weight = bcadd($weight, (string) $item->weight, 3);
|
||||
$amount = bcadd($amount, (string) $item->amount, 2);
|
||||
}
|
||||
$price = bcdiv($amount, (string) $quantity, 2);
|
||||
|
||||
$rows[] = [
|
||||
'product_id' => (int) $productId,
|
||||
'product_name' => $first->product_name,
|
||||
'product_spec' => $first->product_spec,
|
||||
'unit' => $first->unit,
|
||||
'price' => $quantity > 0
|
||||
? bcdiv($amount, (string) $quantity, 2)
|
||||
: (string) $first->price,
|
||||
'price' => $price,
|
||||
'quantity' => $quantity,
|
||||
'weight' => $weight,
|
||||
'amount' => $amount,
|
||||
|
||||
Reference in New Issue
Block a user