- corretto visualizzazione dei prodotti,

- inserimento nuovi prodotti nella tabella.
This commit is contained in:
Surya Paolo
2025-09-27 20:43:46 +02:00
parent d6c0bcf879
commit 05c97ab231
11 changed files with 1446 additions and 1145 deletions

View File

@@ -4254,6 +4254,7 @@ export const colTableVariazioni = [
}),
];
/*
export const colTableProductInfos = [
AddCol({ name: 'code', label_trans: 'products.code', required: true }),
AddCol({ name: 'codice_EAN', label_trans: 'products.codice_EAN' }),
@@ -4392,6 +4393,7 @@ export const colTableProductInfos = [
AddCol(DeleteRec),
AddCol(DuplicateRec),
];
*/
export const colTableOrdersCart = [
AddCol({ name: '_id', label_trans: 'others.value' }),
@@ -4438,38 +4440,109 @@ export const colTableProdShort = [
label_trans: 'products.active',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({ name: 'name', label_trans: 'products.name' }),
AddCol({
name: 'productInfo.code',
field: 'productInfo',
subfield: 'code',
label_trans: 'products.code',
required: true,
}),
AddCol({
name: 'productInfo.name',
label_trans: 'products.name',
field: 'productInfo',
subfield: 'name',
}),
AddCol({
name: 'price',
label_trans: 'products.price',
fieldtype: costanti.FieldType.number,
required: true,
}),
AddCol({
name: 'stockQty',
label_trans: 'products.stockQty',
fieldtype: costanti.FieldType.number,
}),
AddCol({
name: 'price_acquistato',
label_trans: 'products.price_acquistato',
fieldtype: costanti.FieldType.number,
required: true,
}),
AddCol({ name: 'productInfo.code', label_trans: 'products.code', required: true }),
AddCol({
name: 'idProducer',
label_trans: 'products.producer',
fieldtype: costanti.FieldType.select,
jointable: 'producers',
}),
AddCol({
name: 'idStorehouses',
label_trans: 'storehouses.name',
fieldtype: costanti.FieldType.multiselect,
jointable: 'storehouses',
}),
AddCol({
name: 'idGasordine',
label_trans: 'gas.name',
fieldtype: costanti.FieldType.select,
jointable: 'gasordines',
}),
AddCol({
name: 'idProvider',
label_trans: 'provider.name',
fieldtype: costanti.FieldType.select,
jointable: 'providers',
}),
AddCol({
name: 'productInfo.description',
label_trans: 'products.description',
fieldtype: costanti.FieldType.html,
field: 'productInfo',
subfield: 'description',
}),
AddCol({
name: 'productInfo.imagefile',
field: 'productInfo',
subfield: 'imagefile',
label_trans: 'products.img',
fieldtype: costanti.FieldType.imgfile_sfuso,
path: 'products/',
path: 'upload/products/',
}),
AddCol({
name: 'productInfo.idCatProds',
field: 'productInfo',
subfield: 'idCatProds',
label_trans: 'products.category',
fieldtype: costanti.FieldType.multiselect,
jointable: 'catprods',
}),
AddCol({
name: 'date_pub',
field: 'productInfo',
subfield: 'date_pub',
label_trans: 'reg.pub_created',
fieldtype: costanti.FieldType.onlydate,
required: false,
sortable: true,
showWhen:
costanti.showWhen.InPage +
costanti.showWhen.InEdit +
costanti.showWhen.InView_OnlyifExist,
}),
AddCol({
name: 'date_updated',
field: 'productInfo',
subfield: 'date_updated',
label_trans: 'reg.pub_updated',
fieldtype: costanti.FieldType.onlydate,
required: false,
sortable: true,
showWhen:
costanti.showWhen.InPage +
costanti.showWhen.InEdit +
costanti.showWhen.InView_OnlyifExist,
}),
AddCol(DeleteRec),
AddCol(DuplicateRec),
];
@@ -4482,12 +4555,6 @@ export const colTableProducts = [
}),
AddCol({ name: 'isbn', label_trans: 'products.isbn' }),
AddCol({ name: 'name', label_trans: 'products.name' }),
/*AddCol({
name: 'idProductInfo',
label_trans: 'products.productInfo',
fieldtype: costanti.FieldType.select,
jointable: 'productinfos',
}),*/
AddCol({
name: 'idProducer',
label_trans: 'products.producer',
@@ -4540,7 +4607,6 @@ export const colTableProducts = [
name: 'price_acquistato',
label_trans: 'products.price_acquistato',
fieldtype: costanti.FieldType.number,
required: true,
}),
AddCol({ name: 'after_price', label_trans: 'products.after_price' }),
AddCol({
@@ -7147,7 +7213,7 @@ export const fieldsTable = {
label: 'Prodotti',
columns: colTableProducts,
colkey: '_id',
collabel: 'name',
collabel: (rec: any) => `${rec.productInfo.name}`,
},
{
value: 'orderscarts',