+4.5.0 (Beta 2014/05/22)
+==================
+
+Features and bugfixes
+---------------------
+TODO: document
+
+
4.4.1 (2014/05/09)
==================
return XT.Error.clone('xt1013', { params: params });
}
if (!_.isNumber(cutOffDay) || cutOffDay % 1 !== 0 || cutOffDay < 0 || cutOffDay > 31) {
- params = {attr: "_cutOffDate".loc(), value: cutOffDay};
+ params = {attr: "_cutOffDay".loc(), value: cutOffDay};
return XT.Error.clone('xt1013', { params: params });
}
}
components: [
{kind: "XV.ListItem", components: [
{kind: "FittableColumns", components: [
- {kind: "XV.ListColumn", classes: "short",
+ {kind: "XV.ListColumn", classes: "first",
components: [
{kind: "XV.ListAttr", attr: "name", isKey: true}
]}
-UPDATE pkghead SET pkghead_version = '4.4.1' WHERE pkghead_name = 'xt';
+UPDATE pkghead SET pkghead_version = '4.5.0Beta' WHERE pkghead_name = 'xt';
if (options) {
/* Convert from rest_query to XM.Model.query structure. */
- query = XM.Model.restQueryFormat(options);
+ query = XM.Model.restQueryFormat("XM.ItemSiteListItem", options);
/* Perform the query. */
return XM.ItemSitePrivate.fetch("XM.ItemSiteListItem", "public.itemsite", query);
"use strict";
var lang = XT.stringsFor("en_US", {
+ "_activityType": "Activity Type",
"_correctToEarliestDate?": "The due date does not fall within the lead time for this Item Source. Would you like it corrected?",
"_correctToMinimumQuantity?": "The quantity is below the minimum order quantity for this Item Source. Would you like it corrected?",
"_correctToMultipleQuantity?": "The quantity does not fall within the order multiple quantity for this Item Source. Would you like it corrected?",
"_UseEarliestAvailDateOnPOItem": "Use Earliest Date",
"_vendorItem": "Vendor Item",
"_vendorItemNumber": "VendorItemNumber",
+ "_vendorUnit": "Vendor Unit",
"_viewPurchaseOrders": "View Purchase Orders",
"_vouchered": "Vouchered",
"_warnMaxCostExceeded": "The price is above the maximum desired cost of {maximumDesiredCost} for this Item."
DECLARE
_cost NUMERIC := 0.0;
BEGIN
- SELECT itemcost(itemsite_id) INTO _cost
- FROM itemsite
- WHERE (itemsite_item_id=pItemid)
- AND (itemsite_warehous_id=pSiteid);
+ IF (fetchMetricBool('WholesalePriceCosting')) THEN
+ SELECT item_listcost INTO _cost
+ FROM item
+ WHERE (item_id=pItemid);
+ ELSE
+ SELECT itemcost(itemsite_id) INTO _cost
+ FROM itemsite
+ WHERE (itemsite_item_id=pItemid)
+ AND (itemsite_warehous_id=pSiteid);
+ END IF;
RETURN _cost;
END;
correct model will be fetched and this function will be called again
recursively with the model.
+ *In case of "order" models, each order's workspace is different depending on the order type.
+ This causes the Workspace var to be null so get the value from the getWorkspace
+ defined on the relation.js sub-kind.
+
@param {XM.Model|Number|String} Value; can be a model or the id of a model.
@param {Object} options
*/
nameValue = "",
descripValue = "",
additionalValue = "",
- Workspace = this._Workspace,
+ Workspace = this._Workspace || (newId ? this._List.prototype.getWorkspace(value) : null),
Model = this._collection.model,
id,
newValue,
any REST API client queriers.
Sample usage:
- XM.Model.restQueryFormat({"query": [{"city":{"EQUALS":"Norfolk"}}], "orderby": [{"ASC": "line1"}, {"DESC": "line2"}]})
+ XM.Model.restQueryFormat("XM.Address", {"query": [{"city":{"EQUALS":"Norfolk"}}], "orderby": [{"ASC": "line1"}, {"DESC": "line2"}]})
@param {Object} options: query
@returns {Object} The formated query
*/
- XM.Model.restQueryFormat = function (options) {
+ XM.Model.restQueryFormat = function (recordType, options) {
options = options || {};
var order = {},
}
}
}
+
+ /* Convert free text query. */
+ if (recordType && options.q) {
+ /* Get schema and add string columns to search query. */
+ var data = Object.create(XT.Data),
+ nameSpace = recordType.beforeDot(),
+ type = recordType.afterDot(),
+ orm = data.fetchOrm(nameSpace, type),
+ schema = XT.Session.schema(nameSpace.decamelize(), type.decamelize()),
+ param = {
+ "attribute": []
+ };
+
+ for (var c = 0; c < schema[type].columns.length; c++) {
+ if (schema[type].columns[c].category === 'S') {
+ param.attribute.push(schema[type].columns[c].name);
+ }
+ }
+
+ if (param.attribute.length) {
+ /* Add all string columns to attribute query. */
+ query.parameters = query.parameters || [];
+
+ param.operator = 'MATCHES';
+
+ /* Replace any spaces with regex '.*' so multi-word search works on similar strings. */
+ param.value = options.q.replace(' ', '.*');
+ query.parameters.push(param);
+ }
+ }
+
if (options.orderby || options.orderBy) {
options.orderBy = options.orderby || options.orderBy;
query.orderBy = [];
}
}
}
+
if (options.rowlimit || options.rowLimit) {
options.rowLimit = options.rowlimit || options.rowLimit;
query.rowLimit = options.rowLimit;
}
+
if (options.maxresults || options.maxResults) {
options.maxResults = options.maxresults || options.maxResults;
query.rowLimit = options.maxResults;
}
+
if (options.pagetoken || options.pageToken) {
options.pageToken = options.pagetoken || options.pageToken;
if (query.rowLimit) {
query.rowOffset = (options.pageToken || 0);
}
}
+
if (options.count) {
query.count = options.count;
}
/* Convert from rest_query to XM.Model.query structure. */
if (recordType && options) {
formattedOptions = {
- "query": XM.Model.restQueryFormat(options)
+ "query": XM.Model.restQueryFormat(recordType, options)
};
}
@param {String} Schema name
@returns {Hash}
*/
- XT.Session.schema = function(schema) {
+ XT.Session.schema = function(schema, table) {
var sql = 'select c.relname as "type", ' +
' attname as "column", ' +
' typcategory as "category", ' +
' join pg_type t on a.atttypid = t.oid ' +
' join xt.orm on lower(orm_namespace) = n.nspname and xt.decamelize(orm_type) = c.relname and not orm_ext ' +
'where n.nspname = $1 ' +
+ (table ? ' and c.relname = $2 ' : '') +
'and relkind = \'v\' ' +
'and orm_context = \'xtuple\' ' +
'union all ' +
' left join xt.grpext on ext_id=grpext_ext_id ' +
' left join usrgrp on usrgrp_grp_id=grpext_grp_id ' +
'where n.nspname = $1 ' +
+ (table ? ' and c.relname = $2 ' : '') +
' and relkind = \'v\' ' +
' and orm_context != \'xtuple\' ' +
- ' and (usrext_usr_username = $2 or usrgrp_username = $2) ' +
+ ' and (usrext_usr_username = $3 or usrgrp_username = $3) ' +
' group by c.relname, attname, typcategory, n.nspname, attnum ' +
'order by type, attnum',
- recs = plv8.execute(sql, [schema, XT.username]),
+ recs = plv8.execute(sql, [schema, table, XT.username]),
type,
prev = '',
name,
parameters : [{
attribute: _.pluck(columns, 'name'),
operator: 'MATCHES',
- value: that.query.q
+ /* Replace any spaces with regex '.*' so multi-word search works on similar strings. */
+ value: that.query.q.replace(' ', '.*')
}]
}, _.omit(this.query, 'q'));
"author": "xTuple <dev@xtuple.com>",
"name": "xtuple",
"description": "xTuple Enterprise Resource Planning Mobile-Web client",
- "version": "4.4.1",
+ "version": "4.5.0-beta",
"repository": {
"type": "git",
"url": "https://github.com/xtuple/xtuple.git"