<?php
/**
* Created by PhpStorm.
* User: parcel
* Date: 10/16/18
* Time: 3:36 PM
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\TransactionRepository")
* @ORM\Table(name="transaction", uniqueConstraints={
* @ORM\UniqueConstraint(name="way_bill_id", columns={"way_bill_id"})})
*/
class Transaction
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var WayBill
* @ORM\OneToOne(targetEntity="App\Entity\WayBill", inversedBy="transaction")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="way_bill_id", referencedColumnName="id")
* })
*/
private $wayBill;
/**
* @Assert\NotNull(message="Please enter an amount")
* @Assert\GreaterThanOrEqual (value="99", message="Please check the value ie it should not be less than 100")
* @Assert\LessThan(value="100000", message="Please check the value ie it should not be more than 20,000")
* @ORM\Column(type="float")
*/
private $amount;
/** @ORM\Column(type="float", options={"default": 0}) */
private $cashAmount;
/** @ORM\Column(type="float", options={"default": 0}) */
private $mpesaAmount;
/**
* @ORM\Column(type="float")
*/
private $taxPercentage;
/**
* @ORM\Column(type="float")
*/
private $taxAmount;
/**
* @ORM\Column(type="float")
*/
private $grossAmount;
/**
* @ORM\Column(type="float")
*/
private $stationExpenses;
/**
* @ORM\Column(type="float")
*/
private $stationBalance;
/**
* @ORM\Column(type="float")
*/
private $expenses;
/**
* @Serializer\Type("ArrayCollection<App\Entity\TransactionExpense>")
* @ORM\OneToMany(targetEntity="TransactionExpense", mappedBy="transaction", cascade={"persist", "remove"})
*/
private $wayBillExpenses;
/**
* @ORM\Column(type="float")
*/
private $balance;
/**
* @Serializer\Type("DateTime<'d/m/Y'>")
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @var User
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="created_by", referencedColumnName="id")
* })
*/
private $createdBy;
/**
* @var Organization
* @ORM\ManyToOne(targetEntity="App\Entity\Organization")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="organization_id", referencedColumnName="id")
* })
*/
private $organization;
/**
* @var \App\Entity\DailyAccount
* @Serializer\Type("App\Entity\DailyAccount")
* @ORM\ManyToOne(targetEntity="App\Entity\DailyAccount")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="daily_account_id", referencedColumnName="id")
* })
*/
private $dailyAccount;
/**
* @ORM\Column(type="boolean")
*/
private $isCancelled;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $isComplete;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $isPaid;
/** @ORM\Column(type="string", nullable=true) */
private $paid_by;
/** @ORM\Column(type="string", nullable=true) */
private $mpesaPaymentPhone;
/** @ORM\Column(type="string", name="payment_method") */
private $paymentMethod;
/**
* @Assert\Length(max=11, maxMessage="KRA Pin should be 11 Characters", min="11", minMessage="KRA Pin should be 11 Characters" )
* @ORM\Column(type="string", nullable=true)
*/
private $pinNumber;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $cuInvoiceNumber;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $cuInvoiceNumberCredit;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $cuSerialNumber;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $isFinal;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return WayBill
*/
public function getWayBill()
{
return $this->wayBill;
}
/**
* @param WayBill $wayBill
*/
public function setWayBill($wayBill)
{
$this->wayBill = $wayBill;
}
/**
* @return mixed
*/
public function getAmount()
{
return $this->amount;
}
/**
* @param mixed $amount
*/
public function setAmount($amount)
{
$this->amount = $amount;
}
/**
* @return mixed
*/
public function getTaxPercentage()
{
return $this->taxPercentage;
}
/**
* @param mixed $taxPercentage
*/
public function setTaxPercentage($taxPercentage)
{
$this->taxPercentage = $taxPercentage;
}
/**
* @return mixed
*/
public function getTaxAmount()
{
return $this->taxAmount;
}
/**
* @param mixed $taxAmount
*/
public function setTaxAmount($taxAmount)
{
$this->taxAmount = $taxAmount;
}
/**
* @return mixed
*/
public function getGrossAmount()
{
return $this->grossAmount;
}
/**
* @param mixed $grossAmount
*/
public function setGrossAmount($grossAmount)
{
$this->grossAmount = $grossAmount;
}
/**
* @return mixed
*/
public function getStationExpenses()
{
return $this->stationExpenses;
}
/**
* @param mixed $stationExpenses
*/
public function setStationExpenses($stationExpenses)
{
$this->stationExpenses = $stationExpenses;
}
/**
* @return mixed
*/
public function getStationBalance()
{
return $this->stationBalance;
}
/**
* @param mixed $stationBalance
*/
public function setStationBalance($stationBalance)
{
$this->stationBalance = $stationBalance;
}
/**
* @return mixed
*/
public function getExpenses()
{
return $this->expenses;
}
/**
* @param mixed $expenses
*/
public function setExpenses($expenses)
{
$this->expenses = $expenses;
}
/**
* @return mixed
*/
public function getWayBillExpenses()
{
return $this->wayBillExpenses;
}
/**
* @param mixed $wayBillExpenses
*/
public function setWayBillExpenses($wayBillExpenses)
{
$this->wayBillExpenses = $wayBillExpenses;
}
/**
* @return mixed
*/
public function getBalance()
{
return $this->balance;
}
/**
* @param mixed $balance
*/
public function setBalance($balance)
{
$this->balance = $balance;
}
/**
* @return mixed
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @param mixed $createdAt
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
}
/**
* @return User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* @param User $createdBy
*/
public function setCreatedBy($createdBy)
{
$this->createdBy = $createdBy;
}
/**
* @return Organization
*/
public function getOrganization()
{
return $this->organization;
}
/**
* @param Organization $organization
*/
public function setOrganization($organization)
{
$this->organization = $organization;
}
/**
* @return DailyAccount
*/
public function getDailyAccount()
{
return $this->dailyAccount;
}
/**
* @param DailyAccount $dailyAccount
*/
public function setDailyAccount($dailyAccount)
{
$this->dailyAccount = $dailyAccount;
}
/**
* @return mixed
*/
public function getisCancelled()
{
return $this->isCancelled;
}
/**
* @param mixed $isCancelled
*/
public function setIsCancelled($isCancelled)
{
$this->isCancelled = $isCancelled;
}
/**
* @return mixed
*/
public function getIsComplete()
{
return $this->isComplete;
}
/**
* @param mixed $isComplete
*/
public function setIsComplete($isComplete)
{
$this->isComplete = $isComplete;
}
/**
* @return mixed
*/
public function getPaidBy()
{
return $this->paid_by;
}
/**
* @param mixed $paid_by
*/
public function setPaidBy($paid_by): void
{
$this->paid_by = $paid_by;
}
/**
* @return mixed
*/
public function getIsPaid()
{
return $this->isPaid;
}
/**
* @param mixed $isPaid
*/
public function setIsPaid($isPaid)
{
$this->isPaid = $isPaid;
}
/**
* @return mixed
*/
public function getPaymentMethod()
{
return $this->paymentMethod;
}
/**
* @param mixed $paymentMethod
*/
public function setPaymentMethod($paymentMethod): void
{
$this->paymentMethod = $paymentMethod;
}
/**
* @return mixed
*/
public function getMpesaPaymentPhone()
{
return $this->mpesaPaymentPhone;
}
/**
* @param mixed $mpesaPaymentPhone
*/
public function setMpesaPaymentPhone($mpesaPaymentPhone): void
{
$this->mpesaPaymentPhone = $mpesaPaymentPhone;
}
/**
* @return mixed
*/
public function getCashAmount()
{
return $this->cashAmount;
}
/**
* @param mixed $cashAmount
*/
public function setCashAmount($cashAmount): void
{
$this->cashAmount = $cashAmount;
}
/**
* @return mixed
*/
public function getMpesaAmount()
{
return $this->mpesaAmount;
}
/**
* @param mixed $mpesaAmount
*/
public function setMpesaAmount($mpesaAmount): void
{
$this->mpesaAmount = $mpesaAmount;
}
/**
* @return mixed
*/
public function getPinNumber()
{
return $this->pinNumber;
}
/**
* @param mixed $pinNumber
*/
public function setPinNumber($pinNumber): void
{
$this->pinNumber = $pinNumber;
}
/**
* @return mixed
*/
public function getCuInvoiceNumber()
{
return $this->cuInvoiceNumber;
}
/**
* @param mixed $cuInvoiceNumber
*/
public function setCuInvoiceNumber($cuInvoiceNumber): void
{
$this->cuInvoiceNumber = $cuInvoiceNumber;
}
/**
* @return mixed
*/
public function getCuSerialNumber()
{
return $this->cuSerialNumber;
}/**
* @param mixed $cuSerialNumber
*/
public function setCuSerialNumber($cuSerialNumber): void
{
$this->cuSerialNumber = $cuSerialNumber;
}
/**
* @return mixed
*/
public function getIsFinal()
{
return $this->isFinal;
}
/**
* @param mixed $isFinal
*/
public function setIsFinal($isFinal): void
{
$this->isFinal = $isFinal;
}
/**
* @return mixed
*/
public function getCuInvoiceNumberCredit()
{
return $this->cuInvoiceNumberCredit;
}
/**
* @param mixed $cuInvoiceNumberCredit
*/
public function setCuInvoiceNumberCredit($cuInvoiceNumberCredit): void
{
$this->cuInvoiceNumberCredit = $cuInvoiceNumberCredit;
}
}