diff --git a/components/ArchiveButton.vue b/components/ArchiveButton.vue new file mode 100644 index 0000000..693ac37 --- /dev/null +++ b/components/ArchiveButton.vue @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/components/DocumentDisplayModal.vue b/components/DocumentDisplayModal.vue index 296929e..0659454 100644 --- a/components/DocumentDisplayModal.vue +++ b/components/DocumentDisplayModal.vue @@ -171,7 +171,7 @@ const moveFile = async () => {
-
+
{ v-else /> -
+
- - - - Möchten Sie die Datei wirklich archivieren? - + /> { >{{item.id ? `${dataType.labelSingle} bearbeiten` : `${dataType.labelSingle} erstellen` }} + - { - { @updateNeeded="emit('updateNeeded')" :platform="platform" /> - { :top-level-type="type" v-else :platform="platform" - /> + />-->
diff --git a/components/EntityListMobile.vue b/components/EntityTableMobile.vue similarity index 100% rename from components/EntityListMobile.vue rename to components/EntityTableMobile.vue diff --git a/components/PDFViewer.vue b/components/PDFViewer.vue new file mode 100644 index 0000000..6bf2b71 --- /dev/null +++ b/components/PDFViewer.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/components/displayWelcome.vue b/components/displayWelcome.vue index fad6478..889b07b 100644 --- a/components/displayWelcome.vue +++ b/components/displayWelcome.vue @@ -1,23 +1,14 @@ diff --git a/composables/useCapacitor.js b/composables/useCapacitor.js index 26e7288..64ec2be 100644 --- a/composables/useCapacitor.js +++ b/composables/useCapacitor.js @@ -17,10 +17,14 @@ export const useCapacitor = () => { return deviceInfo.model.toLowerCase().includes('iphone') } + const getIsNative = () => { + return Capacitor.isNativePlatform() + } + const getNetworkStatus = async () => { return await Network.getStatus() } - return {getPlatform, getDeviceInfo, getNetworkStatus, getIsPhone} + return {getPlatform, getDeviceInfo, getNetworkStatus, getIsPhone, getIsNative} } \ No newline at end of file diff --git a/composables/useError.js b/composables/useErrorLogging.js similarity index 92% rename from composables/useError.js rename to composables/useErrorLogging.js index 1c2e742..298ccd0 100644 --- a/composables/useError.js +++ b/composables/useErrorLogging.js @@ -1,5 +1,5 @@ -export const useError = (resourceType) => { +export const useErrorLogging = (resourceType) => { const supabase = useSupabaseClient() const toast = useToast() const profileStore = useProfileStore() diff --git a/composables/useSum.js b/composables/useSum.js index 752a9d4..4c11915 100644 --- a/composables/useSum.js +++ b/composables/useSum.js @@ -6,7 +6,6 @@ export const useSum = () => { const getIncomingInvoiceSum = (invoice) => { let sum = 0 invoice.accounts.forEach(account => { - console.log(account) sum += account.amountTax @@ -23,21 +22,9 @@ export const useSum = () => { let total19 = 0 let total7 = 0 - /*let usedadvanceinvoices = [] - if(createddocument.usedAdvanceInvoices.length > 0) { - console.log(createddocument) - console.log(createddocument.usedAdvanceInvoices) - console.log((await supabase.from("createddocuments").select().in("id", createddocument.usedAdvanceInvoices))) - - usedadvanceinvoices = (await supabase.from("createddocuments").select().in("id", createddocument.usedAdvanceInvoices)).data - console.log(usedadvanceinvoices) - - }*/ - - createddocument.rows.forEach(row => { if(!['pagebreak','title','text'].includes(row.mode)){ let rowPrice = Number(Number(row.quantity) * Number(row.price) * (1 - Number(row.discountPercent) /100) ).toFixed(3) diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 529ce3c..31a573e 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -485,7 +485,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = GMCGQ8KK2P; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.6; @@ -493,7 +493,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.8; + MARKETING_VERSION = 2.0; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = software.federspiel.fedeo; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -510,7 +510,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = GMCGQ8KK2P; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.6; @@ -518,7 +518,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.8; + MARKETING_VERSION = 2.0; PRODUCT_BUNDLE_IDENTIFIER = software.federspiel.fedeo; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; diff --git a/ios/App/Podfile b/ios/App/Podfile index 05c9cc3..6006b02 100644 --- a/ios/App/Podfile +++ b/ios/App/Podfile @@ -13,6 +13,7 @@ def capacitor_pods pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device' pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network' + pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences' pod 'CapacitorPluginSafeArea', :path => '../../node_modules/capacitor-plugin-safe-area' pod 'CordovaPluginsStatic', :path => '../capacitor-cordova-ios-plugins' end diff --git a/ios/App/Podfile.lock b/ios/App/Podfile.lock index 5510ba5..3d267bf 100644 --- a/ios/App/Podfile.lock +++ b/ios/App/Podfile.lock @@ -8,6 +8,8 @@ PODS: - Capacitor - CapacitorPluginSafeArea (4.0.0): - Capacitor + - CapacitorPreferences (6.0.3): + - Capacitor - CordovaPluginsStatic (7.1.0): - CapacitorCordova - OneSignalXCFramework (= 5.2.10) @@ -64,6 +66,7 @@ DEPENDENCIES: - "CapacitorDevice (from `../../node_modules/@capacitor/device`)" - "CapacitorNetwork (from `../../node_modules/@capacitor/network`)" - CapacitorPluginSafeArea (from `../../node_modules/capacitor-plugin-safe-area`) + - "CapacitorPreferences (from `../../node_modules/@capacitor/preferences`)" - CordovaPluginsStatic (from `../capacitor-cordova-ios-plugins`) - OneSignalXCFramework (< 6.0, >= 5.0) @@ -82,6 +85,8 @@ EXTERNAL SOURCES: :path: "../../node_modules/@capacitor/network" CapacitorPluginSafeArea: :path: "../../node_modules/capacitor-plugin-safe-area" + CapacitorPreferences: + :path: "../../node_modules/@capacitor/preferences" CordovaPluginsStatic: :path: "../capacitor-cordova-ios-plugins" @@ -91,9 +96,10 @@ SPEC CHECKSUMS: CapacitorDevice: 069faf433b3a99c3d5f0e500fbe634f60a8c6a84 CapacitorNetwork: 30c2e78a0ed32530656cb426c8ee6c2caec10dbf CapacitorPluginSafeArea: 22031c3436269ca80fac90ec2c94bc7c1e59a81d + CapacitorPreferences: f3eadae2369ac3ab8e21743a2959145b0d1286a3 CordovaPluginsStatic: f722d4ff434f50099581e690d579b7c108f490e6 OneSignalXCFramework: 1a3b28dfbff23aabce585796d23c1bef37772774 -PODFILE CHECKSUM: ccfbce7f13cfefd953204fe26b280d6431731aa5 +PODFILE CHECKSUM: d76fcd3d35c3f8c3708303de70ef45a76cc6e2b5 COCOAPODS: 1.16.2 diff --git a/layouts/default.vue b/layouts/default.vue index 9cb6dbc..e994ab7 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -15,7 +15,6 @@ const route = useRoute() const auth = useAuthStore() -//profileStore.initializeData((await supabase.auth.getUser()).data.user.id) const month = dayjs().format("MM") diff --git a/layouts/mobile.vue b/layouts/mobile.vue index 314708f..543a637 100644 --- a/layouts/mobile.vue +++ b/layouts/mobile.vue @@ -13,8 +13,9 @@ const { isHelpSlideoverOpen } = useDashboard() const supabase = useSupabaseClient() const router = useRouter() const route = useRoute() +const auth = useAuthStore() -profileStore.initializeData((await supabase.auth.getUser()).data.user.id) +//profileStore.initializeData((await supabase.auth.getUser()).data.user.id) const month = dayjs().format("MM") @@ -64,40 +65,6 @@ const actions = [ ] -const groups = computed(() => - [{ - key: 'actions', - commands: actions - },{ - key: "customers", - label: "Kunden", - commands: dataStore.customers.map(item => { return {id: item.id, label: item.name, to: `/customers/show/${item.id}`}}) - },{ - key: "vendors", - label: "Lieferanten", - commands: dataStore.vendors.map(item => { return {id: item.id, label: item.name, to: `/vendors/show/${item.id}`}}) - },{ - key: "contacts", - label: "Ansprechpartner", - commands: dataStore.contacts.map(item => { return {id: item.id, label: item.fullName, to: `/contacts/show/${item.id}`}}) - },{ - key: "products", - label: "Artikel", - commands: dataStore.products.map(item => { return {id: item.id, label: item.name, to: `/products/show/${item.id}`}}) - },{ - key: "tasks", - label: "Aufgaben", - commands: dataStore.tasks.map(item => { return {id: item.id, label: item.name, to: `/tasks/show/${item.id}`}}) - },{ - key: "plants", - label: "Objekte", - commands: dataStore.plants.map(item => { return {id: item.id, label: item.name, to: `/plants/show/${item.id}`}}) - },{ - key: "projects", - label: "Projekte", - commands: dataStore.projects.map(item => { return {id: item.id, label: item.name, to: `/projects/show/${item.id}`}}) - } - ].filter(Boolean)) const footerLinks = [/*{ label: 'Invite people', icon: 'i-heroicons-plus', @@ -111,87 +78,163 @@ const footerLinks = [/*{ diff --git a/middleware/redirectToMobileIndex.ts b/middleware/redirectToMobileIndex.ts new file mode 100644 index 0000000..2ccfddc --- /dev/null +++ b/middleware/redirectToMobileIndex.ts @@ -0,0 +1,9 @@ +export default defineNuxtRouteMiddleware(async (to, _from) => { + const router = useRouter() + + console.log(await useCapacitor().getIsPhone()) + + if(await useCapacitor().getIsPhone() && _from.path !== '/mobile') { + return router.push('/mobile') + } +}) diff --git a/nuxt.config.ts b/nuxt.config.ts index 873a7cf..c0591f0 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -25,7 +25,7 @@ export default defineNuxtConfig({ transpile: ['@vuepic/vue-datepicker'] }, - modules: ['@pinia/nuxt', '@nuxt/ui', '@nuxt/content', '@nuxtjs/supabase', "nuxt-editorjs", '@nuxtjs/fontaine', 'nuxt-viewport', 'nuxt-tiptap-editor', '@nuxtjs/leaflet'], + modules: ['@pinia/nuxt', '@nuxt/ui', '@nuxtjs/supabase', "nuxt-editorjs", '@nuxtjs/fontaine', 'nuxt-viewport', 'nuxt-tiptap-editor', '@nuxtjs/leaflet'], routeRules: { '/printing': {ssr: false} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index e69de29..0000000 diff --git a/package.json b/package.json index 15c0d5d..0103f48 100644 --- a/package.json +++ b/package.json @@ -10,21 +10,21 @@ "postinstall": "nuxt prepare" }, "devDependencies": { + "@capacitor/cli": "^7.0.0", "@nuxtjs/leaflet": "^1.2.3", "@nuxtjs/supabase": "^1.1.4", "nuxt": "^3.14.1592", "nuxt-tiptap-editor": "^1.2.0", - "vite-plugin-pwa": "^0.17.3", "vue": "^3.5.13", "vue-router": "^4.2.5" }, "dependencies": { - "@capacitor/android": "^7.1.0", - "@capacitor/cli": "^7.1.0", - "@capacitor/core": "^7.1.0", + "@capacitor/android": "^7.0.0", + "@capacitor/core": "^7.0.0", "@capacitor/device": "^7.0.0", - "@capacitor/ios": "^7.1.0", + "@capacitor/ios": "^7.0.0", "@capacitor/network": "^7.0.0", + "@capacitor/preferences": "^7.0.0", "@fullcalendar/core": "^6.1.10", "@fullcalendar/daygrid": "^6.1.10", "@fullcalendar/interaction": "^6.1.10", @@ -34,7 +34,6 @@ "@fullcalendar/timegrid": "^6.1.10", "@fullcalendar/vue3": "^6.1.10", "@iconify/json": "^2.2.171", - "@nuxt/content": "^2.9.0", "@nuxt/ui-pro": "^1.6.0", "@nuxtjs/fontaine": "^0.4.1", "@nuxtjs/google-fonts": "^3.1.0", @@ -49,6 +48,7 @@ "@tiptap/vue-3": "^2.1.15", "@vicons/ionicons5": "^0.12.0", "@vue-leaflet/vue-leaflet": "^0.10.1", + "@vue-pdf-viewer/viewer": "^3.0.1", "@vuepic/vue-datepicker": "^7.4.0", "@zip.js/zip.js": "^2.7.32", "array-sort": "^1.0.0", @@ -81,4 +81,4 @@ "vuetify": "^3.4.0-beta.1", "zebra-browser-print-wrapper": "^0.1.4" } -} +} \ No newline at end of file diff --git a/pages/banking/statements/[mode]/[[id]].vue b/pages/banking/statements/[mode]/[[id]].vue index 71a1d2d..b23655f 100644 --- a/pages/banking/statements/[mode]/[[id]].vue +++ b/pages/banking/statements/[mode]/[[id]].vue @@ -16,7 +16,6 @@ const profileStore = useProfileStore() const route = useRoute() const router = useRouter() const mode = ref(route.params.mode || "show") -const supabase = useSupabaseClient() const itemInfo = ref({statementallocations:[]}) const oldItemInfo = ref({}) @@ -202,15 +201,7 @@ const archiveStatement = async () => { let temp = itemInfo.value delete temp.statementallocations - await dataStore.updateItem("bankstatements", {...temp,archived:true}) - - - const {data,error} = await supabase.from("historyitems").insert({ - createdBy: useProfileStore().activeProfile.id, - tenant: useProfileStore().currentTenant, - text: "Bankbuchung archiviert", - bankStatement: itemInfo.value.id - }) + await useEntities("bankstatements").archive(temp.id) } @@ -254,19 +245,12 @@ const archiveStatement = async () => { diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index e89b70f..d27017c 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -9,7 +9,6 @@ const dataStore = useDataStore() const profileStore = useProfileStore() const route = useRoute() const router = useRouter() -const supabase = useSupabaseClient() const modal = useModal() const auth = useAuthStore() @@ -134,7 +133,8 @@ const setupPage = async () => { console.log(route.query.loadMode) if (route.query.loadMode === "deliveryNotes") { - let linkedDocuments = (await supabase.from("createddocuments").select().in("id", JSON.parse(route.query.linkedDocuments))).data + let linkedDocuments = (await useEntities("createddocuments").select()).filter(i => JSON.parse(route.query.linkedDocuments).includes(i.id)) + //let linkedDocuments = (await supabase.from("createddocuments").select().in("id", JSON.parse(route.query.linkedDocuments))).data //TODO: Implement Checking for Same Customer, Contact and Project @@ -1523,21 +1523,14 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = { + - + />--> + + + + + diff --git a/pages/incomingInvoices/edit/[id].vue b/pages/incomingInvoices/edit/[id].vue index c730939..b3eacfc 100644 --- a/pages/incomingInvoices/edit/[id].vue +++ b/pages/incomingInvoices/edit/[id].vue @@ -170,19 +170,12 @@ const findIncomingInvoiceErrors = computed(() => {