Move email/ resources to mail/, added invoice generated email to admin, updated email template

This commit is contained in:
2024-08-03 10:06:25 +10:00
parent f8453ae391
commit 0469d64577
40 changed files with 439 additions and 213 deletions

View File

@@ -52,6 +52,22 @@ class InvoiceItem extends Model
127 => 'Rounding', // * SERVICE_ID is NULL, MODULE_ID is NULL, MODULE_REF is NULL
];
/* STATIC */
public static function boot()
{
parent::boot();
static::created(function($model) {
// If this items were a charge, we'll update the charge to processed
if (($model->module_id === 30) && $model->module_ref) {
$o = Charge::findOrfail($model->module_ref);
$o->processed = TRUE;
$o->save();
}
});
}
/* RELATIONS */
public function invoice()