Browse Source

Autorisation du passage du crédit en négatif lors des commandes des utilisateurs

dev
Guillaume Bourgeois 5 years ago
parent
commit
0e6eff148e
1 changed files with 0 additions and 4 deletions
  1. +0
    -4
      producer/controllers/OrderController.php

+ 0
- 4
producer/controllers/OrderController.php View File

$amountRemaining = $order->getAmount(Order::AMOUNT_REMAINING) ; $amountRemaining = $order->getAmount(Order::AMOUNT_REMAINING) ;
$credit = Yii::$app->user->identity->getCredit($distribution->id_producer); $credit = Yii::$app->user->identity->getCredit($distribution->id_producer);


if ($amountRemaining > $credit) {
$amountRemaining = $credit;
}

if ($amountRemaining > 0) { if ($amountRemaining > 0) {
$order->saveCreditHistory( $order->saveCreditHistory(
CreditHistory::TYPE_PAYMENT, CreditHistory::TYPE_PAYMENT,

Loading…
Cancel
Save