Browse Source

Merge pull request #43 from taktik/8.0-fix-zero-price-100--percent-discout-mv

[FIX] : Allow possibility to give 100% discount.
pull/44/head
Sylvain LE GAL 9 years ago
parent
commit
f41a770c82
  1. 10
      pos_pricelist/static/src/js/models.js

10
pos_pricelist/static/src/js/models.js

@ -147,7 +147,7 @@ function pos_pricelist_models(instance, module) {
var price = this.pos.pricelist_engine.compute_price_all( var price = this.pos.pricelist_engine.compute_price_all(
db, product, partner, qty db, product, partner, qty
); );
if (price !== false && price !== 0.0) {
if (price !== false) {
this.price = price; this.price = price;
} }
} }
@ -169,7 +169,7 @@ function pos_pricelist_models(instance, module) {
var price = this.pos.pricelist_engine.compute_price_all( var price = this.pos.pricelist_engine.compute_price_all(
db, product, partner, quantity db, product, partner, quantity
); );
if (price !== false && price !== 0.0) {
if (price !== false) {
this.price = price; this.price = price;
} }
this.trigger('change', this); this.trigger('change', this);
@ -533,8 +533,10 @@ function pos_pricelist_models(instance, module) {
var quantities = []; var quantities = [];
quantities.push(1); quantities.push(1);
for (var j = 0; j < rules.length; j++) { for (var j = 0; j < rules.length; j++) {
if ($.inArray(rules[j].min_quantity, quantities) === -1) {
quantities.push(rules[j].min_quantity); quantities.push(rules[j].min_quantity);
} }
}
quantities = quantities.sort(); quantities = quantities.sort();
var prices_displayed = ''; var prices_displayed = '';
for (var k = 0; k < quantities.length; k++) { for (var k = 0; k < quantities.length; k++) {
@ -542,7 +544,7 @@ function pos_pricelist_models(instance, module) {
var price = this.compute_price_all( var price = this.compute_price_all(
db, product, partner, qty db, product, partner, qty
); );
if (price !== false && price !== 0.0) {
if (price !== false) {
if (this.pos.config.display_price_with_taxes) { if (this.pos.config.display_price_with_taxes) {
var prices = this.simulate_price( var prices = this.simulate_price(
product, partner, price, qty product, partner, price, qty
@ -602,7 +604,7 @@ function pos_pricelist_models(instance, module) {
var price = this.compute_price_all( var price = this.compute_price_all(
db, product, partner, quantity db, product, partner, quantity
); );
if (price !== false && price !== 0.0) {
if (price !== false) {
line.price = price; line.price = price;
} }
line.trigger('change', line); line.trigger('change', line);

Loading…
Cancel
Save