src/Entity/CRM/Order.php line 15
<?phpnamespace App\Entity\CRM;use App\Repository\OrderRepository;use DateTime;use DateTimeInterface;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: OrderRepository::class)]#[ORM\Table(name: '`order`')]class Order{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?OrderStatus $orderStatus = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?DateTimeInterface $addedDate = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?DateTimeInterface $updateDate = null;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?Shipping $shipping = null;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: true)]private ?Consultant $consultant = null;#[ORM\Column(nullable: true)]private ?int $administrationFee = null;#[ORM\Column(nullable: true)]private ?int $ranking = null;#[ORM\Column(nullable: true)]private ?string $invoiceNumber = null;#[ORM\Column]private ?bool $optimaInvoiceAdded = false;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?DateTimeInterface $optimaInvoiceAddedAt = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?DateTimeInterface $paymentDate = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?DateTimeInterface $dateOfPayment = null;#[ORM\Column]private ?bool $ended = false;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?DateTimeInterface $contractExpirationDate = null;#[ORM\Column]private ?bool $fixedTerm = false;#[ORM\Column]private ?bool $contractEnded = false;#[ORM\Column(length: 255, nullable: true)]private ?string $contractNumber = null;#[ORM\Column]private ?bool $checked = false;#[ORM\Column]private ?bool $firstOrder = false;#[ORM\ManyToMany(targetEntity: Implementer::class, inversedBy: 'orders')]private Collection $implementer;#[ORM\Column(length: 255, nullable: true)]private ?string $inspector = null;#[ORM\Column]private ?bool $implementationCompleted = false;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?DateTimeInterface $implementationCompletedDate = null;#[ORM\ManyToOne(targetEntity: self::class)]private ?self $parentOrder = null;#[ORM\Column]private ?bool $contractExtended = false;#[ORM\Column]private ?bool $firstContract = false;#[ORM\Column]private ?bool $contractSigned = false;#[ORM\Column(length: 255, nullable: true)]private ?string $token = null;#[ORM\Column]private ?bool $automaticallyExtended = false;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenOffice = null;#[ORM\Column(nullable: true)]private ?int $recommendedNumber = null;#[ORM\Column(length: 255, nullable: true)]private ?string $officeInvoice = null;#[ORM\Column(nullable: true)]private ?int $commissionPercentage = null;#[ORM\Column(nullable: true)]private ?int $activationAmmount = null;#[ORM\Column]private ?bool $officeContractEnded = false;#[ORM\Column(nullable: true)]private ?int $bhpPackage = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenBhpRodo = null;#[ORM\Column(nullable: true)]private ?int $reward = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenIod = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenBdo = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenBhpStationary = null;#[ORM\Column]private ?bool $auditReady = false;#[ORM\Column]private ?bool $auditEnded = false;#[ORM\Column]private ?bool $contractWithoutCourses = false;public float $priceTotal = 0;public float $priceSubtotal = 0;public array $prices = [];public string $firstOrderString = '';#[ORM\OneToMany(mappedBy: 'orderId', targetEntity: OrderHistory::class, orphanRemoval: true)]private Collection $orderHistories;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?Customer $customer = null;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: true)]private ?CustomerAddress $customerAddress = null;#[ORM\OneToMany(mappedBy: 'orderId', targetEntity: OrderProduct::class, cascade: ['persist'], orphanRemoval: true,)]private Collection $orderProduct;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?Branch $branch = null;#[ORM\OneToOne(inversedBy: 'orderInstance', cascade: ['persist', 'remove'])]private ?Contract $contract = null;#[ORM\OneToMany(mappedBy: 'orderInstance', targetEntity: Instalments::class, cascade: ['persist', 'remove'])]private Collection $instalments;#[ORM\Column]private ?bool $instalment = false;#[ORM\OneToOne(inversedBy: 'orderInst', cascade: ['persist', 'remove'])]private ?ContractIndividual $contractIndividual = null;#[ORM\Column(nullable: true)]private ?bool $needContract = null;#[ORM\OneToMany(mappedBy: 'orderInstance', targetEntity: OrderNote::class)]private Collection $orderNotes;#[ORM\ManyToOne(inversedBy: 'dividedOrders')]private ?Consultant $orderDividedConsultant = null;#[ORM\OneToMany(mappedBy: 'orderId', targetEntity: ImplementerOrderHistory::class)]private Collection $implementerOrderHistories;#[ORM\OneToOne(mappedBy: 'orderId', cascade: ['persist', 'remove'])]private ?ImplementerOrderData $implementerOrderData = null;#[ORM\OneToMany(mappedBy: 'orderInstance', targetEntity: BhpOrderProduct::class)]private Collection $BhpOrderProducts;#[ORM\ManyToOne(inversedBy: 'orders')]private ?Admin $admin = null;#[ORM\Column]private bool $doBeforePayment = false;#[ORM\Column(nullable: true)]private ?int $oldOrderId = null;#[ORM\OneToMany(mappedBy: 'orderInstance', targetEntity: AccountingOfficeCategory::class)]private Collection $accountingOfficeCategories;#[ORM\OneToMany(mappedBy: 'OrderInstance', targetEntity: BhpJournals::class)]private Collection $bhpJournals;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenAml = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenAmlrodo = null;#[ORM\ManyToOne(inversedBy: 'orders')]private ?DebtStatus $debtStatus = null;#[ORM\Column]private ?bool $debtCollection = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $debtContactDate = null;#[ORM\OneToMany(mappedBy: 'orderId', targetEntity: DebtNote::class)]private Collection $debtNotes;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $littleNote = null;#[ORM\OneToOne(mappedBy: 'orderId', cascade: ['persist', 'remove'])]private ?OrderCustomer $orderCustomer = null;#[ORM\OneToOne(mappedBy: 'orderId', cascade: ['persist', 'remove'])]private ?OrderCustomerAddress $orderCustomerAddress = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $contractSignedDate = null;#[ORM\OneToMany(mappedBy: 'orderId', targetEntity: OrderDivided::class, orphanRemoval: true)]private Collection $orderDivideds;#[ORM\OneToMany(mappedBy: 'orderInstance', targetEntity: MailHistory::class)]private Collection $mailHistories;#[ORM\Column]private ?bool $haveInstalments = false;#[ORM\ManyToOne(inversedBy: 'extensionOrders')]private ?OrderNote $orderNoteForExtension = null;#[ORM\Column]private bool $implementationCompletedWithoutAudit = false;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $debtStatusChangeDate = null;#[ORM\ManyToMany(targetEntity: Consultant::class, inversedBy: 'ordersToNotes')]private Collection $consultantForNotes;#[ORM\OneToMany(mappedBy: 'orderInstance', targetEntity: Task::class)]private Collection $tasks;#[ORM\OneToMany(mappedBy: 'orderId', targetEntity: SmsHistory::class)]private Collection $smsHistories;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $noticeDate = null;#[ORM\OneToMany(mappedBy: 'orderInstance', targetEntity: SurveyResponse::class)]private Collection $surveyResponses;#[ORM\OneToMany(mappedBy: 'orderInstance', targetEntity: ZoomList::class)]private Collection $zoomLists;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenLicencyjnaWebAml = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenLicencyjnaWebAmlPartnerska = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tokenLicencyjnaWebAmlNieruchomosci = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?\DateTimeInterface $dateForPoints = null;#[ORM\Column]private ?bool $pointsAdded = null;#[ORM\Column]private ?bool $forCountingSprawozdaniaOther = null;#[ORM\Column]private ?bool $annex = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?\DateTimeInterface $terminationDate = null;#[ORM\Column]private ?bool $effectivelyTerminated = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $contractStartDate = null;public function __construct(){$this->addedDate = new DateTime();$this->updateDate = new DateTime();$this->implementer = new ArrayCollection();$this->orderHistories = new ArrayCollection();$this->orderProduct = new ArrayCollection();$this->instalments = new ArrayCollection();$this->orderNotes = new ArrayCollection();$this->implementerOrderHistories = new ArrayCollection();$this->BhpOrderProducts = new ArrayCollection();$this->accountingOfficeCategories = new ArrayCollection();$this->bhpJournals = new ArrayCollection();$this->debtNotes = new ArrayCollection();$this->orderDivideds = new ArrayCollection();$this->mailHistories = new ArrayCollection();$this->orderNoteForExtension = NULL;$this->consultantForNotes = new ArrayCollection();$this->tasks = new ArrayCollection();$this->smsHistories = new ArrayCollection();$this->noticeDate = NULL;$this->surveyResponses = new ArrayCollection();$this->zoomLists = new ArrayCollection();$this->pointsAdded = false;$this->dateForPoints = NULL;$this->forCountingSprawozdaniaOther = false;$this->annex = false;$this->terminationDate = NULL;$this->effectivelyTerminated = false;}public function __toString(): string{return $this->getId();}public function getId(): ?int{return $this->id;}public function getOrderSubTotal(): float{$products = $this->getOrderProduct();$sum = 0;foreach ($this->getOrderProduct() as $product) {$sum = $sum+$product->getPriceSubtotal();}return $sum;}public function getOrderTotal(): float{$products = $this->getOrderProduct();$sum = 0;foreach ($this->getOrderProduct() as $product) {$sum = +$product->getPriceTotal();}return $sum;}public function getOrderStatus(): ?OrderStatus{return $this->orderStatus;}public function setOrderStatus(?OrderStatus $orderStatus): self{$this->orderStatus = $orderStatus;return $this;}public function getAddedDate(): DateTimeInterface{return $this->addedDate;}public function getUpdateDate(): ?DateTimeInterface{return $this->updateDate;}public function setUpdateDate(?DateTimeInterface $updateDate): self{$this->updateDate = $updateDate;return $this;}public function getShipping(): ?Shipping{return $this->shipping;}public function setShipping(?Shipping $shipping): self{$this->shipping = $shipping;return $this;}public function getConsultant(): ?Consultant{return $this->consultant;}public function setConsultant(?Consultant $consultant): self{$this->consultant = $consultant;return $this;}public function getAdministrationFee(): ?int{$adFeeSum = 0;foreach($this->orderProduct as $op){$adFeeSum += $op->getAdministrationFee();}return $adFeeSum;}public function setAdministrationFee(int $administrationFee): self{$this->administrationFee = $administrationFee;return $this;}public function getRanking(): ?int{return $this->ranking;}public function setRanking(?int $ranking): self{$this->ranking = $ranking;return $this;}public function getInvoiceNumber(): ?string{return $this->invoiceNumber;}public function setInvoiceNumber(?string $invoiceNumber): self{$this->invoiceNumber = $invoiceNumber;return $this;}public function isOptimaInvoiceAdded(): ?bool{return $this->optimaInvoiceAdded;}public function setOptimaInvoiceAdded(bool $optimaInvoiceAdded): static{$this->optimaInvoiceAdded = $optimaInvoiceAdded;return $this;}public function getOptimaInvoiceAddedAt(): ?DateTimeInterface{return $this->optimaInvoiceAddedAt;}public function setOptimaInvoiceAddedAt(?DateTimeInterface $optimaInvoiceAddedAt): static{$this->optimaInvoiceAddedAt = $optimaInvoiceAddedAt;return $this;}public function getPaymentDate(): ?DateTimeInterface{return $this->paymentDate;}public function setPaymentDate(?DateTimeInterface $paymentDate): self{$this->paymentDate = $paymentDate;return $this;}public function getDateOfPayment(): ?DateTimeInterface{return $this->dateOfPayment;}public function setDateOfPayment(?DateTimeInterface $dateOfPayment): self{$this->dateOfPayment = $dateOfPayment;return $this;}public function isEnded(): ?bool{return $this->ended;}public function setEnded(bool $ended): self{$this->ended = $ended;return $this;}public function getContractExpirationDate(): ?DateTimeInterface{return $this->contractExpirationDate;}public function setContractExpirationDate(?DateTimeInterface $contractExpirationDate): self{$this->contractExpirationDate = $contractExpirationDate;return $this;}public function isFixedTerm(): ?bool{return $this->fixedTerm;}public function setFixedTerm(bool $fixedTerm): self{$this->fixedTerm = $fixedTerm;return $this;}public function isContractEnded(): ?bool{return $this->contractEnded;}public function setContractEnded(bool $contractEnded): self{$this->contractEnded = $contractEnded;return $this;}public function getContractNumber(): ?string{return $this->contractNumber;}public function setContractNumber(?string $contractNumber): self{$this->contractNumber = $contractNumber;return $this;}public function isChecked(): ?bool{return $this->checked;}public function setChecked(bool $checked): self{$this->checked = $checked;return $this;}public function isFirstOrder(): ?bool{return $this->firstOrder;}public function setFirstOrder(bool $firstOrder): self{$this->firstOrder = $firstOrder;return $this;}public function getImplementer(): Collection{return $this->implementer;}public function addImplementer(Implementer $implementer): self{if (!$this->implementer->contains($implementer)) {$this->implementer->add($implementer);}return $this;}public function removeImplementer(Implementer $implementer): self{$this->implementer->removeElement($implementer);return $this;}public function getAllImplementers(): array{$implementers = [];$orderProducts = $this->getOrderProduct();foreach ($orderProducts as $orderProduct) {$implementersOrderProducts = $orderProduct->getImplementerOrderProducts();foreach ($implementersOrderProducts as $implementersOrderProduct) {if(count($implementersOrderProduct->getProduct()->getChildProducts())===0) {$iopImplementers = $implementersOrderProduct->getImplementer();foreach ($iopImplementers as $iopImplementer) {if (!in_array($iopImplementer, $implementers)) {$implementers[] = $iopImplementer;}}}}}return $implementers;}public function getAllImplementersForNotCompletedAndNotNeeded(): array{$implementers = [];$orderProducts = $this->getOrderProduct();foreach ($orderProducts as $orderProduct) {$implementersOrderProducts = $orderProduct->getImplementerOrderProducts();foreach ($implementersOrderProducts as $implementersOrderProduct) {$status = $implementersOrderProduct->getStatus();if ($status === null || (!$status->isEnding() && !$status->isNotNeeded())) {if(count($implementersOrderProduct->getProduct()->getChildProducts())===0) {$iopImplementers = $implementersOrderProduct->getImplementer();foreach ($iopImplementers as $iopImplementer) {if (!in_array($iopImplementer, $implementers)) {$implementers[] = $iopImplementer;}}}}}}return $implementers;}public function getInspector(): ?string{return $this->inspector;}public function setInspector(?string $inspector): self{$this->inspector = $inspector;return $this;}public function isImplementationCompleted(): ?bool{return $this->implementationCompleted;}public function setImplementationCompleted(bool $implementationCompleted): self{$this->implementationCompleted = $implementationCompleted;return $this;}public function getImplementationCompletedDate(): ?DateTimeInterface{return $this->implementationCompletedDate;}public function setImplementationCompletedDate(?DateTimeInterface $implementationCompletedDate): self{$this->implementationCompletedDate = $implementationCompletedDate;return $this;}public function getParentOrder(): ?self{return $this->parentOrder;}public function setParentOrder(?self $parentOrder): self{$this->parentOrder = $parentOrder;return $this;}public function isContractExtended(): ?bool{return $this->contractExtended;}public function setContractExtended(bool $contractExtended): self{$this->contractExtended = $contractExtended;return $this;}public function isFirstContract(): ?bool{return $this->firstContract;}public function setFirstContract(bool $firstContract): self{$this->firstContract = $firstContract;return $this;}public function isContractSigned(): ?bool{return $this->contractSigned;}public function setContractSigned(bool $contractSigned): self{$this->contractSigned = $contractSigned;return $this;}public function getToken(): ?string{return $this->token;}public function setToken(?string $token): self{$this->token = $token;return $this;}public function isAutomaticallyExtended(): ?bool{return $this->automaticallyExtended;}public function setAutomaticallyExtended(bool $automaticallyExtended): self{$this->automaticallyExtended = $automaticallyExtended;($automaticallyExtended)?$this->setNoticeDate(NULL):$this->setNoticeDate(new DateTime());return $this;}public function getTokenOffice(): ?string{return $this->tokenOffice;}public function setTokenOffice(?string $tokenOffice): self{$this->tokenOffice = $tokenOffice;return $this;}public function getRecommendedNumber(): ?int{return $this->recommendedNumber;}public function setRecommendedNumber(?int $recommendedNumber): self{$this->recommendedNumber = $recommendedNumber;return $this;}public function getOfficeInvoice(): ?string{return $this->officeInvoice;}public function setOfficeInvoice(?string $officeInvoice): self{$this->officeInvoice = $officeInvoice;return $this;}public function getCommissionPercentage(): ?int{return $this->commissionPercentage;}public function setCommissionPercentage(?int $commissionPercentage): self{$this->commissionPercentage = $commissionPercentage;return $this;}public function getActivationAmmount(): ?int{return $this->activationAmmount;}public function setActivationAmmount(?int $activationAmmount): self{$this->activationAmmount = $activationAmmount;return $this;}public function isOfficeContractEnded(): ?bool{return $this->officeContractEnded;}public function setOfficeContractEnded(bool $officeContractEnded): self{$this->officeContractEnded = $officeContractEnded;return $this;}public function getBhpPackage(): ?int{return $this->bhpPackage;}public function setBhpPackage(int $bhpPackage): self{$this->bhpPackage = $bhpPackage;return $this;}public function getTokenBhpRodo(): ?string{return $this->tokenBhpRodo;}public function setTokenBhpRodo(?string $tokenBhpRodo): self{$this->tokenBhpRodo = $tokenBhpRodo;return $this;}public function getReward(): ?int{return $this->reward;}public function setReward(?int $reward): self{$this->reward = $reward;return $this;}public function getTokenIod(): ?string{return $this->tokenIod;}public function setTokenIod(?string $tokenIod): self{$this->tokenIod = $tokenIod;return $this;}public function getTokenBdo(): ?string{return $this->tokenBdo;}public function setTokenBdo(?string $tokenBdo): self{$this->tokenBdo = $tokenBdo;return $this;}public function getTokenBhpStationary(): ?string{return $this->tokenBhpStationary;}public function setTokenBhpStationary(?string $tokenBhpStationary): self{$this->tokenBhpStationary = $tokenBhpStationary;return $this;}public function isAuditReady(): ?bool{return $this->auditReady;}public function setAuditReady(bool $auditReady): self{$this->auditReady = $auditReady;return $this;}public function isAuditEnded(): ?bool{return $this->auditEnded;}public function setAuditEnded(bool $auditEnded): self{$this->auditEnded = $auditEnded;return $this;}public function isContractWithoutCourses(): ?bool{return $this->contractWithoutCourses;}public function setContractWithoutCourses(bool $contractWithoutCourses): self{$this->contractWithoutCourses = $contractWithoutCourses;return $this;}public function getOrderHistories(): Collection{return $this->orderHistories;}public function addOrderHistory(OrderHistory $orderHistory): self{if (!$this->orderHistories->contains($orderHistory)) {$this->orderHistories->add($orderHistory);$orderHistory->setOrderId($this);}return $this;}public function removeOrderHistory(OrderHistory $orderHistory): self{if ($this->orderHistories->removeElement($orderHistory)) {if ($orderHistory->getOrderId() === $this) {$orderHistory->setOrderId(null);}}return $this;}public function getCustomer(): ?Customer{return $this->customer;}public function setCustomer(?Customer $customer): self{$this->customer = $customer;return $this;}public function getCustomerAddress(): ?CustomerAddress{return $this->customerAddress;}public function setCustomerAddress(?CustomerAddress $customerAddress): self{$this->customerAddress = $customerAddress;return $this;}public function getOrderProduct(): Collection{return $this->orderProduct;}public function addOrderProduct(OrderProduct $orderProduct): self{if (!$this->orderProduct->contains($orderProduct)) {$this->orderProduct->add($orderProduct);$orderProduct->setOrderId($this);}return $this;}public function removeOrderProduct(OrderProduct $orderProduct): self{if ($this->orderProduct->removeElement($orderProduct)) {if ($orderProduct->getOrderId() === $this) {$orderProduct->setOrderId(null);}}return $this;}public function getPriceTotal(): float{$sum = 0;$products = $this->getOrderProduct();foreach ($products as $product) {$sum = $sum + (($product->getPriceSubtotal() * $product->getQuantity()) * (1 + ($product->getProduct()->getTax() / 100)));}return $this->ceiling($sum,2);}function ceiling($value, int $precision = 0) {$offset = 0.5;if ($precision !== 0)$offset /= pow(10, $precision);$final = round($value + $offset, $precision, PHP_ROUND_HALF_DOWN);return ($final == -0 ? 0 : $final);}public function getPriceSubtotal(): float{$sum = 0;$products = $this->getOrderProduct();foreach ($products as $product) {$sum = $sum + ($product->getPriceSubtotal() * $product->getQuantity());}return $sum;}public function getPrices(): array{return ['subtotal' => number_format($this->getPriceSubtotal(), 2),'total' => number_format($this->getPriceTotal(), 2),];}public function getFirstOrderString(): string{return $this->isFirstOrder();}public function getBranch(): ?Branch{return $this->branch;}public function setBranch(?Branch $branch): static{$this->branch = $branch;return $this;}public function getContract(): ?Contract{return $this->contract;}public function setContract(?Contract $contract): static{$this->contract = $contract;return $this;}/*** @return Collection<int, Instalments>*/public function getInstalments(): Collection{return $this->instalments;}public function addInstalment(Instalments $instalment): static{if (!$this->instalments->contains($instalment)) {$this->instalments->add($instalment);$instalment->setOrderInstance($this);}return $this;}public function removeInstalment(Instalments $instalment): static{if ($this->instalments->removeElement($instalment)) {// set the owning side to null (unless already changed)if ($instalment->getOrderInstance() === $this) {$instalment->setOrderInstance(null);}}return $this;}public function isInstalment(): ?bool{return $this->instalment;}public function setInstalment(bool $instalment): static{$this->instalment = $instalment;return $this;}public function getContractIndividual(): ?ContractIndividual{return $this->contractIndividual;}public function setContractIndividual(?ContractIndividual $contractIndividual): static{$this->contractIndividual = $contractIndividual;return $this;}public function isNeedContract(): ?bool{return $this->needContract;}public function setNeedContract(?bool $needContract): static{$this->needContract = $needContract;return $this;}/*** @return Collection<int, ImplementerOrderHistory>*/public function getImplementerOrderHistories(): Collection{return $this->implementerOrderHistories;}public function addImplementerOrderHistory(ImplementerOrderHistory $implementerOrderHistory): static{if (!$this->implementerOrderHistories->contains($implementerOrderHistory)) {$this->implementerOrderHistories->add($implementerOrderHistory);$implementerOrderHistory->setOrderId($this);}return $this;}public function removeImplementerOrderHistory(ImplementerOrderHistory $implementerOrderHistory): static{if ($this->implementerOrderHistories->removeElement($implementerOrderHistory)) {// set the owning side to null (unless already changed)if ($implementerOrderHistory->getOrderId() === $this) {$implementerOrderHistory->setOrderId(null);}}return $this;}public function getImplementerOrderData(): ?ImplementerOrderData{return $this->implementerOrderData;}public function setImplementerOrderData(ImplementerOrderData $implementerOrderData): static{// set the owning side of the relation if necessaryif ($implementerOrderData->getOrderId() !== $this) {$implementerOrderData->setOrderId($this);}$this->implementerOrderData = $implementerOrderData;return $this;}/*** @return Collection<int, OrderNote>*/public function getOrderNotes(): Collection{return $this->orderNotes;}public function addOrderNote(OrderNote $orderNote): static{if (!$this->orderNotes->contains($orderNote)) {$this->orderNotes->add($orderNote);$orderNote->setOrderInstance($this);}return $this;}public function removeOrderNote(OrderNote $orderNote): static{if ($this->orderNotes->removeElement($orderNote)) {// set the owning side to null (unless already changed)if ($orderNote->getOrderInstance() === $this) {$orderNote->setOrderInstance(null);}}return $this;}public function getOrderDividedConsultant(): ?Consultant{return $this->orderDividedConsultant;}public function setOrderDividedConsultant(?Consultant $orderDividedConsultant): static{$this->orderDividedConsultant = $orderDividedConsultant;return $this;}/*** @return Collection<int, BhpOrderProduct>*/public function getBhpOrderProducts(): Collection{return $this->BhpOrderProducts;}public function addBhpOrderProduct(BhpOrderProduct $BhpOrderProduct): static{if (!$this->BhpOrderProducts->contains($BhpOrderProduct)) {$this->BhpOrderProducts->add($BhpOrderProduct);$BhpOrderProduct->setOrderInstance($this);}return $this;}public function getAdmin(): ?Admin{return $this->admin;}public function setAdmin(?Admin $admin): static{$this->admin = $admin;return $this;}public function removeBhpOrderProduct(BhpOrderProduct $BhpOrderProduct): static{if ($this->BhpOrderProducts->removeElement($BhpOrderProduct)) {// set the owning side to null (unless already changed)if ($BhpOrderProduct->getOrderInstance() === $this) {$BhpOrderProduct->setOrderInstance(null);}}return $this;}public function isDoBeforePayment(): ?bool{return $this->doBeforePayment;}public function setDoBeforePayment(bool $doBeforePayment): static{$this->doBeforePayment = $doBeforePayment;return $this;}public function getOldOrderId(): ?int{return $this->oldOrderId;}public function setOldOrderId(?int $oldOrderId): static{$this->oldOrderId = $oldOrderId;return $this;}public function getAdministrationFeeSum(){$orderProductAdministrationSum = 0;foreach($this->orderProduct as $orderProduct){$orderProductAdministrationSum += $orderProduct->getAdministrationFee();}return $orderProductAdministrationSum;}/*** @return Collection<int, AccountingOfficeCategory>*/public function getAccountingOfficeCategories(): Collection{return $this->accountingOfficeCategories;}public function addAccountingOfficeCategory(AccountingOfficeCategory $accountingOfficeCategory): static{if (!$this->accountingOfficeCategories->contains($accountingOfficeCategory)) {$this->accountingOfficeCategories->add($accountingOfficeCategory);$accountingOfficeCategory->setOrderInstance($this);}return $this;}public function removeAccountingOfficeCategory(AccountingOfficeCategory $accountingOfficeCategory): static{if ($this->accountingOfficeCategories->removeElement($accountingOfficeCategory)) {// set the owning side to null (unless already changed)if ($accountingOfficeCategory->getOrderInstance() === $this) {$accountingOfficeCategory->setOrderInstance(null);}}return $this;}/*** @return Collection<int, BhpJournals>*/public function getBhpJournals(): Collection{return $this->bhpJournals;}public function addBhpJournal(BhpJournals $bhpJournal): static{if (!$this->bhpJournals->contains($bhpJournal)) {$this->bhpJournals->add($bhpJournal);$bhpJournal->setOrderInstance($this);}return $this;}public function removeBhpJournal(BhpJournals $bhpJournal): static{if ($this->bhpJournals->removeElement($bhpJournal)) {// set the owning side to null (unless already changed)if ($bhpJournal->getOrderInstance() === $this) {$bhpJournal->setOrderInstance(null);}}return $this;}public function getTokenAml(): ?string{return $this->tokenAml;}public function setTokenAml(?string $tokenAml): static{$this->tokenAml = $tokenAml;return $this;}public function getTokenAmlrodo(): ?string{return $this->tokenAmlrodo;}public function setTokenAmlrodo(?string $tokenAmlrodo): static{$this->tokenAmlrodo = $tokenAmlrodo;return $this;}public function isWithUmowa():bool{$umowa = false;foreach($this->getOrderProduct() as $orderProduct){if($orderProduct->getProduct()->isUmowa()){$umowa = true;break;}}return $umowa;}public function getDebtStatus(): ?DebtStatus{return $this->debtStatus;}public function setDebtStatus(?DebtStatus $debtStatus): static{$this->debtStatus = $debtStatus;return $this;}public function isDebtCollection(): ?bool{return $this->debtCollection;}public function setDebtCollection(bool $debtCollection): static{$this->debtCollection = $debtCollection;return $this;}public function getDebtContactDate(): ?\DateTimeInterface{return $this->debtContactDate;}public function setDebtContactDate(?\DateTimeInterface $debtContactDate): static{$this->debtContactDate = $debtContactDate;return $this;}/*** @return Collection<int, DebtNote>*/public function getDebtNotes(): Collection{return $this->debtNotes;}public function addDebtNote(DebtNote $debtNote): static{if (!$this->debtNotes->contains($debtNote)) {$this->debtNotes->add($debtNote);$debtNote->setOrderId($this);}return $this;}public function removeDebtNote(DebtNote $debtNote): static{if ($this->debtNotes->removeElement($debtNote)) {// set the owning side to null (unless already changed)if ($debtNote->getOrderId() === $this) {$debtNote->setOrderId(null);}}return $this;}public function getLittleNote(): ?string{return $this->littleNote;}public function setLittleNote(?string $littleNote): static{$this->littleNote = $littleNote;return $this;}public function getOrderCustomer(): ?OrderCustomer{return $this->orderCustomer;}public function setOrderCustomer(OrderCustomer $orderCustomer): static{// set the owning side of the relation if necessaryif ($orderCustomer->getOrderId() !== $this) {$orderCustomer->setOrderId($this);}$this->orderCustomer = $orderCustomer;return $this;}public function getOrderCustomerAddress(): ?OrderCustomerAddress{return $this->orderCustomerAddress;}public function setOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): static{// set the owning side of the relation if necessaryif ($orderCustomerAddress->getOrderId() !== $this) {$orderCustomerAddress->setOrderId($this);}$this->orderCustomerAddress = $orderCustomerAddress;return $this;}public function getContractSignedDate(): ?\DateTimeInterface{return $this->contractSignedDate;}public function setContractSignedDate(?\DateTimeInterface $contractSignedDate): static{$this->contractSignedDate = $contractSignedDate;return $this;}/*** @return Collection<int, OrderDivided>*/public function getOrderDivideds(): Collection{return $this->orderDivideds;}public function addOrderDivided(OrderDivided $orderDivided): static{if (!$this->orderDivideds->contains($orderDivided)) {$this->orderDivideds->add($orderDivided);$orderDivided->setOrderId($this);}return $this;}/*** @return Collection<int, MailHistory>*/public function getMailHistories(): Collection{return $this->mailHistories;}public function addMailHistory(MailHistory $mailHistory): static{if (!$this->mailHistories->contains($mailHistory)) {$this->mailHistories->add($mailHistory);$mailHistory->setOrderInstance($this);}return $this;}public function removeOrderDivided(OrderDivided $orderDivided): static{if ($this->orderDivideds->removeElement($orderDivided)) {// set the owning side to null (unless already changed)if ($orderDivided->getOrderId() === $this) {$orderDivided->setOrderId(null);}}return $this;}public function removeMailHistory(MailHistory $mailHistory): static{if ($this->mailHistories->removeElement($mailHistory)) {// set the owning side to null (unless already changed)if ($mailHistory->getOrderInstance() === $this) {$mailHistory->setOrderInstance(null);}}return $this;}public function getOrderDividedSum(): float{$sum = 0;foreach($this->getOrderDivideds() as $orderDivided){$sum = $sum+$orderDivided->getValue();}return $sum;}public function isHaveInstalments(): ?bool{return $this->haveInstalments;}public function setHaveInstalments(bool $haveInstalments): static{$this->haveInstalments = $haveInstalments;return $this;}public function getOrderNoteForExtension(): ?OrderNote{return $this->orderNoteForExtension;}public function setOrderNoteForExtension(?OrderNote $orderNoteForExtension): static{$this->orderNoteForExtension = $orderNoteForExtension;return $this;}public function isImplementationCompletedWithoutAudit(): ?bool{return $this->implementationCompletedWithoutAudit;}public function setImplementationCompletedWithoutAudit(bool $implementationCompletedWithoutAudit): static{$this->implementationCompletedWithoutAudit = $implementationCompletedWithoutAudit;return $this;}public function getDebtStatusChangeDate(): ?\DateTimeInterface{return $this->debtStatusChangeDate;}public function setDebtStatusChangeDate(?\DateTimeInterface $debtStatusChangeDate): static{$this->debtStatusChangeDate = $debtStatusChangeDate;return $this;}/*** @return Collection<int, Consultant>*/public function getConsultantForNotes(): Collection{return $this->consultantForNotes;}/*** @return Collection<int, Consultant>|Consultant|Admin*/public function getCurrentConsultantsOrAdmin(): Collection|Consultant|Admin{$dateTimeNow = new DateTime();$paymentDate = $this->getPaymentDate();$dateOfPayment = $this->getDateOfPayment();$consultant = $this->consultant;$admin = $this->getAdmin();$consultantsForNotes = $this->getConsultantForNotes();if (empty($dateOfPayment) && $paymentDate !== null && $dateTimeNow > $paymentDate && !$consultantsForNotes->isEmpty()) {return $consultantsForNotes;} else {return $consultant ?? $admin;}}public function addConsultantForNote(Consultant $consultantForNote): static{if (!$this->consultantForNotes->contains($consultantForNote)) {$this->consultantForNotes->add($consultantForNote);}return $this;}public function removeConsultantForNote(Consultant $consultantForNote): static{$this->consultantForNotes->removeElement($consultantForNote);return $this;}/*** @return Collection<int, Task>*/public function getTasks(): Collection{return $this->tasks;}public function addTask(Task $task): static{if (!$this->tasks->contains($task)) {$this->tasks->add($task);$task->setOrderInstance($this);}return $this;}public function removeTask(Task $task): static{if ($this->tasks->removeElement($task)) {// set the owning side to null (unless already changed)if ($task->getOrderInstance() === $this) {$task->setOrderInstance(null);}}return $this;}/*** @return Collection<int, SmsHistory>*/public function getSmsHistories(): Collection{return $this->smsHistories;}public function addSmsHistory(SmsHistory $smsHistory): static{if (!$this->smsHistories->contains($smsHistory)) {$this->smsHistories->add($smsHistory);$smsHistory->setOrderId($this);}return $this;}public function removeSmsHistory(SmsHistory $smsHistory): static{if ($this->smsHistories->removeElement($smsHistory)) {// set the owning side to null (unless already changed)if ($smsHistory->getOrderId() === $this) {$smsHistory->setOrderId(null);}}return $this;}public function getNoticeDate(): ?\DateTimeInterface{return $this->noticeDate;}public function setNoticeDate(?\DateTimeInterface $noticeDate): static{$this->noticeDate = $noticeDate;return $this;}/*** @return Collection<int, SurveyResponse>*/public function getSurveyResponses(): Collection{return $this->surveyResponses;}public function addSurveyResponse(SurveyResponse $surveyResponse): static{if (!$this->surveyResponses->contains($surveyResponse)) {$this->surveyResponses->add($surveyResponse);$surveyResponse->setOrderInstance($this);}return $this;}public function removeSurveyResponse(SurveyResponse $surveyResponse): static{if ($this->surveyResponses->removeElement($surveyResponse)) {// set the owning side to null (unless already changed)if ($surveyResponse->getOrderInstance() === $this) {$surveyResponse->setOrderInstance(null);}}return $this;}/*** @return Collection<int, ZoomList>*/public function getZoomLists(): Collection{return $this->zoomLists;}public function addZoomList(ZoomList $zoomList): static{if (!$this->zoomLists->contains($zoomList)) {$this->zoomLists->add($zoomList);$zoomList->setOrderInstance($this);}return $this;}public function removeZoomList(ZoomList $zoomList): static{if ($this->zoomLists->removeElement($zoomList)) {// set the owning side to null (unless already changed)if ($zoomList->getOrderInstance() === $this) {$zoomList->setOrderInstance(null);}}return $this;}public function getTokenLicencyjnaWebAml(): ?string{return $this->tokenLicencyjnaWebAml;}public function setTokenLicencyjnaWebAml(?string $tokenLicencyjnaWebAml): static{$this->tokenLicencyjnaWebAml = $tokenLicencyjnaWebAml;return $this;}public function getTokenLicencyjnaWebAmlPartnerska(): ?string{return $this->tokenLicencyjnaWebAmlPartnerska;}public function setTokenLicencyjnaWebAmlPartnerska(?string $tokenLicencyjnaWebAmlPartnerska): static{$this->tokenLicencyjnaWebAmlPartnerska = $tokenLicencyjnaWebAmlPartnerska;return $this;}public function getTokenLicencyjnaWebAmlNieruchomosci(): ?string{return $this->tokenLicencyjnaWebAmlNieruchomosci;}public function setTokenLicencyjnaWebAmlNieruchomosci(?string $tokenLicencyjnaWebAmlNieruchomosci): static{$this->tokenLicencyjnaWebAmlNieruchomosci = $tokenLicencyjnaWebAmlNieruchomosci;return $this;}public function getDateForPoints(): ?\DateTimeInterface{return $this->dateForPoints;}public function setDateForPoints(?\DateTimeInterface $dateForPoints): static{$this->dateForPoints = $dateForPoints;return $this;}public function isPointsAdded(): ?bool{return $this->pointsAdded;}public function setPointsAdded(bool $pointsAdded): static{$this->pointsAdded = $pointsAdded;return $this;}public function isForCountingSprawozdaniaOther(): ?bool{return $this->forCountingSprawozdaniaOther;}public function setForCountingSprawozdaniaOther(bool $forCountingSprawozdaniaOther): static{$this->forCountingSprawozdaniaOther = $forCountingSprawozdaniaOther;return $this;}public function getOrderProductAgreementToken(): string{$token = '';foreach ($this->getOrderProduct() as $orderProduct) {$token = match ($orderProduct->getProduct()->getAgreement()->getType()) {'rodo' => $orderProduct->getProduct()->getToken(),'aml' => $orderProduct->getProduct()->getTokenAml(),'amlrodo' => $orderProduct->getProduct()->getTokenAmlrodo(),'bdo' => $orderProduct->getProduct()->getTokenBdo(),'bhpstacjonarna' => $orderProduct->getProduct()->getTokenBhpStationary(),'biurarachunkowe' => $orderProduct->getProduct()->getTokenOffice(),'iod' => $orderProduct->getProduct()->getTokenIod(),'rodobhp' => $orderProduct->getProduct()->getTokenBhpRodo(),'licencyjnewebaml' => $orderProduct->getProduct()->getTokenLicencyjnaWebAml(),'licencyjnewebamlpartnerska' => $orderProduct->getProduct()->getTokenLicencyjnaWebAmlPartnerska(),'licencyjnewebamlnieruchomosci' => $orderProduct->getProduct()->getTokenLicencyjnaWebAmlNieruchomosci(),default => '',};if($token){return $token;}else{return '';}}return $token;}public function isAnnex(): ?bool{return $this->annex;}public function setAnnex(bool $annex): static{$this->annex = $annex;return $this;}public function getTerminationDate(): ?\DateTimeInterface{return $this->terminationDate;}public function setTerminationDate(?\DateTimeInterface $terminationDate): static{$this->terminationDate = $terminationDate;return $this;}public function isEffectivelyTerminated(): ?bool{return $this->effectivelyTerminated;}public function setEffectivelyTerminated(bool $effectivelyTerminated): static{$this->effectivelyTerminated = $effectivelyTerminated;return $this;}public function getRootOrder(): ?self{$order = $this->getParentOrder();if ($order === null) {return null;}while ($order->getParentOrder() !== null) {$order = $order->getParentOrder();}return $order;}public function getContractStartDate(): ?\DateTimeInterface{return $this->contractStartDate;}public function setContractStartDate(?\DateTimeInterface $contractStartDate): static{$this->contractStartDate = $contractStartDate;return $this;}}