Fix Chèvre-pieds et autres #482
@ -195,9 +195,15 @@ export class RdDItem extends Item {
|
|||||||
if (itemData.name != otherData.name) return false;
|
if (itemData.name != otherData.name) return false;
|
||||||
if (tplData.quantite == undefined) return false;
|
if (tplData.quantite == undefined) return false;
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(tplData)) {
|
const differences = Object.entries(tplData).filter(([key, value]) => !['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key))
|
||||||
if (['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key)) continue;
|
.filter(([key, value]) => value != otherTplData[key]);
|
||||||
if (value != otherTplData[key]) return false;
|
if (differences.length > 0) {
|
||||||
|
let message = `Impossible de regrouper les ${itemData.type} ${itemData.name}: `;
|
||||||
|
for (const [key, value] of differences){
|
||||||
|
message += `<br>${key}: ${value} vs ${otherTplData[key]}`;
|
||||||
|
}
|
||||||
|
ui.notifications.info(message)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user