- Impostato i Font giusti e la corretta disposizione del testo e dei suoi margini.
- L'immagine del libro, se è piccolo, viene adattato alla dimensione fissa (vedere se va bene).
This commit is contained in:
@@ -334,6 +334,37 @@ MyElemSchema.statics.findAllIdApp = async function (idapp) {
|
||||
return await MyElem.find(myfind).sort({ order: 1 });
|
||||
};
|
||||
|
||||
MyElemSchema.statics.findallSchedeTemplate = async function (idapp) {
|
||||
const MyElem = this;
|
||||
|
||||
try {
|
||||
|
||||
const ris = await MyElem.find({ idapp });
|
||||
|
||||
// Estrai le schede che hanno isTemplate = true
|
||||
const schedeTemplate = ris.flatMap(elem =>
|
||||
elem.catalogo && elem.catalogo.arrSchede ? elem.catalogo.arrSchede.filter(scheda => scheda.scheda.isTemplate) : []
|
||||
);
|
||||
|
||||
/*
|
||||
// Trova tutti i documenti in cui idapp corrisponde e contiene schede con isTemplate = true
|
||||
const ris = await MyElem.find(
|
||||
{ idapp },
|
||||
{ 'catalogo.arrSchede': { $elemMatch: { isTemplate: true } } }
|
||||
).populate('catalogo.arrSchede');
|
||||
|
||||
// Estrai solo le schede che hanno isTemplate = true
|
||||
const schedeTemplate = ris.flatMap(elem =>
|
||||
elem.catalogo.arrSchede.filter(scheda => scheda.isTemplate)
|
||||
);
|
||||
*/
|
||||
|
||||
return schedeTemplate;
|
||||
} catch (e) {
|
||||
console.error('Err', e);
|
||||
}
|
||||
};
|
||||
|
||||
const MyElem = mongoose.model('MyElem', MyElemSchema);
|
||||
|
||||
MyElem.createIndexes((err) => {
|
||||
|
||||
@@ -17,6 +17,7 @@ const ISize = new Schema({
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
fit: { type: String },
|
||||
gap: { type: String },
|
||||
});
|
||||
const IFont = new Schema({
|
||||
name: { type: String },
|
||||
@@ -66,6 +67,7 @@ const IBarCode = new Schema(
|
||||
format: Number,
|
||||
size: ISize,
|
||||
font: IFont,
|
||||
widthlines: Number,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user