diff --git a/process/AddressEntity_lib/process.js b/process/AddressEntity_lib/process.js index a4ac29d053fa3c7a8832fa965116729b6831bbe9..3f13bba906e672156c214fc934e47f0258f5fcb1 100644 --- a/process/AddressEntity_lib/process.js +++ b/process/AddressEntity_lib/process.js @@ -4,8 +4,19 @@ import("system.vars"); ////when available: this should be outsourced within the Address_entity //till then: keep entity specific Code here +/** + * Methods used by the AddressEntity. + * Do not create an instance of this! + * + * @class + */ function AddressEntityValidation(){} +/** + * check if the field, this function is called in is a mandatory field of the country + * + * @return {Boolean} + */ AddressEntityValidation.isMandatoryField = function() { var fieldName = vars.get("$this.name").replace(/^\$?field\./, ""); @@ -17,6 +28,11 @@ AddressEntityValidation.isMandatoryField = function() return isMandatory; }; +/** + * return the shorthand for an field name + * + * @return {String} ADDRESS: A, CITY: C, STATE: S, ZIP: Z + */ AddressEntityValidation.mapFieldToShorthand = function(fieldName) { var fieldCode; diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index 239006faaef2b329f42d2c9103c07c2b4de7a247..368c8909a202a61b155b6e644b57b0b9508903c5 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -117,6 +117,8 @@ AttributeUtil.setAttribute = function () * easier. You probaly won't need this for anything else. * * @param {String} pAttrId the id of the attribute + * + * @class */ function AttributeHandler (pAttrId) //TODO: find out if this class is necessary, maybe there is a more elegant solution, this could also be static { @@ -124,6 +126,9 @@ function AttributeHandler (pAttrId) //TODO: find out if this class is necessar this._attributeType = null; } +/** + * Returns a new AttributeHandler for the given Attribute + */ AttributeHandler.begin = function (pAttrId) { return new AttributeHandler(pAttrId); @@ -168,6 +173,13 @@ AttributeHandler.prototype.getAttributeContentType = function () return AttributeTypes.getContentType(this.getAttributeType()); } +/** + * Sets the value to the AttributeField and also return s the value again. + * + * @param pValue the value + * + * @return {Any} the value + */ AttributeHandler.prototype.setAttributeValue = function (pValue) { var field = "$field." + this.getAttributeField(); diff --git a/process/OfferOrder_lib/process.js b/process/OfferOrder_lib/process.js index a2004d9bac18bdd97e1e977bd820063d6b1b879f..cb1dc57b42c964b43850f223dfaee60a8aff5789 100644 --- a/process/OfferOrder_lib/process.js +++ b/process/OfferOrder_lib/process.js @@ -236,7 +236,7 @@ ItemUtils.prototype.roundPrice = function(price) { * @param {String} productId req UID of root product (selected product) * @param {String} assignedTo opt UID of parent item * @param {String} currency opt currency for price list to use - * @param {String} relationId opt contactid for price list to use (custom price list) + * @param {String} contactId opt contactid for price list to use (custom price list) * @param {String[][]} additionalProductInfo additional product info, which has to be copied from the product. (e.g. INFO field is only used by offer) * has to be in the form: [["DESTINATION-DB-FIELD", "PRODUCT-DB-FIELD"], ...] * @@ -244,7 +244,7 @@ ItemUtils.prototype.roundPrice = function(price) { * * @abstract */ -ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, currency, relationId, additionalProductInfo) { +ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, currency, contactId, additionalProductInfo) { if (additionalProductInfo == undefined) { additionalProductInfo = [] } var insertedItemIds = []; @@ -256,8 +256,8 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c assignedTo = ""; if (currency == undefined) currency = ""; - if (relationId == undefined) - relationId = ""; + if (contactId == undefined) + contactId = ""; var rootProdId = productId; if (rootProdId != "") { @@ -269,7 +269,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c columns = columns.concat(additionalProductInfo.map(function(item) {return item[0]})); var colTypes = db.getColumnTypes(table, columns); // partsList[rootProdId] = root node - __itemInsertStatement(partsList[rootProdId], assignedTo, currency, relationId); + __itemInsertStatement(partsList[rootProdId], assignedTo, currency, contactId); if (statements.length > 0) db.inserts(statements); @@ -278,7 +278,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c return insertedItemIds; //recursive function for building item insert statements - function __itemInsertStatement(partsListObj, assignedTo, currency, relationId) { + function __itemInsertStatement(partsListObj, assignedTo, currency, contactId) { for (var i = 0; i < partsListObj.ids.length; i++) { var newid = util.getNewUUID(); self._appendNode(newid, assignedTo); @@ -290,7 +290,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c var prodid = partsList[p2pid].sourceid; var ProductDetails = ProductUtils.getProductDetails( prodid, - { currency: currency, quantity: P2pObject.quantity, relationId: relationId }, + { currency: currency, quantity: P2pObject.quantity, relationId: contactId }, additionalProductInfo.map(function(item) {return item[1]})); var price = ""; diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index 9078239b376a950037bd77a5b54f12367a7399b3..6f7515d1036833af71835a986d51e50568178501 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -315,27 +315,45 @@ function OfferItemUtils(pOfferId) { OfferItemUtils.prototype.constructor = OfferItemUtils; } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.getNetAndVat = function(offeritemIdsToDel) { return ItemUtils.prototype.getNetAndVat.apply(this, [offeritemIdsToDel]); } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.initItemTree = function() { ItemUtils.prototype.initItemTree.apply(this); } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.getItemSum = function(pQuantity, pPrice, pDiscount, pOptional) { return ItemUtils.prototype.getItemSum.apply(this, [pQuantity, pPrice, pDiscount, pOptional]); } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.getItemVAT = function(pQuantity, pPrice, pDiscount, pVAT, pOptional) { return ItemUtils.prototype.getItemVAT.apply(this, [pQuantity, pPrice, pDiscount, pVAT, pOptional]); } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.roundPrice = function(pPrice) { return ItemUtils.prototype.roundPrice.apply(this, [pPrice]); } -OfferItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCurrency, pRelationId) { +/** + * For documentation, see class ItemUtils. + */ +OfferItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCurrency, pContactId) { this.initItemTree(); var cols = ["OFFERITEMID" @@ -352,27 +370,39 @@ OfferItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCu , "ITEMPOSITION" , "ITEMSORT"]; - return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pRelationId, [["INFO", "INFO"]]]); + return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pContactId, [["INFO", "INFO"]]]); } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.deletePartsList = function(pItemId) { this.initItemTree(); return ItemUtils.prototype.deletePartsList.apply(this, [pItemId]); } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.getNextItemSort = function(pIds) { this.initItemTree(); return ItemUtils.prototype.getNextItemSort.apply(this, [pIds]); } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.getNextItemPosition = function(pAssignedTo, pTree, pIds) { this.initItemTree(); return ItemUtils.prototype.getNextItemPosition.apply(this, [pAssignedTo, pTree, pIds]); } +/** + * For documentation, see class ItemUtils. + */ OfferItemUtils.prototype.reOrgItems = function() { this.initItemTree(); diff --git a/process/Order_lib/process.js b/process/Order_lib/process.js index d006db8a76a57988e82843bbeaeffcfdce37b6e9..0c927b0ed370eb84461c5b0d40ee5c5b69f1a08e 100644 --- a/process/Order_lib/process.js +++ b/process/Order_lib/process.js @@ -170,27 +170,45 @@ function OrderItemUtils(pOrderId) { OrderItemUtils.prototype.constructor = OrderItemUtils; } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.getNetAndVat = function(orderitemIdsToDel) { return ItemUtils.prototype.getNetAndVat.apply(this, [orderitemIdsToDel]); } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.initItemTree = function() { ItemUtils.prototype.initItemTree.apply(this); } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.getItemSum = function(pQuantity, pPrice, pDiscount, pOptional) { return ItemUtils.prototype.getItemSum.apply(this, [pQuantity, pPrice, pDiscount, pOptional]); } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.getItemVAT = function(pQuantity, pPrice, pDiscount, pVAT, pOptional) { return ItemUtils.prototype.getItemVAT.apply(this, [pQuantity, pPrice, pDiscount, pVAT, pOptional]); } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.roundPrice = function(pPrice) { return ItemUtils.prototype.roundPrice.apply(this, [pPrice]); } -OrderItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCurrency, pRelationId) { +/** + * For documentation, see class ItemUtils. + */ +OrderItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCurrency, pContactId) { this.initItemTree(); var cols = ["SALESORDERITEMID" @@ -207,27 +225,39 @@ OrderItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCu , "ITEMPOSITION" , "ITEMSORT"]; - return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pRelationId]); + return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pContactId]); } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.deletePartsList = function(pItemId) { this.initItemTree(); return ItemUtils.prototype.deletePartsList.apply(this, [pItemId]); } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.getNextItemSort = function(pIds) { this.initItemTree(); return ItemUtils.prototype.getNextItemSort.apply(this, [pIds]); } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.getNextItemPosition = function(pAssignedTo, pTree, pIds) { this.initItemTree(); return ItemUtils.prototype.getNextItemPosition.apply(this, [pAssignedTo, pTree, pIds]); } +/** + * For documentation, see class ItemUtils. + */ OrderItemUtils.prototype.reOrgItems = function() { this.initItemTree();