Updates to charges table

This commit is contained in:
Deon George
2022-06-11 17:39:25 +10:00
parent b9ec64fd4f
commit b8f85960aa
3 changed files with 451 additions and 4 deletions

View File

@@ -5,6 +5,8 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
use App\Traits\SiteID;
/**
* CLEANUP NOTES:
* + Charge Date should not be null
@@ -13,11 +15,15 @@ use Illuminate\Support\Arr;
*/
class Charge extends Model
{
const CREATED_AT = 'date_orig';
const UPDATED_AT = 'date_last';
use SiteID;
protected $dates = ['charge_date'];
public $dateFormat = 'U';
protected $casts = [
'attributes' => 'json',
];
protected $dates = [
'charged_at',
];
public const sweep = [
// 0 => 'Daily',
@@ -36,6 +42,11 @@ class Charge extends Model
return $this->belongsTo(Account::class);
}
public function product()
{
return $this->belongsTo(Product::class);
}
public function service()
{
return $this->belongsTo(Service::class);

View File

@@ -38,6 +38,7 @@ class InvoiceItem extends Model
6 => 'Service Cancellation', // * Must have corresponding SERVICE_ID
7 => 'Extra Product/Service Charge', // * Service Billing in advance, Must have corresponding SERVICE_ID
8 => 'Product Addition', // * Additional Product Customisation, Must have corresponding SERVICE_ID
9 => 'Usage Charge',
120 => 'Credit/Debit Transfer', // * SERVICE_ID is NULL, MODULE_ID is NULL, MODULE_REF is NULL : INVOICE_ID is NOT NULL
123 => 'Shipping',
124 => 'Late Payment Fee', // * SERVICE_ID is NULL, MODULE_ID = CHECKOUT MODULE,