++ Cassa - parte 1

This commit is contained in:
Surya Paolo
2024-01-02 15:24:57 +01:00
parent a2cab9ca60
commit 89d095d1c9
18 changed files with 441 additions and 376 deletions

View File

@@ -1685,7 +1685,7 @@ export const colTableSites = [
AddCol({ name: 'telegram_support_chat', label_trans: 'sites.telegram_support_chat', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'telegram_key_test', label_trans: 'sites.telegram_key_test', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'load_process_telegram_test', label_trans: 'sites.load_process_telegram_test', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'load_process_telegramt', label_trans: 'sites.load_process_telegram', fieldtype: costanti.FieldType.boolean}),
AddCol({ name: 'load_process_telegramt', label_trans: 'sites.load_process_telegram', fieldtype: costanti.FieldType.boolean }),
AddCol({
name: 'telegram_bot_name_test',
label_trans: 'sites.telegram_bot_name_test',
@@ -1997,17 +1997,28 @@ export const colTableProductInfos = [
AddCol({ name: 'size', label_trans: 'products.size' }),
AddCol({ name: 'weight', label_trans: 'products.weight', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'vegan', label_trans: 'products.vegan', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'unit', label_trans: 'products.unit',
fieldtype: costanti.FieldType.select, jointable: 'units', }),
AddCol({
name: 'unit', label_trans: 'products.unit',
fieldtype: costanti.FieldType.select, jointable: 'units',
}),
AddCol({ name: 'stars', label_trans: 'products.stars', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'date', label_trans: 'products.date', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'ingredienti', label_trans: 'products.ingredienti' }),
AddCol({ name: 'valori_nutrizionali', label_trans: 'products.valori_nutrizionali' }),
AddCol({ name: 'note', label_trans: 'products.note' }),
AddCol({ name: 'ingredienti', label_trans: 'products.ingredienti', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'valori_nutrizionali', label_trans: 'products.valori_nutrizionali', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'note', label_trans: 'products.note', fieldtype: costanti.FieldType.html }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colTableOrdersCart = [
AddCol({ name: '_id', label_trans: 'others.value' }),
AddCol({ name: 'numorder', label_trans: 'orderscart.numorder', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'totalQty', label_trans: 'orderscart.totalQty', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'totalQtyPreordered', label_trans: 'orderscart.totalQtyPreordered', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'totalPrice', label_trans: 'orderscart.totalPrice', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'status', label_trans: 'orderscart.status', fieldtype: costanti.FieldType.number }),
]
export const colTableProducts = [
AddCol({ name: 'active', label_trans: 'products.active', fieldtype: costanti.FieldType.boolean }),
AddCol({
@@ -2375,6 +2386,37 @@ const colTableEvents = [
AddCol(DuplicateRec),
]
export const colTableCash = [
AddCol({ name: '_id', label_trans: 'event._id' }),
AddCol({ name: 'creatorUserId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users' }),
AddCol({
name: 'idCashCategory',
label_trans: 'Category.idCashCategory',
fieldtype: costanti.FieldType.select,
jointable: 'cashcategory',
}),
AddCol({ name: 'fromUserId', label_trans: 'cash.fromUserId', fieldtype: costanti.FieldType.select, jointable: 'users' }),
AddCol({ name: 'toUserId', label_trans: 'cash.toUserId', fieldtype: costanti.FieldType.select, jointable: 'users' }),
AddCol({ name: 'idOrdersCart', label_trans: 'cash.orderscart', fieldtype: costanti.FieldType.select, jointable: 'orderscart' }),
AddCol({ name: 'type', label_trans: 'cash.type', fieldtype: costanti.FieldType.select, jointable: toolsext.TABTYPECASH }),
AddCol({
name: 'date_payment', label_trans: 'cash.date_payment', fieldtype: costanti.FieldType.onlydate,
sortable: true,
}),
AddCol({ name: 'price', label_trans: 'products.price', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'causale', label_trans: 'cash.causale' }),
AddCol({ name: 'note', label_trans: 'cash.note' }),
AddCol({ name: 'internal', label_trans: 'cash.internal', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'extra', label_trans: 'cash.extra', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'confirmed', label_trans: 'cash.confirmed', fieldtype: costanti.FieldType.boolean }),
AddCol({
name: 'date_created', label_trans: 'reg.pub_created', fieldtype: costanti.FieldType.onlydate,
sortable: true,
}),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const fields = {
colSettings: [
AddCol({ name: 'key', label_trans: 'col.label' }),
@@ -3120,8 +3162,6 @@ export const colTableExtraList = [
AddCol(DuplicateRec),
]
export const colTableCash = []
export const colTableCashCategory = [
AddCol({ name: 'descr', label_trans: 'pages.description' }),
AddCol({ name: 'notes', label_trans: 'reg.note' }),
@@ -3642,6 +3682,13 @@ export const fieldsTable = {
colkey: '_id',
collabel: '_id',
},
{
value: 'orderscart',
label: 'Ordini',
columns: colTableOrdersCart,
colkey: '_id',
collabel: 'numorder',
},
{
value: 'productinfos',
label: 'Info Prodotti',
@@ -3656,6 +3703,13 @@ export const fieldsTable = {
colkey: '_id',
collabel: 'name',
},
{
value: 'cashs',
label: 'Cassa',
columns: colTableCash,
colkey: '_id',
collabel: 'causale',
},
{
value: 'departments',
label: 'Uffici',
@@ -3874,6 +3928,13 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
{
value: toolsext.TABTYPECASH,
label: 'Ingresso/Uscita',
columns: colTableGeneric,
colkey: 'value',
collabel: 'label',
},
{
value: 'confsite_opt',
label: 'Configura Opzioni Sito',

View File

@@ -98,6 +98,7 @@ export const toolsext = {
TABCIRCUITS: 'circuits',
TABUNITS: 'units',
SERVKEY_VERS: 'vers',
TABTYPECASH: 'typecash',
ERR_GENERICO: -1,
ERR_SERVERFETCH: -2,

View File

@@ -138,7 +138,6 @@ export const useProducts = defineStore('Products', {
},
getProductById: (state: IProductsState) => (id: string): IProduct => {
const prod = state.products.find((prod: IProduct) => prod._id === id)
return prod ? prod : getRecordProductEmpty()
@@ -692,7 +691,7 @@ export const useProducts = defineStore('Products', {
let ris = null
ris = await Api.SendReq('/cart/' + userStore.my._id + '/ordercartstatus', 'POST', { order_id, status })
ris = await Api.SendReq('/cart/' + userStore.my._id + '/ordercartstatus', 'POST', { order_id, status, options })
.then((res) => {
this.updateDataProduct(res)

View File

@@ -315,6 +315,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'storehouses') ris = state.storehouses
else if (table === 'providers') ris = state.providers
else if (table === 'productinfos') ris = Products.productInfos
else if (table === 'product') ris = Products.products
else if (table === 'gasordines') ris = state.gasordines
else if (table === 'scontisticas') ris = state.scontisticas
else if (table === 'groups') ris = state.groups
@@ -1542,6 +1543,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.paymenttypes = (res.data.paymenttypes) ? [...res.data.paymenttypes] : []
this.gallery = (res.data.gallery) ? [...res.data.gallery] : []
this.calzoom = (res.data.calzoom) ? [...res.data.calzoom] : []
Products.products = (res.data.products) ? [...res.data.products] : []
Products.productInfos = (res.data.productInfos) ? [...res.data.productInfos] : []
this.producers = (res.data.producers) ? [...res.data.producers] : []
this.storehouses = (res.data.storehouses) ? [...res.data.storehouses] : []
@@ -1849,6 +1851,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABLOCACCOM) myarr = shared_consts.LocationAccom
else if (table === toolsext.TABPREF) myarr = shared_consts.Preferences
else if (table === toolsext.TABUNITS) myarr = shared_consts.Units_Of_Measure_ListBox
else if (table === toolsext.TABTYPECASH) myarr = shared_consts.TypeCashStr
else if (table === 'usernotifs') myarr = shared_consts.UsersNotif_Adv_List
else if (table === 'typenotifs') myarr = shared_consts.TypeNotifs_Arr
else myarr = this.getListByTable(table, value2)