CZARInterface

CZAR Interface

Minor Business Rule

Object Name: N4900930

Parent DLL: CTRAN

Location: Client/Server

Language: NER

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). ^

Data Structure

D4900920 - External Rating Function Template

Parameter NameData ItemData TypeReq/OptI/O/Both
mnFreightChargeRateAFRCGMATH_NUMERICOPTNONE

The unit or flat amount of a freight charge.

szFreightChargeCurrencyCodeCRCDcharOPTNONE

A code that identifies the currency of a transaction. 

mnRatedQuantityRTDQMATH_NUMERICOPTNONE

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.

szUnitOfMeasureRatedQuantityUOMcharOPTNONE

A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).

szErrorMessageIDDTAIcharOPTNONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

cUseRatingFunctionCacheEV01charOPTNONE

An option that specifies the type of processing for an event.

mnTransportationJobnumberJOBSMATH_NUMERICOPTNONE

The job number (work station ID) which executed the particular job.

mnDetailJobNumberJOBSMATH_NUMERICOPTNONE

The job number (work station ID) which executed the particular job.

cBillablePayableBLPBcharOPTNONE

Designates whether a freight charge will be billed to a client (billable) or paid to a contractor (payable). Valid values are:    B Billable    P 
Payable    *  Either billable or payable (the same table is used for both)    N Freight calculation is to be skipped for this customer/item 
combination. Customer freight is also called billable freight. Supplier freight is also called payable freight.

szFreightRateScheduleFRSCcharOPTNONE

The schedule of freight and miscellaneous charges which are applied to a shipment.

mnCarrierCARSMATH_NUMERICOPTNONE

The address number for the preferred carrier of the item. The customer or your organization might prefer a certain carrier due to route or 
special handling requirements.

szPlanningDepotVMCUcharOPTNONE

Indicates the depot from which a trip originates. The Trip Depot and the Trip Number fields identify the unique combination of vehicle, 
registration number, load date, and shift.

mnLoadNumberLDNMMATH_NUMERICOPTNONE

1

mnDeliveryNumberADLNOMATH_NUMERICOPTNONE

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 
destination appear on a single manifest or bill of lading.  In this case the shipments are rated as though there is a single shipment.

mnShipmentNumberSHPNMATH_NUMERICOPTNONE

A "next number" that uniquely identifies a shipment.

mnRoutingStepNumberRSSNMATH_NUMERICOPTNONE

This is the number assigned to a shipment routing step. The movement of a shipment from the origin to the final destination (ship to 
address) can be made up of one or more routing steps, each with an intermediate destination.

mnAddressNumberShipToSHANMATH_NUMERICOPTNONE

The address number of the location to which you want to ship this order. The address book provides default values for customer address, 
including street, city, state, zip code, and country.

szOriginDepotNMCUcharOPTNONE

This identifies the origin depot for a shipment or a load.

mnOriginAddressNumberORGNMATH_NUMERICOPTNONE

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 
a supplier, or the address number of a hub or de-consolidation center.

szPostalCodeOriginADDOcharOPTNONE

The origin postal code of a shipment.

mnDestinationAddressNumberANCCMATH_NUMERICOPTNONE

The address book number of a hub or deconsolidation center.  A hub number is entered for a load to indicate a pooled shipment.

szZipCodePostalDestinationADDZcharOPTNONE

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 
other countries. This code is used as the low end value when doing Postal Code Transaction range processing.

mnShipmentWeightWGTSMATH_NUMERICOPTNONE

The shipment weight is qualified by a Weight Qualifier (WGQ) that identifies the type of weight.

szWeightUnitOfMeasureWTUMcharOPTNONE

The unit of measure that indicates the weight of an individual item. Typical weight units of measure are:    GM Gram    OZ Ounce    LB Pound    
KG Kilogram    CW Hundredweight    TN Ton 

mnShipmentVolumeSCVLMATH_NUMERICOPTNONE

The volume scheduled on a load or in a compartment.

szVolumeUnitOfMeasureVLUMcharOPTNONE

The unit of measure for the cubic space occupied by an inventory item. Typical volume unit of measures are:    ML Milliliter    OZ Fluid Ounce   
 PT Pint    LT Liter    CF Cubic Foot    CM Cubic Meter    CY Cubic Yard 

mnCubicContainerSpaceCCUBMATH_NUMERICOPTNONE

The volume of shipment containers which hold product.  This volume is used for cube rating instead of the volume of the products on the 
shipment.

mnTotalLoadWeightWGTSMATH_NUMERICOPTNONE

The shipment weight is qualified by a Weight Qualifier (WGQ) that identifies the type of weight.

mnTotalLoadVolumeSCVLMATH_NUMERICOPTNONE

The volume scheduled on a load or in a compartment.

mnDistanceDSTNMATH_NUMERICOPTNONE

Either the total amount of distanced traveled, or the total amount of time spent idle.

cDistanceSourceDSRCcharOPTNONE

The source of the distance for a delivery. The source could be a preference,carrier agreement, entered by the user, or retrieved from a 
mileage system.

szUnitofMeasureDistanceUMD1charOPTNONE

mnNumberofStopsNSTPMATH_NUMERICOPTNONE

The number of stops (usually deliveries) on a load.

mnNumberofPircesNPCSMATH_NUMERICOPTNONE

The number of pieces, pallets, containers, etc. which make up a shipment. For shipments that do not have piece information defined in the 
Pieces table (F4943), the system calculates the estimated piece count by converting the quantity in the transaction unit of measure to the 
shipping unit of measure. To obtain the whole piece number, the system rounds the unit of measure down. The weight and volume of the leftover 
quantities from all detail lines are added and the sum total is divided by the maximum piece weight and/or volume. The system rounds the 
resulting piece weight or volume up to the next whole number. This number is added to the whole piece number to obtain the piece count.

mnShipmentLengthLGTSMATH_NUMERICOPTNONE

The length of a shipment or shipment piece.

mnShipmentWidthWTHSMATH_NUMERICOPTNONE

The width of a shipment or shipment piece.

mnShipmentHeightHGTSMATH_NUMERICOPTNONE

The height of a shipment or shipment piece.

mnShipmentGirthGTHSMATH_NUMERICOPTNONE

The girth of a shipment or shipment piece.

szUnitofMeasureLinearLUOMcharOPTNONE

The width, height, or length unit of measure for a vehicle.

mnNumberOfContainersNCTRMATH_NUMERICOPTNONE

The number of shipping containers, pallets, etc.

mnAmountExtendedPriceAEXPMATH_NUMERICOPTNONE

The number of units multiplied by the unit price.

mnAmountForeignExtPriceFEAMATH_NUMERICOPTNONE

The product of the foreign price times the number of units.

szCurrencyCodeForeignCRCDcharOPTNONE

A code that identifies the currency of a transaction. 

mnAmountExtendedCostECSTMATH_NUMERICOPTNONE

For accounts receivable and accounts payable, the invoice (gross) amount. For sales orders and purchase orders, the unit cost times the 
number of units.

mnOutofRouteDistanceODSTMATH_NUMERICOPTNONE

The total distance which is considered outside of the normal route and may be subject to an out of route premium charge.

mnTimeElapsedELTMMATH_NUMERICOPTNONE

This is the amount of time in minutes which will be used to determine idle time freight charges.

szUnitOfMeasureTimeUMcharOPTNONE

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, 
cubic meter, liter, hour, and so on.

szRouteCodeROUTcharOPTNONE

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 
one of several factors used by the freight summary facility to calculate potential freight charges for an order. For picking, use the route code with 
the stop and zone codes to group all of the items that are to be loaded onto a delivery vehicle for a specific route. You set up a default for 
each of these fields on the Customer Billing Instruction form.

szZoneNumberZONcharOPTNONE

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 
of several factors used by freight summary facility to calculate potential freight charges for an order. For picking you can use the zone code 
with the route and stop codes to group all item that are to be loaded onto a delivery vehicle for a specific route. You set up the default for each 
of these fields on the Customer Billing Instructions form.

szCarrierZoneCZONcharOPTNONE

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 
determine the freight charge for deliveries to specific zip codes.

mnRouteNumberRTNMATH_NUMERICOPTNONE

A number assigned by the system to each routing record.

szShipmentCategoryCode1SCT1charOPTNONE

A generic field used to store information about a shipment.  This field can loaded from an address book category.

szShipmentCategoryCode2SCT2charOPTNONE

A generic field used to store information about a shipment.  This field can loaded from an address book category.

szShipmentCategoryCode3SCT3charOPTNONE

A generic field used to store information about a shipment.  This field can loaded from an address book category.

jdDatePromisedPickJuPPDJJDEDATEOPTNONE

The promised shipment date for a sales order. This date represents the day that the item can be shipped from the warehouse.

szOwningBranchPlantMCUcharOPTNONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

szChargeCode1CGC1charOPTNONE

A user defined code which classifies the freight charge.

szShipmentLevelPayableSLPFcharOPTNONE

A flag used to specify that payable freight should be calculated at the shipment or delivery level instead of at the load level.

szDefaultFreightClassificationNMFCcharOPTNONE

The National Motor Freight Classification which is assigned according to the freight commodity code.

szStandardCarrierAlphaCodeSCACcharOPTNONE

A unique four-character code assigned to the carrier.

szRateNameRTNMcharOPTNONE

The name of the rate which is used to define and calculate a freight charge.

cRateBasisFreightRTGBcharOPTNONE

The basis used to calculate the charge.

cRateLevelSHPCcharOPTNONE

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 
applied to a shipment, the rates are added together for a total freight cost, piece level, or at a detail level where the shipment is rated as a 
combination of both the shipment and piece level. This field also indicates how a load is rated versus how a shipment is rated.

cRateDetailLevelRDLVcharOPTNONE

This flag identifies the shipment detail field that determines a rate when the charge is applied at the shipment detail level. You can specify 
one of the following fields:     o Freight Classification Code     o Dispatch Group     o Freight Category 1     o Freight Category 2 

szFreightDetailKeyGS1AcharOPTNONE

szCurrencyCodeDomesticCRDCcharOPTNONE

A code that identifies the domestic (base) currency of the company on a transaction. 

szCurrencyCodeCarrierCRCDcharOPTNONE

A code that identifies the currency of a transaction. 

szCurrencyCodeShipToCRCDcharOPTNONE

A code that identifies the currency of a transaction. 

cRateTypFRTPcharOPTNONE

The type of rate specified in a table.  This could be a fixed amount or percentage, for example.

cInboundRouteSelectedIBRScharOPTNONE

This option indicates an inbound route.

Related Functions

None

Related Tables

None