|
|
@@ -194,13 +194,18 @@ class CreditHistory extends ActiveRecordCommon |
|
|
|
$userProducer->save(); |
|
|
|
|
|
|
|
// set mean payment |
|
|
|
$order = Order::searchOne(['id' => $this->id_order]) ; |
|
|
|
$paymentStatus = $order->getPaymentStatus() ; |
|
|
|
if($paymentStatus == Order::PAYMENT_PAID |
|
|
|
|| $paymentStatus == Order::PAYMENT_SURPLUS) { |
|
|
|
$order->mean_payment = MeanPayment::CREDIT ; |
|
|
|
$order->save() ; |
|
|
|
if($this->id_order && $this->id_order > 0) { |
|
|
|
$order = Order::searchOne(['id' => (int) $this->id_order]) ; |
|
|
|
if($order) { |
|
|
|
$paymentStatus = $order->getPaymentStatus() ; |
|
|
|
if($paymentStatus == Order::PAYMENT_PAID |
|
|
|
|| $paymentStatus == Order::PAYMENT_SURPLUS) { |
|
|
|
$order->mean_payment = MeanPayment::CREDIT ; |
|
|
|
$order->save() ; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// seuil limite de crédit |
|
|
|
$newCredit = $userProducer->credit ; |