From: marina Date: Tue, 10 Dec 2024 11:14:20 +0000 (+0300) Subject: ERP-259 Доработка второго шага передачи смен X-Git-Tag: 1.7~180^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=1fe5a575488891e60b6b45a8f5d10aadfc7661f2;p=erp24_rep%2Fyii-erp24%2F.git ERP-259 Доработка второго шага передачи смен --- diff --git a/erp24/controllers/ShiftTransferController.php b/erp24/controllers/ShiftTransferController.php index ce8298a5..13825e81 100644 --- a/erp24/controllers/ShiftTransferController.php +++ b/erp24/controllers/ShiftTransferController.php @@ -255,7 +255,7 @@ class ShiftTransferController extends Controller $shiftTransfer = ShiftTransfer::findOne($shiftTransferId); $storeId = array_flip(array_map('strval', CityStore::getAllActiveGuidId()))[$shiftTransfer->store_guid]; $productSelfCost = SelfCostProduct::findOne(['product_guid' => $productGuid, 'date' => $shiftTransfer->date, 'store_id' => $storeId]); - $balance = Balances::findOne(['store_id' => $shiftTransfer->store_guid, 'product_id' => $productGuid]); + $count = ShiftRemains::findOne(['shift_transfer_id' => $shiftTransferId, 'product_guid' => $productGuid]); if (!$productPrice) { throw new \Exception('У данного товара нет цены либо замен!'); @@ -265,7 +265,7 @@ class ShiftTransferController extends Controller 'success' => true, 'product_price' => $productPrice->price, 'product_replacement_self_cost' => $productSelfCost->price, - 'maxQuantity' => $balance->quantity, + 'maxQuantity' => $count->fact_and_1c_diff, ]; } catch (\Throwable $exception) {