Added payment recording, minor CSS fixes, enabled Search

This commit is contained in:
Deon George
2021-07-02 14:35:43 +10:00
parent b89e8d18d5
commit 1bba21dcef
13 changed files with 362 additions and 12 deletions

View File

@@ -185,7 +185,7 @@ class Account extends Model implements IDs
public function getNameAttribute()
{
return $this->company ?: $this->user->SurFirstName;
return $this->company ?: ($this->user_id ? $this->user->SurFirstName : 'AID:'.$this->id);
}
public function getServicesCountHtmlAttribute()

View File

@@ -48,11 +48,13 @@ class Invoice extends Model implements IDs
// Array of items that can be updated with PushNew
protected $pushable = ['items'];
/*
protected $with = [
'account.country.currency',
'items.taxes',
'paymentitems'
];
*/
// Caching variables
private int $_paid = 0;

View File

@@ -32,7 +32,7 @@ class Payment extends Model implements IDs
protected $table = 'ab_payment';
protected $dates = ['date_payment'];
protected $dateFormat = 'U';
protected $with = ['account.country.currency','items'];
//protected $with = ['account.country.currency','items'];
// Array of items that can be updated with PushNew
protected $pushable = ['items'];

View File

@@ -4,8 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Traits\NextKey;
use App\Traits\PushNew;
use App\Traits\{NextKey,PushNew};
class PaymentItem extends Model
{
@@ -13,11 +12,14 @@ class PaymentItem extends Model
const RECORD_ID = 'payment_item';
public $incrementing = FALSE;
protected $dateFormat = 'U';
const CREATED_AT = 'date_orig';
const UPDATED_AT = 'date_last';
protected $table = 'ab_payment_item';
/* RELATIONS */
public function payment() {
return $this->belongsTo(Payment::class);
}