Les services sont inquantifiables
Ne pas décrémenter leur quantité, et leur quantite disponible est undefined (ie: infinie)
This commit is contained in:
@ -223,15 +223,17 @@ export class RdDItem extends Item {
|
||||
}
|
||||
|
||||
getQuantite() {
|
||||
return Math.round(this.system.quantite ?? 0)
|
||||
return this.isService() ? undefined : Math.round(this.system.quantite ?? 0)
|
||||
}
|
||||
|
||||
getEncTotal() {
|
||||
return this.getEnc() * this.getQuantite();
|
||||
return (this.isService() ? 0 : this.getQuantite()) * this.getEnc();
|
||||
}
|
||||
|
||||
getEnc() {
|
||||
switch (this.type) {
|
||||
case 'service':
|
||||
return 0;
|
||||
case 'herbe':
|
||||
return this.getEncHerbe();
|
||||
case 'gemme':
|
||||
@ -250,7 +252,7 @@ export class RdDItem extends Item {
|
||||
}
|
||||
|
||||
valeurTotale() {
|
||||
return this.getQuantite() * this.valeur()
|
||||
return (this.isService() ? 1 : this.getQuantite()) * this.valeur()
|
||||
}
|
||||
|
||||
valeur() {
|
||||
|
Reference in New Issue
Block a user