El2rstimService
El2rstimService.asmx
This web service provides two methods to determine whether an item is restricted:
- FindDealerRestrictedItem
- FindConsumerRestrictedItem
Both of them are based on Elliott restricted attribute logic to determine if we can sell/ship a certain item to a customer or consumer. The difference is FindDealerRestricedItem method makes use of the customer number or ship-to if passed. It checks for all restricted types:
- Not Allow
- Restricted When Present
- Restricted When Not Present
- Quantity Restriction
In addition, it also checks XSHIPNOTOK attribute to stop cross ship if the feature is turned on.
On the other hand, FindConsumerRestrictedItem
method ignores customer number and ship-to. The definition of “consumer” here
is someone that does not have a customer number in the Elliott system. Therefore, we
can only check the “Not Allow” type of restriction where some items are not
allowed for certain geography areas regardless of which customers it may be. In
addition, we can’t check for the cross ship condition since the customer record is
presumed not present.
In our attribute restriction check, an
attribute that’s attached to the product category or user-defined code is also
inherited to the item level. This is very convenient if you wish to make
restrictions on a group of items; so you don’t need to add attributes on an item-by-item basis. For both methods, you must pass the Item Number. Product
Category and User Defined Code as optional. If you do not pass, then our web
services will look them up from the item master.
The definition of “Dealer” here refers to someone that has a customer number in the Elliott system. Therefore, we do expect you to pass a customer number when using this method. You may also optionally pass a ship-to. If a ship-to is passed, then the restriction checking will apply to the ship-to, in addition to the customer.
You may optionally pass the customer type. If
you do not pass customer type, then the customer type will be looked up from
customer master.
If you pass the geography information (i.e.,
city, state, zip and country,) the system will use them to check restriction. If
not passed, the system will use the address from customer or ship-to.
Note: If the option to check restricted attributes for the order bill to is enabled through Global Setup-> System-> Attribute Processing-> Field 13. Check Restricted Attribute for Bill To Cust and the order will be billed to a different customer number, this method should be called twice. It should be called once with the default customer or ship-to city, state, zip code, and country and a second time with the bill to customer's city, state, zip code, and country.
Usage:
Output = A.FindDealerRestrictedItem(UserName, UserPassword, FindDealerRestrictedItemInput)
Parameters UserName and UserPassword are not used at this moment.
FindDealerRestrictedItemInput Structure
Property Name |
Length |
Type |
Upper |
Detail |
ITEM_NO |
15 |
String |
Y |
Required. |
ITEM_USER_DEF_CD |
2 |
String |
Y |
Default to item master’s user-defined code |
ITEM_PROD_CAT |
3 |
String |
Y |
Default to item master’s product category |
CUS_NO |
6 |
String |
Y |
Even though it is not required, it is strongly suggested to pass. System will not automatically pad leading zeroes. That is to say, for customer number “6” you should pass customer number “000006” instead. |
CUS_TP |
5 |
String |
Y |
Default to customer’s customer type |
SHIP_TO_NO |
4 |
String |
Y |
If passed, then ship-to restriction check will take place, in addition to customer. |
CUS_CITY |
15 |
String |
Y |
Default to customer or ship-to’s city |
CUS_ST |
2 |
String |
Y |
Default to customer or ship-to’s state |
CUS_ZIP |
10 |
String |
Y |
Default to customer or ship-to’s zip code |
CUS_COUNTRY |
10 |
String |
Y |
Default to customer or ship-to’s country |
ToCheckQty |
|
String |
|
Since this is a string field, the pass numeric value should be in quotes (i.e., “1.5”). The value will be converted to an internal format of S9(9)V999 (i.e., maximum 9 digits to the left of decimal and 3 digits to the right of decimal). If you pass this field, system will check for “restricted by quantity” attributes and return the restricted attribute if ToCheckQty + existing ordered quantity + sold quantity is greater than quantity limit. |
AdditionalOrderQty |
|
String |
|
Like above parameter, the value internal format is S9(9)V999. Normally you do not need to pass this field. It is only necessary when you try to change a line item’s quantity. For example, if the original line item quantity is 2, and you wish to change to 5, then you will pass “ToCheckQty” as “5” and “AdditionalOrderQty” as “2.” So system knows there’s an additional quantity of 5 – 2 = 3 and needs to check for maximum order limit. |
ExtraInput |
|
String |
|
Supports “Location=XX” where XX is the order location for cross ship checking if the feature is enabled. The word “Location” is also recognizable if pass “location” or “LOCATION.” Also, if this location is one of the locations in Elliott attribute handling Global Setup “2. Locs ALWAYS Exempt from Restricted Attribute,” then system will skip restriction checking. |
* Upper = Y indicates the value of the property will be converted to upper case.
Output Structure
Property Name |
Type |
Detail |
ReturnCode |
Integer |
Zero means OK; for other return codes, please see “El2rstimService Return Code” section. |
ReturnMsg |
String |
This is description of return code. For example, if return code is zero, you can expect “OK” in this field. |
RstAttrib |
String |
Restricted attribute. |
RstFlag |
String |
There are four possible values: · N: This item is not allowed. · P: This item is restricted due to the attribute being present (at customer/ship-to, or customer type). · R: This item is restricted due to the attribute not present (at customer/ship-to, or customer type). · H: This item should put this order on hold, and you should add the corresponding attribute to the order. |
RstMessage |
String |
Restricted message shows a user-friendly message for the returned value so you do not have to construct the message yourself. For example, “Restricted Item When Present – 30-PER-YR 13 More Allowed. Sold 15 in Period, 2 in Orders, 13 Allowed.” |
ExpireFlag |
String |
For the attribute returned in RstAttrib, it may have expiration issue as follows: · Blank: The attribute has no expiration or activation issue. · E: The attribute is expired. Do not allow user order this item. · H: The attribute is expired. You should allow users to order this item and place the order on hold. · A: The attribute’s activation date is after system date. Do not allow user to order this item. |
LimitByQty |
String |
If returned restricted attribute is limit by quantity, this field will be “Y,” else it will be empty. |
LimitByCustShipto |
String |
If LimitByQty = “Y,” then this field further clarifies that the limit is due to limitation at customer or ship-to level: · C: by customer · S: by ship-to |
LimitQty |
String |
If LimitByQty = “Y,” then this field returns the maximum quantity limit user can purchase in a designated period by the attribute: i.e., No more than 10 in 30 Days. The value 10 is return here. |
LimitPeriodMethod |
String |
If LimitByQty = “Y,” then it returns one of the following values: · N: Last Number of Days · D: Since a Certain Date For example, if the restriction is “No more than 10 in 30 days,” then the return value in this field is “N.” |
LimitNoOfDays |
String |
If LimtByQty = “Y” and LimitPeriodMethod = N, this field shows the number of days. |
LimitFromDate |
String |
If LimitByQty = “Y” and If LimitPeriodMethod = D, this field shows the date. |
SoldQty |
String |
If LimitByQty = “Y”, this field shows the total quantity sold in the period. |
OrderedQty |
String |
If LimitByQty = “Y”, this field shows outstanding order quantity. |
AllowedQty |
String |
If LimitByQty = “Y”, this field shows quantity this customer or ship-to can order without exceeding the attribute limit. |
NextAvailDate |
String |
If LimitByQty = “Y”, this field will have value if the maximum quantity is exceeded. The value represents the next available date that this customer or ship-to can purchase additional quantity as in the next field. |
NextAvailQty |
String |
If LimitByQty = “Y”, this field will have value if the maximum quantity is exceeded. The value represents the additional quantity that this customer or ship-to can purchase on the next available date as in the previous field. |
ExtraOutput |
String |
This field is not used at the moment. |
Code Example (VB)
The following example codes will check if the condition is restricted for customer “000002” and item “011” on location “02” and quantity 20.
Dim Service As New webServicesRstim.El2rstimService
Dim Input As New webServicesRstim.FindDealerRestrictedItemInput
Dim Result As New webServicesRstim.FindDealerRestrictedItemResult
Input.ITEM_NO = “011”
Input.CUS_NO = “000002”
Input.ToCheckQty = 20
Input.ExtraInput = “Location=02”
Result = Service.FindDealerRestrictedItem(“”,“”,Input)
If Result.ReturnCode = 0 Then
If Result.RstFlag <> String.Empty Then
lblResult.Text = Result.RstMessage
Else
lblResult.Text = "This item is not restricted"
End If
Else
lblResult.Text = Result.ReturnMsg
lblReturnCd.Text = Result.ReturnCode.ToString
End If
FindConsumerRestrictedItem
In our definition, a consumer is someone that does not have a corresponding customer number in Elliott, so the restriction checking is only applicable to the “not allow” type of restriction. In addition, the system will not perform cross ship restriction checking, or any other restriction checking based on customer or ship-to number.
Usage:
Output = A.FindConsumerRestrictedItem(UserName, UserPassword, FindConsumerRestrictedItemInput)
Parameters UserName and UserPassword are not used at this moment.
FindConsumerRestrictedItemInput Structure
Property Name |
Length |
Type |
Upper |
Detail |
ITEM_NO |
15 |
String |
Y |
Required. |
ITEM_USER_DEF_CD |
2 |
String |
Y |
Default to item master’s user-defined code. |
ITEM_PROD_CAT |
3 |
String |
Y |
Default to item master’s product category. |
CUS_NO |
6 |
String |
Y |
Not used in this method. |
CUS_TP |
5 |
String |
Y |
Not used in this method. |
SHIP_TO_NO |
4 |
String |
Y |
Not used in this method. |
CUS_CITY |
15 |
String |
Y |
Not used in this method. |
CUS_ST |
2 |
String |
Y |
Not used in this method. |
CUS_ZIP |
10 |
String |
Y |
Not used in this method. |
CUS_COUNTRY |
10 |
String |
Y |
Not used in this method. |
ToCheckQty |
|
String |
|
Not used in this method. |
AdditionalOrderQty |
|
String |
|
Not used in this method. |
ExtraInput |
|
String |
|
Supports “Location=XX” where XX is the order location. The word “Location” is also recognizable if pass “location” or “LOCATION.” The purpose is to determine if the location is exempted from restriction checking per Elliott attribute handling Global Setup “2. Locs ALWAYS Exempt from Restricted Attribute.” |
* Upper = Y indicates the value of the property will be converted to upper case.
Output Structure
Property Name |
Type |
Detail |
ReturnCode |
Integer |
Zero means OK; for other return codes, please see “El2rstimService Return Code” section. |
ReturnMsg |
String |
This is description of return code. For example, if return code is zero, you can expect “OK” in this field. |
RstAttrib |
String |
Restricted attribute. |
RstFlag |
String |
This method only checks for “N” (not allowed) restricted attributes, so this field can only be empty or “N." |
RstMessage |
String |
Restricted message shows an understandable message for the returned value. For example, “Restricted Item When Not Present – RESTR-ATT.” |
ExpireFlag |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
LimitByQty |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
LimitByCustShipto |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
LimitQty |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
LimitPeriodMethod |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
LimitNoOfDays |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
LimitFromDate |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
SoldQty |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
OrderedQty |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
AllowedQty |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
NextAvailDate |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
NextAvailQty |
String |
Not used in this method because it’s not used when RstFlag = “N.” |
ExtraOutput |
String |
Not used at the moment. |
Code Example (VB)
The following example codes will check if item “011” is restricted.
Dim Service As New webServicesRstim.El2rstimService
Dim Input As New webServicesRstim.FindConsumerRestrictedItemInput
Dim Result As New webServicesRstim.FindConsumerRestrictedItemResult
Input.ITEM_NO = “011”
Result = Service.FindConsumerRestrictedItem(“”,“”,Input)
If Result.ReturnCode = 0 Then
If Result.RstFlag <> String.Empty Then
lblResult.Text = Result.RstMessage
Else
lblResult.Text = "This item is not restricted"
End If
Else
lblResult.Text = Result.ReturnMsg
lblReturnCd.Text = Result.ReturnCode.ToString
End If
0 = OK
1 = File Error
2 = Item No Not Provided
CLS