Skip to content

Commit

Permalink
Merge branch 'bugfix/MAR10001-941-po-recalculation-advised-products' …
Browse files Browse the repository at this point in the history
…into maintenance/3.0
  • Loading branch information
24198 committed Jun 29, 2020
2 parents 413ab5a + a2d4afd commit fec2210
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define(function(require) {
var currencyLabel = this.priceEl.closest('.control-group').find('label').text();
var start_pos = currencyLabel.indexOf('(') + 1;
var end_pos = currencyLabel.indexOf(')',start_pos);
this.currencySymbol = currencyLabel.substring(start_pos,end_pos)
this.currencySymbol = currencyLabel.substring(start_pos,end_pos);
this.priceEl.change(_.bind(this.updateRowTotal, this));
PurchaseOrderItemView.__super__.initialize.apply(this, arguments);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ define(function(require) {
}
});
mediator.trigger('po:items:total:changed', {'value': total.toFixed(2), 'currency': data.currency, 'type': 'additional', 'label': 'Additional items Total'});
},

}
});

return PurchaseOrderItemsView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ define(function(require) {
this.addedCollectionItems = [];
this.removedCollectionItems = [];

mediator.on('po:row:total:changed', this.triggerTotalsUpdateEvent, this);
this.render();
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ define(function(require) {
const _ = require('underscore');
const Backbone = require('backbone');
const DialogWidget = require('oro/dialog-widget');
const mediator = require('oroui/js/mediator');

/**
* @export oroform/js/multiple-entity/view
Expand Down Expand Up @@ -102,12 +103,14 @@ define(function(require) {
this.model.set('purchasePrice', price);

let rowTotal = parseFloat(amount) * parseFloat(price);
let currencySymbol = this.model.get('currency');
if (!isNaN(rowTotal)) {
let currencySymbol = this.model.get('currency');
this.$el.find('td.purchase-order-line-item-row-total').html(currencySymbol + rowTotal.toFixed(2));
} else {
this.$el.find('td.purchase-order-line-item-row-total').html('');
}

mediator.trigger('po:row:total:changed', {'currency': currencySymbol});
}
});

Expand Down

0 comments on commit fec2210

Please sign in to comment.