updated user customer list

This commit is contained in:
2025-09-21 19:10:23 -04:00
parent 279f0d9deb
commit a9ee292b23
5 changed files with 30 additions and 40 deletions

View File

@@ -48,7 +48,7 @@
{{ person.account_number }}
</router-link>
</td>
<td>{{ person.customer_first_name }} {{ person.customer_last_name }}</td>
<td><router-link :to="{ name: 'customerProfile', params: { id: person.id } }" class="link link-hover hover:text-green-500">{{ person.customer_first_name }} {{ person.customer_last_name }}</router-link></td>
<td>{{ person.customer_town }}</td>
<td><span :class="person.customer_automatic ? 'text-success' : 'text-gray-500'">{{ person.customer_automatic ? 'Yes' : 'No' }}</span></td>
<td>{{ person.customer_phone_number }}</td>
@@ -79,7 +79,9 @@
<div class="card-body p-4">
<div class="flex justify-between items-start">
<div>
<h2 class="card-title text-base">{{ person.customer_first_name }} {{ person.customer_last_name }}</h2>
<router-link :to="{ name: 'customerProfile', params: { id: person.id } }" class="hover:text-green-500">
<h2 class="card-title text-base">{{ person.customer_first_name }} {{ person.customer_last_name }}</h2>
</router-link>
<p class="text-xs text-gray-400">#{{ person.account_number }}</p>
</div>
<div class="badge" :class="person.customer_automatic ? 'badge-success' : 'badge-ghost'">
@@ -223,4 +225,4 @@ export default defineComponent({
})
</script>
<style scoped></style>
<style scoped></style>

View File

@@ -73,8 +73,8 @@
<div class="xl:col-span-4 space-y-6">
<!-- Authorize.net Account Status Box -->
<div v-if="customer.id" class="bg-base-100 rounded-lg p-4 border">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between">
<div class="flex items-center gap-3 mb-3 md:mb-0">
<svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v4a3 3 0 003 3z"/>
</svg>
@@ -89,16 +89,10 @@
{{ getAccountStatusMessage() }}
</span>
</div>
<div class="flex gap-2" v-if="!isLoadingAuthorize">
<div class="flex gap-2" v-if="!isLoadingAuthorize && !authorizeCheck.valid_for_charging">
<!-- CREATE ACCOUNT SECTION - Only show when account doesn't exist -->
<div v-if="!authorizeCheck.valid_for_charging" class="flex gap-2">
<button
v-if="credit_cards_count === 0"
@click="addCreditCard"
class="btn btn-primary btn-sm"
>
Add Card
</button>
<div class="flex gap-2">
<button
@click="createAuthorizeAccount"
:class="['btn btn-sm', credit_cards_count === 0 ? 'btn-disabled' : 'btn-primary']"
@@ -115,16 +109,15 @@
Add Card First
</button>
</div>
<!-- DELETE ACCOUNT SECTION - Only show when account exists -->
<div v-if="authorizeCheck.valid_for_charging" class="flex gap-2">
<button
@click="showDeleteAccountModal"
class="btn btn-error btn-sm"
>
Delete Account
</button>
</div>
</div>
<!-- DELETE ACCOUNT SECTION - Only show when account exists -->
<div v-if="authorizeCheck.valid_for_charging" class="mt-3 lg:mt-0 lg:flex lg:gap-2">
<button
@click="showDeleteAccountModal"
class="btn btn-error btn-sm lg:self-start"
>
Delete Account
</button>
</div>
</div>
</div>

View File

@@ -10,7 +10,7 @@
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
<span class="text-xs font-medium">Delivery</span>
<span class="text-xs font-medium ">Delivery</span>
</router-link>
<router-link :to="{ name: 'CalenderCustomer', params: { id: customer.id } }"
@@ -19,7 +19,7 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>
<span class="text-xs font-medium">Service</span>
<span class="text-xs font-medium ">Service</span>
</router-link>
<router-link :to="{ name: 'customerEdit', params: { id: customer.id } }"
@@ -27,7 +27,7 @@
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
<span class="text-xs font-medium">Edit</span>
<span class="text-xs font-medium ">Edit</span>
</router-link>
<!-- Row 2 -->
@@ -36,7 +36,7 @@
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
<span class="text-xs font-medium">Contract</span>
<span class="text-xs font-medium ">Contract</span>
</router-link>
<button @click="$emit('toggleAutomatic', customer.id)"
@@ -45,7 +45,7 @@
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
</svg>
<span class="text-xs font-medium">{{ automatic_status === 1 ? 'Set to Will Call' : 'Set to Auto' }}</span>
<span class="text-xs font-medium ">{{ automatic_status === 1 ? 'Set to Will Call' : 'Set to Auto' }}</span>
</button>
</div>

View File

@@ -62,11 +62,10 @@
<!-- Delivery Status Card -->
<div class="bg-neutral rounded-lg p-5">
<h3 class="text-xl font-bold mb-4">Delivery Status</h3>
<div class="space-y-3">
<div>
<div class="grid grid-cols-2 gap-4">
<div class="col-span-2">
<div class="font-bold text-sm">Current Status</div>
<div class="badge badge-lg"
<div class="badge badge-lg"
:class="{
'badge-success': [1, 10].includes(deliveryOrder.delivery_status),
'badge-info': deliveryOrder.delivery_status == 2,
@@ -84,10 +83,6 @@
<span v-else-if="deliveryOrder.delivery_status == 10">Finalized</span>
</div>
</div>
<!-- <div>
<div class="font-bold text-sm">Assigned Driver</div>
<div>{{ deliveryOrder.driver_first_name }} {{ deliveryOrder.driver_last_name }}</div>
</div> -->
<div>
<div class="font-bold text-sm">Scheduled Date</div>
<div>{{ deliveryOrder.expected_delivery_date }}</div>
@@ -96,7 +91,7 @@
<div class="font-bold text-sm">Date Delivered</div>
<div>{{ (deliveryOrder.when_delivered) }}</div>
</div>
<div>
<div class="col-span-2">
<div class="font-bold text-sm">Date Ordered</div>
<div>{{ (deliveryOrder.when_ordered) }}</div>
</div>
@@ -335,7 +330,7 @@
This prevents the links from rendering until `deliveryOrder.id` is available.
-->
<div v-if="deliveryOrder && deliveryOrder.id" class="flex flex-wrap gap-2 pt-4">
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
<router-link v-if="deliveryOrder.delivery_status !== 10" :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
<button class="btn btn-secondary btn-sm">Edit Delivery</button>
</router-link>
<router-link :to="{ name: 'finalizeTicket', params: { id: deliveryOrder.id } }" v-if="deliveryOrder.delivery_status != 10">

View File

@@ -747,7 +747,7 @@ export default defineComponent({
// Update local state
this.customer.auth_net_profile_id = response.data.profile_id;
this.authorizeCheck.valid_for_charging = true;
this.authorizeCheck.profile_exists = true;
// this.authorizeCheck.profile_exists = true;
this.authorizeCheck.has_payment_methods = true;
this.authorizeCheck.missing_components = [];
this.createdProfileId = response.data.profile_id;