Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #177 from lynnaloo/19453

19453 - Added fields to advanced search and filter for expired quotes
  • Loading branch information...
commit 25dc636849770269f4ab52b6b5bbe2b29c83d94b 2 parents 15bf0dd + 06758b0
@shackbarth shackbarth authored
View
3  enyo-client/application/source/en/strings.js
@@ -177,6 +177,7 @@ var lang = XT.stringsFor("en_US", {
"_error": "Error",
"_errorColor": "Error Color",
"_eventRecipient": "Event Recipient",
+ "_excludeProspects": "Exclude Prospects",
"_expenses": "Expenses",
"_expiredColor": "Expired Color",
"_expires": "Expires",
@@ -413,8 +414,10 @@ var lang = XT.stringsFor("en_US", {
"_shippingNotes": "Shipping Notes",
"_site": "Site",
"_siteCode": "Site Code",
+ "_showClosed": "Show Closed",
"_showCompleted": "Show Complete",
"_showCompletedOnly": "Show Complete Only",
+ "_showExpired": "Show Expired",
"_showInactive": "Show Inactive",
"_sold": "Sold",
"_source": "Source",
View
40 enyo-client/application/source/models/quote.js
@@ -5,6 +5,27 @@ white:true*/
(function () {
"use strict";
+
+ /**
+ @namespace
+
+ A mixin shared by project models that share common project status
+ functionality.
+ */
+ XM.QuoteStatus = {
+ /** @scope XM.ProjectStatus */
+
+ /**
+ Returns project status as a localized string.
+
+ @returns {String}
+ */
+ getProjectStatusString: function () {
+ var K = XM.Quote,
+ status = this.get("status");
+ return status === K.OPEN_STATUS ? "_open".loc() : "_closed".loc();
+ }
+ };
/**
@class
@@ -482,17 +503,6 @@ white:true*/
},
/**
- Returns quote status as a localized string.
-
- @returns {String}
- */
- getQuoteStatusString: function () {
- var K = this.getClass(),
- status = this.get("status");
- return status === K.OPEN_STATUS ? "_open".loc() : "_closed".loc();
- },
-
- /**
If the user changed the freight determine whether they want the automatic calculation
turned on or off as a result of their change. This function will trigger a `notify` call
asking the question, which must be answered via the attached callback to complete the process.
@@ -807,6 +817,9 @@ white:true*/
}
});
+
+ // Add in quote status mixin
+ XM.Quote = XM.Quote.extend(XM.QuoteStatus);
// ..........................................................
// CLASS METHODS
@@ -1724,12 +1737,15 @@ white:true*/
@returns {String}
*/
getQuoteStatusString: function () {
- var K = this.getClass(),
+ var K = XM.Quote,
status = this.get("status");
return status === K.OPEN_STATUS ? "_open".loc() : "_closed".loc();
}
});
+
+ // Add in quote status mixin
+ XM.QuoteListItem = XM.QuoteListItem.extend(XM.QuoteStatus);
/**
@class
View
83 enyo-client/application/source/widgets/parameter.js
@@ -532,34 +532,61 @@ trailing:true white:true*/
kind: "XV.ParameterWidget",
components: [
{kind: "onyx.GroupboxHeader", content: "_quote".loc()},
- // {name: "showInactive", label: "_showInactive".loc(), attr: "isActive", defaultKind: "XV.CheckboxWidget",
- // getParameter: function () {
- // var param;
- // if (!this.getValue()) {
- // param = {
- // attribute: this.getAttr(),
- // operator: '=',
- // value: true
- // };
- // }
- // return param;
- // }
- // },
- // {name: "name", label: "_name".loc(), attr: "name"},
- // {name: "description", label: "_description".loc(), attr: "description"},
- // {kind: "onyx.GroupboxHeader", content: "_relationships".loc()},
- // {name: "account", label: "_account".loc(), attr: "account", defaultKind: "XV.AccountWidget"},
- // {name: "contact", label: "_contact".loc(), attr: "contact", defaultKind: "XV.ContactWidget"},
- // {kind: "onyx.GroupboxHeader", content: "_userAccounts".loc()},
- // {name: "owner", label: "_owner".loc(), attr: "owner", defaultKind: "XV.UserAccountWidget"},
- // {name: "assignedTo", label: "_assignedTo".loc(), attr: "assignedTo", defaultKind: "XV.UserAccountWidget"},
- // {kind: "onyx.GroupboxHeader", content: "_dueDate".loc()},
- // {name: "fromDate", label: "_fromDate".loc(), attr: "dueDate", operator: ">=",
- // filterLabel: "_from".loc() + " " + "_dueDate".loc() + " " + "_date".loc(),
- // defaultKind: "XV.DateWidget"},
- // {name: "toDate", label: "_toDate".loc(), attr: "dueDate", operator: "<=",
- // filterLabel: "_to".loc() + " " + "_dueDate".loc() + " " + "_date".loc(),
- // defaultKind: "XV.DateWidget"}
+ {name: "showExpired", label: "_showExpired".loc(), attr: "expireDate", defaultKind: "XV.CheckboxWidget",
+ getParameter: function () {
+ var param;
+ if (!this.getValue()) {
+ param = {
+ attribute: this.getAttr(),
+ operator: '>=',
+ value: new Date()
+ };
+ }
+ return param;
+ }
+ },
+ {name: "showClosed", label: "_showClosed".loc(), attr: "status", defaultKind: "XV.CheckboxWidget",
+ getParameter: function () {
+ var param;
+ if (!this.getValue()) {
+ param = {
+ attribute: this.getAttr(),
+ operator: '!=',
+ value: 'C'
+ };
+ }
+ return param;
+ }
+ },
+ {name: "excludeProspects", label: "_excludeProspects".loc(), attr: "customer.status", defaultKind: "XV.CheckboxWidget",
+ getParameter: function () {
+ var param;
+ if (this.getValue()) {
+ param = {
+ attribute: this.getAttr(),
+ operator: '!=',
+ value: "P"
+ };
+ }
+ return param;
+ }
+ },
+ {name: "number", label: "_number".loc(), attr: "number"},
+ {name: "salesRep", attr: "salesRep", label: "_salesRep".loc(), defaultKind: "XV.SalesRepPicker"},
+ {kind: "onyx.GroupboxHeader", content: "_customer".loc()},
+ {name: "customer", attr: "customer", label: "_customer".loc(), defaultKind: "XV.CustomerProspectWidget"},
+ {name: "customerType", attr: "customer.customerType", label: "_customerType".loc(), defaultKind: "XV.CustomerTypePicker"},
+ {name: "customerPurchaseOrderNumber", attr: "customerPurchaseOrderNumber",
+ label: "_custPO".loc()},
+ {kind: "onyx.GroupboxHeader", content: "_quoteDate".loc()},
+ {name: "createdFromDate", label: "_fromDate".loc(),
+ filterLabel: "_quoteDate".loc() + " " + "_fromDate".loc(),
+ attr: "quoteDate", operator: ">=",
+ defaultKind: "XV.DateWidget"},
+ {name: "createdToDate", label: "_toDate".loc(),
+ filterLabel: "_quoteDate".loc() + " " + "_toDate".loc(),
+ attr: "quoteDate", operator: "<=",
+ defaultKind: "XV.DateWidget"}
]
});
View
2  enyo-client/application/source/widgets/picker.js
@@ -264,7 +264,7 @@ regexp:true, undef:true, trailing:true, white:true */
kind: "XV.PickerWidget",
collection: "XM.projectStatuses"
});
-
+
// ..........................................................
// SALES REP
//
View
7 enyo-client/database/orm/models/customer.json
@@ -1818,6 +1818,13 @@
"type": "String",
"column": "status"
}
+ },
+ {
+ "name": "customerType",
+ "attr": {
+ "type": "Number",
+ "column": "type"
+ }
}
],
"extensions": [],
View
7 enyo-client/database/orm/models/quote.json
@@ -1334,6 +1334,13 @@
}
},
{
+ "name": "salesRep",
+ "attr": {
+ "type": "Number",
+ "column": "quhead_salesrep_id"
+ }
+ },
+ {
"name": "shiptoName",
"attr": {
"type": "String",
View
22 enyo-client/database/source/xt/views/customer_prospect.sql
@@ -1,20 +1,20 @@
drop view if exists xt.customer_prospect cascade;
create or replace view xt.customer_prospect as
-
- select cust_id as id, cust_active as active, cust_number as number, cust_name as name,
- cust_cntct_id as contact, cust_ffshipto, cust_ffbillto, cust_curr_id, cust_terms_id,
- cust_creditstatus, cust_salesrep_id as salesrep_id, cust_commprcnt, cust_discntprcnt,
- cust_taxzone_id as taxzone_id, cust_shipchrg_id, cust_comments as comments,
- cust_preferred_warehous_id as site, shipto_id as default_shipto_id, cust_shipvia as cust_shipvia,
+
+ select cust_id as id, cust_active as active, cust_number as number, cust_name as name, cust_custtype_id as type,
+ cust_cntct_id as contact, cust_ffshipto, cust_ffbillto, cust_curr_id, cust_terms_id,
+ cust_creditstatus, cust_salesrep_id as salesrep_id, cust_commprcnt, cust_discntprcnt,
+ cust_taxzone_id as taxzone_id, cust_shipchrg_id, cust_comments as comments,
+ cust_preferred_warehous_id as site, shipto_id as default_shipto_id, cust_shipvia as cust_shipvia,
'C' as status
from custinfo left join shiptoinfo on cust_id = shipto_cust_id and shipto_default
union
select prospect_id as id, prospect_active as active, prospect_number as number,
- prospect_name as name, prospect_cntct_id as contact, null as cust_ffshipto,
- null as cust_ffbillto, null as cust_curr_id, null as cust_terms_id,
- null as cust_creditstatus, prospect_salesrep_id as salesrep_id, null as cust_commprcnt,
- null as cust_discntprcnt, null as taxzone_id, null as cust_shipchrg_id,
- prospect_comments as comments, prospect_warehous_id as site, null as default_shipto_id,
+ prospect_name as name, null as type, prospect_cntct_id as contact, null as cust_ffshipto,
+ null as cust_ffbillto, null as cust_curr_id, null as cust_terms_id,
+ null as cust_creditstatus, prospect_salesrep_id as salesrep_id, null as cust_commprcnt,
+ null as cust_discntprcnt, null as taxzone_id, null as cust_shipchrg_id,
+ prospect_comments as comments, prospect_warehous_id as site, null as default_shipto_id,
null as cust_shipvia, 'P' as status
from prospect;
Please sign in to comment.
Something went wrong with that request. Please try again.