Business Function Specification
Function Name CZARInterface System Code 49
Function Category
Function
Use
1. Functional Description
1.1 Purpose
This function provides an interface from the Transportation Rating Engine to the CZAR interface. It is called when
a rating definition contains an external function name to be used to determine the freight charge.
1.2 Setup Notes and Prerequisites
For rating
an entire shipment or load, the rate definition for CZAR needs to contain the following items:
The rate name must be the CZAR tariff
name
The rate type should be 5 = Business Function
If using and FAK rate:
The rate level should be 1 = Shipment Level
The Freight Class from the
Transportastion Constants will be passed to the CZAR rating engine
If using individual class rates:
The rate level should be 2 = Detail
Level
The detail level should be 2 = NMFC
The function name must be CZARInterface
To use CZAR to return individual rates, however deficit
weight calculations will not be performed. The rate definition for CZAR needs to contain the following items:
The rate name must be the CZAR
tariff name
The rate type should be 1=Unit or 2=Fixed
The function name should be CZARInterface
The CZAR product needs to be installed
in the Cdirectory.
Czar32.dll must be copied into the directory.
If the CZAR DLL is installed on a server, then business function B4901030 must
be mapped to run on that server. This should be done using OCM.
CZAR expects all shipment weights to be in pounds. Freight rates are
returned in hundred-weight.
The UDC codes for freight classes (49/BE) need to be updated to reflected the CZAR freight class. The CZAR freight
class needs to be entered in the special handling code. Leading zeroes should be removed, for example for class 055, the special
handling should be 55.
1.3 Special Logic
2. Technical Specifications
2.1 Parameters:
Data Item Data Structure
Description I/O Required Notes
FRCG Freight Rate Amount O Y This is the freight charge. It can be either a flat rate or unit rate depending on the rate definition.
CRCD Freight
Rate Currency Code O In a multi-currency environment, this is the currency code for the freight rate.
RTDQ Rated Quantity I/O The quantity
being rated
UOM Rated Quantity Unit Of Measure I/O The quantity unit of measure.
DTAI Error Message ID O
EV01 Use Business
Function Cache O Indicates if the calculated charges are being returned in the Rating External Cache. Cache can only be used when the rate type
is 5=Business Function. 0-Charges are not found in cache. The total charges are returned in the data structure field Freight Rate Amount.
1-Charges are to be taken from the Rating External Function Cache.
JOBS Job Number I Yes This is the primary index to the input
caches.
JOBS Detail Job Number I Yes This is the index to the shipment detail caches. (D4900190RD, D4900190RB)
BLPB Billable/Payable
Flag I This flag determines whether to calculate billable or payable charges. B-Billable, P-Payable
FRSC Freight Rate Schedule I This is the rate
schedule used to determine the freight charges.
CARS Carrier Number I This is the carrier number for the shipment or load.
VMCU Planning
Depot I This is the planning depot for the load.
LDNM Load Number I This is the load number.
DLNO Delivery Number I This is the
delivery number. When calculating payable charges for a load, this should be zero.
SHPN Shipment Number I This is the shipment number.
When calculating charges for a load or delivery, this should be zero.
RSSN Routing Step Number I This is the routing step number. When
calculating charges for a load or delivery, this should be zero.
SHAN Ship to Address Number I This is the ship to address number. This is
taken from the shipment header
NMCU Origin Depot I The origin depot of the load or shipment. This will be used to obtain the domestic
currency code and transportation constants.
ORGN Origin I This is the origin address book number. It will be used when necessary to obtain
distance. This is loaded from the shipment routing step or from the load header.
ADDO Origin Postal Code I The origin postal
code.
ANCC Destination Address Book Number I This is the destination address book number. For a shipment or delivery, this comes from the shipment
routing step. For a load, this comes from the load header.
ADDZ Destination postal Code I This is the destination postal code.
WGTS Total
Weight I This is the total weight being rated.
WTUM Weight Unit of Measure I The weight unit of measure.
SCVL Total Volume I This is
the total volume being rated.
VLUM Volume Unit of Measure I The volume unit of measure.
CCUB Cubic Container Space I The total cubic
container space being rated.
WGTS Total Load Weight I This is the total weight of a load. This is used when calculating a billable charge
for a delivery that is a pro-rated charge based on weight.
SCVL Total Load Volume I This is the total load volume. This is used when
calculating a billable charge for a delivery that is a pro-rated charge based on volume.
DSTN Distance I/O This is the distance used for rating.
DSRC Distance Source I/O This is the source of the distance.
UMD1 Distance UOM I/O The unit of measure for distance.
NSTP Number of
Stops I The number of stops on a load. This is obtained from the loaded header.
NPCS Number of Pieces I The total number of pieces
being rated.
LGTS Length I The total width of this shipment or piece.
WTHS Width I The total length of this shipment or
piece.
HGTS Height I The total height of this shipment or piece.
GTHS Girth I The total girth of this shipment or piece.
LUOM Linear Unit if Measure I The unit
of measure for linear dimensions.
NCTR Number of Containers I The number of containers on a shipment, delivery, or load.
AEXP Extended Price I The total extended price for all shipments on the delivery or load in domestic currency.
FEA Extended Price Foreign I The total
foreign extended price for a shipment or for all shipments on a delivery. If this is a load that contains shipments with multiple currency codes,
this will not be used.
CRCD Foreign Currency Code I The currency code of the foreign extended price. This is the Ship-To currency
code.
ECST Extended Cost I The total cost for all shipments on the delivery or load in domestic currency.
ODST Out of Route Distance I The total
out of route distance for the load. This is obtained from the load header.
ELTM Elapsed Time I The total elapsed time for the load. This is
obtained from the load header.
UM Time Unit of Measure I The unit of measure for the elapsed time.
ROUT Route I The route code for the
shipment, delivery, or load. This is obtained form the shipment routing step or the load header.
ZON Zone I The zone for the shipment,
delivery, or load. This is obtained from the shipment routing step or load header.
CZON Carrier Zone I The zone assigned by the carrier to the
shipment or load destination. This is obtained from the routing entry or load header.
RTN Route Number I The route number that was
assigned to this shipment or load. This is obtained from the shipment routing step or load header.
SCT1 Shipment Category 1 I The value
assigned to shipment category code 1. This is used for shipment and delivery level charges only.
SCT2 Shipment Category 2 I The value
assigned to shipment category code 2. This is used for shipment and delivery level charges only.
SCT3 Shipment Category 3 I The value
assigned to shipment category code 3. This is used for shipment and delivery level charges only.
PPDJ Shipment Date I Yes The date of the
shipment or load. This is the date used to determine whether a rate is in effect. If a shipment has not been confirmed, the promised shipment
date should be passed, otherwise the actual shipment date should be passed.
MCU Owning Branch I This is the owning
branch.
CGC1 Charge Code I This is the charge code for the rate being calculated.
SLPF Shipment Level Payable I This is the shipment level payable flag
from the rate definition.
NMFC Default Freight Class I This is the default freight class from the transportation constants.
SCAC Carrier
Code I This is the standard alpha carrier code from the carrier master.
RTNM Rate Name I This is the rate name that is being
calculated.
RTGB Rate Basis I This is the rate basis from the rate definition.
SHPC Rate Level I This is the rate level from the rate definition.
RDLV Rate
Detail Level I This is the detail rate level from the rate definition.
GS1A Freight Detail Key I This in only populated when processing a rate type
of 1 or 2, and the rate detail level is 2-Detail.
CRDC Currency Code Domestic I The domestic currency code.
CRCD Currency Code
Carrier I The carrier's currency code.
CRCD Currency Code Ship To I The foreign currency code for the routing steps.
FRTP Rate Type I This is
the rate type from the rate definition. 1-Unit, 2-Fixed, 5-Business Function
2.2 Related Tables
Table Table Description
2.3 Related
Business Functions
Source Name Function Name
B4900940 Internal Call Czar Dll
B4000810 Get Address for OP
B4900193 Cache Process
Rating External Function
X0005 Get UDC
2.4 Processing
If currency processing is active, set the freight charge code currency code to the
domestic currency code.
If the rate type is 5=Business Function, set the flag to use cache to '1', otherwise initialize to '0'..
Get the city name, state,
and country for the origin address book number.
Get the city name, state, and country for the destination address book number.
Format the
CZAR postal codes based on the country. If the country is Canada "CA", the first three characters are used, otherwise the first five characters
are used.
If the rate type is 5 =Business Function, perform a loop through the detail cache. If rating Shipment Level Payable for a load, and
generating payable charges, process the detail cache by delivery number. (D4900190B). Otherwise if rating payable, process the detail cache
by transportation number only (D4900190D). If rating billable, process the detail cache by delivery number. (D4900190B). For each cache
record read, the following steps are taken:
When end of cache has been detected, set on the end of cache flag and the change in freight key
flag.
If a cache record was retrieved, and a change in freight key was encountered, and this is not the first cache record, set on the change in
freight key flag.
If the end of cache has been detected but there were no cache records retrieved, set on the end of cache flag and the change
in freight key flag. Also, default the freight class to the default freight class from the Transportation Constants, and default the shipment weight
to be rated to the total shipment weight.
If the change in freight key flag has been set on, a new freight class was encountered. The previous
freight class total needs to be written to cache.
Call the Function GetUDC, passing the freight class and returning the CZAR freight code in the
special handling field. If special handling is returned as a blank, set the input message id to '098G'.
Write the CZAR freight class, the freight
class code, and the total weight for the freight class to the Rating External Function Cache (D4900910RE).
Clear the total weight to be rated for
the freight class.
Set the freight class code in progress to the code just read from the detail cache.
Increment the total weight to be rated by
weight in the detail cache.
Reset the end of cache flag and the change in freight key flag.
If the rate type is 1=Unit or 2=Fixed, write one shipment
record to the Rating External Function Cache (D4900910RE). Perform the following steps:
Call the Function GetUDC, passing the freight class
from the input data structure and returning the CZAR freight code in the special handling field. If special handling is returned as a blank, set
the input message id to '098G'.
Write the CZAR freight class, the freight class code, and the total weight from the input data structure - to the
Rating External Function Cache (D4900910RE).
If the total number of records written to the Rating External Function Cache exceeds 20, set the
input message id to '098I'.
If the error message id is blank, continue with the CZAR interface.
Call the function InternalCallCzarDll to rate the
shipment or load.
If the error message id is returned as a blank, continue and update the input data structure values.
If the deficit weight charge is not
zero, and the rate type is not 1=Unit, write a record to the Rating External Function Cache (D4900910RE) for the amount of the deficit weight
charge with a blank freight class.
Retrieve the total charges from the Rating External Function Cache. Perform a loop and process all records
in the cache. For each record, perform the following steps:
If the rate type is 1=Unit, move the cache freight rate to the input data structure
freight rate.
If the rate type is not 1, accumulate the cache freight rate into the input data structure freight rate.
If the rate type is not 1=Unit and the
total freight rate just calculated is less than the minimum charge returned by CZAR:
Replace the input data structure freight rate with the
minimum charge.
Set the rated quantity in the input data structure to zero.
Turn off the Use Cache Flag.
If the error message number is not blank, turn
off the Use Cache Flag.
If the Use Cache Flag is not '1', delete the Rating External Function Cache (D4900910RE).
^
D4900920 - External Rating Function Template
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
mnFreightChargeRateA | FRCG | MATH_NUMERIC | OPT | NONE |
The unit or flat amount of a freight charge. | ||||
szFreightChargeCurrencyCode | CRCD | char | OPT | NONE |
A code that identifies the currency of a transaction. | ||||
mnRatedQuantity | RTDQ | MATH_NUMERIC | OPT | NONE |
The quantity in weight, volume, or some other unit which was used to calculate a charge. The type of quantity is specified by the rate basis. | ||||
szUnitOfMeasureRatedQuantity | UOM | char | OPT | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szErrorMessageID | DTAI | char | OPT | NONE |
A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or
| ||||
cUseRatingFunctionCache | EV01 | char | OPT | NONE |
An option that specifies the type of processing for an event. | ||||
mnTransportationJobnumber | JOBS | MATH_NUMERIC | OPT | NONE |
The job number (work station ID) which executed the particular job. | ||||
mnDetailJobNumber | JOBS | MATH_NUMERIC | OPT | NONE |
The job number (work station ID) which executed the particular job. | ||||
cBillablePayable | BLPB | char | OPT | NONE |
Designates whether a freight charge will be billed to a client (billable) or paid to a contractor (payable). Valid values are:
B Billable
P
| ||||
szFreightRateSchedule | FRSC | char | OPT | NONE |
The schedule of freight and miscellaneous charges which are applied to a shipment. | ||||
mnCarrier | CARS | MATH_NUMERIC | OPT | NONE |
The address number for the preferred carrier of the item. The customer or your organization might prefer a certain carrier due to route or
| ||||
szPlanningDepot | VMCU | char | OPT | NONE |
Indicates the depot from which a trip originates. The Trip Depot and the Trip Number fields identify the unique combination of vehicle,
| ||||
mnLoadNumber | LDNM | MATH_NUMERIC | OPT | NONE |
1 | ||||
mnDeliveryNumberA | DLNO | MATH_NUMERIC | OPT | NONE |
This is a system assigned number which is used when a shipment is placed on a load or when two or more shipments for the same
| ||||
mnShipmentNumber | SHPN | MATH_NUMERIC | OPT | NONE |
A "next number" that uniquely identifies a shipment. | ||||
mnRoutingStepNumber | RSSN | MATH_NUMERIC | OPT | NONE |
This is the number assigned to a shipment routing step. The movement of a shipment from the origin to the final destination (ship to
| ||||
mnAddressNumberShipTo | SHAN | MATH_NUMERIC | OPT | NONE |
The address number of the location to which you want to ship this order. The address book provides default values for customer address,
| ||||
szOriginDepot | NMCU | char | OPT | NONE |
This identifies the origin depot for a shipment or a load. | ||||
mnOriginAddressNumber | ORGN | MATH_NUMERIC | OPT | NONE |
This is the address book number of the origin of a shipment. This could be the address number for the branch/plant, the address number of
| ||||
szPostalCodeOrigin | ADDO | char | OPT | NONE |
The origin postal code of a shipment. | ||||
mnDestinationAddressNumber | ANCC | MATH_NUMERIC | OPT | NONE |
The address book number of a hub or deconsolidation center. A hub number is entered for a load to indicate a pooled shipment. | ||||
szZipCodePostalDestination | ADDZ | char | OPT | NONE |
The United States ZIP code or the postal code that specifies where a letter is to be routed. Attach this code to the address for delivery in
| ||||
mnShipmentWeight | WGTS | MATH_NUMERIC | OPT | NONE |
The shipment weight is qualified by a Weight Qualifier (WGQ) that identifies the type of weight. | ||||
szWeightUnitOfMeasure | WTUM | char | OPT | NONE |
The unit of measure that indicates the weight of an individual item. Typical weight units of measure are:
GM Gram
OZ Ounce
LB Pound
| ||||
mnShipmentVolume | SCVL | MATH_NUMERIC | OPT | NONE |
The volume scheduled on a load or in a compartment. | ||||
szVolumeUnitOfMeasure | VLUM | char | OPT | NONE |
The unit of measure for the cubic space occupied by an inventory item. Typical volume unit of measures are:
ML Milliliter
OZ Fluid Ounce
| ||||
mnCubicContainerSpace | CCUB | MATH_NUMERIC | OPT | NONE |
The volume of shipment containers which hold product. This volume is used for cube rating instead of the volume of the products on the
| ||||
mnTotalLoadWeight | WGTS | MATH_NUMERIC | OPT | NONE |
The shipment weight is qualified by a Weight Qualifier (WGQ) that identifies the type of weight. | ||||
mnTotalLoadVolume | SCVL | MATH_NUMERIC | OPT | NONE |
The volume scheduled on a load or in a compartment. | ||||
mnDistance | DSTN | MATH_NUMERIC | OPT | NONE |
Either the total amount of distanced traveled, or the total amount of time spent idle. | ||||
cDistanceSource | DSRC | char | OPT | NONE |
The source of the distance for a delivery. The source could be a preference,carrier agreement, entered by the user, or retrieved from a
| ||||
szUnitofMeasureDistance | UMD1 | char | OPT | NONE |
mnNumberofStops | NSTP | MATH_NUMERIC | OPT | NONE |
The number of stops (usually deliveries) on a load. | ||||
mnNumberofPirces | NPCS | MATH_NUMERIC | OPT | NONE |
The number of pieces, pallets, containers, etc. which make up a shipment.
For shipments that do not have piece information defined in the
| ||||
mnShipmentLength | LGTS | MATH_NUMERIC | OPT | NONE |
The length of a shipment or shipment piece. | ||||
mnShipmentWidth | WTHS | MATH_NUMERIC | OPT | NONE |
The width of a shipment or shipment piece. | ||||
mnShipmentHeight | HGTS | MATH_NUMERIC | OPT | NONE |
The height of a shipment or shipment piece. | ||||
mnShipmentGirth | GTHS | MATH_NUMERIC | OPT | NONE |
The girth of a shipment or shipment piece. | ||||
szUnitofMeasureLinear | LUOM | char | OPT | NONE |
The width, height, or length unit of measure for a vehicle. | ||||
mnNumberOfContainers | NCTR | MATH_NUMERIC | OPT | NONE |
The number of shipping containers, pallets, etc. | ||||
mnAmountExtendedPrice | AEXP | MATH_NUMERIC | OPT | NONE |
The number of units multiplied by the unit price. | ||||
mnAmountForeignExtPrice | FEA | MATH_NUMERIC | OPT | NONE |
The product of the foreign price times the number of units. | ||||
szCurrencyCodeForeign | CRCD | char | OPT | NONE |
A code that identifies the currency of a transaction. | ||||
mnAmountExtendedCost | ECST | MATH_NUMERIC | OPT | NONE |
For accounts receivable and accounts payable, the invoice (gross) amount. For sales orders and purchase orders, the unit cost times the
| ||||
mnOutofRouteDistance | ODST | MATH_NUMERIC | OPT | NONE |
The total distance which is considered outside of the normal route and may be subject to an out of route premium charge. | ||||
mnTimeElapsed | ELTM | MATH_NUMERIC | OPT | NONE |
This is the amount of time in minutes which will be used to determine idle time freight charges. | ||||
szUnitOfMeasureTime | UM | char | OPT | NONE |
A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box,
| ||||
szRouteCode | ROUT | char | OPT | NONE |
The route field is a user defined code (system 42, type RT) that represents the delivery route on which the customer resides. This field is
| ||||
szZoneNumber | ZON | char | OPT | NONE |
The zone field is a user defined code (system 40, type ZN) that represents the delivery area in which the customer resides. This field is one
| ||||
szCarrierZone | CZON | char | OPT | NONE |
The identifier used by a carrier to identify a specific zone. For example, ZONE-21 might refer to a zone used by a parcel carrier to
| ||||
mnRouteNumber | RTN | MATH_NUMERIC | OPT | NONE |
A number assigned by the system to each routing record. | ||||
szShipmentCategoryCode1 | SCT1 | char | OPT | NONE |
A generic field used to store information about a shipment. This field can loaded from an address book category. | ||||
szShipmentCategoryCode2 | SCT2 | char | OPT | NONE |
A generic field used to store information about a shipment. This field can loaded from an address book category. | ||||
szShipmentCategoryCode3 | SCT3 | char | OPT | NONE |
A generic field used to store information about a shipment. This field can loaded from an address book category. | ||||
jdDatePromisedPickJu | PPDJ | JDEDATE | OPT | NONE |
The promised shipment date for a sales order. This date represents the day that the item can be shipped from the warehouse. | ||||
szOwningBranchPlant | MCU | char | OPT | NONE |
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit
| ||||
szChargeCode1 | CGC1 | char | OPT | NONE |
A user defined code which classifies the freight charge. | ||||
szShipmentLevelPayable | SLPF | char | OPT | NONE |
A flag used to specify that payable freight should be calculated at the shipment or delivery level instead of at the load level. | ||||
szDefaultFreightClassification | NMFC | char | OPT | NONE |
The National Motor Freight Classification which is assigned according to the freight commodity code. | ||||
szStandardCarrierAlphaCode | SCAC | char | OPT | NONE |
A unique four-character code assigned to the carrier. | ||||
szRateName | RTNM | char | OPT | NONE |
The name of the rate which is used to define and calculate a freight charge. | ||||
cRateBasisFreight | RTGB | char | OPT | NONE |
The basis used to calculate the charge. | ||||
cRateLevel | SHPC | char | OPT | NONE |
A flag that indicates whether a rate is applied to an entire shipment or to individual pieces on a shipment. Depending on how the rate is
| ||||
cRateDetailLevel | RDLV | char | OPT | NONE |
This flag identifies the shipment detail field that determines a rate when the charge is applied at the shipment detail level.
You can specify
| ||||
szFreightDetailKey | GS1A | char | OPT | NONE |
szCurrencyCodeDomestic | CRDC | char | OPT | NONE |
A code that identifies the domestic (base) currency of the company on a transaction. | ||||
szCurrencyCodeCarrier | CRCD | char | OPT | NONE |
A code that identifies the currency of a transaction. | ||||
szCurrencyCodeShipTo | CRCD | char | OPT | NONE |
A code that identifies the currency of a transaction. | ||||
cRateTyp | FRTP | char | OPT | NONE |
The type of rate specified in a table. This could be a fixed amount or percentage, for example. | ||||
cInboundRouteSelected | IBRS | char | OPT | NONE |
This option indicates an inbound route. |
None |
None |