Update database and helper functionality in CodeIgniter

Revised database drivers, query builder, and file/inflector helpers for improved consistency and functionality. Updated copyrights, links, and standardized function names including deprecating `is_countable` in favor of `word_is_countable`. Added support for new SQL features and optimized query handling.
This commit is contained in:
2025-01-22 18:50:26 +01:00
parent a8dfcfae4c
commit 453a5a89a5
219 changed files with 2041 additions and 1324 deletions
@@ -8,144 +8,144 @@
class InvoiceOverview {
private $project;
private $year;
private $projectname;
private $customer;
private $totalToInvoicingExcl;
private $totalToInvoicingIncl;
private $totalInvoicedOtherYears;
private $totalInvoicedThisYear;
private $invoicesTotal;
private $needInvoice;
private $projectDetails;
private $projectnumber;
private $projectPayment;
private $invoicesToPay;
private $project;
private $year;
private $projectname;
private $customer;
private $totalToInvoicingExcl;
private $totalToInvoicingIncl;
private $totalInvoicedOtherYears;
private $totalInvoicedThisYear;
private $invoicesTotal;
private $needInvoice;
private $projectDetails;
private $projectnumber;
private $projectPayment;
private $invoicesToPay;
public function __construct( $project, $year )
{
$this->project = $project;
public function __construct( $project, $year )
{
$this->project = $project;
$this->year = $year;
$this->year = $year;
$this->handle();
}
$this->handle();
}
public function getProjectDetails()
{
return $this->projectDetails;
}
public function getProjectDetails()
{
return $this->projectDetails;
}
public function getNeedinvoice()
{
return $this->needInvoice;
}
public function getNeedinvoice()
{
return $this->needInvoice;
}
private function handle()
{
$this->setProjectnumber();
private function handle()
{
$this->setProjectnumber();
$this->setProjectname();
$this->setProjectname();
$this->setCustomer();
$this->setCustomer();
$this->setTotalToInvoicingExcl();
$this->setTotalToInvoicingExcl();
$this->setTotalToInvoicingIncl();
$this->setTotalToInvoicingIncl();
$this->setTotalInvoicedOtherYears();
$this->setTotalInvoicedOtherYears();
$this->setTotalInvoicedThisYear();
$this->setTotalInvoicedThisYear();
$this->setPaymentPerProject();
$this->setPaymentPerProject();
$this->setInvoicesTotal();
$this->setInvoicesTotal();
$this->setInvoicesToPay();
$this->setInvoicesToPay();
$this->setNeedInvoice();
$this->setNeedInvoice();
$this->setProjectDetails();
}
$this->setProjectDetails();
}
private function setProjectnumber()
{
$this->projectnumber = $this->project->projectnumber;
}
private function setProjectnumber()
{
$this->projectnumber = $this->project->projectnumber;
}
private function setProjectname()
{
$this->projectname = $this->project->projectname;
}
private function setProjectname()
{
$this->projectname = $this->project->projectname;
}
private function setCustomer()
{
$this->customer = $this->project->customer->name;
}
private function setCustomer()
{
$this->customer = $this->project->customer->name;
}
private function setTotalToInvoicingExcl()
{
$offer = $this->project->offer;
private function setTotalToInvoicingExcl()
{
$offer = $this->project->offer;
$this->totalToInvoicingExcl =
$offer->own_revenue + $offer->other_revenue + $offer->costs;
}
$this->totalToInvoicingExcl =
$offer->own_revenue + $offer->other_revenue + $offer->costs;
}
private function setTotalToInvoicingIncl()
{
$this->totalToInvoicingIncl =
$this->totalToInvoicingExcl * ( 1 + ( $this->project->vat->vatrate / 100 ) );
}
private function setTotalToInvoicingIncl()
{
$this->totalToInvoicingIncl =
$this->totalToInvoicingExcl * ( 1 + ( $this->project->vat->vatrate / 100 ) );
}
private function setTotalInvoicedOtherYears()
{
$this->totalInvoicedOtherYears =
Invoice::invoicePerYear( $this->project->id, $this->year, FALSE );
}
private function setTotalInvoicedOtherYears()
{
$this->totalInvoicedOtherYears =
Invoice::invoicePerYear( $this->project->id, $this->year, FALSE );
}
private function setTotalInvoicedThisYear()
{
$this->totalInvoicedThisYear =
Invoice::invoicePerYear( $this->project->id, $this->year, TRUE );
}
private function setTotalInvoicedThisYear()
{
$this->totalInvoicedThisYear =
Invoice::invoicePerYear( $this->project->id, $this->year, TRUE );
}
private function setPaymentPerProject()
{
$this->projectPayment = Payment::getPaymentPerProject( $this->project->id );
}
private function setPaymentPerProject()
{
$this->projectPayment = Payment::getPaymentPerProject( $this->project->id );
}
private function setInvoicesTotal()
{
$this->invoicesTotal =
$this->totalInvoicedOtherYears + $this->totalInvoicedThisYear;
}
private function setInvoicesTotal()
{
$this->invoicesTotal =
$this->totalInvoicedOtherYears + $this->totalInvoicedThisYear;
}
private function setInvoicesToPay()
{
$this->invoicesToPay = $this->invoicesTotal - $this->projectPayment;
}
private function setInvoicesToPay()
{
$this->invoicesToPay = $this->invoicesTotal - $this->projectPayment;
}
private function setNeedInvoice()
{
$this->needInvoice =
$this->totalToInvoicingIncl - $this->invoicesTotal;
}
private function setNeedInvoice()
{
$this->needInvoice =
$this->totalToInvoicingIncl - $this->invoicesTotal;
}
private function setProjectDetails()
{
$this->projectDetails = [
'projectnumber' => $this->projectnumber,
'projectname' => $this->projectname,
'customer' => $this->customer,
'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl, 0, ',', '.' ),
'totalToInvoicingIncl' => number_format( $this->totalToInvoicingIncl, 0, ',', '.' ),
'totalInvoicedOtherYears' => number_format( $this->totalInvoicedOtherYears, 0, ',', '.' ),
'totalInvoicedThisYear' => number_format( $this->totalInvoicedThisYear, 0, ',', '.' ),
'invoicesTotal' => number_format( $this->invoicesTotal, 0, ',', '.' ),
'projectPayment' => number_format( $this->projectPayment, 0, ',', '.' ),
'invoiceToPay' => number_format( $this->invoicesToPay, 0, ',', '.' ),
'needInvoice' => number_format( $this->needInvoice, 0, ',', '.' )
];
}
}
private function setProjectDetails()
{
$this->projectDetails = [
'projectnumber' => $this->projectnumber,
'projectname' => $this->projectname,
'customer' => $this->customer,
'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl ?? 0, 0, ',', '.' ),
'totalToInvoicingIncl' => number_format( $this->totalToInvoicingIncl ?? 0, 0, ',', '.' ),
'totalInvoicedOtherYears' => number_format( $this->totalInvoicedOtherYears ?? 0, 0, ',', '.' ),
'totalInvoicedThisYear' => number_format( $this->totalInvoicedThisYear ?? 0, 0, ',', '.' ),
'invoicesTotal' => number_format( $this->invoicesTotal ?? 0, 0, ',', '.' ),
'projectPayment' => number_format( $this->projectPayment ?? 0, 0, ',', '.' ),
'invoiceToPay' => number_format( $this->invoicesToPay ?? 0, 0, ',', '.' ),
'needInvoice' => number_format( $this->needInvoice ?? 0, 0, ',', '.' )
];
}
}