public class SalesItemsTree extends Object
Inside the script, an instance of this class, containing the data of the quote that the script will be run on, will be provided automatically and can be accessed as a variable named salesItemsTree
SalesItemNode
Modifier and Type | Method and Description |
---|---|
void |
addAttachmentFile(InputStream attachmentStream,
String fileName,
long fileSize,
String attachmentType)
Adds the attachment file as line item attachment
|
SalesItemNode |
addChildByProductErpId(String productErpId)
Adds a new line item under this object by specifying its ERP ID.
|
SalesItemNode |
addChildByProductURI(String productURI)
Adds a new line item under this object by specifying its Product URI.
|
SalesItemsTree |
addNewPriceItem(PriceItemData priceItemData)
Create and Add Price Item data to salesItem, without triggering SSC
pricing.
|
SalesItemsTree |
addPartnerFunctions(Collection<PartnerFunctionRecord> partnerFunctionRecords)
Add partner function records into quote's Partner Function.
|
SalesItemsTree |
deletePartnerFunctions(Collection<BusinessObject> partnerFunctionRecords)
remove partner function records into quote's Partner Function.
|
SalesItemsTree |
deletePriceItem(PriceItemData priceItem)
Remove Price Item data from salesItem, without triggering SSC pricing.
|
List<SalesItemNode> |
filterChildrenByDynamicAttribute(String dynamicAttributeName,
List<Object> dynamicAttributeValues)
Retrieves the list of child line items that has dynamic attribute of one
of the specified values
|
List<SalesItemNode> |
filterChildrenByDynamicAttribute(String dynamicAttributeName,
Object dynamicAttributeValue)
Retrieves the list of child line items that has dynamic attribute of a
specific value
|
List<SalesItemNode> |
filterChildrenByProductERPID(List<String> productERPIDs)
Retrieves the list of child line items that has one of the specified ERP
IDs.
|
List<SalesItemNode> |
filterChildrenByProductName(List<String> productNames)
Retrieves the list of child line items that has one of the specified
objectName
|
List<SalesItemNode> |
filterChildrenByProductType(String productTypeURI)
Retrieves the list of child line items that belongs to a particular
Product Type only
|
Collection<BusinessObject> |
getAllSalesItemBO(GroovyCtxUtil ctx)
Get all salesItem business objects as a Collection for a quote.
|
List<SalesItemNode> |
getAllSubSalesItems()
Get all SalesItemNodes as a List for a quote.
|
AttachmentData |
getAttachmentFile(String fileName)
Get a attachement file by file name.
|
List<AttachmentData> |
getAttachmentFiles()
Get the list of the attachement file.
|
List<AttachmentData> |
getAttachmentFilesByType(String fileType)
Get the list of the attachement file by file type.
|
AttachmentFolderData |
getAttachmentFolder(String folderName)
Get an attachement folder by folder name.
|
List<AttachmentFolderData> |
getAttachmentFolders()
Get the list of the attachment folder.
|
List<SalesItemNode> |
getChildren()
Retrieves the immediate line items.
|
String |
getCurrencyName()
To get the name of the currency used by the quote
|
String |
getCurrencyUri()
To get the URI of the currency used by the quote
|
Object |
getDocumentHeaderDataAttributeValue(String attributeURI) |
String |
getPartnerErpId(String PartnerFunctionURI)
To get the ERPId of the partner function by partner function URI.
|
String |
getPartnerObjectId(String partnerFunctionURI)
To get the object Id of the partner function by partner function URI.
|
String |
getPartnerObjectName(String partnerFunctionURI)
To get the object Name of the partner function by partner function URI.
|
Map<String,List<AbstractObjectDTO>> |
getPartners()
Retrieves the partner functions of the quote.
|
List<String> |
getPartnersErpId(String partnerFunctionURI)
To get all the ERPId for a type of partner function.
|
List<String> |
getPartnersObjectId(String partnerFunctionURI)
To get all the object Id for a type of partner function.
|
List<String> |
getPartnersObjectName(String partnerFunctionURI)
To get all the object names for a type of partner function.
|
List<String> |
getPartnersURI(String partnerFunctionURI)
To get all the object URI for a type of partner function.
|
String |
getPartnerURI(String PartnerFunctionURI)
To get the object URI of a partner function
|
PriceItemData |
getPriceItemByTypeName(String name)
To get the price Item data by name.
|
PriceItemData |
getPriceItemByTypeUri(String uri)
To get the price Item data by URI.
|
PriceItemData |
getPriceItemByUri(String uri)
To get the price Item data by price item URI.
|
List<PriceItemData> |
getPriceItemsByTypeName(String name)
To get all the price Item data by the name of the price item type.
|
List<PriceItemData> |
getPriceItemsByTypeUri(String uri)
To get all the price Item data by price item URI.
|
List<PriceItemData> |
getPriceItemsJustified(String justificationURI)
To get all user justified price Item data.
|
String |
getQuoteAccountName()
Retrieves the name of the account that the quote belongs to
|
String |
getQuoteCountryErpId()
Retrieves the erp id of the country that the quote belongs to The
relationship is as follows: quote -> includesAddress -> hasCountry
|
Object |
getQuoteDataAttributeValue(String attributeURI)
To get the value of a quote data attribute by attribute URI.
|
String |
getQuoteID()
Retrieves the ID of the quote
|
String |
getQuoteRelationAttributeErpId(String attributeURI)
To get the ERPID of a quote relation attribute by attribute URI.
|
String |
getQuoteRelationAttributeObjectId(String attributeURI)
To get the object Id of a quote relation attribute by attribute URI.
|
String |
getQuoteRelationAttributeObjectName(String attributeURI)
To get the object name of a quote relation attribute by attribute URI.
|
String |
getQuoteRelationAttributeURI(String attributeURI)
To get the URI of a quote relation attribute by attribute URI.
|
String |
getQuoteTitle()
Retrieves the title of this quote
|
String |
getQuoteURI()
Retrieves the URI of this quote
|
Integer |
getQuoteVersion()
Retrieves the latest version of this quote
|
BigDecimal |
getTotalPrice()
To get the total price.
|
boolean |
isCommerce()
Indicates the context that Quote object is created from
|
SalesItemsTree |
setPriceItemByTypeName(String priceItemTypeName,
BigDecimal baseAmount)
Create or Update price item with baseAmount only.
|
SalesItemsTree |
setQuoteDataAttribute(String attributeURI,
Object value)
To set a value for the quote data attribute.
|
SalesItemsTree |
setQuoteRelationAttribute(String attributeURI,
String valueURI)
To set a value for the quote relation attribute.
|
String |
toString()
Returns a string representation of the quote, which prints all the line
items in hierarchical manner
|
SalesItemsTree |
updatePriceItemBaseAmount(String priceItemURI,
BigDecimal baseAmount)
Update BaseAmount with targetCurrency of a Price Item
|
SalesItemsTree |
updatePriceItemBaseCurrency(String priceItemURI,
String baseCurrencyUri)
Update baseCurrencyUri of a Price Item
|
SalesItemsTree |
updatePriceItemBaseQuantity(String priceItemURI,
BigDecimal baseQuantity)
Update BaseQuantity with UoM of a Price Item
|
SalesItemsTree |
updatePriceItemBaseUnitUoM(String priceItemURI,
String baseUnitUoMUri,
String baseUnitUoMName)
Update baseUnitUoMUri and baseUnitUoMName of a Price Item
|
SalesItemsTree |
updatePriceItemConditionIsInactive(String priceItemURI,
boolean conditionIsInactive)
Update sequence of a Price Item
|
SalesItemsTree |
updatePriceItemJustification(String priceItemURI,
String uri)
Update Justification of a Price Item
|
SalesItemsTree |
updatePriceItemSequence(String priceItemURI,
int sequenceID)
Update sequence of a Price Item
|
SalesItemsTree |
updatePriceItemTargetAmount(String priceItemURI,
BigDecimal targetAmount)
Update TargetAmount of a Price Item
|
SalesItemsTree |
updatePriceItemTargetCurrency(String priceItemURI,
String targetCurrencyUri)
Update TargetCurrency of a Price Item
|
public void addAttachmentFile(InputStream attachmentStream, String fileName, long fileSize, String attachmentType) throws IMCException
attachmentStream
- Input File StreamfileName
- Name of the file to be addedfileSize
- Size of the File to be addedattachmentType
- type of attachment FileIMCException
public SalesItemNode addChildByProductErpId(String productErpId) throws IMCException
The validity of the given ERP ID will only be evaluated after the script has completed its execution and returns control back to the main application.
productErpId
- The ERP ID of the product to be added as the new line
itemSalesItemNode
object representing the newly added
line itemIMCException
public SalesItemNode addChildByProductURI(String productURI) throws IMCException
The validity of the given URI will only be evaluated after the script has completed its execution and returns control back to the main application.
productURI
- The URI of the product to be added as the new line
item. The full path has to be provided.SalesItemNode
object representing the newly added
line itemIMCException
public SalesItemsTree addNewPriceItem(PriceItemData priceItemData) throws IMCException
priceItemData
- as PriceItemData. See PriceItemData
IMCException
public SalesItemsTree addPartnerFunctions(Collection<PartnerFunctionRecord> partnerFunctionRecords)
partnerFunctionRecords.
- The partner function records to add into a
quote.SalesItemsTree
instance.public SalesItemsTree deletePartnerFunctions(Collection<BusinessObject> partnerFunctionRecords)
partnerFunctionRecords.
- The partner function records to remove
into a quote.SalesItemsTree
instance.public SalesItemsTree deletePriceItem(PriceItemData priceItem) throws IMCException
priceItemData
- as PriceItemData. See PriceItemData
IMCException
public List<SalesItemNode> filterChildrenByDynamicAttribute(String dynamicAttributeName, List<Object> dynamicAttributeValues) throws IMCException
dynamicAttributeName
- The object name of the dynamic attribute. It
can be either Dynamic Symbolic Attribute (DSA) or Dynamic Data
Attribute (DDA). Note that only the object name can be used here,
not the language-specific labelsdynamicAttributeValues
- The list of acceptable values for the
dynamic attribute. For DSA, only the object name of the ranges can
be used here, not the language-specific labelsSalesItemNode
objects directly under this object that
meets the filter criteriaIMCException
public List<SalesItemNode> filterChildrenByDynamicAttribute(String dynamicAttributeName, Object dynamicAttributeValue) throws IMCException
dynamicAttributeName
- The object name of the dynamic attribute. It
can be either Dynamic Symbolic Attribute (DSA) or Dynamic Data
Attribute (DDA). Note that only the object name can be used here,
not the language-specific labelsdynamicAttributeValue
- The accepted value for the dynamic
attribute. For DSA, only the object name of the ranges can be used
here, not the language-specific labelsSalesItemNode
objects directly under this object that
meets the filter criteriaIMCException
public List<SalesItemNode> filterChildrenByProductERPID(List<String> productERPIDs)
productERPIDs
- The list of accepted values of ERP IDSalesItemNode
objects directly under this object that
meets the filter criteriapublic List<SalesItemNode> filterChildrenByProductName(List<String> productNames)
productNames
- The list of accepted values of product object nameSalesItemNode
objects directly under this object that
meets the filter criteriapublic List<SalesItemNode> filterChildrenByProductType(String productTypeURI)
productTypeURI
- The URI of the product type. The full path has to
be provided.SalesItemNode
objects directly under this object that
meets the filter criteriapublic Collection<BusinessObject> getAllSalesItemBO(GroovyCtxUtil ctx) throws IMCException
ctx
- The groovy context GroovyCtxUtil
.IMCException
- the platform exceptionpublic List<SalesItemNode> getAllSubSalesItems() throws IMCException
SalesItemNode
.IMCException
- the platform exceptionpublic AttachmentData getAttachmentFile(String fileName) throws IMCException
AttachmentData
.fileName
- as String the name of the file.AttachmentData
.IMCException
public List<AttachmentData> getAttachmentFiles() throws IMCException
AttachmentData
.AttachmentData
in List.IMCException
public List<AttachmentData> getAttachmentFilesByType(String fileType) throws IMCException
AttachmentData
.fileType
- as String. The file type.AttachmentData
in List.IMCException
public AttachmentFolderData getAttachmentFolder(String folderName) throws IMCException
AttachmentFolderData
.folderName
- the name of the folder.AttachmentFolderData
.IMCException
public List<AttachmentFolderData> getAttachmentFolders() throws IMCException
AttachmentFolderData
in List.IMCException
AttachmentFolderData}.
public List<SalesItemNode> getChildren()
SalesItemNode
objects directly under this objectpublic String getCurrencyName() throws IMCException
IMCException
public String getCurrencyUri() throws IMCException
IMCException
public Object getDocumentHeaderDataAttributeValue(String attributeURI) throws IMCException
IMCException
public String getPartnerErpId(String PartnerFunctionURI) throws IMCException
PartnerFunctionURI
- the URI of the partner function.null
if not
found.IMCException
public String getPartnerObjectId(String partnerFunctionURI) throws IMCException
partnerFunctionURI
- the URI of the partner function.null
if
not found.IMCException
public String getPartnerObjectName(String partnerFunctionURI) throws IMCException
partnerFunctionURI
- the URI of the partner function.null
if
not found.IMCException
public Map<String,List<AbstractObjectDTO>> getPartners() throws IMCException
IMCException
public List<String> getPartnersErpId(String partnerFunctionURI) throws IMCException
partnerFunctionURI
- the URI of the partner function.IMCException
public List<String> getPartnersObjectId(String partnerFunctionURI) throws IMCException
partnerFunctionURI
- the URI of the partner function.IMCException
public List<String> getPartnersObjectName(String partnerFunctionURI) throws IMCException
partnerFunctionURI
- the URI of the partner function.IMCException
public List<String> getPartnersURI(String partnerFunctionURI) throws IMCException
partnerFunctionURI
- the URI of the partner function.IMCException
public String getPartnerURI(String PartnerFunctionURI) throws IMCException
PartnerFunctionURI
- as String. The URI of the type of partner
function.null
if not found.IMCException
public PriceItemData getPriceItemByTypeName(String name) throws IMCException
PriceItemData
name
- as String the name of the price item.PriceItemData
.IMCException
public PriceItemData getPriceItemByTypeUri(String uri) throws IMCException
PriceItemData
uri
- as String the uri of the price item.PriceItemData
.IMCException
public PriceItemData getPriceItemByUri(String uri) throws IMCException
PriceItemData
uri
- as String the uri of the price item.PriceItemData
.IMCException
public List<PriceItemData> getPriceItemsByTypeName(String name) throws IMCException
PriceItemData
name
- as String the name of the price item type.PriceItemData
.IMCException
public List<PriceItemData> getPriceItemsByTypeUri(String uri) throws IMCException
PriceItemData
uri
- as String the URI of the price item type.PriceItemData
in ListIMCException
public List<PriceItemData> getPriceItemsJustified(String justificationURI) throws IMCException
PriceItemData
.PriceItemData
in ListIMCException
public String getQuoteAccountName() throws IMCException
IMCException
public String getQuoteCountryErpId() throws IMCException
IMCException
public Object getQuoteDataAttributeValue(String attributeURI) throws IMCException
attributeURI
- as String. The URI of the quote data attribute.IMCException
public String getQuoteID() throws IMCException
IMCException
public String getQuoteRelationAttributeErpId(String attributeURI) throws IMCException
attributeURI
- as String. The URI of the quote relation attribute.IMCException
public String getQuoteRelationAttributeObjectId(String attributeURI) throws IMCException
attributeURI
- as String. The URI of the quote relation attribute.IMCException
public String getQuoteRelationAttributeObjectName(String attributeURI) throws IMCException
attributeURI
- as String. The URI of the quote relation attribute.IMCException
public String getQuoteRelationAttributeURI(String attributeURI) throws IMCException
attributeURI
- as String. The URI of the quote relation attribute.IMCException
public String getQuoteTitle() throws IMCException
IMCException
public String getQuoteURI()
public Integer getQuoteVersion() throws IMCException
IMCException
public BigDecimal getTotalPrice() throws IMCException
IMCException
public boolean isCommerce()
TRUE
if it is
commerce Inquiry.public SalesItemsTree setPriceItemByTypeName(String priceItemTypeName, BigDecimal baseAmount) throws IMCException
priceItemTypeName
- as String. The name of the price item type.baseAmount
- as BigDecimal. The baseAmount to update / create.SalesItemsTree
IMCException
public SalesItemsTree setQuoteDataAttribute(String attributeURI, Object value) throws IMCException
attributeURI
- as String. The URI of the quote data attribute.value
- as Object. The value for the quote data attribute.SalesItemsTree
IMCException
- the platform exceptionpublic SalesItemsTree setQuoteRelationAttribute(String attributeURI, String valueURI) throws IMCException
attributeURI
- as String. The URI of the quote relation attribute.valueURI
- as Object. The value for the quote relation attribute.SalesItemsTree
IMCException
- the platform exceptionpublic String toString()
public SalesItemsTree updatePriceItemBaseAmount(String priceItemURI, BigDecimal baseAmount) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.baseAmount
- as BigDecimal. The BaseAmount of the price item.IMCException
public SalesItemsTree updatePriceItemBaseCurrency(String priceItemURI, String baseCurrencyUri) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.baseCurrencyUri
- as String. The base Currency Uri of the price
item.IMCException
public SalesItemsTree updatePriceItemBaseQuantity(String priceItemURI, BigDecimal baseQuantity) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.baseQuantity
- as BigDecimal. The Base Quantity value (base
condition unit) of the price item.IMCException
public SalesItemsTree updatePriceItemBaseUnitUoM(String priceItemURI, String baseUnitUoMUri, String baseUnitUoMName) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.baseUnitUoMUri
- as String. The base unit UoM Uri of the price item.baseUnitUoMName
- as String. The base unit UoM Name of the price
item.IMCException
public SalesItemsTree updatePriceItemConditionIsInactive(String priceItemURI, boolean conditionIsInactive) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.sequenceID
- as int. The sequence of the price item.IMCException
public SalesItemsTree updatePriceItemJustification(String priceItemURI, String uri) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.uri
- as String. The URI of the justification.
(http://www.inmindcloud.com/application/schema.owl#UserJustified
or
http://www.inmindcloud.com/application/schema.owl#SystemJustifiedERP)IMCException
public SalesItemsTree updatePriceItemSequence(String priceItemURI, int sequenceID) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.sequenceID
- as int. The sequence of the price item.IMCException
public SalesItemsTree updatePriceItemTargetAmount(String priceItemURI, BigDecimal targetAmount) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.targetAmount
- as BigDecimal. The targetAmount of the price item.IMCException
public SalesItemsTree updatePriceItemTargetCurrency(String priceItemURI, String targetCurrencyUri) throws IMCException
priceItemURI
- as String. The URI of the price item to be updated.targetCurrencyUri
- as String. The target Currency Uri of the price
item.IMCException