src/Entity/Idempiere/COrder.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Idempiere;
  3. use App\Repository\Idempiere\COrderRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=COrderRepository::class)
  9. * @ORM\Table(name="C_Order")
  10. */
  11. class COrder
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\Column(type="integer")
  16. */
  17. private $c_order_id;
  18. /**
  19. * @ORM\Column(type="integer")
  20. */
  21. private $ad_client_id;
  22. /**
  23. * @ORM\Column(type="integer")
  24. */
  25. private $ad_org_id;
  26. /**
  27. * @ORM\ManyToOne(targetEntity=AdOrg::class)
  28. * @ORM\JoinColumn(referencedColumnName="ad_org_id", nullable=false)
  29. */
  30. private $ad_org;
  31. /**
  32. * @ORM\Column(type="string", length=1)
  33. */
  34. private $isactive;
  35. /**
  36. * @ORM\Column(type="datetime")
  37. */
  38. private $created;
  39. /**
  40. * @ORM\Column(type="integer")
  41. */
  42. private $createdby;
  43. /**
  44. * @ORM\Column(type="datetime")
  45. */
  46. private $updated;
  47. /**
  48. * @ORM\Column(type="integer")
  49. */
  50. private $updatedby;
  51. /**
  52. * @ORM\Column(type="string", length=1)
  53. */
  54. private $issotrx;
  55. /**
  56. * @ORM\Column(type="string", length=255)
  57. */
  58. private $documentno;
  59. /**
  60. * @ORM\Column(type="string", length=3)
  61. */
  62. private $docstatus;
  63. /**
  64. * @ORM\Column(type="string", length=10)
  65. */
  66. private $docaction;
  67. /**
  68. * @ORM\Column(type="string", length=1)
  69. */
  70. private $processing;
  71. /**
  72. * @ORM\Column(type="string", length=1)
  73. */
  74. private $processed;
  75. /**
  76. * @ORM\ManyToOne(targetEntity=CDoctype::class)
  77. * @ORM\JoinColumn(name="c_doctypetarget_id", referencedColumnName="c_doctype_id", nullable=false)
  78. */
  79. private $c_doctype;
  80. /**
  81. * @ORM\Column(type="integer")
  82. */
  83. private $c_doctype_id;
  84. /**
  85. * @ORM\Column(type="integer")
  86. */
  87. private $c_doctypetarget_id;
  88. /**
  89. * @ORM\Column(type="string", length=255)
  90. */
  91. private $description;
  92. /**
  93. * @ORM\Column(type="string", length=1)
  94. */
  95. private $isapproved;
  96. /**
  97. * @ORM\ManyToOne(targetEntity=AdUser::class)
  98. * @ORM\JoinColumn(name="salesrep_id", referencedColumnName="ad_user_id")
  99. */
  100. private $salesrep;
  101. /**
  102. * @ORM\Column(type="integer")
  103. */
  104. private $salesrep_id;
  105. /**
  106. * @ORM\Column(type="datetime")
  107. */
  108. private $dateordered;
  109. /**
  110. * @ORM\Column(type="datetime")
  111. */
  112. private $dateacct;
  113. /**
  114. * @ORM\ManyToOne(targetEntity=CBpartner::class, inversedBy="orders")
  115. * @ORM\JoinColumn(referencedColumnName="c_bpartner_id", nullable=false)
  116. */
  117. private $c_bpartner;
  118. /**
  119. * @ORM\Column(type="integer")
  120. */
  121. private $c_bpartner_id;
  122. /**
  123. * @ORM\ManyToOne(targetEntity=CBpartnerLocation::class, inversedBy="c_order")
  124. * @ORM\JoinColumn(referencedColumnName="c_bpartner_location_id", nullable=false)
  125. */
  126. private $c_bpartner_location;
  127. /**
  128. * @ORM\Column(type="integer")
  129. */
  130. private $c_bpartner_location_id;
  131. /**
  132. * @ORM\ManyToOne(targetEntity=CCurrency::class)
  133. * @ORM\JoinColumn(referencedColumnName="c_currency_id", nullable=false)
  134. */
  135. private $c_currency;
  136. /**
  137. * @ORM\Column(type="integer")
  138. */
  139. private $c_currency_id;
  140. /**
  141. * @ORM\Column(type="string", length=1)
  142. */
  143. private $paymentrule;
  144. /**
  145. * @ORM\ManyToOne(targetEntity=CPaymentterm::class)
  146. * @ORM\JoinColumn(referencedColumnName="c_paymentterm_id", nullable=false)
  147. */
  148. private $c_paymentterm;
  149. /**
  150. * @ORM\Column(type="integer")
  151. */
  152. private $c_paymentterm_id;
  153. /**
  154. * @ORM\Column(type="string", length=1)
  155. */
  156. private $invoicerule;
  157. /**
  158. * @ORM\Column(type="string", length=1)
  159. */
  160. private $deliveryrule;
  161. /**
  162. * @ORM\Column(type="string", length=1)
  163. */
  164. private $freightcostrule;
  165. /**
  166. * @ORM\Column(type="string", length=1)
  167. */
  168. private $deliveryviarule;
  169. /**
  170. * @ORM\Column(type="string", length=1)
  171. */
  172. private $priorityrule;
  173. /**
  174. * @ORM\Column(type="float")
  175. */
  176. private $totallines;
  177. /**
  178. * @ORM\Column(type="float")
  179. */
  180. private $grandtotal;
  181. /**
  182. * @ORM\Column(type="integer")
  183. */
  184. private $m_warehouse_id;
  185. /**
  186. * @ORM\ManyToOne(targetEntity=MWarehouse::class)
  187. * @ORM\JoinColumn(referencedColumnName="m_warehouse_id", nullable=false)
  188. */
  189. private $m_warehouse;
  190. /**
  191. * @ORM\ManyToOne(targetEntity=MPricelist::class)
  192. * @ORM\JoinColumn(referencedColumnName="m_pricelist_id", nullable=false)
  193. */
  194. private $m_pricelist;
  195. /**
  196. * @ORM\Column(type="integer")
  197. */
  198. private $m_pricelist_id;
  199. /**
  200. * @ORM\Column(type="string", length=255)
  201. */
  202. private $c_order_uu;
  203. /**
  204. * @ORM\OneToMany(targetEntity=COrderpayschedule::class, mappedBy="c_order")
  205. */
  206. private $c_orderpayschedules;
  207. private $dueamt;
  208. private $duedays;
  209. /**
  210. * @ORM\OneToMany(targetEntity=COrderline::class, mappedBy="c_order", orphanRemoval=true)
  211. */
  212. private $c_orderlines;
  213. /**
  214. * @ORM\OneToMany(targetEntity=CPayment::class, mappedBy="c_order")
  215. */
  216. private $c_payments;
  217. private $convertedamt;
  218. /**
  219. * @ORM\ManyToOne(targetEntity=SmMarca::class)
  220. * @ORM\JoinColumn(referencedColumnName="sm_marca_id", nullable=false)
  221. */
  222. private $sm_marca;
  223. /**
  224. * @ORM\Column(type="integer")
  225. */
  226. private $sm_marca_id;
  227. /**
  228. * @ORM\Column(type="integer", nullable=true)
  229. */
  230. private $c_conversiontype_id;
  231. /**
  232. * @ORM\OneToOne(targetEntity=SmRvOrderqty::class, mappedBy="c_order_id")
  233. */
  234. private $SummaryQty;
  235. /**
  236. * @ORM\ManyToOne(targetEntity=SmSalestemplate::class, inversedBy="orders")
  237. * @ORM\JoinColumn(referencedColumnName="sm_salestemplate_id", name="sm_salestemplate_id")
  238. */
  239. private $salestemplate;
  240. private $sm_salestemplate_id;
  241. /**
  242. * @ORM\OneToMany(targetEntity=CInvoice::class, mappedBy="c_order")
  243. */
  244. private $c_invoices;
  245. public function __construct()
  246. {
  247. $this->c_orderpayschedules = new ArrayCollection();
  248. $this->c_orderlines = new ArrayCollection();
  249. $this->c_payments = new ArrayCollection();
  250. $this->c_invoices = new ArrayCollection();
  251. }
  252. public function getId(): ?int
  253. {
  254. return $this->getCOrderId();
  255. }
  256. public function getCOrderId(): ?int
  257. {
  258. return $this->c_order_id;
  259. }
  260. public function setCOrderId(int $c_order_id): self
  261. {
  262. $this->c_order_id = $c_order_id;
  263. return $this;
  264. }
  265. public function getAdClientId(): ?int
  266. {
  267. return $this->ad_client_id;
  268. }
  269. public function setAdClientId(int $ad_client_id): self
  270. {
  271. $this->ad_client_id = $ad_client_id;
  272. return $this;
  273. }
  274. public function getAdOrgId(): ?int
  275. {
  276. return $this->ad_org_id;
  277. }
  278. public function setAdOrgId(int $ad_org_id): self
  279. {
  280. $this->ad_org_id = $ad_org_id;
  281. return $this;
  282. }
  283. public function getAdOrg(): ?AdOrg
  284. {
  285. return $this->ad_org;
  286. }
  287. public function setAdOrg(?AdOrg $ad_org): self
  288. {
  289. $this->ad_org = $ad_org;
  290. return $this;
  291. }
  292. public function getIsactive(): ?string
  293. {
  294. return $this->isactive;
  295. }
  296. public function setIsactive(string $isactive): self
  297. {
  298. $this->isactive = $isactive;
  299. return $this;
  300. }
  301. public function getCreated(): ?\DateTimeInterface
  302. {
  303. return $this->created;
  304. }
  305. public function setCreated(\DateTimeInterface $created): self
  306. {
  307. $this->created = $created;
  308. return $this;
  309. }
  310. public function getCreatedby(): ?int
  311. {
  312. return $this->createdby;
  313. }
  314. public function setCreatedby(int $createdby): self
  315. {
  316. $this->createdby = $createdby;
  317. return $this;
  318. }
  319. public function getUpdated(): ?\DateTimeInterface
  320. {
  321. return $this->updated;
  322. }
  323. public function setUpdated(\DateTimeInterface $updated): self
  324. {
  325. $this->updated = $updated;
  326. return $this;
  327. }
  328. public function getUpdatedby(): ?int
  329. {
  330. return $this->updatedby;
  331. }
  332. public function setUpdatedby(int $updatedby): self
  333. {
  334. $this->updatedby = $updatedby;
  335. return $this;
  336. }
  337. public function getIssotrx(): ?string
  338. {
  339. return $this->issotrx;
  340. }
  341. public function setIssotrx(string $issotrx): self
  342. {
  343. $this->issotrx = $issotrx;
  344. return $this;
  345. }
  346. public function getDocumentno(): ?string
  347. {
  348. return $this->documentno;
  349. }
  350. public function setDocumentno(string $documentno): self
  351. {
  352. $this->documentno = $documentno;
  353. return $this;
  354. }
  355. public function getDocstatus(): ?string
  356. {
  357. return $this->docstatus;
  358. }
  359. public function setDocstatus(string $docstatus): self
  360. {
  361. $this->docstatus = $docstatus;
  362. return $this;
  363. }
  364. public function getDocaction(): ?string
  365. {
  366. return $this->docaction;
  367. }
  368. public function setDocaction(string $docaction): self
  369. {
  370. $this->docaction = $docaction;
  371. return $this;
  372. }
  373. public function getProcessing(): ?string
  374. {
  375. return $this->processing;
  376. }
  377. public function setProcessing(string $processing): self
  378. {
  379. $this->processing = $processing;
  380. return $this;
  381. }
  382. public function getProcessed(): ?string
  383. {
  384. return $this->processed;
  385. }
  386. public function setProcessed(string $processed): self
  387. {
  388. $this->processed = $processed;
  389. return $this;
  390. }
  391. public function getCDoctype(): ?CDoctype
  392. {
  393. return $this->c_doctype;
  394. }
  395. public function setCDoctype(?CDoctype $c_doctype): self
  396. {
  397. $this->c_doctype = $c_doctype;
  398. return $this;
  399. }
  400. public function getCDoctypeId(): ?int
  401. {
  402. return $this->c_doctype_id;
  403. }
  404. public function setCDoctypeId(int $c_doctype_id): self
  405. {
  406. $this->c_doctype_id = $c_doctype_id;
  407. return $this;
  408. }
  409. public function getCDoctypetargetId(): ?int
  410. {
  411. return $this->c_doctypetarget_id;
  412. }
  413. public function setCDoctypetargetId(int $c_doctypetarget_id): self
  414. {
  415. $this->c_doctypetarget_id = $c_doctypetarget_id;
  416. return $this;
  417. }
  418. public function getDescription(): ?string
  419. {
  420. return $this->description;
  421. }
  422. public function setDescription(string $description): self
  423. {
  424. $this->description = $description;
  425. return $this;
  426. }
  427. public function getIsapproved(): ?string
  428. {
  429. return $this->isapproved;
  430. }
  431. public function setIsapproved(string $isapproved): self
  432. {
  433. $this->isapproved = $isapproved;
  434. return $this;
  435. }
  436. public function getSalesrepId(): ?int
  437. {
  438. return $this->salesrep_id;
  439. }
  440. public function setSalesrepId(int $salesrep_id): self
  441. {
  442. $this->salesrep_id = $salesrep_id;
  443. return $this;
  444. }
  445. public function getDateordered(): ?\DateTimeInterface
  446. {
  447. return $this->dateordered;
  448. }
  449. public function setDateordered(\DateTimeInterface $dateordered): self
  450. {
  451. $this->dateordered = $dateordered;
  452. return $this;
  453. }
  454. public function getDateacct(): ?\DateTimeInterface
  455. {
  456. return $this->dateacct;
  457. }
  458. public function setDateacct(\DateTimeInterface $dateacct): self
  459. {
  460. $this->dateacct = $dateacct;
  461. return $this;
  462. }
  463. public function getCBpartner(): ?CBpartner
  464. {
  465. return $this->c_bpartner;
  466. }
  467. public function setCBpartner(?CBpartner $c_bpartner): self
  468. {
  469. $this->c_bpartner = $c_bpartner;
  470. return $this;
  471. }
  472. public function getCBpartnerId(): ?int
  473. {
  474. return $this->c_bpartner_id;
  475. }
  476. public function setCBpartnerId(int $c_bpartner_id): self
  477. {
  478. $this->c_bpartner_id = $c_bpartner_id;
  479. return $this;
  480. }
  481. public function getCBpartnerLocation(): ?CBpartnerLocation
  482. {
  483. return $this->c_bpartner_location;
  484. }
  485. public function setCBpartnerLocation(?CBpartnerLocation $c_bpartner_location): self
  486. {
  487. $this->c_bpartner_location = $c_bpartner_location;
  488. return $this;
  489. }
  490. public function getCBpartnerLocationId(): ?int
  491. {
  492. return $this->c_bpartner_location_id;
  493. }
  494. public function setCBpartnerLocationId(int $c_bpartner_location_id): self
  495. {
  496. $this->c_bpartner_location_id = $c_bpartner_location_id;
  497. return $this;
  498. }
  499. public function getCCurrency(): ?CCurrency
  500. {
  501. return $this->c_currency;
  502. }
  503. public function setCCurrency(?CCurrency $c_currency): self
  504. {
  505. $this->c_currency = $c_currency;
  506. return $this;
  507. }
  508. public function getCCurrencyId(): ?int
  509. {
  510. return $this->c_currency_id;
  511. }
  512. public function setCCurrencyId(int $c_currency_id): self
  513. {
  514. $this->c_currency_id = $c_currency_id;
  515. return $this;
  516. }
  517. public function getPaymentrule(): ?string
  518. {
  519. return $this->paymentrule;
  520. }
  521. public function setPaymentrule(string $paymentrule): self
  522. {
  523. $this->paymentrule = $paymentrule;
  524. return $this;
  525. }
  526. public function getCPaymentterm(): ?CPaymentterm
  527. {
  528. return $this->c_paymentterm;
  529. }
  530. public function setCPaymentterm(?CPaymentterm $c_paymentterm): self
  531. {
  532. $this->c_paymentterm = $c_paymentterm;
  533. return $this;
  534. }
  535. public function getCPaymenttermId(): ?int
  536. {
  537. return $this->c_paymentterm_id;
  538. }
  539. public function setCPaymenttermId(int $c_paymentterm_id): self
  540. {
  541. $this->c_paymentterm_id = $c_paymentterm_id;
  542. return $this;
  543. }
  544. public function getInvoicerule(): ?string
  545. {
  546. return $this->invoicerule;
  547. }
  548. public function setInvoicerule(string $invoicerule): self
  549. {
  550. $this->invoicerule = $invoicerule;
  551. return $this;
  552. }
  553. public function getDeliveryrule(): ?string
  554. {
  555. return $this->deliveryrule;
  556. }
  557. public function setDeliveryrule(string $deliveryrule): self
  558. {
  559. $this->deliveryrule = $deliveryrule;
  560. return $this;
  561. }
  562. public function getFreightcostrule(): ?string
  563. {
  564. return $this->freightcostrule;
  565. }
  566. public function setFreightcostrule(string $freightcostrule): self
  567. {
  568. $this->freightcostrule = $freightcostrule;
  569. return $this;
  570. }
  571. public function getDeliveryviarule(): ?string
  572. {
  573. return $this->deliveryviarule;
  574. }
  575. public function setDeliveryviarule(string $deliveryviarule): self
  576. {
  577. $this->deliveryviarule = $deliveryviarule;
  578. return $this;
  579. }
  580. public function getPriorityrule(): ?string
  581. {
  582. return $this->priorityrule;
  583. }
  584. public function setPriorityrule(string $priorityrule): self
  585. {
  586. $this->priorityrule = $priorityrule;
  587. return $this;
  588. }
  589. public function getTotallines(): ?float
  590. {
  591. return $this->totallines;
  592. }
  593. public function setTotallines(float $totallines): self
  594. {
  595. $this->totallines = $totallines;
  596. return $this;
  597. }
  598. public function getGrandtotal(): ?float
  599. {
  600. return $this->grandtotal;
  601. }
  602. public function setGrandtotal(float $grandtotal): self
  603. {
  604. $this->grandtotal = $grandtotal;
  605. return $this;
  606. }
  607. public function getMPricelist(): ?MPricelist
  608. {
  609. return $this->m_pricelist;
  610. }
  611. public function setMPricelist(?MPricelist $m_pricelist): self
  612. {
  613. $this->m_pricelist = $m_pricelist;
  614. return $this;
  615. }
  616. public function getMWarehouseId(): ?int
  617. {
  618. return $this->m_warehouse_id;
  619. }
  620. public function setMWarehouseId(int $m_warehouse_id): self
  621. {
  622. $this->m_warehouse_id = $m_warehouse_id;
  623. return $this;
  624. }
  625. public function getMWarehouse(): ?MWarehouse
  626. {
  627. return $this->m_warehouse;
  628. }
  629. public function setMWarehouse(?MWarehouse $m_warehouse): self
  630. {
  631. $this->m_warehouse = $m_warehouse;
  632. return $this;
  633. }
  634. public function getMPricelistId(): ?int
  635. {
  636. return $this->m_pricelist_id;
  637. }
  638. public function setMPricelistId(int $m_pricelist_id): self
  639. {
  640. $this->m_pricelist_id = $m_pricelist_id;
  641. return $this;
  642. }
  643. public function getCOrderUu(): ?string
  644. {
  645. return $this->c_order_uu;
  646. }
  647. public function setCOrderUu(string $c_order_uu): self
  648. {
  649. $this->c_order_uu = $c_order_uu;
  650. return $this;
  651. }
  652. public function getSalesrep(): ?AdUser
  653. {
  654. return $this->salesrep;
  655. }
  656. public function setSalesrep(?AdUser $salesrep): self
  657. {
  658. $this->salesrep = $salesrep;
  659. return $this;
  660. }
  661. /**
  662. * @return Collection<int, COrderpayschedule>
  663. */
  664. public function getCOrderpayschedules(): Collection
  665. {
  666. return $this->c_orderpayschedules;
  667. }
  668. public function addCOrderpayschedule(COrderpayschedule $cOrderpayschedule): self
  669. {
  670. if (!$this->c_orderpayschedules->contains($cOrderpayschedule)) {
  671. $this->c_orderpayschedules[] = $cOrderpayschedule;
  672. $cOrderpayschedule->setCOrder($this);
  673. }
  674. return $this;
  675. }
  676. public function removeCOrderpayschedule(COrderpayschedule $cOrderpayschedule): self
  677. {
  678. if ($this->c_orderpayschedules->removeElement($cOrderpayschedule)) {
  679. // set the owning side to null (unless already changed)
  680. if ($cOrderpayschedule->getCOrder() === $this) {
  681. $cOrderpayschedule->setCOrder(null);
  682. }
  683. }
  684. return $this;
  685. }
  686. public function getDueAmt():? Float
  687. {
  688. return $this->dueamt;
  689. }
  690. public function setDueAmt(Float $dueamt):? Self
  691. {
  692. $this->dueamt = $dueamt;
  693. return $this;
  694. }
  695. public function getDueDays():? String
  696. {
  697. return $this->duedays;
  698. }
  699. public function setDueDays(String $duedays):? Self
  700. {
  701. $this->duedays = $duedays;
  702. return $this;
  703. }
  704. /**
  705. * @return Collection<int, COrderline>
  706. */
  707. public function getCOrderlines(): Collection
  708. {
  709. return $this->c_orderlines;
  710. }
  711. public function addCOrderline(COrderline $cOrderline): self
  712. {
  713. if (!$this->c_orderlines->contains($cOrderline)) {
  714. $this->c_orderlines[] = $cOrderline;
  715. $cOrderline->setCOrder($this);
  716. }
  717. return $this;
  718. }
  719. public function removeCOrderline(COrderline $cOrderline): self
  720. {
  721. if ($this->c_orderlines->removeElement($cOrderline)) {
  722. // set the owning side to null (unless already changed)
  723. if ($cOrderline->getCOrder() === $this) {
  724. $cOrderline->setCOrder(null);
  725. }
  726. }
  727. return $this;
  728. }
  729. /**
  730. * @return Collection<int, CPayment>
  731. */
  732. public function getCPayments(): Collection
  733. {
  734. return $this->c_payments;
  735. }
  736. public function addCPayment(CPayment $cPayment): self
  737. {
  738. if (!$this->c_payments->contains($cPayment)) {
  739. $this->c_payments[] = $cPayment;
  740. $cPayment->setCOrder($this);
  741. }
  742. return $this;
  743. }
  744. public function removeCPayment(CPayment $cPayment): self
  745. {
  746. if ($this->c_payments->removeElement($cPayment)) {
  747. // set the owning side to null (unless already changed)
  748. if ($cPayment->getCOrder() === $this) {
  749. $cPayment->setCOrder(null);
  750. }
  751. }
  752. return $this;
  753. }
  754. public function getConvertedamt(): ?float
  755. {
  756. return $this->convertedamt;
  757. }
  758. public function setConvertedamt(?float $convertedamt): self
  759. {
  760. $this->convertedamt = $convertedamt;
  761. return $this;
  762. }
  763. public function getCConversiontypeId(): ?int
  764. {
  765. return $this->c_conversiontype_id;
  766. }
  767. public function setCConversiontypeId(?int $c_conversiontype_id): self
  768. {
  769. $this->c_conversiontype_id = $c_conversiontype_id;
  770. return $this;
  771. }
  772. public function getSmMarca(): ?SmMarca
  773. {
  774. return $this->sm_marca;
  775. }
  776. public function getMarca(): string
  777. {
  778. return $this->getSmMarca() ? $this->getSmMarca()->getName() : '';
  779. }
  780. public function setSmMarca(?SmMarca $sm_marca): self
  781. {
  782. $this->sm_marca = $sm_marca;
  783. return $this;
  784. }
  785. public function getSmMarcaId(): ?int
  786. {
  787. return $this->sm_marca_id;
  788. }
  789. public function setSmMarcaId(int $sm_marca_id): self
  790. {
  791. $this->sm_marca_id = $sm_marca_id;
  792. return $this;
  793. }
  794. public function getSummaryQty(): ?SmRvOrderqty
  795. {
  796. return $this->SummaryQty;
  797. }
  798. public function setSummaryQty(?SmRvOrderqty $SummaryQty): self
  799. {
  800. $this->SummaryQty = $SummaryQty;
  801. return $this;
  802. }
  803. /**
  804. * Get the status of the sales process
  805. */
  806. public function getProcessStatus(): string
  807. {
  808. $docStatus = $this->getDocstatus();
  809. $processStatus = 'CL';
  810. if (!$this->getSummaryQty())
  811. return $processStatus;
  812. if (in_array($docStatus, ['DR', 'VO']) ||
  813. ($this->getSummaryQty()->getQtyreserved() >= 0 && in_array($docStatus, ['AP', 'IP', 'NA', 'IN', 'RE']))) {
  814. $processStatus = $docStatus;
  815. } else if ($docStatus === 'CO') {
  816. if ($this->getSummaryQty()->getQtyreserved() === floatval(0)) {
  817. if ($this->getSummaryQty()->getQtydelivered() === $this->getSummaryQty()->getQtyinvoiced())
  818. $processStatus = 'PC';
  819. else if ($this->getSummaryQty()->getQtydelivered() > $this->getSummaryQty()->getQtyinvoiced())
  820. $processStatus = 'PF';
  821. } else if ($this->getSummaryQty()->getQtyreserved() > floatval(0)) {
  822. if ($this->getSummaryQty()->getQtyordered() === $this->getSummaryQty()->getQtyinvoiced())
  823. $processStatus = 'PW';
  824. else if ($this->getSummaryQty()->getQtyordered() > $this->getSummaryQty()->getQtyinvoiced())
  825. $processStatus = 'PD';
  826. }
  827. } else if ($docStatus === 'CL') {
  828. if ($this->getSummaryQty()->getQtylostsales() === floatval(0))
  829. $processStatus = 'CL';
  830. else if ($this->getSummaryQty()->getQtylostsales() > floatval(0))
  831. $processStatus = 'LS';
  832. }
  833. return $processStatus;
  834. }
  835. public function getSmSalestemplateId(): ?int
  836. {
  837. return $this->sm_salestemplate_id;
  838. }
  839. public function setSmSalestemplateId(int $sm_salestemplate_id): self
  840. {
  841. $this->sm_salestemplate_id = $sm_salestemplate_id;
  842. return $this;
  843. }
  844. public function getSmSalestemplate(): ?SmSalestemplate
  845. {
  846. return $this->salestemplate;
  847. }
  848. public function setSmSalestemplate(?SmSalestemplate $salestemplate): self
  849. {
  850. $this->salestemplate = $salestemplate;
  851. $this->setSmSalestemplateId( $salestemplate->getId() );
  852. return $this;
  853. }
  854. /**
  855. * @return Collection<int, CInvoice>
  856. */
  857. public function getCInvoices(): Collection
  858. {
  859. return $this->c_invoices;
  860. }
  861. }