Add cost/price/supplierid to service, update service report to show supplerid and overridden costs (if any)

This commit is contained in:
2025-05-16 20:36:27 +10:00
parent 8d72c1ceb5
commit b33c052995
8 changed files with 78 additions and 43 deletions

View File

@@ -10,7 +10,7 @@
</div>
<div class="row">
<div class="col">
<div class="col-12">
Connection Type
<x-leenooks::form.toggle id="pppoe" name="broadband[pppoe]" label="PPPoE" old="broadband.pppoe" :value="$o->pppoe"/>
</div>

View File

@@ -1,7 +1,7 @@
<!-- $o=Service::class,$p=Product::class -->
@use(App\Models\Invoice)
@use(Carbon\CarbonInterface)
@use(App\Models\Invoice)
@php($c=$o->product)
@@ -68,7 +68,7 @@
<tr>
<th>Billing Price</th>
<td @if($o->isChargeOverridden())class="text-danger"@endif>${{ number_format($b=$o->billing_charge,2) }}</td>
<td>${{ number_format($a=$o->account->taxed($c->base_cost),2) }}</td>
<td @if($o->isCostOverridden())class="text-danger"@endif>${{ number_format($a=$o->billing_cost,2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@if($p->exists)
<td @if($o->isChargeOverridden())class="text-danger"@endif>${{ number_format($b=$o->account->taxed($p->base_charge),2) }}</td>
@@ -90,7 +90,7 @@
@if($x)
<abbr title="${{ number_format($a=$o->account->taxed($c->base_cost)*Invoice::billing_change($o->billing_interval,Invoice::BILL_MONTHLY),2) }}">${{ number_format($b=$o->billing_cost_normalised,2) }}
@else
${{ number_format($o->billing_cost_normalised,2) }}
${{ number_format($a=$o->billing_cost_normalised,2) }}
@endif
</td>
<td>{!! markup($a,$b) !!}</td>

View File

@@ -3,7 +3,7 @@
<div class="row">
<div class="col-12">
<h4>Update Service details <x-leenooks::button.success class="float-right"/></h4>
<h4>Update Service Details <x-leenooks::button.success class="float-right"/></h4>
<hr>
<form method="POST" action="{{ url('a/service/update',[$o->id]) }}">
@@ -29,11 +29,18 @@
</div>
<div class="row">
<div class="col-3"></div>
<div class="col-12 col-sm-3">
<x-leenooks::form.text name="supplierid" icon="fa-hashtag" label="Supplier ID" :value="$o->supplierid"/>
</div>
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
<x-leenooks::form.select id="recur_schedule" name="recur_schedule" icon="fa-redo" label="Renew Term" :value="$o->recur_schedule" :options="collect(Invoice::billing_periods)->map(fn($item,$key)=>['id'=>$key,'value'=>$item['name']])"/>
</div>
<!-- Cost -->
<div class="col-12 col-sm-4 col-xl-3">
<x-leenooks::form.text name="cost" icon="fa-dollar-sign" label="Cost (Monthly)" :value="$o->cost"/>
</div>
</div>
<hr>