|
@@ -30,14 +30,14 @@ class ConsoleController extends BaseController
|
|
|
$lsDebt = $lsDebt === null ? 0 : $lsDebt;
|
|
$lsDebt = $lsDebt === null ? 0 : $lsDebt;
|
|
|
$totalDebt = bcadd($pfDebt, $lsDebt, 2);
|
|
$totalDebt = bcadd($pfDebt, $lsDebt, 2);
|
|
|
|
|
|
|
|
- $itemList = ItemClass::getAllByCondition(['mainId' => $this->mainId], null, 'id,stock,cost,virtualStock,delStatus', null, true);
|
|
|
|
|
|
|
+ $itemList = ItemClass::getAllByCondition(['mainId' => $this->mainId], null, 'id,stock,avCost,cost,virtualStock,delStatus', null, true);
|
|
|
$totalItemNum = 0;
|
|
$totalItemNum = 0;
|
|
|
$totalCost = 0;
|
|
$totalCost = 0;
|
|
|
if (!empty($itemList)) {
|
|
if (!empty($itemList)) {
|
|
|
foreach ($itemList as $item) {
|
|
foreach ($itemList as $item) {
|
|
|
if ($item->virtualStock == 0 && $item->delStatus == 0) {
|
|
if ($item->virtualStock == 0 && $item->delStatus == 0) {
|
|
|
$stock = $item->stock ?? 0;
|
|
$stock = $item->stock ?? 0;
|
|
|
- $cost = $item->cost ?? 0;
|
|
|
|
|
|
|
+ $cost = $item->avCost ?? 0;
|
|
|
$totalItemNum = bcadd($stock, $totalItemNum, 2);
|
|
$totalItemNum = bcadd($stock, $totalItemNum, 2);
|
|
|
$currentCost = bcmul($stock, $cost, 2);
|
|
$currentCost = bcmul($stock, $cost, 2);
|
|
|
$totalCost = bcadd($currentCost, $totalCost, 2);
|
|
$totalCost = bcadd($currentCost, $totalCost, 2);
|