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.     public function __construct()
  207.     {
  208.         $this->orderItems = new ArrayCollection();
  209.         $this->adjustments = new ArrayCollection();
  210.         $this->createdAt = new \DateTime();
  211.         $this->customerWalletPoints = new ArrayCollection();
  212.         $this->payments = new ArrayCollection();
  213.         
  214.     }
  215.    
  216.     public function __toString(): string
  217.     {
  218.         return $this->getOrderNumber();
  219.     }
  220.     public function getId(): ?int
  221.     {
  222.         return $this->id;
  223.     }
  224.     #[Groups(['read'])]
  225.     public function getOrderNumber($secondaryPrefix=null)
  226.     {
  227.         $prefix "";
  228.         
  229.         $orderNumber $prefix.$this->createdAt->format("ym").str_pad((string) $this->id5"0"STR_PAD_LEFT);
  230.         if($secondaryPrefix){
  231.             $orderNumber $prefix.$this->createdAt->format("ym").str_pad((string) $this->id5"0"STR_PAD_LEFT)."-".$secondaryPrefix;
  232.         }
  233.         if($this->reference){
  234.             return $this->reference;
  235.         }
  236.         return $orderNumber;
  237.     }
  238.     #[Groups(['read'])]
  239.     public function getIdPrefixed()
  240.     {
  241.         return $this->getOrderNumber();
  242.     }
  243.     public function getCreatedAt(): ?\DateTime
  244.     {
  245.         return $this->createdAt;
  246.     }
  247.     public function setCreatedAt(?\DateTime $createdAt): self
  248.     {
  249.         $this->createdAt $createdAt;
  250.         return $this;
  251.     }
  252.     public function getCashBoxOrderStartAt(): ?\DateTime
  253.     {
  254.             return $this->cashBoxOrder $this->cashBoxOrder->getStartAt() : null;
  255.     }
  256.      public function getCashBoxOrderEndAt(): ?\DateTime
  257.     {
  258.             return $this->cashBoxOrder $this->cashBoxOrder->getEndAt() : null;
  259.     }
  260.     public function getCustomer(): ?Customer
  261.     {
  262.         return $this->customer;
  263.     }
  264.     public function setCustomer(?Customer $customer): self
  265.     {
  266.         $this->customer $customer;
  267.         return $this;
  268.     }
  269.     public function getCategoriesProduct(){
  270.         $categories = [];
  271.         foreach($this->getOrderItems() as $singleOrderItem){
  272.             if($singleOrderItem->getProduct()){
  273.                 if($singleOrderItem->getProduct()->getParentCategory()){
  274.                     $categories[] = $singleOrderItem->getProduct()->getParentCategory()->getName();
  275.                 }
  276.                 
  277.             }
  278.         }
  279.         return $categories;
  280.     }
  281.     public function getSubCategoriesProduct(){
  282.         $categories = [];
  283.         foreach($this->getOrderItems() as $singleOrderItem){
  284.             if($singleOrderItem->getProduct()){
  285.                 foreach($singleOrderItem->getProduct()->getCategoriesProduct() as $singleCategory){
  286.                     if(!in_array($singleCategory->getName(),$categories)){
  287.                         $categories[] = $singleCategory->getName();
  288.                     }
  289.                     
  290.                 }
  291.                 
  292.             }
  293.         }
  294.         return $categories;
  295.     }
  296.     /**
  297.      * @return Collection|OrderItem[]
  298.      */
  299.     public function getOrderItems(): Collection
  300.     {
  301.         return $this->orderItems;
  302.     }
  303.     public function addOrderItem(OrderItem $orderItem): self
  304.     {
  305.         if (!$this->orderItems->contains($orderItem)) {
  306.             $this->orderItems[] = $orderItem;
  307.             $orderItem->setParentOrder($this);
  308.         }
  309.         return $this;
  310.     }
  311.     public function removeOrderItem(OrderItem $orderItem): self
  312.     {
  313.         if ($this->orderItems->removeElement($orderItem)) {
  314.             // set the owning side to null (unless already changed)
  315.             if ($orderItem->getParentOrder() === $this) {
  316.                 $orderItem->setParentOrder(null);
  317.             }
  318.         }
  319.         return $this;
  320.     }
  321.     /**
  322.      * @return Collection|Adjustment[]
  323.      */
  324.     public function getAdjustments(): Collection
  325.     {
  326.         return $this->adjustments;
  327.     }
  328.     public function addAdjustment(Adjustment $adjustment): self
  329.     {
  330.         if (!$this->adjustments->contains($adjustment)) {
  331.             $this->adjustments[] = $adjustment;
  332.             $adjustment->setParentOrder($this);
  333.         }
  334.         return $this;
  335.     }
  336.     public function removeAdjustment(Adjustment $adjustment): self
  337.     {
  338.         if ($this->adjustments->removeElement($adjustment)) {
  339.             // set the owning side to null (unless already changed)
  340.             if ($adjustment->getParentOrder() === $this) {
  341.                 $adjustment->setParentOrder(null);
  342.             }
  343.         }
  344.         return $this;
  345.     }
  346.     public function getReductionOnCoupon(){
  347.         $reductionCoupon=0;
  348.         if($this->getCoupon()){
  349.             if($this->getCoupon()->getTypeReduction()=="percent"){
  350.                 $reductionCoupon = ($this->getTotalAmount()/100)*$this->getCoupon()->getValueReduction();
  351.             }else{
  352.                 $reductionCoupon $this->getCoupon()->getValueReduction();
  353.             }
  354.         }
  355.         return  $reductionCoupon;
  356.     }
  357.     public function getFirstName(): ?string
  358.     {
  359.         return $this->firstName;
  360.     }
  361.     public function setFirstName(string $firstName): self
  362.     {
  363.         $this->firstName $firstName;
  364.         return $this;
  365.     }
  366.     public function getLastName(): ?string
  367.     {
  368.         return $this->lastName;
  369.     }
  370.     public function setLastName(string $lastName): self
  371.     {
  372.         $this->lastName $lastName;
  373.         return $this;
  374.     }
  375.     public function getCompanyName(): ?string
  376.     {
  377.         return $this->companyName;
  378.     }
  379.     public function setCompanyName(?string $companyName): self
  380.     {
  381.         $this->companyName $companyName;
  382.         return $this;
  383.     }
  384.     public function getAddress(): ?string
  385.     {
  386.         return $this->address;
  387.     }
  388.     public function setAddress(string $address): self
  389.     {
  390.         $this->address $address;
  391.         return $this;
  392.     }
  393.     public function getCity(): ?string
  394.     {
  395.         return $this->city;
  396.     }
  397.     public function setCity(string $city): self
  398.     {
  399.         $this->city $city;
  400.         return $this;
  401.     }
  402.     public function getCountry(): ?string
  403.     {
  404.         return $this->country;
  405.     }
  406.     public function setCountry(string $country): self
  407.     {
  408.         $this->country $country;
  409.         return $this;
  410.     }
  411.     public function getDepartment(): ?string
  412.     {
  413.         return $this->department;
  414.     }
  415.     public function setDepartment(?string $department): self
  416.     {
  417.         $this->department $department;
  418.         return $this;
  419.     }
  420.     public function getPostcode(): ?string
  421.     {
  422.         return $this->postcode;
  423.     }
  424.     public function setPostcode(?string $postcode): self
  425.     {
  426.         $this->postcode $postcode;
  427.         return $this;
  428.     }
  429.     public function getEmail(): ?string
  430.     {
  431.         return $this->email;
  432.     }
  433.     public function setEmail(string $email): self
  434.     {
  435.         $this->email $email;
  436.         return $this;
  437.     }
  438.     public function getTel(): ?string
  439.     {
  440.         return $this->tel;
  441.     }
  442.     public function setTel(string $tel): self
  443.     {
  444.         $this->tel $tel;
  445.         return $this;
  446.     }
  447.     public function getComment(): ?string
  448.     {
  449.         return $this->comment;
  450.     }
  451.     public function setComment(?string $comment): self
  452.     {
  453.         $this->comment $comment;
  454.         return $this;
  455.     }
  456.   
  457.     #[Groups(['read'])]
  458.     public function getTotalAmount(){
  459.         $total=0;
  460.         foreach($this->orderItems as $singleOrderItem){
  461.             $total $total + ($singleOrderItem->getTotalAmount());
  462.         }
  463.         return $total;
  464.         
  465.     }
  466.     //needs optimisation
  467.     #[Groups(['read'])]
  468.     public function getShippingFees(){
  469.         $fees 0;
  470.         if($this->getShippingMethod()){
  471.             if($this->getShippingMethod()->isIsSeparatelyCalculated()){
  472.                 $fees $this->getShippingMethod()->getPrice();
  473.             
  474.                 foreach($this->getShippingMethod()->getShippingRules() as $shippingRule){
  475.     
  476.     
  477.                     if($shippingRule->getTypeCalculation() == "distance"){
  478.                         if( $shippingRule->getMin() < $this->getDistance()  and   $shippingRule->getMax() >= $this->getDistance() ){
  479.                             $fees =  $this->getDistance() * $shippingRule->getValueCalculation();
  480.     
  481.                             /*Condition for TLCS may be it works for all people*/
  482.                             if ($fees $this->getShippingMethod()->getPrice()){
  483.                                 $fees $this->getShippingMethod()->getPrice();
  484.                             }
  485.                             /*Condition for TLCS may be it works for all people*/
  486.                         }
  487.                         
  488.                     }
  489.                         else{
  490.                             if(
  491.                             $shippingRule->getMin() < $this->getTotalAmount() and $shippingRule->getMax() >=  $this->getTotalAmount()
  492.                             
  493.                             ){
  494.                                 if($shippingRule->getTypeCalculation() == "percent"){
  495.                                     $fees = ($this->getTotalAmount() / 100 ) * $shippingRule->getValueCalculation();
  496.                                 }
  497.                                 else{
  498.                                     $fees =  $shippingRule->getValueCalculation();
  499.                                 }
  500.                             }
  501.                         
  502.                     }
  503.     
  504.                     
  505.                 }
  506.             }
  507.             
  508.         }
  509.     
  510.         
  511.         
  512.         return $fees;
  513.     }
  514.     #[Groups(['read'])]
  515.     public function getTotalReduction(){
  516.         $total=0;
  517.         
  518.         foreach($this->orderItems as $singleOrderItem){
  519.             $total $total + ($singleOrderItem->getReduction());
  520.         }
  521.         return $total;
  522.     }
  523.     public function getReductionOnTotal(){
  524.         $reductionAmount 0;
  525.         
  526.         if($this->getReduction() and $this->getReduction()>0){
  527.             $reductionAmount = ($this->getTotalAmount() / 100) * $this->getReduction();
  528.         }
  529.         return $reductionAmount;
  530.     }
  531.     #[Groups(['read'])]
  532.     public function getAmountPayedByCredit(){
  533.         $total=0;
  534.         foreach($this->getCustomerWalletPoints() as $singleWalletPoints){
  535.             if($singleWalletPoints->getPoints()<0){
  536.                 $total $total + ($singleWalletPoints->getPoints());
  537.             }
  538.             
  539.         }
  540.         return $total;
  541.     }
  542.     #[Groups(['read'])]
  543.     public function getAmountEarnedAsCredit(){
  544.         $total=0;
  545.         foreach($this->getCustomerWalletPoints() as $singleWalletPoints){
  546.             if($singleWalletPoints->getPoints()>0){
  547.                 $total $total + ($singleWalletPoints->getPoints());
  548.             }
  549.             
  550.         }
  551.         return $total;
  552.     }
  553.     public function getDemandeFund(): ?DemandeFund
  554.     {
  555.         return $this->demandeFund;
  556.     }
  557.     public function setDemandeFund(?DemandeFund $demandeFund): self
  558.     {
  559.         $this->demandeFund $demandeFund;
  560.         return $this;
  561.     }
  562.     public function getStatus(): ?string
  563.     {
  564.         $status "order_finance_verification_pending";
  565.         if($this->status)
  566.         {
  567.             $status $this->status;
  568.         }
  569.         return $status;
  570.     }
  571.     public function setStatus(?string $status): self
  572.     {
  573.         $this->status $status;
  574.         return $this;
  575.     }
  576.     // BySamir : TO CLEAN
  577.  
  578.     public function getSource(): ?string
  579.     {
  580.         return $this->source;
  581.     }
  582.     public function setSource(?string $source): self
  583.     {
  584.         $this->source $source;
  585.         return $this;
  586.     }
  587.     public function getDeliveryAt()
  588.     {
  589.         return $this->deliveryAt;
  590.     }
  591.     public function setDeliveryAt($deliveryAt)
  592.     {
  593.         $this->deliveryAt $deliveryAt;
  594.         return $this;
  595.     }
  596.     public function getRecoveryAt()
  597.     {
  598.         return $this->recoveryAt;
  599.     }
  600.     public function setRecoveryAt($recoveryAt)
  601.     {
  602.         $this->recoveryAt $recoveryAt;
  603.         return $this;
  604.     }
  605.     public function getReduction(): ?float
  606.     {
  607.         return $this->reduction;
  608.     }
  609.     public function setReduction(?float $reduction): self
  610.     {
  611.         $this->reduction $reduction;
  612.         return $this;
  613.     }
  614.     public function getShippingMethod(): ?ShippingMethod
  615.     {
  616.         return $this->shippingMethod;
  617.     }
  618.     public function setShippingMethod(?ShippingMethod $shippingMethod): self
  619.     {
  620.         $this->shippingMethod $shippingMethod;
  621.         return $this;
  622.     }
  623.     public function getAgent(): ?Agent
  624.     {
  625.         return $this->agent;
  626.     }
  627.     public function setAgent(?Agent $agent): self
  628.     {
  629.         $this->agent $agent;
  630.         return $this;
  631.     }
  632.     public function getPaymentMethod(): ?paymentMethod
  633.     {
  634.         return $this->paymentMethod;
  635.     }
  636.     public function setPaymentMethod(?paymentMethod $paymentMethod): self
  637.     {
  638.         $this->paymentMethod $paymentMethod;
  639.         return $this;
  640.     }
  641.     public function getPayedAmount(): ?float
  642.     {
  643.         return $this->payedAmount;
  644.     }
  645.     public function setPayedAmount(?float $payedAmount): self
  646.     {
  647.         $this->payedAmount $payedAmount;
  648.         return $this;
  649.     }
  650.     public function getStartProcessingAt(): ?\DateTimeInterface
  651.     {
  652.         return $this->startProcessingAt;
  653.     }
  654.     public function setStartProcessingAt(?\DateTimeInterface $startProcessingAt): self
  655.     {
  656.         $this->startProcessingAt $startProcessingAt;
  657.         return $this;
  658.     }
  659.     public function getDeliveryType(): ?string
  660.     {
  661.         return $this->deliveryType;
  662.     }
  663.     public function setDeliveryType(?string $deliveryType): self
  664.     {
  665.         $this->deliveryType $deliveryType;
  666.         return $this;
  667.     }
  668.     public function getStartDeliveryAt(): ?\DateTimeInterface
  669.     {
  670.         return $this->startDeliveryAt;
  671.     }
  672.     public function setStartDeliveryAt(?\DateTimeInterface $startDeliveryAt): self
  673.     {
  674.         $this->startDeliveryAt $startDeliveryAt;
  675.         return $this;
  676.     }
  677.     /**
  678.      * @return Collection<int, CustomerWalletPoint>
  679.      */
  680.     public function getCustomerWalletPoints(): Collection
  681.     {
  682.         return $this->customerWalletPoints;
  683.     }
  684.     public function addCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  685.     {
  686.         if (!$this->customerWalletPoints->contains($customerWalletPoint)) {
  687.             $this->customerWalletPoints[] = $customerWalletPoint;
  688.             $customerWalletPoint->setOriginOrder($this);
  689.         }
  690.         return $this;
  691.     }
  692.     public function removeCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  693.     {
  694.         if ($this->customerWalletPoints->removeElement($customerWalletPoint)) {
  695.             // set the owning side to null (unless already changed)
  696.             if ($customerWalletPoint->getOriginOrder() === $this) {
  697.                 $customerWalletPoint->setOriginOrder(null);
  698.             }
  699.         }
  700.         return $this;
  701.     }
  702.     public function getCoupon(): ?Coupon
  703.     {
  704.         return $this->coupon;
  705.     }
  706.     public function setCoupon(?Coupon $coupon): self
  707.     {
  708.         $this->coupon $coupon;
  709.         return $this;
  710.     }
  711.     public function getAgentToDo(): ?Agent
  712.     {
  713.         return $this->agentToDo;
  714.     }
  715.     public function setAgentToDo(?Agent $agentToDo): self
  716.     {
  717.         $this->agentToDo $agentToDo;
  718.         return $this;
  719.     }
  720.     public function getIsToDo(): ?bool
  721.     {
  722.         return $this->isToDo;
  723.     }
  724.     public function setIsToDo(?bool $isToDo): self
  725.     {
  726.         $this->isToDo $isToDo;
  727.         return $this;
  728.     }
  729.     public function getCityRegionShipping(): ?CityRegion
  730.     {
  731.         return $this->cityRegionShipping;
  732.     }
  733.     public function setCityRegionShipping(?CityRegion $cityRegionShipping): self
  734.     {
  735.         $this->cityRegionShipping $cityRegionShipping;
  736.         return $this;
  737.     }
  738.     public function getVendor(): ?Vendor
  739.     {
  740.         return $this->vendor;
  741.     }
  742.     public function setVendor(?Vendor $vendor): self
  743.     {
  744.         $this->vendor $vendor;
  745.         return $this;
  746.     }
  747.     public function getCollectAddress(): ?string
  748.     {
  749.         return $this->collectAddress;
  750.     }
  751.     public function setCollectAddress(?string $collectAddress): self
  752.     {
  753.         $this->collectAddress $collectAddress;
  754.         return $this;
  755.     }
  756.     public function getCollectTel(): ?string
  757.     {
  758.         return $this->collectTel;
  759.     }
  760.     public function setCollectTel(?string $collectTel): self
  761.     {
  762.         $this->collectTel $collectTel;
  763.         return $this;
  764.     }
  765.     public function getIsHeavy(): ?bool
  766.     {
  767.         return $this->isHeavy;
  768.     }
  769.     public function setIsHeavy(?bool $isHeavy): self
  770.     {
  771.         $this->isHeavy $isHeavy;
  772.         return $this;
  773.     }
  774.     public function getShippingTips(): ?float
  775.     {
  776.         return $this->shippingTips;
  777.     }
  778.     public function setShippingTips(?float $shippingTips): self
  779.     {
  780.         $this->shippingTips $shippingTips;
  781.         return $this;
  782.     }
  783.  
  784.     
  785.     /**
  786.      * Get the value of isChecked
  787.      */ 
  788.     public function getIsChecked()
  789.     {
  790.         return $this->isChecked;
  791.     }
  792.     /**
  793.      * Set the value of isChecked
  794.      *
  795.      * @return  self
  796.      */ 
  797.     public function setIsChecked($isChecked)
  798.     {
  799.         $this->isChecked $isChecked;
  800.         return $this;
  801.     }
  802.     /**
  803.      * Get the value of walletPaymentAmount
  804.      */ 
  805.     public function getWalletPaymentAmount()
  806.     {
  807.         return $this->walletPaymentAmount;
  808.     }
  809.     /**
  810.      * Set the value of walletPaymentAmount
  811.      *
  812.      * @return  self
  813.      */ 
  814.     public function setWalletPaymentAmount($walletPaymentAmount)
  815.     {
  816.         $this->walletPaymentAmount $walletPaymentAmount;
  817.         return $this;
  818.     }
  819.     /**
  820.      * Get the value of cityRegionCollect
  821.      */ 
  822.     public function getCityRegionCollect()
  823.     {
  824.         return $this->cityRegionCollect;
  825.     }
  826.     /**
  827.      * Set the value of cityRegionCollect
  828.      *
  829.      * @return  self
  830.      */ 
  831.     public function setCityRegionCollect($cityRegionCollect)
  832.     {
  833.         $this->cityRegionCollect $cityRegionCollect;
  834.         return $this;
  835.     }
  836.     /**
  837.      * Get the value of distance
  838.      */ 
  839.     public function getDistance()
  840.     {
  841.         return $this->distance;
  842.     }
  843.     /**
  844.      * Set the value of distance
  845.      *
  846.      * @return  self
  847.      */ 
  848.     public function setDistance($distance)
  849.     {
  850.         $this->distance $distance;
  851.         return $this;
  852.     }
  853.     /**
  854.      * Get the value of tokenStripe
  855.      */ 
  856.     public function getTokenStripe()
  857.     {
  858.         return $this->tokenStripe;
  859.     }
  860.     /**
  861.      * Set the value of tokenStripe
  862.      *
  863.      * @return  self
  864.      */ 
  865.     public function setTokenStripe($tokenStripe)
  866.     {
  867.         $this->tokenStripe $tokenStripe;
  868.         return $this;
  869.     }
  870.     public function getOrderType(): ?string
  871.     {
  872.         return $this->orderType;
  873.     }
  874.     public function setOrderType(?string $orderType): self
  875.     {
  876.         $this->orderType $orderType;
  877.         return $this;
  878.     }
  879.     /**
  880.      * Get the value of deletedAt
  881.      */ 
  882.     public function getDeletedAt()
  883.     {
  884.         return $this->deletedAt;
  885.     }
  886.     /**
  887.      * Set the value of deletedAt
  888.      *
  889.      * @return  self
  890.      */ 
  891.     public function setDeletedAt($deletedAt)
  892.     {
  893.         $this->deletedAt $deletedAt;
  894.         return $this;
  895.     }
  896.     public function getStore(): ?Store
  897.     {
  898.         return $this->store;
  899.     }
  900.     public function setStore(?Store $store): self
  901.     {
  902.         $this->store $store;
  903.         return $this;
  904.     }
  905.     public function getShipment(): ?Shipment
  906.     {
  907.         return $this->shipment;
  908.     }
  909.     public function setShipment(?Shipment $shipment): self
  910.     {
  911.         $this->shipment $shipment;
  912.         return $this;
  913.     }
  914.     public function getInvoice(): ?Invoice
  915.     {
  916.         return $this->invoice;
  917.     }
  918.     public function setInvoice(?Invoice $invoice): self
  919.     {
  920.         $this->invoice $invoice;
  921.         return $this;
  922.     }
  923.     /**
  924.      * Get the value of shippingAddress
  925.      */ 
  926.     public function getShippingAddress()
  927.     {
  928.         return $this->shippingAddress;
  929.     }
  930.     /**
  931.      * Set the value of shippingAddress
  932.      *
  933.      * @return  self
  934.      */ 
  935.     public function setShippingAddress($shippingAddress)
  936.     {
  937.         $this->shippingAddress $shippingAddress;
  938.         return $this;
  939.     }
  940.     public function getCreatedBy()
  941.     {
  942.         return $this->createdBy;
  943.     }
  944.     public function getDescription(): ?string
  945.     {
  946.         return $this->description;
  947.     }
  948.     public function setDescription(?string $description): self
  949.     {
  950.         $this->description $description;
  951.         return $this;
  952.     }
  953.     /**
  954.      * @return Collection<int, Payment>
  955.      */
  956.     public function getPayments(): Collection
  957.     {
  958.         return $this->payments;
  959.     }
  960.     public function addPayment(Payment $payment): self
  961.     {
  962.         if (!$this->payments->contains($payment)) {
  963.             $this->payments->add($payment);
  964.             $payment->setRelatedOrder($this);
  965.         }
  966.         return $this;
  967.     }
  968.     public function removePayment(Payment $payment): self
  969.     {
  970.         if ($this->payments->removeElement($payment)) {
  971.             // set the owning side to null (unless already changed)
  972.             if ($payment->getRelatedOrder() === $this) {
  973.                 $payment->setRelatedOrder(null);
  974.             }
  975.         }
  976.         return $this;
  977.     }
  978.     public function getReference(): ?string
  979.     {
  980.         return $this->reference;
  981.     }
  982.     public function setReference(?string $reference): self
  983.     {
  984.         $this->reference $reference;
  985.         return $this;
  986.     }
  987.     public function getCashBoxOrder(): ?CashBoxOrder
  988.     {
  989.         return $this->cashBoxOrder;
  990.     }
  991.     public function setCashBoxOrder(?CashBoxOrder $cashBoxOrder): self
  992.     {
  993.         $this->cashBoxOrder $cashBoxOrder;
  994.         return $this;
  995.     }
  996. }