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_info->put('cancel_cancel',Carbon::now()->format('Y-m-d H:i:s'));
$o->order_status = 'ACTIVE'; $o->order_status = 'ACTIVE';
$o->stop_at = NULL;
return $o->save(); 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']))); && (! 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 * 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", "name": "leenooks/laravel",
"version": "11.1.12", "version": "11.1.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://gitea.dege.au/laravel/leenooks.git", "url": "https://gitea.dege.au/laravel/leenooks.git",
"reference": "ba18a2a21c0bf98c3825d53f93ed620d6a3e4423" "reference": "be6061fb6e91689714260dd0139839b9cfbffbc7"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -3096,7 +3096,7 @@
"laravel", "laravel",
"leenooks" "leenooks"
], ],
"time": "2024-08-17T00:36:07+00:00" "time": "2024-08-17T03:14:51+00:00"
}, },
{ {
"name": "leenooks/passkey", "name": "leenooks/passkey",

View File

@ -22,6 +22,12 @@
<th>Status</th> <th>Status</th>
<td><x-button.status :status="$o->status" :substatus="$o->order_status"/></td> <td><x-button.status :status="$o->status" :substatus="$o->order_status"/></td>
</tr> </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') @if($o->order_status == 'ORDER-SENT')
<tr> <tr>
<th>Order Reference</th> <th>Order Reference</th>
@ -59,18 +65,19 @@
</tr> </tr>
@endif @endif
@endif @endif
@if($o->status !== 'cancel-pending')
<tr> <tr>
<th>Next Invoice</th> <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> <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> </tr>
@if($o->invoice_next)
@if($o->invoice_next)
<tr> <tr>
<th>Next Estimated Invoice</th> <th>Next Estimated Invoice</th>
<td>${{ number_format($o->next_invoice_items()->sum('total'),2) }} <sup>*</sup></td> <td>${{ number_format($o->next_invoice_items()->sum('total'),2) }} <sup>*</sup></td>
</tr> </tr>
@endif
@endif @endif
<tr> <tr>
<th>Payment Method</th> <th>Payment Method</th>
<td>@if($o->billing)Direct Debit @else Invoice @endif</td> <td>@if($o->billing)Direct Debit @else Invoice @endif</td>