src/Flexy/ShopBundle/Entity/Order/Order.php line 50

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Order;
  3. use ApiPlatform\Core\Annotation\ApiFilter;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  6. use App\Entity\LogHistory;
  7. use App\Entity\User;
  8. use App\Flexy\ShopBundle\Entity\Accounting\Invoice;
  9. use App\Flexy\ShopBundle\Entity\Customer\Customer;
  10. use App\Flexy\ShopBundle\Entity\Payment\Payment;
  11. use App\Flexy\ShopBundle\Entity\Shipping\Shipment;
  12. use App\Flexy\ShopBundle\Entity\Customer\CustomerWalletPoint;
  13. use App\Flexy\ShopBundle\Entity\Payment\PaymentMethod;
  14. use App\Flexy\ShopBundle\Entity\Promotion\Coupon;
  15. use App\Flexy\ShopBundle\Entity\Shipping\CityRegion;
  16. use App\Flexy\ShopBundle\Entity\Resource\Agent;
  17. use App\Flexy\ShopBundle\Entity\Shipping\ShippingMethod;
  18. use App\Flexy\ShopBundle\Entity\Store\Store;
  19. use App\Flexy\ShopBundle\Entity\Vendor\Vendor;
  20. use App\Flexy\ShopBundle\Repository\Order\OrderRepository;
  21. use Doctrine\Common\Collections\ArrayCollection;
  22. use Doctrine\Common\Collections\Collection;
  23. use Doctrine\DBAL\Types\Types;
  24. use Doctrine\ORM\Mapping as ORM;
  25. use Doctrine\ORM\Mapping\Entity;
  26. use Doctrine\ORM\Mapping\InheritanceType;
  27. use Gedmo\Mapping\Annotation as Gedmo;
  28. use Symfony\Component\Serializer\Annotation\Groups;
  29. use Symfony\Component\Validator\Constraints as Assert;
  30. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  31. #[ApiResource(
  32.     normalizationContext: ['groups' => ['read']],
  33.     denormalizationContext: ['groups' => ['write']],
  34. )]
  35. #[ApiFilter(SearchFilter::class, properties: ['status' => 'exact','customer'=>'exact'])]
  36. #[ORM\Table(name'`order`')]
  37. #[ORM\Entity(repositoryClassOrderRepository::class)]
  38. #[InheritanceType('JOINED')]
  39. #[Gedmo\SoftDeleteable(fieldName'deletedAt'timeAwarefalsehardDeletetrue)]
  40. #[Gedmo\Loggable(logEntryClass:LogHistory::class)]
  41. #[UniqueEntity(
  42.     fields: ['reference'],
  43.     errorPath'reference',
  44.     message'This reference is already exist.',
  45. )]
  46. class Order implements \Stringable
  47. {
  48.     #[ORM\Id]
  49.     #[ORM\GeneratedValue]
  50.     #[ORM\Column(type'integer')]
  51.     #[Groups(['read'])]
  52.     private $id;
  53.   
  54.     
  55.     #[Groups(['read'])]
  56.     #[ORM\Column(type'datetime'nullabletrue)]
  57.     private ?\DateTime $createdAt null;
  58.     #[Groups(['read','write'])]
  59.     #[ORM\Column(type'text'nullabletrue)]
  60.     #[Gedmo\Versioned]
  61.     private ?string $description null;
  62.     #[Groups(['read','write'])]
  63.     #[ORM\ManyToOne(targetEntityCustomer::class, inversedBy'orders'cascade: ['persist'])]
  64.     #[Assert\Valid]
  65.     #[Gedmo\Versioned]
  66.     private ?\App\Flexy\ShopBundle\Entity\Customer\Customer $customer null;
  67.     #[Groups(['read','write'])]
  68.     #[ORM\OneToMany(targetEntityOrderItem::class, mappedBy'parentOrder'cascade: ['persist''remove'])]
  69.     #[Assert\Valid]
  70.     
  71.     private \Doctrine\Common\Collections\Collection|array $orderItems;
  72.     
  73.     #[ORM\OneToMany(targetEntityAdjustment::class, mappedBy'parentOrder')]
  74.     private \Doctrine\Common\Collections\Collection|array $adjustments;
  75.     #[ORM\Column(type'string'length255nullabletrue)]
  76.     #[Groups(['read','write'])]
  77.     private ?string $firstName null;
  78.     #[ORM\Column(type'string'length255nullabletrue)]
  79.     #[Groups(['read','write'])]
  80.     private ?string $lastName null;
  81.     #[ORM\Column(type'string'length255nullabletrue)]
  82.     #[Groups(['read','write'])]
  83.     private ?string $companyName null;
  84.     #[ORM\Column(type'string'length255nullabletrue)]
  85.     #[Groups(['read','write'])]
  86.     private ?string $address null;
  87.     #[ORM\Column(type'string'length255nullabletrue)]
  88.     #[Groups(['read','write'])]
  89.     private ?string $city null;
  90.     #[ORM\Column(type'string'length255nullabletrue)]
  91.     #[Groups(['read','write'])]
  92.     private ?string $country null;
  93.     #[ORM\Column(type'string'length255nullabletrue)]
  94.     private ?string $department null;
  95.     #[ORM\Column(type'string'length255nullabletrue)]
  96.     private ?string $postcode null;
  97.     #[ORM\Column(type'string'length255nullabletrue)]
  98.     #[Groups(['read','write'])]
  99.     private ?string $email null;
  100.     #[ORM\Column(type'string'length255nullabletrue)]
  101.     #[Groups(['read','write'])]
  102.     private ?string $tel null;
  103.     #[ORM\Column(type'text'nullabletrue)]
  104.     private ?string $comment null;
  105.     #[ORM\ManyToOne(targetEntityDemandeFund::class, inversedBy'orders')]
  106.     private ?\App\Flexy\ShopBundle\Entity\Order\DemandeFund $demandeFund null;
  107.     #[Groups(['read','write'])]
  108.     #[ORM\Column(type'string'length255nullabletrue)]
  109.     #[Gedmo\Versioned]
  110.     private ?string $status "draft";
  111.     
  112.     #[ORM\Column(type'string'length255nullabletrue)]
  113.     private ?string $source null;
  114.     #[ORM\Column(type'text'nullabletrue)]
  115.     private $deliveryAt;
  116.     #[ORM\Column(type'text'nullabletrue)]
  117.     private $recoveryAt;
  118.     #[ORM\Column(type'string'length255nullabletrue)]
  119.     private ?string $oldOrderNumber null;
  120.     #[ORM\Column(type'float'nullabletrue)]
  121.     private ?float $reduction null;
  122.     #[ORM\Column(type'float'nullabletrue)]
  123.     private $distance 0;
  124.     #[ORM\ManyToOne(targetEntityShippingMethod::class, inversedBy'orders'cascade: ['persist'])]
  125.     #[Groups(['read','write'])]
  126.     #[Gedmo\Versioned]
  127.     private ?\App\Flexy\ShopBundle\Entity\Shipping\ShippingMethod $shippingMethod null;
  128.     #[ORM\ManyToOne(targetEntityAgent::class, inversedBy'orders')]
  129.     #[Groups(['read','write'])]
  130.     #[Gedmo\Versioned]
  131.     private ?\App\Flexy\ShopBundle\Entity\Resource\Agent $agent null;
  132.     #[Groups(['read','write'])]
  133.     #[ORM\ManyToOne(targetEntitypaymentMethod::class, inversedBy'orders'cascade: ['persist'])]
  134.     #[ORM\JoinColumn(nullabletrueonDelete'CASCADE')]
  135.     
  136.     private ?\App\Flexy\ShopBundle\Entity\Payment\PaymentMethod $paymentMethod null;
  137.     #[ORM\Column(type'float'nullabletrue)]
  138.     #[Groups(['read','write'])]
  139.     #[Gedmo\Versioned]
  140.     private ?float $payedAmount null;
  141.     #[ORM\Column(type'datetime'nullabletrue)]
  142.     #[Groups(['read','write'])]
  143.     #[Gedmo\Versioned]
  144.     private ?\DateTimeInterface $startProcessingAt null;
  145.     #[ORM\Column(type'string'length255nullabletrue)]
  146.     private ?string $deliveryType null;
  147.     #[ORM\Column(type'datetime'nullabletrue)]
  148.     #[Groups(['read','write'])]
  149.     #[Gedmo\Versioned]
  150.     private ?\DateTimeInterface $startDeliveryAt null;
  151.     #[ORM\OneToMany(targetEntityCustomerWalletPoint::class, mappedBy'originOrder')]
  152.     private \Doctrine\Common\Collections\Collection|array $customerWalletPoints;
  153.     #[ORM\ManyToOne(targetEntityCoupon::class, inversedBy'orders')]
  154.     #[Groups(['read','write'])]
  155.     private ?\App\Flexy\ShopBundle\Entity\Promotion\Coupon $coupon null;
  156.     #[ORM\ManyToOne(targetEntityAgent::class, inversedBy'ordersToDolist')]
  157.     private ?\App\Flexy\ShopBundle\Entity\Resource\Agent $agentToDo null;
  158.     #[ORM\Column(type'boolean'nullabletrue)]
  159.     private ?bool $isToDo null;
  160.     #[ORM\ManyToOne(targetEntityCityRegion::class, inversedBy'orders')]
  161.     private ?\App\Flexy\ShopBundle\Entity\Shipping\CityRegion $cityRegionShipping null;
  162.     #[ORM\ManyToOne(targetEntityCityRegion::class, inversedBy'collectedOrders')]
  163.     private $cityRegionCollect;
  164.     #[ORM\ManyToOne(targetEntityVendor::class, inversedBy'orders')]
  165.     private ?\App\Flexy\ShopBundle\Entity\Vendor\Vendor $vendor null;
  166.     #[ORM\Column(type'text'nullabletrue)]
  167.     #[Groups(['read','write'])]
  168.     private ?string $collectAddress null;
  169.     #[ORM\Column(type'text'nullabletrue)]
  170.     #[Groups(['read','write'])]
  171.     private ?string $shippingAddress null;
  172.     #[ORM\Column(type'string'length255nullabletrue)]
  173.     #[Groups(['read','write'])]
  174.     private ?string $collectTel null;
  175.     #[ORM\Column(type'boolean'nullabletrue)]
  176.     #[Groups(['read','write'])]
  177.     private ?bool $isHeavy null;
  178.     #[ORM\Column(type'float'nullabletrue)]
  179.     private $shippingTips 0;
  180.      #[ORM\Column(type'float'nullabletrue)]
  181.     private $walletPaymentAmount 0;
  182.     #[ORM\Column(type'boolean'nullabletrue)]
  183.     private $isChecked;
  184.     #[ORM\Column(type'string'length255nullabletrue)]
  185.     private $tokenStripe;
  186.     #[ORM\Column(length255nullabletrue)]
  187.     private ?string $orderType "order";
  188.     #[ORM\Column(nullabletrue)]
  189.     private ?\DateTimeImmutable $deletedAt null;
  190.     #[ORM\ManyToOne(inversedBy'orders')]
  191.     private ?Store $store null;
  192.     #[ORM\OneToOne(inversedBy'relatedOrder'cascade: ['persist''remove'])]
  193.     private ?Shipment $shipment null;
  194.     #[ORM\ManyToOne(inversedBy'orders')]
  195.     private ?Invoice $invoice null;
  196.     #[ORM\Column(typeTypes::STRING,nullabletrue)]
  197.     #[Gedmo\Blameable(on'create')]
  198.     private $createdBy;
  199.     #[ORM\OneToMany(mappedBy'relatedOrder'targetEntityPayment::class,cascade:["persist"])]
  200.     private Collection $payments;
  201.     #[ORM\Column(length255nullabletrue,unique:true)]
  202.     private ?string $reference null;
  203.     #[ORM\ManyToOne(inversedBy'orders',cascade:["persist"])]
  204.     #[ORM\JoinColumn(name"cash_box_order_id"referencedColumnName"id"onDelete"SET NULL")]
  205.     private ?CashBoxOrder $cashBoxOrder null;
  206.     #[ORM\Column(nullabletrue)]
  207.     private ?bool $is_multiclub null;
  208.     public function __construct()
  209.     {
  210.         $this->orderItems = new ArrayCollection();
  211.         $this->adjustments = new ArrayCollection();
  212.         $this->createdAt = new \DateTime();
  213.         $this->customerWalletPoints = new ArrayCollection();
  214.         $this->payments = new ArrayCollection();
  215.         
  216.     }
  217.    
  218.     public function __toString(): string
  219.     {
  220.         return $this->getOrderNumber();
  221.     }
  222.     public function getId(): ?int
  223.     {
  224.         return $this->id;
  225.     }
  226.     #[Groups(['read'])]
  227.     public function getOrderNumber($secondaryPrefix=null)
  228.     {
  229.         $prefix "";
  230.         
  231.         $orderNumber $prefix.$this->createdAt->format("ym").str_pad((string) $this->id5"0"STR_PAD_LEFT);
  232.         if($secondaryPrefix){
  233.             $orderNumber $prefix.$this->createdAt->format("ym").str_pad((string) $this->id5"0"STR_PAD_LEFT)."-".$secondaryPrefix;
  234.         }
  235.         if($this->reference){
  236.             return $this->reference;
  237.         }
  238.         return $orderNumber;
  239.     }
  240.     #[Groups(['read'])]
  241.     public function getIdPrefixed()
  242.     {
  243.         return $this->getOrderNumber();
  244.     }
  245.     public function getCreatedAt(): ?\DateTime
  246.     {
  247.         return $this->createdAt;
  248.     }
  249.     public function setCreatedAt(?\DateTime $createdAt): self
  250.     {
  251.         $this->createdAt $createdAt;
  252.         return $this;
  253.     }
  254.     public function getCashBoxOrderStartAt(): ?\DateTime
  255.     {
  256.             return $this->cashBoxOrder $this->cashBoxOrder->getStartAt() : null;
  257.     }
  258.      public function getCashBoxOrderEndAt(): ?\DateTime
  259.     {
  260.             return $this->cashBoxOrder $this->cashBoxOrder->getEndAt() : null;
  261.     }
  262.     public function getCustomer(): ?Customer
  263.     {
  264.         return $this->customer;
  265.     }
  266.     public function setCustomer(?Customer $customer): self
  267.     {
  268.         $this->customer $customer;
  269.         return $this;
  270.     }
  271.     public function getCategoriesProduct(){
  272.         $categories = [];
  273.         foreach($this->getOrderItems() as $singleOrderItem){
  274.             if($singleOrderItem->getProduct()){
  275.                 if($singleOrderItem->getProduct()->getParentCategory()){
  276.                     $categories[] = $singleOrderItem->getProduct()->getParentCategory()->getName();
  277.                 }
  278.                 
  279.             }
  280.         }
  281.         return $categories;
  282.     }
  283.     public function getSubCategoriesProduct(){
  284.         $categories = [];
  285.         foreach($this->getOrderItems() as $singleOrderItem){
  286.             if($singleOrderItem->getProduct()){
  287.                 foreach($singleOrderItem->getProduct()->getCategoriesProduct() as $singleCategory){
  288.                     if(!in_array($singleCategory->getName(),$categories)){
  289.                         $categories[] = $singleCategory->getName();
  290.                     }
  291.                     
  292.                 }
  293.                 
  294.             }
  295.         }
  296.         return $categories;
  297.     }
  298.     /**
  299.      * @return Collection|OrderItem[]
  300.      */
  301.     public function getOrderItems(): Collection
  302.     {
  303.         return $this->orderItems;
  304.     }
  305.     public function addOrderItem(OrderItem $orderItem): self
  306.     {
  307.         if (!$this->orderItems->contains($orderItem)) {
  308.             $this->orderItems[] = $orderItem;
  309.             $orderItem->setParentOrder($this);
  310.         }
  311.         return $this;
  312.     }
  313.     public function removeOrderItem(OrderItem $orderItem): self
  314.     {
  315.         if ($this->orderItems->removeElement($orderItem)) {
  316.             // set the owning side to null (unless already changed)
  317.             if ($orderItem->getParentOrder() === $this) {
  318.                 $orderItem->setParentOrder(null);
  319.             }
  320.         }
  321.         return $this;
  322.     }
  323.     /**
  324.      * @return Collection|Adjustment[]
  325.      */
  326.     public function getAdjustments(): Collection
  327.     {
  328.         return $this->adjustments;
  329.     }
  330.     public function addAdjustment(Adjustment $adjustment): self
  331.     {
  332.         if (!$this->adjustments->contains($adjustment)) {
  333.             $this->adjustments[] = $adjustment;
  334.             $adjustment->setParentOrder($this);
  335.         }
  336.         return $this;
  337.     }
  338.     public function removeAdjustment(Adjustment $adjustment): self
  339.     {
  340.         if ($this->adjustments->removeElement($adjustment)) {
  341.             // set the owning side to null (unless already changed)
  342.             if ($adjustment->getParentOrder() === $this) {
  343.                 $adjustment->setParentOrder(null);
  344.             }
  345.         }
  346.         return $this;
  347.     }
  348.     public function getReductionOnCoupon(){
  349.         $reductionCoupon=0;
  350.         if($this->getCoupon()){
  351.             if($this->getCoupon()->getTypeReduction()=="percent"){
  352.                 $reductionCoupon = ($this->getTotalAmount()/100)*$this->getCoupon()->getValueReduction();
  353.             }else{
  354.                 $reductionCoupon $this->getCoupon()->getValueReduction();
  355.             }
  356.         }
  357.         return  $reductionCoupon;
  358.     }
  359.     public function getFirstName(): ?string
  360.     {
  361.         return $this->firstName;
  362.     }
  363.     public function setFirstName(string $firstName): self
  364.     {
  365.         $this->firstName $firstName;
  366.         return $this;
  367.     }
  368.     public function getLastName(): ?string
  369.     {
  370.         return $this->lastName;
  371.     }
  372.     public function setLastName(string $lastName): self
  373.     {
  374.         $this->lastName $lastName;
  375.         return $this;
  376.     }
  377.     public function getCompanyName(): ?string
  378.     {
  379.         return $this->companyName;
  380.     }
  381.     public function setCompanyName(?string $companyName): self
  382.     {
  383.         $this->companyName $companyName;
  384.         return $this;
  385.     }
  386.     public function getAddress(): ?string
  387.     {
  388.         return $this->address;
  389.     }
  390.     public function setAddress(string $address): self
  391.     {
  392.         $this->address $address;
  393.         return $this;
  394.     }
  395.     public function getCity(): ?string
  396.     {
  397.         return $this->city;
  398.     }
  399.     public function setCity(string $city): self
  400.     {
  401.         $this->city $city;
  402.         return $this;
  403.     }
  404.     public function getCountry(): ?string
  405.     {
  406.         return $this->country;
  407.     }
  408.     public function setCountry(string $country): self
  409.     {
  410.         $this->country $country;
  411.         return $this;
  412.     }
  413.     public function getDepartment(): ?string
  414.     {
  415.         return $this->department;
  416.     }
  417.     public function setDepartment(?string $department): self
  418.     {
  419.         $this->department $department;
  420.         return $this;
  421.     }
  422.     public function getPostcode(): ?string
  423.     {
  424.         return $this->postcode;
  425.     }
  426.     public function setPostcode(?string $postcode): self
  427.     {
  428.         $this->postcode $postcode;
  429.         return $this;
  430.     }
  431.     public function getEmail(): ?string
  432.     {
  433.         return $this->email;
  434.     }
  435.     public function setEmail(string $email): self
  436.     {
  437.         $this->email $email;
  438.         return $this;
  439.     }
  440.     public function getTel(): ?string
  441.     {
  442.         return $this->tel;
  443.     }
  444.     public function setTel(string $tel): self
  445.     {
  446.         $this->tel $tel;
  447.         return $this;
  448.     }
  449.     public function getComment(): ?string
  450.     {
  451.         return $this->comment;
  452.     }
  453.     public function setComment(?string $comment): self
  454.     {
  455.         $this->comment $comment;
  456.         return $this;
  457.     }
  458.   
  459.     #[Groups(['read'])]
  460.     public function getTotalAmount(){
  461.         $total=0;
  462.         foreach($this->orderItems as $singleOrderItem){
  463.             $total $total + ($singleOrderItem->getTotalAmount());
  464.         }
  465.         return $total;
  466.         
  467.     }
  468.     //needs optimisation
  469.     #[Groups(['read'])]
  470.     public function getShippingFees(){
  471.         $fees 0;
  472.         if($this->getShippingMethod()){
  473.             if($this->getShippingMethod()->isIsSeparatelyCalculated()){
  474.                 $fees $this->getShippingMethod()->getPrice();
  475.             
  476.                 foreach($this->getShippingMethod()->getShippingRules() as $shippingRule){
  477.     
  478.     
  479.                     if($shippingRule->getTypeCalculation() == "distance"){
  480.                         if( $shippingRule->getMin() < $this->getDistance()  and   $shippingRule->getMax() >= $this->getDistance() ){
  481.                             $fees =  $this->getDistance() * $shippingRule->getValueCalculation();
  482.     
  483.                             /*Condition for TLCS may be it works for all people*/
  484.                             if ($fees $this->getShippingMethod()->getPrice()){
  485.                                 $fees $this->getShippingMethod()->getPrice();
  486.                             }
  487.                             /*Condition for TLCS may be it works for all people*/
  488.                         }
  489.                         
  490.                     }
  491.                         else{
  492.                             if(
  493.                             $shippingRule->getMin() < $this->getTotalAmount() and $shippingRule->getMax() >=  $this->getTotalAmount()
  494.                             
  495.                             ){
  496.                                 if($shippingRule->getTypeCalculation() == "percent"){
  497.                                     $fees = ($this->getTotalAmount() / 100 ) * $shippingRule->getValueCalculation();
  498.                                 }
  499.                                 else{
  500.                                     $fees =  $shippingRule->getValueCalculation();
  501.                                 }
  502.                             }
  503.                         
  504.                     }
  505.     
  506.                     
  507.                 }
  508.             }
  509.             
  510.         }
  511.     
  512.         
  513.         
  514.         return $fees;
  515.     }
  516.     #[Groups(['read'])]
  517.     public function getTotalReduction(){
  518.         $total=0;
  519.         
  520.         foreach($this->orderItems as $singleOrderItem){
  521.             $total $total + ($singleOrderItem->getReduction());
  522.         }
  523.         return $total;
  524.     }
  525.     public function getReductionOnTotal(){
  526.         $reductionAmount 0;
  527.         
  528.         if($this->getReduction() and $this->getReduction()>0){
  529.             $reductionAmount = ($this->getTotalAmount() / 100) * $this->getReduction();
  530.         }
  531.         return $reductionAmount;
  532.     }
  533.     #[Groups(['read'])]
  534.     public function getAmountPayedByCredit(){
  535.         $total=0;
  536.         foreach($this->getCustomerWalletPoints() as $singleWalletPoints){
  537.             if($singleWalletPoints->getPoints()<0){
  538.                 $total $total + ($singleWalletPoints->getPoints());
  539.             }
  540.             
  541.         }
  542.         return $total;
  543.     }
  544.     #[Groups(['read'])]
  545.     public function getAmountEarnedAsCredit(){
  546.         $total=0;
  547.         foreach($this->getCustomerWalletPoints() as $singleWalletPoints){
  548.             if($singleWalletPoints->getPoints()>0){
  549.                 $total $total + ($singleWalletPoints->getPoints());
  550.             }
  551.             
  552.         }
  553.         return $total;
  554.     }
  555.     public function getDemandeFund(): ?DemandeFund
  556.     {
  557.         return $this->demandeFund;
  558.     }
  559.     public function setDemandeFund(?DemandeFund $demandeFund): self
  560.     {
  561.         $this->demandeFund $demandeFund;
  562.         return $this;
  563.     }
  564.     public function getStatus(): ?string
  565.     {
  566.         $status "order_finance_verification_pending";
  567.         if($this->status)
  568.         {
  569.             $status $this->status;
  570.         }
  571.         return $status;
  572.     }
  573.     public function setStatus(?string $status): self
  574.     {
  575.         $this->status $status;
  576.         return $this;
  577.     }
  578.     // BySamir : TO CLEAN
  579.  
  580.     public function getSource(): ?string
  581.     {
  582.         return $this->source;
  583.     }
  584.     public function setSource(?string $source): self
  585.     {
  586.         $this->source $source;
  587.         return $this;
  588.     }
  589.     public function getDeliveryAt()
  590.     {
  591.         return $this->deliveryAt;
  592.     }
  593.     public function setDeliveryAt($deliveryAt)
  594.     {
  595.         $this->deliveryAt $deliveryAt;
  596.         return $this;
  597.     }
  598.     public function getRecoveryAt()
  599.     {
  600.         return $this->recoveryAt;
  601.     }
  602.     public function setRecoveryAt($recoveryAt)
  603.     {
  604.         $this->recoveryAt $recoveryAt;
  605.         return $this;
  606.     }
  607.     public function getReduction(): ?float
  608.     {
  609.         return $this->reduction;
  610.     }
  611.     public function setReduction(?float $reduction): self
  612.     {
  613.         $this->reduction $reduction;
  614.         return $this;
  615.     }
  616.     public function getShippingMethod(): ?ShippingMethod
  617.     {
  618.         return $this->shippingMethod;
  619.     }
  620.     public function setShippingMethod(?ShippingMethod $shippingMethod): self
  621.     {
  622.         $this->shippingMethod $shippingMethod;
  623.         return $this;
  624.     }
  625.     public function getAgent(): ?Agent
  626.     {
  627.         return $this->agent;
  628.     }
  629.     public function setAgent(?Agent $agent): self
  630.     {
  631.         $this->agent $agent;
  632.         return $this;
  633.     }
  634.     public function getPaymentMethod(): ?paymentMethod
  635.     {
  636.         return $this->paymentMethod;
  637.     }
  638.     public function setPaymentMethod(?paymentMethod $paymentMethod): self
  639.     {
  640.         $this->paymentMethod $paymentMethod;
  641.         return $this;
  642.     }
  643.     public function getPayedAmount(): ?float
  644.     {
  645.         return $this->payedAmount;
  646.     }
  647.     public function setPayedAmount(?float $payedAmount): self
  648.     {
  649.         $this->payedAmount $payedAmount;
  650.         return $this;
  651.     }
  652.     public function getStartProcessingAt(): ?\DateTimeInterface
  653.     {
  654.         return $this->startProcessingAt;
  655.     }
  656.     public function setStartProcessingAt(?\DateTimeInterface $startProcessingAt): self
  657.     {
  658.         $this->startProcessingAt $startProcessingAt;
  659.         return $this;
  660.     }
  661.     public function getDeliveryType(): ?string
  662.     {
  663.         return $this->deliveryType;
  664.     }
  665.     public function setDeliveryType(?string $deliveryType): self
  666.     {
  667.         $this->deliveryType $deliveryType;
  668.         return $this;
  669.     }
  670.     public function getStartDeliveryAt(): ?\DateTimeInterface
  671.     {
  672.         return $this->startDeliveryAt;
  673.     }
  674.     public function setStartDeliveryAt(?\DateTimeInterface $startDeliveryAt): self
  675.     {
  676.         $this->startDeliveryAt $startDeliveryAt;
  677.         return $this;
  678.     }
  679.     /**
  680.      * @return Collection<int, CustomerWalletPoint>
  681.      */
  682.     public function getCustomerWalletPoints(): Collection
  683.     {
  684.         return $this->customerWalletPoints;
  685.     }
  686.     public function addCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  687.     {
  688.         if (!$this->customerWalletPoints->contains($customerWalletPoint)) {
  689.             $this->customerWalletPoints[] = $customerWalletPoint;
  690.             $customerWalletPoint->setOriginOrder($this);
  691.         }
  692.         return $this;
  693.     }
  694.     public function removeCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  695.     {
  696.         if ($this->customerWalletPoints->removeElement($customerWalletPoint)) {
  697.             // set the owning side to null (unless already changed)
  698.             if ($customerWalletPoint->getOriginOrder() === $this) {
  699.                 $customerWalletPoint->setOriginOrder(null);
  700.             }
  701.         }
  702.         return $this;
  703.     }
  704.     public function getCoupon(): ?Coupon
  705.     {
  706.         return $this->coupon;
  707.     }
  708.     public function setCoupon(?Coupon $coupon): self
  709.     {
  710.         $this->coupon $coupon;
  711.         return $this;
  712.     }
  713.     public function getAgentToDo(): ?Agent
  714.     {
  715.         return $this->agentToDo;
  716.     }
  717.     public function setAgentToDo(?Agent $agentToDo): self
  718.     {
  719.         $this->agentToDo $agentToDo;
  720.         return $this;
  721.     }
  722.     public function getIsToDo(): ?bool
  723.     {
  724.         return $this->isToDo;
  725.     }
  726.     public function setIsToDo(?bool $isToDo): self
  727.     {
  728.         $this->isToDo $isToDo;
  729.         return $this;
  730.     }
  731.     public function getCityRegionShipping(): ?CityRegion
  732.     {
  733.         return $this->cityRegionShipping;
  734.     }
  735.     public function setCityRegionShipping(?CityRegion $cityRegionShipping): self
  736.     {
  737.         $this->cityRegionShipping $cityRegionShipping;
  738.         return $this;
  739.     }
  740.     public function getVendor(): ?Vendor
  741.     {
  742.         return $this->vendor;
  743.     }
  744.     public function setVendor(?Vendor $vendor): self
  745.     {
  746.         $this->vendor $vendor;
  747.         return $this;
  748.     }
  749.     public function getCollectAddress(): ?string
  750.     {
  751.         return $this->collectAddress;
  752.     }
  753.     public function setCollectAddress(?string $collectAddress): self
  754.     {
  755.         $this->collectAddress $collectAddress;
  756.         return $this;
  757.     }
  758.     public function getCollectTel(): ?string
  759.     {
  760.         return $this->collectTel;
  761.     }
  762.     public function setCollectTel(?string $collectTel): self
  763.     {
  764.         $this->collectTel $collectTel;
  765.         return $this;
  766.     }
  767.     public function getIsHeavy(): ?bool
  768.     {
  769.         return $this->isHeavy;
  770.     }
  771.     public function setIsHeavy(?bool $isHeavy): self
  772.     {
  773.         $this->isHeavy $isHeavy;
  774.         return $this;
  775.     }
  776.     public function getShippingTips(): ?float
  777.     {
  778.         return $this->shippingTips;
  779.     }
  780.     public function setShippingTips(?float $shippingTips): self
  781.     {
  782.         $this->shippingTips $shippingTips;
  783.         return $this;
  784.     }
  785.  
  786.     
  787.     /**
  788.      * Get the value of isChecked
  789.      */ 
  790.     public function getIsChecked()
  791.     {
  792.         return $this->isChecked;
  793.     }
  794.     /**
  795.      * Set the value of isChecked
  796.      *
  797.      * @return  self
  798.      */ 
  799.     public function setIsChecked($isChecked)
  800.     {
  801.         $this->isChecked $isChecked;
  802.         return $this;
  803.     }
  804.     /**
  805.      * Get the value of walletPaymentAmount
  806.      */ 
  807.     public function getWalletPaymentAmount()
  808.     {
  809.         return $this->walletPaymentAmount;
  810.     }
  811.     /**
  812.      * Set the value of walletPaymentAmount
  813.      *
  814.      * @return  self
  815.      */ 
  816.     public function setWalletPaymentAmount($walletPaymentAmount)
  817.     {
  818.         $this->walletPaymentAmount $walletPaymentAmount;
  819.         return $this;
  820.     }
  821.     /**
  822.      * Get the value of cityRegionCollect
  823.      */ 
  824.     public function getCityRegionCollect()
  825.     {
  826.         return $this->cityRegionCollect;
  827.     }
  828.     /**
  829.      * Set the value of cityRegionCollect
  830.      *
  831.      * @return  self
  832.      */ 
  833.     public function setCityRegionCollect($cityRegionCollect)
  834.     {
  835.         $this->cityRegionCollect $cityRegionCollect;
  836.         return $this;
  837.     }
  838.     /**
  839.      * Get the value of distance
  840.      */ 
  841.     public function getDistance()
  842.     {
  843.         return $this->distance;
  844.     }
  845.     /**
  846.      * Set the value of distance
  847.      *
  848.      * @return  self
  849.      */ 
  850.     public function setDistance($distance)
  851.     {
  852.         $this->distance $distance;
  853.         return $this;
  854.     }
  855.     /**
  856.      * Get the value of tokenStripe
  857.      */ 
  858.     public function getTokenStripe()
  859.     {
  860.         return $this->tokenStripe;
  861.     }
  862.     /**
  863.      * Set the value of tokenStripe
  864.      *
  865.      * @return  self
  866.      */ 
  867.     public function setTokenStripe($tokenStripe)
  868.     {
  869.         $this->tokenStripe $tokenStripe;
  870.         return $this;
  871.     }
  872.     public function getOrderType(): ?string
  873.     {
  874.         return $this->orderType;
  875.     }
  876.     public function setOrderType(?string $orderType): self
  877.     {
  878.         $this->orderType $orderType;
  879.         return $this;
  880.     }
  881.     /**
  882.      * Get the value of deletedAt
  883.      */ 
  884.     public function getDeletedAt()
  885.     {
  886.         return $this->deletedAt;
  887.     }
  888.     /**
  889.      * Set the value of deletedAt
  890.      *
  891.      * @return  self
  892.      */ 
  893.     public function setDeletedAt($deletedAt)
  894.     {
  895.         $this->deletedAt $deletedAt;
  896.         return $this;
  897.     }
  898.     public function getStore(): ?Store
  899.     {
  900.         return $this->store;
  901.     }
  902.     public function setStore(?Store $store): self
  903.     {
  904.         $this->store $store;
  905.         return $this;
  906.     }
  907.     public function getShipment(): ?Shipment
  908.     {
  909.         return $this->shipment;
  910.     }
  911.     public function setShipment(?Shipment $shipment): self
  912.     {
  913.         $this->shipment $shipment;
  914.         return $this;
  915.     }
  916.     public function getInvoice(): ?Invoice
  917.     {
  918.         return $this->invoice;
  919.     }
  920.     public function setInvoice(?Invoice $invoice): self
  921.     {
  922.         $this->invoice $invoice;
  923.         return $this;
  924.     }
  925.     /**
  926.      * Get the value of shippingAddress
  927.      */ 
  928.     public function getShippingAddress()
  929.     {
  930.         return $this->shippingAddress;
  931.     }
  932.     /**
  933.      * Set the value of shippingAddress
  934.      *
  935.      * @return  self
  936.      */ 
  937.     public function setShippingAddress($shippingAddress)
  938.     {
  939.         $this->shippingAddress $shippingAddress;
  940.         return $this;
  941.     }
  942.     public function getCreatedBy()
  943.     {
  944.         return $this->createdBy;
  945.     }
  946.     public function getDescription(): ?string
  947.     {
  948.         return $this->description;
  949.     }
  950.     public function setDescription(?string $description): self
  951.     {
  952.         $this->description $description;
  953.         return $this;
  954.     }
  955.     /**
  956.      * @return Collection<int, Payment>
  957.      */
  958.     public function getPayments(): Collection
  959.     {
  960.         return $this->payments;
  961.     }
  962.     public function addPayment(Payment $payment): self
  963.     {
  964.         if (!$this->payments->contains($payment)) {
  965.             $this->payments->add($payment);
  966.             $payment->setRelatedOrder($this);
  967.         }
  968.         return $this;
  969.     }
  970.     public function removePayment(Payment $payment): self
  971.     {
  972.         if ($this->payments->removeElement($payment)) {
  973.             // set the owning side to null (unless already changed)
  974.             if ($payment->getRelatedOrder() === $this) {
  975.                 $payment->setRelatedOrder(null);
  976.             }
  977.         }
  978.         return $this;
  979.     }
  980.     public function getReference(): ?string
  981.     {
  982.         return $this->reference;
  983.     }
  984.     public function setReference(?string $reference): self
  985.     {
  986.         $this->reference $reference;
  987.         return $this;
  988.     }
  989.     public function getCashBoxOrder(): ?CashBoxOrder
  990.     {
  991.         return $this->cashBoxOrder;
  992.     }
  993.     public function setCashBoxOrder(?CashBoxOrder $cashBoxOrder): self
  994.     {
  995.         $this->cashBoxOrder $cashBoxOrder;
  996.         return $this;
  997.     }
  998.     public function isIsMulticlub(): ?bool
  999.     {
  1000.         return $this->is_multiclub;
  1001.     }
  1002.     public function setIsMulticlub(?bool $is_multiclub): static
  1003.     {
  1004.         $this->is_multiclub $is_multiclub;
  1005.         return $this;
  1006.     }
  1007. }