|
|
@@ -40,14 +40,13 @@ class ConsoleController extends BaseController
|
|
|
$totalCost = 0;
|
|
|
if (!empty($itemList)) {
|
|
|
foreach ($itemList as $item) {
|
|
|
- if ($item->virtualStock != 0 && $item->delStatus != 0) {
|
|
|
- continue;
|
|
|
+ if ($item->virtualStock == 0 && $item->delStatus == 0) {
|
|
|
+ $stock = $item->stock ?? 0;
|
|
|
+ $cost = $item->cost ?? 0;
|
|
|
+ $totalItemNum = bcadd($stock, $totalItemNum, 2);
|
|
|
+ $currentCost = bcmul($stock, $cost, 2);
|
|
|
+ $totalCost = bcadd($currentCost, $totalCost, 2);
|
|
|
}
|
|
|
- $stock = $item->stock ?? 0;
|
|
|
- $cost = $item->cost ?? 0;
|
|
|
- $totalItemNum = bcadd($stock, $totalItemNum, 2);
|
|
|
- $currentCost = bcmul($stock, $cost, 2);
|
|
|
- $totalCost = bcadd($currentCost, $totalCost, 2);
|
|
|
}
|
|
|
}
|
|
|
$totalItemNum = floor($totalItemNum);
|