diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index dd2eb8d9596f3ef5714cff434e129bee187638fc..fa6215ee0e87f1ad4eb86a06d2ea19c2458c3e84 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -2092,7 +2092,7 @@ exports.Order = Backbone.Model.extend({ this.assert_editable(); var newPaymentline = new exports.Paymentline({},{order: this, cashregister:cashregister, pos: this.pos}); if(cashregister.journal.type !== 'cash' || this.pos.config.iface_precompute_cash){ - newPaymentline.set_amount( Math.max(this.get_due(),0) ); + newPaymentline.set_amount( this.get_due() ); } this.paymentlines.add(newPaymentline); this.select_paymentline(newPaymentline); @@ -2256,10 +2256,10 @@ exports.Order = Backbone.Model.extend({ } } } - return round_pr(Math.max(0,due), this.pos.currency.rounding); + return round_pr(due, this.pos.currency.rounding); }, is_paid: function(){ - return this.get_due() === 0; + return this.get_due() <= 0; }, is_paid_with_cash: function(){ return !!this.paymentlines.find( function(pl){ diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 7c1cb9559a6d530c5a1e480fc76197bfbe5dc754..82e6fa0e7b25f2b0a2c5963a01a8c08d21f3c08d 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1943,17 +1943,6 @@ var PaymentScreenWidget = ScreenWidget.extend({ return false; } - var plines = order.get_paymentlines(); - for (var i = 0; i < plines.length; i++) { - if (plines[i].get_type() === 'bank' && plines[i].get_amount() < 0) { - this.gui.show_popup('error',{ - 'message': _t('Negative Bank Payment'), - 'comment': _t('You cannot have a negative amount in a Bank payment. Use a cash payment method to return money to the customer.'), - }); - return false; - } - } - if (!order.is_paid() || this.invoicing) { return false; }