Browse Source

[FIX] Renamed method and var for clarity

pull/39/head
PabloCM 9 years ago
parent
commit
4f71da443a
  1. 14
      pos_pricelist/static/src/js/db.js
  2. 4
      pos_pricelist/static/src/js/models.js

14
pos_pricelist/static/src/js/db.js

@ -140,16 +140,16 @@ function pos_pricelist_db(instance, module) {
}); });
return list; return list;
}, },
find_taxes_by_fiscal_position_id: function (fiscal_position_id, taxes_ids) {
map_tax: function (fiscal_position_id, taxes_ids) {
var taxes = []; var taxes = [];
var found_taxes = {}; var found_taxes = {};
for (var id in this.fiscal_position_tax_by_id) { for (var id in this.fiscal_position_tax_by_id) {
var tax = this.fiscal_position_tax_by_id[id];
if (tax && tax.position_id &&
tax.position_id[0] == fiscal_position_id &&
taxes_ids.indexOf(tax.tax_src_id[0]) > -1) {
taxes.push(tax.tax_dest_id[0]);
found_taxes[tax.tax_src_id[0]] = true;
var fp_line = this.fiscal_position_tax_by_id[id];
if (fp_line && fp_line.position_id &&
fp_line.position_id[0] == fiscal_position_id &&
taxes_ids.indexOf(fp_line.tax_src_id[0]) > -1) {
taxes.push(fp_line.tax_dest_id[0]);
found_taxes[fp_line.tax_src_id[0]] = true;
} }
} }
for (var i = 0, len = taxes_ids.length; i < len; i++) { for (var i = 0, len = taxes_ids.length; i < len; i++) {

4
pos_pricelist/static/src/js/models.js

@ -270,7 +270,7 @@ function pos_pricelist_models(instance, module) {
var partner = this.order ? this.order.get_client() : null; var partner = this.order ? this.order.get_client() : null;
if (partner && partner.property_account_position) { if (partner && partner.property_account_position) {
product_tax_ids = product_tax_ids =
this.pos.db.find_taxes_by_fiscal_position_id(
this.pos.db.map_tax(
partner.property_account_position[0], product_tax_ids partner.property_account_position[0], product_tax_ids
); );
} }
@ -302,7 +302,7 @@ function pos_pricelist_models(instance, module) {
var partner = this.order ? this.order.get_client() : null; var partner = this.order ? this.order.get_client() : null;
if (partner && partner.property_account_position) { if (partner && partner.property_account_position) {
product_tax_ids = product_tax_ids =
this.pos.db.find_taxes_by_fiscal_position_id(
this.pos.db.map_tax(
partner.property_account_position[0], product_tax_ids partner.property_account_position[0], product_tax_ids
); );
} }

Loading…
Cancel
Save