BETA for new DB
This commit is contained in:
@@ -16,9 +16,15 @@ const router = useRouter()
|
||||
const items = ref([])
|
||||
const dataLoaded = ref(false)
|
||||
|
||||
const statementallocations = ref([])
|
||||
const incominginvoices = ref([])
|
||||
|
||||
const setupPage = async () => {
|
||||
items.value = await useEntities("accounts").selectSpecial()
|
||||
|
||||
statementallocations.value = (await useEntities("statementallocations").select("*, bs_id(*)"))
|
||||
incominginvoices.value = (await useEntities("incominginvoices").select("*, vendor(*)"))
|
||||
|
||||
items.value = await Promise.all(items.value.map(async (i) => {
|
||||
let renderedAllocationsTemp = await renderedAllocations(i.id)
|
||||
let saldo = getSaldo(renderedAllocationsTemp)
|
||||
@@ -37,22 +43,22 @@ const setupPage = async () => {
|
||||
|
||||
const renderedAllocations = async (account) => {
|
||||
|
||||
let statementallocations = (await useEntities("statementallocations").select("*, bs_id(*)")).filter(i => i.account === account)
|
||||
let incominginvoices = (await useEntities("incominginvoices").select("*, vendor(*)")).filter(i => i.accounts.find(x => x.account === account))
|
||||
let statementallocationslocal = statementallocations.value.filter(i => i.account === account)
|
||||
let incominginvoiceslocal = incominginvoices.value.filter(i => i.accounts.find(x => x.account === account))
|
||||
|
||||
let tempstatementallocations = statementallocations.map(i => {
|
||||
let tempstatementallocations = statementallocationslocal.map(i => {
|
||||
return {
|
||||
...i,
|
||||
type: "statementallocation",
|
||||
date: i.bs_id.date,
|
||||
partner: i.bs_id ? (i.bs_id.debName ? i.bs_id.debName : (i.bs_id.credName ? i.bs_id.credName : '')) : ''
|
||||
date: i.bankstatement.date,
|
||||
partner: i.bankstatement ? (i.bankstatement.debName ? i.bankstatement.debName : (i.bankstatement.credName ? i.bankstatement.credName : '')) : ''
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
let incominginvoicesallocations = []
|
||||
|
||||
incominginvoices.forEach(i => {
|
||||
incominginvoiceslocal.forEach(i => {
|
||||
|
||||
incominginvoicesallocations.push(...i.accounts.filter(x => x.account === account).map(x => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user