Browse Source

Merge branch 'develop'

master
Guillaume Bourgeois 4 months ago
parent
commit
345e120f8d
2 changed files with 8 additions and 1 deletions
  1. +7
    -1
      backend/controllers/DistributionController.php
  2. +1
    -0
      backend/web/js/vuejs/distribution-index.js

+ 7
- 1
backend/controllers/DistributionController.php View File

@@ -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

+ 1
- 0
backend/web/js/vuejs/distribution-index.js View File

@@ -360,6 +360,7 @@ if($(selector).length) {
}
})
.then(function (response) {
Vue.set(app.products[app.getProductIndex(idProduct)], 'quantity_max', response.data.quantity_max);
Vue.set(app.products[app.getProductIndex(idProduct)], 'quantity_remaining', response.data.quantity_remaining);
});
},

Loading…
Cancel
Save