@if($lead->subscriptions->count() > 0)

Subscriptions

@foreach($lead->subscriptions as $sub) @if(!empty($sub->stripe_id)) @endif() @if(!empty($sub->package())) @endif @if(!empty($sub->products())) @foreach($sub->products() as $product) @endforeach @endif @if(!empty($sub->discount_amount)) @endif @if(auth()->user() && auth()->user()->isPermitted("super")) @endif @if($sub->requiresPayment()) @endif @if(!empty($sub->getStripeSub()->ended_at)) @endif @if($sub->state() != 1 && !empty($sub->overDueCost())) @endif @if(!empty($sub->unpaidInvoiceTotal()) && $sub->unpaidInvoiceTotal() != 0) @endif @if(!empty($sub->getInvoices())) @php $invoice_list_title = 'Show subscription invoices'; $stripe_invoices = $sub->getInvoices(); @endphp @endif
@if(empty($sub->package())) No internet package @else {!! $sub->package()->title !!} @endif
ID {!! $sub->id !!}
Stripe ID {!! $sub->stripe_id !!}
Speed {!! $sub->package()->getDownSpeedUnit() !!}   {!! $sub->package()->getUpSpeedUnit() !!}
Start {!! $sub->start !!}
End {!! $sub->end !!}
Internet {!! $sub->packagePrice() !!}
{!! $product->title !!} {!! $product->price() !!}
Discount £{!! $sub->discount_amount !!} @if(!empty($sub->discount_months)) for {!! $sub->discount_months !!} months @endif
Total {!! $sub->priceSymboled() !!}
State {!! $sub->stateLong() !!}
Action
{{ csrf_field() }} @method('DELETE')
Requires payment
Payments ended {!! \Carbon\Carbon::parse($sub->getStripeSub()->ended_at)->format('jS M y') !!}
Overdue amount {!! $sub->overDueCost() !!}
Unpaid invoice total amount £{!! $sub->unpaidInvoiceTotal() !!}
@include('admin.customers.invoice_list')
@endforeach @endif @if(!empty($lead->getAllStripeInvoices())) @php $invoice_list_title = 'Show all invoices'; $stripe_invoices = $lead->getAllStripeInvoices(); @endphp @include('admin.customers.invoice_list') @endif @if(!empty($lead->getCreditTransactions()))
Credit transactions
@foreach($lead->getCreditTransactions() as $tra) @endforeach
Amount Reason Date
{{ abs($tra['amount']) }} {{ $tra['description'] }} {{ $tra['created'] }}
@endif {!! Form::model($lead, ['route' => ['lead.update', $lead->id], 'id' => 'customer_change_package', 'class' => 'my-3' ]) !!} @method('PATCH') @if(empty($lead->package))
Customer has not selected a package
@endif
Change package
@if(empty($lead->package)) {!! Form::select('package_id', $availablePackages, null) !!} @else {!! Form::select('package_id', $availablePackages, $lead->package->id) !!} @endif
{!! Form::close() !!} {!! Form::model($lead, ['route' => ['lead.update', $lead->id], 'id' => 'customer_start_quote_form', 'class' => 'my-3' ]) !!} @method('PATCH')
Discounts & exemptions
@foreach($lead->getAdminNotifications() as $notification) @if(!empty($notification['id']) && $notification['id'] == 'live_coupon') @endif @endforeach
Subscription: {!! Form::text('discount_subscription', null) !!}
Sub discount length (months): {!! Form::number('discount_sub_length', null) !!}
{!! $notification['title'] !!}
Installation: {!! Form::number('discount_install', null) !!}
Activation: {!! Form::number('discount_activation', null) !!}
Exempt from billing reason: {!! Form::text('billing_exempt', null) !!}
Exempt expire date @if(empty($lead->exempt_expire_date)) {!! Form::datetimeLocal('exempt_expire_date', null) !!} @else {!! Form::datetimeLocal( 'exempt_expire_date', (\Carbon\Carbon::parse($lead->exempt_expire_date) ->format('Y-m-d\TH:m') ?? null)) !!} @endif
Service end reason: {!! Form::text('service_end_reason', null) !!}
Service end date @if(empty($lead->service_end_date)) {!! Form::datetimeLocal('service_end_date', null) !!} @else {!! Form::datetimeLocal( 'service_end_date', (\Carbon\Carbon::parse($lead->service_end_date) ->format('Y-m-d\TH:m') ?? null)) !!} @endif
{!! Form::close() !!} {!! Form::model($lead, ['route' => ['lead.update', $lead->id], 'id' => 'customer_start_quote_form', 'class' => 'my-3' ]) !!} @method('PATCH')
Package start date quote

Setting this date will allow the customer to commit to a subscription with this date set for the first payment. The customer should have a live connection on or before this date.

Allow commitment without payment details {!! Form::select('commit_without_bank', [0=>'no',1=>'yes'], null) !!}
@if(empty($lead->start_date_quote)) {!! Form::datetimeLocal('start_date_quote', null) !!} @else {!! Form::datetimeLocal('start_date_quote', \Carbon\Carbon::parse($lead->start_date_quote)->format('Y-m-d\TH:m')) !!} @endif
{!! Form::close() !!} @if(!empty($lead->package))
Products
@if(!empty($lead->products)) @foreach($lead->products as $product) {!! Form::open( ['route' => ['product.lead_attachment'], 'id' => 'product_lead_attachment', 'class' => 'my-3' ]) !!} @method('POST') {!! Form::hidden('lead_id', $lead->id) !!} {!! Form::hidden('product_id', $product->id) !!}
{!! $product->title !!} {!! $product->price() !!}
{!! Form::close() !!} @endforeach @else

Customer currently has no extra products

@endif {!! Form::open( ['route' => ['product.lead_attachment'], 'id' => 'product_lead_attachment', 'class' => 'my-3' ]) !!} @method('POST') {!! Form::hidden('lead_id', $lead->id) !!} {!! Form::hidden('attach', true) !!}
Add product:
{!! Form::select('product_id', $products, null, ['id' => 'product-select']) !!}
{!! Form::close() !!}
@if(!empty($lead->gpon_sn)) @if(!empty($ontDetails)) @if($ontDetails['active']) @if(empty($lead->getProvisioningFile()['error'])) {!! Form::model($lead, ['route' => ['lead.activate_ont', $lead->id], 'id' => 'set_provisioning_form', ]) !!} @method('PATCH') {!! Form::close() !!} @endif @endif @endif @endif
@if(!empty($lead->products)) @foreach($lead->products as $product) @endforeach @endif @if(!empty($lead->getPreSubscription()) && !empty($lead->getPreSubscription()->discount_amount)) @endif @if(!empty($lead->stripeMatchReport())) @foreach($lead->stripeMatchReport()['report'] as $key => $r) @if(!$r['match']) @endif @endforeach @endif
Package selected  
{!! $lead->package->title !!} [ID: {!! $lead->package->id !!}]
Speed {!! $lead->package->getDownSpeedUnit() !!}   {!! $lead->package->getUpSpeedUnit() !!}
Length {!! $lead->package->length !!}
Internet {!! $lead->package->priceMonthly() !!}
+{!! $product->title !!} {!! $product->price() !!}
Discount £{!! $lead->getPreSubscription()->discount_amount !!} @if(!empty($lead->getPreSubscription()->discount_months)) for {!! $lead->getPreSubscription()->discount_months !!} months @endif @if(!empty($lead->getPreSubscription()->getCoupon())) (coupon: {!! $lead->getPreSubscription()->getCoupon() !!}) @endif
Monthly total {!! $lead->getPreSubscription()->priceSymboled() !!}
Installation {!! $lead->package->getInstallationPrice($lead->isVoucher()) !!}
Activation {!! $lead->package->getActivationPrice($lead->isVoucher()) !!}
Stripe missmatch for {!! $key !!} notify senior technical staff member immediately, this could cause problems with customer billing. @php dump($r); @endphp
@if(auth()->user() && auth()->user()->isPermitted("super")) {!! Form::open( ['route' => ['create_sub'], 'id' => 'create_sub', 'class' => 'my-3' ]) !!} @method('POST') {!! Form::hidden('package_id', $lead->package->id) !!} {!! Form::hidden('lead_id', $lead->id) !!}
Initiate subscription

Use this to forcefully start a subscription on behalf of a customer. A common reason for using this function is when a customer has been installed without going through the usual website flow.

Start date: {!! Form::datetimeLocal('start', null, ['id' => 'sub-start']) !!}
End date: {!! Form::datetimeLocal('end', null, ['id' => 'sub-end']) !!}
{!! Form::checkbox('notify_lead', 1, null, ['id' => 'notify_lead', 'class' => 'p-0']) !!} {!! Form::label('notify_lead', 'Notify customer by email ('.$lead->getEmail().')') !!}
{!! Form::close() !!} @endif @endif

View direct debit setup form (preview it then print to save as PDF)

Send Billing reminder email