- i filtri non venivano correttamente salvati sui cookies (compariva null e -100)

- aggiunte tabelle accounts e circuits
This commit is contained in:
Paolo Arena
2022-05-08 00:09:38 +02:00
parent 11acac03e5
commit b1fa4c4e2d
19 changed files with 350 additions and 65 deletions

View File

@@ -264,9 +264,7 @@ export const getcolorderscart = [
AddCol({ name: 'created_at', label_trans: 'order.created_at', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'status', label_trans: 'order.status' }),
AddCol({ name: 'items', label_trans: 'order.items' }),
AddCol({
name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users',
}),
AddCol({ name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users', }),
AddCol({ name: 'note', label_trans: 'order.note' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
@@ -1044,8 +1042,9 @@ export const colmyHosp = [
fieldtype: costanti.FieldType.listimages,
jointable: '',
showpicprofile_ifnotset: true,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
isadvanced_field: false,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
isadvanced_field: true,
sortable: false,
}),
AddCol({
name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html,
@@ -2294,8 +2293,8 @@ export const colTableCircuit = [
AddCol({ name: 'subname', label_trans: 'circuit.subname' }),
AddCol({ name: 'descr', label_trans: 'circuit.descr' }),
AddCol({ name: 'systemUserDescr', label_trans: 'circuit.systemUserDescr' }),
AddCol({ name: 'systemUserId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users', }),
AddCol({ name: 'founderUserId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users', }),
AddCol({ name: 'systemUserId', label_trans: 'circuit.systemUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
AddCol({ name: 'founderUserId', label_trans: 'circuit.founderUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
AddCol({ name: 'totCircolante', label_trans: 'circuit.totCircolante', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'totTransato', label_trans: 'circuit.totTransato', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'nome_valuta', label_trans: 'circuit.nome_valuta' }),
@@ -2314,10 +2313,33 @@ export const colTableCircuit = [
AddCol({ name: 'mese_deper', label_trans: 'circuit.mese_deper', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'ultimo_deper', label_trans: 'circuit.ultimo_deper', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'durata_deper', label_trans: 'circuit.durata_deper', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'img_logo', label_trans: 'circuit.img_logo' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colTableAccount = [
AddCol({ name: 'circuitId', label_trans: 'account.circuitId', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'userId', label_trans: 'account.users', fieldtype: costanti.FieldType.select, jointable: 'users', }),
AddCol({ name: 'name', label_trans: 'circuit.name' }),
AddCol({ name: 'deperibile', label_trans: 'account.deperibile', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'importo_iniziale', label_trans: 'account.importo_iniziale', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'saldo', label_trans: 'account.saldo', fieldtype: costanti.FieldType.number }),
]
export const colTableMovement = [
AddCol({ name: 'transactionDate', label_trans: 'movement.transactionDate', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'accountFromId', label_trans: 'movement.accountFromId', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'accountToId', label_trans: 'movement.accountToId', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'amount', label_trans: 'movement.amount', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'causal', label_trans: 'movement.causal' }),
AddCol({ name: 'causal_table', label_trans: 'movement.causal_table' }),
AddCol({ name: 'causal_IdRec', label_trans: 'movement.causal_IdRec', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'residual', label_trans: 'movement.residual', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'expiringDate', label_trans: 'movement.expiringDate', fieldtype: costanti.FieldType.date }),
]
export const fieldsTable = {
getrecTableList(mytable: string) {
return this.tablesList.find((rec) => rec.value === mytable)
@@ -2408,7 +2430,7 @@ export const fieldsTable = {
'myskills',
'mygoods',
'mybachecas',
'myhosp',
'myhosps',
],
tableRemotePickup: [
@@ -2421,9 +2443,17 @@ export const fieldsTable = {
'myskills',
'mygoods',
'mybachecas',
'myhosp',
'myhosps',
],
circuitslist() {
return colTableCircuit
},
accountslist() {
return colTableAccount
},
userlist() {
if (static_data.functionality.ENABLE_REG_AYNI) {
return colTableUsers

View File

@@ -3268,7 +3268,7 @@ export const tools = {
},
getwidthscale(mythis: any, mywidthpass: string, maxwidth: string): number {
let mywidth = parseInt(mywidthpass)
let mywidth = parseInt(mywidthpass, 10)
if (this.isMobile()) {
// if (mywidth > this.getwidth(mythis) - 20)
mywidth = this.getwidth(mythis, false, false) - 32
@@ -3279,8 +3279,8 @@ export const tools = {
// console.log('this.getwidth(mythis) = ', this.getwidth(mythis))
let myw: number = mywidth + ((this.getwidth(mythis, true) - mywidth) * 0.6)
// console.log('myw1 = ', myw)
if (myw > parseInt(maxwidth))
myw = parseInt(maxwidth)
if (myw > parseInt(maxwidth, 10))
myw = parseInt(maxwidth, 10)
if (myw > this.getwidth(mythis) - 24)
myw = this.getwidth(mythis) - 24
@@ -3292,7 +3292,7 @@ export const tools = {
getheightbywidth(mythis: any, mywidth: string, myheight: string, maxwidth: string) {
// console.log('getheightbywidth')
const myw = this.getwidthscale(mythis, mywidth, maxwidth)
return myw * (parseInt(myheight) / parseInt(mywidth))
return myw * (parseInt(myheight, 10) / parseInt(mywidth))
},
isIsoDate(str: string) {
@@ -3347,9 +3347,36 @@ export const tools = {
else
return 'primary'
},
getCookie(mytok: any, def?: any) {
convstrToNum(myval: any) {
if (typeof myval == 'number' && !isNaN(myval)) {
if (Number.isInteger(myval)) {
return myval
} else {
// @ts-ignore
return parseFloat(myval)
}
}
},
getCookie(mytok: any, def?: any, convertint: any = false) {
const ris = Cookies.get(mytok)
// console.log('getCookie', mytok, ris)
if (ris === 'null')
return def
if (ris === '-100')
return -100
if (convertint && !!ris) {
return parseInt(ris, 10)
}
// if (typeof(ris) == 'number') {
// return this.convstrToNum(ris)
// }
if (!!ris) {
return ris
} else {