<?php
namespace AdminBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
#[ORM\Table(name: 'driver_invoices')]
#[ORM\Entity(repositoryClass: \AdminBundle\Repository\DriverInvoicesRepository::class)]
class DriverInvoices extends BaseEntity
{
const PAYMENT_STATUS_PENDING = 0;
const PAYMENT_STATUS_PAID = 1;
const INVOICE_PENDING_APPROVAL = 0;
const INVOICE_APPROVED = 1;
public static $invoiceApproval = array(
self::INVOICE_PENDING_APPROVAL => 'Pending Approval',
self::INVOICE_APPROVED => 'Approved',
);
public static $paymentStatuses = array(
self::PAYMENT_STATUS_PENDING => 'Payment pending',
self::PAYMENT_STATUS_PAID => 'Paid',
);
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
protected $id;
/**
* @var integer
*/
#[ORM\Column(name: 'week', type: 'integer')]
protected $week;
/**
* @var double
*/
#[ORM\Column(name: 'total_job_value', type: 'decimal', scale: 2)]
protected $totalJobValue=0;
/**
* @var double
*/
#[ORM\Column(name: 'net_cash', type: 'decimal', scale: 2)]
protected $netCash=0;
/**
* @var double
*/
#[ORM\Column(name: 'net_card', type: 'decimal', scale: 2)]
protected $netCard=0;
/**
* @var double
*/
#[ORM\Column(name: 'driver_earnings', type: 'decimal', scale: 2)]
protected $driverEarnings=0;
/**
* @var double
*/
#[ORM\Column(name: 'office_total_commission', type: 'decimal', scale: 2)]
protected $officeTotalCommission=0;
/**
* @var double
*/
#[ORM\Column(name: 'total_pickup_dropoff_pass_fees', type: 'decimal', scale: 2)]
protected $totalPickupDropoffPassFees=0;
/**
* @var double
*/
#[ORM\Column(name: 'total_ccpayment_fees', type: 'decimal', scale: 2)]
protected $totalCCPaymentFees=0;
/**
* @var double
*/
#[ORM\Column(name: 'total_app_fees', type: 'decimal', scale: 2)]
protected $totalAppFees=0;
/**
* @var double
*/
#[ORM\Column(name: 'total_admin_fees', type: 'decimal', scale: 2)]
protected $totalAdminFees=0;
/**
* @var double
*/
#[ORM\Column(name: 'total_general_adjustment_amount', type: 'decimal', scale: 2)]
protected $totalGeneralAdjustmentAmount=0;
/**
* @var double
*/
#[ORM\Column(name: 'total_driver_adjustment_amount', type: 'decimal', scale: 2)]
protected $totalDriverAdjustmentAmount=0;
/**
* @var double
*/
#[ORM\Column(name: 'total_invoice_balance', type: 'decimal', scale: 2)]
protected $totalInvoiceBalance=0;
/**
* @var string
*/
#[ORM\Column(name: 'office_percentage_commission', type: 'string', length: 255)]
protected $officePercentageCommission=0;
/**
* @var string
*/
#[ORM\Column(name: 'job_tier0', type: 'decimal', scale: 2)]
protected $jobTier0=0;
/**
* @var string
*/
#[ORM\Column(name: 'job_tier1', type: 'decimal', scale: 2)]
protected $jobTier1=0;
/**
* @var string
*/
#[ORM\Column(name: 'job_tier2', type: 'decimal', scale: 2)]
protected $jobTier2=0;
/**
* @var string
*/
#[ORM\Column(name: 'job_tier3', type: 'decimal', scale: 2)]
protected $jobTier3=0;
/**
* @var string
*/
#[ORM\Column(name: 'job_special_tier', type: 'decimal', scale: 2)]
protected $jobSpecialTier=0;
/**
* @var string
*/
#[ORM\Column(name: 'job_instant_tier', type: 'decimal', scale: 2)]
protected $jobInstantTier=0;
/**
* @var string
*/
#[ORM\Column(name: 'office_commission_up_to500', type: 'decimal', scale: 2)]
protected $officeCommissionUpTo500=0;
/**
* @var string
*/
#[ORM\Column(name: 'office_commission_up_to1000', type: 'decimal', scale: 2)]
protected $officeCommissionUpTo1000=0;
/**
* @var string
*/
#[ORM\Column(name: 'office_commission_up_to1500', type: 'decimal', scale: 2)]
protected $officeCommissionUpTo1500=0;
/**
* @var string
*/
#[ORM\Column(name: 'office_commission_over1500', type: 'decimal', scale: 2)]
protected $officeCommissionOver1500=0;
/**
* @var string
*/
#[ORM\Column(name: 'special_office_commission', type: 'decimal', scale: 2)]
protected $specialOfficeCommission=0;
/**
* @var string
*/
#[ORM\Column(name: 'instant_office_commission', type: 'decimal', scale: 2)]
protected $instantOfficeCommission=0;
/**
* @var string
*/
#[ORM\Column(name: 'instant_office_commission_percentage', type: 'decimal', scale: 2)]
protected $instantOfficeCommissionPercentage=0;
/**
* @var string
*/
#[ORM\Column(name: 'special_commission_end_date', type: 'string', nullable: true)]
private $specialCommissionEndDate;
/**
* @var string
*/
#[ORM\Column(name: 'special_commission_start_date', type: 'string', nullable: true)]
private $specialCommissionStartDate;
/**
* @var integer
*/
#[ORM\Column(name: 'payment_status', type: 'integer')]
protected $status = self::PAYMENT_STATUS_PENDING;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'invoice_date', type: 'datetime')]
protected $invoiceDate;
/**
* @var string
*/
#[ORM\Column(name: 'pdf_file', type: 'string', length: 255, nullable: true)]
protected $pdfFile;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'pdf_gen_date', type: 'datetime', nullable: true)]
protected $pdfGenDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'sent_date', type: 'datetime', nullable: true)]
protected $sentDate;
/**
* @var boolean
*/
#[ORM\Column(name: 'ready_to_send', type: 'boolean', options: ['default' => false])]
protected $readyToSend = false;
/**
* @var boolean
*/
#[ORM\Column(name: 'regenerate_invoice', type: 'boolean')]
protected $regenerateInvoice = false;
/**
* @var integer
*/
#[ORM\Column(name: 'approval', type: 'integer')]
protected $approval = self::INVOICE_PENDING_APPROVAL;
/**
* @var string
*/
#[ORM\Column(name: 'notice', type: 'text', nullable: true)]
protected $notice;
/**
* @var boolean
*/
#[ORM\Column(name: 'driver_bonus_feature_active', type: 'boolean', options: ['default' => false], nullable: true)]
protected $driverBonusFeatureActive = false;
/**
* @var string
*/
#[ORM\Column(name: 'driver_bonus_value', type: 'decimal', scale: 2, nullable: true)]
protected $driverBonusValue=0;
/**
* @var string
*/
#[ORM\Column(name: 'driver_bonus_threshold', type: 'decimal', scale: 2)]
protected $driverBonusThreshold=0;
/**
* @var string
*/
#[ORM\Column(name: 'driver_queue_bonus', type: 'decimal', scale: 2, nullable: true)]
protected $driverQueueBonus=0;
/**
* @var string
*/
#[ORM\Column(name: 'driver_bonus_period', type: 'string', length: 255, nullable: true)]
protected $driverBonusPeriod;
/**
* @var string
*/
#[ORM\Column(name: 'total_driver_tip', type: 'decimal', scale: 2, nullable: true)]
protected $totalDriverTip = 0;
/**
* @var string
*/
#[ORM\Column(name: 'driver_referral_bonus', type: 'decimal', scale: 2, nullable: true)]
protected $driverReferralBonus = 0;
/**
* @var ArrayCollection
*/
#[ORM\OneToMany(targetEntity: \AdminBundle\Entity\DriverInvoiceItems::class, mappedBy: 'invoice')]
#[ORM\OrderBy(['booking_pickup_date_time' => 'ASC'])]
public $invoiceItems;
/**
* @var Driver
*/
#[ORM\JoinColumn(name: 'driver_id', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: \AdminBundle\Entity\Driver::class, inversedBy: 'invoices')]
private $driver;
/**
* Constructor
*/
public function __construct()
{
$this->invoiceItems = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set week
*
* @param integer $week
*
* @return DriverInvoices
*/
public function setWeek($week)
{
$this->week = $week;
return $this;
}
/**
* Get week
*
* @return integer
*/
public function getWeek()
{
return $this->week;
}
/**
* Set totalJobValue
*
* @param string $totalJobValue
*
* @return DriverInvoices
*/
public function setTotalJobValue($totalJobValue)
{
$this->totalJobValue = $totalJobValue;
return $this;
}
/**
* Get totalJobValue
*
* @return string
*/
public function getTotalJobValue()
{
return $this->totalJobValue;
}
/**
* Set netCash
*
* @param string $netCash
*
* @return DriverInvoices
*/
public function setNetCash($netCash)
{
$this->netCash = $netCash;
return $this;
}
/**
* Get netCash
*
* @return string
*/
public function getNetCash()
{
return $this->netCash;
}
/**
* Set netCard
*
* @param string $netCard
*
* @return DriverInvoices
*/
public function setNetCard($netCard)
{
$this->netCard = $netCard;
return $this;
}
/**
* Get netCard
*
* @return string
*/
public function getNetCard()
{
return $this->netCard;
}
/**
* Set driverEarnings
*
* @param string $driverEarnings
*
* @return DriverInvoices
*/
public function setDriverEarnings($driverEarnings)
{
$this->driverEarnings = $driverEarnings;
return $this;
}
/**
* Get driverEarnings
*
* @return string
*/
public function getDriverEarnings()
{
return $this->driverEarnings;
}
/**
* Set officeTotalCommission
*
* @param string $officeTotalCommission
*
* @return DriverInvoices
*/
public function setOfficeTotalCommission($officeTotalCommission)
{
$this->officeTotalCommission = $officeTotalCommission;
return $this;
}
/**
* Get officeTotalCommission
*
* @return string
*/
public function getOfficeTotalCommission()
{
return $this->officeTotalCommission;
}
/**
* Set totalPickupDropoffPassFees
*
* @param string $totalPickupDropoffPassFees
*
* @return DriverInvoices
*/
public function setTotalPickupDropoffPassFees($totalPickupDropoffPassFees)
{
$this->totalPickupDropoffPassFees = $totalPickupDropoffPassFees;
return $this;
}
/**
* Get totalPickupDropoffPassFees
*
* @return string
*/
public function getTotalPickupDropoffPassFees()
{
return $this->totalPickupDropoffPassFees;
}
/**
* Set totalCCPaymentFees
*
* @param string $totalCCPaymentFees
*
* @return DriverInvoices
*/
public function setTotalCCPaymentFees($totalCCPaymentFees)
{
$this->totalCCPaymentFees = $totalCCPaymentFees;
return $this;
}
/**
* Get totalCCPaymentFees
*
* @return string
*/
public function getTotalCCPaymentFees()
{
return $this->totalCCPaymentFees;
}
/**
* Set totalAppFees
*
* @param string $totalAppFees
*
* @return DriverInvoices
*/
public function setTotalAppFees($totalAppFees)
{
$this->totalAppFees = $totalAppFees;
return $this;
}
/**
* Get totalAppFees
*
* @return string
*/
public function getTotalAppFees()
{
return $this->totalAppFees;
}
/**
* Set totalAdminFees
*
* @param string $totalAdminFees
*
* @return DriverInvoices
*/
public function setTotalAdminFees($totalAdminFees)
{
$this->totalAdminFees = $totalAdminFees;
return $this;
}
/**
* Get totalAdminFees
*
* @return string
*/
public function getTotalAdminFees()
{
return $this->totalAdminFees;
}
/**
* Set totalInvoiceBalance
*
* @param string $totalInvoiceBalance
*
* @return DriverInvoices
*/
public function setTotalInvoiceBalance($totalInvoiceBalance)
{
$this->totalInvoiceBalance = $totalInvoiceBalance;
return $this;
}
/**
* Get totalInvoiceBalance
*
* @return string
*/
public function getTotalInvoiceBalance()
{
return $this->totalInvoiceBalance;
}
/**
* Set officePercentageCommission
*
* @param string $officePercentageCommission
*
* @return DriverInvoices
*/
public function setOfficePercentageCommission($officePercentageCommission)
{
$this->officePercentageCommission = $officePercentageCommission;
return $this;
}
/**
* Get officePercentageCommission
*
* @return string
*/
public function getOfficePercentageCommission()
{
return $this->officePercentageCommission;
}
/**
* Set status
*
* @param integer $status
*
* @return DriverInvoices
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
/**
* Get status
*
* @return integer
*/
public function getStatus()
{
return $this->status;
}
public function getStringStatus($status)
{
return self::$paymentStatuses[$status];
}
/**
* Set invoiceDate
*
* @param \DateTime $invoiceDate
*
* @return DriverInvoices
*/
public function setInvoiceDate($invoiceDate)
{
$this->invoiceDate = $invoiceDate;
return $this;
}
/**
* Get invoiceDate
*
* @return \DateTime
*/
public function getInvoiceDate()
{
return $this->invoiceDate;
}
/**
* Set pdfFile
*
* @param string $pdfFile
*
* @return DriverInvoices
*/
public function setPdfFile($pdfFile)
{
$this->pdfFile = $pdfFile;
return $this;
}
/**
* Get pdfFile
*
* @return string
*/
public function getPdfFile()
{
return $this->pdfFile;
}
/**
* Set pdfGenDate
*
* @param \DateTime $pdfGenDate
*
* @return DriverInvoices
*/
public function setPdfGenDate($pdfGenDate)
{
$this->pdfGenDate = $pdfGenDate;
return $this;
}
/**
* Get pdfGenDate
*
* @return \DateTime
*/
public function getPdfGenDate()
{
return $this->pdfGenDate;
}
/**
* Set sentDate
*
* @param \DateTime $sentDate
*
* @return DriverInvoices
*/
public function setSentDate($sentDate)
{
$this->sentDate = $sentDate;
return $this;
}
/**
* Get sentDate
*
* @return \DateTime
*/
public function getSentDate()
{
return $this->sentDate;
}
/**
* Set readyToSend
*
* @param boolean $readyToSend
*
* @return DriverInvoices
*/
public function setReadyToSend($readyToSend)
{
$this->readyToSend = $readyToSend;
return $this;
}
/**
* Get readyToSend
*
* @return boolean
*/
public function getReadyToSend()
{
return $this->readyToSend;
}
/**
* Set approval
*
* @param integer $approval
*
* @return DriverInvoices
*/
public function setApproval($approval)
{
$this->approval = $approval;
return $this;
}
/**
* Get approval
*
* @return integer
*/
public function getApproval()
{
return $this->approval;
}
public function getStringApproval($approval)
{
return self::$invoiceApproval[$approval];
}
/**
* Add invoiceItem
*
* @param \AdminBundle\Entity\DriverInvoiceItems $invoiceItem
*
* @return DriverInvoices
*/
public function addInvoiceItem(\AdminBundle\Entity\DriverInvoiceItems $invoiceItem)
{
$this->invoiceItems[] = $invoiceItem;
return $this;
}
/**
* Remove invoiceItem
*
* @param \AdminBundle\Entity\DriverInvoiceItems $invoiceItem
*/
public function removeInvoiceItem(\AdminBundle\Entity\DriverInvoiceItems $invoiceItem)
{
$this->invoiceItems->removeElement($invoiceItem);
}
/**
* Get invoiceItems
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getInvoiceItems()
{
return $this->invoiceItems;
}
/**
* Set driver
*
* @param \AdminBundle\Entity\Driver $driver
*
* @return DriverInvoices
*/
public function setDriver(\AdminBundle\Entity\Driver $driver = null)
{
$this->driver = $driver;
return $this;
}
/**
* Get driver
*
* @return \AdminBundle\Entity\Driver
*/
public function getDriver()
{
return $this->driver;
}
/**
* @return float
*/
public function getTotalGeneralAdjustmentAmount()
{
return $this->totalGeneralAdjustmentAmount;
}
/**
* @param float $totalGeneralAdjustmentAmount
*/
public function setTotalGeneralAdjustmentAmount($totalGeneralAdjustmentAmount)
{
$this->totalGeneralAdjustmentAmount = $totalGeneralAdjustmentAmount;
}
/**
* @return float
*/
public function getTotalDriverAdjustmentAmount()
{
return $this->totalDriverAdjustmentAmount;
}
/**
* @param float $totalDriverAdjustmentAmount
*/
public function setTotalDriverAdjustmentAmount($totalDriverAdjustmentAmount)
{
$this->totalDriverAdjustmentAmount = $totalDriverAdjustmentAmount;
}
/**
* @return bool
*/
public function getRegenerateInvoice()
{
return $this->regenerateInvoice;
}
/**
* @param bool $regenerateInvoice
*/
public function setRegenerateInvoice($regenerateInvoice)
{
$this->regenerateInvoice = $regenerateInvoice;
}
/**
* @return string
*/
public function getNotice()
{
return !empty($this->notice)?unserialize($this->notice):null;
}
/**
* @param string $notice
*/
public function setNotice($notice)
{
$this->notice = $notice;
}
/**
* @return string
*/
public function getOfficeCommissionUpTo1000()
{
return $this->officeCommissionUpTo1000;
}
/**
* @param string $officeCommissionUpTo1000
*/
public function setOfficeCommissionUpTo1000($officeCommissionUpTo1000)
{
$this->officeCommissionUpTo1000 = $officeCommissionUpTo1000;
}
/**
* @return string
*/
public function getOfficeCommissionUpTo1500()
{
return $this->officeCommissionUpTo1500;
}
/**
* @param string $officeCommissionUpTo1500
*/
public function setOfficeCommissionUpTo1500($officeCommissionUpTo1500)
{
$this->officeCommissionUpTo1500 = $officeCommissionUpTo1500;
}
/**
* @return string
*/
public function getOfficeCommissionOver1500()
{
return $this->officeCommissionOver1500;
}
/**
* @param string $officeCommissionOver1500
*/
public function setOfficeCommissionOver1500($officeCommissionOver1500)
{
$this->officeCommissionOver1500 = $officeCommissionOver1500;
}
/**
* @return string
*/
public function getSpecialOfficeCommission()
{
return $this->specialOfficeCommission;
}
/**
* @param string $specialOfficeCommission
*/
public function setSpecialOfficeCommission($specialOfficeCommission)
{
$this->specialOfficeCommission = $specialOfficeCommission;
}
/**
* @return string
*/
public function getSpecialCommissionEndDate()
{
return $this->specialCommissionEndDate;
}
/**
* @param string $specialCommissionEndDate
*/
public function setSpecialCommissionEndDate($specialCommissionEndDate)
{
$this->specialCommissionEndDate = $specialCommissionEndDate;
}
/**
* @return string
*/
public function getSpecialCommissionStartDate()
{
return $this->specialCommissionStartDate;
}
/**
* @param string $specialCommissionStartDate
*/
public function setSpecialCommissionStartDate($specialCommissionStartDate)
{
$this->specialCommissionStartDate = $specialCommissionStartDate;
}
/**
* @return string
*/
public function getJobTier1()
{
return $this->jobTier1;
}
/**
* @param string $jobTier1
*/
public function setJobTier1($jobTier1)
{
$this->jobTier1 = $jobTier1;
}
/**
* @return string
*/
public function getJobTier2()
{
return $this->jobTier2;
}
/**
* @param string $jobTier2
*/
public function setJobTier2($jobTier2)
{
$this->jobTier2 = $jobTier2;
}
/**
* @return string
*/
public function getJobTier3()
{
return $this->jobTier3;
}
/**
* @param string $jobTier3
*/
public function setJobTier3($jobTier3)
{
$this->jobTier3 = $jobTier3;
}
/**
* @return string
*/
public function getJobSpecialTier()
{
return $this->jobSpecialTier;
}
/**
* @param string $jobSpecialTier
*/
public function setJobSpecialTier($jobSpecialTier)
{
$this->jobSpecialTier = $jobSpecialTier;
}
/**
* @return bool
*/
public function isDriverBonusFeatureActive()
{
return $this->driverBonusFeatureActive;
}
/**
* @param bool $driverBonusFeatureActive
*/
public function setDriverBonusFeatureActive($driverBonusFeatureActive)
{
$this->driverBonusFeatureActive = $driverBonusFeatureActive;
}
/**
* @return string
*/
public function getDriverBonusValue()
{
return $this->driverBonusValue;
}
/**
* @param string $driverBonusValue
*/
public function setDriverBonusValue($driverBonusValue)
{
$this->driverBonusValue = $driverBonusValue;
}
/**
* @return mixed
*/
public function getDriverBonusThreshold()
{
return $this->driverBonusThreshold;
}
/**
* @param mixed $driverBonusThreshold
*/
public function setDriverBonusThreshold($driverBonusThreshold)
{
$this->driverBonusThreshold = $driverBonusThreshold;
}
/**
* @return string
*/
public function getDriverBonusPeriod()
{
return $this->driverBonusPeriod;
}
/**
* @param string $driverBonusPeriod
*/
public function setDriverBonusPeriod($driverBonusPeriod)
{
$this->driverBonusPeriod = $driverBonusPeriod;
}
/**
* @return string
*/
public function getDriverQueueBonus()
{
return $this->driverQueueBonus;
}
/**
* @param string $driverQueueBonus
*/
public function setDriverQueueBonus($driverQueueBonus)
{
$this->driverQueueBonus = $driverQueueBonus;
}
/**
* @return string
*/
public function getJobInstantTier()
{
return $this->jobInstantTier;
}
/**
* @param string $jobInstantTier
*/
public function setJobInstantTier($jobInstantTier)
{
$this->jobInstantTier = $jobInstantTier;
}
/**
* @return string
*/
public function getInstantOfficeCommission()
{
return $this->instantOfficeCommission;
}
/**
* @param string $instantOfficeCommission
*/
public function setInstantOfficeCommission($instantOfficeCommission)
{
$this->instantOfficeCommission = $instantOfficeCommission;
}
/**
* @return string
*/
public function getInstantOfficeCommissionPercentage()
{
return $this->instantOfficeCommissionPercentage;
}
/**
* @param string $instantOfficeCommissionPercentage
*/
public function setInstantOfficeCommissionPercentage($instantOfficeCommissionPercentage)
{
$this->instantOfficeCommissionPercentage = $instantOfficeCommissionPercentage;
}
/**
* @return string
*/
public function getTotalDriverTip()
{
return $this->totalDriverTip;
}
/**
* @param string $totalDriverTip
*/
public function setTotalDriverTip($totalDriverTip)
{
$this->totalDriverTip = $totalDriverTip;
}
/**
* @return string
*/
public function getJobTier0()
{
return $this->jobTier0;
}
/**
* @param string $jobTier0
*/
public function setJobTier0($jobTier0)
{
$this->jobTier0 = $jobTier0;
}
/**
* @return string
*/
public function getOfficeCommissionUpTo500()
{
return $this->officeCommissionUpTo500;
}
/**
* @param string $officeCommissionUpTo500
*/
public function setOfficeCommissionUpTo500($officeCommissionUpTo500)
{
$this->officeCommissionUpTo500 = $officeCommissionUpTo500;
}
/**
* @return string
*/
public function getDriverReferralBonus()
{
return $this->driverReferralBonus;
}
/**
* @param string $driverReferralBonus
*/
public function setDriverReferralBonus($driverReferralBonus)
{
$this->driverReferralBonus = $driverReferralBonus;
}
}