switch non-working features to have notifications

This commit is contained in:
Casey 2025-12-02 09:58:29 -06:00
parent 0bad4dbc95
commit 77fce34c05
7 changed files with 35 additions and 20 deletions

View File

@ -3,19 +3,13 @@ import frappe
def after_insert(doc, method): def after_insert(doc, method):
try: try:
print("DEBUG: after_insert hook triggered for Quotation:", doc.name) print("DEBUG: after_insert hook triggered for Quotation:", doc.name)
print("DEBUG: custom_installation_address:", doc.custom_installation_address)
if not doc.custom_installation_address: if not doc.custom_installation_address:
print("ERROR: custom_installation_address is empty") print("ERROR: custom_installation_address is empty")
return return
address_doc = frappe.get_doc("Address", doc.custom_installation_address) address_doc = frappe.get_doc("Address", doc.custom_installation_address)
print("DEBUG: Retrieved address document:", address_doc.name)
address_doc.custom_estimate_sent_status = "In Progress" address_doc.custom_estimate_sent_status = "In Progress"
address_doc.save() address_doc.save()
print("DEBUG: Address status updated successfully") print("DEBUG: Address status updated successfully")
except Exception as e: except Exception as e:
print("ERROR in after_insert hook:", str(e)) print("ERROR in after_insert hook:", str(e))
frappe.log_error(f"Error in estimate after_insert: {str(e)}", "Estimate Hook Error") frappe.log_error(f"Error in estimate after_insert: {str(e)}", "Estimate Hook Error")

View File

@ -1,7 +1,8 @@
import frappe import frappe
def after_insert(doc, method): def after_insert(doc, method):
print(doc.address) print("DEBUG: After Insert Triggered for On-Site Meeting")
print("DEBUG: Updating on-site meeting status in Address")
if doc.address and not doc.end_time and not doc.start_time: if doc.address and not doc.end_time and not doc.start_time:
address_doc = frappe.get_doc("Address", doc.address) address_doc = frappe.get_doc("Address", doc.address)
address_doc.custom_onsite_meeting_scheduled = "In Progress" address_doc.custom_onsite_meeting_scheduled = "In Progress"

View File

@ -6,6 +6,15 @@ from .utils import create_module
def after_install(): def after_install():
create_module() create_module()
add_custom_fields() add_custom_fields()
update_onsite_meeting_fields()
frappe.db.commit()
# Proper way to refresh metadata
frappe.clear_cache(doctype="Address")
frappe.reload_doctype("Address")
frappe.clear_cache(doctype="On-Site Meeting")
frappe.reload_doctype("On-Site Meeting")
update_address_fields()
build_frontend() build_frontend()
def after_migrate(): def after_migrate():

View File

@ -2,6 +2,7 @@
import { ref } from "vue"; import { ref } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useModalStore } from "@/stores/modal"; import { useModalStore } from "@/stores/modal";
import { useNotificationStore } from "@/stores/notifications-primevue"
import { import {
Home, Home,
Community, Community,
@ -22,21 +23,13 @@ import SpeedDial from "primevue/speeddial";
const router = useRouter(); const router = useRouter();
const modalStore = useModalStore(); const modalStore = useModalStore();
const notifications = useNotificationStore();
const isCollapsed = ref(false); const isCollapsed = ref(false);
const toggleSidebar = () => { const toggleSidebar = () => {
isCollapsed.value = !isCollapsed.value; isCollapsed.value = !isCollapsed.value;
}; };
const developmentButtons = ref([
{
label: "Error Handling Demo",
command: () => {
router.push("/dev/error-handling-demo");
},
},
]);
const createButtons = ref([ const createButtons = ref([
{ {
label: "Client", label: "Client",
@ -61,19 +54,22 @@ const createButtons = ref([
label: "Job", label: "Job",
command: () => { command: () => {
//frappe.new_doc("Job"); //frappe.new_doc("Job");
modalStore.openModal("createJob"); // modalStore.openModal("createJob");
notifications.addWarning("Job creation coming soon!");
}, },
}, },
{ {
label: "Invoice", label: "Invoice",
command: () => { command: () => {
modalStore.openModal("createInvoice"); // modalStore.openModal("createInvoice");
notifications.addWarning("Invoice creation coming soon!");
}, },
}, },
{ {
label: "Warranty Claim", label: "Warranty Claim",
command: () => { command: () => {
modalStore.openModal("createWarranty"); // modalStore.openModal("createWarranty");
notifications.addWarning("Warranty Claim creation coming soon!");
}, },
}, },
]); ]);
@ -97,6 +93,9 @@ const categories = ref([
// { name: "Development", icon: Developer, buttons: developmentButtons }, // { name: "Development", icon: Developer, buttons: developmentButtons },
]); ]);
const handleCategoryClick = (category) => { const handleCategoryClick = (category) => {
if (category.url === "/invoices") {
notifications.addWarning("Invoices data table view coming soon!");
}
router.push(category.url); router.push(category.url);
}; };
</script> </script>

View File

@ -307,6 +307,9 @@
<script setup> <script setup>
import { ref, onMounted, computed } from "vue"; import { ref, onMounted, computed } from "vue";
import Api from "../../api"; import Api from "../../api";
import { useNotificationStore } from "../../stores/notifications-primevue";
const notifications = useNotificationStore();
// Reactive data // Reactive data
const services = ref([]); const services = ref([]);
@ -788,6 +791,7 @@ const handleUnscheduledDrop = (event) => {
// Lifecycle // Lifecycle
onMounted(async () => { onMounted(async () => {
notifications.addWarning("Calendar is currently in development. Many features are placeholders. UPDATES COMING SOON!");
try { try {
const data = await Api.getServiceData(); const data = await Api.getServiceData();
services.value = data; services.value = data;

View File

@ -206,19 +206,21 @@
</template> </template>
<script setup> <script setup>
import { ref, computed } from "vue"; import { ref, computed, onMounted } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import Card from "primevue/card"; import Card from "primevue/card";
import Button from "primevue/button"; import Button from "primevue/button";
import Tag from "primevue/tag"; import Tag from "primevue/tag";
import { Calendar, Community, Hammer, PathArrowSolid, Clock, HistoricShield } from "@iconoir/vue"; import { Calendar, Community, Hammer, PathArrowSolid, Clock, HistoricShield } from "@iconoir/vue";
import DataUtils from "../../utils.js"; import DataUtils from "../../utils.js";
import { useNotificationStore } from "../../stores/notifications-primevue";
const router = useRouter(); const router = useRouter();
// Dummy data from utils // Dummy data from utils
const clientData = ref(DataUtils.dummyClientData); const clientData = ref(DataUtils.dummyClientData);
const jobData = ref(DataUtils.dummyJobData); const jobData = ref(DataUtils.dummyJobData);
const notifications = useNotificationStore();
// Computed values for dashboard metrics // Computed values for dashboard metrics
const totalRevenue = computed(() => "$47,250"); const totalRevenue = computed(() => "$47,250");
@ -231,6 +233,9 @@ const avgResponseTime = computed(() => 2.3);
const navigateTo = (path) => { const navigateTo = (path) => {
router.push(path); router.push(path);
}; };
onMounted(() => {
notifications.addWarning("Dashboard metrics are based on dummy data for demonstration purposes. UPDATES COMING SOON!");
});
</script> </script>
<style scoped> <style scoped>

View File

@ -379,7 +379,9 @@ import { FilterMatchMode } from "@primevue/core";
import { useLoadingStore } from "../../stores/loading"; import { useLoadingStore } from "../../stores/loading";
import { usePaginationStore } from "../../stores/pagination"; import { usePaginationStore } from "../../stores/pagination";
import { useFiltersStore } from "../../stores/filters"; import { useFiltersStore } from "../../stores/filters";
import { useNotificationStore } from "../../stores/notifications-primevue";
const notifications = useNotificationStore();
const loadingStore = useLoadingStore(); const loadingStore = useLoadingStore();
const paginationStore = usePaginationStore(); const paginationStore = usePaginationStore();
const filtersStore = useFiltersStore(); const filtersStore = useFiltersStore();
@ -754,6 +756,7 @@ const formatDate = (dateString) => {
// Load data on component mount // Load data on component mount
onMounted(async () => { onMounted(async () => {
notifications.addWarning("Timesheets page coming soon!");
try { try {
// Initialize pagination and filters // Initialize pagination and filters
paginationStore.initializeTablePagination("timesheets", { rows: 10 }); paginationStore.initializeTablePagination("timesheets", { rows: 10 });