Updated charge close to working

This commit is contained in:
2025-09-09 18:26:21 -04:00
parent fd11c9e794
commit 98fe855e65
19 changed files with 1785 additions and 372 deletions

View File

@@ -38,18 +38,20 @@
<table class="table w-full">
<thead>
<tr>
<th>ID</th>
<th>Date / Time</th>
<th>Customer</th>
<th>Address</th>
<th>Service Type</th>
<th>Description</th>
<th class="text-right">Cost</th>
<th class="text-right">Amount</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody>
<!-- Removed @click from tr to avoid conflicting actions -->
<tr v-for="service in services" :key="service.id" class=" hover:bg-blue-600">
<td class="align-top">{{ service.id }}</td>
<td class="align-top">
<div>{{ formatDate(service.scheduled_date) }}</div>
<div class="text-xs opacity-70">{{ formatTime(service.scheduled_date) }}</div>
@@ -76,8 +78,9 @@
</div>
</td>
<td class="text-right font-mono align-top">{{ formatCurrency(service.service_cost) }}</td>
<td class="text-right align-top">
<td class="text-right align-top space-x-2">
<button @click="openEditModal(service)" class="btn btn-sm btn-primary">View</button>
<router-link v-if="service.service_cost !== undefined && service.service_cost !== '' && Number(service.service_cost) === 0" :to="{ name: 'chargeServiceAuthorize', params: { id: service.id } }" class="btn btn-sm btn-success">Charge</router-link>
</td>
</tr>
</tbody>
@@ -91,6 +94,7 @@
<div class="flex justify-between items-start">
<div>
<h2 class="card-title text-base">{{ service.customer_name }}</h2>
<p class="text-xs text-gray-500">ID: {{ service.id }}</p>
<p class="text-xs text-gray-400">{{ service.customer_address }}, {{ service.customer_town }}</p>
</div>
<div class="badge badge-outline text-right" :style="{ 'border-color': getServiceTypeColor(service.type_service_call), color: getServiceTypeColor(service.type_service_call) }">
@@ -116,8 +120,9 @@
</div>
</div>
<div class="card-actions justify-end mt-2">
<div class="card-actions justify-end mt-2 space-x-2">
<button @click="openEditModal(service)" class="btn btn-sm btn-primary">View</button>
<router-link v-if="service.service_cost !== undefined && service.service_cost !== '' && Number(service.service_cost) === 0" :to="{ name: 'chargeServiceAuthorize', params: { id: service.id } }" class="btn btn-sm btn-success">Charge</router-link>
</div>
</div>
</div>
@@ -311,4 +316,4 @@ export default defineComponent({
}
},
})
</script>
</script>

View File

@@ -38,17 +38,19 @@
<table class="table w-full">
<thead>
<tr>
<th>ID</th>
<th>Date / Time</th>
<th>Customer</th>
<th>Address</th>
<th>Service Type</th>
<th>Description</th>
<th class="text-right">Cost</th>
<th class="text-right">Amount</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody>
<tr v-for="service in services" :key="service.id" class="hover:bg-blue-600">
<td class="align-top">{{ service.id }}</td>
<td class="align-top">
<div>{{ formatDate(service.scheduled_date) }}</div>
<div class="text-xs opacity-70">{{ formatTime(service.scheduled_date) }}</div>
@@ -82,8 +84,9 @@
</div>
</td>
<td class="text-right font-mono align-top">{{ formatCurrency(service.service_cost) }}</td>
<td class="text-right align-top">
<td class="text-right align-top space-x-2">
<button @click="openEditModal(service)" class="btn btn-sm btn-primary">View</button>
<router-link v-if="service.service_cost !== undefined && service.service_cost !== '' && Number(service.service_cost) === 0" :to="{ name: 'chargeServiceAuthorize', params: { id: service.id } }" class="btn btn-sm btn-success">Charge</router-link>
</td>
</tr>
</tbody>
@@ -97,6 +100,7 @@
<div class="flex justify-between items-start">
<div>
<h2 class="card-title text-base">{{ service.customer_name }}</h2>
<p class="text-xs text-gray-500">ID: {{ service.id }}</p>
<p class="text-xs text-gray-400">{{ service.customer_address }}, {{ service.customer_town }}</p>
</div>
<!-- Mobile view already uses a badge, which is great! No changes needed here. -->
@@ -122,8 +126,9 @@
</div>
</div>
<div class="card-actions justify-end mt-2">
<div class="card-actions justify-end mt-2 space-x-2">
<button @click="openEditModal(service)" class="btn btn-sm btn-primary">View</button>
<router-link v-if="service.service_cost !== undefined && service.service_cost !== '' && Number(service.service_cost) === 0" :to="{ name: 'chargeServiceAuthorize', params: { id: service.id } }" class="btn btn-sm btn-success">Charge</router-link>
</div>
</div>
</div>
@@ -324,4 +329,4 @@ export default defineComponent({
}
},
})
</script>
</script>

View File

@@ -38,17 +38,19 @@
<table class="table w-full">
<thead>
<tr>
<th>ID</th>
<th>Date / Time</th>
<th>Customer</th>
<th>Address</th>
<th>Service Type</th>
<th>Description</th>
<th class="text-right">Cost</th>
<th class="text-right">Amount</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody>
<tr v-for="service in services" :key="service.id" class="hover:bg-blue-600">
<td class="align-top">{{ service.id }}</td>
<td class="align-top">
<div>{{ formatDate(service.scheduled_date) }}</div>
<div class="text-xs opacity-70">{{ formatTime(service.scheduled_date) }}</div>
@@ -82,8 +84,9 @@
</div>
</td>
<td class="text-right font-mono align-top">{{ formatCurrency(service.service_cost) }}</td>
<td class="text-right align-top">
<td class="text-right align-top space-x-2">
<button @click="openEditModal(service)" class="btn btn-sm btn-primary">View</button>
<router-link v-if="service.service_cost !== undefined && service.service_cost !== '' && Number(service.service_cost) === 0" :to="{ name: 'chargeServiceAuthorize', params: { id: service.id } }" class="btn btn-sm btn-success">Charge</router-link>
</td>
</tr>
</tbody>
@@ -97,6 +100,7 @@
<div class="flex justify-between items-start">
<div>
<h2 class="card-title text-base">{{ service.customer_name }}</h2>
<p class="text-xs text-gray-500">ID: {{ service.id }}</p>
<p class="text-xs text-gray-400">{{ service.customer_address }}, {{ service.customer_town }}</p>
</div>
<!-- Mobile view already uses a badge, which is great! No changes needed here. -->
@@ -122,8 +126,9 @@
</div>
</div>
<div class="card-actions justify-end mt-2">
<div class="card-actions justify-end mt-2 space-x-2">
<button @click="openEditModal(service)" class="btn btn-sm btn-primary">View</button>
<router-link v-if="service.service_cost !== undefined && service.service_cost !== '' && Number(service.service_cost) === 0" :to="{ name: 'chargeServiceAuthorize', params: { id: service.id } }" class="btn btn-sm btn-success">Charge</router-link>
</div>
</div>
</div>