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