Improvements for service_change and service_cancel
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 37s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
2024-08-16 08:20:58 +10:00
parent 5f66987a3e
commit 3b40e92c48
12 changed files with 186 additions and 327 deletions

View File

@@ -330,9 +330,8 @@ class ServiceController extends Controller
$start_at = Carbon::create(Arr::get($request->broadband,'start_at'));
// Get the invoiced items covering the start_at date
foreach ($o->invoiced_items->filter(function($item) use ($start_at) {
return ($item->start_at < $start_at) && ($item->stop_at > $start_at) && ($item->item_type === 0);
}) as $iio)
foreach ($o->invoiced_items
->filter(fn($item)=>($item->start_at < $start_at) && ($item->stop_at > $start_at) && ($item->item_type === 0)) as $iio)
{
// Reverse the original charge
$co = new Charge;
@@ -400,7 +399,7 @@ class ServiceController extends Controller
*/
public function service_change_charges_display(Request $request,Service $o)
{
return view('theme.backend.adminlte.a.charge.service_change')
return view('theme.backend.adminlte.service.change_charge')
->with('charges',$this->service_change_charges($request,$o));
}

View File

@@ -15,15 +15,15 @@ class CancelRequest extends Mailable
use Queueable, SerializesModels;
public Service $service;
public string $notes;
public ?string $notes;
/**
* Create a new message instance.
*
* @param Service $o
* @param string $notes
* @param string|NULL $notes
*/
public function __construct(Service $o,string $notes='')
public function __construct(Service $o,string $notes=NULL)
{
$this->service = $o;
$this->notes = $notes;
@@ -40,7 +40,9 @@ class CancelRequest extends Mailable
switch (get_class($this->service->type)) {
case Service\Broadband::class:
$subject = sprintf('Cancel BROADBAND: %s',$this->service->type->service_address);
$subject = sprintf('Cancel BROADBAND: %s (%s)',
$this->service->type->service_number,
$this->service->type->service_address);
break;
case Service\Phone::class:

View File

@@ -15,18 +15,18 @@ class ChangeRequest extends Mailable
use Queueable, SerializesModels;
public Service $service;
public string $notes;
public ?string $notes;
/**
* Create a new message instance.
*
* @param Service $o
* @param string $notes
* @param string|NULL $notes
*/
public function __construct(Service $o,string $notes='')
public function __construct(Service $o,string $notes=NULL)
{
$this->service = $o;
$this->notes = $notes ?? '';
$this->notes = $notes;
}
/**
@@ -40,7 +40,9 @@ class ChangeRequest extends Mailable
switch (get_class($this->service->type)) {
case Service\Broadband::class:
$subject = sprintf('Change BROADBAND: %s',$this->service->type->service_address);
$subject = sprintf('Change BROADBAND: %s (%s)',
$this->service->type->service_number,
$this->service->type->service_address);
break;
case Service\Phone::class:

View File

@@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Log;
use Leenooks\Traits\ScopeActive;
use App\Casts\CollectionOrNull;
use App\Traits\SiteID;
/**
* CLEANUP NOTES:
@@ -15,7 +16,7 @@ use App\Casts\CollectionOrNull;
*/
class Charge extends Model
{
use ScopeActive;
use ScopeActive,SiteID;
protected $casts = [
'attributes' => CollectionOrNull::class,