Changed usenextnumber from supabase to fs

This commit is contained in:
2025-01-20 10:07:30 +01:00
parent 830e5d3602
commit 94d61a6d52
3 changed files with 20 additions and 22 deletions

View File

@@ -1,8 +1,8 @@
<script setup>
import dayjs from "dayjs"
import Handlebars from "handlebars"
import {useNumberRange} from "~/composables/useNumberRange.js";
import { v4 as uuidv4 } from 'uuid';
import {useFunctions} from "~/composables/useFunctions.js";
const dataStore = useDataStore()
const profileStore = useProfileStore()
@@ -804,14 +804,7 @@ const saveDocument = async (state,resetup = false) => {
type = itemInfo.value.type
}
const {data,error} = await supabase.functions.invoke("use_next_number",{
body: {
tenant: profileStore.currentTenant,
numberRange: type
}
})
itemInfo.value.documentNumber = data.usedNumber
itemInfo.value.documentNumber = await useFunctions().useNextNumber(type) //data.usedNumber
setDocumentTypeConfig(false)
}