Rework service, removed redundant code, service invoicing improvements
This commit is contained in:
@@ -14,7 +14,7 @@ class OrderRequestApprove extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public Service $service;
|
||||
public Service $so;
|
||||
public string $notes;
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ class OrderRequestApprove extends Mailable
|
||||
*/
|
||||
public function __construct(Service $o,string $notes='')
|
||||
{
|
||||
$this->service = $o;
|
||||
$this->so = $o;
|
||||
$this->notes = $notes;
|
||||
}
|
||||
|
||||
@@ -36,14 +36,14 @@ class OrderRequestApprove extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
Config::set('site',$this->service->site);
|
||||
Config::set('site',$this->so->site);
|
||||
|
||||
// @todo This is not consistent with Cancel/Change Request
|
||||
switch ($this->service->category) {
|
||||
case 'broadband': $subject = sprintf('%s: %s',$this->service->category,$this->service->type->service_address);
|
||||
switch ($this->so->product->category) {
|
||||
case 'broadband': $subject = sprintf('%s: %s',$this->so->product->category,$this->so->type->service_address);
|
||||
break;
|
||||
|
||||
case 'phone': $subject = sprintf('%s: %s',$this->service->category,$this->service->type->service_number);
|
||||
case 'phone': $subject = sprintf('%s: %s',$this->so->product->category,$this->so->type->service_number);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -53,6 +53,6 @@ class OrderRequestApprove extends Mailable
|
||||
return $this
|
||||
->markdown('email.admin.order.approve')
|
||||
->subject($subject)
|
||||
->with(['site'=>$this->service->site]);
|
||||
->with(['site'=>$this->so->site]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user