'PAYMENT'])] #[Assert\Type(type: 'string')] #[Assert\NotNull] #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\PaymentTypeEnum', 'toArray'])] #[Groups(['billpayment', 'billpayment_list', 'account_balance_reimbursements_accessbilling', 'build_bills_billpayments'])] private $type= 'PAYMENT'; /** * @var ArrayCollection */ #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Core\Tagg', cascade: ['persist'], inversedBy: 'payments')] #[Assert\Valid] #[ORM\JoinTable(name: 'tag_billPayment', joinColumns: [], inverseJoinColumns: [])] #[ORM\JoinColumn(name: 'billPayment_id', referencedColumnName: 'id')] #[ORM\JoinColumn(name: 'tag_id', referencedColumnName: 'id')] #[Groups(['billpayment_tags', 'manage_tags', 'billpayment_list'])] private $tags; /** * Constructor */ public function __construct() { $this->billDebitBalances = new ArrayCollection(); $this->tags = new ArrayCollection(); } /** * Sets id. * * @param int $id * * @return $this */ public function setId($id) { $this->id = $id; return $this; } /** * Gets id. * * @return int */ public function getId() { return $this->id; } /** * Set receiptDate * * @param \DateTime $receiptDate * * @return BillPayment */ public function setReceiptDate($receiptDate) { $this->receiptDate = $receiptDate; return $this; } /** * Get receiptDate * * @return \DateTime */ public function getReceiptDate() { return $this->receiptDate ? $this->receiptDate->format('Y-m-d') : $this->receiptDate; } /** * Set effectiveReceiptDate * * @param \DateTime $effectiveReceiptDate * * @return BillPayment */ public function setEffectiveReceiptDate($effectiveReceiptDate) { $this->effectiveReceiptDate = $effectiveReceiptDate; return $this; } /** * Get effectiveReceiptDate * * @return \DateTime */ public function getEffectiveReceiptDate() { return $this->effectiveReceiptDate ? $this->effectiveReceiptDate->format('Y-m-d') : $this->effectiveReceiptDate; } /** * Set paymentChoice * * @param string $paymentChoice * * @return BillPayment */ public function setPaymentChoice($paymentChoice) { $this->paymentChoice = $paymentChoice; return $this; } /** * Get paymentChoice * * @return string */ public function getPaymentChoice() { return $this->paymentChoice; } /** * Set bank * * @param string $bank * * @return BillPayment */ public function setBank($bank) { $this->bank = $bank; return $this; } /** * Get bank * * @return string */ public function getBank() { return $this->bank; } /** * Set agency * * @param string $agency * * @return BillPayment */ public function setAgency($agency) { $this->agency = $agency; return $this; } /** * Get agency * * @return string */ public function getAgency() { return $this->agency; } /** * Set checkNumber * * @param string $checkNumber * * @return BillPayment */ public function setCheckNumber($checkNumber) { $this->checkNumber = $checkNumber; return $this; } /** * Get checkNumber * * @return string */ public function getCheckNumber() { return $this->checkNumber; } /** * Set reference * * @param string $reference * * @return BillPayment */ public function setReference($reference) { $this->reference = $reference; return $this; } /** * Get reference * * @return string */ public function getReference() { return $this->reference; } /** * Set amount * * @param float $amount * * @return BillPayment */ public function setAmount($amount) { $this->amount = floatval($amount); return $this; } /** * Get amount * * @return float */ public function getAmount() { return $this->amount; } /** * Set bill * * @param \AppBundle\Entity\Billing\BillAccounting $bill * * @return BillPayment */ public function setBill($bill = null) { $this->bill = $bill; return $this; } /** * Get bill * * @return \AppBundle\Entity\Billing\BillAccounting */ public function getBill() { return $this->bill; } /** * Gets isAcquired. * * @return boolean */ public function getIsAcquired() { $isAcquired = false; if($this->getAmount() && !is_null($this->getEffectiveReceiptDate())){ $isAcquired = true; } return $isAcquired; } /** * Set accessBilling * * @param \AppBundle\Entity\Billing\AccessBilling $accessBilling * * @return BillPayment */ public function setAccessBilling(\AppBundle\Entity\Billing\AccessBilling $accessBilling = null) { $this->accessBilling = $accessBilling; return $this; } /** * Get accessBilling * * @return \AppBundle\Entity\Billing\AccessBilling */ public function getAccessBilling() { return $this->accessBilling; } /** * Add billDebitBalance * * @param \AppBundle\Entity\Billing\BillDebitBalance $billDebitBalance * * @return BillPayment */ public function addBillDebitBalance(\AppBundle\Entity\Billing\BillDebitBalance $billDebitBalance) { $billDebitBalance->setBillPayment($this); $this->billDebitBalances[] = $billDebitBalance; return $this; } /** * Remove billDebitBalance * * @param \AppBundle\Entity\Billing\BillDebitBalance $billDebitBalance */ public function removeBillDebitBalance(\AppBundle\Entity\Billing\BillDebitBalance $billDebitBalance) { $this->billDebitBalances->removeElement($billDebitBalance); } /** * Get billDebitBalances * * @return \Doctrine\Common\Collections\Collection */ public function getBillDebitBalances() { return $this->billDebitBalances; } /** * Set type * * @param string $type * * @return BillPayment */ public function setType($type) { $this->type = $type; return $this; } /** * Get type * * @return string */ public function getType() { return $this->type; } /** * Add tag * * @param \AppBundle\Entity\Core\Tagg $tag * * @return BillPayment */ public function addTag(\AppBundle\Entity\Core\Tagg $tag) { $this->tags[] = $tag; return $this; } /** * Remove tag * * @param \AppBundle\Entity\Core\Tagg $tag */ public function removeTag(\AppBundle\Entity\Core\Tagg $tag) { $this->tags->removeElement($tag); } /** * Get tags * * @return \Doctrine\Common\Collections\Collection */ public function getTags() { return $this->tags; } /** * Set accessBillingAccountBalanceReimbursement * * @param \AppBundle\Entity\Billing\AccessBilling $accessBillingAccountBalanceReimbursement * * @return BillPayment */ public function setAccessBillingAccountBalanceReimbursement(\AppBundle\Entity\Billing\AccessBilling $accessBillingAccountBalanceReimbursement = null) { $this->accessBillingAccountBalanceReimbursement = $accessBillingAccountBalanceReimbursement; return $this; } /** * Get accessBillingAccountBalanceReimbursement * * @return \AppBundle\Entity\Billing\AccessBilling */ public function getAccessBillingAccountBalanceReimbursement() { return $this->accessBillingAccountBalanceReimbursement; } }