Untitled

 avatar
unknown
plain_text
5 months ago
705 B
3
Indexable
export default class Cl_Farmacia {
    constructor() {
        this.acMontoVenta = 0;
        this.menor = Infinity
        this.codMenor = 0;
        this.cantidadMenor = 0
    }
    
    totalVendido() {
        return this.acMontoVenta;
    }
    
    CodYCantidadMenosDestacado() {
        return {
            codigo: this.codMenor,
            cantidad: this.cantidadMenor
        };
    }

    procesarMedicamento(med) {
     
        this.acMontoVenta += med.montoVenta();
        
        
        if (med.cantidadVendida < this.menor) {
            this.menor = med.cantidadVendida;
            this.codMenor = med.codigo;
            this.cantidadMenor = med.cantidadVendida; 
        }
    }
}
Editor is loading...
Leave a Comment