Browse Source

[Administration] Distributions : correctif génération abonnements

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
4758b48665
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      backend/controllers/SubscriptionController.php

+ 1
- 3
backend/controllers/SubscriptionController.php View File

{ {
$subscriptionModule = $this->getSubscriptionModule(); $subscriptionModule = $this->getSubscriptionModule();
$distributionModule = $this-> getDistributionModule(); $distributionModule = $this-> getDistributionModule();
$orderModule = $this->getOrderModule();

$subscription = $subscriptionModule->findOneSubscriptionById($idSubscription); $subscription = $subscriptionModule->findOneSubscriptionById($idSubscription);
$matchedDistributionsArray = $distributionModule->findDistributionsIncomingMatchWithSubscrtiption($subscription); $matchedDistributionsArray = $distributionModule->findDistributionsIncomingMatchWithSubscrtiption($subscription);


->deleteOrdersIncomingDistributionsFromSubscription($subscription); ->deleteOrdersIncomingDistributionsFromSubscription($subscription);
} }
foreach ($matchedDistributionsArray as $distribution) { foreach ($matchedDistributionsArray as $distribution) {
$orderModule->createOrderFromSubscription($subscription, $distribution->date);
$subscriptionModule->createOrderFromSubscription($subscription, $distribution->date);
} }
$this->setFlash('success', 'Commandes ' . ($update ? 're-' : '') . 'générées dans les distributions futures.'); $this->setFlash('success', 'Commandes ' . ($update ? 're-' : '') . 'générées dans les distributions futures.');
return $this->redirect(['subscription/index']); return $this->redirect(['subscription/index']);

Loading…
Cancel
Save