Debug 6 /reservation
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
class InvoiceOverview {
|
||||
|
||||
private $project;
|
||||
private $currentYear;
|
||||
private $year;
|
||||
private $projectname;
|
||||
private $customer;
|
||||
private $totalToInvoicingExcl;
|
||||
@@ -20,10 +20,12 @@ class InvoiceOverview {
|
||||
private $needInvoice;
|
||||
private $projectDetails;
|
||||
|
||||
public function __construct( $project )
|
||||
public function __construct( $project, $year )
|
||||
{
|
||||
$this->project = $project;
|
||||
|
||||
$this->year = $year;
|
||||
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
@@ -39,8 +41,6 @@ class InvoiceOverview {
|
||||
|
||||
private function handle()
|
||||
{
|
||||
$this->setCurrentyear();
|
||||
|
||||
$this->setProjectname();
|
||||
|
||||
$this->setCustomer();
|
||||
@@ -60,11 +60,6 @@ class InvoiceOverview {
|
||||
$this->setProjectDetails();
|
||||
}
|
||||
|
||||
private function setCurrentyear()
|
||||
{
|
||||
$this->currentYear = date( 'Y' );
|
||||
}
|
||||
|
||||
private function setProjectname()
|
||||
{
|
||||
$this->projectname = $this->project->projectname . '(' . $this->project->projectnumber . ')';
|
||||
@@ -92,13 +87,13 @@ class InvoiceOverview {
|
||||
private function setTotalInvoicedOtherYears()
|
||||
{
|
||||
$this->totalInvoicedOtherYears =
|
||||
Invoice::invoicePerYear( $this->project->id, $this->currentYear, FALSE );
|
||||
Invoice::invoicePerYear( $this->project->id, $this->year, FALSE );
|
||||
}
|
||||
|
||||
private function setTotalInvoicedThisYear()
|
||||
{
|
||||
$this->totalInvoicedThisYear =
|
||||
Invoice::invoicePerYear( $this->project->id, $this->currentYear, TRUE );
|
||||
Invoice::invoicePerYear( $this->project->id, $this->year, TRUE );
|
||||
}
|
||||
|
||||
private function setInvoicesTotal()
|
||||
|
||||
@@ -85,7 +85,10 @@ class MonthPayments {
|
||||
|
||||
private function setTotalProjectPayments()
|
||||
{
|
||||
$this->totalProjectPayments += $this->payment->paymentamount;
|
||||
$paymentYear = date( 'Y', strtotime( $this->payment->paymentdate ) );
|
||||
|
||||
if ( $paymentYear == $this->year )
|
||||
$this->totalProjectPayments += $this->payment->paymentamount;
|
||||
}
|
||||
|
||||
private function setProjectDetails()
|
||||
|
||||
Reference in New Issue
Block a user