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> <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> <nav>
<h6 class="footer-title">Services</h6> <h6 class="footer-title">Services</h6>
<a class="link link-hover">Branding</a> <a class="link link-hover">Branding</a>
@@ -22,7 +20,7 @@
<a class="link link-hover">Privacy policy</a> <a class="link link-hover">Privacy policy</a>
<a class="link link-hover">Cookie policy</a> <a class="link link-hover">Cookie policy</a>
</nav> </nav>
</footer> </footer>
</template> </template>
@@ -37,10 +35,8 @@ export default defineComponent({
} }
}, },
mounted() {}, mounted() { },
methods: {}, methods: {},
}) })
</script> </script>
<style> <style></style>
</style>

View File

@@ -55,6 +55,14 @@ export default defineComponent({
user_id: 0, user_id: 0,
user_name: '', user_name: '',
}, },
company: {
company_dba_name: '',
company_llc_name: '',
company_town: '',
company_stat: 0,
company_zip: '0',
},
employee: { employee: {
id: '', id: '',
user_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> </script>

View File

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

View File

@@ -1,8 +1,8 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs">
@@ -17,34 +17,42 @@
<div class="flex text-2xl mb-5"> <div class="flex text-2xl mb-5">
Welcome {{ employee.employee_first_name }} {{ employee.employee_last_name }}! Welcome {{ employee.employee_first_name }} {{ employee.employee_last_name }}!
</div> </div>
<div class="grid grid-cols-12 gap-5">
<div class="col-span-12 bg-neutral "> <div class="grid grid-cols-12 gap-5 ">
<div class="col-span-12 bg-secondary ">
<div class="grid grid-cols-12 p-5"> <div class="grid grid-cols-12 p-5">
<div class="col-span-12 font-bold text-xl">Todays stats</div> <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"> Total Deliveries: {{ delivery_count }}</div>
<div class="col-span-6 py-2"> Completed: {{ delivery_count_delivered }} / {{ delivery_count }}</div>
</div>
</div>
</div> <div class="col-span-6 bg-neutral">
</div> <div class="grid grid-cols-12 p-5 bg-secondary">
<div class="col-span-6 bg-neutral" >
<div class="grid grid-cols-12 p-5 ">
<div class="col-span-12 font-bold text-xl">Todays Oil Price</div> <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"> 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"> Same Day: ${{ price_same_day }}</div>
<div class="col-span-12 py-2"> Prime: ${{prime}}</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> </div>
<div class="col-span-6 bg-neutral" > <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> </div>
</div> </div>
</div> </div>
<Footer/> <Footer />
</template> </template>
<script lang="ts"> <script lang="ts">
import {defineComponent} from 'vue' import { defineComponent } from 'vue'
import axios from 'axios' import axios from 'axios'
import authHeader from '../services/auth.header' import authHeader from '../services/auth.header'
import Header from '../layouts/headers/headerauth.vue' import Header from '../layouts/headers/headerauth.vue'
@@ -64,10 +72,12 @@ export default defineComponent({
return { return {
token: null, token: null,
delivery_count: 0, delivery_count: 0,
today_oil_price: '', delivery_count_delivered: 0,
same_day: '', price_from_supplier: 0,
prime: '', today_oil_price: 0,
out_of_oil: '', price_for_employee: 0,
price_same_day: 0,
price_prime: 0,
user: { user: {
user_id: 0, user_id: 0,
user_name: '', user_name: '',
@@ -148,7 +158,18 @@ export default defineComponent({
this.delivery_count = response.data.data; 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() { today_price_oil() {
let path = import.meta.env.VITE_BASE_URL + '/info/price/oil' let path = import.meta.env.VITE_BASE_URL + '/info/price/oil'
axios({ axios({
@@ -158,7 +179,12 @@ export default defineComponent({
headers: authHeader(), headers: authHeader(),
}) })
.then((response: any) => { .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> </script>
<style scoped> <style scoped></style>
</style>
<script setup lang="ts"> <script setup lang="ts">
</script> </script>

View File

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

View File

@@ -1,8 +1,8 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs">
@@ -28,6 +28,7 @@
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Account Number</th>
<th>Name</th> <th>Name</th>
<th>Town</th> <th>Town</th>
<th>Automatic</th> <th>Automatic</th>
@@ -38,7 +39,7 @@
<tbody> <tbody>
<!-- row 1 --> <!-- row 1 -->
<tr v-for="person in customers" :key="person['id']"> <tr v-for="person in customers" :key="person['id']">
<td>{{ person['account_number'] }}</td>
<td> <td>
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }"> <router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }">
{{ person['customer_first_name'] }} {{ person['customer_last_name'] }} {{ person['customer_first_name'] }} {{ person['customer_last_name'] }}
@@ -52,14 +53,17 @@
<td>{{ person['customer_phone_number'] }}</td> <td>{{ person['customer_phone_number'] }}</td>
<td class="flex gap-5"> <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 Oil
</router-link> </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 Edit
</router-link> </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 View
</router-link> </router-link>
<a @click.prevent="deleteCustomer(person['id'])" class="cursor-pointer underline hover:text-blue-300"> <a @click.prevent="deleteCustomer(person['id'])" class="cursor-pointer underline hover:text-blue-300">
@@ -71,8 +75,7 @@
</table> </table>
</div> </div>
<div class="flex justify-center" v-if="recordsLength > 9"> <div class="flex justify-center" v-if="recordsLength > 9">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" <pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
:options="options">
</pagination> </pagination>
<div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div> <div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div>
</div> </div>
@@ -80,11 +83,11 @@
</div> </div>
</div> </div>
<Footer/> <Footer />
</template> </template>
<script lang="ts"> <script lang="ts">
import {defineComponent} from 'vue' import { defineComponent } from 'vue'
import axios from 'axios' import axios from 'axios'
import authHeader from '../../services/auth.header' import authHeader from '../../services/auth.header'
@@ -175,6 +178,4 @@ export default defineComponent({
}) })
</script> </script>
<style scoped> <style scoped></style>
</style>

View File

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

View File

@@ -325,6 +325,21 @@ export default defineComponent({
.catch(() => { .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: { CreateOilOrder(payload: {
gallons_ordered: string; gallons_ordered: string;
customer_asked_for_fill: boolean; customer_asked_for_fill: boolean;
@@ -369,23 +384,14 @@ export default defineComponent({
credit_card_id: this.CreateOilOrderForm.basicInfo.userCards, credit_card_id: this.CreateOilOrderForm.basicInfo.userCards,
driver_employee_id: this.CreateOilOrderForm.basicInfo.driver_driver, driver_employee_id: this.CreateOilOrderForm.basicInfo.driver_driver,
}; };
this.CreateOilOrder(payload); if (this.CreateOilOrderForm.basicInfo.driver_driver == ''){
}, notify({
title: "Error",
text: "Did not add a driver",
getDriversList() { type: "error",
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(() => {
}); });
}
this.CreateOilOrder(payload);
}, },
}, },

View File

@@ -25,6 +25,7 @@
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Ticket id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th> <th>Town</th>
@@ -39,6 +40,8 @@
<tbody> <tbody>
<!-- row 1 --> <!-- 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['id'] }}</td>
<td>{{ oil['customer_name'] }} </td> <td>{{ oil['customer_name'] }} </td>
</router-link> </router-link>
<td> <td>

View File

@@ -1,9 +1,9 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs mb-10"> <div class="text-sm breadcrumbs mb-10">
@@ -21,7 +21,8 @@
</ul> </ul>
</div> </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]"> <div class="text-[24px]">
Finalize Oil Order # {{ deliveryOrder.id }} Finalize Oil Order # {{ deliveryOrder.id }}
</div> </div>
@@ -75,7 +76,7 @@
</div> </div>
<div class="col-span-6 "> <div class="col-span-6 ">
<div class="flex justify-end" v-if="deliveryOrder.id "> <div class="flex justify-end" v-if="deliveryOrder.id">
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }"> <router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
<button class="btn">Edit Order</button> <button class="btn">Edit Order</button>
</router-link> </router-link>
@@ -132,22 +133,22 @@
</div> </div>
<div class="grid grid-cols-12 bg-neutral p-5"> <div class="grid grid-cols-12 bg-neutral p-5">
<div class="col-span-12 font-bold"> <div class="col-span-12 font-bold">
<div v-if="deliveryOrder.customer_asked_for_fill==1">Fill</div> <div v-if="deliveryOrder.customer_asked_for_fill == 1">Fill</div>
<div v-else>Gallons delivered: {{ deliveryOrder.gallons_delivered }}</div> <div v-else>Gallons delivered: {{ deliveryOrder.gallons_delivered }}</div>
</div> </div>
<div class="col-span-12 font-bold"> <div class="col-span-12 font-bold">
<div v-if="deliveryOrder.prime==1"> <div v-if="deliveryOrder.prime == 1">
Prime Required: Yes Prime Required: Yes
</div> </div>
<div v-if="deliveryOrder.prime==0"> <div v-if="deliveryOrder.prime == 0">
Prime Required: No Prime Required: No
</div> </div>
</div> </div>
<div class="col-span-12 font-bold"> <div class="col-span-12 font-bold">
<div v-if="deliveryOrder.same_day==1"> <div v-if="deliveryOrder.same_day == 1">
Same Day: Yes Same Day: Yes
</div> </div>
<div v-if="deliveryOrder.same_day==0"> <div v-if="deliveryOrder.same_day == 0">
Same Day: No Same Day: No
</div> </div>
</div> </div>
@@ -160,12 +161,12 @@
</div> </div>
<div class="grid grid-cols-12 bg-neutral p-2"> <div class="grid grid-cols-12 bg-neutral p-2">
<div class="col-span-12 font-bold"> <div class="col-span-12 font-bold">
<div v-if="deliveryOrder.payment_type==0">Cash</div> <div v-if="deliveryOrder.payment_type == 0">Cash</div>
<div v-else-if="deliveryOrder.payment_type==1">Credit Card</div> <div v-else-if="deliveryOrder.payment_type == 1">Credit Card</div>
<div v-else-if="deliveryOrder.payment_type==2">Credit Card & cash</div> <div v-else-if="deliveryOrder.payment_type == 2">Credit Card & cash</div>
<div v-else>No Payment Type Added</div> <div v-else>No Payment Type Added</div>
</div> </div>
<div class="col-span-12" v-if="deliveryOrder.payment_type==1"> <div class="col-span-12" v-if="deliveryOrder.payment_type == 1">
<div class="flex"> <div class="flex">
<div class="basis-1/3 p-2"> <div class="basis-1/3 p-2">
<div class="bg-neutral rounded-md border-2 "> <div class="bg-neutral rounded-md border-2 ">
@@ -176,7 +177,7 @@
{{ userCard.name_on_card }} {{ userCard.name_on_card }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
****-****-****-{{ userCard.last_four_digits }} {{ userCard.card_number }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }} {{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
@@ -186,18 +187,18 @@
</div> </div>
</div> </div>
<div class="col-span-12" v-if="deliveryOrder.payment_type==2"> <div class="col-span-12" v-if="deliveryOrder.payment_type == 2">
<div class="flex"> <div class="flex">
<div class="basis-1/3 p-2"> <div class="basis-1/3 p-2">
<div class="bg-neutral rounded-md border-2 "> <div class="bg-neutral rounded-md border-2 ">
<div class="flex p-3"> <div class="flex p-3">
{{ userCard.type_of_card }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
{{ userCard.name_on_card }} {{ userCard.name_on_card }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
****-****-****-{{ userCard.last_four_digits }} {{ userCard.card_number }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }} {{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
@@ -206,68 +207,69 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-span-12 ">Total {{deliveryMoney.total_amount}}</div>
</div> </div>
</div> </div>
<div class="col-span-6 mt-5"> <div class="col-span-6 mt-5">
<div class="col-span-12 font-bold"> <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>
<form class="rounded-md bg-neutral " enctype="multipart/form-data" @submit.prevent="onSubmit"> <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="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"> <div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button <button class="btn">
class="btn">
Finalize Delivery Finalize Delivery
</button> </button>
</div> </div>
</div> </div>
</form> </form>
</div>
</div> </div>
</div> </div>
<Footer/> <Footer />
</template> </template>
<script lang="ts"> <script lang="ts">
import {defineComponent} from 'vue' import { defineComponent } from 'vue'
import axios from 'axios' import axios from 'axios'
import authHeader from '../../../services/auth.header' import authHeader from '../../../services/auth.header'
import Header from '../../../layouts/headers/headerauth.vue' import Header from '../../../layouts/headers/headerauth.vue'
import SideBar from '../../../layouts/sidebar/sidebar.vue' import SideBar from '../../../layouts/sidebar/sidebar.vue'
import Footer from '../../../layouts/footers/footer.vue' import Footer from '../../../layouts/footers/footer.vue'
import useValidate from "@vuelidate/core"; import useValidate from "@vuelidate/core";
import {notify} from "@kyvg/vue3-notification" import { notify } from "@kyvg/vue3-notification"
export default defineComponent({ export default defineComponent({
@@ -282,6 +284,7 @@ export default defineComponent({
data() { data() {
return { return {
v$: useValidate(), v$: useValidate(),
loaded: false,
user: { user: {
id: 0 id: 0
}, },
@@ -364,7 +367,19 @@ export default defineComponent({
driver_employee_id: 0, driver_employee_id: 0,
driver_first_name: '', driver_first_name: '',
driver_last_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: { watch: {
$route() { $route() {
this.sumdelivery(this.$route.params.id);
this.getOilOrder(this.$route.params.id); this.getOilOrder(this.$route.params.id);
this.getOilOrderMoney(this.$route.params.id); this.getOilPricing();
this.get_delivery_amount(this.$route.params.id);
}, },
}, },
mounted() { mounted() {
this.sumdelivery(this.$route.params.id);
this.getOilOrder(this.$route.params.id); this.getOilOrder(this.$route.params.id);
this.getOilOrderMoney(this.$route.params.id);
}, },
methods: { 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) { getCustomer(user_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/customer/" + user_id; let path = import.meta.env.VITE_BASE_URL + "/customer/" + user_id;
axios({ axios({
@@ -474,20 +478,50 @@ export default defineComponent({
}); });
}, },
getOilPricing() {
getOilOrderMoney(delivery_id: any) { let path = import.meta.env.VITE_BASE_URL + "/info/price/oil/table";
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/money/" + delivery_id;
axios({ axios({
method: "get", method: "get",
url: path, url: path,
withCredentials: true, withCredentials: true,
headers: authHeader(),
}) })
.then((response: any) => { .then((response: any) => {
if (response.data) { this.pricing = response.data;
this.deliveryMoney = 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: { editOilOrder(payload: {
@@ -513,7 +547,7 @@ export default defineComponent({
text: "Ticket is finalized", text: "Ticket is finalized",
type: "success", type: "success",
}); });
this.$router.push({name: "deliveryTicketsMissing"}); this.$router.push({ name: "deliveryTicketsMissing" });
} }
if (response.data.error) { if (response.data.error) {
notify({ notify({

View File

@@ -80,7 +80,7 @@
<div class="col-span-6 "> <div class="col-span-6 ">
<div class="flex justify-end" v-if="deliveryOrder.id "> <div class="flex justify-end" v-if="deliveryOrder.id ">
<router-link :to="{ name: 'deliveryEdit', params: { id: 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> </router-link>
</div> </div>
</div> </div>

View File

@@ -1,26 +1,27 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs pb-10">
<ul> <ul>
<li> <li>
<router-link :to="{ name: 'home' }"> <router-link :to="{ name: 'home' }">
Home Home
</router-link> </router-link>
</li> </li>
</ul> </ul>
</div> </div>
<div class="flex justify-end">
<div class="flex start pb-10">Cancelled Deliveries </div>
<div class="flex justify-start pb-5">
</div> </div>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<div class="flex start">Cancelled Deliveries</div> <div class="flex start"> </div>
<table class="table"> <table class="table">
<!-- head --> <!-- head -->
<thead> <thead>
@@ -75,12 +76,12 @@
<td class="flex gap-5"> <td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }"> <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>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }"> <router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button> <button class="btn btn-accent">Edit</button>
</router-link> </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> </td>
</tr> </tr>
</tbody> </tbody>

View File

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

View File

@@ -1,30 +1,32 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs pb-10">
<ul> <ul>
<li> <li>
<router-link :to="{ name: 'home' }"> <router-link :to="{ name: 'home' }">
Home Home
</router-link> </router-link>
</li> </li>
</ul> </ul>
</div> </div>
<div class="flex justify-end">
<div class="flex start pb-10">Finalized Delivery </div>
<div class="flex justify-start pb-5">
</div> </div>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<div class="flex start">Finalized Deliveries</div>
<table class="table"> <table class="table">
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Ticket Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th> <th>Town</th>
@@ -38,7 +40,9 @@
</thead> </thead>
<tbody> <tbody>
<!-- row 1 --> <!-- 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> <td>{{ oil['customer_name'] }} </td>
</router-link> </router-link>
<td> <td>
@@ -73,12 +77,12 @@
<td class="flex gap-5"> <td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }"> <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>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }"> <router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button> <button class="btn btn-accent">Edit</button>
</router-link> </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> </td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -1,34 +1,35 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs pb-10">
<ul> <ul>
<li> <li>
<router-link :to="{ name: 'home' }"> <router-link :to="{ name: 'home' }">
Home Home
</router-link> </router-link>
</li> </li>
</ul> </ul>
</div> </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>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<div class="flex start">Issue with Delivery</div>
<table class="table"> <table class="table">
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Ticket Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th> <th>Town</th>
<th>Address</th> <th>Address</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
@@ -39,7 +40,9 @@
</thead> </thead>
<tbody> <tbody>
<!-- row 1 --> <!-- 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> <td>{{ oil['customer_name'] }} </td>
</router-link> </router-link>
<td> <td>
@@ -75,12 +78,12 @@
<td class="flex gap-5"> <td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }"> <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>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }"> <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> </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> </td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -1,30 +1,35 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs pb-10">
<ul> <ul>
<li> <li>
<router-link :to="{ name: 'home' }"> <router-link :to="{ name: 'home' }">
Home Home
</router-link> </router-link>
</li> </li>
</ul> </ul>
</div> </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>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<div class="flex start">Out for Delivery </div>
<table class="table"> <table class="table">
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Delivery Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th> <th>Town</th>
@@ -38,7 +43,12 @@
</thead> </thead>
<tbody> <tbody>
<!-- row 1 --> <!-- 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> <td>{{ oil['customer_name'] }} </td>
</router-link> </router-link>
<td> <td>
@@ -74,38 +84,43 @@
<td class="flex gap-5"> <td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }"> <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>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }"> <router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button> <button class="btn btn-accent">Edit</button>
</router-link> </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> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="flex justify-center" v-if="recordsLength > 9"> <div class="flex justify-center" v-if="recordsLength > 9">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" <pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
:options="options">
</pagination> </pagination>
<div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div> <div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div>
</div> </div>
</div> </div>
</div> </div>
<Footer/> <Footer />
</template> </template>
<script lang="ts"> <script lang="ts">
import {defineComponent} from 'vue' import { defineComponent } from 'vue'
import axios from 'axios' import axios from 'axios'
import authHeader from '../../../services/auth.header' import authHeader from '../../../services/auth.header'
import Header from '../../../layouts/headers/headerauth.vue' import Header from '../../../layouts/headers/headerauth.vue'
import PaginationComp from '../../../components/pagination.vue' import PaginationComp from '../../../components/pagination.vue'
import SideBar from '../../../layouts/sidebar/sidebar.vue' import SideBar from '../../../layouts/sidebar/sidebar.vue'
import Footer from '../../../layouts/footers/footer.vue' import Footer from '../../../layouts/footers/footer.vue'
import {notify} from "@kyvg/vue3-notification"; import { notify } from "@kyvg/vue3-notification";
export default defineComponent({ export default defineComponent({
name: 'deliveryOutForDelivery', name: 'deliveryOutForDelivery',
@@ -131,16 +146,15 @@ export default defineComponent({
} }
} }
}, },
created() { created() {
this.userStatus() this.userStatus()
this.updatestatus();
}, },
mounted() { mounted() {
this.getPage(this.page) this.getPage(this.page)
}, },
methods: { methods: {
getPage: function (page: any) { getPage: function (page: any) {
// we simulate an api call that fetch the records from a backend
this.deliveries = []; this.deliveries = [];
this.get_oil_orders(page) this.get_oil_orders(page)
}, },
@@ -161,6 +175,23 @@ export default defineComponent({
this.user = null 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) { get_oil_orders(page: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/outfordelivery/' + page; let path = import.meta.env.VITE_BASE_URL + '/delivery/outfordelivery/' + page;
axios({ axios({
@@ -171,6 +202,7 @@ export default defineComponent({
this.deliveries = response.data this.deliveries = response.data
}) })
}, },
deleteCall(delivery_id: any) { deleteCall(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id; let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
axios({ 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> </script>
<style scoped> <style scoped></style>
</style>

View File

@@ -1,30 +1,34 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs pb-10">
<ul> <ul>
<li> <li>
<router-link :to="{ name: 'home' }"> <router-link :to="{ name: 'home' }">
Home Home
</router-link> </router-link>
</li> </li>
</ul> </ul>
</div> </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>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<div class="flex start">Tommorrows Deliveries </div> <div class="flex start"> </div>
<table class="table"> <table class="table">
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Ticket Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th> <th>Town</th>
@@ -39,7 +43,9 @@
<tbody> <tbody>
<!-- row 1 --> <!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']"> <tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }} </td>
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['customer_name'] }} </td> <td>{{ oil['customer_name'] }} </td>
</router-link> </router-link>
<td> <td>
@@ -75,40 +81,44 @@
<td class="flex gap-5"> <td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }"> <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>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }"> <router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button> <button class="btn btn-accent">Edit</button>
</router-link> </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> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="flex justify-center" v-if="recordsLength > 9"> <div class="flex justify-center" v-if="recordsLength > 9">
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" <pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
:options="options">
</pagination> </pagination>
<div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div> <div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div>
</div> </div>
</div> </div>
</div> </div>
<Footer/> <Footer />
</template> </template>
<script lang="ts"> <script lang="ts">
import {defineComponent} from 'vue' import { defineComponent } from 'vue'
import axios from 'axios' import axios from 'axios'
import authHeader from '../../../services/auth.header' import authHeader from '../../../services/auth.header'
import Header from '../../../layouts/headers/headerauth.vue' import Header from '../../../layouts/headers/headerauth.vue'
import PaginationComp from '../../../components/pagination.vue' import PaginationComp from '../../../components/pagination.vue'
import SideBar from '../../../layouts/sidebar/sidebar.vue' import SideBar from '../../../layouts/sidebar/sidebar.vue'
import Footer from '../../../layouts/footers/footer.vue' import Footer from '../../../layouts/footers/footer.vue'
import {notify} from "@kyvg/vue3-notification"; import { notify } from "@kyvg/vue3-notification";
export default defineComponent({ export default defineComponent({
name: 'deliveryOutForDelivery', name: 'deliveryOutForDelivery',
components: { components: {
@@ -132,7 +142,6 @@
} }
} }
}, },
created() { created() {
this.userStatus() this.userStatus()
}, },
@@ -141,7 +150,6 @@
}, },
methods: { methods: {
getPage: function (page: any) { getPage: function (page: any) {
// we simulate an api call that fetch the records from a backend
this.deliveries = []; this.deliveries = [];
this.get_oil_orders(page) this.get_oil_orders(page)
}, },
@@ -172,6 +180,7 @@
this.deliveries = response.data this.deliveries = response.data
}) })
}, },
deleteCall(delivery_id: any) { deleteCall(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id; let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
axios({ 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",
});
}
}) })
</script> },
<style scoped> 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",
});
}
})
},
},
</style>
})
</script>

View File

@@ -1,34 +1,36 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10 "> <div class=" w-full px-10 ">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs pb-10">
<ul> <ul>
<li> <li>
<router-link :to="{ name: 'home' }"> <router-link :to="{ name: 'home' }">
Home Home
</router-link> </router-link>
</li> </li>
</ul> </ul>
</div> </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>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<div class="flex start">Waiting Deliveries</div>
<table class="table"> <table class="table">
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Ticket Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th> <th>Town</th>
<th>Address</th> <th>Address</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
@@ -39,7 +41,9 @@
</thead> </thead>
<tbody> <tbody>
<!-- row 1 --> <!-- 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> <td>{{ oil['customer_name'] }} </td>
</router-link> </router-link>
<td> <td>
@@ -75,12 +79,13 @@
<td class="flex gap-5"> <td class="flex gap-5">
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }"> <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>
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }"> <router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button> <button class="btn btn-accent">Edit</button>
</router-link> </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> </td>
</tr> </tr>
</tbody> </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> </script>

View File

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

View File

@@ -1,8 +1,8 @@
<template> <template>
<Header/> <Header />
<div class="flex"> <div class="flex">
<div class=""> <div class="">
<SideBar/> <SideBar />
</div> </div>
<div class=" w-full px-10"> <div class=" w-full px-10">
<div class="text-sm breadcrumbs"> <div class="text-sm breadcrumbs">
@@ -18,15 +18,15 @@
</div> </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]"> <div class=" col-span-12 text-[24px]">
Confirm Payment Oil Delivery {{ delivery.id }} Confirm Payment Oil Delivery {{ delivery.id }}
</div> </div>
<div class="grid grid-cols-12 bg-neutral mb-5"> <div class="grid grid-cols-12 bg-neutral mb-5">
<div class="col-span-12 font-bold flex pb-5 text-lg">
<div class="col-span-12 font-bold flex pb-5 text-lg">{{ customer.account_number }}</div> {{ customer.account_number }}
</div>
<div class="col-span-12 font-bold flex"> <div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }} {{ customer.customer_first_name }}
{{ customer.customer_last_name }} {{ customer.customer_last_name }}
@@ -141,43 +141,66 @@
<div v-else> Gallons Ordered: {{ delivery.gallons_ordered }}</div> <div v-else> Gallons Ordered: {{ delivery.gallons_ordered }}</div>
</div> </div>
<div class="col-span-12 py-3" v-if="delivery.prime == 1"> <div class="col-span-12 py-3" v-if="delivery.prime == 1">
Prime Fee: {{ delivery.prime }} Prime Fee: {{ pricing.price_prime }}
</div> </div>
<div class="col-span-12 py-3" v-if="delivery.same_day == 1"> <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>
<div class="col-span-12 font-bold py-5 text-lg">Total: {{ delivery.total_price }}</div>
</div> </div>
</div> </div>
<div class="flex justify-between"> <div class="flex justify-between">
<!-- <button class="btn" @click="checkoutOilCreditStripe()">--> <!-- <button class="btn" @click="checkoutOilCreditStripe()">-->
<!-- Pay Credit Card (Stripe)--> <!-- Pay Credit Card (Stripe)-->
<!-- </button>--> <!-- </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 Cash Payment
</button> </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 Pay Credit Terminal
</button> </button>
</div> </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> </div>
<Footer/> </div>
</div>
<Footer />
</template> </template>
<script lang="ts"> <script lang="ts">
import {defineComponent} from 'vue' import { defineComponent } from 'vue'
import axios from 'axios' import axios from 'axios'
import authHeader from '../../services/auth.header' import authHeader from '../../services/auth.header'
import Header from '../../layouts/headers/headerauth.vue' import Header from '../../layouts/headers/headerauth.vue'
import SideBar from '../../layouts/sidebar/sidebar.vue' import SideBar from '../../layouts/sidebar/sidebar.vue'
import Footer from '../../layouts/footers/footer.vue' import Footer from '../../layouts/footers/footer.vue'
import useValidate from "@vuelidate/core"; import useValidate from "@vuelidate/core";
import {notify} from "@kyvg/vue3-notification" import { notify } from "@kyvg/vue3-notification"
import {minLength, required} from "@vuelidate/validators"; import { minLength, required } from "@vuelidate/validators";
export default defineComponent({ export default defineComponent({
name: 'PayOil', name: 'PayOil',
@@ -191,6 +214,7 @@ export default defineComponent({
data() { data() {
return { return {
v$: useValidate(), v$: useValidate(),
loaded: false,
user: { user: {
user_id: 0, user_id: 0,
}, },
@@ -241,6 +265,7 @@ export default defineComponent({
} }
], ],
stripe: null, stripe: null,
customer: { customer: {
id: 0, id: 0,
@@ -256,14 +281,25 @@ export default defineComponent({
customer_phone_number: '', customer_phone_number: '',
account_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() { validations() {
return { return {
CreateOilOrderForm: { CreateOilOrderForm: {
basicInfo: { basicInfo: {
gallons_ordered: {required, minLength: minLength(1)}, gallons_ordered: { required, minLength: minLength(1) },
expected_delivery_date: {required}, expected_delivery_date: { required },
}, },
}, },
}; };
@@ -279,10 +315,28 @@ export default defineComponent({
}, },
mounted() { mounted() {
this.getOilOrder(this.$route.params.id) this.getOilOrder(this.$route.params.id)
this.getOilPricing()
// this.getStripePublishableKey(); // this.getStripePublishableKey();
}, },
methods: { 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() { userStatus() {
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami'; let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
axios({ 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) { getOilOrder(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/" + delivery_id; let path = import.meta.env.VITE_BASE_URL + "/delivery/order/" + delivery_id;
axios({ axios({
@@ -387,7 +462,7 @@ export default defineComponent({
type: "success", type: "success",
}); });
} }
this.$router.push({name: "customerProfile", params: {id: this.customer.id}}); this.$router.push({ name: "customerProfile", params: { id: this.customer.id } });
} }
}) })
.catch(() => { .catch(() => {

View File

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