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