namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\GlobalParam; | |||||
use backend\models\AccessUserProducerForm; | use backend\models\AccessUserProducerForm; | ||||
use common\logic\Document\DeliveryNote\DeliveryNoteManager; | |||||
use common\logic\Producer\Producer\ProducerManager; | |||||
use common\logic\User\User\User; | |||||
use common\logic\User\User\UserSearch; | |||||
use common\logic\User\User\Model\UserSearch; | |||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\filters\VerbFilter; | use yii\filters\VerbFilter; | ||||
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Product\Product\Product; | |||||
use common\controllers\CommonController; | use common\controllers\CommonController; | ||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Product\Product\Model\Product; | |||||
class BackendController extends CommonController | class BackendController extends CommonController | ||||
{ | { |
namespace backend\controllers; | namespace backend\controllers; | ||||
use backend\models\MailForm; | use backend\models\MailForm; | ||||
use common\logic\User\User\User; | |||||
use common\logic\User\User\Model\User; | |||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\filters\VerbFilter; | use yii\filters\VerbFilter; | ||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\logic\Order\Order\Order; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\User\CreditHistory\CreditHistory; | |||||
use common\logic\User\User\User; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\User\CreditHistory\Model\CreditHistory; | |||||
use common\logic\User\User\Model\User; | |||||
use Yii; | use Yii; | ||||
use yii\filters\VerbFilter; | use yii\filters\VerbFilter; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
public function actionInitDemo($key = '') | public function actionInitDemo($key = '') | ||||
{ | { | ||||
if ($key == '45432df6e842ac71aa0b5bb6b9f25d44') { | if ($key == '45432df6e842ac71aa0b5bb6b9f25d44') { | ||||
$producerManager = $this->getProducerManager(); | $producerManager = $this->getProducerManager(); | ||||
$distributionManager = $this->getDistributionManager(); | |||||
$producer = $producerManager->findOneProducerDemoAccount(); | $producer = $producerManager->findOneProducerDemoAccount(); | ||||
$producerManager->setProducerContext($producer); | |||||
$distributionManager->setProducerContext($producer); | |||||
if ($producer) { | if ($producer) { | ||||
// initialisation de la distribution à J+7 | // initialisation de la distribution à J+7 | ||||
} | } | ||||
if ($activeDistribution) { | if ($activeDistribution) { | ||||
$distributionManager = $this->getDistributionManager(); | |||||
$distribution = $distributionManager->createDistributionIfNotExist($producer, date('Y-m-d', $dateTime)); | |||||
$distribution = $distributionManager->createDistributionIfNotExist(date('Y-m-d', $dateTime)); | |||||
$distributionManager->activeDistribution($distribution); | $distributionManager->activeDistribution($distribution); | ||||
} | } | ||||
} | } |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\logic\Document\DeliveryNote\DeliveryNoteSearch; | |||||
use common\logic\Document\DeliveryNote\Model\DeliveryNoteSearch; | |||||
use Yii; | use Yii; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\filters\VerbFilter; | use yii\filters\VerbFilter; | ||||
class DeliveryNoteController extends DocumentController | class DeliveryNoteController extends DocumentController | ||||
{ | { | ||||
public function behaviors() | public function behaviors() | ||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, | ||||
]); | ]); | ||||
} | } | ||||
} | } |
use common\helpers\Password; | use common\helpers\Password; | ||||
use common\helpers\Price; | use common\helpers\Price; | ||||
use common\helpers\Tiller; | use common\helpers\Tiller; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistribution; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistribution; | |||||
use common\logic\Document\DeliveryNote\DeliveryNote; | |||||
use common\logic\Document\Document\Document; | |||||
use common\logic\Order\Order\Order; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\User\User\User; | |||||
use common\logic\User\UserProducer\UserProducer; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||||
use common\logic\Document\Document\Model\Document; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\User\UserProducer\Model\UserProducer; | |||||
use DateTime; | use DateTime; | ||||
use kartik\mpdf\Pdf; | use kartik\mpdf\Pdf; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\web\User; | |||||
class DistributionController extends BackendController | class DistributionController extends BackendController | ||||
{ | { | ||||
public function behaviors() | public function behaviors() | ||||
{ | { | ||||
return [ | return [ | ||||
$json['distributions'] = $distributionsArray; | $json['distributions'] = $distributionsArray; | ||||
if ($dateObject && $dateObject->format($format) === $date) { | if ($dateObject && $dateObject->format($format) === $date) { | ||||
$distribution = $distributionManager->createDistributionIfNotExist($producer, $date); | |||||
$distribution = $distributionManager->createDistributionIfNotExist($date); | |||||
$json['distribution'] = [ | $json['distribution'] = [ | ||||
'id' => $distribution->id, | 'id' => $distribution->id, | ||||
'active' => $distribution->active, | 'active' => $distribution->active, | ||||
$format = 'Y-m-d'; | $format = 'Y-m-d'; | ||||
$dateObject = DateTime::createFromFormat($format, $date); | $dateObject = DateTime::createFromFormat($format, $date); | ||||
if ($dateObject && $dateObject->format($format) === $date) { | if ($dateObject && $dateObject->format($format) === $date) { | ||||
$distribution = $distributionManager->createDistributionIfNotExist($producerCurrent, $date); | |||||
$distribution = $distributionManager->createDistributionIfNotExist($date); | |||||
} | } | ||||
if ($distribution) { | if ($distribution) { | ||||
$user = $userManager->findOneUserById($deliveryNote->id_user); | $user = $userManager->findOneUserById($deliveryNote->id_user); | ||||
$userProducer = $userProducerManager->findOneUserProducer($user, $producerCurrent); | $userProducer = $userProducerManager->findOneUserProducer($user, $producerCurrent); | ||||
} else { | } else { | ||||
$user = new User; | |||||
$user = new User(); | |||||
$user->type = User::TYPE_LEGAL_PERSON; | $user->type = User::TYPE_LEGAL_PERSON; | ||||
$user->name_legal_person = $firstOrder->pointSale->name; | $user->name_legal_person = $firstOrder->pointSale->name; | ||||
$user->address = $firstOrder->pointSale->address; | $user->address = $firstOrder->pointSale->address; |
use common\helpers\CSV; | use common\helpers\CSV; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Document\DeliveryNote\DeliveryNote; | |||||
use common\logic\Document\Document\Document; | |||||
use common\logic\Document\Invoice\Invoice; | |||||
use common\logic\Document\Quotation\Quotation; | |||||
use common\logic\Order\Order\Order; | |||||
use common\logic\Order\ProductOrder\ProductOrder; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||||
use common\logic\Document\Document\Model\Document; | |||||
use common\logic\Document\Invoice\Model\Invoice; | |||||
use common\logic\Document\Quotation\Model\Quotation; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Order\ProductOrder\Model\ProductOrder; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use kartik\mpdf\Pdf; | use kartik\mpdf\Pdf; | ||||
use yii\base\UserException; | use yii\base\UserException; | ||||
use yii; | use yii; | ||||
use yii\filters\VerbFilter; | use yii\filters\VerbFilter; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\web\NotFoundHttpException; | |||||
use yii\helpers\Html; | |||||
class DocumentController extends BackendController | class DocumentController extends BackendController | ||||
{ | { | ||||
throw new NotFoundHttpException('The requested page does not exist.'); | throw new NotFoundHttpException('The requested page does not exist.'); | ||||
} | } | ||||
} | } | ||||
} | } |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\logic\Document\Invoice\InvoiceSearch; | |||||
use common\logic\Order\Order\Order; | |||||
use Yii; | |||||
use common\logic\Document\Invoice\Model\InvoiceSearch; | |||||
use common\logic\Order\Order\Model\Order; | |||||
class InvoiceController extends DocumentController | class InvoiceController extends DocumentController | ||||
{ | { |
use common\forms\SubscriptionForm; | use common\forms\SubscriptionForm; | ||||
use common\helpers\CSV; | use common\helpers\CSV; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistribution; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistribution; | |||||
use common\logic\Order\Order\Order; | |||||
use common\logic\Order\ProductOrder\ProductOrder; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\User\CreditHistory\CreditHistory; | |||||
use common\logic\User\User\User; | |||||
use common\logic\User\UserProducer\UserProducer; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; | |||||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Order\ProductOrder\Model\ProductOrder; | |||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\User\CreditHistory\Model\CreditHistory; | |||||
use common\logic\User\User\Model\User; | |||||
use common\logic\User\UserProducer\Model\UserProducer; | |||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$date = \Yii::$app->getRequest()->post('date_order_point_sale_' . $point->id, 0); | $date = \Yii::$app->getRequest()->post('date_order_point_sale_' . $point->id, 0); | ||||
$oneProduct = false; | $oneProduct = false; | ||||
foreach ($products as $product) { | foreach ($products as $product) { | ||||
$quantity = Yii::$app->getRequest()->post('product_point_sale_' . $point->id . '_' . $product->id, 0); | |||||
$quantity = \Yii::$app->getRequest()->post('product_point_sale_' . $point->id . '_' . $product->id, 0); | |||||
if ($quantity) { | if ($quantity) { | ||||
$oneProduct = true; | $oneProduct = true; | ||||
} | } | ||||
foreach ($products as $product) { | foreach ($products as $product) { | ||||
$quantity = \Yii::$app->getRequest()->post('product_point_sale_' . $point->id . '_' . $product->id, 0); | $quantity = \Yii::$app->getRequest()->post('product_point_sale_' . $point->id . '_' . $product->id, 0); | ||||
if ($quantity) { | if ($quantity) { | ||||
$productOrder = new ProductOrder; | |||||
$productOrder = new ProductOrder(); | |||||
$productOrder->id_order = $order->id; | $productOrder->id_order = $order->id; | ||||
$productOrder->id_product = $product->id; | $productOrder->id_product = $product->id; | ||||
$productOrder->quantity = $quantity; | $productOrder->quantity = $quantity; | ||||
$arrayUsers[$user->id] = $user->name . ' ' . $user->lastname; | $arrayUsers[$user->id] = $user->name . ' ' . $user->lastname; | ||||
} | } | ||||
$distribution = $distributionManager->createDistributionIfNotExist($this->getProducerCurrent(), $date); | |||||
$distribution = $distributionManager->createDistributionIfNotExist($date); | |||||
if ($distribution) { | if ($distribution) { | ||||
$arrayPointsSale = PointSale::find() | $arrayPointsSale = PointSale::find() | ||||
public function actionChangeState(string $date, bool $active, bool $redirect = true) | public function actionChangeState(string $date, bool $active, bool $redirect = true) | ||||
{ | { | ||||
$distributionManager = $this->getDistributionManager(); | $distributionManager = $this->getDistributionManager(); | ||||
$distribution = $distributionManager->createDistributionIfNotExist($this->getProducerCurrent(), $date); | |||||
$distribution = $distributionManager->createDistributionIfNotExist($date); | |||||
$distributionManager->activeDistribution($distribution, $active); | $distributionManager->activeDistribution($distribution, $active); | ||||
if ($redirect) { | if ($redirect) { |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistribution; | |||||
use common\logic\Order\Order\Order; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\PointSale\PointSale\PointSaleSearch; | |||||
use common\logic\PointSale\UserPointSale\UserPointSale; | |||||
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\PointSale\PointSale\Model\PointSaleSearch; | |||||
use common\logic\PointSale\UserPointSale\Model\UserPointSale; | |||||
use Yii; | use Yii; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\logic\Order\Order\Order; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use Yii; | use Yii; | ||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; | ||||
use yii\filters\VerbFilter; | use yii\filters\VerbFilter; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Producer\ProducerPriceRange\ProducerPriceRange; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Producer\ProducerPriceRange\Model\ProducerPriceRange; | |||||
use Yii; | use Yii; | ||||
use yii\data\ActiveDataProvider; | use yii\data\ActiveDataProvider; | ||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\logic\Producer\ProducerPriceRange\ProducerPriceRange; | |||||
use common\logic\Producer\ProducerPriceRange\Model\ProducerPriceRange; | |||||
use Yii; | use Yii; | ||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; | ||||
use yii\filters\VerbFilter; | use yii\filters\VerbFilter; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Product\ProductCategory\ProductCategorySearch; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\Product\ProductCategory\Model\ProductCategorySearch; | |||||
use Yii; | use Yii; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Distribution\ProductDistribution\ProductDistribution; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Product\Product\ProductSearch; | |||||
use common\logic\Product\ProductPointSale\ProductPointSale; | |||||
use common\logic\Product\ProductPrice\ProductPrice; | |||||
use common\logic\Product\ProductPrice\ProductPriceSearch; | |||||
use common\logic\User\UserProducer\UserProducer; | |||||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\Product\Product\Model\ProductSearch; | |||||
use common\logic\Product\ProductPointSale\Model\ProductPointSale; | |||||
use common\logic\Product\ProductPrice\Model\ProductPrice; | |||||
use common\logic\Product\ProductPrice\Model\ProductPriceSearch; | |||||
use common\logic\User\UserProducer\Model\UserProducer; | |||||
use Yii; | use Yii; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\helpers\Html; | use yii\helpers\Html; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Document\Quotation\QuotationSearch; | |||||
use common\logic\Order\Order\Order; | |||||
use common\logic\Document\Quotation\Model\QuotationSearch; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use Yii; | use Yii; | ||||
use yii\base\UserException; | use yii\base\UserException; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; |
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\helpers\Price; | use common\helpers\Price; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use Yii; | use Yii; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Order\Order\Order; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\User\User\User; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\User\User\Model\User; | |||||
use Yii; | use Yii; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use common\forms\LoginForm; | use common\forms\LoginForm; |
class StatsController extends BackendController | class StatsController extends BackendController | ||||
{ | { | ||||
public function behaviors() | public function behaviors() | ||||
{ | { | ||||
return [ | return [ |
use common\forms\SubscriptionForm; | use common\forms\SubscriptionForm; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Subscription\Subscription\SubscriptionSearch; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\Subscription\Subscription\Model\SubscriptionSearch; | |||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; | ||||
use common\helpers\Mailjet; | use common\helpers\Mailjet; | ||||
use backend\models\MailForm; | use backend\models\MailForm; | ||||
use common\helpers\Password; | use common\helpers\Password; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Order\Order\OrderSearch; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\PointSale\UserPointSale\UserPointSale; | |||||
use common\logic\User\CreditHistory\CreditHistory; | |||||
use common\logic\User\User\UserSearch; | |||||
use common\logic\User\UserProducer\UserProducer; | |||||
use common\logic\User\UserUserGroup\UserUserGroup; | |||||
use common\logic\Order\Order\Model\OrderSearch; | |||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\PointSale\UserPointSale\Model\UserPointSale; | |||||
use common\logic\User\CreditHistory\Model\CreditHistory; | |||||
use common\logic\User\User\Model\UserSearch; | |||||
use common\logic\User\UserProducer\Model\UserProducer; | |||||
use common\logic\User\UserUserGroup\Model\UserUserGroup; | |||||
use yii\base\UserException; | use yii\base\UserException; | ||||
use yii\debug\models\search\User; | use yii\debug\models\search\User; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\User\UserGroup\UserGroupSearch; | |||||
use common\logic\User\UserUserGroup\UserUserGroup; | |||||
use common\logic\User\UserGroup\Model\UserGroupSearch; | |||||
use common\logic\User\UserUserGroup\Model\UserUserGroup; | |||||
use Yii; | use Yii; | ||||
use yii\filters\AccessControl; | use yii\filters\AccessControl; | ||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\User\User\User; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\User\User\Model\User; | |||||
$userManager = $this->getUserManager(); | $userManager = $this->getUserManager(); | ||||
$producerManager = $this->getProducerManager(); | $producerManager = $this->getProducerManager(); |
public static function searchBy($params = [], $options = []) | public static function searchBy($params = [], $options = []) | ||||
{ | { | ||||
$class = get_called_class(); | $class = get_called_class(); | ||||
$repositoryClass = $class.'Repository'; | |||||
$repositoryClass = str_replace('\\Model\\', '\\Repository\\', $class).'Repository'; | |||||
$repository = $repositoryClass::getInstance(); | |||||
if (is_callable([$repositoryClass, 'getDefaultOptionsSearch'])) { | |||||
$repository = $repositoryClass::getInstance(); | |||||
if(method_exists($repository , 'getDefaultOptionsSearch')) { | |||||
$default_options = $repository->getDefaultOptionsSearch(); | $default_options = $repository->getDefaultOptionsSearch(); | ||||
} else { | } else { | ||||
throw new \ErrorException('La méthode "getDefaultOptionsSearch" n\'est ' | throw new \ErrorException('La méthode "getDefaultOptionsSearch" n\'est ' | ||||
. 'pas définie dans la classe "' . $class . '"'); | |||||
. 'pas définie dans la classe "' . $repositoryClass . '"'); | |||||
} | } | ||||
$options = array_merge($default_options, $options); | $options = array_merge($default_options, $options); | ||||
$pk = $class::tableName() . '.' . $pk[0]; | $pk = $class::tableName() . '.' . $pk[0]; | ||||
if (isset($options['attribute_id_producer']) && strlen($options['attribute_id_producer']) | if (isset($options['attribute_id_producer']) && strlen($options['attribute_id_producer']) | ||||
&& !isset($params[$options['attribute_id_producer']]) && !\Yii::$app->user->isGuest) { | |||||
&& !isset($params[$options['attribute_id_producer']]) && !\Yii::$app->user->isGuest | |||||
) { | |||||
$params[$options['attribute_id_producer']] = GlobalParam::getCurrentProducerId(); | $params[$options['attribute_id_producer']] = GlobalParam::getCurrentProducerId(); | ||||
} | } | ||||
namespace common\components; | namespace common\components; | ||||
use common\logic\Config\TaxRate\TaxRateContainer; | |||||
use common\logic\Distribution\Distribution\DistributionContainer; | |||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistributionContainer; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistributionContainer; | |||||
use common\logic\Document\Document\DocumentContainer; | |||||
use common\logic\Order\Order\OrderContainer; | |||||
use common\logic\Order\Order\OrderManager; | |||||
use common\logic\Order\OrderStatusHistory\OrderStatusHistoryContainer; | |||||
use common\logic\Order\ProductOrder\ProductOrderContainer; | |||||
use common\logic\PointSale\PointSale\PointSaleContainer; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Producer\Producer\ProducerContainer; | |||||
use common\logic\Producer\ProducerPriceRange\ProducerPriceRangeContainer; | |||||
use common\logic\Product\Product\ProductContainer; | |||||
use common\logic\Product\ProductCategory\ProductCategoryContainer; | |||||
use common\logic\Product\ProductPointSale\ProductPointSaleContainer; | |||||
use common\logic\Product\ProductPrice\ProductPriceContainer; | |||||
use common\logic\Subscription\ProductSubscription\ProductSubscriptionContainer; | |||||
use common\logic\Subscription\Subscription\SubscriptionContainer; | |||||
use common\logic\User\CreditHistory\CreditHistoryContainer; | |||||
use common\logic\User\User\UserContainer; | |||||
use common\logic\User\UserGroup\UserGroupContainer; | |||||
use common\logic\User\UserProducer\UserProducerContainer; | |||||
use common\logic\User\UserUserGroup\UserUserGroupContainer; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use yii\base\ErrorException; | use yii\base\ErrorException; | ||||
class BusinessLogic | class BusinessLogic |
use common\logic\Config\TaxRate\TaxRateContainer; | use common\logic\Config\TaxRate\TaxRateContainer; | ||||
use common\logic\Config\TaxRate\TaxRateManager; | use common\logic\Config\TaxRate\TaxRateManager; | ||||
use common\logic\Distribution\Distribution\DistributionContainer; | |||||
use common\logic\Distribution\Distribution\DistributionManager; | use common\logic\Distribution\Distribution\DistributionManager; | ||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistributionContainer; | |||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistributionManager; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistributionContainer; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistributionManager; | |||||
use common\logic\Document\DeliveryNote\DeliveryNoteManager; | |||||
use common\logic\Document\Document\DocumentContainer; | |||||
use common\logic\Document\Document\DocumentManager; | |||||
use common\logic\Document\Invoice\InvoiceManager; | |||||
use common\logic\Document\Invoice\QuotationManager; | |||||
use common\logic\Order\Order\OrderContainer; | |||||
use common\logic\Order\Order\OrderManager; | |||||
use common\logic\Order\OrderStatusHistory\OrderStatusHistoryContainer; | |||||
use common\logic\Order\OrderStatusHistory\OrderStatusHistoryManager; | |||||
use common\logic\Order\ProductOrder\ProductOrderContainer; | |||||
use common\logic\Order\ProductOrder\ProductOrderManager; | |||||
use common\logic\PointSale\PointSale\PointSaleContainer; | |||||
use common\logic\PointSale\PointSale\PointSaleManager; | |||||
use common\logic\PointSale\UserPointSale\UserPointSaleContainer; | |||||
use common\logic\PointSale\UserPointSale\UserPointSaleManager; | |||||
use common\logic\Producer\Producer\ProducerContainer; | |||||
use common\logic\Producer\Producer\ProducerManager; | |||||
use common\logic\Producer\ProducerPriceRange\ProducerPriceRangeContainer; | |||||
use common\logic\Producer\ProducerPriceRange\ProducerPriceRangeManager; | |||||
use common\logic\Product\Product\ProductContainer; | |||||
use common\logic\Product\Product\ProductManager; | |||||
use common\logic\Product\ProductCategory\ProductCategoryContainer; | |||||
use common\logic\Product\ProductCategory\ProductCategoryManager; | |||||
use common\logic\Product\ProductPointSale\ProductPointSaleContainer; | |||||
use common\logic\Product\ProductPointSale\ProductPointSaleManager; | |||||
use common\logic\Product\ProductPrice\ProductPriceContainer; | |||||
use common\logic\Product\ProductPrice\ProductPriceManager; | |||||
use common\logic\Subscription\ProductSubscription\ProductSubscriptionContainer; | |||||
use common\logic\Subscription\ProductSubscription\ProductSubscriptionManager; | |||||
use common\logic\Subscription\Subscription\SubscriptionContainer; | |||||
use common\logic\Subscription\Subscription\SubscriptionManager; | |||||
use common\logic\User\CreditHistory\CreditHistoryContainer; | |||||
use common\logic\User\CreditHistory\CreditHistoryManager; | |||||
use common\logic\User\User\UserContainer; | |||||
use common\logic\User\User\UserManager; | |||||
use common\logic\User\UserGroup\UserGroupContainer; | |||||
use common\logic\User\UserGroup\UserGroupManager; | |||||
use common\logic\User\UserProducer\UserProducerContainer; | |||||
use common\logic\User\UserProducer\UserProducerManager; | |||||
use common\logic\User\UserUserGroup\UserUserGroupContainer; | |||||
use common\logic\User\UserUserGroup\UserUserGroupManager; | |||||
use common\logic\Distribution\Distribution\Wrapper\DistributionContainer; | |||||
use common\logic\Distribution\PointSaleDistribution\Wrapper\PointSaleDistributionContainer; | |||||
use common\logic\Distribution\PointSaleDistribution\Wrapper\PointSaleDistributionManager; | |||||
use common\logic\Distribution\ProductDistribution\Wrapper\ProductDistributionContainer; | |||||
use common\logic\Distribution\ProductDistribution\Wrapper\ProductDistributionManager; | |||||
use common\logic\Document\DeliveryNote\Wrapper\DeliveryNoteManager; | |||||
use common\logic\Document\Document\Wrapper\DocumentContainer; | |||||
use common\logic\Document\Document\Wrapper\DocumentManager; | |||||
use common\logic\Document\Invoice\Wrapper\InvoiceManager; | |||||
use common\logic\Document\Invoice\Wrapper\QuotationManager; | |||||
use common\logic\Order\Order\Wrapper\OrderContainer; | |||||
use common\logic\Order\Order\Wrapper\OrderManager; | |||||
use common\logic\Order\OrderStatusHistory\Wrapper\OrderStatusHistoryContainer; | |||||
use common\logic\Order\OrderStatusHistory\Wrapper\OrderStatusHistoryManager; | |||||
use common\logic\Order\ProductOrder\Wrapper\ProductOrderContainer; | |||||
use common\logic\Order\ProductOrder\Wrapper\ProductOrderManager; | |||||
use common\logic\PointSale\PointSale\Wrapper\PointSaleContainer; | |||||
use common\logic\PointSale\PointSale\Wrapper\PointSaleManager; | |||||
use common\logic\PointSale\UserPointSale\Wrapper\UserPointSaleContainer; | |||||
use common\logic\PointSale\UserPointSale\Wrapper\UserPointSaleManager; | |||||
use common\logic\Producer\Producer\Wrapper\ProducerContainer; | |||||
use common\logic\Producer\Producer\Wrapper\ProducerManager; | |||||
use common\logic\Producer\ProducerPriceRange\Wrapper\ProducerPriceRangeContainer; | |||||
use common\logic\Producer\ProducerPriceRange\Wrapper\ProducerPriceRangeManager; | |||||
use common\logic\Product\Product\Wrapper\ProductContainer; | |||||
use common\logic\Product\Product\Wrapper\ProductManager; | |||||
use common\logic\Product\ProductCategory\Wrapper\ProductCategoryContainer; | |||||
use common\logic\Product\ProductCategory\Wrapper\ProductCategoryManager; | |||||
use common\logic\Product\ProductPointSale\Wrapper\ProductPointSaleContainer; | |||||
use common\logic\Product\ProductPointSale\Wrapper\ProductPointSaleManager; | |||||
use common\logic\Product\ProductPrice\Wrapper\ProductPriceContainer; | |||||
use common\logic\Product\ProductPrice\Wrapper\ProductPriceManager; | |||||
use common\logic\Subscription\ProductSubscription\Wrapper\ProductSubscriptionContainer; | |||||
use common\logic\Subscription\ProductSubscription\Wrapper\ProductSubscriptionManager; | |||||
use common\logic\Subscription\Subscription\Wrapper\SubscriptionContainer; | |||||
use common\logic\Subscription\Subscription\Wrapper\SubscriptionManager; | |||||
use common\logic\User\CreditHistory\Wrapper\CreditHistoryContainer; | |||||
use common\logic\User\CreditHistory\Wrapper\CreditHistoryManager; | |||||
use common\logic\User\User\Wrapper\UserContainer; | |||||
use common\logic\User\User\Wrapper\UserManager; | |||||
use common\logic\User\UserGroup\Wrapper\UserGroupContainer; | |||||
use common\logic\User\UserGroup\Wrapper\UserGroupManager; | |||||
use common\logic\User\UserProducer\Wrapper\UserProducerContainer; | |||||
use common\logic\User\UserProducer\Wrapper\UserProducerManager; | |||||
use common\logic\User\UserUserGroup\Wrapper\UserUserGroupContainer; | |||||
use common\logic\User\UserUserGroup\Wrapper\UserUserGroupManager; | |||||
trait BusinessLogicTrait | trait BusinessLogicTrait | ||||
{ | { |
], | ], | ||||
'user' => [ | 'user' => [ | ||||
'class' => 'yii\web\User', | 'class' => 'yii\web\User', | ||||
'identityClass' => 'common\logic\User\User\User', | |||||
'identityClass' => 'common\logic\User\User\Model\User', | |||||
'enableAutoLogin' => true, | 'enableAutoLogin' => true, | ||||
'identityCookie' => [ | 'identityCookie' => [ | ||||
'name' => 'distrib', | 'name' => 'distrib', |
use common\components\BusinessLogic; | use common\components\BusinessLogic; | ||||
use common\components\BusinessLogicTrait; | use common\components\BusinessLogicTrait; | ||||
use common\logic\User\User\User; | |||||
use common\logic\User\User\Model\User; | |||||
use yii; | use yii; | ||||
class CommonController extends \yii\web\Controller | class CommonController extends \yii\web\Controller |
namespace common\forms; | namespace common\forms; | ||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\User\User\User; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\User\User\Model\User; | |||||
use Yii; | use Yii; | ||||
use yii\base\Model; | use yii\base\Model; | ||||
namespace common\helpers; | namespace common\helpers; | ||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\User\User\UserSolver; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\User\User\Service\UserSolver; | |||||
class GlobalParam | class GlobalParam | ||||
{ | { |
namespace common\helpers; | namespace common\helpers; | ||||
use common\logic\Order\Order\Order; | |||||
use common\logic\Producer\Producer\Producer; | use common\logic\Producer\Producer\Producer; | ||||
use common\logic\Producer\Producer\ProducerManager; | |||||
use linslin\yii2\curl; | use linslin\yii2\curl; | ||||
class Tiller | class Tiller | ||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$producerManager = ProducerManager::getInstance(); | |||||
$this->curl = new curl\Curl(); | $this->curl = new curl\Curl(); | ||||
$this->producer_tiller = Producer::getConfig('tiller'); | |||||
$this->provider_token = Producer::getConfig('tiller_provider_token'); | |||||
$this->restaurant_token = Producer::getConfig('tiller_restaurant_token'); | |||||
$this->producer_tiller = $producerManager->getConfig('tiller'); | |||||
$this->provider_token = $producerManager->getConfig('tiller_provider_token'); | |||||
$this->restaurant_token = $producerManager->getConfig('tiller_restaurant_token'); | |||||
} | } | ||||
public function getOrders($date) | public function getOrders($date) |
<?php | |||||
namespace common\logic\Distribution\Distribution\Event; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use yii\base\Event; | |||||
class DistributionActiveEvent extends Event | |||||
{ | |||||
public Distribution $distribution; | |||||
} |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Distribution\Distribution; | |||||
namespace common\logic\Distribution\Distribution\Model; | |||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistribution; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistribution; | |||||
use common\logic\Order\Order\Order; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\components\ActiveRecordCommon; | use common\components\ActiveRecordCommon; | ||||
use common\logic\Subscription\Subscription\SubscriptionEventSubscriber; | |||||
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; | |||||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Subscription\Subscription\Event\SubscriptionEventSubscriber; | |||||
class Distribution extends ActiveRecordCommon | class Distribution extends ActiveRecordCommon | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Distribution\Distribution; | |||||
namespace common\logic\Distribution\Distribution\Repository; | |||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\AbstractRepository; | use common\logic\AbstractRepository; | ||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Subscription\Subscription\Subscription; | |||||
use common\logic\Subscription\Subscription\SubscriptionSolver; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\Distribution\Service\DistributionSolver; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Subscription\Subscription\Model\Subscription; | |||||
use common\logic\Subscription\Subscription\Service\SubscriptionSolver; | |||||
class DistributionRepository extends AbstractRepository | class DistributionRepository extends AbstractRepository | ||||
{ | { | ||||
$incomingDistributions->params($params); | $incomingDistributions->params($params); | ||||
$incomingDistributionsArray = $incomingDistributions->all(); | $incomingDistributionsArray = $incomingDistributions->all(); | ||||
$this->subscriptionSolver->filterDistributionsByDateDelay($incomingDistributionsArray); | |||||
$this->distributionSolver->filterDistributionsByDateDelay($incomingDistributionsArray); | |||||
$matchedIncomingDistributionsArray = []; | $matchedIncomingDistributionsArray = []; | ||||
foreach ($incomingDistributionsArray as $incomingDistribution) { | foreach ($incomingDistributionsArray as $incomingDistribution) { | ||||
if ($this->subscriptionSolver->matchWith($subscription, $incomingDistribution->date)) { | |||||
if ($this->subscriptionSolver->isSubscriptionMatchWith($subscription, $incomingDistribution->date)) { | |||||
$matchedIncomingDistributionsArray[] = $incomingDistribution; | $matchedIncomingDistributionsArray[] = $incomingDistribution; | ||||
} | } | ||||
} | } |
<?php | <?php | ||||
namespace common\logic\Distribution\Distribution; | |||||
namespace common\logic\Distribution\Distribution\Repository; | |||||
use common\logic\AbstractRepositoryQuery; | use common\logic\AbstractRepositoryQuery; | ||||
<?php | <?php | ||||
namespace common\logic\Distribution\Distribution; | |||||
namespace common\logic\Distribution\Distribution\Service; | |||||
use common\logic\AbstractBuilder; | use common\logic\AbstractBuilder; | ||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistribution; | |||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistributionBuilder; | |||||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistributionRepository; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistribution; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistributionBuilder; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistributionRepository; | |||||
use common\logic\Order\Order\OrderRepository; | |||||
use common\logic\Order\ProductOrder\ProductOrderBuilder; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Product\Product\ProductRepository; | |||||
use common\logic\User\UserProducer\UserProducerRepository; | |||||
use yii\base\Event; | |||||
use common\logic\Distribution\Distribution\Event\DistributionActiveEvent; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\Distribution\Repository\DistributionRepository; | |||||
use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository; | |||||
use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributionBuilder; | |||||
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository; | |||||
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionBuilder; | |||||
use common\logic\Order\Order\Repository\OrderRepository; | |||||
use common\logic\Order\ProductOrder\Service\ProductOrderBuilder; | |||||
use common\logic\Product\Product\Repository\ProductRepository; | |||||
use common\logic\User\UserProducer\Repository\UserProducerRepository; | |||||
class DistributionBuilder extends AbstractBuilder | class DistributionBuilder extends AbstractBuilder | ||||
{ | { | ||||
$this->pointSaleDistributionBuilder = $this->loadService(PointSaleDistributionBuilder::class); | $this->pointSaleDistributionBuilder = $this->loadService(PointSaleDistributionBuilder::class); | ||||
$this->productRepository = $this->loadService(ProductRepository::class); | $this->productRepository = $this->loadService(ProductRepository::class); | ||||
$this->productDistributionRepository = $this->loadService(ProductDistributionRepository::class); | $this->productDistributionRepository = $this->loadService(ProductDistributionRepository::class); | ||||
$this->productDistributionBuilder = $this->loadService(ProductDistributionBuilder::class); | |||||
$this->orderRepository = $this->loadService(OrderRepository::class); | $this->orderRepository = $this->loadService(OrderRepository::class); | ||||
$this->userProducerRepository = $this->loadService(UserProducerRepository::class); | $this->userProducerRepository = $this->loadService(UserProducerRepository::class); | ||||
$this->productOrderBuilder = $this->loadService(ProductOrderBuilder::class); | $this->productOrderBuilder = $this->loadService(ProductOrderBuilder::class); | ||||
$this->saveUpdate($distribution); | $this->saveUpdate($distribution); | ||||
if ($active) { | if ($active) { | ||||
$distribution->trigger(Distribution::EVENT_ACTIVE, new Event(['distribution' => $distribution])); | |||||
$distributionActiveEvent = new DistributionActiveEvent(); | |||||
$distributionActiveEvent->distribution = $distribution; | |||||
$distribution->trigger(Distribution::EVENT_ACTIVE, $distributionActiveEvent); | |||||
} | } | ||||
} | } | ||||
} | } |
<?php | <?php | ||||
namespace common\logic\Distribution\Distribution; | |||||
namespace common\logic\Distribution\Distribution\Service; | |||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\AbstractService; | use common\logic\AbstractService; | ||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\PointSale\PointSale\PointSale; | use common\logic\PointSale\PointSale\PointSale; | ||||
use common\logic\Product\Product\Product; | use common\logic\Product\Product\Product; | ||||
use common\logic\SolverInterface; | use common\logic\SolverInterface; |
<?php | <?php | ||||
namespace common\logic\Distribution\Distribution; | |||||
namespace common\logic\Distribution\Distribution\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\Distribution\Repository\DistributionRepository; | |||||
use common\logic\Distribution\Distribution\Service\DistributionBuilder; | |||||
use common\logic\Distribution\Distribution\Service\DistributionSolver; | |||||
class DistributionContainer extends AbstractContainer | class DistributionContainer extends AbstractContainer | ||||
{ | { |
namespace common\logic\Distribution\Distribution; | namespace common\logic\Distribution\Distribution; | ||||
use common\logic\AbstractManager; | use common\logic\AbstractManager; | ||||
use common\logic\Distribution\Distribution\Repository\DistributionRepository; | |||||
use common\logic\Distribution\Distribution\Service\DistributionBuilder; | |||||
use common\logic\Distribution\Distribution\Service\DistributionSolver; | |||||
use common\logic\Distribution\Distribution\Wrapper\DistributionContainer; | |||||
/** | /** | ||||
* @mixin DistributionSolver | * @mixin DistributionSolver |
termes. | termes. | ||||
*/ | */ | ||||
namespace common\logic\Distribution\PointSaleDistribution; | |||||
namespace common\logic\Distribution\PointSaleDistribution\Model; | |||||
use common\components\ActiveRecordCommon ; | use common\components\ActiveRecordCommon ; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\PointSale\PointSale\PointSale; | use common\logic\PointSale\PointSale\PointSale; | ||||
class PointSaleDistribution extends ActiveRecordCommon | class PointSaleDistribution extends ActiveRecordCommon |
<?php | <?php | ||||
namespace common\logic\Distribution\PointSaleDistribution; | |||||
namespace common\logic\Distribution\PointSaleDistribution\Repository; | |||||
use common\logic\AbstractRepository; | use common\logic\AbstractRepository; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; | |||||
use common\logic\PointSale\PointSale\PointSale; | use common\logic\PointSale\PointSale\PointSale; | ||||
class PointSaleDistributionRepository extends AbstractRepository | class PointSaleDistributionRepository extends AbstractRepository |
<?php | <?php | ||||
namespace common\logic\Distribution\PointSaleDistribution; | |||||
namespace common\logic\Distribution\PointSaleDistribution\Repository; | |||||
use common\logic\AbstractRepositoryQuery; | use common\logic\AbstractRepositoryQuery; | ||||
<?php | <?php | ||||
namespace common\logic\Distribution\PointSaleDistribution; | |||||
namespace common\logic\Distribution\PointSaleDistribution\Service; | |||||
use common\logic\AbstractBuilder; | use common\logic\AbstractBuilder; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\Distribution\DistributionRepository; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\PointSale\PointSale\PointSaleRepository; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\Distribution\Repository\DistributionRepository; | |||||
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; | |||||
use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository; | |||||
use common\logic\PointSale\PointSale\Repository\PointSaleRepository; | |||||
class PointSaleDistributionBuilder extends AbstractBuilder | class PointSaleDistributionBuilder extends AbstractBuilder | ||||
{ | { | ||||
// setAll | // setAll | ||||
public function createAllPointSaleDistributions(Distribution $distribution, bool $delivery): void | public function createAllPointSaleDistributions(Distribution $distribution, bool $delivery): void | ||||
{ | { | ||||
$pointSaleArray = $this->pointSaleRepository->findPointSaleDistributionsByDistribution($distribution); | |||||
$pointSaleArray = $this->pointSaleDistributionRepository->findPointSaleDistributionsByDistribution($distribution); | |||||
foreach ($pointSaleArray as $pointSale) { | foreach ($pointSaleArray as $pointSale) { | ||||
if (!$pointSale->pointSaleDistribution) { | if (!$pointSale->pointSaleDistribution) { | ||||
$this->createPointSaleDistribution($distribution, $pointSale); | $this->createPointSaleDistribution($distribution, $pointSale); |
<?php | <?php | ||||
namespace common\logic\Distribution\PointSaleDistribution; | |||||
namespace common\logic\Distribution\PointSaleDistribution\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; | |||||
use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository; | |||||
use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributionBuilder; | |||||
class PointSaleDistributionContainer extends AbstractContainer | class PointSaleDistributionContainer extends AbstractContainer | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Distribution\PointSaleDistribution; | |||||
namespace common\logic\Distribution\PointSaleDistribution\Wrapper; | |||||
use common\logic\AbstractManager; | use common\logic\AbstractManager; | ||||
use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository; | |||||
use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributionBuilder; | |||||
/** | /** | ||||
* @mixin PointSaleDistributionRepository | * @mixin PointSaleDistributionRepository |
termes. | termes. | ||||
*/ | */ | ||||
namespace common\logic\Distribution\ProductDistribution; | |||||
namespace common\logic\Distribution\ProductDistribution\Model; | |||||
use common\components\ActiveRecordCommon ; | use common\components\ActiveRecordCommon ; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Product\Product\Product; | use common\logic\Product\Product\Product; | ||||
class ProductDistribution extends ActiveRecordCommon | class ProductDistribution extends ActiveRecordCommon |
<?php | <?php | ||||
namespace common\logic\Distribution\ProductDistribution; | |||||
namespace common\logic\Distribution\ProductDistribution\Repository; | |||||
use common\logic\AbstractRepository; | use common\logic\AbstractRepository; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||||
use common\logic\Product\Product\Product; | use common\logic\Product\Product\Product; | ||||
class ProductDistributionRepository extends AbstractRepository | class ProductDistributionRepository extends AbstractRepository |
<?php | <?php | ||||
namespace common\logic\Distribution\ProductDistribution; | |||||
namespace common\logic\Distribution\ProductDistribution\Repository; | |||||
use common\logic\AbstractRepositoryQuery; | use common\logic\AbstractRepositoryQuery; | ||||
<?php | <?php | ||||
namespace common\logic\Distribution\ProductDistribution; | |||||
namespace common\logic\Distribution\ProductDistribution\Service; | |||||
use common\logic\AbstractBuilder; | use common\logic\AbstractBuilder; | ||||
use common\logic\BuilderInterface; | |||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\Distribution\DistributionSolver; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Product\Product\ProductSolver; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\Distribution\Service\DistributionSolver; | |||||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||||
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\Product\Product\Service\ProductSolver; | |||||
class ProductDistributionBuilder extends AbstractBuilder | class ProductDistributionBuilder extends AbstractBuilder | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Distribution\ProductDistribution; | |||||
namespace common\logic\Distribution\ProductDistribution\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||||
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository; | |||||
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionBuilder; | |||||
class ProductDistributionContainer extends AbstractContainer | class ProductDistributionContainer extends AbstractContainer | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Distribution\ProductDistribution; | |||||
namespace common\logic\Distribution\ProductDistribution\Wrapper; | |||||
use common\logic\AbstractManager; | use common\logic\AbstractManager; | ||||
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository; | |||||
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionBuilder; | |||||
/** | /** | ||||
* @mixin ProductDistributionRepository | * @mixin ProductDistributionRepository |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Document\DeliveryNote; | |||||
namespace common\logic\Document\DeliveryNote\Model; | |||||
use common\logic\Document\Document\Document; | use common\logic\Document\Document\Document; | ||||
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Document\DeliveryNote; | |||||
namespace common\logic\Document\DeliveryNote\Model; | |||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\PointSale\PointSale\DeliveryNoteRepository; | |||||
use common\logic\Document\DeliveryNote\Repository\DeliveryNoteRepository; | |||||
use yii\data\ActiveDataProvider; | use yii\data\ActiveDataProvider; | ||||
class DeliveryNoteSearch extends DeliveryNote | class DeliveryNoteSearch extends DeliveryNote |
<?php | <?php | ||||
namespace common\logic\Document\DeliveryNote; | |||||
namespace common\logic\Document\DeliveryNote\Repository; | |||||
use common\logic\AbstractRepository; | use common\logic\AbstractRepository; | ||||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||||
class DeliveryNoteRepository extends AbstractRepository | class DeliveryNoteRepository extends AbstractRepository | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Document\DeliveryNote; | |||||
namespace common\logic\Document\DeliveryNote\Repository; | |||||
use common\logic\AbstractRepositoryQuery; | use common\logic\AbstractRepositoryQuery; | ||||
<?php | <?php | ||||
namespace common\logic\Document\DeliveryNote; | |||||
namespace common\logic\Document\DeliveryNote\Service; | |||||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||||
use common\logic\Document\Document\DocumentBuilder; | use common\logic\Document\Document\DocumentBuilder; | ||||
class DeliveryNoteBuilder extends DocumentBuilder | class DeliveryNoteBuilder extends DocumentBuilder |
<?php | <?php | ||||
namespace common\logic\Document\DeliveryNote; | |||||
namespace common\logic\Document\DeliveryNote\Service; | |||||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||||
use common\logic\Document\Document\DocumentSolver; | use common\logic\Document\Document\DocumentSolver; | ||||
use common\logic\Document\Invoice\Invoice; | use common\logic\Document\Invoice\Invoice; | ||||
use common\logic\SolverInterface; | use common\logic\SolverInterface; |
<?php | <?php | ||||
namespace common\logic\Document\DeliveryNote; | |||||
namespace common\logic\Document\DeliveryNote\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteBuilder; | |||||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteSolver; | |||||
class DeliveryNoteContainer extends AbstractContainer | class DeliveryNoteContainer extends AbstractContainer | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Document\DeliveryNote; | |||||
namespace common\logic\Document\DeliveryNote\Wrapper; | |||||
use common\logic\Document\DeliveryNote\Repository\DeliveryNoteRepository; | |||||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteBuilder; | |||||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteSolver; | |||||
use common\logic\Document\Document\DocumentManager; | use common\logic\Document\Document\DocumentManager; | ||||
use common\logic\PointSale\PointSale\DeliveryNoteRepository; | |||||
/** | /** | ||||
* @mixin DeliveryNoteSolver | * @mixin DeliveryNoteSolver |
<?php | |||||
namespace common\logic\Document\Document; | |||||
interface DocumentInterface | |||||
{ | |||||
} |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Document\Document; | |||||
namespace common\logic\Document\Document\Model; | |||||
use common\components\ActiveRecordCommon; | use common\components\ActiveRecordCommon; | ||||
use common\helpers\GlobalParam; | |||||
use common\logic\Order\Order\Order; | |||||
use common\logic\Order\Order\OrderRepository; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\User\User\User; | |||||
use kartik\mpdf\Pdf; | |||||
use yii\base\ErrorException; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Order\Order\Repository\OrderRepository; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\User\User\Model\User; | |||||
class Document extends ActiveRecordCommon implements DocumentInterface | class Document extends ActiveRecordCommon implements DocumentInterface | ||||
{ | { |
<?php | |||||
namespace common\logic\Document\Document\Model; | |||||
interface DocumentInterface | |||||
{ | |||||
} |
<?php | <?php | ||||
namespace common\logic\Document\Document; | |||||
namespace common\logic\Document\Document\Service; | |||||
use common\logic\AbstractBuilder; | use common\logic\AbstractBuilder; | ||||
use common\logic\Producer\Producer\ProducerRepository; | |||||
use common\logic\Document\Document\Model\Document; | |||||
use common\logic\Document\Document\Model\DocumentInterface; | |||||
use common\logic\Producer\Producer\Repository\ProducerRepository; | |||||
class DocumentBuilder extends AbstractBuilder | class DocumentBuilder extends AbstractBuilder | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Document\Document; | |||||
namespace common\logic\Document\Document\Service; | |||||
use common\helpers\Price; | use common\helpers\Price; | ||||
use common\logic\AbstractService; | use common\logic\AbstractService; | ||||
use common\logic\Document\Document\Model\Document; | |||||
use common\logic\Document\Document\Model\DocumentInterface; | |||||
use common\logic\Order\Order\Order; | use common\logic\Order\Order\Order; | ||||
use common\logic\PointSale\PointSale\PointSale; | use common\logic\PointSale\PointSale\PointSale; | ||||
use common\logic\SolverInterface; | use common\logic\SolverInterface; |
<?php | <?php | ||||
namespace common\logic\Document\Document; | |||||
namespace common\logic\Document\Document\Service; | |||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\AbstractService; | use common\logic\AbstractService; | ||||
use common\logic\Producer\Producer\ProducerRepository; | |||||
use common\logic\Producer\Producer\ProducerSolver; | |||||
use common\logic\Document\Document\Model\DocumentInterface; | |||||
use common\logic\Producer\Producer\Repository\ProducerRepository; | |||||
use common\logic\Producer\Producer\Service\ProducerSolver; | |||||
use common\logic\UtilsInterface; | use common\logic\UtilsInterface; | ||||
use kartik\mpdf\Pdf; | use kartik\mpdf\Pdf; | ||||
use yii\base\ErrorException; | use yii\base\ErrorException; | ||||
->setFrom([$producer->getEmailOpendistrib() => $producer->name]) | ->setFrom([$producer->getEmailOpendistrib() => $producer->name]) | ||||
->setSubject('[' . $producer->name . '] ' . $subjectEmail); | ->setSubject('[' . $producer->name . '] ' . $subjectEmail); | ||||
$this->documentBuilder->generatePdf($document, Pdf::DEST_FILE); | |||||
$this->generatePdf($document, Pdf::DEST_FILE); | |||||
$email->attach($this->documentSolver->getFilenameComplete($document)); | $email->attach($this->documentSolver->getFilenameComplete($document)); | ||||
return $email->send(); | return $email->send(); |
<?php | <?php | ||||
namespace common\logic\Document\Document; | |||||
namespace common\logic\Document\Document\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\Document\Document\Model\Document; | |||||
use common\logic\Document\Document\Service\DocumentBuilder; | |||||
use common\logic\Document\Document\Service\DocumentSolver; | |||||
use common\logic\Document\Document\Service\DocumentUtils; | |||||
class DocumentContainer extends AbstractContainer | class DocumentContainer extends AbstractContainer | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Document\Document; | |||||
namespace common\logic\Document\Document\Wrapper; | |||||
use common\logic\AbstractManager; | use common\logic\AbstractManager; | ||||
<?php | |||||
namespace common\logic\Document\Invoice; | |||||
use common\logic\Document\Document\DocumentManager; | |||||
/** | |||||
* @mixin InvoiceRepository | |||||
* @mixin InvoiceBuilder | |||||
*/ | |||||
class InvoiceManager extends DocumentManager | |||||
{ | |||||
public function getContainerFqcn(): string | |||||
{ | |||||
return InvoiceContainer::class; | |||||
} | |||||
} |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Document\Invoice; | |||||
namespace common\logic\Document\Invoice\Model; | |||||
use common\logic\Document\Document\Document; | |||||
use common\logic\Document\Document\Model\Document; | |||||
/** | /** | ||||
* This is the model class for table "invoice". | * This is the model class for table "invoice". |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Document\Invoice; | |||||
namespace common\logic\Document\Invoice\Model; | |||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\PointSale\PointSale\InvoiceRepository; | |||||
use common\logic\Document\Invoice\Repository\InvoiceRepository; | |||||
use yii\data\ActiveDataProvider; | use yii\data\ActiveDataProvider; | ||||
class InvoiceSearch extends Invoice | class InvoiceSearch extends Invoice |
<?php | <?php | ||||
namespace common\logic\Document\Invoice; | |||||
namespace common\logic\Document\Invoice\Repository; | |||||
use common\logic\AbstractRepository; | use common\logic\AbstractRepository; | ||||
use common\logic\Document\Invoice\Model\Invoice; | |||||
class InvoiceRepository extends AbstractRepository | class InvoiceRepository extends AbstractRepository | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Document\Invoice; | |||||
namespace common\logic\Document\Invoice\Repository; | |||||
use common\logic\AbstractRepositoryQuery; | use common\logic\AbstractRepositoryQuery; | ||||
<?php | <?php | ||||
namespace common\logic\Document\Invoice; | |||||
namespace common\logic\Document\Invoice\Service; | |||||
use common\logic\Document\Document\DocumentBuilder; | |||||
use common\logic\Document\Document\Service\DocumentBuilder; | |||||
use common\logic\Document\Invoice\Model\Invoice; | |||||
class InvoiceBuilder extends DocumentBuilder | class InvoiceBuilder extends DocumentBuilder | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Document\Invoice; | |||||
namespace common\logic\Document\Invoice\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\Document\Document\DocumentSolver; | |||||
use common\logic\Document\Document\Service\DocumentSolver; | |||||
use common\logic\Document\Invoice\Model\Invoice; | |||||
use common\logic\Document\Invoice\Repository\InvoiceRepository; | |||||
use common\logic\Document\Invoice\Service\InvoiceBuilder; | |||||
class InvoiceContainer extends AbstractContainer | class InvoiceContainer extends AbstractContainer | ||||
{ | { |
<?php | |||||
namespace common\logic\Document\Invoice\Wrapper; | |||||
use common\logic\Document\Document\Wrapper\DocumentManager; | |||||
use common\logic\Document\Invoice\Repository\InvoiceRepository; | |||||
use common\logic\Document\Invoice\Service\InvoiceBuilder; | |||||
/** | |||||
* @mixin InvoiceRepository | |||||
* @mixin InvoiceBuilder | |||||
*/ | |||||
class InvoiceManager extends DocumentManager | |||||
{ | |||||
public function getContainerFqcn(): string | |||||
{ | |||||
return InvoiceContainer::class; | |||||
} | |||||
} |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Document\Quotation; | |||||
namespace common\logic\Document\Quotation\Model; | |||||
use common\logic\Document\Document\Document; | |||||
use common\logic\Document\Document\Model\Document; | |||||
/** | /** | ||||
* This is the model class for table "quotation". | * This is the model class for table "quotation". |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Document\Quotation; | |||||
namespace common\logic\Document\Quotation\Model; | |||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\PointSale\PointSale\QuotationRepository; | |||||
use common\logic\PointSale\PointSale\Repository\QuotationRepository; | |||||
use yii\data\ActiveDataProvider; | use yii\data\ActiveDataProvider; | ||||
class QuotationSearch extends Quotation | class QuotationSearch extends Quotation |
<?php | |||||
namespace common\logic\Document\Invoice; | |||||
use common\logic\Document\Document\DocumentManager; | |||||
use common\logic\Document\Quotation\QuotationBuilder; | |||||
use common\logic\PointSale\PointSale\QuotationRepository; | |||||
/** | |||||
* @mixin QuotationRepository | |||||
* @mixin QuotationBuilder | |||||
*/ | |||||
class QuotationManager extends DocumentManager | |||||
{ | |||||
public function getContainerFqcn(): string | |||||
{ | |||||
return QuotationContainer::class; | |||||
} | |||||
} |
<?php | <?php | ||||
namespace common\logic\PointSale\PointSale; | |||||
namespace common\logic\PointSale\PointSale\Repository; | |||||
use common\logic\AbstractRepository; | use common\logic\AbstractRepository; | ||||
use common\logic\Document\Quotation\QuotationRepositoryQuery; | |||||
use common\logic\Document\Quotation\Repository\QuotationRepositoryQuery; | |||||
class QuotationRepository extends AbstractRepository | class QuotationRepository extends AbstractRepository | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Document\Quotation; | |||||
namespace common\logic\Document\Quotation\Repository; | |||||
use common\logic\AbstractRepositoryQuery; | use common\logic\AbstractRepositoryQuery; | ||||
<?php | <?php | ||||
namespace common\logic\Document\Quotation; | |||||
namespace common\logic\Document\Quotation\Service; | |||||
use common\logic\AbstractBuilder; | use common\logic\AbstractBuilder; | ||||
use common\logic\Document\Quotation\Model\Quotation; | |||||
class QuotationBuilder extends AbstractBuilder | class QuotationBuilder extends AbstractBuilder | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Document\Invoice; | |||||
namespace common\logic\Document\Invoice\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\Document\Document\DocumentSolver; | |||||
use common\logic\Document\Quotation\QuotationBuilder; | |||||
use common\logic\Document\Quotation\Quotation; | |||||
use common\logic\PointSale\PointSale\QuotationRepository; | |||||
use common\logic\Document\Document\Service\DocumentSolver; | |||||
use common\logic\Document\Quotation\Model\Quotation; | |||||
use common\logic\Document\Quotation\Service\QuotationBuilder; | |||||
use common\logic\PointSale\PointSale\Repository\QuotationRepository; | |||||
class QuotationContainer extends AbstractContainer | class QuotationContainer extends AbstractContainer | ||||
{ | { |
<?php | |||||
namespace common\logic\Document\Invoice\Wrapper; | |||||
use common\logic\Document\Document\Wrapper\DocumentManager; | |||||
use common\logic\Document\Quotation\Service\QuotationBuilder; | |||||
use common\logic\PointSale\PointSale\Repository\QuotationRepository; | |||||
/** | |||||
* @mixin QuotationRepository | |||||
* @mixin QuotationBuilder | |||||
*/ | |||||
class QuotationManager extends DocumentManager | |||||
{ | |||||
public function getContainerFqcn(): string | |||||
{ | |||||
return QuotationContainer::class; | |||||
} | |||||
} |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Order\Order; | |||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Document\DeliveryNote\DeliveryNote; | |||||
use common\logic\Document\Invoice\Invoice; | |||||
use common\logic\Document\Quotation\Quotation; | |||||
use common\logic\Order\ProductOrder\ProductOrder; | |||||
use common\logic\PointSale\PointSale\PointSale; | |||||
use common\logic\Subscription\Subscription\Subscription; | |||||
use common\logic\User\CreditHistory\CreditHistory; | |||||
use common\logic\User\User\User; | |||||
namespace common\logic\Order\Order\Model; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||||
use common\logic\Document\Invoice\Model\Invoice; | |||||
use common\logic\Document\Quotation\Model\Quotation; | |||||
use common\logic\Order\ProductOrder\Model\ProductOrder; | |||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\Subscription\Subscription\Model\Subscription; | |||||
use common\logic\User\CreditHistory\Model\CreditHistory; | |||||
use common\logic\User\User\Model\User; | |||||
use common\components\ActiveRecordCommon; | use common\components\ActiveRecordCommon; | ||||
/** | /** |
termes. | termes. | ||||
*/ | */ | ||||
namespace common\logic\Order\Order ; | |||||
namespace common\logic\Order\Order\Model; | |||||
use common\logic\Order\Order\Repository\OrderRepository; | |||||
use yii\data\ActiveDataProvider; | use yii\data\ActiveDataProvider; | ||||
class OrderSearch extends Order | class OrderSearch extends Order |
<?php | |||||
namespace common\logic\Order\Order; | |||||
use common\logic\AbstractManager; | |||||
use common\logic\Config\TaxRate\TaxRate; | |||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Document\Document\Document; | |||||
use common\logic\Order\ProductOrder\ProductOrder; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Subscription\Subscription\Subscription; | |||||
use common\logic\User\User\User; | |||||
use yii\db\Query; | |||||
/** | |||||
* @mixin OrderSolver | |||||
* @mixin OrderRepository | |||||
* @mixin OrderBuilder | |||||
*/ | |||||
class OrderManager extends AbstractManager | |||||
{ | |||||
public function getContainerFqcn(): string | |||||
{ | |||||
return OrderContainer::class; | |||||
} | |||||
} |
<?php | <?php | ||||
namespace common\logic\Order\Order; | |||||
namespace common\logic\Order\Order\Repository; | |||||
use common\logic\AbstractRepository; | use common\logic\AbstractRepository; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\ProductDistribution\ProductDistributionRepository; | |||||
use common\logic\Order\ProductOrder\ProductOrderRepository; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Producer\Producer\ProducerRepository; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\User\User\User; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Order\Order\Service\OrderSolver; | |||||
use common\logic\Order\ProductOrder\Repository\ProductOrderRepository; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Producer\Producer\Repository\ProducerRepository; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\User\User\Model\User; | |||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
class OrderRepository extends AbstractRepository | class OrderRepository extends AbstractRepository | ||||
public function getCartSummary(Order $order, $htmlFormat = true): string | public function getCartSummary(Order $order, $htmlFormat = true): string | ||||
{ | { | ||||
if (!isset($order->productOrder)) { | if (!isset($order->productOrder)) { | ||||
$order->productOrder = $this->productOrderRepository->getByOrder($order); | |||||
$order->productOrder = $this->productOrderRepository->findProductOrdersByOrder($order); | |||||
} | } | ||||
$html = ''; | $html = ''; | ||||
{ | { | ||||
$html = ''; | $html = ''; | ||||
$creditActive = $this->producerRepository->getConfig('credit'); | $creditActive = $this->producerRepository->getConfig('credit'); | ||||
$html .= $this->orderSolver->getAmountWithTax($order, Order::AMOUNT_TOTAL, true); | |||||
$html .= $this->orderSolver->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL, true); | |||||
if ($creditActive) { | if ($creditActive) { | ||||
$html .= '<br />'; | $html .= '<br />'; |
<?php | <?php | ||||
namespace common\logic\Order\Order; | |||||
namespace common\logic\Order\Order\Repository; | |||||
use common\logic\AbstractRepositoryQuery; | use common\logic\AbstractRepositoryQuery; | ||||
<?php | <?php | ||||
namespace common\logic\Order\Order; | |||||
namespace common\logic\Order\Order\Service; | |||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\helpers\MeanPayment; | use common\helpers\MeanPayment; | ||||
use common\helpers\Price; | use common\helpers\Price; | ||||
use common\logic\AbstractBuilder; | use common\logic\AbstractBuilder; | ||||
use common\logic\AbstractService; | |||||
use common\logic\BuilderInterface; | |||||
use common\logic\Config\TaxRate\TaxRate; | use common\logic\Config\TaxRate\TaxRate; | ||||
use common\logic\Distribution\Distribution\Distribution; | |||||
use common\logic\Distribution\Distribution\DistributionRepository; | |||||
use common\logic\Document\Document\Document; | |||||
use common\logic\Order\OrderStatusHistory\OrderStatusHistoryBuilder; | |||||
use common\logic\Order\ProductOrder\ProductOrder; | |||||
use common\logic\Order\ProductOrder\ProductOrderBuilder; | |||||
use common\logic\Order\ProductOrder\ProductOrderSolver; | |||||
use common\logic\PointSale\PointSale\PointSaleBuilder; | |||||
use common\logic\PointSale\PointSale\PointSaleRepository; | |||||
use common\logic\PointSale\UserPointSale\UserPointSaleRepository; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Producer\Producer\ProducerRepository; | |||||
use common\logic\Subscription\Subscription\Subscription; | |||||
use common\logic\Subscription\Subscription\SubscriptionBuilder; | |||||
use common\logic\Subscription\Subscription\SubscriptionRepository; | |||||
use common\logic\Subscription\Subscription\SubscriptionSolver; | |||||
use common\logic\User\CreditHistory\CreditHistory; | |||||
use common\logic\User\CreditHistory\CreditHistoryBuilder; | |||||
use common\logic\User\CreditHistory\CreditHistoryRepository; | |||||
use common\logic\User\User\User; | |||||
use common\logic\User\User\UserSolver; | |||||
use common\logic\User\UserProducer\UserProducerRepository; | |||||
use common\logic\Distribution\Distribution\Repository\DistributionRepository; | |||||
use common\logic\Document\Document\Model\Document; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Order\Order\Repository\OrderRepository; | |||||
use common\logic\Order\OrderStatusHistory\Service\OrderStatusHistoryBuilder; | |||||
use common\logic\Order\ProductOrder\Model\ProductOrder; | |||||
use common\logic\Order\ProductOrder\Service\ProductOrderBuilder; | |||||
use common\logic\Order\ProductOrder\Service\ProductOrderSolver; | |||||
use common\logic\PointSale\PointSale\Service\PointSaleBuilder; | |||||
use common\logic\PointSale\PointSale\Repository\PointSaleRepository; | |||||
use common\logic\PointSale\UserPointSale\Repository\UserPointSaleRepository; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Producer\Producer\Repository\ProducerRepository; | |||||
use common\logic\Subscription\Subscription\Model\Subscription; | |||||
use common\logic\Subscription\Subscription\Service\SubscriptionBuilder; | |||||
use common\logic\Subscription\Subscription\Repository\SubscriptionRepository; | |||||
use common\logic\Subscription\Subscription\Service\SubscriptionSolver; | |||||
use common\logic\User\CreditHistory\Model\CreditHistory; | |||||
use common\logic\User\CreditHistory\Service\CreditHistoryBuilder; | |||||
use common\logic\User\CreditHistory\Repository\CreditHistoryRepository; | |||||
use common\logic\User\User\Service\UserSolver; | |||||
use common\logic\User\UserProducer\Repository\UserProducerRepository; | |||||
use yii\web\NotFoundHttpException; | use yii\web\NotFoundHttpException; | ||||
class OrderBuilder extends AbstractBuilder | class OrderBuilder extends AbstractBuilder | ||||
{ | { | ||||
$now = date('Y-m-d'); | $now = date('Y-m-d'); | ||||
$distributionDate = date('Y-m-d', strtotime($date)); | $distributionDate = date('Y-m-d', strtotime($date)); | ||||
$distribution = $this->distributionRepository->getOneByDate($distributionDate); | |||||
$distribution = $this->distributionRepository->findOneDistributionByDate($distributionDate); | |||||
if ($distribution | if ($distribution | ||||
&& $distribution->active | && $distribution->active | ||||
public function createAllOrdersFromSubscriptions(string $date, bool $force = false): array | public function createAllOrdersFromSubscriptions(string $date, bool $force = false): array | ||||
{ | { | ||||
$orderArray = []; | $orderArray = []; | ||||
$distribution = $this->distributionRepository->getOneByDate(date('Y-m-d', strtotime($date))); | |||||
$distribution = $this->distributionRepository->findOneDistributionByDate(date('Y-m-d', strtotime($date))); | |||||
if ($distribution) { | if ($distribution) { | ||||
$orderArray = $this->orderRepository->getByDistribution($distribution); | |||||
$subscriptionArray = $this->subscriptionRepository->getByDate($date); | |||||
$orderArray = $this->orderRepository->findOrdersByDistribution($distribution); | |||||
$subscriptionArray = $this->subscriptionRepository->findSubscriptionsByDate($date); | |||||
foreach ($subscriptionArray as $subscription) { | foreach ($subscriptionArray as $subscription) { | ||||
if (!$this->subscriptionSolver->hasOrderAlreadyExist($subscription, $orderArray)) { | if (!$this->subscriptionSolver->hasOrderAlreadyExist($subscription, $orderArray)) { | ||||
$this->createOrderFromSubscription($subscription, $date, $force); | $this->createOrderFromSubscription($subscription, $date, $force); | ||||
public function updateOrdersIncomingDistributionsFromSubscription(Subscription $subscription, $update = false): array | public function updateOrdersIncomingDistributionsFromSubscription(Subscription $subscription, $update = false): array | ||||
{ | { | ||||
$orderArray = []; | $orderArray = []; | ||||
$matchedDistributionsArray = $this->distributionRepository->searchMatchedIncomingDistributions($subscription); | |||||
$matchedDistributionsArray = $this->distributionRepository->findDistributionsIncomingMatchWithSubscrtiption($subscription); | |||||
if ($update) { | if ($update) { | ||||
$this->deleteOrdersIncomingDistributionsFromSubscription($subscription); | $this->deleteOrdersIncomingDistributionsFromSubscription($subscription); | ||||
if ($ordersArray && count($ordersArray)) { | if ($ordersArray && count($ordersArray)) { | ||||
foreach ($ordersArray as $order) { | foreach ($ordersArray as $order) { | ||||
$theOrder = $this->orderRepository->getOneById($order->id); | |||||
$theOrder = $this->orderRepository->findOneOrderById($order->id); | |||||
// remboursement de la commande | // remboursement de la commande | ||||
if ($theOrder->id_user && $theOrder->getAmount(Order::AMOUNT_PAID) && $configCredit) { | if ($theOrder->id_user && $theOrder->getAmount(Order::AMOUNT_PAID) && $configCredit) { | ||||
$this->creditHistoryBuilder->create( | |||||
$this->creditHistoryBuilder->createCreditHistory( | |||||
CreditHistory::TYPE_REFUND, | CreditHistory::TYPE_REFUND, | ||||
$theOrder->getAmount(Order::AMOUNT_PAID), | $theOrder->getAmount(Order::AMOUNT_PAID), | ||||
$theOrder->distribution->producer, | $theOrder->distribution->producer, | ||||
$user = $subscription->user ?? null; | $user = $subscription->user ?? null; | ||||
foreach ($subscription->productSubscription as $productSubscription) { | foreach ($subscription->productSubscription as $productSubscription) { | ||||
$this->productOrderBuilder->create( | |||||
$this->productOrderBuilder->createProductOrder( | |||||
$order, | $order, | ||||
$productSubscription->product, | $productSubscription->product, | ||||
$productSubscription->quantity, | $productSubscription->quantity, | ||||
$order->auto_payment = 1; | $order->auto_payment = 1; | ||||
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER) { | } elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER) { | ||||
$userProducer = $this->userProducerRepository->getOne($order->user, $order->producer); | |||||
$userProducer = $this->userProducerRepository->findOneUserProducer($order->user, $order->producer); | |||||
if ($userProducer) { | if ($userProducer) { | ||||
$order->auto_payment = $userProducer->credit_active; | $order->auto_payment = $userProducer->credit_active; | ||||
public function initOrderCommentPointSale(Order $order): void | public function initOrderCommentPointSale(Order $order): void | ||||
{ | { | ||||
if($order->user && $order->pointSale) { | if($order->user && $order->pointSale) { | ||||
$userPointSale = $this->userPointSaleRepository->getOne($order->user, $order->pointSale); | |||||
$userPointSale = $this->userPointSaleRepository->findOneUserPointSale($order->user, $order->pointSale); | |||||
if ($userPointSale && strlen($userPointSale->comment)) { | if ($userPointSale && strlen($userPointSale->comment)) { | ||||
$order->comment_point_sale = $userPointSale->comment; | $order->comment_point_sale = $userPointSale->comment; | ||||
public function deleteOrder(Order $order, bool $force = false): bool | public function deleteOrder(Order $order, bool $force = false): bool | ||||
{ | { | ||||
// remboursement si l'utilisateur a payé pour cette commande | // remboursement si l'utilisateur a payé pour cette commande | ||||
$amountPaid = $this->orderSolver->getAmount($order, Order::AMOUNT_PAID); | |||||
$amountPaid = $this->orderSolver->getOrderAmount($order, Order::AMOUNT_PAID); | |||||
if ($amountPaid >= 0.01) { | if ($amountPaid >= 0.01) { | ||||
$this->creditHistoryBuilder->create( | |||||
$this->creditHistoryBuilder->createCreditHistory( | |||||
CreditHistory::TYPE_REFUND, | CreditHistory::TYPE_REFUND, | ||||
$amountPaid, | $amountPaid, | ||||
GlobalParam::getCurrentProducer(), | GlobalParam::getCurrentProducer(), | ||||
($this->producerRepository->getConfig('option_behavior_cancel_order') == Producer::BEHAVIOR_DELETE_ORDER_STATUS && strlen($order->date_delete)) | ($this->producerRepository->getConfig('option_behavior_cancel_order') == Producer::BEHAVIOR_DELETE_ORDER_STATUS && strlen($order->date_delete)) | ||||
|| $force) { | || $force) { | ||||
$this->productOrderBuilder->deleteByOrder($order); | |||||
$this->productOrderBuilder->deleteProductOrdersByOrder($order); | |||||
return $this->delete($order); | return $this->delete($order); | ||||
} | } | ||||
return; | return; | ||||
} elseif ($paymentStatus == Order::PAYMENT_SURPLUS) { | } elseif ($paymentStatus == Order::PAYMENT_SURPLUS) { | ||||
$type = CreditHistory::TYPE_REFUND; | $type = CreditHistory::TYPE_REFUND; | ||||
$amount = $this->orderSolver->getAmount($order, Order::AMOUNT_SURPLUS); | |||||
$amount = $this->orderSolver->getOrderAmount($order, Order::AMOUNT_SURPLUS); | |||||
} elseif ($paymentStatus == Order::PAYMENT_UNPAID) { | } elseif ($paymentStatus == Order::PAYMENT_UNPAID) { | ||||
$type = CreditHistory::TYPE_PAYMENT; | $type = CreditHistory::TYPE_PAYMENT; | ||||
$amount = $this->orderSolver->getAmount($order, Order::AMOUNT_REMAINING); | |||||
$amount = $this->orderSolver->getOrderAmount($order, Order::AMOUNT_REMAINING); | |||||
} | } | ||||
$this->creditHistoryBuilder->create( | |||||
$this->creditHistoryBuilder->createCreditHistory( | |||||
$type, | $type, | ||||
$amount, | $amount, | ||||
GlobalParam::getCurrentProducer(), | GlobalParam::getCurrentProducer(), | ||||
switch ($newStatus) { | switch ($newStatus) { | ||||
case 'new-order' : | case 'new-order' : | ||||
$this->orderStatusHistoryBuilder->create($order, $userCurrent, $newStatus, $origin); | |||||
$this->orderStatusHistoryBuilder->createOrderStatusHistory($order, $userCurrent, $newStatus, $origin); | |||||
$order->status = $newStatus; | $order->status = $newStatus; | ||||
$order->save(); | $order->save(); | ||||
break; | break; | ||||
case 'refunded': | case 'refunded': | ||||
case 'cancel': | case 'cancel': | ||||
if (in_array($newStatus, $orderStatusArray[$order->status]['nextStatusAllow'])) { | if (in_array($newStatus, $orderStatusArray[$order->status]['nextStatusAllow'])) { | ||||
$this->orderStatusHistoryBuilder->create($order, $userCurrent, $newStatus, $origin); | |||||
$this->orderStatusHistoryBuilder->createOrderStatusHistory($order, $userCurrent, $newStatus, $origin); | |||||
$order->status = $newStatus; | $order->status = $newStatus; | ||||
$order->save(); | $order->save(); | ||||
} | } | ||||
// generateReference | // generateReference | ||||
public function generateOrderReference(Order $order): void | public function generateOrderReference(Order $order): void | ||||
{ | { | ||||
$producer = $order->producer; | |||||
$producer = $this->producerRepository->findOneProducerById($order->id_producer); | |||||
if (!$order->reference && $producer->option_order_reference_type == Producer::ORDER_REFERENCE_TYPE_YEARLY) { | if (!$order->reference && $producer->option_order_reference_type == Producer::ORDER_REFERENCE_TYPE_YEARLY) { | ||||
$lastOrder = $this->orderRepository->getOneLastOfYear($producer); | |||||
$lastOrder = $this->orderRepository->findOneOrderLastOfYear($producer); | |||||
if ($lastOrder && $lastOrder->reference && strlen($lastOrder->reference) > 0) { | if ($lastOrder && $lastOrder->reference && strlen($lastOrder->reference) > 0) { | ||||
$pattern = '#A([0-9]+)C([0-9]+)#'; | $pattern = '#A([0-9]+)C([0-9]+)#'; | ||||
{ | { | ||||
foreach ($order->productOrder as $productOrder) { | foreach ($order->productOrder as $productOrder) { | ||||
if ($productOrder->product) { | if ($productOrder->product) { | ||||
$this->productOrderBuilder->updateInvoicePrice($productOrder, $params); | |||||
$this->productOrderBuilder->updateProductOrderInvoicePrice($productOrder, $params); | |||||
} | } | ||||
} | } | ||||
} | } |
<?php | <?php | ||||
namespace common\logic\Order\Order; | |||||
namespace common\logic\Order\Order\Service; | |||||
use common\helpers\GlobalParam; | |||||
use common\helpers\Price; | use common\helpers\Price; | ||||
use common\logic\AbstractService; | use common\logic\AbstractService; | ||||
use common\logic\Document\Document\Document; | |||||
use common\logic\Document\Document\DocumentSolver; | |||||
use common\logic\Order\ProductOrder\ProductOrder; | |||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Product\Product\Product; | |||||
use common\logic\Document\Document\Service\DocumentSolver; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use common\logic\SolverInterface; | use common\logic\SolverInterface; | ||||
use common\logic\User\User\User; | |||||
use common\logic\User\User\UserSolver; | |||||
use common\logic\User\User\Model\User; | |||||
use common\logic\User\User\Service\UserSolver; | |||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
public function getPaymentStatus(Order $order): ?string | public function getPaymentStatus(Order $order): ?string | ||||
{ | { | ||||
// payé | // payé | ||||
if ($this->getAmountWithtax($order) - $this->getAmount($order, Order::AMOUNT_PAID) < 0.01 && | |||||
$this->getAmountWithtax($order) - $this->getAmount($order, Order::AMOUNT_PAID) > -0.01) { | |||||
if ($this->getOrderAmountWithtax($order) - $this->getOrderAmount($order, Order::AMOUNT_PAID) < 0.01 && | |||||
$this->getOrderAmountWithtax($order) - $this->getOrderAmount($order, Order::AMOUNT_PAID) > -0.01) { | |||||
return Order::PAYMENT_PAID; | return Order::PAYMENT_PAID; | ||||
} // à rembourser | } // à rembourser | ||||
elseif ($this->getAmountWithtax($order) - $this->getAmount($order, Order::AMOUNT_PAID) <= -0.01) { | |||||
elseif ($this->getOrderAmountWithtax($order) - $this->getOrderAmount($order, Order::AMOUNT_PAID) <= -0.01) { | |||||
return Order::PAYMENT_SURPLUS; | return Order::PAYMENT_SURPLUS; | ||||
} // reste à payer | } // reste à payer | ||||
elseif ($this->getAmountWithtax($order) - $this->getAmount($order, Order::AMOUNT_PAID) >= 0.01) { | |||||
elseif ($this->getOrderAmountWithtax($order) - $this->getOrderAmount($order, Order::AMOUNT_PAID) >= 0.01) { | |||||
return Order::PAYMENT_UNPAID; | return Order::PAYMENT_UNPAID; | ||||
} | } | ||||
$amount = $order->paid_amount; | $amount = $order->paid_amount; | ||||
break; | break; | ||||
case Order::AMOUNT_REMAINING : | case Order::AMOUNT_REMAINING : | ||||
$amount = $this->getAmountWithTax($order, Order::AMOUNT_TOTAL) | |||||
- $this->getAmountWithTax($order,Order::AMOUNT_PAID); | |||||
$amount = $this->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL) | |||||
- $this->getOrderAmountWithTax($order,Order::AMOUNT_PAID); | |||||
break; | break; | ||||
case Order::AMOUNT_SURPLUS : | case Order::AMOUNT_SURPLUS : | ||||
$amount = $this->getAmountWithTax($order,Order::AMOUNT_PAID) | |||||
- $this->getAmountWithTax($order,Order::AMOUNT_TOTAL); | |||||
$amount = $this->getOrderAmountWithTax($order,Order::AMOUNT_PAID) | |||||
- $this->getOrderAmountWithTax($order,Order::AMOUNT_TOTAL); | |||||
break; | break; | ||||
} | } | ||||
<?php | <?php | ||||
namespace common\logic\Order\Order; | |||||
namespace common\logic\Order\Order\Service; | |||||
use common\logic\AbstractService; | use common\logic\AbstractService; | ||||
use common\logic\UtilsInterface; | use common\logic\UtilsInterface; |
<?php | <?php | ||||
namespace common\logic\Order\Order; | |||||
namespace common\logic\Order\Order\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Order\Order\Repository\OrderRepository; | |||||
use common\logic\Order\Order\Service\OrderBuilder; | |||||
use common\logic\Order\Order\Service\OrderSolver; | |||||
use common\logic\Order\Order\Service\OrderUtils; | |||||
class OrderContainer extends AbstractContainer | class OrderContainer extends AbstractContainer | ||||
{ | { |
<?php | |||||
namespace common\logic\Order\Order\Wrapper; | |||||
use common\logic\AbstractManager; | |||||
use common\logic\Order\Order\Repository\OrderRepository; | |||||
use common\logic\Order\Order\Service\OrderBuilder; | |||||
use common\logic\Order\Order\Service\OrderSolver; | |||||
/** | |||||
* @mixin OrderSolver | |||||
* @mixin OrderRepository | |||||
* @mixin OrderBuilder | |||||
*/ | |||||
class OrderManager extends AbstractManager | |||||
{ | |||||
public function getContainerFqcn(): string | |||||
{ | |||||
return OrderContainer::class; | |||||
} | |||||
} |
<?php | <?php | ||||
namespace common\logic\Order\OrderStatusHistory; | |||||
namespace common\logic\Order\OrderStatusHistory\Model; | |||||
use common\components\ActiveRecordCommon; | use common\components\ActiveRecordCommon; | ||||
use common\logic\Order\Order\Order; | |||||
use common\logic\User\User\User; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\User\User\Model\User; | |||||
/** | /** | ||||
* This is the model class for table "order_status_history". | * This is the model class for table "order_status_history". |
<?php | <?php | ||||
namespace common\logic\Order\OrderStatusHistory; | |||||
namespace common\logic\Order\OrderStatusHistory\Repository; | |||||
use common\logic\AbstractRepository; | use common\logic\AbstractRepository; | ||||
<?php | <?php | ||||
namespace common\logic\Order\OrderStatusHistory; | |||||
namespace common\logic\Order\OrderStatusHistory\Repository; | |||||
use common\logic\AbstractRepositoryQuery; | use common\logic\AbstractRepositoryQuery; | ||||
<?php | <?php | ||||
namespace common\logic\Order\OrderStatusHistory; | |||||
namespace common\logic\Order\OrderStatusHistory\Service; | |||||
use common\logic\AbstractBuilder; | use common\logic\AbstractBuilder; | ||||
use common\logic\Order\Order\Order; | |||||
use common\logic\User\User\User; | |||||
use common\logic\User\User\UserSolver; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Order\OrderStatusHistory\Model\OrderStatusHistory; | |||||
use common\logic\User\User\Model\User; | |||||
use common\logic\User\User\Service\UserSolver; | |||||
class OrderStatusHistoryBuilder extends AbstractBuilder | class OrderStatusHistoryBuilder extends AbstractBuilder | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Order\OrderStatusHistory; | |||||
namespace common\logic\Order\OrderStatusHistory\Wrapper; | |||||
use common\logic\AbstractContainer; | use common\logic\AbstractContainer; | ||||
use common\logic\PointSale\PointSale\OrderStatusHistoryRepository; | |||||
use common\logic\Order\OrderStatusHistory\Model\OrderStatusHistory; | |||||
use common\logic\Order\OrderStatusHistory\Repository\OrderStatusHistoryRepository; | |||||
use common\logic\Order\OrderStatusHistory\Service\OrderStatusHistoryBuilder; | |||||
class OrderStatusHistoryContainer extends AbstractContainer | class OrderStatusHistoryContainer extends AbstractContainer | ||||
{ | { |
<?php | <?php | ||||
namespace common\logic\Order\OrderStatusHistory; | |||||
namespace common\logic\Order\OrderStatusHistory\Wrapper; | |||||
use common\logic\AbstractManager; | use common\logic\AbstractManager; | ||||
use common\logic\PointSale\PointSale\OrderStatusHistoryRepository; | |||||
use common\logic\Order\OrderStatusHistory\Repository\OrderStatusHistoryRepository; | |||||
use common\logic\Order\OrderStatusHistory\Service\OrderStatusHistoryBuilder; | |||||
/** | /** | ||||
* @mixin OrderStatusHistoryRepository | * @mixin OrderStatusHistoryRepository |
* termes. | * termes. | ||||
*/ | */ | ||||
namespace common\logic\Order\ProductOrder; | |||||
namespace common\logic\Order\ProductOrder\Model; | |||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\helpers\Price; | |||||
use common\components\ActiveRecordCommon; | use common\components\ActiveRecordCommon; | ||||
use common\logic\Config\TaxRate\TaxRate; | use common\logic\Config\TaxRate\TaxRate; | ||||
use common\logic\Order\Order\Order; | |||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Product\Product\Product; | use common\logic\Product\Product\Product; | ||||
/** | /** |