added print button and finalize

This commit is contained in:
2024-03-29 19:57:34 -04:00
parent 5b13032cd6
commit 2d9fce2e89
21 changed files with 1040 additions and 684 deletions

View File

@@ -1,7 +1,5 @@
<template>
<footer class="footer p-10 bg-neutral text-neutral-content mt-20">
<footer class="footer p-10 bg-neutral text-neutral-content mt-20 bg-secondary">
<nav>
<h6 class="footer-title">Services</h6>
<a class="link link-hover">Branding</a>
@@ -41,6 +39,4 @@ export default defineComponent({
methods: {},
})
</script>
<style>
</style>
<style></style>

View File

@@ -55,6 +55,14 @@ export default defineComponent({
user_id: 0,
user_name: '',
},
company: {
company_dba_name: '',
company_llc_name: '',
company_town: '',
company_stat: 0,
company_zip: '0',
},
employee: {
id: '',
user_id: '',
@@ -180,7 +188,21 @@ export default defineComponent({
})
},
getCompany() {
let path = import.meta.env.VITE_BASE_URL + '/admin/company/' + import.meta.env.COMPANY_ID;
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
this.company = response.data;
})
},
},
});
</script>

View File

@@ -29,6 +29,9 @@
</li>
<div class="font-bold text-lg text-gray-500 pt-5">Delivery</div>
<li>
<router-link :to="{ name: 'delivery' }">
<div class=" hover:underline py-1">Home</div>
</router-link>
<router-link :to="{ name: 'deliveryOutForDelivery' }">
<div class=" hover:underline py-1">Todays Deliveries</div>
</router-link>

View File

@@ -17,24 +17,32 @@
<div class="flex text-2xl mb-5">
Welcome {{ employee.employee_first_name }} {{ employee.employee_last_name }}!
</div>
<div class="grid grid-cols-12 gap-5 ">
<div class="col-span-12 bg-neutral ">
<div class="col-span-12 bg-secondary ">
<div class="grid grid-cols-12 p-5">
<div class="col-span-12 font-bold text-xl">Todays stats</div>
<div class="col-span-6 py-2"> Total Deliveries: {{ delivery_count }}</div>
<div class="col-span-6 py-2"> Completed: {{ delivery_count_delivered }} / {{ delivery_count }}</div>
</div>
</div>
</div>
</div>
<div class="col-span-6 bg-neutral">
<div class="grid grid-cols-12 p-5 ">
<div class="grid grid-cols-12 p-5 bg-secondary">
<div class="col-span-12 font-bold text-xl">Todays Oil Price</div>
<div class="col-span-12 py-2"> Price / Gallon: {{ today_oil_price }}</div>
<div class="col-span-12 py-2"> Same Day: ${{same_day}}</div>
<div class="col-span-12 py-2"> Prime: ${{prime}}</div>
<div class="col-span-12 py-2"> Same Day: ${{ price_same_day }}</div>
<div class="col-span-12 py-2"> Prime: ${{ price_prime }}</div>
<div class="col-span-12 py-2"> Price / Employee: ${{ price_for_employee }}</div>
</div>
</div>
<div class="col-span-6 bg-neutral">
<div class="grid grid-cols-12 p-5 bg-secondary">
<div class="col-span-12 font-bold text-xl">Quick Tips</div>
<div class="col-span-12 py-2"> search: @ = last name search</div>
<div class="col-span-12 py-2"> search: ! = address</div>
<div class="col-span-12 py-2"> search: # = phone number</div>
</div>
</div>
</div>
</div>
@@ -64,10 +72,12 @@ export default defineComponent({
return {
token: null,
delivery_count: 0,
today_oil_price: '',
same_day: '',
prime: '',
out_of_oil: '',
delivery_count_delivered: 0,
price_from_supplier: 0,
today_oil_price: 0,
price_for_employee: 0,
price_same_day: 0,
price_prime: 0,
user: {
user_id: 0,
user_name: '',
@@ -148,7 +158,18 @@ export default defineComponent({
this.delivery_count = response.data.data;
})
},
today_delivery_delivered() {
let path = import.meta.env.VITE_BASE_URL + '/stats/delivery/count/delivered/today'
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
this.delivery_count_delivered = response.data.data;
})
},
today_price_oil() {
let path = import.meta.env.VITE_BASE_URL + '/info/price/oil'
axios({
@@ -158,7 +179,12 @@ export default defineComponent({
headers: authHeader(),
})
.then((response: any) => {
this.today_oil_price = response.data.price;
this.price_from_supplier = response.data.price_from_supplier;
this.today_oil_price = response.data.price_for_customer;
this.price_for_employee = response.data.price_for_employee;
this.price_same_day = response.data.price_same_day;
this.price_prime = response.data.price_prime;
})
},
@@ -166,8 +192,6 @@ export default defineComponent({
})
</script>
<style scoped>
</style>
<style scoped></style>
<script setup lang="ts">
</script>

View File

@@ -29,6 +29,7 @@
<!-- head -->
<thead>
<tr>
<th>Ticket ID</th>
<th>Due Date</th>
<th>Status</th>
<th>Town</th>
@@ -41,6 +42,7 @@
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }}</td>
<td>
<div v-if="oil['delivery_status'] == 0">Waiting</div>
<div v-else-if="oil['delivery_status'] == 1">delivered</div>
@@ -61,16 +63,13 @@
<td>
{{ oil['expected_delivery_date'] }}
</td>
<td>
<div v-if="oil['automatic'] == 0">No</div>
<div v-else>Yes</div>
</td>
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
<button class="btn btn-accent">Edit</button>
</router-link>
</td>
</tr>

View File

@@ -28,6 +28,7 @@
<!-- head -->
<thead>
<tr>
<th>Account Number</th>
<th>Name</th>
<th>Town</th>
<th>Automatic</th>
@@ -38,7 +39,7 @@
<tbody>
<!-- row 1 -->
<tr v-for="person in customers" :key="person['id']">
<td>{{ person['account_number'] }}</td>
<td>
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }">
{{ person['customer_first_name'] }} {{ person['customer_last_name'] }}
@@ -52,14 +53,17 @@
<td>{{ person['customer_phone_number'] }}</td>
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryCreate', params: { id: person['id'] } }" class="cursor-pointer underline hover:text-blue-300">
<router-link :to="{ name: 'deliveryCreate', params: { id: person['id'] } }"
class="cursor-pointer underline hover:text-blue-300">
Oil
</router-link>
<router-link :to="{ name: 'customerEdit', params: { id: person['id'] } }" class="cursor-pointer underline hover:text-blue-300">
<router-link :to="{ name: 'customerEdit', params: { id: person['id'] } }"
class="cursor-pointer underline hover:text-blue-300">
Edit
</router-link>
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }" class="cursor-pointer underline hover:text-blue-300">
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }"
class="cursor-pointer underline hover:text-blue-300">
View
</router-link>
<a @click.prevent="deleteCustomer(person['id'])" class="cursor-pointer underline hover:text-blue-300">
@@ -71,8 +75,7 @@
</table>
</div>
<div class="flex justify-center" v-if="recordsLength > 9">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage"
:options="options">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
</pagination>
<div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div>
</div>
@@ -175,6 +178,4 @@ export default defineComponent({
})
</script>
<style scoped>
</style>
<style scoped></style>

View File

@@ -210,6 +210,7 @@
<!-- head -->
<thead>
<tr>
<th>id</th>
<th>Status</th>
<th>Town</th>
<th>Name</th>
@@ -224,6 +225,7 @@
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }}</td>
<td>
<div v-if="oil['delivery_status'] == 0">Waiting</div>
<div v-else-if="oil['delivery_status'] == 1">delivered</div>

View File

@@ -325,6 +325,21 @@ export default defineComponent({
.catch(() => {
});
},
getDriversList() {
let path = import.meta.env.VITE_BASE_URL + "/employee/drivers";
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
this.truckDriversList = response.data;
})
.catch(() => {
});
},
CreateOilOrder(payload: {
gallons_ordered: string;
customer_asked_for_fill: boolean;
@@ -369,23 +384,14 @@ export default defineComponent({
credit_card_id: this.CreateOilOrderForm.basicInfo.userCards,
driver_employee_id: this.CreateOilOrderForm.basicInfo.driver_driver,
};
this.CreateOilOrder(payload);
},
getDriversList() {
let path = import.meta.env.VITE_BASE_URL + "/employee/drivers";
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
this.truckDriversList = response.data;
})
.catch(() => {
if (this.CreateOilOrderForm.basicInfo.driver_driver == ''){
notify({
title: "Error",
text: "Did not add a driver",
type: "error",
});
}
this.CreateOilOrder(payload);
},
},

View File

@@ -25,6 +25,7 @@
<!-- head -->
<thead>
<tr>
<th>Ticket id</th>
<th>Name</th>
<th>Status</th>
<th>Town</th>
@@ -39,6 +40,8 @@
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['id'] }}</td>
<td>{{ oil['customer_name'] }} </td>
</router-link>
<td>

View File

@@ -21,7 +21,8 @@
</ul>
</div>
<div class="grid grid-cols-1 rounded-md pb-5">
<div class="grid grid-cols-1 rounded-md pb-5" v-if="total_amount">
<div class="text-[24px]">
Finalize Oil Order # {{ deliveryOrder.id }}
</div>
@@ -176,7 +177,7 @@
{{ userCard.name_on_card }}
</div>
<div class="flex p-1 pl-4">
****-****-****-{{ userCard.last_four_digits }}
{{ userCard.card_number }}
</div>
<div class="flex p-1 pl-4">
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
@@ -191,13 +192,13 @@
<div class="basis-1/3 p-2">
<div class="bg-neutral rounded-md border-2 ">
<div class="flex p-3">
{{ userCard.type_of_card }}
</div>
<div class="flex p-1 pl-4">
{{ userCard.name_on_card }}
</div>
<div class="flex p-1 pl-4">
****-****-****-{{ userCard.last_four_digits }}
{{ userCard.card_number }}
</div>
<div class="flex p-1 pl-4">
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
@@ -206,52 +207,53 @@
</div>
</div>
</div>
<div class="col-span-12 ">Total {{deliveryMoney.total_amount}}</div>
</div>
</div>
<div class="col-span-6 mt-5">
<div class="col-span-12 font-bold">
Change Details
<div class="grid grid-cols-12 mb-5 bg-neutral">
<div class="col-span-12 py-3">Price / Gallon: {{ deliveryOrder.customer_price }}</div>
<div class="col-span-12 py-3">
<div v-if="deliveryOrder.customer_asked_for_fill == 1"> Gallons Ordered: FILL (250)</div>
<div v-else> Gallons Ordered: {{ deliveryOrder.gallons_ordered }}</div>
</div>
<div class="col-span-12 py-3" v-if="deliveryOrder.prime == 1">
Prime Fee: {{ pricing.price_prime }}
</div>
<div class="col-span-12 py-3" v-if="deliveryOrder.same_day == 1">
Same Day: {{ pricing.price_same_day }}
</div>
<div class="col-span-12 font-bold py-5 text-lg" v-if="deliveryOrder.payment_type == 0">
<div class="">
CASH Total: ${{ total_amount }}
</div>
</div>
<div class="col-span-12 font-bold py-5 text-lg text-primary" v-if="deliveryOrder.payment_type == 1">
<div class="">
Pre Charge Credit Card Total: ${{ total_amount }}
</div>
</div>
<div class="col-span-12 font-bold py-5 text-lg text-primary" v-if="deliveryOrder.payment_type == 2">
<div class="">
Pre Charge Credit Card Total: ${{ total_amount }}
</div>
</div>
</div>
</div>
</div>
<form class="rounded-md bg-neutral" enctype="multipart/form-data" @submit.prevent="onSubmit">
<div class="grid grid-cols-12 p-5">
<div class="col-span-12 mb-5 md:mb-0 gap-10 ">
<label class="block text-white text-sm font-bold mb-2">Gallons Ordered</label>
<input v-model="CreateOilOrderForm.basicInfo.gallons_delivered"
class="input input-bordered w-full max-w-xs"
id="title" type="text" placeholder="# gallons"/>
</div>
<div class="col-span-12mb-5 md:mb-0 gap-10">
<label class="block text-white text-sm font-bold cursor-pointer label">Prime</label>
<input v-model="CreateOilOrderForm.basicInfo.prime"
class="checkbox"
id="prime"
type="checkbox"/>
</div>
<div class="col-span-12 mb-5 md:mb-0 gap-10">
<label class="block text-white text-sm font-bold cursor-pointer label">Same Day </label>
<input v-model="CreateOilOrderForm.basicInfo.same_day"
class="checkbox"
id="same_day"
type="checkbox"/>
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button
class="btn">
<button class="btn">
Finalize Delivery
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@@ -282,6 +284,7 @@ export default defineComponent({
data() {
return {
v$: useValidate(),
loaded: false,
user: {
id: 0
},
@@ -364,7 +367,19 @@ export default defineComponent({
driver_employee_id: 0,
driver_first_name: '',
driver_last_name: '',
total_price: 0,
},
pricing: {
price_from_supplier: 0,
price_for_customer: 0,
price_for_employee: 0,
price_same_day: 0,
price_prime: 0,
date: "",
},
priceprime: 0,
pricesameday: 0,
total_amount: 0
}
},
@@ -373,14 +388,16 @@ export default defineComponent({
},
watch: {
$route() {
this.sumdelivery(this.$route.params.id);
this.getOilOrder(this.$route.params.id);
this.getOilOrderMoney(this.$route.params.id);
this.get_delivery_amount(this.$route.params.id);
this.getOilPricing();
},
},
mounted() {
this.sumdelivery(this.$route.params.id);
this.getOilOrder(this.$route.params.id);
this.getOilOrderMoney(this.$route.params.id);
},
methods: {
@@ -428,20 +445,7 @@ export default defineComponent({
})
},
get_delivery_amount(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/delivery/amount/" + delivery_id;
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data) {
}
})
},
getCustomer(user_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/customer/" + user_id;
axios({
@@ -474,20 +478,50 @@ export default defineComponent({
});
},
getOilOrderMoney(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/money/" + delivery_id;
getOilPricing() {
let path = import.meta.env.VITE_BASE_URL + "/info/price/oil/table";
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data) {
this.deliveryMoney = response.data
}
this.pricing = response.data;
})
.catch(() => {
notify({
title: "Error",
text: "Could not get oil pricing",
type: "error",
});
});
},
sumdelivery(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/delivery/total/" + delivery_id;
axios({
method: "get",
url: path,
withCredentials: true,
})
.then((response: any) => {
if (response.data.ok){
this.priceprime = response.data.priceprime;
this.pricesameday = response.data.pricesameday;
this.total_amount = response.data.total_amount;
}
})
.catch(() => {
notify({
title: "Error",
text: "Could not get oil pricing",
type: "error",
});
});
},
editOilOrder(payload: {

View File

@@ -80,7 +80,7 @@
<div class="col-span-6 ">
<div class="flex justify-end" v-if="deliveryOrder.id ">
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
<button class="btn">Edit Order</button>
<button class="btn btn-accent">Edit Order</button>
</router-link>
</div>
</div>

View File

@@ -5,22 +5,23 @@
<SideBar />
</div>
<div class=" w-full px-10 ">
<div class="text-sm breadcrumbs">
<div class="text-sm breadcrumbs pb-10">
<ul>
<li>
<router-link :to="{ name: 'home' }">
Home
</router-link>
</li>
</ul>
</div>
<div class="flex justify-end">
<div class="flex start pb-10">Cancelled Deliveries </div>
<div class="flex justify-start pb-5">
</div>
<div class="overflow-x-auto">
<div class="flex start">Cancelled Deliveries</div>
<div class="flex start"> </div>
<table class="table">
<!-- head -->
<thead>
@@ -75,12 +76,12 @@
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
<button class="btn">View</button>
<button class="btn btn-accent">View</button>
</router-link>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
<button class="btn btn-accent">Edit</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
</td>
</tr>
</tbody>

View File

@@ -5,22 +5,23 @@
<SideBar />
</div>
<div class=" w-full px-10 ">
<div class="text-sm breadcrumbs">
<div class="text-sm breadcrumbs pb-10">
<ul>
<li>
<router-link :to="{ name: 'home' }">
Home
</router-link>
</li>
</ul>
</div>
<div class="flex justify-end">
<div class="flex start pb-10">Delivered Deliveries </div>
<div class="flex justify-start pb-5">
</div>
<div class="overflow-x-auto">
<div class="flex start">Delivered Deliveries</div>
<table class="table">
<!-- head -->
<thead>
@@ -38,7 +39,8 @@
</thead>
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<tr v-for="oil in deliveries" :key="oil['id']">
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['customer_name'] }} </td>
</router-link>
<td>
@@ -72,13 +74,9 @@
</td>
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
<button class="btn">View</button>
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
<button class="btn btn-accent">Finalize</button>
</router-link>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
</td>
</tr>
</tbody>
@@ -160,6 +158,7 @@ export default defineComponent({
this.user = null
})
},
get_oil_orders(page: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/delivered/' + page;
axios({

View File

@@ -5,26 +5,28 @@
<SideBar />
</div>
<div class=" w-full px-10 ">
<div class="text-sm breadcrumbs">
<div class="text-sm breadcrumbs pb-10">
<ul>
<li>
<router-link :to="{ name: 'home' }">
Home
</router-link>
</li>
</ul>
</div>
<div class="flex justify-end">
<div class="flex start pb-10">Finalized Delivery </div>
<div class="flex justify-start pb-5">
</div>
<div class="overflow-x-auto">
<div class="flex start">Finalized Deliveries</div>
<table class="table">
<!-- head -->
<thead>
<tr>
<th>Ticket Id</th>
<th>Name</th>
<th>Status</th>
<th>Town</th>
@@ -38,7 +40,9 @@
</thead>
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }} </td>
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['customer_name'] }} </td>
</router-link>
<td>
@@ -73,12 +77,12 @@
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
<button class="btn">View</button>
<button class="btn btn-accent">View</button>
</router-link>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
<button class="btn btn-accent">Edit</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
</td>
</tr>
</tbody>

View File

@@ -5,30 +5,31 @@
<SideBar />
</div>
<div class=" w-full px-10 ">
<div class="text-sm breadcrumbs">
<div class="text-sm breadcrumbs pb-10">
<ul>
<li>
<router-link :to="{ name: 'home' }">
Home
</router-link>
</li>
</ul>
</div>
<div class="flex justify-end">
<div class="flex start pb-10">Issue with Delivery </div>
<div class="flex justify-start pb-5">
</div>
<div class="overflow-x-auto">
<div class="flex start">Issue with Delivery</div>
<table class="table">
<!-- head -->
<thead>
<tr>
<th>Ticket Id</th>
<th>Name</th>
<th>Status</th>
<th>Town</th>
<th>Address</th>
<th>Gallons</th>
<th>Date</th>
@@ -39,7 +40,9 @@
</thead>
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }} </td>
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['customer_name'] }} </td>
</router-link>
<td>
@@ -75,12 +78,12 @@
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
<button class="btn">View</button>
<button class="btn btn-accent">View</button>
</router-link>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
<button class="btn btn-accent btn-accent">Edit</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
</td>
</tr>
</tbody>

View File

@@ -5,26 +5,31 @@
<SideBar />
</div>
<div class=" w-full px-10 ">
<div class="text-sm breadcrumbs">
<div class="text-sm breadcrumbs pb-10">
<ul>
<li>
<router-link :to="{ name: 'home' }">
Home
</router-link>
</li>
</ul>
</div>
<div class="flex justify-end">
<div class="flex start pb-10">Out for Delivery </div>
<div class="flex justify-start pb-5">
<button @click.prevent="printtTicketAll" class="btn btn-accent">
Print All
</button>
</div>
<div class="overflow-x-auto">
<div class="flex start">Out for Delivery </div>
<table class="table">
<!-- head -->
<thead>
<tr>
<th>Delivery Id</th>
<th>Name</th>
<th>Status</th>
<th>Town</th>
@@ -38,7 +43,12 @@
</thead>
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }} </td>
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['customer_name'] }} </td>
</router-link>
<td>
@@ -74,20 +84,25 @@
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
<button class="btn">View</button>
<button class="btn btn-accent">View</button>
</router-link>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
<button class="btn btn-accent">Edit</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">
Delete
</button>
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent">
Print
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="flex justify-center" v-if="recordsLength > 9">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage"
:options="options">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
</pagination>
<div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div>
</div>
@@ -131,16 +146,15 @@ export default defineComponent({
}
}
},
created() {
this.userStatus()
this.updatestatus();
},
mounted() {
this.getPage(this.page)
},
methods: {
getPage: function (page: any) {
// we simulate an api call that fetch the records from a backend
this.deliveries = [];
this.get_oil_orders(page)
},
@@ -161,6 +175,23 @@ export default defineComponent({
this.user = null
})
},
updatestatus() {
let path = import.meta.env.VITE_BASE_URL + '/delivery/updatestatus/outfordelivery';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.update)
notify({
title: "Success",
text: "Updated Oil Orders",
type: "success",
});
else { }
})
},
get_oil_orders(page: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/outfordelivery/' + page;
axios({
@@ -171,6 +202,7 @@ export default defineComponent({
this.deliveries = response.data
})
},
deleteCall(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
axios({
@@ -194,10 +226,55 @@ export default defineComponent({
}
})
},
printtTicketAll() {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/all/print_today';
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
printTicket(delivery_id: number) {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
},
})
</script>
<style scoped>
</style>
<style scoped></style>

View File

@@ -5,26 +5,30 @@
<SideBar />
</div>
<div class=" w-full px-10 ">
<div class="text-sm breadcrumbs">
<div class="text-sm breadcrumbs pb-10">
<ul>
<li>
<router-link :to="{ name: 'home' }">
Home
</router-link>
</li>
</ul>
</div>
<div class="flex justify-end">
<div class="flex start pb-10">Tommorrows Deliveries </div>
<div class="flex justify-start pb-5">
<button @click.prevent="printtTicketAll" class="btn btn-accent">
Print All
</button>
</div>
<div class="overflow-x-auto">
<div class="flex start">Tommorrows Deliveries </div>
<div class="flex start"> </div>
<table class="table">
<!-- head -->
<thead>
<tr>
<th>Ticket Id</th>
<th>Name</th>
<th>Status</th>
<th>Town</th>
@@ -39,7 +43,9 @@
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }} </td>
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['customer_name'] }} </td>
</router-link>
<td>
@@ -75,20 +81,24 @@
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
<button class="btn">View</button>
<button class="btn btn-accent">View</button>
</router-link>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
<button class="btn btn-accent">Edit</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">
Delete
</button>
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent">
Print
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="flex justify-center" v-if="recordsLength > 9">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage"
:options="options">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
</pagination>
<div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div>
</div>
@@ -132,7 +142,6 @@
}
}
},
created() {
this.userStatus()
},
@@ -141,7 +150,6 @@
},
methods: {
getPage: function (page: any) {
// we simulate an api call that fetch the records from a backend
this.deliveries = [];
this.get_oil_orders(page)
},
@@ -172,6 +180,7 @@
this.deliveries = response.data
})
},
deleteCall(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
axios({
@@ -195,10 +204,57 @@
}
})
},
printtTicketAll() {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/all/print_tommorrow';
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
printTicket(delivery_id: number) {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
},
})
</script>
<style scoped>
</style>

View File

@@ -5,30 +5,32 @@
<SideBar />
</div>
<div class=" w-full px-10 ">
<div class="text-sm breadcrumbs">
<div class="text-sm breadcrumbs pb-10">
<ul>
<li>
<router-link :to="{ name: 'home' }">
Home
</router-link>
</li>
</ul>
</div>
<div class="flex justify-end">
<div class="flex start pb-10">Waiting Deliveries </div>
<div class="flex justify-start pb-5">
<button @click.prevent="printtTicketAll" class="btn btn-accent">
Print All
</button>
</div>
<div class="overflow-x-auto">
<div class="flex start">Waiting Deliveries</div>
<table class="table">
<!-- head -->
<thead>
<tr>
<th>Ticket Id</th>
<th>Name</th>
<th>Status</th>
<th>Town</th>
<th>Address</th>
<th>Gallons</th>
<th>Date</th>
@@ -39,7 +41,9 @@
</thead>
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }} </td>
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['customer_name'] }} </td>
</router-link>
<td>
@@ -75,12 +79,13 @@
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
<button class="btn">View</button>
<button class="btn btn-accent">View</button>
</router-link>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
<button class="btn btn-accent">Edit</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent">Print</button>
</td>
</tr>
</tbody>
@@ -195,6 +200,53 @@ export default defineComponent({
}
})
},
printtTicketAll() {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/all/print_waiting';
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
printTicket(delivery_id: number) {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
},
})
</script>

View File

@@ -21,7 +21,7 @@
</div>
<div class="flex justify-end">
<router-link :to="{ name: 'employeeCreate' }">
<button class="btn">Create Employee</button>
<button class="btn btn-accent">Create Employee</button>
</router-link>
</div>
@@ -30,6 +30,7 @@
<!-- head -->
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Town</th>
@@ -42,7 +43,6 @@
<tr v-for="person in employees" :key="person['id']">
<td>{{ person['employee_first_name'] }} {{ person['employee_last_name'] }}</td>
<td>
<div v-if="person['employee_type'] == 0">Owner</div>
<div v-else-if="person['employee_type'] == 1">Manager</div>
@@ -54,7 +54,6 @@
<div v-else-if="person['employee_type'] == 7">Cash</div>
<div v-else-if="person['employee_type'] == 8">Driver/Tech</div>
<div v-else></div>
</td>
<td>{{ person['employee_town'] }}</td>
@@ -62,10 +61,10 @@
<td>{{ person['employee_phone_number'] }}</td>
<td class="flex gap-5">
<router-link :to="{ name: 'employeeEdit', params: { id: person['id'] } }">
<button class="btn">Edit</button>
<button class="btn btn-accent">Edit</button>
</router-link>
<router-link :to="{ name: 'employeeProfile', params: { id: person['id'] } }">
<button class="btn">View</button>
<button class="btn btn-accent">View</button>
</router-link>
</td>
</tr>

View File

@@ -18,15 +18,15 @@
</div>
<div class="grid grid-cols-1 rounded-md p-6 mb-5">
<div class="grid grid-cols-1 rounded-md p-6 mb-5" v-if="loaded">
<div class=" col-span-12 text-[24px]">
Confirm Payment Oil Delivery {{ delivery.id }}
</div>
<div class="grid grid-cols-12 bg-neutral mb-5">
<div class="col-span-12 font-bold flex pb-5 text-lg">{{ customer.account_number }}</div>
<div class="col-span-12 font-bold flex pb-5 text-lg">
{{ customer.account_number }}
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
@@ -141,26 +141,49 @@
<div v-else> Gallons Ordered: {{ delivery.gallons_ordered }}</div>
</div>
<div class="col-span-12 py-3" v-if="delivery.prime == 1">
Prime Fee: {{ delivery.prime }}
Prime Fee: {{ pricing.price_prime }}
</div>
<div class="col-span-12 py-3" v-if="delivery.same_day == 1">
Same Day: {{ delivery.same_day }}
Same Day: {{ pricing.price_same_day }}
</div>
<div class="col-span-12 font-bold py-5 text-lg" v-if="delivery.payment_type == 0">
<div class="">
CASH Total: ${{ total_amount }}
</div>
</div>
<div class="col-span-12 font-bold py-5 text-lg text-primary" v-if="delivery.payment_type == 1">
<div class="">
Pre Charge Credit Card Total: ${{ total_amount }}
</div>
</div>
<div class="col-span-12 font-bold py-5 text-lg text-primary" v-if="delivery.payment_type == 2">
<div class="">
Pre Charge Credit Card Total: ${{ total_amount }}
</div>
</div>
<div class="col-span-12 font-bold py-5 text-lg">Total: {{ delivery.total_price }}</div>
</div>
</div>
<div class="flex justify-between">
<!-- <button class="btn" @click="checkoutOilCreditStripe()">-->
<!-- Pay Credit Card (Stripe)-->
<!-- </button>-->
<button class="btn" @click="checkoutOilUpdatePayment(0)">
<div class="" v-if="delivery.payment_type == 0">
<button class="btn btn-primary" @click="checkoutOilUpdatePayment(0)">
Cash Payment
</button>
<button class="btn" @click="checkoutOilUpdatePayment(1)">
</div>
<div class="" v-if="delivery.payment_type == 1">
<button class="btn btn-accent" @click="checkoutOilUpdatePayment(1)">
Pay Credit Terminal
</button>
</div>
<div class="" v-if="delivery.payment_type == 2">
Cash +
<button class="btn btn-accent" @click="checkoutOilUpdatePayment(3)">
Pay Credit Terminal
</button>
</div>
</div>
</div>
</div>
</div>
@@ -191,6 +214,7 @@ export default defineComponent({
data() {
return {
v$: useValidate(),
loaded: false,
user: {
user_id: 0,
},
@@ -241,6 +265,7 @@ export default defineComponent({
}
],
stripe: null,
customer: {
id: 0,
@@ -256,6 +281,17 @@ export default defineComponent({
customer_phone_number: '',
account_number: '',
},
pricing: {
price_from_supplier: 0,
price_for_customer: 0,
price_for_employee: 0,
price_same_day: 0,
price_prime: 0,
date: "",
},
priceprime: 0,
pricesameday: 0,
total_amount: 0
}
},
validations() {
@@ -279,10 +315,28 @@ export default defineComponent({
},
mounted() {
this.getOilOrder(this.$route.params.id)
this.getOilPricing()
// this.getStripePublishableKey();
},
methods: {
sumdelivery() {
if (this.delivery.same_day == 1)
this.pricesameday = this.pricing.price_same_day
else { this.pricesameday = 0 };
if (this.delivery.prime == 1)
this.priceprime = this.pricing.price_prime
else { this.priceprime = 0 };
this.total_amount = Number(this.delivery.total_price) + Number(this.priceprime) + Number(this.pricesameday)
this.loaded = true
},
userStatus() {
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
axios({
@@ -298,6 +352,27 @@ export default defineComponent({
})
},
getOilPricing() {
let path = import.meta.env.VITE_BASE_URL + "/info/price/oil/table";
axios({
method: "get",
url: path,
withCredentials: true,
})
.then((response: any) => {
this.pricing = response.data;
this.sumdelivery();
})
.catch(() => {
notify({
title: "Error",
text: "Could not get oil pricing",
type: "error",
});
});
},
getOilOrder(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/" + delivery_id;
axios({

View File

@@ -7,8 +7,8 @@ module.exports = {
themes: [{
mytheme: {
"primary": "#0256bf",
"secondary": "#1e1d24",
"accent": "#7F00FF",
"secondary": "#262732",
"accent": "#161fac",
"neutral": "#1e1d24",
"base-100": "#1e1d24",
"info": "#74a0d5",