- Corretto la possibilità di effettuare un Ordine di libri, sul sito gruppomacro.app. arriverà una email a "info@gruppomacro.app".

This commit is contained in:
Surya Paolo
2025-06-03 01:01:46 +02:00
parent 3d6455f23c
commit f85b8d0637
7 changed files with 83 additions and 64 deletions

View File

@@ -80,7 +80,8 @@ p {
/* Whitespace (imageless spacer) */
.whitespace {
line-height: 0; }
line-height: 0;
}
.firma {
font-size: 0.75rem; }

View File

@@ -58,69 +58,73 @@ html
td(class="whitespace", height="10")
p  
- var totalPrice = orders.totalPrice
- var note = orders.note
- var index = 0
- var totalPrice = orders.totalPrice
- var note = orders.note
- var index = 0
each rec in orders.items
- var descr = rec.order.product.productInfo.name
- var img = dirimg + rec.order.product.productInfo.imagefile
- var price = rec.order.price
- var after_price = rec.order.after_price
- var TotalPriceProduct = rec.order.TotalPriceProductstr
if (rec.order.gasordine)
- var gasordine = rec.order.gasordine.name
else
- var gasordine = ''
each rec in orders.items
- var descr = rec.order.product.productInfo.name
- var code = rec.order.product.productInfo.code
- var img = dirimg + rec.order.product.productInfo.imagefile
- var price = rec.order.price
- var after_price = rec.order.after_price
- var TotalPriceProduct = rec.order.TotalPriceProductstr
if (rec.order.gasordine)
- var gasordine = rec.order.gasordine.name
else
- var gasordine = ''
- var qty = rec.order.quantity
- var qtypreordered = rec.order.quantitypreordered
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
else if (rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered + ' x ' + rec.order.product.productInfo.weight
- var qty = rec.order.quantity
- var qtypreordered = rec.order.quantitypreordered
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
else if (rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered + ' x ' + rec.order.product.productInfo.weight
- var unit = rec.order.product.productInfo.unitstr
- index = index + 1
- var unit = rec.order.product.productInfo.unitstr
- index = index + 1
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
tr
td(class="column", valign="center" width="40")
p.boldhigh #{index}.
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
tr
td(class="column", valign="center" width="40")
p.boldhigh #{index}.
td(class="column sectionArticleImage", valign="top" width="150")
table(cellpadding="0", cellspacing="0", summary="", border="0")
tr
td
img(src=baseimg + img, alt="", width="150")
td(class="column", valign="top")
td(class="column sectionArticleImage", valign="top" width="150")
table(cellpadding="0", cellspacing="0", summary="", border="0")
tr
td
img(src=baseimg + img, alt="", width="150")
td(class="column", valign="top")
table(cellpadding="0", cellspacing="0", summary="", border="0")
if (qtypreordered > 0)
tr
td(class="sectionContent", valign="top")
p Gas Ordine: #{gasordine}
p  
tr
td(class="sectionContentTitle boldhigh", valign="top")
p #{descr}
table(cellpadding="0", cellspacing="0", summary="", border="0")
if (qtypreordered > 0)
tr
td(class="sectionContent", valign="top")
p Prezzo: #{price} € #{after_price}
if (qty > 0)
td(class="sectionContent", valign="top")
p Quantità: #{qty} #{unit}
if (qtypreordered > 0)
td(class="sectionContent", valign="top")
p Quantità Prenotata: #{qtypreordered} #{unit}
tr
td(class="sectionContent", valign="top")
p Totale: #{TotalPriceProduct} €
p Gas Ordine: #{gasordine}
p  
tr
td(class="sectionContentTitle boldhigh", valign="top")
p #{descr}
tr
td(class="sectionContent", valign="top")
p Codice: #{code}
tr
td(class="sectionContent", valign="top")
p Prezzo: #{price} € #{after_price}
if (qty > 0)
td(class="sectionContent", valign="top")
p Quantità: #{qty} #{unit}
if (qtypreordered > 0)
td(class="sectionContent", valign="top")
p Quantità Prenotata: #{qtypreordered} #{unit}
tr
td(class="sectionContent", valign="top")
p Totale: #{TotalPriceProduct} €
if (note)
p Note Aggiuntive: #{note}<br>
if (note)
p Note Aggiuntive: #{note}<br>
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
tr
td(class="whitespace", height="10")

View File

@@ -156,9 +156,6 @@ html
}
.whitespace {
line-height:0;
font-size:0;
height:20px;
}
@media only screen and (max-width:480px) {

View File

@@ -167,6 +167,7 @@ const productSchema = new Schema({
maxbookableGASQty: {
// Quantità massima (ancora disponibile) Ordine GAS prenotabile (Complessivamente tra tutti gli ordini)
type: Number,
default: -1,
},
bookedGASQtyOrdered: {
// Quantità Ordine GAS Prenotate Totali

View File

@@ -11,6 +11,7 @@ const Gasordine = require('../models/gasordine');
const tools = require('../tools/general'); // Assicurati di avere il file delle utility
const shared_consts = require('../tools/shared_nodejs'); // Assicurati di avere le costanti condivise
const Storehouse = require('../models/storehouse');
const { getTableContent } = require('../controllers/articleController');
const T_WEB_ArticoliFatturati = require('../models/t_web_articolifatturati');
@@ -591,7 +592,7 @@ class Macro {
if (options.inputdaGM)
product = this.convertiDaCampiGMACampoFDV_ProductInfo(options.idapp, product);
product = await this.convertiDaCampiGMACampoFDV_ProductInfo(options.idapp, product);
if (!product.title || !product.sku) importa = false;
@@ -710,7 +711,7 @@ class Macro {
}
}
convertiDaCampiGMACampoFDV_ProductInfo(idapp, productGM) {
async convertiDaCampiGMACampoFDV_ProductInfo(idapp, productGM) {
let productFDV = {};
/* productGM CAMPI
@@ -759,6 +760,17 @@ class Macro {
}
*/
const magazzino_macro = 'Gruppo Macro';
let recstorehouse = await Storehouse.findOne({ idapp, name: magazzino_macro }).lean();
if (!recstorehouse) {
// Non esiste questo produttore, quindi lo creo !
recstorehouse = new Storehouse({ idapp, name: magazzino_macro });
ris = await recstorehouse.save();
recstorehouse = await Storehouse.findOne({ idapp, name: prod.magazzino_name }).lean();
}
const recproduct = {
idapp: idapp,
@@ -787,11 +799,12 @@ class Macro {
ristampa: productGM.Ristampa,
eta: productGM.FasciaEta,
// addtocart_link: '',
Quantita: productGM.QtaDisponibile || undefined,
stockQty: productGM.QtaDisponibile || undefined,
date_pub: productGM.DataPubblicazione ? tools.getDateFromISOString(productGM.DataPubblicazione) : null,
sottotitolo: productGM.Sottotitolo,
productTypes: [shared_consts.PRODUCTTYPE.PRODUCT],
date_updated_fromGM: new Date(),
idStorehouses: [recstorehouse._id],
}
let vers = 0;
@@ -1007,7 +1020,7 @@ class Macro {
ristampa: product.ristampa || '',
eta: product.eta || '',
addtocart_link: product.addtocart_link || '',
quantita: product.Quantita ? parseInt(product.Quantita) : 0,
quantita: product.stockQty ? parseInt(product.stockQty) : 0,
preOrderDate: product.preOrderDate || null,
};
}
@@ -1100,6 +1113,8 @@ class Macro {
const listaCampi = [
'idapp',
'isbn',
'price',
'stockQty',
//++FIELD_PRODUCT
]
return listaCampi.some((campo) => recordOld[campo] !== recordNew[campo]);

View File

@@ -1953,13 +1953,13 @@ async function load(req, res, version = '0') {
calcstat: req.user ? User.calculateStat(idapp, req.user.username) : Promise.resolve(null),
calzoom: CalZoom.findAllIdApp(idapp),
producers: Producer.findAllIdApp(idapp),
cart: req.user ? Cart.getCartByUserId(req.user.id, idapp) : Promise.resolve(null),
cart: req.user ? Cart.getCartByUserId(userId, idapp) : Promise.resolve(null),
storehouses: Storehouse.findAllIdApp(idapp),
departments: Department.findAllIdApp(idapp),
orderscart: req.user
? User.isManager(req.user.perm)
? OrdersCart.getOrdersCartByUserId('ALL', idapp, 0, false)
: OrdersCart.getOrdersCartByUserId(req.user.id, idapp, 0, false)
: OrdersCart.getOrdersCartByUserId(userId, idapp, 0, false)
: Promise.resolve(null),
groups: Group.findAllIdApp(idapp),
resps: User.getusersRespList(idapp),

View File

@@ -1153,6 +1153,7 @@ module.exports = {
],
MAX_QTA_PREORD: 5000,
MAX_QTA_NON_IMPOSTATA: -1,
STATUSSKILL_DI_PERSONA: 1,
STATUSSKILL_ONLINE: 2,