Bladeren bron

Correctifs

feature/souke
Guillaume 1 jaar geleden
bovenliggende
commit
e0d95815e0
2 gewijzigde bestanden met toevoegingen van 18 en 15 verwijderingen
  1. +17
    -14
      common/logic/Order/Order/Repository/OrderRepository.php
  2. +1
    -1
      common/logic/User/User/Model/User.php

+ 17
- 14
common/logic/Order/Order/Repository/OrderRepository.php Bestand weergeven

@@ -308,20 +308,23 @@ class OrderRepository extends AbstractRepository
{
$pointSale = PointSale::findOne($order->id_point_sale);
$distribution = Distribution::findOne($order->id_distribution);
$creditFunctioning = $this->producerRepository->getPointSaleCreditFunctioning($pointSale);

if ($order->id_user && $this->producerRepository->getConfig('credit') && $pointSale->credit) {
if ($creditFunctioning == Producer::CREDIT_FUNCTIONING_OPTIONAL) {
return 0;
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY) {
return 1;
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER) {
$userProducer = UserProducer::searchOne([
'id_user' => $order->id_user,
'id_producer' => $distribution->id_producer
]);
if ($userProducer) {
return $userProducer->credit_active;

if($pointSale) {
$creditFunctioning = $this->producerRepository->getPointSaleCreditFunctioning($pointSale);

if ($order->id_user && $this->producerRepository->getConfig('credit') && $pointSale->credit) {
if ($creditFunctioning == Producer::CREDIT_FUNCTIONING_OPTIONAL) {
return 0;
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY) {
return 1;
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER) {
$userProducer = UserProducer::searchOne([
'id_user' => $order->id_user,
'id_producer' => $distribution->id_producer
]);
if ($userProducer) {
return $userProducer->credit_active;
}
}
}
}

+ 1
- 1
common/logic/User/User/Model/User.php Bestand weergeven

@@ -251,7 +251,7 @@ class User extends ActiveRecordCommon implements IdentityInterface
return $this->name;
}

public function getLastname(): string
public function getLastname(): ?string
{
return $this->lastname;
}

Laden…
Annuleren
Opslaan