diff --git a/app/Http/Controllers/ServiceController.php b/app/Http/Controllers/ServiceController.php index 384e1d0..80c7691 100644 --- a/app/Http/Controllers/ServiceController.php +++ b/app/Http/Controllers/ServiceController.php @@ -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)); } diff --git a/app/Mail/CancelRequest.php b/app/Mail/CancelRequest.php index 125ff6d..46daea8 100644 --- a/app/Mail/CancelRequest.php +++ b/app/Mail/CancelRequest.php @@ -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: diff --git a/app/Mail/ChangeRequest.php b/app/Mail/ChangeRequest.php index dca3113..44f5bd1 100644 --- a/app/Mail/ChangeRequest.php +++ b/app/Mail/ChangeRequest.php @@ -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: diff --git a/app/Models/Charge.php b/app/Models/Charge.php index ca70721..2f48ac8 100644 --- a/app/Models/Charge.php +++ b/app/Models/Charge.php @@ -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, diff --git a/resources/views/theme/backend/adminlte/a/charge/service_change.blade.php b/resources/views/theme/backend/adminlte/a/charge/service_change.blade.php deleted file mode 100644 index 9dab783..0000000 --- a/resources/views/theme/backend/adminlte/a/charge/service_change.blade.php +++ /dev/null @@ -1,33 +0,0 @@ -
Service Charge | -Quantity | -Rate | -Amount | -
---|---|---|---|
{{ $co->type_name }} | -{{ number_format($co->quantity,2) }} | -${{ number_format($co->amount,2) }} | -${{ number_format($co->amount*$co->quantity,2) }} | -