PHP deprecation fixes, assigning null arguments in methods
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 41s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
2025-05-22 18:37:04 +10:00
parent 251aefa947
commit b37045acca
11 changed files with 22 additions and 22 deletions

View File

@@ -44,7 +44,7 @@ class Account extends Model
* @param Collection|NULL $invoices
* @return Collection
*/
public static function InvoicesCredit(Collection $invoices=NULL): Collection
public static function InvoicesCredit(?Collection $invoices=NULL): Collection
{
return (new self)
->invoiceSummaryCredit($invoices,TRUE)
@@ -57,7 +57,7 @@ class Account extends Model
* @param Collection|NULL $invoices
* @return Collection
*/
public static function InvoicesDue(Collection $invoices=NULL): Collection
public static function InvoicesDue(?Collection $invoices=NULL): Collection
{
return (new self)
->invoiceSummaryDue($invoices,TRUE)
@@ -251,7 +251,7 @@ class Account extends Model
/* METHODS */
public function invoice_next(Carbon $date=NULL): Collection
public function invoice_next(?Carbon $date=NULL): Collection
{
$svs = $this
->services_active
@@ -307,7 +307,7 @@ class Account extends Model
* @param bool $all
* @return Builder
*/
public function invoiceSummary(Collection $invoices=NULL,bool $all=FALSE): Builder
public function invoiceSummary(?Collection $invoices=NULL,bool $all=FALSE): Builder
{
return (new Invoice)
->select([
@@ -355,19 +355,19 @@ class Account extends Model
->with(['account']);
}
public function invoiceSummaryDue(Collection $invoices=NULL,bool $all=FALSE): Builder
public function invoiceSummaryDue(?Collection $invoices=NULL,bool $all=FALSE): Builder
{
return $this->invoiceSummary($invoices,$all)
->havingRaw('ROUND(CAST(SUM(item_total)-COALESCE(invoices.discount_amt,0)-SUM(payments) AS NUMERIC),2) > 0');
}
public function invoiceSummaryCredit(Collection $invoices=NULL,bool $all=FALSE): Builder
public function invoiceSummaryCredit(?Collection $invoices=NULL,bool $all=FALSE): Builder
{
return $this->invoiceSummary($invoices,$all)
->havingRaw('ROUND(CAST(SUM(item_total)-COALESCE(invoices.discount_amt,0)-SUM(payments) AS NUMERIC),2) < 0');
}
public function invoiceSummaryPast(Collection $invoices=NULL,bool $all=FALSE): Builder
public function invoiceSummaryPast(?Collection $invoices=NULL,bool $all=FALSE): Builder
{
return $this->invoiceSummary($invoices,$all)
->join('payment_items',['payment_items.invoice_id'=>'invoices.id'])