Le GR a toujours le droit de voir les acteurs #601
@@ -220,7 +220,7 @@ export class RdDBaseActor extends Actor {
 | 
				
			|||||||
  /* -------------------------------------------- */
 | 
					  /* -------------------------------------------- */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getQuantiteDisponible(item) {
 | 
					  getQuantiteDisponible(item) {
 | 
				
			||||||
    return item?.getQuantite();
 | 
					    return item?.isService() ? undefined : item?.getQuantite();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* -------------------------------------------- */
 | 
					  /* -------------------------------------------- */
 | 
				
			||||||
@@ -310,6 +310,9 @@ export class RdDBaseActor extends Actor {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async decrementerQuantiteItem(item, quantite, options = { supprimerSiZero: true }) {
 | 
					  async decrementerQuantiteItem(item, quantite, options = { supprimerSiZero: true }) {
 | 
				
			||||||
 | 
					    if (itemVendu.isService()) {
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    let resteQuantite = (item.system.quantite ?? 1) - quantite;
 | 
					    let resteQuantite = (item.system.quantite ?? 1) - quantite;
 | 
				
			||||||
    if (resteQuantite <= 0) {
 | 
					    if (resteQuantite <= 0) {
 | 
				
			||||||
      if (options.supprimerSiZero) {
 | 
					      if (options.supprimerSiZero) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,7 +22,7 @@ export class RdDCommerce extends RdDBaseActor {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getQuantiteDisponible(item) {
 | 
					  getQuantiteDisponible(item) {
 | 
				
			||||||
    return this.system.illimite ? undefined : item.getQuantite();
 | 
					    return this.system.illimite || item.isService() ? undefined : item.getQuantite();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  verifierFortune(cout) {
 | 
					  verifierFortune(cout) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -223,15 +223,17 @@ export class RdDItem extends Item {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getQuantite() {
 | 
					  getQuantite() {
 | 
				
			||||||
    return Math.round(this.system.quantite ?? 0)
 | 
					    return this.isService() ? undefined : Math.round(this.system.quantite ?? 0)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getEncTotal() {
 | 
					  getEncTotal() {
 | 
				
			||||||
    return this.getEnc() * this.getQuantite();
 | 
					    return (this.isService() ? 0 : this.getQuantite()) * this.getEnc();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getEnc() {
 | 
					  getEnc() {
 | 
				
			||||||
    switch (this.type) {
 | 
					    switch (this.type) {
 | 
				
			||||||
 | 
					      case 'service':
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
      case 'herbe':
 | 
					      case 'herbe':
 | 
				
			||||||
        return this.getEncHerbe();
 | 
					        return this.getEncHerbe();
 | 
				
			||||||
      case 'gemme':
 | 
					      case 'gemme':
 | 
				
			||||||
@@ -250,7 +252,7 @@ export class RdDItem extends Item {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  valeurTotale() {
 | 
					  valeurTotale() {
 | 
				
			||||||
    return this.getQuantite() * this.valeur()
 | 
					    return (this.isService() ? 1 : this.getQuantite()) * this.valeur()
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  valeur() {
 | 
					  valeur() {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user