Putback user::site(), add heading for order emails

This commit is contained in:
Deon George 2020-02-09 16:48:03 +11:00
parent eb316f65fc
commit a92e94398c
6 changed files with 48 additions and 5 deletions

View File

@ -20,7 +20,6 @@ variables:
cache:
paths:
- vendor/
- node_modules/
# This is a basic example for a gem or script which doesn't use
# services such as redis or postgres

View File

@ -117,7 +117,9 @@ class OrderController extends Controller
$options->save();
}
Mail::to('help@graytech.net.au')->queue((new OrderRequest($so,$request->input('options.notes')))->onQueue('email')); //@todo Get email from DB.
Mail::to('help@graytech.net.au')
->queue((new OrderRequest($so,$request->input('options.notes')))->onQueue('email')); //@todo Get email from DB.
return view('order_received',['o'=>$so]);
}
}

View File

@ -37,10 +37,12 @@ class OrderRequest extends Mailable
{
switch (get_class($this->service->type))
{
case 'App\Models\Service\Adsl': $subject = sprintf('NBN: %s',$this->service->type->service_address);
case 'App\Models\Service\Adsl':
$subject = sprintf('NBN: %s',$this->service->type->service_address);
break;
case 'App\Models\Service\Voip': $subject = sprintf('VOIP: %s',$this->service->type->service_number);
case 'App\Models\Service\Voip':
$subject = sprintf('VOIP: %s',$this->service->type->service_number);
break;
default:

View File

@ -133,6 +133,16 @@ class User extends Authenticatable
->with(['account','product','invoices.items.tax','type']);
}
/**
* The site this user is configured to access
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function site()
{
return $this->belongsTo(Site::class);
}
/**
* This users supplier/reseller
*

View File

@ -0,0 +1,30 @@
<table class="table table-bordered">
<!-- Group by Account -->
@foreach (($x=$o->next_invoice_items($future))->groupBy('product_id') as $id => $oo)
<tr>
<th colspan="4">{{ $oo->first()->product->name }}</th>
<th class="text-right">${{ number_format($oo->sum('total'),2) }}</th>
</tr>
@foreach ($oo->groupBy('service_id') as $ooo)
<tr>
<td class="pt-0 pb-1" style="width: 8em;"><a href="{{ url('u/service',$ooo->first()->service_id) }}">{{ $ooo->first()->service->sid }}</a></td>
<td class="pt-0 pb-1" colspan="3">{{ $ooo->first()->service->sname }}: {{ $ooo->first()->service->sdesc }}</td>
</tr>
@foreach ($ooo as $io)
<tr>
<td class="pt-0 pb-1">&nbsp;</td>
<td class="pt-0 pb-1">&nbsp;</td>
<td class="pt-0 pb-1">{{ $io->item_type_name }}</td>
<td class="text-right pt-0 pb-1">${{ number_format($io->total,2) }}</td>
</tr>
@endforeach
@endforeach
@endforeach
<tr>
<th colspan="4">TOTAL</th>
<th class="text-right">${{ number_format($x->sum('total'),2) }}</th>
</tr>
</table>

View File

@ -1,4 +1,4 @@
@component('mail::message',['site'=>$site])
@component('mail::message',['site'=>$site,'heading'=>'Please Order the following...'])
# Please order the following service.
@component('mail::panel')