diff --git a/AntPos/dev-dist/sw.js b/AntPos/dev-dist/sw.js
index 2d9f84a..947f76d 100644
--- a/AntPos/dev-dist/sw.js
+++ b/AntPos/dev-dist/sw.js
@@ -82,7 +82,7 @@ define(['./workbox-f8c404e3'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
- "revision": "0.vleiuho4npo"
+ "revision": "0.jf6sfepm51g"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
diff --git a/AntPos/dev-dist/sw.js.map b/AntPos/dev-dist/sw.js.map
index 19d64f5..fc25178 100644
--- a/AntPos/dev-dist/sw.js.map
+++ b/AntPos/dev-dist/sw.js.map
@@ -1 +1 @@
-{"version":3,"file":"sw.js","sources":["../../../../../../../../../../tmp/8c873393ca0db409b53a3e16f4042166/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"registerSW.js\",\n \"revision\": \"3ca0b8505b4bec776b69afdba2768812\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"0.vleiuho4npo\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\"), {\n allowlist: [/^\\/$/],\n \n}));\n\n\nworkbox_routing_registerRoute(({ url }) => url.origin === self.location.origin && url.pathname.startsWith(\"/api/\"), new workbox_strategies_NetworkOnly(), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","allowlist","url","origin","location","pathname","startsWith","workbox_strategies_NetworkOnly"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBAA,CAAI,CAAA,CAAA,CAAA,CAACC,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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AA,CAAC,CAAE,CAAA,CAAA,CAAA,CAAA,CAAIC,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA;;"}
\ No newline at end of file
+{"version":3,"file":"sw.js","sources":["../../../../../../../../../../tmp/5cc94416934eb0c4c9b382fea23af015/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/nihal/project/anther/formost/antpos/frappe-bench/apps/ant_pos/AntPos/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"registerSW.js\",\n \"revision\": \"3ca0b8505b4bec776b69afdba2768812\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"0.jf6sfepm51g\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\"), {\n allowlist: [/^\\/$/],\n \n}));\n\n\nworkbox_routing_registerRoute(({ url }) => url.origin === self.location.origin && url.pathname.startsWith(\"/api/\"), new workbox_strategies_NetworkOnly(), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","allowlist","url","origin","location","pathname","startsWith","workbox_strategies_NetworkOnly"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBAA,CAAI,CAAA,CAAA,CAAA,CAACC,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA;AAElBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAyB,EAAE,CAAA;;AAG3B,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CA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of file
diff --git a/AntPos/src/App.vue b/AntPos/src/App.vue
index 4f33529..2695f54 100644
--- a/AntPos/src/App.vue
+++ b/AntPos/src/App.vue
@@ -19,18 +19,17 @@
diff --git a/AntPos/src/components/Customer.vue b/AntPos/src/components/Customer.vue
index c85c1f5..7c08070 100644
--- a/AntPos/src/components/Customer.vue
+++ b/AntPos/src/components/Customer.vue
@@ -12,18 +12,28 @@
import { computed, inject, onMounted, onUnmounted } from 'vue';
import emitter from '@/utils/emitter';
import Autocomplete from '@/components/custom_components/Autocomplete.vue';
-import { createListResource } from 'frappe-ui';
+import { createListResource,createResource } from 'frappe-ui';
import { createToast } from '@/utils';
+import { usePosProfileStore } from '@/stores/posProfile';
let base = inject('base');
let errorHandled = false;
+const getCustomerGroups = computed(()=>{
+ if (!usePosProfileStore().posProfileData?.customer_groups){
+ return []
+ }
+ return usePosProfileStore().posProfileData?.customer_groups.map(item=>item.customer_group);
+
+})
+
const customerResource = createListResource({
doctype: 'Customer',
fields: ['name', 'mobile_no','customer_group','territory','is_internal_customer'],
filters: {
disabled: false,
},
+ orFilters: getCustomerGroups.value.length>0?[['customer_group', 'in', getCustomerGroups.value]]:[],
pageLength: Number.MAX_VALUE * 2,
auto: true,
onSuccess(data) {
diff --git a/AntPos/src/components/Dialog/Held.vue b/AntPos/src/components/Dialog/Held.vue
index e1fc9cc..3f9631d 100644
--- a/AntPos/src/components/Dialog/Held.vue
+++ b/AntPos/src/components/Dialog/Held.vue
@@ -71,12 +71,16 @@ import { Dialog, Button, createListResource, createResource, TextInput, FeatherI
import { ref, inject, computed, watch } from 'vue';
import { createToast } from '@/utils';
import { usePosProfileStore } from '@/stores/posProfile';
+import { usePermissionStore } from '@/stores/permissionStore';
+import { usersStore } from '@/stores/users';
const store = usePosProfileStore();
let base = inject('base');
const dialogVisible = ref(true);
const selectedInvoice = ref(null);
const searchQuery = ref("");
+const permissionStore = usePermissionStore();
+const user = usersStore().getUser();
let errorHandled = false;
const selectedPageLength = ref(20);
const handleDialogClose = () => { dialogVisible.value = false; };
@@ -199,7 +203,8 @@ const invoices = createListResource({
orderBy: 'creation desc',
filters: {
docstatus: 0,
- pos_profile: store.posProfileData.name,
+ pos_profile: store.posProfileData.name,
+ owner: permissionStore.salesInvoiceCanOnlyOwn ? user.name : undefined,
},
orFilters: [],
pageLength: 20,
diff --git a/AntPos/src/components/Dialog/Return.vue b/AntPos/src/components/Dialog/Return.vue
index 53cce81..94c7cb9 100644
--- a/AntPos/src/components/Dialog/Return.vue
+++ b/AntPos/src/components/Dialog/Return.vue
@@ -68,9 +68,11 @@
+import { usePermissionStore } from '@/stores/permissionStore';
+import { onBeforeMount } from 'vue';
+import { useRouter } from 'vue-router';
+
+const router = useRouter();
+const permissionStore = usePermissionStore();
+
+onBeforeMount(() => {
+ if (
+ !permissionStore.paymentEntryCanSubmit &&
+ !permissionStore.paymentEntryCanCreate &&
+ !permissionStore.paymentEntryCanPrint
+ ) {
+ if (window.history.length > 1) {
+ router.go(-1); // Go back
+ } else {
+ router.push('/'); // Fallback to homepage
+ }
+ }
+});
+
\ No newline at end of file
diff --git a/AntPos/src/router.js b/AntPos/src/router.js
index 842b804..9e999ef 100644
--- a/AntPos/src/router.js
+++ b/AntPos/src/router.js
@@ -1,6 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router'
-import { useSessionStore } from './data/session'
-import { userResource } from './data/user'
+import { useSessionStore } from './stores/session'
+import { userResource } from './stores/user'
const routes = [
{
diff --git a/AntPos/src/stores/permissionStore.js b/AntPos/src/stores/permissionStore.js
new file mode 100644
index 0000000..1cbb9e2
--- /dev/null
+++ b/AntPos/src/stores/permissionStore.js
@@ -0,0 +1,64 @@
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+import { createResource } from 'frappe-ui'
+
+export const usePermissionStore = defineStore('permissionStore', () => {
+ const salesInvoiceCanSubmit = ref(false)
+ const salesInvoiceCanCreate = ref(false)
+ const salesInvoiceCanPrint = ref(false)
+ const salesInvoiceCanOnlyOwn = ref(false)
+
+ // Payment Entry
+ const paymentEntryCanSubmit = ref(false)
+ const paymentEntryCanCreate = ref(false)
+ const paymentEntryCanPrint = ref(false)
+ const paymentEntryCanOnlyOwn = ref(false)
+
+ // Sales Order
+ const salesOrderCanSubmit = ref(false)
+ const salesOrderCanCreate = ref(false)
+ const salesOrderCanPrint = ref(false)
+ const salesOrderCanOnlyOwn = ref(false)
+
+ const permissionResource = createResource({
+ url: 'ant_pos.ant_pos.api.get_user_permissions',
+ method: 'GET',
+ auto: false,
+ onSuccess(data) {
+ if (data) {
+ salesInvoiceCanSubmit.value = data.sales_invoice.can_submit
+ salesInvoiceCanCreate.value = data.sales_invoice.can_create
+ salesInvoiceCanPrint.value = data.sales_invoice.can_print
+ salesInvoiceCanOnlyOwn.value = data.sales_invoice.has_own_docs
+
+ paymentEntryCanSubmit.value = data.payment_entry.can_submit
+ paymentEntryCanCreate.value = data.payment_entry.can_create
+ paymentEntryCanPrint.value = data.payment_entry.can_print
+ paymentEntryCanOnlyOwn.value = data.payment_entry.has_own_docs
+
+ salesOrderCanSubmit.value = data.sales_order.can_submit
+ salesOrderCanCreate.value = data.sales_order.can_create
+ salesOrderCanPrint.value = data.sales_order.can_print
+ salesOrderCanOnlyOwn.value = data.sales_order.has_own_docs
+ }
+ },
+ onError(err) {
+ console.error('Error fetching permissions', err)
+ },
+ })
+
+ function refresh() {
+ return permissionResource.reload()
+ }
+
+ function fetchPermissions() {
+ return permissionResource.fetch()
+ }
+
+ return {
+ salesInvoiceCanSubmit, salesInvoiceCanCreate, salesInvoiceCanPrint,salesInvoiceCanOnlyOwn,
+ paymentEntryCanSubmit, paymentEntryCanCreate, paymentEntryCanPrint,paymentEntryCanOnlyOwn,
+ salesOrderCanSubmit, salesOrderCanCreate, salesOrderCanPrint,salesOrderCanOnlyOwn,
+ refresh, fetchPermissions
+ }
+})
\ No newline at end of file
diff --git a/AntPos/src/stores/posProfile.js b/AntPos/src/stores/posProfile.js
index 4d42842..28e6f22 100644
--- a/AntPos/src/stores/posProfile.js
+++ b/AntPos/src/stores/posProfile.js
@@ -11,7 +11,7 @@ export const usePosProfileStore = defineStore('posProfile', () => {
const posProfile = createResource({
url: 'ant_pos.ant_pos.api.pos_profile.get_openingshift',
method: 'GET',
- auto: true,
+ auto: false,
onSuccess(data) {
if (data && data.pos_profile && data.Ant_Opening_Shift){
posProfileData.value = data.pos_profile
diff --git a/AntPos/src/data/session.js b/AntPos/src/stores/session.js
similarity index 71%
rename from AntPos/src/data/session.js
rename to AntPos/src/stores/session.js
index 61c6d3f..b557756 100644
--- a/AntPos/src/data/session.js
+++ b/AntPos/src/stores/session.js
@@ -1,10 +1,16 @@
import { defineStore } from 'pinia'
import { createResource } from 'frappe-ui'
-import { userResource } from '@/data/user'
+import { userResource } from '@/stores/user'
import router from '@/router'
import { ref, computed } from 'vue'
+import { usePosProfileStore } from '@/stores/posProfile'
+import { usePermissionStore } from '@/stores/permissionStore';
export const useSessionStore = defineStore('antpos-session', () => {
+
+ const permissionStore = usePermissionStore();
+ const posProfileStore = usePosProfileStore()
+
function sessionUser() {
let cookies = new URLSearchParams(document.cookie.split('; ').join('&'))
let _sessionUser = cookies.get('user_id')
@@ -17,6 +23,12 @@ export const useSessionStore = defineStore('antpos-session', () => {
let user = ref(sessionUser())
const isLoggedIn = computed(() => !!user.value)
+ function initializeSession() {
+ if (isLoggedIn.value) {
+ permissionStore.fetchPermissions()
+ posProfileStore.fetchPosProfile()
+ }
+ }
const login = createResource({
url: 'login',
makeParams({ email, password }) {
@@ -31,6 +43,7 @@ export const useSessionStore = defineStore('antpos-session', () => {
onSuccess() {
userResource.reload()
user.value = sessionUser()
+ initializeSession()
login.reset()
router.replace({ path: '/' })
},
@@ -45,6 +58,7 @@ export const useSessionStore = defineStore('antpos-session', () => {
},
})
+ initializeSession()
return {
user,
isLoggedIn,
@@ -52,3 +66,4 @@ export const useSessionStore = defineStore('antpos-session', () => {
logout,
}
})
+
diff --git a/AntPos/src/data/user.js b/AntPos/src/stores/user.js
similarity index 100%
rename from AntPos/src/data/user.js
rename to AntPos/src/stores/user.js
diff --git a/AntPos/src/data/users.js b/AntPos/src/stores/users.js
similarity index 92%
rename from AntPos/src/data/users.js
rename to AntPos/src/stores/users.js
index ef512e0..fe76b46 100644
--- a/AntPos/src/data/users.js
+++ b/AntPos/src/stores/users.js
@@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import { createResource } from 'frappe-ui'
-import { useSessionStore } from '@/data/session'
+import { useSessionStore } from '@/stores/session'
import { reactive } from 'vue'
import { useRouter } from 'vue-router'
@@ -32,6 +32,9 @@ export const usersStore = defineStore('antpos-users', () => {
})
function getUser(email) {
+ if (!session.isLoggedIn) {
+ return null
+ }
if (!email || email === 'sessionUser') {
email = session.user
}
diff --git a/AntPos/src/translation.js b/AntPos/src/translation.js
new file mode 100644
index 0000000..a55767c
--- /dev/null
+++ b/AntPos/src/translation.js
@@ -0,0 +1,47 @@
+import { createResource } from 'frappe-ui'
+
+export default function translationPlugin(app) {
+ app.config.globalProperties.__ = translate
+ window.__ = translate
+ if (!window.translatedMessages) fetchTranslations()
+}
+
+function format(message, replace) {
+ return message.replace(/{(\d+)}/g, function (match, number) {
+ return typeof replace[number] != 'undefined' ? replace[number] : match
+ })
+}
+
+function translate(message, replace, context = null) {
+ let translatedMessages = window.translatedMessages || {}
+ let translatedMessage = ''
+
+ if (context) {
+ let key = `${message}:${context}`
+ if (translatedMessages[key]) {
+ translatedMessage = translatedMessages[key]
+ }
+ }
+
+ if (!translatedMessage) {
+ translatedMessage = translatedMessages[message] || message
+ }
+
+ const hasPlaceholders = /{\d+}/.test(message)
+ if (!hasPlaceholders) {
+ return translatedMessage
+ }
+
+ return format(translatedMessage, replace)
+}
+
+function fetchTranslations(lang) {
+ createResource({
+ url: 'ant_pos.ant_pos.api.get_translations',
+ cache: 'translations',
+ auto: true,
+ transform: (data) => {
+ window.translatedMessages = data
+ },
+ })
+}
diff --git a/AntPos/vite.config.mjs b/AntPos/vite.config.mjs
index e1131b3..fa4d718 100644
--- a/AntPos/vite.config.mjs
+++ b/AntPos/vite.config.mjs
@@ -85,6 +85,7 @@ export default defineConfig({
'prosemirror-state',
'prosemirror-view',
'lowlight',
+ 'interactjs'
],
},
})
diff --git a/ant_pos/ant_pos/api/__init__.py b/ant_pos/ant_pos/api/__init__.py
index 11f78d7..58fa35b 100644
--- a/ant_pos/ant_pos/api/__init__.py
+++ b/ant_pos/ant_pos/api/__init__.py
@@ -1,15 +1,20 @@
import frappe
+from frappe.translate import get_all_translations
+
def user_has_posprofile(user=None):
user = user or frappe.session.user
-
- # Query POS Profile where 'applicable_for_users' (example field) includes this user
- # Adjust field name based on your POS Profile doctype field for users
- profiles = frappe.get_all('POS Profile',
- filters={'applicable_for_users': ['like', f'%{user}%']},
- fields=['name'])
-
- return len(profiles) > 0
+
+ child_records = frappe.get_all(
+ 'POS Profile User',
+ filters={'user': user},
+ fields=['parent']
+ )
+
+ pos_profiles = [record['parent'] for record in child_records]
+
+ return len(pos_profiles) > 0
+
def posprofile_user_query_conditions(user=None):
@@ -33,4 +38,68 @@ def posprofile_user_query_conditions(user=None):
SELECT parent FROM `tabPOS Profile User`
WHERE user = {frappe.db.escape(user)}
)
- """
\ No newline at end of file
+ """
+
+@frappe.whitelist()
+def get_user_permissions():
+ user = frappe.session.user
+ permissions = {}
+ user_roles = frappe.get_roles(user)
+
+ def check_perm(doctype, permtype):
+ # Check Custom DocPerm first
+ custom_perms = frappe.get_all(
+ "Custom DocPerm",
+ filters={"parent": doctype, "role": ["in", user_roles], permtype: 1},
+ fields=["if_owner"]
+ )
+ if custom_perms:
+ return custom_perms[0]["if_owner"] == 1
+
+ # Fallback: check DocPerm entries
+ std_perms = frappe.get_all(
+ "DocPerm",
+ filters={"parent": doctype, "role": ["in", user_roles], permtype: 1},
+ fields=["if_owner"]
+ )
+ if std_perms:
+ return std_perms[0]["if_owner"] == 1
+
+ return False
+
+ for doctype in ["Sales Invoice", "Payment Entry", "Sales Order"]:
+ submit_owner_restricted = check_perm(doctype, "submit")
+
+ can_submit_global = frappe.has_permission(doctype, doc=None, ptype="submit", user=user)
+ can_create_global = frappe.has_permission(doctype, doc=None, ptype="create", user=user)
+ can_print_global = frappe.has_permission(doctype, doc=None, ptype="print", user=user)
+
+ # If submit is owner restricted, check if user owns any docs
+ has_own_docs = False
+ if submit_owner_restricted:
+ has_own_docs = frappe.db.exists({
+ "doctype": doctype,
+ "owner": user,
+ "docstatus": 0
+ }) is not None
+
+ can_submit = can_submit_global or (submit_owner_restricted and has_own_docs)
+
+ permissions[doctype.lower().replace(" ", "_")] = {
+ "can_submit": can_submit,
+ "can_submit_owner_restricted": submit_owner_restricted,
+ "has_own_docs": has_own_docs,
+ "can_create": can_create_global,
+ "can_print": can_print_global,
+ }
+
+ return permissions
+
+@frappe.whitelist(allow_guest=True)
+def get_translations():
+ if frappe.session.user != "Guest":
+ language = frappe.db.get_value("User", frappe.session.user, "language")
+ else:
+ language = frappe.db.get_single_value("System Settings", "language")
+
+ return get_all_translations(language)
\ No newline at end of file
diff --git a/ant_pos/ant_pos/api/payment_entry.py b/ant_pos/ant_pos/api/payment_entry.py
index 6c3c39d..a992e5b 100644
--- a/ant_pos/ant_pos/api/payment_entry.py
+++ b/ant_pos/ant_pos/api/payment_entry.py
@@ -62,25 +62,4 @@ def get_payments(shift):
})
return result_list
- # invoice = frappe.db.get_all('Sales Invoice', filters={'custom_ant_opening': shift},fields=['name', 'is_pos',])
- # for inv in invoice:
- # inv['payments'] = []
- # payments = frappe.db.get_all('Payment Entry', filters={'shift': shift}, fields=['name', 'paid_from', 'paid_to', 'paid_from_account_currency', 'paid_to_account_currency', 'amount', 'amount_in_account_currency'])
- # for payment in payments:
- # inv['payments'].append(payment)
-def get_payment_entry(invoice):
-
- # payments = frappe.db.sql("""
- # SELECT
- # name,
- # paid_from,
- # paid_to,
- # paid_from_account_currency,
- # paid_to_account_currency,
- # amount,
- # amount_in_account_currency
- # FROM `tabPayment Entry`
- # WHERE shift = %s
- # """, (shift,), as_dict=True)
-
- return invoice
+
diff --git a/ant_pos/ant_pos/api/pos_profile.py b/ant_pos/ant_pos/api/pos_profile.py
index 1f5e54e..e90edd8 100644
--- a/ant_pos/ant_pos/api/pos_profile.py
+++ b/ant_pos/ant_pos/api/pos_profile.py
@@ -101,4 +101,4 @@ def create_opening(values):
except Exception as e:
frappe.log_error(message=frappe.get_traceback(), title="Ant Opening Shift Creation Error")
- frappe.throw(str(e))
\ No newline at end of file
+ frappe.throw(str(e))
diff --git a/ant_pos/ant_pos/api/sales_invoice.py b/ant_pos/ant_pos/api/sales_invoice.py
index 92b12a3..17125b4 100644
--- a/ant_pos/ant_pos/api/sales_invoice.py
+++ b/ant_pos/ant_pos/api/sales_invoice.py
@@ -29,4 +29,4 @@ def calculate_invoice_item_taxes(doc):
item.item_code
)
item.price_list_rate=data
- return invoice.as_dict()
\ No newline at end of file
+ return invoice.as_dict()
diff --git a/ant_pos/ant_pos/doctype/ant_closing_shift/ant_closing_shift.json b/ant_pos/ant_pos/doctype/ant_closing_shift/ant_closing_shift.json
index 8fd80a9..a167d71 100644
--- a/ant_pos/ant_pos/doctype/ant_closing_shift/ant_closing_shift.json
+++ b/ant_pos/ant_pos/doctype/ant_closing_shift/ant_closing_shift.json
@@ -159,7 +159,7 @@
],
"is_submittable": 1,
"links": [],
- "modified": "2025-04-21 09:58:12.822960",
+ "modified": "2025-08-23 12:02:18.972822",
"modified_by": "Administrator",
"module": "Ant-Pos",
"name": "Ant Closing Shift",
@@ -205,6 +205,34 @@
"share": 1,
"submit": 1,
"write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "POS Billing",
+ "select": 1,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "POS Cash",
+ "select": 1,
+ "share": 1,
+ "submit": 1,
+ "write": 1
}
],
"sort_field": "modified",
diff --git a/ant_pos/ant_pos/doctype/ant_opening_shift/ant_opening_shift.json b/ant_pos/ant_pos/doctype/ant_opening_shift/ant_opening_shift.json
index a53ba93..60741cb 100644
--- a/ant_pos/ant_pos/doctype/ant_opening_shift/ant_opening_shift.json
+++ b/ant_pos/ant_pos/doctype/ant_opening_shift/ant_opening_shift.json
@@ -107,7 +107,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2024-11-29 18:05:22.683131",
+ "modified": "2025-08-23 11:49:39.574190",
"modified_by": "Administrator",
"module": "Ant-Pos",
"name": "Ant Opening Shift",
@@ -151,6 +151,34 @@
"share": 1,
"submit": 1,
"write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "POS Billing",
+ "select": 1,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "POS Cash",
+ "share": 1,
+ "submit": 1,
+ "write": 1
}
],
"sort_field": "modified",
diff --git a/ant_pos/ant_pos/doctype/antpos_fields_layout/antpos_fields_layout.json b/ant_pos/ant_pos/doctype/antpos_fields_layout/antpos_fields_layout.json
index dc75fa1..93bef39 100644
--- a/ant_pos/ant_pos/doctype/antpos_fields_layout/antpos_fields_layout.json
+++ b/ant_pos/ant_pos/doctype/antpos_fields_layout/antpos_fields_layout.json
@@ -47,7 +47,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2025-05-09 16:25:48.476466",
+ "modified": "2025-08-23 11:51:45.655352",
"modified_by": "Administrator",
"module": "Ant-Pos",
"name": "Antpos Fields Layout",
@@ -74,6 +74,16 @@
"report": 1,
"role": "All",
"share": 1
+ },
+ {
+ "export": 1,
+ "read": 1,
+ "role": "POS Billing"
+ },
+ {
+ "export": 1,
+ "read": 1,
+ "role": "POS Cash"
}
],
"sort_field": "creation",
diff --git a/ant_pos/ant_pos/doctype/antpos_settings/antpos_settings.json b/ant_pos/ant_pos/doctype/antpos_settings/antpos_settings.json
index e060faf..6900aba 100644
--- a/ant_pos/ant_pos/doctype/antpos_settings/antpos_settings.json
+++ b/ant_pos/ant_pos/doctype/antpos_settings/antpos_settings.json
@@ -31,7 +31,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
- "modified": "2025-08-21 16:01:20.229542",
+ "modified": "2025-08-23 11:49:36.759797",
"modified_by": "Administrator",
"module": "Ant-Pos",
"name": "AntPOS Settings",
@@ -66,6 +66,16 @@
{
"read": 1,
"role": "Accounts User"
+ },
+ {
+ "export": 1,
+ "read": 1,
+ "role": "POS Billing"
+ },
+ {
+ "export": 1,
+ "read": 1,
+ "role": "POS Cash"
}
],
"sort_field": "modified",
diff --git a/ant_pos/ant_pos/workspace/antpos/antpos.json b/ant_pos/ant_pos/workspace/antpos/antpos.json
index 7733697..0b021e0 100644
--- a/ant_pos/ant_pos/workspace/antpos/antpos.json
+++ b/ant_pos/ant_pos/workspace/antpos/antpos.json
@@ -1,7 +1,7 @@
{
"charts": [],
"content": "[{\"id\":\"J2EWUAxqUk\",\"type\":\"header\",\"data\":{\"text\":\"antPOS\",\"col\":12}},{\"id\":\"8OsCxUA1yu\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"antPOS\",\"col\":3}}]",
- "creation": "2025-05-28 13:31:07.053723",
+ "creation": "2025-08-23 11:53:14.229391",
"custom_blocks": [],
"docstatus": 0,
"doctype": "Workspace",
@@ -12,7 +12,7 @@
"is_hidden": 0,
"label": "antPOS",
"links": [],
- "modified": "2025-05-28 13:52:52.932070",
+ "modified": "2025-08-23 13:19:31.491501",
"modified_by": "nihal@anther.tech",
"module": "Ant-Pos",
"name": "antPOS",
diff --git a/ant_pos/fixtures/workspace.json b/ant_pos/fixtures/workspace.json
deleted file mode 100644
index 35c38e3..0000000
--- a/ant_pos/fixtures/workspace.json
+++ /dev/null
@@ -1,45 +0,0 @@
-[
- {
- "charts": [],
- "content": "[{\"id\":\"J2EWUAxqUk\",\"type\":\"header\",\"data\":{\"text\":\"antPOS\",\"col\":12}},{\"id\":\"8OsCxUA1yu\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"antPOS\",\"col\":3}}]",
- "custom_blocks": [],
- "docstatus": 0,
- "doctype": "Workspace",
- "type":"Ant-Pos",
- "for_user": "",
- "hide_custom": 0,
- "icon": "color-review-points",
- "is_hidden": 0,
- "label": "antPOS",
- "links": [],
- "modified": "2025-05-29 13:02:38.499787",
- "module": "Ant-Pos",
- "name": "antPOS",
- "number_cards": [],
- "parent_page": "",
- "public": 1,
- "quick_lists": [],
- "restrict_to_domain": null,
- "roles": [],
- "sequence_id": 2.0,
- "shortcuts": [
- {
- "color": "Grey",
- "doc_view": "List",
- "format": null,
- "icon": null,
- "kanban_board": null,
- "label": "antPOS",
- "link_to": null,
- "parent": "antPOS",
- "parentfield": "shortcuts",
- "parenttype": "Workspace",
- "restrict_to_domain": null,
- "stats_filter": null,
- "type": "URL",
- "url": "/antPOS"
- }
- ],
- "title": "antPOS"
- }
-]
\ No newline at end of file
diff --git a/ant_pos/hooks.py b/ant_pos/hooks.py
index 62dcb51..f85a1c1 100644
--- a/ant_pos/hooks.py
+++ b/ant_pos/hooks.py
@@ -231,5 +231,4 @@
fixtures = [
{"dt": "Custom Field", "filters": [["module", "=", "Ant-Pos"]], "prefix": "Ant-Pos_custom_fields"},
- {"dt": "Workspace", "filters": [["module", "=", "Ant-Pos"]], "prefix": "Ant-Pos_workspace"}
]
\ No newline at end of file
diff --git a/ant_pos/install.py b/ant_pos/install.py
index 6056778..a2bf0c3 100644
--- a/ant_pos/install.py
+++ b/ant_pos/install.py
@@ -1,23 +1,62 @@
import frappe
+from frappe.core.page.permission_manager.permission_manager import add, update
def before_install():
create_roles_and_permissions()
+ set_custom_permissions(permission_matrix)
+
+def set_custom_permissions(permission_matrix):
+ """
+ Set Custom DocPerms for all entries in permission_matrix.
+ Each entry is a tuple: (doctype, role, permissions_dict)
+ """
+ for doctype, role, perms in permission_matrix:
+ permlevel = perms.get("permlevel", 0)
+ filters = {
+ "parent": doctype,
+ "role": role,
+ "permlevel": permlevel
+ }
+ # Check if a Custom DocPerm already exists for this tuple
+ custom_perm_name = frappe.db.exists("Custom DocPerm", filters)
+ perms_for_doc = {
+ "doctype": "Custom DocPerm",
+ "parent": doctype,
+ "parenttype": "DocType",
+ "parentfield": "permissions",
+ "role": role,
+ "permlevel": permlevel,
+ }
+ perms_for_doc.update(perms)
+ # Don't set permlevel twice
+ del perms_for_doc["permlevel"]
+
+ if not custom_perm_name:
+ # Create new Custom DocPerm
+ frappe.get_doc(perms_for_doc).insert(ignore_permissions=True)
+ else:
+ # Update existing Custom DocPerm
+ doc = frappe.get_doc("Custom DocPerm", custom_perm_name)
+ for k, v in perms_for_doc.items():
+ setattr(doc, k, v)
+ doc.save(ignore_permissions=True)
+ frappe.db.commit()
+ # Always clear cache so permission map is updated immediately
+ frappe.clear_cache()
def create_roles_and_permissions():
- # 1. Define roles to create
roles = [
{"role_name": "POS Billing", "desk_access": 0},
{"role_name": "POS Cash", "desk_access": 0},
]
- # 2. Create roles if not exists
+ # Create roles if not exist
for role in roles:
if not frappe.db.exists("Role", role["role_name"]):
frappe.get_doc({"doctype": "Role", **role}).insert()
- # 3. Permission Matrix: (doctype, role, permissions dict)
- permission_matrix = [
-
+
+permission_matrix = [
# POS Cash user permission in Doctype
("POS Invoice", "POS Cash", {"permlevel":0, "if_owner":0, "select":1, "read":1, "write":1,"create":0, "delete":0, "submit": 1, "cancel":0, "amend":0, "print":1, "email":0, "report":0, "import":0, "export":1, "set_user_permissions":0, "share":0}),
("Customer", "POS Cash", {"permlevel":0, "if_owner":0, "select":1, "read":1, "write":1,"create":1, "delete":0, "submit": 0, "cancel":0, "amend":0, "print":0, "email":0, "report":0, "import":0, "export":1, "set_user_permissions":0, "share":0}),
@@ -64,25 +103,3 @@ def create_roles_and_permissions():
("Tax Category", "POS Billing", {"permlevel":0, "if_owner":0, "select":1, "read":1, "write":0,"create":0, "delete":0, "submit": 0, "cancel":0, "amend":0, "print": 0, "email":0, "report":1, "import":0, "export":1, "set_user_permissions":0, "share":0}),
]
-
- # 4. Create DocPerm entries if not already set
- for doctype, role, perms in permission_matrix:
- exists = frappe.db.exists(
- "DocPerm",
- {"parent": doctype, "role": role, "permlevel": perms.get("permlevel", 0)}
- )
- if not exists:
- perms_lower = {k.lower(): v for k, v in perms.items()}
- doc = frappe.get_doc({
- "doctype": "DocPerm",
- "parent": doctype,
- "parenttype": "DocType",
- "parentfield": "permissions",
- "role": role,
- **perms_lower
- })
- doc.insert(ignore_permissions=True)
-
- # 5. Clear cache so changes take effect
- frappe.clear_cache()
-
diff --git a/ant_pos/public/antPOS/assets/CloseShift-D9RUXaQL.js b/ant_pos/public/antPOS/assets/CloseShift-C8I4-YBN.js
similarity index 81%
rename from ant_pos/public/antPOS/assets/CloseShift-D9RUXaQL.js
rename to ant_pos/public/antPOS/assets/CloseShift-C8I4-YBN.js
index 9ffd25f..2a5c206 100644
--- a/ant_pos/public/antPOS/assets/CloseShift-D9RUXaQL.js
+++ b/ant_pos/public/antPOS/assets/CloseShift-C8I4-YBN.js
@@ -1,2 +1,2 @@
-import{a3 as $,j as y,e as p,f as t,v as B,r as h,x as z,y as S,A as D,b as j,w as f,l as E,u as o,g as d,F as I,k as O,t as r,D as F,_ as k,B as C,ae as L}from"./index-Akjsy7C6.js";import{_}from"./FormControl.vue_vue_type_script_setup_true_lang-Dra8SI4z.js";import{c as G}from"./index-BL2fDzrE.js";import{e as H}from"./emitter-ClkYUnba.js";const J={},M={class:"spinner",viewBox:"0 0 50 50"};function R(N,l){return p(),y("svg",M,l[0]||(l[0]=[t("defs",null,[t("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[t("stop",{offset:"0%","stop-color":"rgba(0,110,219,1)"}),t("stop",{offset:"100%","stop-color":"rgba(255,255,255,0)"})])],-1),t("circle",{stroke:"url(#gradient)",class:"spinner-path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"},null,-1)]))}const q=$(J,[["render",R],["__scopeId","data-v-5c03f65e"]]),K={key:0,class:"w-full flex justify-center mb-2"},Q={class:"w-full mt-2"},W={class:"py-2 pr-4 w-48"},X={class:"py-2 px-1"},Y={class:"py-2 px-1"},Z={class:"py-2 px-1"},ee={class:"py-2 px-1"},te={class:"font-bold border-t"},se={class:"py-2 px-1"},ne={class:"py-2 px-1"},oe={class:"py-2 px-1"},ae={class:"py-2 px-1"},le={class:"flex justify-end gap-2 mt-4"},re={__name:"CloseShift",setup(N){const l=B(),m=h(!0);z("base");const i=h(l.posProfileData.payments);let g=!1;const u=h({opening:0,closing:0,expected:0,difference:0}),w=F(s=>{const e=i.value[s];e&&(e.difference=(e.expected||0)-(e.closing||0),b())},100);let A=S({url:"ant_pos.ant_pos.api.payment_entry.get_payments",method:"POST",makeParams(){return{shift:l.openingShift.name}},auto:!0,onSuccess(s){P(s)}});const P=s=>{const e=[];l.posProfileData.payments.forEach(n=>{const c=l.openingShift.opening_balance_details.find(x=>x.mode_of_payment===n.mode_of_payment),a=s.find(x=>x.mode_of_payment===n.mode_of_payment),v=Number(c==null?void 0:c.opening_amount)||0,V=Number(a==null?void 0:a.total)||0;e.push({mode_of_payment:n.mode_of_payment,opening:v,expected:V+v,closing:V+v,difference:0})}),i.value=e,b()},T=async()=>{m.value=!1},U=S({url:"frappe.desk.form.save.savedocs",makeParams(s){return{doc:JSON.stringify({doctype:"Ant Closing Shift",payment_reconciliation:i.value,ant_opening_shift:l.openingShift.name}),action:s.action}},onSuccess(s){g=!1,H.emit("remove_invoice",!0),m.value=!1,l.fetchPosProfile()},onError(s){g||(G({title:"error",message:Array.isArray(s==null?void 0:s.messages)?s.messages[0]:(s==null?void 0:s.messages)||"An error occurred",icon:"x-circle",iconClasses:"bg-surface-red-5 text-ink-white rounded-md p-px",position:"top-center",timeout:5}),g=!0)}}),b=()=>{u.value={opening:i.value.reduce((s,e)=>s+(Number(e.opening)||0),0),closing:i.value.reduce((s,e)=>s+(Number(e.closing)||0),0),expected:i.value.reduce((s,e)=>s+(Number(e.expected)||0),0),difference:i.value.reduce((s,e)=>s+(Number(e.difference)||0),0)}};return D(i,b,{deep:!0}),(s,e)=>(p(),j(o(L),{options:{size:"3xl"},modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=n=>m.value=n)},{"body-title":f(()=>e[2]||(e[2]=[t("h3",null,"ANT Closing Shift",-1)])),"body-content":f(()=>[o(A).isLoading?(p(),y("div",K,[d(o(q),{class:"w-5 h-5"})])):E("",!0),t("table",Q,[e[4]||(e[4]=t("thead",null,[t("tr",{class:"text-left text-sm border-b"},[t("th",{class:"pb-2 w-48"},"Mode of Payment"),t("th",{class:"pb-2 w-32"},"Opening Amount"),t("th",{class:"pb-2 w-32"},"Closing Amount"),t("th",{class:"pb-2 w-32"},"Expected Amount"),t("th",{class:"pb-2 w-32"},"Difference")])],-1)),t("tbody",null,[(p(!0),y(I,null,O(i.value,(n,c)=>(p(),y("tr",{key:c,class:"border-b"},[t("td",W,r(n.mode_of_payment),1),t("td",X,[d(o(_),{type:"number",size:"sm",variant:"subtle",disabled:"true",modelValue:n.opening,"onUpdate:modelValue":a=>n.opening=a},null,8,["modelValue","onUpdate:modelValue"])]),t("td",Y,[d(o(_),{type:"text",inputmode:"decimal",step:"any",size:"sm",variant:"subtle",modelValue:n.closing,"onUpdate:modelValue":a=>n.closing=a,onInput:a=>o(w)(c)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),t("td",Z,[d(o(_),{type:"number",size:"sm",variant:"subtle",disabled:"true",modelValue:n.expected,"onUpdate:modelValue":a=>n.expected=a},null,8,["modelValue","onUpdate:modelValue"])]),t("td",ee,[d(o(_),{type:"number",size:"sm",variant:"subtle",disabled:"true",value:n.difference},null,8,["value"])])]))),128))]),t("tfoot",null,[t("tr",te,[e[3]||(e[3]=t("td",{class:"py-2 pr-4"},"Total",-1)),t("td",se,r(u.value.opening),1),t("td",ne,r(u.value.closing),1),t("td",oe,r(u.value.expected),1),t("td",ae,r(u.value.difference),1)])])]),t("div",le,[d(o(k),{variant:"ghost",onClick:T},{default:f(()=>e[5]||(e[5]=[C("Cancel",-1)])),_:1,__:[5]}),d(o(k),{variant:"solid",onClick:e[0]||(e[0]=n=>o(U).fetch({action:"Submit"}))},{default:f(()=>e[6]||(e[6]=[C("Submit",-1)])),_:1,__:[6]})])]),_:1},8,["modelValue"]))}};export{re as default};
-//# sourceMappingURL=CloseShift-D9RUXaQL.js.map
+import{a4 as $,j as g,e as p,f as t,v as B,r as h,x as z,y as S,A as D,b as j,w as f,l as E,u as o,g as d,F as I,k as O,t as r,D as F,_ as k,B as C,ag as L}from"./index-ZJMnRRL_.js";import{_}from"./FormControl.vue_vue_type_script_setup_true_lang-DwVg3GU6.js";import{c as G}from"./index-C6kpA4Fx.js";import{e as H}from"./emitter-CriEFWbU.js";const J={},M={class:"spinner",viewBox:"0 0 50 50"};function R(N,l){return p(),g("svg",M,l[0]||(l[0]=[t("defs",null,[t("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[t("stop",{offset:"0%","stop-color":"rgba(0,110,219,1)"}),t("stop",{offset:"100%","stop-color":"rgba(255,255,255,0)"})])],-1),t("circle",{stroke:"url(#gradient)",class:"spinner-path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"},null,-1)]))}const q=$(J,[["render",R],["__scopeId","data-v-5c03f65e"]]),K={key:0,class:"w-full flex justify-center mb-2"},Q={class:"w-full mt-2"},W={class:"py-2 pr-4 w-48"},X={class:"py-2 px-1"},Y={class:"py-2 px-1"},Z={class:"py-2 px-1"},ee={class:"py-2 px-1"},te={class:"font-bold border-t"},se={class:"py-2 px-1"},ne={class:"py-2 px-1"},oe={class:"py-2 px-1"},ae={class:"py-2 px-1"},le={class:"flex justify-end gap-2 mt-4"},re={__name:"CloseShift",setup(N){const l=B(),m=h(!0);z("base");const i=h(l.posProfileData.payments);let y=!1;const u=h({opening:0,closing:0,expected:0,difference:0}),w=F(s=>{const e=i.value[s];e&&(e.difference=(e.expected||0)-(e.closing||0),b())},100);let A=S({url:"ant_pos.ant_pos.api.payment_entry.get_payments",method:"POST",makeParams(){return{shift:l.openingShift.name}},auto:!0,onSuccess(s){P(s)}});const P=s=>{const e=[];l.posProfileData.payments.forEach(n=>{const c=l.openingShift.opening_balance_details.find(x=>x.mode_of_payment===n.mode_of_payment),a=s.find(x=>x.mode_of_payment===n.mode_of_payment),v=Number(c==null?void 0:c.opening_amount)||0,V=Number(a==null?void 0:a.total)||0;e.push({mode_of_payment:n.mode_of_payment,opening:v,expected:V+v,closing:V+v,difference:0})}),i.value=e,b()},T=async()=>{m.value=!1},U=S({url:"frappe.desk.form.save.savedocs",makeParams(s){return{doc:JSON.stringify({doctype:"Ant Closing Shift",payment_reconciliation:i.value,ant_opening_shift:l.openingShift.name}),action:s.action}},onSuccess(s){y=!1,H.emit("remove_invoice",!0),m.value=!1,l.fetchPosProfile()},onError(s){y||(G({title:"error",message:Array.isArray(s==null?void 0:s.messages)?s.messages[0]:(s==null?void 0:s.messages)||"An error occurred",icon:"x-circle",iconClasses:"bg-surface-red-5 text-ink-white rounded-md p-px",position:"top-center",timeout:5}),y=!0)}}),b=()=>{u.value={opening:i.value.reduce((s,e)=>s+(Number(e.opening)||0),0),closing:i.value.reduce((s,e)=>s+(Number(e.closing)||0),0),expected:i.value.reduce((s,e)=>s+(Number(e.expected)||0),0),difference:i.value.reduce((s,e)=>s+(Number(e.difference)||0),0)}};return D(i,b,{deep:!0}),(s,e)=>(p(),j(o(L),{options:{size:"3xl"},modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=n=>m.value=n)},{"body-title":f(()=>e[2]||(e[2]=[t("h3",null,"ANT Closing Shift",-1)])),"body-content":f(()=>[o(A).isLoading?(p(),g("div",K,[d(o(q),{class:"w-5 h-5"})])):E("",!0),t("table",Q,[e[4]||(e[4]=t("thead",null,[t("tr",{class:"text-left text-sm border-b"},[t("th",{class:"pb-2 w-48"},"Mode of Payment"),t("th",{class:"pb-2 w-32"},"Opening Amount"),t("th",{class:"pb-2 w-32"},"Closing Amount"),t("th",{class:"pb-2 w-32"},"Expected Amount"),t("th",{class:"pb-2 w-32"},"Difference")])],-1)),t("tbody",null,[(p(!0),g(I,null,O(i.value,(n,c)=>(p(),g("tr",{key:c,class:"border-b"},[t("td",W,r(n.mode_of_payment),1),t("td",X,[d(o(_),{type:"number",size:"sm",variant:"subtle",disabled:"true",modelValue:n.opening,"onUpdate:modelValue":a=>n.opening=a},null,8,["modelValue","onUpdate:modelValue"])]),t("td",Y,[d(o(_),{type:"text",inputmode:"decimal",step:"any",size:"sm",variant:"subtle",modelValue:n.closing,"onUpdate:modelValue":a=>n.closing=a,onInput:a=>o(w)(c)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),t("td",Z,[d(o(_),{type:"number",size:"sm",variant:"subtle",disabled:"true",modelValue:n.expected,"onUpdate:modelValue":a=>n.expected=a},null,8,["modelValue","onUpdate:modelValue"])]),t("td",ee,[d(o(_),{type:"number",size:"sm",variant:"subtle",disabled:"true",value:n.difference},null,8,["value"])])]))),128))]),t("tfoot",null,[t("tr",te,[e[3]||(e[3]=t("td",{class:"py-2 pr-4"},"Total",-1)),t("td",se,r(u.value.opening),1),t("td",ne,r(u.value.closing),1),t("td",oe,r(u.value.expected),1),t("td",ae,r(u.value.difference),1)])])]),t("div",le,[d(o(k),{variant:"ghost",onClick:T},{default:f(()=>e[5]||(e[5]=[C("Cancel",-1)])),_:1,__:[5]}),d(o(k),{variant:"solid",onClick:e[0]||(e[0]=n=>o(U).fetch({action:"Submit"}))},{default:f(()=>e[6]||(e[6]=[C("Submit",-1)])),_:1,__:[6]})])]),_:1},8,["modelValue"]))}};export{re as default};
+//# sourceMappingURL=CloseShift-C8I4-YBN.js.map
diff --git a/ant_pos/public/antPOS/assets/CloseShift-D9RUXaQL.js.map b/ant_pos/public/antPOS/assets/CloseShift-C8I4-YBN.js.map
similarity index 99%
rename from ant_pos/public/antPOS/assets/CloseShift-D9RUXaQL.js.map
rename to ant_pos/public/antPOS/assets/CloseShift-C8I4-YBN.js.map
index f87ed8a..9cc7d09 100644
--- a/ant_pos/public/antPOS/assets/CloseShift-D9RUXaQL.js.map
+++ b/ant_pos/public/antPOS/assets/CloseShift-C8I4-YBN.js.map
@@ -1 +1 @@
-{"version":3,"file":"CloseShift-D9RUXaQL.js","sources":["../../../../AntPos/node_modules/frappe-ui/src/components/Spinner/Spinner.vue","../../../../AntPos/src/components/Dialog/CloseShift.vue"],"sourcesContent":["\n \n\n\n\n","\n \n\n\n\n\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_cache","_createElementVNode","store","usePosProfileStore","dialogVisible","ref","inject","data","errorHandled","totals","updateDifference","debounce","index","row","calculateTotals","mode","createResource","closingData","createClosingShift","closing","newData","element","openingDetail","item","closingDetail","openingAmount","closingTotal","handleClose","handleSubmit","params","emitter","error","createToast","sum","watch","_createBlock","_unref","Dialog","$event","_createVNode","Spinner","_hoisted_2","_Fragment","_renderList","_hoisted_3","_toDisplayString","_hoisted_4","FormControl","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","Button"],"mappings":"mWACO,MAAM,UAAU,QAAQ,6BAA7B,OAAAA,EAAA,EAAAC,EAgBM,MAhBNC,EAgBMC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CAfJC,EAKO,OAAA,KAAA,CAJLA,EAGiB,iBAAA,CAHD,GAAG,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,SACvDA,EAAmD,OAAA,CAA7C,OAAO,KAAK,aAAW,sBAC7BA,EAAuD,OAAA,CAAjD,OAAO,OAAO,aAAW,+BAGnCA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,EAMEH,EAAAW,CAAA,EAAA,CALE,KAAK,SACL,KAAK,KACL,QAAQ,SACR,SAAS,OACA,WAAAlC,EAAI,SAAJ,sBAAAyB,GAAAzB,EAAI,SAAQyB,kDAG7BrC,EAQK,KARLiD,GAQK,CAPDX,EAMEH,EAAAW,CAAA,EAAA,CALE,KAAK,SACL,KAAK,KACL,QAAQ,SACR,SAAS,OACR,MAAOlC,EAAI,4CAK5BZ,EAQQ,QAAA,KAAA,CAPJA,EAMK,KANLkD,GAMK,CALDnD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,EAAgC,KAAA,CAA5B,MAAM,WAAW,EAAC,QAAK,EAAA,GAC3BA,EAA+C,KAA/CmD,GAA+CP,EAAtBpC,EAAA,MAAO,OAAO,EAAA,CAAA,EACvCR,EAA+C,KAA/CoD,GAA+CR,EAAtBpC,EAAA,MAAO,OAAO,EAAA,CAAA,EACvCR,EAAgD,KAAhDqD,GAAgDT,EAAvBpC,EAAA,MAAO,QAAQ,EAAA,CAAA,EACxCR,EAAkD,KAAlDsD,GAAkDV,EAAzBpC,EAAA,MAAO,UAAU,EAAA,CAAA,QAKtDR,EAGM,MAHNuD,GAGM,CAFFjB,EAA4DH,EAAAqB,CAAA,EAAA,CAApD,QAAQ,QAAS,QAAO9B,cAAa,IAAM3B,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAN,SAAM,EAAA,kBACnDuC,EAAyFH,EAAAqB,CAAA,EAAA,CAAjF,QAAQ,QAAS,QAAKzD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAsC,GAAEF,EAAAR,CAAA,EAAa,MAAK,CAAA,OAAA,QAAA,CAAA,eAAwB,IAAM5B,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAN,SAAM,EAAA","x_google_ignoreList":[0]}
\ No newline at end of file
+{"version":3,"file":"CloseShift-C8I4-YBN.js","sources":["../../../../AntPos/node_modules/frappe-ui/src/components/Spinner/Spinner.vue","../../../../AntPos/src/components/Dialog/CloseShift.vue"],"sourcesContent":["\n \n\n\n\n","\n \n\n\n\n\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_cache","_createElementVNode","store","usePosProfileStore","dialogVisible","ref","inject","data","errorHandled","totals","updateDifference","debounce","index","row","calculateTotals","mode","createResource","closingData","createClosingShift","closing","newData","element","openingDetail","item","closingDetail","openingAmount","closingTotal","handleClose","handleSubmit","params","emitter","error","createToast","sum","watch","_createBlock","_unref","Dialog","$event","_createVNode","Spinner","_hoisted_2","_Fragment","_renderList","_hoisted_3","_toDisplayString","_hoisted_4","FormControl","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","Button"],"mappings":"mWACO,MAAM,UAAU,QAAQ,6BAA7B,OAAAA,EAAA,EAAAC,EAgBM,MAhBNC,EAgBMC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CAfJC,EAKO,OAAA,KAAA,CAJLA,EAGiB,iBAAA,CAHD,GAAG,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,SACvDA,EAAmD,OAAA,CAA7C,OAAO,KAAK,aAAW,sBAC7BA,EAAuD,OAAA,CAAjD,OAAO,OAAO,aAAW,+BAGnCA,EAQU,SAAA,CAPR,OAAO,iBACP,MAAM,eACN,GAAG,KACH,GAAG,KACH,EAAE,KACF,KAAK,OACL,eAAa,idC6EnB,MAAMC,EAAQC,EAAkB,EAC1BC,EAAgBC,EAAI,EAAI,EACjBC,EAAO,MAAM,EAC1B,MAAMC,EAAOF,EAAIH,EAAM,eAAe,QAAQ,EAC9C,IAAIM,EAAe,GAEnB,MAAMC,EAASJ,EAAI,CACf,QAAS,EACT,QAAS,EACT,SAAU,EACV,WAAY,CAChB,CAAC,EAEKK,EAAmBC,EAAUC,GAAU,CACzC,MAAMC,EAAMN,EAAK,MAAMK,CAAK,EACpBC,IACAA,EAAI,YAAcA,EAAI,UAAY,IAAMA,EAAI,SAAW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AAtBpC,EAAA,MAAO,OAAO,EAAA,CAAA,EACvCR,EAA+C,KAA/CoD,GAA+CR,EAAtBpC,EAAA,MAAO,OAAO,EAAA,CAAA,EACvCR,EAAgD,KAAhDqD,GAAgDT,EAAvBpC,EAAA,MAAO,QAAQ,EAAA,CAAA,EACxCR,EAAkD,KAAlDsD,GAAkDV,EAAzBpC,EAAA,MAAO,UAAU,EAAA,CAAA,QAKtDR,EAGM,MAHNuD,GAGM,CAFFjB,EAA4DH,EAAAqB,CAAA,EAAA,CAApD,QAAQ,QAAS,QAAO9B,cAAa,IAAM3B,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAN,SAAM,EAAA,kBACnDuC,EAAyFH,EAAAqB,CAAA,EAAA,CAAjF,QAAQ,QAAS,QAAKzD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAsC,GAAEF,EAAAR,CAAA,EAAa,MAAK,CAAA,OAAA,QAAA,CAAA,eAAwB,IAAM5B,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAN,SAAM,EAAA","x_google_ignoreList":[0]}
\ No newline at end of file
diff --git a/ant_pos/public/antPOS/assets/Customer--u-fbBj5.js b/ant_pos/public/antPOS/assets/Customer--u-fbBj5.js
new file mode 100644
index 0000000..8ab24be
--- /dev/null
+++ b/ant_pos/public/antPOS/assets/Customer--u-fbBj5.js
@@ -0,0 +1,2 @@
+import{e as L}from"./emitter-CriEFWbU.js";import{a4 as H,h as Q,_ as R,a5 as _,b as w,e as a,w as C,g as O,a6 as I,f as c,n as V,j as n,l as d,F as j,k as B,t as g,q as y,m as z,a7 as M,aa as N,ab as U,ac as F,ad as X,x as J,c as P,v as D,C as K,o as W,E as Y}from"./index-ZJMnRRL_.js";import{n as Z,r as $,u as ee,b as te,l as se,P as le}from"./FormControl.vue_vue_type_script_setup_true_lang-DwVg3GU6.js";import{c as ae}from"./index-C6kpA4Fx.js";const re={name:"Autocomplete",props:["modelValue","options","placeholder","bodyClasses","multiple","hideSearch"],emits:["update:modelValue","update:query","change"],components:{Popover:le,Button:R,FeatherIcon:Q,Combobox:se,ComboboxInput:te,ComboboxOptions:ee,ComboboxOption:$,ComboboxButton:Z},expose:["togglePopover","closeOptions"],data(){return{query:"",showOptions:!1}},computed:{selectedValue:{get(){var e,t;return this.multiple?v((e=this.modelValue)==null?void 0:e[0])==="value"?(t=this.modelValue)==null?void 0:t.map(l=>this.findOption(l)):this.modelValue:this.findOption(this.modelValue)},set(e){this.query="",e&&!this.multiple&&(this.showOptions=!1),this.$emit("update:modelValue",e)}},groups(){var t;return!this.options||this.options.length===0?[]:((t=this.options[0])!=null&&t.group?this.options:[{group:"",items:this.sanitizeOptions(this.options)}]).map((l,m)=>{const o=this.sanitizeOptions(l.items)||[];return{key:m,group:l.group,hideLabel:l.hideLabel||!1,items:this.filterOptions(o)}}).filter(l=>l.items.length>0)},allOptions(){return this.groups.flatMap(e=>e.items)},areAllOptionsSelected(){var e;return this.multiple?this.allOptions.length===((e=this.selectedValue)==null?void 0:e.length):!1}},watch:{query(e){this.$emit("update:query",e)},showOptions(e){e&&X(()=>{var t,l;return(l=(t=this.$refs.searchInput)==null?void 0:t.$el)==null?void 0:l.focus()})}},methods:{togglePopover(e){this.showOptions=e??!this.showOptions},closeOptions(){this.showOptions=!1,this.openPopover=!1,this.togglePopover=!1,this.isComboboxOpen=!1},findOption(e){if(!e)return e;const t=v(e)==="value"?e:e.value;return this.allOptions.find(l=>l.value===t)},filterOptions(e){if(!e)return[];if(!this.query)return e;const t=this.query.trim().toLowerCase();return e.filter(l=>{var p,h;const m=(p=l.label)==null?void 0:p.toLowerCase().includes(t),o=(h=l.value)==null?void 0:h.toLowerCase().includes(t),r=l.mobile_no?l.mobile_no.toString().toLowerCase().includes(t):!1;return m||o||r})},displayValue(e){return e?this.multiple?Array.isArray(e)?e.map(t=>this.getLabel(this.findOption(t))).join(", "):"":this.getLabel(this.findOption(e)):""},getLabel(e){return v(e)==="value"?e:(e==null?void 0:e.label)||(e==null?void 0:e.value)||"No Name"},getmobile(e){return v(e)==="value"?e:(e==null?void 0:e.mobile_no)||""},sanitizeOptions(e){return e?e.map(t=>v(t)==="option"?t:{label:t,value:t}):[]},isOptionSelected(e){var l,m;if(!this.selectedValue)return!1;const t=v(e)==="value"?e:e.value;return this.multiple?(m=this.selectedValue)==null?void 0:m.find(o=>o&&o.value===t):((l=this.selectedValue)==null?void 0:l.value)===t},selectAll(){this.selectedValue=this.allOptions},clearAll(){this.selectedValue=[]}}};function v(e){return typeof e=="object"?"option":"value"}const oe={class:"w-full"},ue=["onClick"],ie={class:"flex items-center overflow-hidden"},ne={key:0,class:"truncate text-base leading-5"},ce={key:1,class:"text-base leading-5 text-gray-500"},me={key:0,class:"sticky top-0 z-10 flex items-stretch space-x-1.5 bg-white py-1.5"},de={class:"relative w-full"},he={key:0,class:"sticky top-10 truncate bg-white px-2.5 py-1.5 text-sm font-medium text-gray-600"},fe={class:"flex flex-1 gap-2 overflow-hidden"},pe={key:0,class:"flex-shrink-0"},_e={key:1,class:"h-4 w-4"},be={class:"flex-1 truncate"},ge={class:"truncate"},ye={key:0,class:"ml-2 flex-shrink-0"},ve={key:0,class:"text-sm text-gray-600"},xe={key:1,class:"rounded-md px-2.5 py-1.5 text-base text-gray-600"},we={key:0,class:"border-t p-1"},Ce={key:0,class:"flex items-center justify-end"};function Oe(e,t,l,m,o,r){const p=_("ComboboxInput"),h=_("FeatherIcon"),s=_("ComboboxOption"),i=_("ComboboxOptions"),b=_("Button"),E=_("Popover"),T=_("Combobox");return a(),w(T,{modelValue:r.selectedValue,"onUpdate:modelValue":t[3]||(t[3]=A=>r.selectedValue=A),multiple:l.multiple,nullable:""},{default:C(({open:A})=>[O(E,{class:"w-full",show:o.showOptions,"onUpdate:show":t[2]||(t[2]=x=>o.showOptions=x)},{target:C(({open:x,togglePopover:k})=>[y(e.$slots,"target",N(U({open:x,togglePopover:k})),()=>[c("div",oe,[c("button",{class:V(["flex h-7 w-full items-center justify-between gap-2 rounded bg-gray-100 px-2 py-1 transition-colors hover:bg-gray-200 focus:ring-2 focus:ring-gray-400",{"bg-gray-200":A}]),onClick:()=>k()},[c("div",ie,[y(e.$slots,"prefix"),r.selectedValue?(a(),n("span",ne,g(r.displayValue(r.selectedValue)),1)):(a(),n("span",ce,g(l.placeholder||""),1))]),y(e.$slots,"suffix")],10,ue)])])]),body:C(({isOpen:x,togglePopover:k})=>[I(c("div",null,[c("div",{class:V(["relative mt-1 rounded-lg bg-white text-base shadow-2xl",l.bodyClasses])},[O(i,{class:V(["max-h-[15rem] overflow-y-auto px-1.5 pb-1.5",{"pt-1.5":l.hideSearch}]),static:""},{default:C(()=>[l.hideSearch?d("",!0):(a(),n("div",me,[c("div",de,[O(p,{ref:"searchInput",class:"form-input w-full",type:"text",onChange:t[0]||(t[0]=f=>{o.query=f.target.value}),value:o.query,autocomplete:"off",placeholder:"Search"},null,8,["value"]),c("button",{class:"absolute right-0 inline-flex h-7 w-7 items-center justify-center",onClick:t[1]||(t[1]=f=>r.selectedValue=null)},[O(h,{name:"x",class:"w-4"})])])])),(a(!0),n(j,null,B(r.groups,f=>I((a(),n("div",{key:f.key},[f.group&&!f.hideLabel?(a(),n("div",he,g(f.group),1)):d("",!0),(a(!0),n(j,null,B(f.items.slice(0,50),(u,G)=>(a(),w(s,{as:"template",key:(u==null?void 0:u.value)||G,value:u},{default:C(({active:S,selected:q})=>[c("li",{class:V(["flex cursor-pointer items-center justify-between rounded px-2.5 py-1.5 text-base",{"bg-gray-100":S}])},[c("div",fe,[e.$slots["item-prefix"]||e.$props.multiple?(a(),n("div",pe,[y(e.$slots,"item-prefix",z({ref_for:!0},{active:S,selected:q,option:u}),()=>[r.isOptionSelected(u)?(a(),w(h,{key:0,name:"check",class:"h-4 w-4 text-gray-700"})):(a(),n("div",_e))])])):d("",!0),c("span",be,g(r.getLabel(u)),1),c("span",ge,g(r.getmobile(u)),1)]),e.$slots["item-suffix"]||u!=null&&u.description?(a(),n("div",ye,[y(e.$slots,"item-suffix",z({ref_for:!0},{active:S,selected:q,option:u}),()=>[u!=null&&u.description?(a(),n("div",ve,g(u.description),1)):d("",!0)])])):d("",!0)],2)]),_:2},1032,["value"]))),128))])),[[M,f.items.length>0]])),128)),r.groups.length==0?(a(),n("li",xe," No results found ")):d("",!0)]),_:3},8,["class"]),e.$slots.footer||l.multiple?(a(),n("div",we,[y(e.$slots,"footer",N(U({togglePopover:k})),()=>[l.multiple?(a(),n("div",Ce,[r.areAllOptionsSelected?d("",!0):(a(),w(b,{key:0,label:"Select All",onClick:F(r.selectAll,["stop"])},null,8,["onClick"])),r.areAllOptionsSelected?(a(),w(b,{key:1,label:"Clear All",onClick:F(r.clearAll,["stop"])},null,8,["onClick"])):d("",!0)])):d("",!0)])])):d("",!0)],2)],512),[[M,x]])]),_:2},1032,["show"])]),_:3},8,["modelValue","multiple"])}const ke=H(re,[["render",Oe]]),Ve={class:"w-full"},qe={__name:"Customer",setup(e){let t=J("base"),l=!1;const m=P(()=>{var s,i;return(s=D().posProfileData)!=null&&s.customer_groups?(i=D().posProfileData)==null?void 0:i.customer_groups.map(b=>b.customer_group):[]}),o=K({doctype:"Customer",fields:["name","mobile_no","customer_group","territory","is_internal_customer"],filters:{disabled:!1},orFilters:m.value.length>0?[["customer_group","in",m.value]]:[],pageLength:Number.MAX_VALUE*2,auto:!0,onSuccess(s){l=!1},onError(s){l||(ae({title:"error",message:Array.isArray(s==null?void 0:s.messages)?s.messages[0]:(s==null?void 0:s.messages)||s||"An error occurred",icon:"x-circle",iconClasses:"bg-surface-red-5 text-ink-white rounded-md p-px",position:"top-center",timeout:5}),l=!0)},transform:s=>s.map(i=>({label:i.name,value:i.name,mobile_no:i.mobile_no,name:i.name,customer_group:i.customer_group,territory:i.territory,is_internal_customer:i.is_internal_customer}))}),r=P(()=>o!=null&&o.data?o.data.map(s=>({mobile_no:s.mobile_no||"",label:s.label||"Unnamed",value:s.value,name:s.name,customer_group:s.customer_group,territory:s.territory,is_internal_customer:s.is_internal_customer})):[]),p=async s=>{await o.fetch(),h.value={mobile_no:s.mobile_no||"",label:s.name||"Unnamed",value:s.name,name:s.name,customer_group:s.customer_group,territory:s.territory,is_internal_customer:s.is_internal_customer}};W(()=>{L.on("customerCreated",p)}),Y(()=>{L.off("customerCreated",p)});const h=P({get:()=>t.customer,set:s=>{t.is_return||(t.customer=s,L.emit("calctotal"))}});return(s,i)=>(a(),n("div",Ve,[O(ke,{options:r.value,modelValue:h.value,"onUpdate:modelValue":i[0]||(i[0]=b=>h.value=b),placeholder:"Select Customer"},null,8,["options","modelValue"])]))}};export{qe as _};
+//# sourceMappingURL=Customer--u-fbBj5.js.map
diff --git a/ant_pos/public/antPOS/assets/Customer-BDZj7gWa.js.map b/ant_pos/public/antPOS/assets/Customer--u-fbBj5.js.map
similarity index 50%
rename from ant_pos/public/antPOS/assets/Customer-BDZj7gWa.js.map
rename to ant_pos/public/antPOS/assets/Customer--u-fbBj5.js.map
index 3e067cf..270b569 100644
--- a/ant_pos/public/antPOS/assets/Customer-BDZj7gWa.js.map
+++ b/ant_pos/public/antPOS/assets/Customer--u-fbBj5.js.map
@@ -1 +1 @@
-{"version":3,"file":"Customer-BDZj7gWa.js","sources":["../../../../AntPos/src/components/custom_components/Autocomplete.vue","../../../../AntPos/src/components/Customer.vue"],"sourcesContent":["\n
n[$]!==I)))return t;n=f;let R;if(l.key&&((s=l.debug)!=null&&s.call(l))&&(R=Date.now()),t=i(...f),l.key&&((p=l.debug)!=null&&p.call(l))){const I=Math.round((Date.now()-d)*100)/100,$=Math.round((Date.now()-R)*100)/100,L=$/16,N=(y,P)=>{for(y=String(y);y.length
{n=o},a}function Ie(e,i){if(e===void 0)throw new Error("Unexpected undefined");return e}const vt=(e,i)=>Math.abs(e-i)<1.01,ht=(e,i,l)=>{let n;return function(...t){e.clearTimeout(n),n=e.setTimeout(()=>i.apply(this,t),l)}},Pe=e=>{const{offsetWidth:i,offsetHeight:l}=e;return{width:i,height:l}},mt=e=>e,bt=e=>{const i=Math.max(e.startIndex-e.overscan,0),l=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let t=i;t<=l;t++)n.push(t);return n},gt=(e,i)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;const t=o=>{const{width:s,height:p}=o;i({width:Math.round(s),height:Math.round(p)})};if(t(Pe(l)),!n.ResizeObserver)return()=>{};const a=new n.ResizeObserver(o=>{const s=()=>{const p=o[0];if(p!=null&&p.borderBoxSize){const v=p.borderBoxSize[0];if(v){t({width:v.inlineSize,height:v.blockSize});return}}t(Pe(l))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return a.observe(l,{box:"border-box"}),()=>{a.unobserve(l)}},Te={passive:!0},Ee=typeof window>"u"?!0:"onscrollend"in window,yt=(e,i)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;let t=0;const a=e.options.useScrollendEvent&&Ee?()=>{}:ht(n,()=>{i(t,!1)},e.options.isScrollingResetDelay),o=d=>()=>{const{horizontal:f,isRtl:b}=e.options;t=f?l.scrollLeft*(b&&-1||1):l.scrollTop,a(),i(t,d)},s=o(!0),p=o(!1);p(),l.addEventListener("scroll",s,Te);const v=e.options.useScrollendEvent&&Ee;return v&&l.addEventListener("scrollend",p,Te),()=>{l.removeEventListener("scroll",s),v&&l.removeEventListener("scrollend",p)}},xt=(e,i,l)=>{if(i!=null&&i.borderBoxSize){const n=i.borderBoxSize[0];if(n)return Math.round(n[l.options.horizontal?"inlineSize":"blockSize"])}return e[l.options.horizontal?"offsetWidth":"offsetHeight"]},Ot=(e,{adjustments:i=0,behavior:l},n)=>{var t,a;const o=e+i;(a=(t=n.scrollElement)==null?void 0:t.scrollTo)==null||a.call(t,{[n.options.horizontal?"left":"top"]:o,behavior:l})};class wt{constructor(i){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let l=null;const n=()=>l||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:l=new this.targetWindow.ResizeObserver(t=>{t.forEach(a=>{const o=()=>{this._measureElement(a.target,a)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var t;(t=n())==null||t.disconnect(),l=null},observe:t=>{var a;return(a=n())==null?void 0:a.observe(t,{box:"border-box"})},unobserve:t=>{var a;return(a=n())==null?void 0:a.unobserve(t)}}})(),this.range=null,this.setOptions=l=>{Object.entries(l).forEach(([n,t])=>{typeof t>"u"&&delete l[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:mt,rangeExtractor:bt,onChange:()=>{},measureElement:xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...l}},this.notify=l=>{var n,t;(t=(n=this.options).onChange)==null||t.call(n,this,l)},this.maybeNotify=oe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),l=>{this.notify(l)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(l=>l()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var l;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((l=this.scrollElement)==null?void 0:l.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset() {{ description }} {{ description }} Name Customer Amount Outstanding No invoices found {{ invoice.name }} {{ invoice.customer }} {{ invoice.grand_total }} {{ invoice.outstanding_amount }} Payment Total Payment Method Name Customer Amount Outstanding No invoices found {{ invoice.name }} {{ invoice.customer }} {{ invoice.grand_total }} {{ invoice.outstanding_amount }} Payment Total Payment Method