Skip to content

Commit

Permalink
COM-3587 B2B P2: Enforce account filter on buyer Quotes grids (#317)
Browse files Browse the repository at this point in the history
When using the filters on the buyer Quotes grids the customerAccountId filter was being dropped. Enforce the account filter when searching from the buyer Quotes grid on My Account and the View B2B Account page.

Co-authored-by: RajeshDatir <[email protected]>
  • Loading branch information
Rajesh D and kibo-rajeshdatir authored Apr 6, 2021
1 parent cee979e commit b6dd923
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/modules/b2b-account/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,21 @@ define([
self.model.syncApiModel();
self.render();
},
filter: function(collection) {
filter: function (collection) {
var self = this;
var filterStr = "";
var qName = $("#searchName").val();
var qNumber = $("#searchQuoteNumber").val();
var status = $("#statusDropdown").val();
var expDate = $("#expirationdate").val();
var accountId = $("#accountNameDropdown").val();
var accountId = "";

if (isSalesRep) {
accountId = $("#accountNameDropdown").val();
} else {
var viewB2BAccount = self.model.attributes.viewB2BAccount;
accountId = viewB2BAccount ? self.model.attributes.accountToView : require.mozuData("user").accountId;
}
if (accountId) {
filterStr += accountNameFilter + accountId;
}
Expand Down

0 comments on commit b6dd923

Please sign in to comment.