- 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:
@@ -80,7 +80,8 @@ p {
|
|||||||
|
|
||||||
/* Whitespace (imageless spacer) */
|
/* Whitespace (imageless spacer) */
|
||||||
.whitespace {
|
.whitespace {
|
||||||
line-height: 0; }
|
line-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.firma {
|
.firma {
|
||||||
font-size: 0.75rem; }
|
font-size: 0.75rem; }
|
||||||
|
|||||||
@@ -58,69 +58,73 @@ html
|
|||||||
td(class="whitespace", height="10")
|
td(class="whitespace", height="10")
|
||||||
p
|
p
|
||||||
|
|
||||||
- var totalPrice = orders.totalPrice
|
- var totalPrice = orders.totalPrice
|
||||||
- var note = orders.note
|
- var note = orders.note
|
||||||
- var index = 0
|
- var index = 0
|
||||||
|
|
||||||
each rec in orders.items
|
each rec in orders.items
|
||||||
- var descr = rec.order.product.productInfo.name
|
- var descr = rec.order.product.productInfo.name
|
||||||
- var img = dirimg + rec.order.product.productInfo.imagefile
|
- var code = rec.order.product.productInfo.code
|
||||||
- var price = rec.order.price
|
- var img = dirimg + rec.order.product.productInfo.imagefile
|
||||||
- var after_price = rec.order.after_price
|
- var price = rec.order.price
|
||||||
- var TotalPriceProduct = rec.order.TotalPriceProductstr
|
- var after_price = rec.order.after_price
|
||||||
if (rec.order.gasordine)
|
- var TotalPriceProduct = rec.order.TotalPriceProductstr
|
||||||
- var gasordine = rec.order.gasordine.name
|
if (rec.order.gasordine)
|
||||||
else
|
- var gasordine = rec.order.gasordine.name
|
||||||
- var gasordine = ''
|
else
|
||||||
|
- var gasordine = ''
|
||||||
- var qty = rec.order.quantity
|
|
||||||
- var qtypreordered = rec.order.quantitypreordered
|
- var qty = rec.order.quantity
|
||||||
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
|
- var qtypreordered = rec.order.quantitypreordered
|
||||||
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
|
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
|
||||||
else if (rec.order.product.productInfo.weight)
|
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
|
||||||
- qtypreordered = qtypreordered + ' x ' + 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
|
- var unit = rec.order.product.productInfo.unitstr
|
||||||
- index = index + 1
|
- index = index + 1
|
||||||
|
|
||||||
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||||
tr
|
tr
|
||||||
td(class="column", valign="center" width="40")
|
td(class="column", valign="center" width="40")
|
||||||
p.boldhigh #{index}.
|
p.boldhigh #{index}.
|
||||||
|
|
||||||
td(class="column sectionArticleImage", valign="top" width="150")
|
td(class="column sectionArticleImage", valign="top" width="150")
|
||||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
img(src=baseimg + img, alt="", width="150")
|
img(src=baseimg + img, alt="", width="150")
|
||||||
td(class="column", valign="top")
|
td(class="column", valign="top")
|
||||||
|
|
||||||
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||||
if (qtypreordered > 0)
|
if (qtypreordered > 0)
|
||||||
tr
|
|
||||||
td(class="sectionContent", valign="top")
|
|
||||||
p Gas Ordine: #{gasordine}
|
|
||||||
p
|
|
||||||
tr
|
|
||||||
td(class="sectionContentTitle boldhigh", valign="top")
|
|
||||||
p #{descr}
|
|
||||||
tr
|
tr
|
||||||
td(class="sectionContent", valign="top")
|
td(class="sectionContent", valign="top")
|
||||||
p Prezzo: #{price} € #{after_price}
|
p Gas Ordine: #{gasordine}
|
||||||
if (qty > 0)
|
p
|
||||||
td(class="sectionContent", valign="top")
|
tr
|
||||||
p Quantità: #{qty} #{unit}
|
td(class="sectionContentTitle boldhigh", valign="top")
|
||||||
if (qtypreordered > 0)
|
p #{descr}
|
||||||
td(class="sectionContent", valign="top")
|
tr
|
||||||
p Quantità Prenotata: #{qtypreordered} #{unit}
|
td(class="sectionContent", valign="top")
|
||||||
tr
|
p Codice: #{code}
|
||||||
td(class="sectionContent", valign="top")
|
tr
|
||||||
p Totale: #{TotalPriceProduct} €
|
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)
|
if (note)
|
||||||
p Note Aggiuntive: #{note}<br>
|
p Note Aggiuntive: #{note}<br>
|
||||||
|
|
||||||
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
|
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
|
||||||
tr
|
tr
|
||||||
td(class="whitespace", height="10")
|
td(class="whitespace", height="10")
|
||||||
|
|
||||||
|
|||||||
@@ -156,9 +156,6 @@ html
|
|||||||
}
|
}
|
||||||
|
|
||||||
.whitespace {
|
.whitespace {
|
||||||
line-height:0;
|
|
||||||
font-size:0;
|
|
||||||
height:20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width:480px) {
|
@media only screen and (max-width:480px) {
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ const productSchema = new Schema({
|
|||||||
maxbookableGASQty: {
|
maxbookableGASQty: {
|
||||||
// Quantità massima (ancora disponibile) Ordine GAS prenotabile (Complessivamente tra tutti gli ordini)
|
// Quantità massima (ancora disponibile) Ordine GAS prenotabile (Complessivamente tra tutti gli ordini)
|
||||||
type: Number,
|
type: Number,
|
||||||
|
default: -1,
|
||||||
},
|
},
|
||||||
bookedGASQtyOrdered: {
|
bookedGASQtyOrdered: {
|
||||||
// Quantità Ordine GAS Prenotate Totali
|
// Quantità Ordine GAS Prenotate Totali
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const Gasordine = require('../models/gasordine');
|
|||||||
const tools = require('../tools/general'); // Assicurati di avere il file delle utility
|
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 shared_consts = require('../tools/shared_nodejs'); // Assicurati di avere le costanti condivise
|
||||||
|
|
||||||
|
const Storehouse = require('../models/storehouse');
|
||||||
const { getTableContent } = require('../controllers/articleController');
|
const { getTableContent } = require('../controllers/articleController');
|
||||||
|
|
||||||
const T_WEB_ArticoliFatturati = require('../models/t_web_articolifatturati');
|
const T_WEB_ArticoliFatturati = require('../models/t_web_articolifatturati');
|
||||||
@@ -591,7 +592,7 @@ class Macro {
|
|||||||
|
|
||||||
|
|
||||||
if (options.inputdaGM)
|
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;
|
if (!product.title || !product.sku) importa = false;
|
||||||
|
|
||||||
@@ -710,7 +711,7 @@ class Macro {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
convertiDaCampiGMACampoFDV_ProductInfo(idapp, productGM) {
|
async convertiDaCampiGMACampoFDV_ProductInfo(idapp, productGM) {
|
||||||
let productFDV = {};
|
let productFDV = {};
|
||||||
|
|
||||||
/* productGM CAMPI
|
/* 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 = {
|
const recproduct = {
|
||||||
idapp: idapp,
|
idapp: idapp,
|
||||||
@@ -787,11 +799,12 @@ class Macro {
|
|||||||
ristampa: productGM.Ristampa,
|
ristampa: productGM.Ristampa,
|
||||||
eta: productGM.FasciaEta,
|
eta: productGM.FasciaEta,
|
||||||
// addtocart_link: '',
|
// addtocart_link: '',
|
||||||
Quantita: productGM.QtaDisponibile || undefined,
|
stockQty: productGM.QtaDisponibile || undefined,
|
||||||
date_pub: productGM.DataPubblicazione ? tools.getDateFromISOString(productGM.DataPubblicazione) : null,
|
date_pub: productGM.DataPubblicazione ? tools.getDateFromISOString(productGM.DataPubblicazione) : null,
|
||||||
sottotitolo: productGM.Sottotitolo,
|
sottotitolo: productGM.Sottotitolo,
|
||||||
productTypes: [shared_consts.PRODUCTTYPE.PRODUCT],
|
productTypes: [shared_consts.PRODUCTTYPE.PRODUCT],
|
||||||
date_updated_fromGM: new Date(),
|
date_updated_fromGM: new Date(),
|
||||||
|
idStorehouses: [recstorehouse._id],
|
||||||
}
|
}
|
||||||
|
|
||||||
let vers = 0;
|
let vers = 0;
|
||||||
@@ -1007,7 +1020,7 @@ class Macro {
|
|||||||
ristampa: product.ristampa || '',
|
ristampa: product.ristampa || '',
|
||||||
eta: product.eta || '',
|
eta: product.eta || '',
|
||||||
addtocart_link: product.addtocart_link || '',
|
addtocart_link: product.addtocart_link || '',
|
||||||
quantita: product.Quantita ? parseInt(product.Quantita) : 0,
|
quantita: product.stockQty ? parseInt(product.stockQty) : 0,
|
||||||
preOrderDate: product.preOrderDate || null,
|
preOrderDate: product.preOrderDate || null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1100,6 +1113,8 @@ class Macro {
|
|||||||
const listaCampi = [
|
const listaCampi = [
|
||||||
'idapp',
|
'idapp',
|
||||||
'isbn',
|
'isbn',
|
||||||
|
'price',
|
||||||
|
'stockQty',
|
||||||
//++FIELD_PRODUCT
|
//++FIELD_PRODUCT
|
||||||
]
|
]
|
||||||
return listaCampi.some((campo) => recordOld[campo] !== recordNew[campo]);
|
return listaCampi.some((campo) => recordOld[campo] !== recordNew[campo]);
|
||||||
|
|||||||
@@ -1953,13 +1953,13 @@ async function load(req, res, version = '0') {
|
|||||||
calcstat: req.user ? User.calculateStat(idapp, req.user.username) : Promise.resolve(null),
|
calcstat: req.user ? User.calculateStat(idapp, req.user.username) : Promise.resolve(null),
|
||||||
calzoom: CalZoom.findAllIdApp(idapp),
|
calzoom: CalZoom.findAllIdApp(idapp),
|
||||||
producers: Producer.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),
|
storehouses: Storehouse.findAllIdApp(idapp),
|
||||||
departments: Department.findAllIdApp(idapp),
|
departments: Department.findAllIdApp(idapp),
|
||||||
orderscart: req.user
|
orderscart: req.user
|
||||||
? User.isManager(req.user.perm)
|
? User.isManager(req.user.perm)
|
||||||
? OrdersCart.getOrdersCartByUserId('ALL', idapp, 0, false)
|
? OrdersCart.getOrdersCartByUserId('ALL', idapp, 0, false)
|
||||||
: OrdersCart.getOrdersCartByUserId(req.user.id, idapp, 0, false)
|
: OrdersCart.getOrdersCartByUserId(userId, idapp, 0, false)
|
||||||
: Promise.resolve(null),
|
: Promise.resolve(null),
|
||||||
groups: Group.findAllIdApp(idapp),
|
groups: Group.findAllIdApp(idapp),
|
||||||
resps: User.getusersRespList(idapp),
|
resps: User.getusersRespList(idapp),
|
||||||
|
|||||||
@@ -1153,6 +1153,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
MAX_QTA_PREORD: 5000,
|
MAX_QTA_PREORD: 5000,
|
||||||
|
MAX_QTA_NON_IMPOSTATA: -1,
|
||||||
|
|
||||||
STATUSSKILL_DI_PERSONA: 1,
|
STATUSSKILL_DI_PERSONA: 1,
|
||||||
STATUSSKILL_ONLINE: 2,
|
STATUSSKILL_ONLINE: 2,
|
||||||
|
|||||||
Reference in New Issue
Block a user