this.order.removeOrderline(this);
return;
}else{
- var quant = Math.max(parseFloat(quantity) || 0, 0);
+ var quant = parseFloat(quantity) || 0;
var unit = this.get_unit();
if(unit){
- this.quantity = Math.max(unit.rounding, round_pr(quant, unit.rounding));
- this.quantityStr = this.quantity.toFixed(Math.max(0,Math.ceil(Math.log(1.0 / unit.rounding) / Math.log(10))));
+ this.quantity = round_pr(quant, unit.rounding);
+ this.quantityStr = this.quantity.toFixed(Math.ceil(Math.log(1.0 / unit.rounding) / Math.log(10)));
}else{
this.quantity = quant;
this.quantityStr = '' + this.quantity;
}
},
switchSign: function() {
+ console.log('switchsing');
var oldBuffer;
oldBuffer = this.get('buffer');
this.set({
- buffer: oldBuffer[0] === '-' ? oldBuffer.substr(1) : "-" + oldBuffer
+ buffer: oldBuffer[0] === '-' ? oldBuffer.substr(1) : "-" + oldBuffer
});
this.trigger('set_value',this.get('buffer'));
},
},
is_paid: function(){
var currentOrder = this.pos.get('selectedOrder');
- return (currentOrder.getTotalTaxIncluded() >= 0.000001
- && currentOrder.getPaidTotal() + 0.000001 >= currentOrder.getTotalTaxIncluded());
+ return (currentOrder.getTotalTaxIncluded() < 0.000001
+ || currentOrder.getPaidTotal() + 0.000001 >= currentOrder.getTotalTaxIncluded());
},
validate_order: function(options) {