src/Entity/Idempiere/CBpartner.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Idempiere;
  3. use App\Repository\Idempiere\CBpartnerRepository;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9. * @ORM\Entity(repositoryClass=CBpartnerRepository::class)
  10. * @ORM\Table(name="c_bpartner")
  11. */
  12. class CBpartner
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\Column(type="integer")
  17. */
  18. private $c_bpartner_id;
  19. /**
  20. * @ORM\Column(type="integer")
  21. */
  22. private $ad_client_id;
  23. /**
  24. * @ORM\Column(type="integer")
  25. */
  26. private $ad_org_id;
  27. private $ad_org;
  28. /**
  29. * @ORM\Column(type="string", length=255)
  30. */
  31. private $name;
  32. /**
  33. * @ORM\Column(type="string", length=60, nullable=true)
  34. */
  35. private $name2;
  36. /**
  37. * @ORM\Column(type="string", length=1)
  38. */
  39. private $isdetailednames;
  40. /**
  41. * @ORM\Column(type="string", length=60, nullable=true)
  42. */
  43. private $firstname1;
  44. /**
  45. * @ORM\Column(type="string", length=60, nullable=true)
  46. */
  47. private $firstname2;
  48. /**
  49. * @ORM\Column(type="string", length=60, nullable=true)
  50. */
  51. private $lastname1;
  52. /**
  53. * @ORM\Column(type="string", length=60, nullable=true)
  54. */
  55. private $lastname2;
  56. /**
  57. * @ORM\Column(type="string", length=255)
  58. */
  59. private $taxid;
  60. /**
  61. * @ORM\OneToMany(targetEntity=SmSalestemplate::class, mappedBy="c_bpartner")
  62. */
  63. private $salestemplate;
  64. /**
  65. * @ORM\OneToMany(targetEntity=COrder::class, mappedBy="c_bpartner")
  66. */
  67. private $orders;
  68. /**
  69. * @ORM\Column(type="string", length=1)
  70. */
  71. private $isactive;
  72. /**
  73. * @ORM\Column(type="string", length=1)
  74. */
  75. private $iscustomer;
  76. /**
  77. * @ORM\Column(type="string", length=255)
  78. */
  79. private $value;
  80. /**
  81. * @ORM\OneToMany(targetEntity=CBpartnerLocation::class, mappedBy="c_bpartner")
  82. */
  83. private $c_bpartner_location;
  84. /**
  85. * @ORM\Column(type="string", length=1)
  86. */
  87. private $issalesrep;
  88. /**
  89. * @ORM\Column(type="string", length=1)
  90. */
  91. private $ismatriz;
  92. /**
  93. * @ORM\Column(type="string", length=1)
  94. */
  95. private $issummary;
  96. /**
  97. * @ORM\OneToMany(targetEntity=CInvoice::class, mappedBy="c_bpartner")
  98. */
  99. private $c_invoices;
  100. /**
  101. * @ORM\OneToMany(targetEntity=MInout::class, mappedBy="c_bpartner")
  102. */
  103. private $m_inouts;
  104. /**
  105. * @ORM\OneToMany(targetEntity=SmSalesRep::class, mappedBy="c_bpartner")
  106. */
  107. private $sm_sales_reps;
  108. /**
  109. * @ORM\Column(type="float")
  110. */
  111. private $totalopenbalance;
  112. /**
  113. * @ORM\Column(type="datetime")
  114. */
  115. private $firstsale;
  116. /**
  117. * @ORM\Column(type="float")
  118. */
  119. private $so_creditlimit;
  120. /**
  121. * @ORM\Column(type="string", length=255)
  122. */
  123. private $description;
  124. /**
  125. * @ORM\Column(type="string", length=1, nullable=true)
  126. */
  127. private $socreditstatus;
  128. protected array $SoCreditStatus = [
  129. "H" => "Credit.Hold",
  130. "O" => "Credit.OK",
  131. "S" => "Credit.Stop",
  132. "W" => "Credit.Watch",
  133. "X" => "No Credit Check"
  134. ];
  135. /**
  136. * @ORM\Column(type="string", length=1)
  137. */
  138. private $istaxexempt;
  139. /**
  140. * @ORM\Column(type="integer", nullable=true)
  141. */
  142. private $sm_bp_type_id;
  143. /**
  144. * @ORM\ManyToOne(targetEntity=SmBpType::class)
  145. * @ORM\JoinColumn(referencedColumnName="sm_bp_type_id")
  146. */
  147. private $sm_bp_type;
  148. /**
  149. * @ORM\Column(type="integer", nullable=true)
  150. */
  151. private $sm_bp_segment_cm_area_id;
  152. /**
  153. * @ORM\ManyToOne(targetEntity=SmBpSegmentCmArea::class)
  154. * @ORM\JoinColumn(referencedColumnName="sm_bp_segment_cm_area_id")
  155. */
  156. private $sm_bp_segment_cm_area;
  157. /**
  158. * @ORM\Column(type="integer")
  159. */
  160. private $lco_taxidtype_id;
  161. /**
  162. * @ORM\ManyToOne(targetEntity=LcoTaxidtype::class)
  163. * @ORM\JoinColumn(referencedColumnName="lco_taxidtype_id", nullable=false)
  164. */
  165. private $lco_taxidtype;
  166. /**
  167. * @ORM\Column(type="datetime")
  168. */
  169. private $created;
  170. /**
  171. * @ORM\Column(type="integer")
  172. */
  173. private $createdby;
  174. /**
  175. * @ORM\Column(type="datetime")
  176. */
  177. private $updated;
  178. /**
  179. * @ORM\Column(type="integer")
  180. */
  181. private $updatedby;
  182. /**
  183. * @ORM\Column(type="string", length=1)
  184. */
  185. private $isprospect;
  186. /**
  187. * @ORM\Column(type="string", length=1)
  188. */
  189. private $isonetime;
  190. /**
  191. * @ORM\Column(type="string", length=1)
  192. */
  193. private $isvendor;
  194. /**
  195. * @ORM\Column(type="string", length=1)
  196. */
  197. private $isemployee;
  198. /**
  199. * @ORM\Column(type="float", nullable=true)
  200. */
  201. private $so_creditused;
  202. /**
  203. * @ORM\Column(type="string", length=1, nullable=true)
  204. */
  205. private $invoicerule;
  206. /**
  207. * @ORM\Column(type="string", length=1, nullable=true)
  208. */
  209. private $deliveryrule;
  210. /**
  211. * @ORM\Column(type="string", length=1, nullable=true)
  212. */
  213. private $freightcostrule;
  214. /**
  215. * @ORM\Column(type="string", length=1, nullable=true)
  216. */
  217. private $deliveryviarule;
  218. /**
  219. * @ORM\Column(type="string", length=1)
  220. */
  221. private $sendemail;
  222. /**
  223. * @ORM\Column(type="string", length=1)
  224. */
  225. private $ispotaxexempt;
  226. /**
  227. * @ORM\Column(type="string", length=1)
  228. */
  229. private $is1099vendor;
  230. /**
  231. * @ORM\Column(type="string", length=1)
  232. */
  233. private $isusetaxiddigit;
  234. /**
  235. * @ORM\OneToMany(targetEntity=CPayment::class, mappedBy="c_bpartner")
  236. */
  237. private $c_payments;
  238. /**
  239. * @ORM\Column(type="integer", nullable=true)
  240. */
  241. private $c_bp_group_id;
  242. /**
  243. * @ORM\OneToMany(targetEntity=CBpartnerLocation::class, mappedBy="c_bpartner")
  244. */
  245. private $address;
  246. public function __construct()
  247. {
  248. $this->salestemplate = new ArrayCollection();
  249. $this->orders = new ArrayCollection();
  250. $this->c_bpartner_location = new ArrayCollection();
  251. $this->c_invoices = new ArrayCollection();
  252. $this->m_inouts = new ArrayCollection();
  253. $this->sm_sales_reps = new ArrayCollection();
  254. $this->c_payments = new ArrayCollection();
  255. }
  256. public function getId(): ?int
  257. {
  258. return $this->getCBpartnerId();
  259. }
  260. public function getAdClientId(): ?int
  261. {
  262. return $this->ad_client_id;
  263. }
  264. public function setAdClientId(int $ad_client_id): self
  265. {
  266. $this->ad_client_id = $ad_client_id;
  267. return $this;
  268. }
  269. public function getAdOrgId(): ?int
  270. {
  271. return $this->ad_org_id;
  272. }
  273. public function setAdOrgId(int $ad_org_id): self
  274. {
  275. $this->ad_org_id = $ad_org_id;
  276. return $this;
  277. }
  278. public function getAdOrg(): ?AdOrg
  279. {
  280. return $this->ad_org;
  281. }
  282. public function setAdOrg(?AdOrg $AdOrg): self
  283. {
  284. $this->ad_org = $AdOrg;
  285. $this->ad_org_id = $AdOrg->getId();
  286. return $this;
  287. }
  288. public function getCBpartnerId(): ?int
  289. {
  290. return $this->c_bpartner_id;
  291. }
  292. public function setCBpartnerId(int $c_bpartner_id): self
  293. {
  294. $this->c_bpartner_id = $c_bpartner_id;
  295. return $this;
  296. }
  297. public function getName(): ?string
  298. {
  299. return $this->name;
  300. }
  301. public function setName(string $name): self
  302. {
  303. $this->name = $name;
  304. return $this;
  305. }
  306. public function getName2(): ?string
  307. {
  308. return $this->name2;
  309. }
  310. public function setName2(?string $name2): self
  311. {
  312. $this->name2 = $name2;
  313. return $this;
  314. }
  315. public function getIsdetailednames(): ?string
  316. {
  317. return $this->isdetailednames;
  318. }
  319. public function setIsdetailednames(string $isdetailednames): self
  320. {
  321. $this->isdetailednames = $isdetailednames;
  322. return $this;
  323. }
  324. public function getFirstname1(): ?string
  325. {
  326. return $this->firstname1;
  327. }
  328. public function setFirstname1(?string $firstname1): self
  329. {
  330. $this->firstname1 = $firstname1;
  331. return $this;
  332. }
  333. public function getFirstname2(): ?string
  334. {
  335. return $this->firstname2;
  336. }
  337. public function setFirstname2(?string $firstname2): self
  338. {
  339. $this->firstname2 = $firstname2;
  340. return $this;
  341. }
  342. public function getLastname1(): ?string
  343. {
  344. return $this->lastname1;
  345. }
  346. public function setLastname1(?string $lastname1): self
  347. {
  348. $this->lastname1 = $lastname1;
  349. return $this;
  350. }
  351. public function getLastname2(): ?string
  352. {
  353. return $this->lastname2;
  354. }
  355. public function setLastname2(?string $lastname2): self
  356. {
  357. $this->lastname2 = $lastname2;
  358. return $this;
  359. }
  360. public function getTaxid(): ?string
  361. {
  362. return $this->taxid;
  363. }
  364. public function setTaxid(string $taxid): self
  365. {
  366. $this->taxid = $taxid;
  367. return $this;
  368. }
  369. /**
  370. * @return Collection|COrder[]
  371. */
  372. public function getOrders(): Collection
  373. {
  374. return $this->orders;
  375. }
  376. public function addOrder(COrder $order): self
  377. {
  378. if (!$this->orders->contains($order)) {
  379. $this->orders[] = $order;
  380. $order->setCBpartner($this);
  381. }
  382. return $this;
  383. }
  384. public function removeOrder(COrder $order): self
  385. {
  386. if ($this->orders->removeElement($order)) {
  387. // set the owning side to null (unless already changed)
  388. if ($order->getCBpartner() === $this) {
  389. $order->setCBpartner(null);
  390. }
  391. }
  392. return $this;
  393. }
  394. public function isActive(): ?bool
  395. {
  396. return $this->getIsactive() === "Y";
  397. }
  398. public function getIsactive(): ?string
  399. {
  400. return $this->isactive;
  401. }
  402. public function setIsactive(string $isactive): self
  403. {
  404. $this->isactive = $isactive;
  405. return $this;
  406. }
  407. public function getIscustomer(): ?bool
  408. {
  409. return $this->iscustomer == "Y";
  410. }
  411. public function setIscustomer(bool $iscustomer = true): self
  412. {
  413. $this->iscustomer = $iscustomer ? "Y" : "N";
  414. return $this;
  415. }
  416. public function getValue(): ?string
  417. {
  418. return $this->value;
  419. }
  420. public function setValue(string $value): self
  421. {
  422. $this->value = $value;
  423. return $this;
  424. }
  425. /**
  426. * @return Collection|CBpartnerLocation[]
  427. */
  428. public function getCBpartnerLocation(): Collection
  429. {
  430. return $this->c_bpartner_location;
  431. }
  432. public function addCBpartnerLocation(CBpartnerLocation $cBpartnerLocation): self
  433. {
  434. if (!$this->c_bpartner_location->contains($cBpartnerLocation)) {
  435. $this->c_bpartner_location[] = $cBpartnerLocation;
  436. $cBpartnerLocation->setCBpartner($this);
  437. }
  438. return $this;
  439. }
  440. public function removeCBpartnerLocation(CBpartnerLocation $cBpartnerLocation): self
  441. {
  442. if ($this->c_bpartner_location->removeElement($cBpartnerLocation)) {
  443. // set the owning side to null (unless already changed)
  444. if ($cBpartnerLocation->getCBpartner() === $this) {
  445. $cBpartnerLocation->setCBpartner(null);
  446. }
  447. }
  448. return $this;
  449. }
  450. /**
  451. * @return Collection|CBpartnerLocation[]
  452. */
  453. public function getBPartnerInvoiceLocation(): Collection
  454. {
  455. $locations = $this->getCBpartnerLocation();
  456. return $locations->filter(function($bplocation) {
  457. return $bplocation->getIsbillto() === true;
  458. });
  459. }
  460. /**
  461. * @return Collection|CBpartnerLocation[]
  462. */
  463. public function getBPartnerShipmentLocation(): Collection
  464. {
  465. $locations = $this->getCBpartnerLocation();
  466. return $locations->filter(function($bplocation) {
  467. return $bplocation->getIsshipto() === true;
  468. });
  469. }
  470. public function getIssalesrep(): bool
  471. {
  472. return $this->issalesrep === "Y";
  473. }
  474. public function setIssalesrep(bool $issalesrep): self
  475. {
  476. $this->issalesrep = $issalesrep ? "Y" : "N";
  477. return $this;
  478. }
  479. public function IsSalesRep(): bool {
  480. return $this->getIssalesrep();
  481. }
  482. public function getIsmatriz(): ?bool
  483. {
  484. return $this->ismatriz === "Y";
  485. }
  486. public function setIsmatriz(bool $ismatriz): self
  487. {
  488. $this->ismatriz = $ismatriz ? "Y" : "N";
  489. return $this;
  490. }
  491. public function getIssummary(): ?bool
  492. {
  493. return $this->issummary === "Y";
  494. }
  495. public function setIssummary(bool $issummary): self
  496. {
  497. $this->issummary = $issummary ? "Y" : "N";
  498. return $this;
  499. }
  500. /**
  501. * @return Collection|CInvoice[]
  502. */
  503. public function getCInvoices(): Collection
  504. {
  505. return $this->c_invoices;
  506. }
  507. public function addCInvoice(CInvoice $cInvoice): self
  508. {
  509. if (!$this->c_invoices->contains($cInvoice)) {
  510. $this->c_invoices[] = $cInvoice;
  511. $cInvoice->setCBpartner($this);
  512. }
  513. return $this;
  514. }
  515. public function removeCInvoice(CInvoice $cInvoice): self
  516. {
  517. if ($this->c_invoices->removeElement($cInvoice)) {
  518. // set the owning side to null (unless already changed)
  519. if ($cInvoice->getCBpartner() === $this) {
  520. $cInvoice->setCBpartner(null);
  521. }
  522. }
  523. return $this;
  524. }
  525. /**
  526. * @return Collection|MInout[]
  527. */
  528. public function getMInouts(): Collection
  529. {
  530. return $this->m_inouts;
  531. }
  532. public function addMInout(MInout $mInout): self
  533. {
  534. if (!$this->m_inouts->contains($mInout)) {
  535. $this->m_inouts[] = $mInout;
  536. $mInout->setCBpartner($this);
  537. }
  538. return $this;
  539. }
  540. public function removeMInout(MInout $mInout): self
  541. {
  542. if ($this->m_inouts->removeElement($mInout)) {
  543. // set the owning side to null (unless already changed)
  544. if ($mInout->getCBpartner() === $this) {
  545. $mInout->setCBpartner(null);
  546. }
  547. }
  548. return $this;
  549. }
  550. /**
  551. * @return Collection|SmSalesRep[]
  552. */
  553. public function getSmSalesReps(): Collection
  554. {
  555. return $this->sm_sales_reps;
  556. }
  557. public function getTotalopenbalance(): ?float
  558. {
  559. return $this->totalopenbalance;
  560. }
  561. public function setTotalopenbalance(float $totalopenbalance): self
  562. {
  563. $this->totalopenbalance = $totalopenbalance;
  564. return $this;
  565. }
  566. public function getFirstsale(): ?DateTime
  567. {
  568. return $this->firstsale;
  569. }
  570. public function setFirstsale(DateTime $firstsale): self
  571. {
  572. $this->firstsale = $firstsale;
  573. return $this;
  574. }
  575. public function getSoCreditlimit(): ?float
  576. {
  577. return $this->so_creditlimit;
  578. }
  579. public function setSoCreditlimit(float $so_creditlimit): self
  580. {
  581. $this->so_creditlimit = $so_creditlimit;
  582. return $this;
  583. }
  584. public function getDescription(): ?string
  585. {
  586. return $this->description;
  587. }
  588. public function setDescription(string $description): self
  589. {
  590. $this->description = $description;
  591. return $this;
  592. }
  593. public function getSocreditstatus(): ?string
  594. {
  595. return $this->socreditstatus;
  596. }
  597. public function setSocreditstatus(?string $socreditstatus): self
  598. {
  599. $this->socreditstatus = $socreditstatus;
  600. return $this;
  601. }
  602. public function getCreditStatus(): ?string
  603. {
  604. return $this->SoCreditStatus[
  605. $this->getSocreditstatus()
  606. ];
  607. }
  608. public function getIstaxexempt(): ?bool
  609. {
  610. return $this->istaxexempt == "Y";
  611. }
  612. public function setIstaxexempt(bool $istaxexempt): self
  613. {
  614. $this->istaxexempt = $istaxexempt ? "Y" : "N";
  615. return $this;
  616. }
  617. public function IsTaxExempt(): ?bool
  618. {
  619. return $this->getIstaxexempt();
  620. }
  621. public function getSmBpTypeId(): ?int
  622. {
  623. return $this->sm_bp_type_id;
  624. }
  625. public function setSmBpTypeId(?int $sm_bp_type_id): self
  626. {
  627. $this->sm_bp_type_id = $sm_bp_type_id;
  628. return $this;
  629. }
  630. public function getSmBpType(): ?SmBpType
  631. {
  632. return $this->sm_bp_type;
  633. }
  634. public function setSmBpType(?SmBpType $sm_bp_type): self
  635. {
  636. $this->sm_bp_type = $sm_bp_type;
  637. return $this;
  638. }
  639. public function getSmBpSegmentCmAreaId(): ?int
  640. {
  641. return $this->sm_bp_segment_cm_area_id;
  642. }
  643. public function setSmBpSegmentCmAreaId(?int $sm_bp_segment_cm_area_id): self
  644. {
  645. $this->sm_bp_segment_cm_area_id = $sm_bp_segment_cm_area_id;
  646. return $this;
  647. }
  648. public function getSmBpSegmentCmArea(): ?SmBpSegmentCmArea
  649. {
  650. return $this->sm_bp_segment_cm_area;
  651. }
  652. public function setSmBpSegmentCmArea(?SmBpSegmentCmArea $sm_bp_segment_cm_area): self
  653. {
  654. $this->sm_bp_segment_cm_area = $sm_bp_segment_cm_area;
  655. return $this;
  656. }
  657. public function getLcoTaxidtypeId(): ?int
  658. {
  659. return $this->lco_taxidtype_id;
  660. }
  661. public function setLcoTaxidtypeId(int $lco_taxidtype_id): self
  662. {
  663. $this->lco_taxidtype_id = $lco_taxidtype_id;
  664. return $this;
  665. }
  666. public function getLcoTaxidtype(): ?LcoTaxidtype
  667. {
  668. return $this->lco_taxidtype;
  669. }
  670. public function setLcoTaxidtype(?LcoTaxidtype $lco_taxidtype): self
  671. {
  672. $this->lco_taxidtype = $lco_taxidtype;
  673. return $this;
  674. }
  675. public function getCreated(): ?\DateTimeInterface
  676. {
  677. return $this->created;
  678. }
  679. public function setCreated(\DateTimeInterface $created): self
  680. {
  681. $this->created = $created;
  682. return $this;
  683. }
  684. public function getCreatedby(): ?int
  685. {
  686. return $this->createdby;
  687. }
  688. public function setCreatedby(int $createdby): self
  689. {
  690. $this->createdby = $createdby;
  691. return $this;
  692. }
  693. public function getUpdated(): ?\DateTimeInterface
  694. {
  695. return $this->updated;
  696. }
  697. public function setUpdated(\DateTimeInterface $updated): self
  698. {
  699. $this->updated = $updated;
  700. return $this;
  701. }
  702. public function getUpdatedby(): ?int
  703. {
  704. return $this->updatedby;
  705. }
  706. public function setUpdatedby(int $updatedby): self
  707. {
  708. $this->updatedby = $updatedby;
  709. return $this;
  710. }
  711. public function getIsprospect(): ?bool
  712. {
  713. return $this->isprospect === "Y";
  714. }
  715. public function setIsprospect(bool $isprospect): self
  716. {
  717. $this->isprospect = $isprospect ? "Y" : "N";
  718. return $this;
  719. }
  720. public function getIsonetime(): ?bool
  721. {
  722. return $this->isonetime === "Y";
  723. }
  724. public function setIsonetime(bool $isonetime): self
  725. {
  726. $this->isonetime = $isonetime ? "Y" : "N";
  727. return $this;
  728. }
  729. public function getIsvendor(): ?bool
  730. {
  731. return $this->isvendor === "Y";
  732. }
  733. public function setIsvendor(bool $isvendor): self
  734. {
  735. $this->isvendor = $isvendor ? "Y" : "N";
  736. return $this;
  737. }
  738. public function getIsemployee(): ?bool
  739. {
  740. return $this->isemployee === "Y";
  741. }
  742. public function setIsemployee(bool $isemployee): self
  743. {
  744. $this->isemployee = $isemployee ? "Y" : "N";
  745. return $this;
  746. }
  747. public function getSoCreditused(): ?float
  748. {
  749. return $this->so_creditused;
  750. }
  751. public function setSoCreditused(?float $so_creditused): self
  752. {
  753. $this->so_creditused = $so_creditused;
  754. return $this;
  755. }
  756. public function getInvoicerule(): ?string
  757. {
  758. return $this->invoicerule;
  759. }
  760. public function setInvoicerule(?string $invoicerule): self
  761. {
  762. $this->invoicerule = $invoicerule;
  763. return $this;
  764. }
  765. public function getDeliveryrule(): ?string
  766. {
  767. return $this->deliveryrule;
  768. }
  769. public function setDeliveryrule(?string $deliveryrule): self
  770. {
  771. $this->deliveryrule = $deliveryrule;
  772. return $this;
  773. }
  774. public function getFreightcostrule(): ?string
  775. {
  776. return $this->freightcostrule;
  777. }
  778. public function setFreightcostrule(?string $freightcostrule): self
  779. {
  780. $this->freightcostrule = $freightcostrule;
  781. return $this;
  782. }
  783. public function getDeliveryviarule(): ?string
  784. {
  785. return $this->deliveryviarule;
  786. }
  787. public function setDeliveryviarule(?string $deliveryviarule): self
  788. {
  789. $this->deliveryviarule = $deliveryviarule;
  790. return $this;
  791. }
  792. public function getSendemail(): ?string
  793. {
  794. return $this->sendemail;
  795. }
  796. public function setSendemail(string $sendemail): self
  797. {
  798. $this->sendemail = $sendemail;
  799. return $this;
  800. }
  801. public function getIspotaxexempt(): ?string
  802. {
  803. return $this->ispotaxexempt === "Y";
  804. }
  805. public function setIspotaxexempt(bool $ispotaxexempt): self
  806. {
  807. $this->ispotaxexempt = $ispotaxexempt ? "Y" : "N";
  808. return $this;
  809. }
  810. public function getIs1099vendor(): ?bool
  811. {
  812. return $this->is1099vendor == "Y";
  813. }
  814. public function setIs1099vendor(bool $is1099vendor): self
  815. {
  816. $this->is1099vendor = $is1099vendor ? "Y" : "N";
  817. return $this;
  818. }
  819. public function getIsusetaxiddigit(): ?bool
  820. {
  821. return $this->isusetaxiddigit === "Y";
  822. }
  823. public function setIsusetaxiddigit(bool $isusetaxiddigit): self
  824. {
  825. $this->isusetaxiddigit = $isusetaxiddigit ? "Y" : "N";
  826. return $this;
  827. }
  828. /**
  829. * @return Collection<int, CPayment>
  830. */
  831. public function getCPayments(): Collection
  832. {
  833. return $this->c_payments;
  834. }
  835. public function addCPayment(CPayment $cPayment): self
  836. {
  837. if (!$this->c_payments->contains($cPayment)) {
  838. $this->c_payments[] = $cPayment;
  839. $cPayment->setCBpartner($this);
  840. }
  841. return $this;
  842. }
  843. public function removeCPayment(CPayment $cPayment): self
  844. {
  845. if ($this->c_payments->removeElement($cPayment)) {
  846. // set the owning side to null (unless already changed)
  847. if ($cPayment->getCBpartner() === $this) {
  848. $cPayment->setCBpartner(null);
  849. }
  850. }
  851. return $this;
  852. }
  853. public function getCBpGroupId(): ?int
  854. {
  855. return $this->c_bp_group_id;
  856. }
  857. public function setCBpGroupId(?int $c_bp_group_id): self
  858. {
  859. $this->c_bp_group_id = $c_bp_group_id;
  860. return $this;
  861. }
  862. public function getBillLocationId(): int
  863. {
  864. $filtered = array_filter(
  865. $this->address->toArray(),
  866. fn($e) => $e->getIsbillto()
  867. );
  868. $adressList = array_map(
  869. fn($e) => [
  870. 'id' => $e->getId(),
  871. 'isbillto' => $e->getIsbillto()
  872. ],
  873. $filtered
  874. );
  875. $adressList = array_shift($adressList);
  876. return $adressList['id'];
  877. }
  878. }