Browse Source

[Administration] Distributions : correctif mise à jour quantités max

feature/rotating_product
Guillaume Bourgeois 5 months ago
parent
commit
7b7d7451c6
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