src/Entity/Gos/Orders.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\Gos\AdditionalAccess\AdditionalAccessBeneficiary;
  4. use App\Entity\Gos\AdditionalAccess\UserAdditionalAccessOffer;
  5. use App\Entity\Gos\VirtualCurrency\VirtualCurrencyTransaction;
  6. use App\Entity\OrdersInterface;
  7. use App\Enum\DocumentDistributionChannels;
  8. use App\Model\TaxStatement;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. /**
  13.  * Orders
  14.  *
  15.  * @ORM\Table()
  16.  * @ORM\Entity(repositoryClass="App\Repository\OrdersRepository")
  17.  * @ORM\HasLifecycleCallbacks
  18.  */
  19. class Orders implements OrdersInterface
  20. {
  21.     /**
  22.      * @var int
  23.      *
  24.      * @ORM\Column(name="id", type="integer")
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue(strategy="AUTO")
  27.      */
  28.     private $id;
  29.     /**
  30.      * @ORM\Column(type="string", length=150, unique=true, nullable=true)
  31.      */
  32.     private $ordTran;
  33.     /**
  34.      * @ORM\Column(type="text", length=1000, nullable=true)
  35.      */
  36.     private $comment;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      */
  42.     private $couponCode;
  43.     /**
  44.      * @var float
  45.      *
  46.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  47.      */
  48.     private $totalPriceGross;
  49.     /**
  50.      * @var float
  51.      *
  52.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  53.      */
  54.     private $totalPriceNet;
  55.     /**
  56.      * @var float
  57.      *
  58.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  59.      */
  60.     private $totalPriceBeforeCouponGross;
  61.     /**
  62.      * @var float
  63.      *
  64.      * @ORM\Column(type="float", precision=18, scale=2, nullable=true)
  65.      */
  66.     private $totalPriceBeforeCouponNet;
  67.     /**
  68.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  69.      */
  70.     private $receiveAdvertising;
  71.     /**
  72.      * @ORM\Column(type="string", length=128, nullable=true)
  73.      */
  74.     private $actionNumber;
  75.     /**
  76.      * @ORM\Column(type="string", length=100, nullable=true)
  77.      */
  78.     private $fromSource;
  79.     /**
  80.      * @ORM\Column(type="string", length=100, nullable=true)
  81.      */
  82.     private $campaign;
  83.     /**
  84.      * @ORM\Column(type="string", length=100, nullable=true)
  85.      */
  86.     private $campaignChannel;
  87.     /**
  88.      * @ORM\Column(type="string", length=255, nullable=true)
  89.      */
  90.     private $buttonParameters;
  91.     /**
  92.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderPart", mappedBy="orders", cascade={"persist"})
  93.      */
  94.     private $orderPart;
  95.     /**
  96.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Participants", mappedBy="orders", cascade={"persist"})
  97.      */
  98.     private $participants;
  99.     /**
  100.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Address", inversedBy="orders")
  101.      * @ORM\JoinColumn()
  102.      */
  103.     private $address;
  104.     /**
  105.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\User", inversedBy="orders")
  106.      * @ORM\JoinColumn()
  107.      */
  108.     private $user;
  109.     /**
  110.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="orders")
  111.      * @ORM\JoinColumn()
  112.      */
  113.     private $portalSettings;
  114.     /**
  115.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\OrderType", inversedBy="orders")
  116.      * @ORM\JoinColumn()
  117.      */
  118.     private $orderType;
  119.     /**
  120.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderTerm", mappedBy="orders")
  121.      */
  122.     private $orderTerms;
  123.     /**
  124.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\SalesManagoEvent", mappedBy="orders")
  125.      */
  126.     private $salesManagoEvent;
  127.     /**
  128.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\UserTerms", mappedBy="orders")
  129.      */
  130.     private $userTerms;
  131.     /**
  132.      * @ORM\Column(type="string", length=15, nullable=true)
  133.      */
  134.     private $client_ipv4;
  135.     /**
  136.      * @ORM\Column(type="string", length=255, nullable=true)
  137.      */
  138.     private $client_host;
  139.     /**
  140.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\NoTaxType", inversedBy="orders")
  141.      */
  142.     private $noTaxType;
  143.     /**
  144.      * @ORM\Column(type="string", length=255, nullable=true)
  145.      */
  146.     private $noTaxPublicSectorUnit;
  147.     /**
  148.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\TouchPoint", mappedBy="order")
  149.      */
  150.     private $touchPoint;
  151.     /**
  152.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\TouchPointAll", mappedBy="order")
  153.      */
  154.     private $touchPointAll;
  155.     /**
  156.      * @ORM\OneToMany(targetEntity="Gift", mappedBy="buyerOrder", cascade={"persist"})
  157.      */
  158.     private $buyerGift;
  159.     /**
  160.      * @ORM\OneToOne(targetEntity="Gift", mappedBy="recipientOrder")
  161.      */
  162.     private $recipientGift;
  163.     /**
  164.      * @ORM\ManyToOne(targetEntity="Country", inversedBy="orders")
  165.      * @ORM\JoinColumn()
  166.      */
  167.     private $country;
  168.     /**
  169.      * @ORM\ManyToOne(targetEntity="PaymentSystem", inversedBy="orders")
  170.      * @ORM\JoinColumn()
  171.      */
  172.     private $paymentSystem;
  173.     /**
  174.      * @ORM\OneToMany(targetEntity="BraintreeResponse", mappedBy="order")
  175.      */
  176.     private $braintreeResponse;
  177.     /**
  178.      * @ORM\Column(type="datetime")
  179.      */
  180.     private $createdAt;
  181.     /**
  182.      * @ORM\Column(type="datetime", nullable=true)
  183.      */
  184.     private $updatedAt;
  185.     /**
  186.      * @ORM\Column(type="datetime", nullable=true)
  187.      */
  188.     private $deletedAt;
  189.     /**
  190.      * @ORM\Column(type="string", length=255, nullable=true)
  191.      */
  192.     private $infoline;
  193.     /**
  194.      * @ORM\Column(type="string", length=255, nullable=true)
  195.      */
  196.     private $postOrder;
  197.     /**
  198.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\User", mappedBy="orderDuringRegistration")
  199.      */
  200.     private $userFirstOrder;
  201.     /**
  202.      * @ORM\Column(type="text", nullable=true)
  203.      */
  204.     private $marketing;
  205.     /**
  206.      * @ORM\OneToOne(targetEntity="TeleOrder", mappedBy="mainOrder", cascade={"persist", "remove"})
  207.      */
  208.     private $teleOrder;
  209.     /**
  210.      * @ORM\Column(type="datetime", nullable=true)
  211.      */
  212.     private $foExportetAt;
  213.     /**
  214.      * @ORM\OneToMany(targetEntity=ExportLog::class, mappedBy="orders")
  215.      */
  216.     private $exportLogs;
  217.     /**
  218.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  219.      */
  220.     private $isTest;
  221.     /**
  222.      * @ORM\Column(type="boolean", nullable=true)
  223.      */
  224.     private $isGATransactionSent;
  225.     /**
  226.      * @ORM\Column(type="string", length=255, nullable=true)
  227.      */
  228.     private $lab;
  229.     /**
  230.      * @ORM\Column(type="boolean", options={"default":0})
  231.      */
  232.     private $isSbExportNeeded false;
  233.     /**
  234.      * @ORM\Column(type="datetime", nullable=true)
  235.      */
  236.     private $sbExportAt;
  237.     /**
  238.      * @ORM\Column(type="integer", options={"default": 0})
  239.      */
  240.     private $extendedPaymentTime 0;
  241.     /**
  242.      * @ORM\ManyToOne(targetEntity=ShippingType::class)
  243.      */
  244.     private $shippingType;
  245.     /**
  246.      * @ORM\OneToOne(targetEntity=OrderTeleConsultant::class, cascade={"remove"})
  247.      */
  248.     private $teleConsultant;
  249.     /**
  250.      * @ORM\Column(type="string", length=255, nullable=true)
  251.      */
  252.     private $exportedToSbBy;
  253.     /**
  254.      * @ORM\OneToMany(targetEntity=UserCard::class, mappedBy="orders")
  255.      */
  256.     private $userCards;
  257.     /**
  258.      * @ORM\Column(type="text", nullable=true)
  259.      */
  260.     private $fromSourceAll;
  261.     /**
  262.      * @ORM\Column(type="text", nullable=true)
  263.      */
  264.     private $actionNumberAll;
  265.     /**
  266.      * @ORM\OneToOne(targetEntity=ProductVariantReviewNotification::class, mappedBy="orders")
  267.      */
  268.     private $productVariantsReviewNotification;
  269.     /**
  270.      * @ORM\Column(type="datetime", nullable=true)
  271.      */
  272.     private $paymentRewardDeadline;
  273.     /**
  274.      * @ORM\ManyToOne(targetEntity=UserAdditionalAccessOffer::class, inversedBy="orders")
  275.      */
  276.     private $userAdditionalAccessOffer;
  277.     /**
  278.      * @ORM\OneToMany(targetEntity=AdditionalAccessBeneficiary::class, mappedBy="orders", orphanRemoval=true)
  279.      */
  280.     private $additionalAccessBeneficiaries;
  281.     /**
  282.      * @ORM\Column(type="boolean", nullable=true)
  283.      */
  284.     private $teleOrderSplit;
  285.     /**
  286.      * @ORM\Column(type="string", length=255, nullable=true)
  287.      */
  288.     private $burAssignedSupportId;
  289.     /**
  290.      * @ORM\Column(type="boolean", nullable=true)
  291.      */
  292.     private ?bool $onHold;
  293.     /**
  294.      * @ORM\Column(type="boolean", nullable=true)
  295.      */
  296.     private ?bool $professionalNature null;
  297.     /** @ORM\PrePersist() */
  298.     public function prePersist()
  299.     {
  300.         $this->createdAt = new \DateTime();
  301.     }
  302.     /** @ORM\PreUpdate() */
  303.     public function preUpdate()
  304.     {
  305.         $this->updatedAt = new \DateTime();
  306.     }
  307.     public function __toString()
  308.     {
  309.         return (string)$this->ordTran;
  310.     }
  311.     public function getObjectVars()
  312.     {
  313.         return get_object_vars($this);
  314.     }
  315.     public function getTotalShippingCost($returnNet true)
  316.     {
  317.         $totalShippingCostNet   0;
  318.         $totalShippingCostGross 0;
  319.         foreach ($this->getOrderPart() as $orderPart)
  320.         {
  321.             /** @var OrderPart $orderPart */
  322.             $totalShippingCostNet   += $orderPart->getTotalShippingCostNet();
  323.             $totalShippingCostGross += $orderPart->getTotalShippingCostGross();
  324.         }
  325.         return $returnNet $totalShippingCostNet $totalShippingCostGross;
  326.     }
  327.     public function getTotalPriceGrossWithShipping()
  328.     {
  329.         return $this->getTotalPriceGross() + $this->getTotalShippingCost(false);
  330.     }
  331.     public function getTotalPriceNetWithShipping()
  332.     {
  333.         return $this->getTotalPriceNet() + $this->getTotalShippingCost();
  334.     }
  335.     public function hasTestProduct()
  336.     {
  337.         /** @var OrderPart $orderPart */
  338.         foreach ($this->getOrderPart() as $orderPart)
  339.         {
  340.             if ($orderPart->hasTestProduct())
  341.             {
  342.                 return true;
  343.             }
  344.         }
  345.         return false;
  346.     }
  347.     //------------------------------ setters & getters
  348.     /**
  349.      * Get id
  350.      *
  351.      * @return int
  352.      */
  353.     public function getId()
  354.     {
  355.         return $this->id;
  356.     }
  357.     /**
  358.      * Set ordTran
  359.      *
  360.      * @param string $ordTran
  361.      *
  362.      * @return Orders
  363.      */
  364.     public function setOrdTran($ordTran)
  365.     {
  366.         $this->ordTran $ordTran;
  367.         return $this;
  368.     }
  369.     /**
  370.      * Get ordTran
  371.      *
  372.      * @return string
  373.      */
  374.     public function getOrdTran()
  375.     {
  376.         return $this->ordTran;
  377.     }
  378.     public function getOrdTranForSummaryLink()
  379.     {
  380.         foreach ($this->orderPart as $orderPart)
  381.         {
  382.             if (!empty($orderPart->getOrdTran()) && strpos($orderPart->getOrdTran(), 'WF') !== false)
  383.             {
  384.                 return $orderPart->getOrdTran();
  385.             }
  386.         }
  387.         return $this->ordTran;
  388.     }
  389.     /**
  390.      * Set createdAt
  391.      *
  392.      * @param \DateTime $createdAt
  393.      *
  394.      * @return Orders
  395.      */
  396.     public function setCreatedAt($createdAt)
  397.     {
  398.         $this->createdAt $createdAt;
  399.         return $this;
  400.     }
  401.     /**
  402.      * Get createdAt
  403.      *
  404.      * @return \DateTime
  405.      */
  406.     public function getCreatedAt()
  407.     {
  408.         return $this->createdAt;
  409.     }
  410.     /**
  411.      * Set updatedAt
  412.      *
  413.      * @param \DateTime $updatedAt
  414.      *
  415.      * @return Orders
  416.      */
  417.     public function setUpdatedAt($updatedAt)
  418.     {
  419.         $this->updatedAt $updatedAt;
  420.         return $this;
  421.     }
  422.     /**
  423.      * Get updatedAt
  424.      *
  425.      * @return \DateTime
  426.      */
  427.     public function getUpdatedAt()
  428.     {
  429.         return $this->updatedAt;
  430.     }
  431.     /**
  432.      * Set user
  433.      *
  434.      * @param \App\Entity\Gos\User $user
  435.      *
  436.      * @return Orders
  437.      */
  438.     public function setUser(\App\Entity\Gos\User $user null)
  439.     {
  440.         $this->user $user;
  441.         return $this;
  442.     }
  443.     /**
  444.      * Get user
  445.      *
  446.      * @return \App\Entity\Gos\User
  447.      */
  448.     public function getUser()
  449.     {
  450.         return $this->user;
  451.     }
  452.     /**
  453.      * Set orderType
  454.      *
  455.      * @param \App\Entity\Gos\OrderType $orderType
  456.      *
  457.      * @return Orders
  458.      */
  459.     public function setOrderType(\App\Entity\Gos\OrderType $orderType null)
  460.     {
  461.         $this->orderType $orderType;
  462.         return $this;
  463.     }
  464.     /**
  465.      * Get orderType
  466.      *
  467.      * @return \App\Entity\Gos\OrderType
  468.      */
  469.     public function getOrderType()
  470.     {
  471.         return $this->orderType;
  472.     }
  473.     /**
  474.      * Set comment
  475.      *
  476.      * @param string $comment
  477.      *
  478.      * @return Orders
  479.      */
  480.     public function setComment($comment)
  481.     {
  482.         $this->comment $comment;
  483.         return $this;
  484.     }
  485.     /**
  486.      * Get comment
  487.      *
  488.      * @return string
  489.      */
  490.     public function getComment()
  491.     {
  492.         return $this->comment;
  493.     }
  494.     /**
  495.      * Set address
  496.      *
  497.      * @param \App\Entity\Gos\Address $address
  498.      *
  499.      * @return Orders
  500.      */
  501.     public function setAddress(\App\Entity\Gos\Address $address null)
  502.     {
  503.         $this->address $address;
  504.         return $this;
  505.     }
  506.     /**
  507.      * Get address
  508.      *
  509.      * @return \App\Entity\Gos\Address
  510.      */
  511.     public function getAddress()
  512.     {
  513.         return $this->address;
  514.     }
  515.     /**
  516.      * Set receiveAdvertising
  517.      *
  518.      * @param boolean $receiveAdvertising
  519.      *
  520.      * @return Orders
  521.      */
  522.     public function setReceiveAdvertising($receiveAdvertising)
  523.     {
  524.         $this->receiveAdvertising $receiveAdvertising;
  525.         return $this;
  526.     }
  527.     /**
  528.      * Get receiveAdvertising
  529.      *
  530.      * @return boolean
  531.      */
  532.     public function getReceiveAdvertising()
  533.     {
  534.         return $this->receiveAdvertising;
  535.     }
  536.     /**
  537.      * Set totalPriceGross
  538.      *
  539.      * @param float $totalPriceGross
  540.      *
  541.      * @return Orders
  542.      */
  543.     public function setTotalPriceGross($totalPriceGross)
  544.     {
  545.         $this->totalPriceGross round($totalPriceGross2);
  546.         return $this;
  547.     }
  548.     /**
  549.      * Get totalPriceGross
  550.      *
  551.      * @return float
  552.      */
  553.     public function getTotalPriceGross()
  554.     {
  555.         return $this->totalPriceGross;
  556.     }
  557.     /**
  558.      * Set totalPriceNet
  559.      *
  560.      * @param float $totalPriceNet
  561.      *
  562.      * @return Orders
  563.      */
  564.     public function setTotalPriceNet($totalPriceNet)
  565.     {
  566.         $this->totalPriceNet round($totalPriceNet,2);
  567.         return $this;
  568.     }
  569.     /**
  570.      * Get totalPriceNet
  571.      *
  572.      * @return float
  573.      */
  574.     public function getTotalPriceNet()
  575.     {
  576.         return $this->totalPriceNet;
  577.     }
  578.     /**
  579.      * Set totalPriceBeforeCouponGross
  580.      *
  581.      * @param float $totalPriceBeforeCouponGross
  582.      *
  583.      * @return Orders
  584.      */
  585.     public function setTotalPriceBeforeCouponGross($totalPriceBeforeCouponGross)
  586.     {
  587.         $this->totalPriceBeforeCouponGross round($totalPriceBeforeCouponGross,);
  588.         return $this;
  589.     }
  590.     /**
  591.      * Get totalPriceBeforeCouponGross
  592.      *
  593.      * @return float
  594.      */
  595.     public function getTotalPriceBeforeCouponGross()
  596.     {
  597.         return $this->totalPriceBeforeCouponGross;
  598.     }
  599.     /**
  600.      * Set totalPriceBeforeCouponNet
  601.      *
  602.      * @param float $totalPriceBeforeCouponNet
  603.      *
  604.      * @return Orders
  605.      */
  606.     public function setTotalPriceBeforeCouponNet($totalPriceBeforeCouponNet)
  607.     {
  608.         $this->totalPriceBeforeCouponNet round($totalPriceBeforeCouponNet,2);
  609.         return $this;
  610.     }
  611.     /**
  612.      * Get totalPriceBeforeCouponNet
  613.      *
  614.      * @return float
  615.      */
  616.     public function getTotalPriceBeforeCouponNet()
  617.     {
  618.         return $this->totalPriceBeforeCouponNet;
  619.     }
  620.     /**
  621.      * Set couponCode
  622.      *
  623.      * @param string $couponCode
  624.      *
  625.      * @return Orders
  626.      */
  627.     public function setCouponCode($couponCode)
  628.     {
  629.         $this->couponCode $couponCode;
  630.         return $this;
  631.     }
  632.     /**
  633.      * Get couponCode
  634.      *
  635.      * @return string
  636.      */
  637.     public function getCouponCode()
  638.     {
  639.         return $this->couponCode;
  640.     }
  641.     /**
  642.      * Constructor
  643.      */
  644.     public function __construct()
  645.     {
  646.         $this->orderProductVariant  = new ArrayCollection();
  647.         $this->orderPart            = new ArrayCollection();
  648.         $this->participants         = new ArrayCollection();
  649.         $this->orderTerms           = new ArrayCollection();
  650.         $this->salesManagoEvent     = new ArrayCollection();
  651.         $this->userTerms            = new ArrayCollection();
  652.         $this->buyerGift            = new ArrayCollection();
  653.         $this->braintreeResponse    = new ArrayCollection();
  654.         $this->exportLogs           = new ArrayCollection();
  655.         $this->userCards            = new ArrayCollection();
  656.         $this->additionalAccessBeneficiaries = new ArrayCollection();
  657.     }
  658.     /**
  659.      * Set actionNumber
  660.      *
  661.      * @param string $actionNumber
  662.      *
  663.      * @return Orders
  664.      */
  665.     public function setActionNumber($actionNumber)
  666.     {
  667.         $this->actionNumber $actionNumber;
  668.         return $this;
  669.     }
  670.     /**
  671.      * Get actionNumber
  672.      *
  673.      * @return string
  674.      */
  675.     public function getActionNumber()
  676.     {
  677.         return $this->actionNumber;
  678.     }
  679.     /**
  680.      * Set fromSource
  681.      *
  682.      * @param string $fromSource
  683.      *
  684.      * @return Orders
  685.      */
  686.     public function setFromSource($fromSource)
  687.     {
  688.         $this->fromSource $fromSource;
  689.         return $this;
  690.     }
  691.     /**
  692.      * Get fromSource
  693.      *
  694.      * @return string
  695.      */
  696.     public function getFromSource()
  697.     {
  698.         return $this->fromSource;
  699.     }
  700.     /**
  701.      * Set campaign
  702.      *
  703.      * @param string $campaign
  704.      * @return Orders
  705.      */
  706.     public function setCampaign($campaign)
  707.     {
  708.         $this->campaign $campaign;
  709.         return $this;
  710.     }
  711.     /**
  712.      * Get campaign
  713.      *
  714.      * @return string
  715.      */
  716.     public function getCampaign()
  717.     {
  718.         return $this->campaign;
  719.     }
  720.     /**
  721.      * Set campaignChannel
  722.      *
  723.      * @param string $campaignChannel
  724.      * @return Orders
  725.      */
  726.     public function setCampaignChannel($campaignChannel)
  727.     {
  728.         $this->campaignChannel $campaignChannel;
  729.         return $this;
  730.     }
  731.     /**
  732.      * Get campaignChannel
  733.      *
  734.      * @return string
  735.      */
  736.     public function getCampaignChannel()
  737.     {
  738.         return $this->campaignChannel;
  739.     }
  740.     /**
  741.      * Add orderPart
  742.      *
  743.      * @param \App\Entity\Gos\OrderPart $orderPart
  744.      *
  745.      * @return Orders
  746.      */
  747.     public function addOrderPart(\App\Entity\Gos\OrderPart $orderPart)
  748.     {
  749.         $this->orderPart[] = $orderPart;
  750.         return $this;
  751.     }
  752.     /**
  753.      * Remove orderPart
  754.      *
  755.      * @param \App\Entity\Gos\OrderPart $orderPart
  756.      */
  757.     public function removeOrderPart(\App\Entity\Gos\OrderPart $orderPart)
  758.     {
  759.         $this->orderPart->removeElement($orderPart);
  760.     }
  761.     /**
  762.      * Get orderPart
  763.      *
  764.      * @return \Doctrine\Common\Collections\Collection
  765.      */
  766.     public function getOrderPart()
  767.     {
  768.         return $this->orderPart;
  769.     }
  770.     /**
  771.      * Set portalSettings
  772.      *
  773.      * @param \App\Entity\Gos\PortalSettings $portalSettings
  774.      *
  775.      * @return Orders
  776.      */
  777.     public function setPortalSettings(\App\Entity\Gos\PortalSettings $portalSettings null)
  778.     {
  779.         $this->portalSettings $portalSettings;
  780.         return $this;
  781.     }
  782.     /**
  783.      * Get portalSettings
  784.      *
  785.      * @return \App\Entity\Gos\PortalSettings
  786.      */
  787.     public function getPortalSettings()
  788.     {
  789.         return $this->portalSettings;
  790.     }
  791.     /**
  792.      * Add orderTerm
  793.      *
  794.      * @param \App\Entity\Gos\OrderTerm $orderTerm
  795.      *
  796.      * @return Orders
  797.      */
  798.     public function addOrderTerm(\App\Entity\Gos\OrderTerm $orderTerm)
  799.     {
  800.         $this->orderTerms[] = $orderTerm;
  801.         return $this;
  802.     }
  803.     /**
  804.      * Remove orderTerm
  805.      *
  806.      * @param \App\Entity\Gos\OrderTerm $orderTerm
  807.      */
  808.     public function removeOrderTerm(\App\Entity\Gos\OrderTerm $orderTerm)
  809.     {
  810.         $this->orderTerms->removeElement($orderTerm);
  811.     }
  812.     /**
  813.      * Get orderTerms
  814.      *
  815.      * @return \Doctrine\Common\Collections\Collection
  816.      */
  817.     public function getOrderTerms()
  818.     {
  819.         return $this->orderTerms;
  820.     }
  821.     /**
  822.      * Set clientIpv4
  823.      *
  824.      * @param string $clientIpv4
  825.      *
  826.      * @return Orders
  827.      */
  828.     public function setClientIpv4($clientIpv4)
  829.     {
  830.         $this->client_ipv4 $clientIpv4;
  831.         return $this;
  832.     }
  833.     /**
  834.      * Get clientIpv4
  835.      *
  836.      * @return string
  837.      */
  838.     public function getClientIpv4()
  839.     {
  840.         return $this->client_ipv4;
  841.     }
  842.     /**
  843.      * Set clientHost
  844.      *
  845.      * @param string $clientHost
  846.      *
  847.      * @return Orders
  848.      */
  849.     public function setClientHost($clientHost)
  850.     {
  851.         $this->client_host $clientHost;
  852.         return $this;
  853.     }
  854.     /**
  855.      * Get clientHost
  856.      *
  857.      * @return string
  858.      */
  859.     public function getClientHost()
  860.     {
  861.         return $this->client_host;
  862.     }
  863.     /**
  864.      * Set deletedAt
  865.      *
  866.      * @param \DateTime $deletedAt
  867.      *
  868.      * @return Orders
  869.      */
  870.     public function setDeletedAt($deletedAt)
  871.     {
  872.         $this->deletedAt $deletedAt;
  873.         return $this;
  874.     }
  875.     /**
  876.      * Get deletedAt
  877.      *
  878.      * @return \DateTime
  879.      */
  880.     public function getDeletedAt()
  881.     {
  882.         return $this->deletedAt;
  883.     }
  884.     /**
  885.      * Add userTerm
  886.      *
  887.      * @param \App\Entity\Gos\UserTerms $userTerm
  888.      *
  889.      * @return Orders
  890.      */
  891.     public function addUserTerm(\App\Entity\Gos\UserTerms $userTerm)
  892.     {
  893.         $this->userTerms[] = $userTerm;
  894.         return $this;
  895.     }
  896.     /**
  897.      * Remove userTerm
  898.      *
  899.      * @param \App\Entity\Gos\UserTerms $userTerm
  900.      */
  901.     public function removeUserTerm(\App\Entity\Gos\UserTerms $userTerm)
  902.     {
  903.         $this->userTerms->removeElement($userTerm);
  904.     }
  905.     /**
  906.      * Get userTerms
  907.      *
  908.      * @return \Doctrine\Common\Collections\Collection
  909.      */
  910.     public function getUserTerms()
  911.     {
  912.         return $this->userTerms;
  913.     }
  914.     /**
  915.      * Add salesManagoEvent
  916.      *
  917.      * @param \App\Entity\Gos\SalesManagoEvent $salesManagoEvent
  918.      *
  919.      * @return Orders
  920.      */
  921.     public function addSalesManagoEvent(\App\Entity\Gos\SalesManagoEvent $salesManagoEvent)
  922.     {
  923.         $this->salesManagoEvent[] = $salesManagoEvent;
  924.         return $this;
  925.     }
  926.     /**
  927.      * Remove salesManagoEvent
  928.      *
  929.      * @param \App\Entity\Gos\SalesManagoEvent $salesManagoEvent
  930.      */
  931.     public function removeSalesManagoEvent(\App\Entity\Gos\SalesManagoEvent $salesManagoEvent)
  932.     {
  933.         $this->salesManagoEvent->removeElement($salesManagoEvent);
  934.     }
  935.     /**
  936.      * Get salesManagoEvent
  937.      *
  938.      * @return \Doctrine\Common\Collections\Collection
  939.      */
  940.     public function getSalesManagoEvent()
  941.     {
  942.         return $this->salesManagoEvent;
  943.     }
  944.     public function getInfoline(): ?string
  945.     {
  946.         return $this->infoline;
  947.     }
  948.     public function setInfoline(?string $infoline): self
  949.     {
  950.         $this->infoline $infoline;
  951.         return $this;
  952.     }
  953.     public function getPostOrder(): ?string
  954.     {
  955.         return $this->postOrder;
  956.     }
  957.     public function setPostOrder(?string $postOrder): self
  958.     {
  959.         $this->postOrder $postOrder;
  960.         return $this;
  961.     }
  962.     public function getNoTaxPublicSectorUnit(): ?string
  963.     {
  964.         return $this->noTaxPublicSectorUnit;
  965.     }
  966.     public function setNoTaxPublicSectorUnit(?string $noTaxPublicSectorUnit): self
  967.     {
  968.         $this->noTaxPublicSectorUnit $noTaxPublicSectorUnit;
  969.         return $this;
  970.     }
  971.     public function getNoTaxType(): ?NoTaxType
  972.     {
  973.         return $this->noTaxType;
  974.     }
  975.     public function setNoTaxType(?NoTaxType $noTaxType): self
  976.     {
  977.         $this->noTaxType $noTaxType;
  978.         return $this;
  979.     }
  980.     public function getTouchPoint(): ?TouchPoint
  981.     {
  982.         return $this->touchPoint;
  983.     }
  984.     public function setTouchPoint(?TouchPoint $touchPoint): self
  985.     {
  986.         $this->touchPoint $touchPoint;
  987.         // set (or unset) the owning side of the relation if necessary
  988.         $newOrder $touchPoint === null null $this;
  989.         if ($newOrder !== $touchPoint->getOrder()) {
  990.             $touchPoint->setOrder($newOrder);
  991.         }
  992.         return $this;
  993.     }
  994.     public function getBuyerGift(): ?Collection
  995.     {
  996.         return $this->buyerGift;
  997.     }
  998.     public function setBuyerGift(?Gift $buyerGift): self
  999.     {
  1000.         $this->buyerGift $buyerGift;
  1001.         // set (or unset) the owning side of the relation if necessary
  1002.         $newBuyerOrder $buyerGift === null null $this;
  1003.         if ($newBuyerOrder !== $buyerGift->getBuyerOrder()) {
  1004.             $buyerGift->setBuyerOrder($newBuyerOrder);
  1005.         }
  1006.         return $this;
  1007.     }
  1008.     public function getRecipientGift(): ?Gift
  1009.     {
  1010.         return $this->recipientGift;
  1011.     }
  1012.     public function setRecipientGift(?Gift $recipientGift): self
  1013.     {
  1014.         $this->recipientGift $recipientGift;
  1015.         // set (or unset) the owning side of the relation if necessary
  1016.         $newRecipientOrder $recipientGift === null null $this;
  1017.         if ($newRecipientOrder !== $recipientGift->getRecipientOrder()) {
  1018.             $recipientGift->setRecipientOrder($newRecipientOrder);
  1019.         }
  1020.         return $this;
  1021.     }
  1022.     public function addBuyerGift(Gift $buyerGift): self
  1023.     {
  1024.         if (!$this->buyerGift->contains($buyerGift)) {
  1025.             $this->buyerGift[] = $buyerGift;
  1026.             $buyerGift->setBuyerOrder($this);
  1027.         }
  1028.         return $this;
  1029.     }
  1030.     public function removeBuyerGift(Gift $buyerGift): self
  1031.     {
  1032.         if ($this->buyerGift->contains($buyerGift)) {
  1033.             $this->buyerGift->removeElement($buyerGift);
  1034.             // set the owning side to null (unless already changed)
  1035.             if ($buyerGift->getBuyerOrder() === $this) {
  1036.                 $buyerGift->setBuyerOrder(null);
  1037.             }
  1038.         }
  1039.         return $this;
  1040.     }
  1041.     public function getTouchPointAll(): ?TouchPointAll
  1042.     {
  1043.         return $this->touchPointAll;
  1044.     }
  1045.     public function setTouchPointAll(?TouchPointAll $touchPointAll): self
  1046.     {
  1047.         $this->touchPointAll $touchPointAll;
  1048.         // set (or unset) the owning side of the relation if necessary
  1049.         $newOrder $touchPointAll === null null $this;
  1050.         if ($newOrder !== $touchPointAll->getOrder()) {
  1051.             $touchPointAll->setOrder($newOrder);
  1052.         }
  1053.         return $this;
  1054.     }
  1055.     public function getCountry(): ?Country
  1056.     {
  1057.         return $this->country;
  1058.     }
  1059.     public function setCountry(?Country $country): self
  1060.     {
  1061.         $this->country $country;
  1062.         return $this;
  1063.     }
  1064.     public function getUserFirstOrder(): ?User
  1065.     {
  1066.         return $this->userFirstOrder;
  1067.     }
  1068.     public function setUserFirstOrder(?User $user): self
  1069.     {
  1070.         $this->userFirstOrder $user;
  1071.         return $this;
  1072.     }
  1073.     public function checkIsCorrect(): bool
  1074.     {
  1075.         foreach ($this->orderPart as $orderPart)
  1076.         {
  1077.             /** @var OrderPart $orderPart */
  1078.             if (!$orderPart->getIsCorrect()) return false;
  1079.         }
  1080.         return true;
  1081.     }
  1082.     public function mustBeHiddenInSB(): bool
  1083.     {
  1084.         /** @var OrderPart $orderPart */
  1085.         foreach ($this->orderPart as $orderPart)
  1086.         {
  1087.             if ($orderPart->checkIfToHideInSB()) return true;
  1088.         }
  1089.         return false;
  1090.     }
  1091.     public function getProductsWithInvoicePayment(): array
  1092.     {
  1093.         $products = [];
  1094.         /** @var OrderPart $orderPart */
  1095.         foreach ($this->orderPart as $orderPart)
  1096.         {
  1097.             if (!$orderPart->getPaymentMethod())
  1098.             {
  1099.                 continue;
  1100.             }
  1101.             if ($orderPart->getPaymentMethod()->getSlug() === 'invoice')
  1102.             {
  1103.                 foreach ($orderPart->getOrderProductVariant() as $opv)
  1104.                 {
  1105.                     $products[] = $opv;
  1106.                 }
  1107.             }
  1108.         }
  1109.         return $products;
  1110.     }
  1111.     public function omittedShippingCostsInAllProducts(): bool
  1112.     {
  1113.         /** @var OrderPart $orderPart */
  1114.         foreach ($this->orderPart as $orderPart)
  1115.         {
  1116.             if (!$orderPart->omittedShippingCostsInAllProducts())
  1117.             {
  1118.                 return false;
  1119.             }
  1120.         }
  1121.         return true;
  1122.     }
  1123.     public function getProductsWithProformaPayment(): array
  1124.     {
  1125.         $products = [];
  1126.         /** @var OrderPart $orderPart */
  1127.         foreach ($this->orderPart as $orderPart)
  1128.         {
  1129.             /** @var OrderProductVariant $opv */
  1130.             if (!$orderPart->getPaymentMethod())
  1131.             {
  1132.                 continue;
  1133.             }
  1134.             if ($orderPart->getPaymentMethod()->getSlug() === 'proforma-invoice')
  1135.             {
  1136.                 foreach ($orderPart->getOrderProductVariant() as $opv)
  1137.                 {
  1138.                     $products[] = $opv;
  1139.                 }
  1140.             }
  1141.         }
  1142.         return $products;
  1143.     }
  1144.     public function canBePaidForWithOnline(): bool
  1145.     {
  1146.         /** @var OrderPart $orderPart */
  1147.         foreach ($this->orderPart as $orderPart)
  1148.         {
  1149.             if (!$orderPart->checkIfPayOnlineIsActive())
  1150.             {
  1151.                 return false;
  1152.             }
  1153.         }
  1154.         return true;
  1155.     }
  1156.     public function hasRecurringPaymentProducts(): bool
  1157.     {
  1158.         foreach ($this->orderPart as $orderPart)
  1159.         {
  1160.             if ($orderPart->hasRecurringPaymentProducts()) return true;
  1161.         }
  1162.         return false;
  1163.     }
  1164.     public function hasUniqskillsProducts()
  1165.     {
  1166.         foreach ($this->orderPart as $orderPart)
  1167.         {
  1168.             if ($orderPart->hasUniqskillsProducts())
  1169.                 return true;
  1170.         }
  1171.         return false;
  1172.     }
  1173.     public function hasOnlyUniqskillsProducts()
  1174.     {
  1175.         foreach ($this->orderPart as $orderPart)
  1176.         {
  1177.             if (!$orderPart->hasOnlyUniqskillsProducts())
  1178.                 return false;
  1179.         }
  1180.         return true;
  1181.     }
  1182.     public function getUniqskillsProducts(): ArrayCollection
  1183.     {
  1184.         $usProducts = new ArrayCollection();
  1185.         /** @var OrderPart $orderPart */
  1186.         foreach ($this->getOrderPart() as $orderPart)
  1187.         {
  1188.             /** @var OrderProductVariant $opv */
  1189.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1190.             {
  1191.                 $productVariant $opv->getProductVariant();
  1192.                 /** @var PortalSettings $portalSetting */
  1193.                 foreach ($productVariant->getPortalSettings() as $portalSetting)
  1194.                 {
  1195.                     if ($portalSetting->getHash() === $_ENV['US_PORTAL_SETTINGS'])
  1196.                     {
  1197.                         $usProducts->add([
  1198.                             'order'   => $orderPart->getOrdTran(),
  1199.                             'product' => $productVariant->getProductVariantNoComplete(),
  1200.                             'date'    => $orderPart->getCreatedAt()->format('c'),
  1201.                         ]);
  1202.                     }
  1203.                 }
  1204.             }
  1205.         }
  1206.         return $usProducts;
  1207.     }
  1208.     public function getOrderedCourse()
  1209.     {
  1210.         /** @var OrderPart $orderPart */
  1211.         foreach ($this->getOrderPart() as $orderPart)
  1212.         {
  1213.             /** @var OrderProductVariant $opv */
  1214.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1215.             {
  1216.                 if ($opv->getProductVariant() === null)
  1217.                 {
  1218.                     return null;
  1219.                 }
  1220.                 if (!$opv->getProductVariant()->getCourses()->isEmpty())
  1221.                 {
  1222.                     return $opv->getProductVariant()->getCourses()->first();
  1223.                 }
  1224.             }
  1225.         }
  1226.         return null;
  1227.     }
  1228.     public function getPaymentSystem(): ?PaymentSystem
  1229.     {
  1230.         return $this->paymentSystem;
  1231.     }
  1232.     public function setPaymentSystem(?PaymentSystem $paymentSystem): self
  1233.     {
  1234.         $this->paymentSystem $paymentSystem;
  1235.         return $this;
  1236.     }
  1237.     public function hasEventProducts()
  1238.     {
  1239.         foreach ($this->orderPart as $orderPart)
  1240.         {
  1241.             if ($orderPart->hasEventProduct())
  1242.                 return true;
  1243.         }
  1244.         return false;
  1245.     }
  1246.     public function hasDelayedProformaProducts()
  1247.     {
  1248.         foreach ($this->orderPart as $orderPart)
  1249.         {
  1250.             if ($orderPart->hasDelayedProformaProducts())
  1251.                 return true;
  1252.         }
  1253.         return false;
  1254.     }
  1255.     /**
  1256.      * @return Collection|BraintreeResponse[]
  1257.      */
  1258.     public function getBraintreeResponse(): Collection
  1259.     {
  1260.         return $this->braintreeResponse;
  1261.     }
  1262.     public function addBraintreeResponse(BraintreeResponse $braintreeResponse): self
  1263.     {
  1264.         if (!$this->braintreeResponse->contains($braintreeResponse)) {
  1265.             $this->braintreeResponse[] = $braintreeResponse;
  1266.             $braintreeResponse->setOrder($this);
  1267.         }
  1268.         return $this;
  1269.     }
  1270.     public function removeBraintreeResponse(BraintreeResponse $braintreeResponse): self
  1271.     {
  1272.         if ($this->braintreeResponse->contains($braintreeResponse)) {
  1273.             $this->braintreeResponse->removeElement($braintreeResponse);
  1274.             // set the owning side to null (unless already changed)
  1275.             if ($braintreeResponse->getOrder() === $this) {
  1276.                 $braintreeResponse->setOrder(null);
  1277.             }
  1278.         }
  1279.         return $this;
  1280.     }
  1281.     public function getIsTele()
  1282.     {
  1283.         if (strpos($this->getComment(), 'TELE ') && $this->getClientHost() == 'www.gos.e-firma.pl')
  1284.         {
  1285.             return true;
  1286.         }
  1287.         return false;
  1288.     }
  1289.     public function getButtonParameters(): ?string
  1290.     {
  1291.         return $this->buttonParameters;
  1292.     }
  1293.     public function setButtonParameters(?string $buttonParameters): self
  1294.     {
  1295.         $this->buttonParameters $buttonParameters;
  1296.         return $this;
  1297.     }
  1298.     public function getMarketing(): ?string
  1299.     {
  1300.         return $this->marketing;
  1301.     }
  1302.     public function setMarketing(?string $marketing): self
  1303.     {
  1304.         $this->marketing $marketing;
  1305.         return $this;
  1306.     }
  1307.     public function addParticipant(Participants $participant)
  1308.     {
  1309.         $this->participants[] = $participant;
  1310.         return $this;
  1311.     }
  1312.     public function removeParticipant(Participants $participant)
  1313.     {
  1314.         $this->participants->removeElement($participant);
  1315.     }
  1316.     public function getParticipants()
  1317.     {
  1318.         return $this->participants;
  1319.     }
  1320.     
  1321.     public function hasAllProductsTaxFreeForBudgetUnit()
  1322.     {
  1323.         /** @var OrderPart $orderPart */
  1324.         foreach ($this->getOrderPart() as $orderPart)
  1325.         {
  1326.             /** @var OrderProductVariant $opv */
  1327.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1328.             {
  1329.                 if (!$opv->getProductVariant()->getTaxFreeForBudgetUnit())
  1330.                 {
  1331.                     return false;
  1332.                 }
  1333.             }
  1334.         }
  1335.         
  1336.         return true;
  1337.     }
  1338.     /**
  1339.      * @return Collection|ProductVariant[]
  1340.      */
  1341.     public function getAllProductVariants(): ?Collection
  1342.     {
  1343.         $variants = new ArrayCollection();
  1344.         /** @var OrderPart $orderPart */
  1345.         foreach ($this->getOrderPart() as $orderPart)
  1346.         {
  1347.             /** @var OrderProductVariant $opv */
  1348.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1349.             {
  1350.                 $variants->add($opv->getProductVariant());
  1351.             }
  1352.         }
  1353.         return $variants;
  1354.     }
  1355.     public function getAllPrimaryProductVariants(): Collection
  1356.     {
  1357.         $variants = new ArrayCollection();
  1358.         /** @var OrderPart $orderPart */
  1359.         foreach ($this->getOrderPart() as $orderPart)
  1360.         {
  1361.             /** @var OrderProductVariant $opv */
  1362.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1363.             {
  1364.                 if ($opv->getPrimaryVariant() === null) {
  1365.                     $variants->add($opv->getProductVariant());
  1366.                 }
  1367.             }
  1368.         }
  1369.         return $variants;
  1370.     }
  1371.     public function getAllOrderProductVariants(): ?Collection
  1372.     {
  1373.         $orderProductVariants = new ArrayCollection();
  1374.         /** @var OrderPart $orderPart */
  1375.         foreach ($this->getOrderPart() as $orderPart)
  1376.         {
  1377.             /** @var OrderProductVariant $opv */
  1378.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1379.             {
  1380.                 $orderProductVariants->add($opv);
  1381.             }
  1382.         }
  1383.         return $orderProductVariants;
  1384.     }
  1385.     public function isEmailInvoiceEnabled(): bool
  1386.     {
  1387.         /** @var OrderPart $orderPart */
  1388.         foreach ($this->getOrderPart() as $orderPart)
  1389.         {
  1390.             /** @var OrderProductVariant $opv */
  1391.             foreach ($orderPart->getOrderProductVariant() as $opv)
  1392.             {
  1393.                 if (
  1394.                     is_null($opv->getProductVariant()->getDocumentDistributionChannel())
  1395.                     ||
  1396.                     $opv->getProductVariant()->getDocumentDistributionChannel() === DocumentDistributionChannels::PAPER)
  1397.                 {
  1398.                     return false;
  1399.                 }
  1400.             }
  1401.         }
  1402.         return true;
  1403.     }
  1404.     public function getTeleOrder(): ?TeleOrder
  1405.     {
  1406.         return $this->teleOrder;
  1407.     }
  1408.     public function setTeleOrder(?TeleOrder $teleOrder): self
  1409.     {
  1410.         $this->teleOrder $teleOrder;
  1411.         return $this;
  1412.     }
  1413.     public function getFoExportetAt(): ?\DateTimeInterface
  1414.     {
  1415.         return $this->foExportetAt;
  1416.     }
  1417.     public function setFoExportetAt(?\DateTimeInterface $foExportetAt): self
  1418.     {
  1419.         $this->foExportetAt $foExportetAt;
  1420.         return $this;
  1421.     }
  1422.     /**
  1423.      * @return Collection|ExportLog[]
  1424.      */
  1425.     public function getExportLogs(): Collection
  1426.     {
  1427.         return $this->exportLogs;
  1428.     }
  1429.     public function addExportLog(ExportLog $exportLog): self
  1430.     {
  1431.         if (!$this->exportLogs->contains($exportLog)) {
  1432.             $this->exportLogs[] = $exportLog;
  1433.             $exportLog->setOrders($this);
  1434.         }
  1435.         return $this;
  1436.     }
  1437.     public function removeExportLog(ExportLog $exportLog): self
  1438.     {
  1439.         if ($this->exportLogs->contains($exportLog)) {
  1440.             $this->exportLogs->removeElement($exportLog);
  1441.             // set the owning side to null (unless already changed)
  1442.             if ($exportLog->getOrders() === $this) {
  1443.                 $exportLog->setOrders(null);
  1444.             }
  1445.         }
  1446.         return $this;
  1447.     }
  1448.     public function getIsTest(): ?bool
  1449.     {
  1450.         return $this->isTest;
  1451.     }
  1452.     public function setIsTest(?bool $isTest): self
  1453.     {
  1454.         $this->isTest $isTest;
  1455.         return $this;
  1456.     }
  1457.     public function getIsGATransactionSent(): ?bool
  1458.     {
  1459.         return $this->isGATransactionSent;
  1460.     }
  1461.     public function setIsGATransactionSent(?bool $isGATransactionSent): self
  1462.     {
  1463.         $this->isGATransactionSent $isGATransactionSent;
  1464.         return $this;
  1465.     }
  1466.     public function getLab(): ?string
  1467.     {
  1468.         return $this->lab;
  1469.     }
  1470.     public function setLab(?string $lab): self
  1471.     {
  1472.         $this->lab $lab;
  1473.         return $this;
  1474.     }
  1475.     public function getIsSbExportNeeded(): ?bool
  1476.     {
  1477.         return $this->isSbExportNeeded;
  1478.     }
  1479.     public function setIsSbExportNeeded(bool $isSbExportNeeded): self
  1480.     {
  1481.         $this->isSbExportNeeded $isSbExportNeeded;
  1482.         return $this;
  1483.     }
  1484.     public function getSbExportAt(): ?\DateTimeInterface
  1485.     {
  1486.         return $this->sbExportAt;
  1487.     }
  1488.     public function setSbExportAt(?\DateTimeInterface $sbExportAt): self
  1489.     {
  1490.         $this->sbExportAt $sbExportAt;
  1491.         return $this;
  1492.     }
  1493.     public function getExtendedPaymentTime(): ?int
  1494.     {
  1495.         return $this->extendedPaymentTime;
  1496.     }
  1497.     public function setExtendedPaymentTime(int $extendedPaymentTime): self
  1498.     {
  1499.         $this->extendedPaymentTime $extendedPaymentTime;
  1500.         return $this;
  1501.     }
  1502.     public function getShippingType(): ?ShippingType
  1503.     {
  1504.         return $this->shippingType;
  1505.     }
  1506.     public function setShippingType(?ShippingType $shippingType): self
  1507.     {
  1508.         $this->shippingType $shippingType;
  1509.         return $this;
  1510.     }
  1511.     public function getTeleConsultant(): ?OrderTeleConsultant
  1512.     {
  1513.         return $this->teleConsultant;
  1514.     }
  1515.     public function setTeleConsultant(?OrderTeleConsultant $teleConsultant): self
  1516.     {
  1517.         $this->teleConsultant $teleConsultant;
  1518.         return $this;
  1519.     }
  1520.     /**
  1521.      * @return Collection|UserCard[]
  1522.      */
  1523.     public function getUserCards(): Collection
  1524.     {
  1525.         return $this->userCards;
  1526.     }
  1527.     public function addUserCard(UserCard $userCard): self
  1528.     {
  1529.         if (!$this->userCards->contains($userCard)) {
  1530.             $this->userCards[] = $userCard;
  1531.             $userCard->setOrders($this);
  1532.         }
  1533.         return $this;
  1534.     }
  1535.     public function removeUserCard(UserCard $userCard): self
  1536.     {
  1537.         if ($this->userCards->contains($userCard)) {
  1538.             $this->userCards->removeElement($userCard);
  1539.             // set the owning side to null (unless already changed)
  1540.             if ($userCard->getOrders() === $this) {
  1541.                 $userCard->setOrders(null);
  1542.             }
  1543.         }
  1544.         return $this;
  1545.     }
  1546.     public function getExportedToSbBy(): ?string
  1547.     {
  1548.         return $this->exportedToSbBy;
  1549.     }
  1550.     public function setExportedToSbBy(?string $exportedToSbBy): self
  1551.     {
  1552.         $this->exportedToSbBy $exportedToSbBy;
  1553.         return $this;
  1554.     }
  1555.     /**
  1556.      * Checks the notifies of each orderPart
  1557.      * Returns true if all have status: COMPLETED
  1558.      *
  1559.      * @return bool
  1560.      */
  1561.     public function hasOnlinePaymentCompleted(): bool
  1562.     {
  1563.         if ($this->orderPart->isEmpty())
  1564.         {
  1565.             return false;
  1566.         }
  1567.         /** @var OrderPart $orderPart */
  1568.         foreach ($this->orderPart as $orderPart)
  1569.         {
  1570.             if (
  1571.                 $orderPart->getMasterNotify() === null
  1572.                 || !$orderPart->getMasterNotify()->isSuccessfullyPaid()
  1573.             )
  1574.             {
  1575.                 return false;
  1576.             }
  1577.         }
  1578.         return true;
  1579.     }
  1580.     public function getFromSourceAll(): ?string
  1581.     {
  1582.         return $this->fromSourceAll;
  1583.     }
  1584.     public function setFromSourceAll(?string $fromSourceAll): self
  1585.     {
  1586.         $this->fromSourceAll $fromSourceAll;
  1587.         return $this;
  1588.     }
  1589.     public function getActionNumberAll(): ?string
  1590.     {
  1591.         return $this->actionNumberAll;
  1592.     }
  1593.     public function setActionNumberAll(?string $actionNumberAll): self
  1594.     {
  1595.         $this->actionNumberAll $actionNumberAll;
  1596.         return $this;
  1597.     }
  1598.     public function getProductVariantsReviewNotification(): ?ProductVariantReviewNotification
  1599.     {
  1600.         return $this->productVariantsReviewNotification;
  1601.     }
  1602.     public function getPaymentRewardDeadline(): ?\DateTimeInterface
  1603.     {
  1604.         return $this->paymentRewardDeadline;
  1605.     }
  1606.     public function setPaymentRewardDeadline(?\DateTimeInterface $paymentRewardDeadline): self
  1607.     {
  1608.         $this->paymentRewardDeadline $paymentRewardDeadline;
  1609.         return $this;
  1610.     }
  1611.     public function getUserAdditionalAccessOffer(): ?UserAdditionalAccessOffer
  1612.     {
  1613.         return $this->userAdditionalAccessOffer;
  1614.     }
  1615.     public function setUserAdditionalAccessOffer(?UserAdditionalAccessOffer $userAdditionalAccessOffer): self
  1616.     {
  1617.         $this->userAdditionalAccessOffer $userAdditionalAccessOffer;
  1618.         return $this;
  1619.     }
  1620.     /**
  1621.      * @return Collection|AdditionalAccessBeneficiary[]
  1622.      */
  1623.     public function getAdditionalAccessBeneficiaries(): Collection
  1624.     {
  1625.         return $this->additionalAccessBeneficiaries;
  1626.     }
  1627.     public function addAdditionalAccessBeneficiary(AdditionalAccessBeneficiary $additionalAccessBeneficiary): self
  1628.     {
  1629.         if (!$this->additionalAccessBeneficiaries->contains($additionalAccessBeneficiary)) {
  1630.             $this->additionalAccessBeneficiaries[] = $additionalAccessBeneficiary;
  1631.             $additionalAccessBeneficiary->setOrders($this);
  1632.         }
  1633.         return $this;
  1634.     }
  1635.     public function removeAdditionalAccessBeneficiary(AdditionalAccessBeneficiary $additionalAccessBeneficiary): self
  1636.     {
  1637.         if ($this->additionalAccessBeneficiaries->contains($additionalAccessBeneficiary)) {
  1638.             $this->additionalAccessBeneficiaries->removeElement($additionalAccessBeneficiary);
  1639.             // set the owning side to null (unless already changed)
  1640.             if ($additionalAccessBeneficiary->getOrders() === $this) {
  1641.                 $additionalAccessBeneficiary->setOrders(null);
  1642.             }
  1643.         }
  1644.         return $this;
  1645.     }
  1646.     public function getTeleOrderSplit(): ?bool
  1647.     {
  1648.         return $this->teleOrderSplit;
  1649.     }
  1650.     public function setTeleOrderSplit(?bool $teleOrderSplit): self
  1651.     {
  1652.         $this->teleOrderSplit $teleOrderSplit;
  1653.         return $this;
  1654.     }
  1655.     public function getBurAssignedSupportId(): ?string
  1656.     {
  1657.         return $this->burAssignedSupportId;
  1658.     }
  1659.     public function setBurAssignedSupportId(?string $burAssignedSupportId): self
  1660.     {
  1661.         $this->burAssignedSupportId $burAssignedSupportId;
  1662.         return $this;
  1663.     }
  1664.     public function isOnHold(): ?bool
  1665.     {
  1666.         return $this->onHold;
  1667.     }
  1668.     public function setOnHold(?bool $onHold): self
  1669.     {
  1670.         $this->onHold $onHold;
  1671.         return $this;
  1672.     }
  1673.     public function getProfessionalNature(): ?bool
  1674.     {
  1675.         return $this->professionalNature;
  1676.     }
  1677.     public function setProfessionalNature(?bool $professionalNature): self
  1678.     {
  1679.         $this->professionalNature $professionalNature;
  1680.         return $this;
  1681.     }
  1682.     public function isOnboardingActive(): bool
  1683.     {
  1684.         $isActive false;
  1685.         $portalSettings $this->getPortalSettings();
  1686.         if ($portalSettings !== null) {
  1687.             $onboardingSettings $portalSettings->getOnboardingSettings();
  1688.             if ($onboardingSettings !== null) {
  1689.                 $isActive $onboardingSettings->getIsActive() === true;
  1690.             }
  1691.         }
  1692.         return $isActive;
  1693.     }
  1694.     public function getOnboardingEmailTemplate(): ?EmailTemplate
  1695.     {
  1696.         $emailTemplate null;
  1697.         $portalSettings $this->getPortalSettings();
  1698.         if ($portalSettings !== null) {
  1699.             $onboardingSettings $portalSettings->getOnboardingSettings();
  1700.             if ($onboardingSettings !== null) {
  1701.                 $emailTemplate $onboardingSettings->getEmailTemplate();
  1702.             }
  1703.         }
  1704.         return $emailTemplate;
  1705.     }
  1706.     public function getSalesManago2PurchaseTags(): array
  1707.     {
  1708.         $tags = [];
  1709.         /** @var OrderPart $orderPart */
  1710.         foreach ($this->getOrderPart() as $orderPart) {
  1711.             /** @var OrderProductVariant $orderProductVariant */
  1712.             foreach ($orderPart->getOrderProductVariant() as $orderProductVariant) {
  1713.                 $productVariant $orderProductVariant->getProductVariant();
  1714.                 $product $productVariant->getMasterProduct();
  1715.                 $tags[] = 'ZAKUP_P' $product->getProductNo() . 'END';
  1716.             }
  1717.         }
  1718.         return $tags;
  1719.     }
  1720.     public function getSalesmanago2Funnels(): array
  1721.     {
  1722.         $funnels = [];
  1723.         /** @var OrderPart $orderPart */
  1724.         foreach ($this->getOrderPart() as $orderPart) {
  1725.             /** @var OrderProductVariant $orderProductVariant */
  1726.             foreach ($orderPart->getOrderProductVariant() as $orderProductVariant) {
  1727.                 $productVariant $orderProductVariant->getProductVariant();
  1728.                 $product $productVariant->getMasterProduct();
  1729.                 $funnels[$product->getProductNo()] = $product->getSalesmanagoTags(true);
  1730.             }
  1731.         }
  1732.         return $funnels;
  1733.     }
  1734.     public function getTaxStatement(): ?string
  1735.     {
  1736.         return (new TaxStatement($this))->getStatement();
  1737.     }
  1738. }