|
|
@@ -670,11 +670,17 @@ class DistributionController extends BackendController |
|
|
|
public function actionAjaxProcessProductQuantityMax($idDistribution, $idProduct, $quantityMax) |
|
|
|
{ |
|
|
|
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
|
|
|
$orderModule = $this->getOrderModule(); |
|
|
|
$productDistributionModule = $this->getProductDistributionModule(); |
|
|
|
$productDistribution = $this->getProductDistribution($idProduct, $idDistribution); |
|
|
|
$productDistributionModule->updateProductDistributionQuantityMax($productDistribution, (float) $quantityMax); |
|
|
|
return [ |
|
|
|
'quantity_remaining' => $this->getOrderModule()->getResolver() |
|
|
|
'quantity_max' => $orderModule->getResolver() |
|
|
|
->getProductQuantityMax( |
|
|
|
$productDistribution->product, |
|
|
|
$productDistribution->distribution |
|
|
|
), |
|
|
|
'quantity_remaining' => $orderModule->getResolver() |
|
|
|
->getProductQuantityRemaining( |
|
|
|
$productDistribution->product, |
|
|
|
$productDistribution->distribution |