Show cancel date on service information widget
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 32s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
Deon George 2024-08-17 13:17:07 +10:00
parent a41a69676e
commit 7e784c3e81
4 changed files with 19 additions and 6 deletions

View File

@ -38,6 +38,7 @@ class ServiceController extends Controller
$o->order_info->put('cancel_cancel',Carbon::now()->format('Y-m-d H:i:s'));
$o->order_status = 'ACTIVE';
$o->stop_at = NULL;
return $o->save();
}

View File

@ -1077,6 +1077,11 @@ class Service extends Model implements IDs
&& (! in_array($this->order_status,array_merge(self::INACTIVE_STATUS,['INACTIVE'])));
}
public function isPendingCancel(): bool
{
return in_array(strtolower($this->order_status),['cancel-request','cancel-pending']);
}
/**
* Generate a collection of invoice_item objects that will be billed for the next invoice
*

6
composer.lock generated
View File

@ -3059,11 +3059,11 @@
},
{
"name": "leenooks/laravel",
"version": "11.1.12",
"version": "11.1.13",
"source": {
"type": "git",
"url": "https://gitea.dege.au/laravel/leenooks.git",
"reference": "ba18a2a21c0bf98c3825d53f93ed620d6a3e4423"
"reference": "be6061fb6e91689714260dd0139839b9cfbffbc7"
},
"type": "library",
"extra": {
@ -3096,7 +3096,7 @@
"laravel",
"leenooks"
],
"time": "2024-08-17T00:36:07+00:00"
"time": "2024-08-17T03:14:51+00:00"
},
{
"name": "leenooks/passkey",

View File

@ -22,6 +22,12 @@
<th>Status</th>
<td><x-button.status :status="$o->status" :substatus="$o->order_status"/></td>
</tr>
@if($o->isPendingCancel())
<tr>
<th>Cancel Date</th>
<td>{{ $o->stop_at->format('Y-m-d') }}</td>
</tr>
@endif
@if($o->order_status == 'ORDER-SENT')
<tr>
<th>Order Reference</th>
@ -59,18 +65,19 @@
</tr>
@endif
@endif
@if($o->status !== 'cancel-pending')
<tr>
<th>Next Invoice</th>
<td>@if($o->suspend_billing)<del>@endif{{ $o->invoice_next?->format('Y-m-d') }}@if($o->suspend_billing)</del> <strong>SUSPENDED</strong>@endif</td>
</tr>
@if($o->invoice_next)
<tr>
<th>Next Estimated Invoice</th>
<td>${{ number_format($o->next_invoice_items()->sum('total'),2) }} <sup>*</sup></td>
</tr>
@endif
@endif
<tr>
<th>Payment Method</th>
<td>@if($o->billing)Direct Debit @else Invoice @endif</td>