src/IlaveU/ShopBundle/Entity/Order/Order.php line 47

  1. <?php
  2. namespace App\IlaveU\ShopBundle\Entity\Order;
  3. use ApiPlatform\Core\Annotation\ApiFilter;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\RangeFilter;
  6. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  7. use App\Entity\LogHistory;
  8. use App\Entity\User;
  9. use App\IlaveU\ShopBundle\Entity\Accounting\Invoice;
  10. use App\IlaveU\ShopBundle\Entity\Customer\Customer;
  11. use App\IlaveU\ShopBundle\Entity\Product\ProductSubscription;
  12. use App\IlaveU\ShopBundle\Entity\Shipping\Shipment;
  13. use App\IlaveU\ShopBundle\Entity\Customer\CustomerWalletPoint;
  14. use App\IlaveU\ShopBundle\Entity\Payment\PaymentMethod;
  15. use App\IlaveU\ShopBundle\Entity\Promotion\Coupon;
  16. use App\IlaveU\ShopBundle\Entity\Shipping\CityRegion;
  17. use App\IlaveU\ShopBundle\Entity\Resource\Agent;
  18. use App\IlaveU\ShopBundle\Entity\Shipping\ShippingMethod;
  19. use App\IlaveU\ShopBundle\Entity\Store\Store;
  20. use App\IlaveU\ShopBundle\Entity\Vendor\Vendor;
  21. use App\IlaveU\ShopBundle\Repository\Order\OrderRepository;
  22. use Doctrine\Common\Collections\ArrayCollection;
  23. use Doctrine\Common\Collections\Collection;
  24. use Doctrine\DBAL\Types\Types;
  25. use Doctrine\ORM\Mapping as ORM;
  26. use Doctrine\ORM\Mapping\Entity;
  27. use Doctrine\ORM\Mapping\InheritanceType;
  28. use Doctrine\ORM\Mapping\PreUpdate;
  29. use Gedmo\Mapping\Annotation as Gedmo;
  30. use Symfony\Component\Serializer\Annotation\Groups;
  31. use Symfony\Component\Validator\Constraints as Assert;
  32. #[ApiResource(
  33.     normalizationContext: ['groups' => ['read']],
  34.     denormalizationContext: ['groups' => ['write']],
  35. )]
  36. #[ApiFilter(SearchFilter::class, properties: ['status' => 'exact','customer'=>'exact','statusShipping' => 'exact'])]
  37. #[ApiFilter(RangeFilter::class, properties: ['createdAt'])]
  38. #[ORM\Table(name'`order`')]
  39. #[ORM\Entity(repositoryClassOrderRepository::class)]
  40. #[InheritanceType('JOINED')]
  41. #[Gedmo\SoftDeleteable(fieldName'deletedAt'timeAwarefalsehardDeletetrue)]
  42. #[Gedmo\Loggable(logEntryClass:LogHistory::class)]
  43. class Order implements \Stringable
  44. {
  45.     #[ORM\Id]
  46.     #[ORM\GeneratedValue]
  47.     #[ORM\Column(type'integer')]
  48.     #[Groups(['read'])]
  49.     private $id;
  50.     #[Groups(['read'])]
  51.     #[ORM\Column(type'datetime'nullabletrue)]
  52.     private ?\DateTime $createdAt null;
  53.     #[Groups(['read','write'])]
  54.     #[ORM\Column(type'text'nullabletrue)]
  55.     #[Gedmo\Versioned]
  56.     private ?string $description null;
  57.     #[Groups(['read','write'])]
  58.     #[ORM\ManyToOne(targetEntityCustomer::class, inversedBy'orders'cascade: ['persist'])]
  59.     #[Assert\Valid]
  60.     #[Gedmo\Versioned]
  61.     private ?\App\IlaveU\ShopBundle\Entity\Customer\Customer $customer null;
  62.     /**
  63.      *
  64.      * @example OrderItems that contain products,quantities,partial reductions, and details of the order
  65.      */
  66.     #[Groups(['read','write'])]
  67.     #[ORM\OneToMany(targetEntityOrderItem::class, mappedBy'parentOrder'cascade: ['persist''remove'])]
  68.     #[Assert\Valid]
  69.     
  70.     private \Doctrine\Common\Collections\Collection|array $orderItems;
  71.     
  72.     #[ORM\OneToMany(targetEntityAdjustment::class, mappedBy'parentOrder')]
  73.     private \Doctrine\Common\Collections\Collection|array $adjustments;
  74.     #[ORM\Column(type'string'length255nullabletrue)]
  75.     #[Groups(['read','write'])]
  76.     private ?string $firstName null;
  77.     #[ORM\Column(type'string'length255nullabletrue)]
  78.     #[Groups(['read','write'])]
  79.     private ?string $lastName null;
  80.     #[ORM\Column(type'string'length255nullabletrue)]
  81.     #[Groups(['read','write'])]
  82.     private ?string $companyName null;
  83.     #[ORM\Column(type'string'length255nullabletrue)]
  84.     #[Groups(['read','write'])]
  85.     private ?string $address null;
  86.     #[ORM\Column(type'string'length255nullabletrue)]
  87.     #[Groups(['read','write'])]
  88.     private ?string $city null;
  89.     #[ORM\Column(type'string'length255nullabletrue)]
  90.     #[Groups(['read','write'])]
  91.     private ?string $country null;
  92.     #[ORM\Column(type'string'length255nullabletrue)]
  93.     private ?string $department null;
  94.     #[ORM\Column(type'string'length255nullabletrue)]
  95.     private ?string $postcode null;
  96.     #[ORM\Column(type'string'length255nullabletrue)]
  97.     #[Groups(['read','write'])]
  98.     private ?string $email null;
  99.     #[ORM\Column(type'string'length255nullabletrue)]
  100.     #[Groups(['read','write'])]
  101.     private ?string $tel null;
  102.     #[ORM\Column(type'text'nullabletrue)]
  103.     private ?string $comment null;
  104.     #[ORM\ManyToOne(targetEntityDemandeFund::class, inversedBy'orders')]
  105.     private ?\App\IlaveU\ShopBundle\Entity\Order\DemandeFund $demandeFund null;
  106.     #[Groups(['read','write'])]
  107.     #[ORM\Column(type'string'length255nullabletrue)]
  108.     #[Gedmo\Versioned]
  109.     private ?string $status "draft";
  110.     #[Groups(['read','write'])]
  111.     #[ORM\Column(type'string'length255nullabletrue)]
  112.     #[Gedmo\Versioned]
  113.     private ?string $statusShipping "draft";
  114.     
  115.     #[Groups(['read','write'])]
  116.     #[ORM\Column(type'string'length255nullabletrue)]
  117.     private ?string $source null;
  118.     #[ORM\Column(type'text'nullabletrue)]
  119.     private $deliveryAt;
  120.     #[ORM\Column(type'text'nullabletrue)]
  121.     private $recoveryAt;
  122.     #[ORM\Column(type'string'length255nullabletrue)]
  123.     private ?string $oldOrderNumber null;
  124.     #[Groups(['read','write'])]
  125.     #[ORM\Column(type'float'nullabletrue)]
  126.     private ?float $reduction null;
  127.     #[ORM\Column(type'float'nullabletrue)]
  128.     private $distance 0;
  129.     #[ORM\ManyToOne(targetEntityShippingMethod::class, inversedBy'orders'cascade: ['persist'])]
  130.     #[Groups(['read','write'])]
  131.     #[Gedmo\Versioned]
  132.     private ?\App\IlaveU\ShopBundle\Entity\Shipping\ShippingMethod $shippingMethod null;
  133.     #[ORM\ManyToOne(targetEntityAgent::class, inversedBy'orders')]
  134.     #[Groups(['read','write'])]
  135.     #[Gedmo\Versioned]
  136.     private ?\App\IlaveU\ShopBundle\Entity\Resource\Agent $agent null;
  137.     #[Groups(['read','write'])]
  138.     #[ORM\ManyToOne(targetEntitypaymentMethod::class, inversedBy'orders'cascade: ['persist'])]
  139.     #[ORM\JoinColumn(nullabletrueonDelete'CASCADE')]
  140.     
  141.     private ?\App\IlaveU\ShopBundle\Entity\Payment\PaymentMethod $paymentMethod null;
  142.     #[ORM\Column(type'float'nullabletrue)]
  143.     #[Groups(['read','write'])]
  144.     #[Gedmo\Versioned]
  145.     private ?float $payedAmount null;
  146.     #[ORM\Column(type'datetime'nullabletrue)]
  147.     #[Groups(['read','write'])]
  148.     #[Gedmo\Versioned]
  149.     private ?\DateTimeInterface $startProcessingAt null;
  150.     #[Groups(['read','write'])]
  151.     #[ORM\Column(type'string'length255nullabletrue)]
  152.     private ?string $deliveryType null;
  153.     #[ORM\Column(type'datetime'nullabletrue)]
  154.     #[Groups(['read','write'])]
  155.     #[Gedmo\Versioned]
  156.     private ?\DateTimeInterface $startDeliveryAt null;
  157.     #[ORM\Column(type'datetime'nullabletrue)]
  158.     #[Groups(['read','write'])]
  159.     #[Gedmo\Versioned]
  160.     private ?\DateTimeInterface $paidAt null;
  161.     #[ORM\Column(type'datetime'nullabletrue)]
  162.     #[Groups(['read','write'])]
  163.     #[Gedmo\Versioned]
  164.     private ?\DateTimeInterface $deliveredAt null;
  165.     #[ORM\OneToMany(targetEntityCustomerWalletPoint::class, mappedBy'originOrder')]
  166.     private \Doctrine\Common\Collections\Collection|array $customerWalletPoints;
  167.     #[ORM\ManyToOne(targetEntityCoupon::class, inversedBy'orders')]
  168.     #[Groups(['read','write'])]
  169.     private ?\App\IlaveU\ShopBundle\Entity\Promotion\Coupon $coupon null;
  170.     #[ORM\ManyToOne(targetEntityAgent::class, inversedBy'ordersToDolist')]
  171.     private ?\App\IlaveU\ShopBundle\Entity\Resource\Agent $agentToDo null;
  172.     #[ORM\Column(type'boolean'nullabletrue)]
  173.     private ?bool $isToDo false;
  174.     #[ORM\ManyToOne(targetEntityCityRegion::class, inversedBy'orders')]
  175.     private ?\App\IlaveU\ShopBundle\Entity\Shipping\CityRegion $cityRegionShipping null;
  176.     #[ORM\ManyToOne(targetEntityCityRegion::class, inversedBy'collectedOrders')]
  177.     private $cityRegionCollect;
  178.     #[ORM\ManyToOne(targetEntityVendor::class, inversedBy'orders')]
  179.     private ?\App\IlaveU\ShopBundle\Entity\Vendor\Vendor $vendor null;
  180.     #[ORM\Column(type'text'nullabletrue)]
  181.     #[Groups(['read','write'])]
  182.     private ?string $collectAddress null;
  183.     #[ORM\Column(type'text'nullabletrue)]
  184.     #[Groups(['read','write'])]
  185.     private ?string $shippingAddress null;
  186.     #[ORM\Column(type'string'length255nullabletrue)]
  187.     #[Groups(['read','write'])]
  188.     private ?string $collectTel null;
  189.     
  190.     
  191.      #[ORM\Column(type'string'length255nullabletrue)]
  192.     #[Groups(['read','write'])]
  193.     private ?string $collectLng null;
  194.     
  195.          #[ORM\Column(type'string'length255nullabletrue)]
  196.     #[Groups(['read','write'])]
  197.     private ?string $collectLat null;
  198.     
  199.          #[ORM\Column(type'string'length255nullabletrue)]
  200.     #[Groups(['read','write'])]
  201.     private ?string $shippingLng null;
  202.     
  203.          #[ORM\Column(type'string'length255nullabletrue)]
  204.     #[Groups(['read','write'])]
  205.     private ?string $shippingLat null;
  206.     #[ORM\Column(type'boolean'nullabletrue)]
  207.     #[Groups(['read','write'])]
  208.     private ?bool $isHeavy null;
  209.     #[Groups(['read','write'])]
  210.     #[ORM\Column(type'float'nullabletrue)]
  211.     private $shippingTips 0;
  212.     #[Groups(['read','write'])]
  213.      #[ORM\Column(type'float'nullabletrue)]
  214.     private $walletPaymentAmount 0;
  215.     
  216.     #[ORM\Column(type'boolean'nullabletrue)]
  217.     private $isChecked;
  218.     #[ORM\Column(type'string'length255nullabletrue)]
  219.     private $tokenStripe;
  220.     #[ORM\Column(length255nullabletrue)]
  221.     #[Groups(['read','write'])]
  222.     private ?string $orderType "order";
  223.     #[ORM\Column(nullabletrue)]
  224.     private ?\DateTimeImmutable $deletedAt null;
  225.     #[ORM\ManyToOne(inversedBy'orders')]
  226.     private ?Store $store null;
  227.     #[ORM\OneToOne(inversedBy'relatedOrder'cascade: ['persist''remove'])]
  228.     #[Groups(['read','write'])]
  229.     private ?Shipment $shipment null;
  230.     // Undefined array key \"invoice\"" To be fixed for #[Groups(['read','write'])]
  231.     #[ORM\ManyToOne(inversedBy'orders')]
  232.     private ?Invoice $invoice null;
  233.     #[ORM\Column(typeTypes::STRING,nullabletrue)]
  234.     #[Gedmo\Blameable(on'create')]
  235.     private $createdBy;
  236.     #[ORM\OneToOne(mappedBy'relatedOrder'cascade: ['persist''remove'])]
  237.     private ?ProductSubscription $productSubscription null;
  238.     #[Groups(['read','write'])]
  239.     #[ORM\Column(nullabletrue)]
  240.     private ?array $metaData null;
  241.     #[ORM\Column(length255nullabletrue)]
  242.     private ?string $defaultCurrency null;
  243.     #[ORM\Column(nullabletrue)]
  244.     private ?float $extraShippingFees 0;
  245.     #[ORM\Column(length255nullabletrue)]
  246.     private ?string $extraShippingMethodName "";
  247.     #[ORM\Column(length255nullabletrue)]
  248.     private ?string $extraShippingInfos "";
  249.     #[Groups(['read','write'])]
  250.     #[ORM\Column(nullabletrue)]
  251.     private ?bool $notifyCustomer null;
  252.     #[ORM\Column(length255nullabletrue)]
  253.     private ?string $updateNotificationMessage null;
  254.     public function __construct()
  255.     {
  256.         $this->orderItems = new ArrayCollection();
  257.         $this->adjustments = new ArrayCollection();
  258.         $this->createdAt = new \DateTime();
  259.         $this->customerWalletPoints = new ArrayCollection();
  260.         
  261.     }
  262.     #[PreUpdate]
  263.     public function preUpdate(): void
  264.     {
  265.         // Ensure paidAt is updated when the entity is saved
  266.         $this->updatePaidAtIfNeeded();
  267.     }
  268.    
  269.     public function __toString(): string
  270.     {
  271.         return (string)$this->getOrderNumber();
  272.     }
  273.     public function getId(): ?int
  274.     {
  275.         return $this->id;
  276.     }
  277.     #[Groups(['read'])]
  278.     public function getOrderNumber($secondaryPrefix=null)
  279.     {
  280.         $prefix "CMD-";
  281.         if($this->getOrderType()=="invoice"){
  282.             $prefix "FA-";
  283.         }
  284.         $orderNumber $prefix.$this->createdAt->format("ym").str_pad((string) $this->id5"0"STR_PAD_LEFT);
  285.         if($secondaryPrefix){
  286.             $orderNumber $prefix.$this->createdAt->format("ym").str_pad((string) $this->id5"0"STR_PAD_LEFT)."-".$secondaryPrefix;
  287.         }
  288.         return $orderNumber;
  289.     }
  290.     #[Groups(['read'])]
  291.     public function getIdPrefixed()
  292.     {
  293.         return $this->getOrderNumber();
  294.     }
  295.     public function getFirstName(): ?string
  296.     {
  297.         return $this->firstName;
  298.     }
  299.     public function setFirstName(string $firstName): self
  300.     {
  301.         $this->firstName $firstName;
  302.         return $this;
  303.     }
  304.     public function getLastName(): ?string
  305.     {
  306.         return $this->lastName;
  307.     }
  308.     public function setLastName(string $lastName): self
  309.     {
  310.         $this->lastName $lastName;
  311.         return $this;
  312.     }
  313.     public function getCreatedAt(): ?\DateTime
  314.     {
  315.         return $this->createdAt;
  316.     }
  317.     public function setCreatedAt(?\DateTime $createdAt): self
  318.     {
  319.         $this->createdAt $createdAt;
  320.         return $this;
  321.     }
  322.     public function getCustomer(): ?Customer
  323.     {
  324.         return $this->customer;
  325.     }
  326.     public function setCustomer(?Customer $customer): self
  327.     {
  328.         $this->customer $customer;
  329.         return $this;
  330.     }
  331.     public function getCategoriesProduct(){
  332.         $categories = [];
  333.         foreach($this->getOrderItems() as $singleOrderItem){
  334.             if($singleOrderItem->getProduct()){
  335.                 if($singleOrderItem->getProduct()->getParentCategory()){
  336.                     $categories[] = $singleOrderItem->getProduct()->getParentCategory()->getName();
  337.                 }
  338.                 
  339.             }
  340.         }
  341.         return $categories;
  342.     }
  343.     public function getSubCategoriesProduct(){
  344.         $categories = [];
  345.         foreach($this->getOrderItems() as $singleOrderItem){
  346.             if($singleOrderItem->getProduct()){
  347.                 foreach($singleOrderItem->getProduct()->getCategoriesProduct() as $singleCategory){
  348.                     if(!in_array($singleCategory->getName(),$categories)){
  349.                         $categories[] = $singleCategory->getName();
  350.                     }
  351.                     
  352.                 }
  353.                 
  354.             }
  355.         }
  356.         return $categories;
  357.     }
  358.     /**
  359.      * @return Collection|OrderItem[]
  360.      */
  361.     public function getOrderItems(): Collection
  362.     {
  363.         return $this->orderItems;
  364.     }
  365.     public function addOrderItem(OrderItem $orderItem): self
  366.     {
  367.         if (!$this->orderItems->contains($orderItem)) {
  368.             $this->orderItems[] = $orderItem;
  369.             $orderItem->setParentOrder($this);
  370.         }
  371.         return $this;
  372.     }
  373.     public function removeOrderItem(OrderItem $orderItem): self
  374.     {
  375.         if ($this->orderItems->removeElement($orderItem)) {
  376.             // set the owning side to null (unless already changed)
  377.             if ($orderItem->getParentOrder() === $this) {
  378.                 $orderItem->setParentOrder(null);
  379.             }
  380.         }
  381.         return $this;
  382.     }
  383.     /**
  384.      * @return Collection|Adjustment[]
  385.      */
  386.     public function getAdjustments(): Collection
  387.     {
  388.         return $this->adjustments;
  389.     }
  390.     public function addAdjustment(Adjustment $adjustment): self
  391.     {
  392.         if (!$this->adjustments->contains($adjustment)) {
  393.             $this->adjustments[] = $adjustment;
  394.             $adjustment->setParentOrder($this);
  395.         }
  396.         return $this;
  397.     }
  398.     public function removeAdjustment(Adjustment $adjustment): self
  399.     {
  400.         if ($this->adjustments->removeElement($adjustment)) {
  401.             // set the owning side to null (unless already changed)
  402.             if ($adjustment->getParentOrder() === $this) {
  403.                 $adjustment->setParentOrder(null);
  404.             }
  405.         }
  406.         return $this;
  407.     }
  408.     #[Groups(['read'])]
  409.     public function getReductionOnCoupon(){
  410.         $reductionCoupon=0;
  411.         if($this->getCoupon()){
  412.             if($this->getCoupon()->getTypeReduction()=="percent"){
  413.                 $reductionCoupon = ($this->getTotalAmount()/100)*$this->getCoupon()->getValueReduction();
  414.             }else{
  415.                 $reductionCoupon $this->getCoupon()->getValueReduction();
  416.             }
  417.         }
  418.         return  $reductionCoupon;
  419.     }
  420.     public function getCompanyName(): ?string
  421.     {
  422.         return $this->companyName;
  423.     }
  424.     public function setCompanyName(?string $companyName): self
  425.     {
  426.         $this->companyName $companyName;
  427.         return $this;
  428.     }
  429.     public function getAddress(): ?string
  430.     {
  431.         return $this->address;
  432.     }
  433.     public function setAddress(string $address): self
  434.     {
  435.         $this->address $address;
  436.         return $this;
  437.     }
  438.     public function getCity(): ?string
  439.     {
  440.         return $this->city;
  441.     }
  442.     public function setCity(string $city): self
  443.     {
  444.         $this->city $city;
  445.         return $this;
  446.     }
  447.     public function getCountry(): ?string
  448.     {
  449.         return $this->country;
  450.     }
  451.     public function setCountry(string $country): self
  452.     {
  453.         $this->country $country;
  454.         return $this;
  455.     }
  456.     public function getDepartment(): ?string
  457.     {
  458.         return $this->department;
  459.     }
  460.     public function setDepartment(?string $department): self
  461.     {
  462.         $this->department $department;
  463.         return $this;
  464.     }
  465.     public function getPostcode(): ?string
  466.     {
  467.         return $this->postcode;
  468.     }
  469.     public function setPostcode(?string $postcode): self
  470.     {
  471.         $this->postcode $postcode;
  472.         return $this;
  473.     }
  474.     public function getEmail(): ?string
  475.     {
  476.         return $this->email;
  477.     }
  478.     public function setEmail(string $email): self
  479.     {
  480.         $this->email $email;
  481.         return $this;
  482.     }
  483.     public function getTel(): ?string
  484.     {
  485.         return $this->tel;
  486.     }
  487.     public function setTel(string $tel): self
  488.     {
  489.         $this->tel $tel;
  490.         return $this;
  491.     }
  492.     public function getComment(): ?string
  493.     {
  494.         return $this->comment;
  495.     }
  496.     public function setComment(?string $comment): self
  497.     {
  498.         $this->comment $comment;
  499.         return $this;
  500.     }
  501.   
  502.     #[Groups(['read'])]
  503.     public function getTotalAmount(){
  504.         $total=0;
  505.         foreach($this->orderItems as $singleOrderItem){
  506.             $total $total + ($singleOrderItem->getTotalAmount());
  507.         }
  508.         return $total;
  509.         
  510.     }
  511.     #[Groups(['read'])]
  512.     public function getFullPayedAmount(){
  513.         return $this->getPayedAmount() + $this->getWalletPaymentAmount();
  514.     }
  515.     #[Groups(['read'])]
  516.     public function getFullTotalAmount(){
  517.         
  518.        
  519.         $total 
  520.         ((float)$this->getTotalAmount() + 
  521.         (float)$this->getShippingFees()  
  522.         
  523.         + (float)$this->getShippingTips()) - 
  524.         ((float)$this->getTotalReduction()) ;
  525.         return $total;
  526.         
  527.     }
  528.     #[Groups(['read'])]
  529.     public function getFullRestAmount(){
  530.         $payedAmount $this->getPayedAmount();
  531.         $walletPayedAmount $this->getWalletPaymentAmount();
  532.         $paymentMethodCode null;
  533.         if($this->getPaymentMethod()){
  534.             $paymentMethodCode $this->getPaymentMethod()->getCode();
  535.         }
  536.         
  537.         if( ( $this->statusShipping == "cancelled")){
  538.             // ToReview
  539.             //return 0;
  540.             $payedAmount 0;
  541.             
  542.         }
  543.        
  544.         $total $this->getFullTotalAmount() - ($payedAmount $walletPayedAmount);
  545.          ;
  546.         return $total;
  547.         
  548.     }
  549.     //needs optimisation
  550.     #[Groups(['read'])]
  551.     public function getShippingFees(){
  552.         $fees 0;
  553.         foreach($this->getOrderItems() as $singleOrderItem){
  554.             $fees += $singleOrderItem->getShippingFees();
  555.         }
  556.         $fees += $this->getExtraShippingFees();
  557.         if($fees>0) {return $fees;} 
  558.         if($this->getShippingMethod()){
  559.             
  560.             // Condition IlaveU / Classic 19 DH
  561.             
  562.             if($this->getShippingMethod()->getCode() == "CLASSIQUE GRATUIT" and $this->getDeliveryType() == "on-store"){
  563.                     return 0;
  564.            }
  565.             
  566.             
  567.             if($this->getShippingMethod()->isIsSeparatelyCalculated()){
  568.                 $fees $this->getShippingMethod()->getPrice();
  569.             
  570.                 foreach($this->getShippingMethod()->getShippingRules() as $shippingRule){
  571.     
  572.     
  573.                     if($shippingRule->getTypeCalculation() == "distance"){
  574.                         if( $shippingRule->getMin() < $this->getDistance()  and   $shippingRule->getMax() >= $this->getDistance() ){
  575.                             $fees =  $this->getDistance() * $shippingRule->getValueCalculation();
  576.     
  577.                             /*Condition for TLCS may be it works for all people*/
  578.                             if ($fees $this->getShippingMethod()->getPrice()){
  579.                                 $fees $this->getShippingMethod()->getPrice();
  580.                             }
  581.                             /*Condition for TLCS may be it works for all people*/
  582.                         }
  583.                         
  584.                     }
  585.                         else{
  586.                             if(
  587.                             $shippingRule->getMin() < $this->getTotalAmount() and $shippingRule->getMax() >=  $this->getTotalAmount()
  588.                             
  589.                             ){
  590.                                 if($shippingRule->getTypeCalculation() == "percent"){
  591.                                     $fees = ($this->getTotalAmount() / 100 ) * $shippingRule->getValueCalculation();
  592.                                 }
  593.                                 else{
  594.                                     $fees =  $shippingRule->getValueCalculation();
  595.                                 }
  596.                             }
  597.                         
  598.                     }
  599.     
  600.                     
  601.                 }
  602.             }
  603.             
  604.         }
  605.     
  606.         
  607.         
  608.        
  609.         return $fees;
  610.     }
  611.     #[Groups(['read'])]
  612.     public function getTotalReduction(){
  613.         $total=0;
  614.         $total $total $this->getReduction() + $this->getReductionOnCoupon();
  615.         return $total;
  616.     }
  617.     public function getReductionOnTotal(){
  618.         $reductionAmount 0;
  619.         
  620.         if($this->getReduction() and $this->getReduction()>0){
  621.             $reductionAmount = ($this->getTotalAmount() / 100) * $this->getReduction();
  622.         }
  623.         return $reductionAmount;
  624.     }
  625.     #[Groups(['read'])]
  626.     public function getAmountPayedByCredit(){
  627.         $total=0;
  628.         foreach($this->getCustomerWalletPoints() as $singleWalletPoints){
  629.             if($singleWalletPoints->getPoints()<0){
  630.                 $total $total + ($singleWalletPoints->getPoints());
  631.             }
  632.             
  633.         }
  634.         return $total;
  635.     }
  636.     #[Groups(['read'])]
  637.     public function getAmountEarnedAsCredit(){
  638.         $total=0;
  639.         foreach($this->getCustomerWalletPoints() as $singleWalletPoints){
  640.             if($singleWalletPoints->getPoints()>0){
  641.                 $total $total + ($singleWalletPoints->getPoints());
  642.             }
  643.             
  644.         }
  645.         return $total;
  646.     }
  647.     public function getDemandeFund(): ?DemandeFund
  648.     {
  649.         return $this->demandeFund;
  650.     }
  651.     public function setDemandeFund(?DemandeFund $demandeFund): self
  652.     {
  653.         $this->demandeFund $demandeFund;
  654.         return $this;
  655.     }
  656.     public function getStatus(): ?string
  657.     {
  658.         $status "waiting";
  659.         
  660.         
  661.         $shippingMethodCode $this->getPaymentMethod() ? $this->getPaymentMethod()->getCode() : "";
  662.         
  663.         
  664.         
  665.         $cashTranslations = [
  666.             "CASH",
  667.             "ESPECES"
  668.             ]; 
  669.         if( $this->getFullRestAmount() == and $this->getFullTotalAmount() > 0){
  670.             return "paid";
  671.         }
  672.         // if( ($this->getPayedAmount() > 0 &&  $this->getPayedAmount() < $this->getFullTotalAmount())){
  673.         //     return "partially-paid";
  674.             
  675.         // }
  676.         if($this->getFullPayedAmount() > 0){
  677.             
  678.         
  679.             if($this->getFullRestAmount() > and $this->getFullPayedAmount() < $this->getFullTotalAmount() ){
  680.                 return "partially-paid";
  681.             }
  682.         }
  683.         return "waiting";
  684.         
  685.         
  686.       
  687.         
  688.         
  689.         
  690.         
  691.         
  692.         
  693.         // BySamir : ToReview : $this->status != "waiting" and $this->source != "mobile" and $this->source
  694.         
  695.         
  696.         
  697.         if($this->status)
  698.         {
  699.             $status $this->status;
  700.         }
  701.         
  702.         return $status;
  703.     }
  704.     public function setStatus(?string $status): self
  705.     {
  706.         $this->status $status;
  707.         return $this;
  708.     }
  709.     // BySamir : TO CLEAN
  710.  
  711.     public function getSource(): ?string
  712.     {
  713.         return $this->source;
  714.     }
  715.     public function setSource(?string $source): self
  716.     {
  717.         $this->source $source;
  718.         return $this;
  719.     }
  720.     public function getDeliveryAt()
  721.     {
  722.         return $this->deliveryAt;
  723.     }
  724.     public function setDeliveryAt($deliveryAt)
  725.     {
  726.         $this->deliveryAt $deliveryAt;
  727.         return $this;
  728.     }
  729.     public function getRecoveryAt()
  730.     {
  731.         return $this->recoveryAt;
  732.     }
  733.     public function setRecoveryAt($recoveryAt)
  734.     {
  735.         $this->recoveryAt $recoveryAt;
  736.         return $this;
  737.     }
  738.     public function getReduction(): ?float
  739.     {
  740.         return $this->reduction;
  741.     }
  742.     public function setReduction(?float $reduction): self
  743.     {
  744.         $this->reduction $reduction;
  745.         return $this;
  746.     }
  747.    #[Groups(['read'])]
  748.     public function getReductionInPercent(): ?float
  749.     {
  750.         $reduction 0;
  751.         if(($this->reduction $this->getFullTotalAmount()) > 0){
  752.             $reduction $this->reduction / (($this->reduction $this->getFullTotalAmount()) / 100);
  753.         }
  754.         
  755.         return $reduction;
  756.     }
  757.     public function getShippingMethod(): ?ShippingMethod
  758.     {
  759.         return $this->shippingMethod;
  760.     }
  761.     public function setShippingMethod(?ShippingMethod $shippingMethod): self
  762.     {
  763.         $this->shippingMethod $shippingMethod;
  764.         return $this;
  765.     }
  766.     public function getAgent(): ?Agent
  767.     {
  768.         return $this->agent;
  769.     }
  770.     public function setAgent(?Agent $agent): self
  771.     {
  772.         $this->agent $agent;
  773.         return $this;
  774.     }
  775.     public function getPaymentMethod(): ?paymentMethod
  776.     {
  777.         return $this->paymentMethod;
  778.     }
  779.     public function setPaymentMethod(?paymentMethod $paymentMethod): self
  780.     {
  781.         $this->paymentMethod $paymentMethod;
  782.         return $this;
  783.     }
  784.     public function getPayedAmount(): ?float
  785.     {
  786.         return $this->payedAmount;
  787.     }
  788.     public function setPayedAmount(?float $payedAmount): self
  789.     {
  790.         $this->payedAmount $payedAmount;
  791.         
  792.         // Automatically set paidAt when payment is made
  793.         $this->updatePaidAtIfNeeded();
  794.         return $this;
  795.     }
  796.     public function getStartProcessingAt(): ?\DateTimeInterface
  797.     {
  798.         return $this->startProcessingAt;
  799.     }
  800.     public function setStartProcessingAt(?\DateTimeInterface $startProcessingAt): self
  801.     {
  802.         $this->startProcessingAt $startProcessingAt;
  803.         return $this;
  804.     }
  805.     public function getDeliveryType(): ?string
  806.     {
  807.         return $this->deliveryType;
  808.     }
  809.     public function setDeliveryType(?string $deliveryType): self
  810.     {
  811.         $this->deliveryType $deliveryType;
  812.         return $this;
  813.     }
  814.     public function getStartDeliveryAt(): ?\DateTimeInterface
  815.     {
  816.         return $this->startDeliveryAt;
  817.     }
  818.     public function setStartDeliveryAt(?\DateTimeInterface $startDeliveryAt): self
  819.     {
  820.         $this->startDeliveryAt $startDeliveryAt;
  821.         return $this;
  822.     }
  823.     public function getPaidAt(): ?\DateTimeInterface
  824.     {
  825.         return $this->paidAt;
  826.     }
  827.     public function setPaidAt(?\DateTimeInterface $paidAt): self
  828.     {
  829.         $this->paidAt $paidAt;
  830.         return $this;
  831.     }
  832.     public function getDeliveredAt(): ?\DateTimeInterface
  833.     {
  834.         return $this->deliveredAt;
  835.     }
  836.     public function setDeliveredAt(?\DateTimeInterface $deliveredAt): self
  837.     {
  838.         $this->deliveredAt $deliveredAt;
  839.         return $this;
  840.     }
  841.     /**
  842.      * Automatically set paidAt when payment amounts are set
  843.      * This method checks if the order should be considered paid and sets paidAt accordingly
  844.      * Only considers payedAmount (real money), not walletPaymentAmount (loyalty points)
  845.      */
  846.     private function updatePaidAtIfNeeded(): void
  847.     {
  848.         // Check if there's real payment (payedAmount > 0)
  849.         $hasPayment $this->payedAmount && $this->payedAmount 0;
  850.         
  851.         if ($hasPayment && $this->paidAt === null) {
  852.             // Set paidAt to current time if payment exists but paidAt is not set
  853.             $this->paidAt = new \DateTime();
  854.         } elseif (!$hasPayment && $this->paidAt !== null) {
  855.             // Clear paidAt if no payment exists but paidAt is set
  856.             $this->paidAt null;
  857.         }
  858.     }
  859.     /**
  860.      * Automatically set deliveredAt when statusShipping changes to "livree"
  861.      * This method checks if the order should be considered delivered and sets deliveredAt accordingly
  862.      */
  863.     private function updateDeliveredAtIfNeeded(): void
  864.     {
  865.         // Check if status is "livree" (delivered)
  866.         $isDelivered $this->statusShipping === "livree";
  867.         
  868.         if ($isDelivered && $this->deliveredAt === null) {
  869.             // Set deliveredAt to current time if status is "livree" but deliveredAt is not set
  870.             $this->deliveredAt = new \DateTime();
  871.         } elseif (!$isDelivered && $this->deliveredAt !== null) {
  872.             // Clear deliveredAt if status is not "livree" but deliveredAt is set
  873.             $this->deliveredAt null;
  874.         }
  875.     }
  876.     /**
  877.      * @return Collection<int, CustomerWalletPoint>
  878.      */
  879.     public function getCustomerWalletPoints(): Collection
  880.     {
  881.         return $this->customerWalletPoints;
  882.     }
  883.     public function addCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  884.     {
  885.         if (!$this->customerWalletPoints->contains($customerWalletPoint)) {
  886.             $this->customerWalletPoints[] = $customerWalletPoint;
  887.             $customerWalletPoint->setOriginOrder($this);
  888.         }
  889.         return $this;
  890.     }
  891.     public function removeCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  892.     {
  893.         if ($this->customerWalletPoints->removeElement($customerWalletPoint)) {
  894.             // set the owning side to null (unless already changed)
  895.             if ($customerWalletPoint->getOriginOrder() === $this) {
  896.                 $customerWalletPoint->setOriginOrder(null);
  897.             }
  898.         }
  899.         return $this;
  900.     }
  901.     public function getCoupon(): ?Coupon
  902.     {
  903.         return $this->coupon;
  904.     }
  905.     public function setCoupon(?Coupon $coupon): self
  906.     {
  907.         $this->coupon $coupon;
  908.         return $this;
  909.     }
  910.     public function getAgentToDo(): ?Agent
  911.     {
  912.         return $this->agentToDo;
  913.     }
  914.     public function setAgentToDo(?Agent $agentToDo): self
  915.     {
  916.         $this->agentToDo $agentToDo;
  917.         return $this;
  918.     }
  919.     public function getIsToDo(): ?bool
  920.     {
  921.         return $this->isToDo;
  922.     }
  923.     public function setIsToDo(?bool $isToDo): self
  924.     {
  925.         $this->isToDo $isToDo;
  926.         return $this;
  927.     }
  928.     public function getCityRegionShipping(): ?CityRegion
  929.     {
  930.         return $this->cityRegionShipping;
  931.     }
  932.     public function setCityRegionShipping(?CityRegion $cityRegionShipping): self
  933.     {
  934.         $this->cityRegionShipping $cityRegionShipping;
  935.         return $this;
  936.     }
  937.     public function getVendor(): ?Vendor
  938.     {
  939.         return $this->vendor;
  940.     }
  941.     public function setVendor(?Vendor $vendor): self
  942.     {
  943.         $this->vendor $vendor;
  944.         return $this;
  945.     }
  946.     public function getCollectAddress(): ?string
  947.     {
  948.         return $this->collectAddress;
  949.     }
  950.     public function setCollectAddress(?string $collectAddress): self
  951.     {
  952.         $this->collectAddress $collectAddress;
  953.         return $this;
  954.     }
  955.     public function getCollectTel(): ?string
  956.     {
  957.         return $this->collectTel;
  958.     }
  959.     public function setCollectTel(?string $collectTel): self
  960.     {
  961.         $this->collectTel $collectTel;
  962.         return $this;
  963.     }
  964.     public function getIsHeavy(): ?bool
  965.     {
  966.         return $this->isHeavy;
  967.     }
  968.     public function setIsHeavy(?bool $isHeavy): self
  969.     {
  970.         $this->isHeavy $isHeavy;
  971.         return $this;
  972.     }
  973.     #[Groups(['read'])]
  974.     public function getShippingTips(): ?float
  975.     {
  976.         return $this->shippingTips;
  977.     }
  978.     public function setShippingTips(?float $shippingTips): self
  979.     {
  980.         $this->shippingTips $shippingTips;
  981.         return $this;
  982.     }
  983.  
  984.     
  985.     /**
  986.      * Get the value of isChecked
  987.      */ 
  988.     public function getIsChecked()
  989.     {
  990.         return $this->isChecked;
  991.     }
  992.     /**
  993.      * Set the value of isChecked
  994.      *
  995.      * @return  self
  996.      */ 
  997.     public function setIsChecked($isChecked)
  998.     {
  999.         $this->isChecked $isChecked;
  1000.         return $this;
  1001.     }
  1002.     /**
  1003.      * Get the value of walletPaymentAmount
  1004.      */ 
  1005.     public function getWalletPaymentAmount()
  1006.     {
  1007.         return $this->walletPaymentAmount;
  1008.     }
  1009.     /**
  1010.      * Set the value of walletPaymentAmount
  1011.      *
  1012.      * @return  self
  1013.      */ 
  1014.     public function setWalletPaymentAmount($walletPaymentAmount)
  1015.     {
  1016.         $this->walletPaymentAmount $walletPaymentAmount;
  1017.         return $this;
  1018.     }
  1019.     /**
  1020.      * Get the value of cityRegionCollect
  1021.      */ 
  1022.     public function getCityRegionCollect()
  1023.     {
  1024.         return $this->cityRegionCollect;
  1025.     }
  1026.     /**
  1027.      * Set the value of cityRegionCollect
  1028.      *
  1029.      * @return  self
  1030.      */ 
  1031.     public function setCityRegionCollect($cityRegionCollect)
  1032.     {
  1033.         $this->cityRegionCollect $cityRegionCollect;
  1034.         return $this;
  1035.     }
  1036.     /**
  1037.      * Get the value of distance
  1038.      */ 
  1039.     public function getDistance()
  1040.     {
  1041.         return $this->distance;
  1042.     }
  1043.     /**
  1044.      * Set the value of distance
  1045.      *
  1046.      * @return  self
  1047.      */ 
  1048.     public function setDistance($distance)
  1049.     {
  1050.         $this->distance $distance;
  1051.         return $this;
  1052.     }
  1053.     /**
  1054.      * Get the value of tokenStripe
  1055.      */ 
  1056.     public function getTokenStripe()
  1057.     {
  1058.         return $this->tokenStripe;
  1059.     }
  1060.     /**
  1061.      * Set the value of tokenStripe
  1062.      *
  1063.      * @return  self
  1064.      */ 
  1065.     public function setTokenStripe($tokenStripe)
  1066.     {
  1067.         $this->tokenStripe $tokenStripe;
  1068.         return $this;
  1069.     }
  1070.     public function getOrderType(): ?string
  1071.     {
  1072.         return $this->orderType;
  1073.     }
  1074.     public function setOrderType(?string $orderType): self
  1075.     {
  1076.         $this->orderType $orderType;
  1077.         return $this;
  1078.     }
  1079.     /**
  1080.      * Get the value of deletedAt
  1081.      */ 
  1082.     public function getDeletedAt()
  1083.     {
  1084.         return $this->deletedAt;
  1085.     }
  1086.     /**
  1087.      * Set the value of deletedAt
  1088.      *
  1089.      * @return  self
  1090.      */ 
  1091.     public function setDeletedAt($deletedAt)
  1092.     {
  1093.         $this->deletedAt $deletedAt;
  1094.         return $this;
  1095.     }
  1096.     public function getStore(): ?Store
  1097.     {
  1098.         return $this->store;
  1099.     }
  1100.     public function setStore(?Store $store): self
  1101.     {
  1102.         $this->store $store;
  1103.         return $this;
  1104.     }
  1105.     public function getShipment(): ?Shipment
  1106.     {
  1107.         return $this->shipment;
  1108.     }
  1109.     public function setShipment(?Shipment $shipment): self
  1110.     {
  1111.         $this->shipment $shipment;
  1112.         return $this;
  1113.     }
  1114.     public function getInvoice(): ?Invoice
  1115.     {
  1116.         return $this->invoice;
  1117.     }
  1118.     public function setInvoice(?Invoice $invoice): self
  1119.     {
  1120.         $this->invoice $invoice;
  1121.         return $this;
  1122.     }
  1123.     /**
  1124.      * Get the value of shippingAddress
  1125.      */ 
  1126.     public function getShippingAddress()
  1127.     {
  1128.         return $this->shippingAddress;
  1129.     }
  1130.     /**
  1131.      * Set the value of shippingAddress
  1132.      *
  1133.      * @return  self
  1134.      */ 
  1135.     public function setShippingAddress($shippingAddress)
  1136.     {
  1137.         $this->shippingAddress $shippingAddress;
  1138.         return $this;
  1139.     }
  1140.     public function getCreatedBy()
  1141.     {
  1142.         return $this->createdBy;
  1143.     }
  1144.     public function getDescription(): ?string
  1145.     {
  1146.         return $this->description;
  1147.     }
  1148.     public function setDescription(?string $description): self
  1149.     {
  1150.         $this->description $description;
  1151.         return $this;
  1152.     }
  1153.     #[Groups(['read'])]
  1154.     public function getStartProcessingAtText()
  1155.     {
  1156.         $value null;
  1157.         if($this->startDeliveryAt and $this->getShippingMethod()){
  1158.             $intervalDate = clone $this->startProcessingAt;
  1159.         $intervalInMinutes $this->shippingMethod->getShippingDuration() * 60;
  1160.         $intervalDate->modify(" + ".$intervalInMinutes." minutes");
  1161.         
  1162.         $value $this->startProcessingAt->format("d/m/Y H:i") ." - ".$intervalDate->format("H:i");
  1163.         }
  1164.         
  1165.         
  1166.         return $value;
  1167.         
  1168.     }
  1169.     
  1170.     #[Groups(['read'])]
  1171.     public function getCreatedAtText()
  1172.     {
  1173.         $value null;
  1174.         if($this->createdAt){
  1175.            
  1176.         
  1177.             $value $this->createdAt->format("d/m/Y H:i");
  1178.         }
  1179.         
  1180.         
  1181.         return $value;
  1182.     }
  1183.     
  1184.     #[Groups(['read'])]
  1185.     public function getPaidAtText()
  1186.     {
  1187.         $value null;
  1188.         if($this->paidAt){
  1189.             $value $this->paidAt->format("d/m/Y H:i");
  1190.         }
  1191.         return $value;
  1192.     }
  1193.     
  1194.     #[Groups(['read'])]
  1195.     public function getDeliveredAtText()
  1196.     {
  1197.         $value null;
  1198.         if($this->deliveredAt){
  1199.             $value $this->deliveredAt->format("d/m/Y H:i");
  1200.         }
  1201.         return $value;
  1202.     }
  1203.     
  1204.     #[Groups(['read'])]
  1205.     public function getStartDeliveryAtText()
  1206.     {
  1207.         
  1208.         $value null;
  1209.         if($this->startDeliveryAt and $this->getShippingMethod()){
  1210.             $intervalDate = clone $this->startDeliveryAt;
  1211.             $intervalInMinutes $this->shippingMethod->getShippingDuration() * 60;
  1212.             $intervalDate->modify(" + ".$intervalInMinutes." minutes");
  1213.             $value $this->startDeliveryAt->format("d/m/Y H:i") ." - ".$intervalDate->format("H:i");
  1214.         }
  1215.         
  1216.         
  1217.         return $value;
  1218.     }
  1219.     #[Groups(['read'])]
  1220.     public function getShippingMethodText()
  1221.     {
  1222.         $value null
  1223.         if($this->shippingMethod){
  1224.             $value $this->shippingMethod->getName();
  1225.         }
  1226.         return $value;
  1227.         
  1228.     }
  1229.     #[Groups(['read'])]
  1230.     public function getPaymentMethodText()
  1231.     {   
  1232.         $value null
  1233.         if($this->paymentMethod){
  1234.             $value $this->paymentMethod->getName();
  1235.         }
  1236.         return $value;
  1237.     }
  1238.     
  1239.     
  1240.         #[Groups(['read'])]
  1241.     public function getStatusText()
  1242.     {
  1243.         //$translated = $this->translator->trans($this->getSatus());
  1244.         
  1245.         
  1246.         $translatedStatusArray = [
  1247.                 "paid"=>"Réglé",
  1248.                 "canceled"=>"annulé",
  1249.                 "waiting"=>"Non réglé",
  1250.                 "partially-paid"=>"Réglé partiellement",
  1251.             ];
  1252.             
  1253.         if(array_key_exists($this->getStatus(),$translatedStatusArray)){
  1254.             return $translatedStatusArray[$this->getStatus()];
  1255.         }
  1256.         
  1257.         return  "Non réglé";
  1258.         
  1259.     }
  1260.     
  1261.     
  1262.     
  1263.     #[Groups(['read'])]
  1264.     public function getTotalProducts()
  1265.     {   
  1266.         $value 0
  1267.         foreach($this->getOrderItems() as $singleOrderItem){
  1268.             $defaultQuantityProduct 1;
  1269.             
  1270.             if($singleOrderItem->getProduct()){
  1271.                 if($singleOrderItem->getProduct()->getDefaultQuantity() > 0){
  1272.                     $defaultQuantityProduct $singleOrderItem->getProduct()->getDefaultQuantity();
  1273.                 }
  1274.             }
  1275.             
  1276.             
  1277.                 $value $value + ($singleOrderItem->getQuantity() * $defaultQuantityProduct );
  1278.             
  1279.             
  1280.         }
  1281.         
  1282.         return $value;
  1283.     }
  1284.     public function getProductSubscription(): ?ProductSubscription
  1285.     {
  1286.         return $this->productSubscription;
  1287.     }
  1288.     public function setProductSubscription(?ProductSubscription $productSubscription): self
  1289.     {
  1290.         // unset the owning side of the relation if necessary
  1291.         if ($productSubscription === null && $this->productSubscription !== null) {
  1292.             $this->productSubscription->setRelatedOrder(null);
  1293.         }
  1294.         // set the owning side of the relation if necessary
  1295.         if ($productSubscription !== null && $productSubscription->getRelatedOrder() !== $this) {
  1296.             $productSubscription->setRelatedOrder($this);
  1297.         }
  1298.         $this->productSubscription $productSubscription;
  1299.         return $this;
  1300.     }
  1301.     /**
  1302.      * Get the value of statusShipping
  1303.      */ 
  1304.     public function getStatusShipping()
  1305.     {
  1306.         return $this->statusShipping;
  1307.     }
  1308.     /**
  1309.      * Set the value of statusShipping
  1310.      *
  1311.      * @return  self
  1312.      */ 
  1313.     public function setStatusShipping($statusShipping)
  1314.     {
  1315.         $this->statusShipping $statusShipping;
  1316.         
  1317.         // Automatically set deliveredAt when status changes to "livree"
  1318.         $this->updateDeliveredAtIfNeeded();
  1319.         return $this;
  1320.     }
  1321.     
  1322.     public function getCollectLng()
  1323.     {
  1324.         return $this->collectLng;
  1325.     }
  1326.     public function getCollectLat()
  1327.     {
  1328.         return $this->collectLat;
  1329.     }
  1330.     
  1331.     public function setCollectLng($collectLng)
  1332.     {
  1333.         $this->collectLng $collectLng;
  1334.         return $this;
  1335.     }
  1336.     
  1337.         public function setCollectLat($collectLat)
  1338.     {
  1339.         $this->collectLat $collectLat;
  1340.         return $this;
  1341.     }
  1342.     
  1343.     
  1344.     
  1345.         public function getShippingLng()
  1346.     {
  1347.         return $this->shippingLng;
  1348.     }
  1349.     public function getShippingLat()
  1350.     {
  1351.         return $this->shippingLat;
  1352.     }
  1353.     
  1354.     public function setShippingLng($shippingLng)
  1355.     {
  1356.         $this->shippingLng $shippingLng;
  1357.         return $this;
  1358.     }
  1359.     
  1360.         public function setShippingLat($shippingLat)
  1361.     {
  1362.         $this->shippingLat $shippingLat;
  1363.         return $this;
  1364.     }
  1365.         public function getMetaData(): ?array
  1366.         {
  1367.             return $this->metaData;
  1368.         }
  1369.         public function setMetaData(?array $metaData): static
  1370.         {
  1371.             $this->metaData $metaData;
  1372.             return $this;
  1373.         }
  1374.         public function getDefaultCurrency(): ?string
  1375.         {
  1376.             return $this->defaultCurrency;
  1377.         }
  1378.         public function setDefaultCurrency(?string $defaultCurrency): static
  1379.         {
  1380.             $this->defaultCurrency $defaultCurrency;
  1381.             return $this;
  1382.         }
  1383.         public function getExtraShippingFees(): ?float
  1384.         {
  1385.             return $this->extraShippingFees;
  1386.         }
  1387.         public function setExtraShippingFees(?float $extraShippingFees): static
  1388.         {
  1389.             $this->extraShippingFees $extraShippingFees;
  1390.             return $this;
  1391.         }
  1392.         public function getExtraShippingMethodName(): ?string
  1393.         {
  1394.             return $this->extraShippingMethodName;
  1395.         }
  1396.         public function setExtraShippingMethodName(?string $extraShippingMethodName): static
  1397.         {
  1398.             $this->extraShippingMethodName $extraShippingMethodName;
  1399.             return $this;
  1400.         }
  1401.         public function getExtraShippingInfos(): ?string
  1402.         {
  1403.             return $this->extraShippingInfos;
  1404.         }
  1405.         public function setExtraShippingInfos(?string $extraShippingInfos): static
  1406.         {
  1407.             $this->extraShippingInfos $extraShippingInfos;
  1408.             return $this;
  1409.         }
  1410.     
  1411.     public function getShippingMonth(){
  1412.         $result "";
  1413.         if($this->getStartDeliveryAt()){
  1414.             $result $this->getStartDeliveryAt()->format('M');
  1415.         }
  1416.         return $result;
  1417.     }
  1418.     public function getNotifyCustomer(): ?bool
  1419.     {
  1420.         return $this->notifyCustomer;
  1421.     }
  1422.     public function setNotifyCustomer(?bool $notifyCustomer): static
  1423.     {
  1424.         $this->notifyCustomer $notifyCustomer;
  1425.         return $this;
  1426.     }
  1427.     public function getUpdateNotificationMessage(): ?string
  1428.     {
  1429.         return $this->updateNotificationMessage;
  1430.     }
  1431.     public function setUpdateNotificationMessage(?string $updateNotificationMessage): static
  1432.     {
  1433.         $this->updateNotificationMessage $updateNotificationMessage;
  1434.         return $this;
  1435.     }
  1436.     
  1437. }