MODCHQCF - NATIONAL CONFIGURATION Ó UNCTAD - SITE (V1.15) 8.19 Value Apportionment Rule Rule "PRV_EXPORT" If Inv = 0 Then   ItemDed IS 0 ;   ItmIfr IS 0 ; Else   ItemDed IS Ded * ItmInv / Inv ;   ItmIfr IS Ifr * ItmInv / Inv ; Endif; This first tests if the total Invoice value is 0 and if it is 0 then the Item Deduction and the Item Inland Freight  is  also  0.  This  prevents  the  system  attempting  to  divide  by  0.  If  the  Invoice  value  >  0  it apportions  the  Item  Deductions  against  the  Total  Deductions  and  Item  Inland  Freight  against  the Total Inland Freight using the Total Invoice Value divided by the Item Invoice Value - . ItmInv/Inv. Mass Apportionment Rule Rule "PRM_EXPORT" If Inv = 0 Then   ItemDed IS 0 ; Else   ItemDed IS Ded * ItmInv / Inv ; Endif; If TotalMass = 0 Then   ItmIfr IS 0 ; Else   ItmIfr IS Ifr * GrossMass / TotalMass ; Endif; This first tests if the Total Invoice Value is 0 and if it is, the Item Deduction is also 0. This prevents the  system  attempting  to  divide  by  0.  If  The  Total  Invoice  Value  is  >  0  it  apportions  the  Item Deduction based on Item Invoice Value divided by Total Invoice Value - ItmInv/Inv. It  then  tests  if  the  Total  Mass  is  0  and  if  it  is,  the  Item  Inland  Freight  is  also  0.  This  prevents  the system  attempting  to  divide  by  0.    If  the  Total  Mass  is  >  0  it  apportions  it  based  on  Gross  Mass divided by Total Mass -  GrossMass/TotalMass. Examples of Pre-defined Import Valuation Rules General Segment Section: Rule "SG_IMPORT" InvNcy IS Inv * InvCurRat ; EfrNcy IS Efr * EfrCurRat ; InsNcy IS Ins * InsCurRat ; OtcNcy IS Otc * OtcCurRat ; IfrNcy IS Ifr * IfrCurRat ; DedNcy IS Ded * DedCurRat ; TotalCost IS EfrNcy + InsNcy + OtcNcy - DedNcy ; CIFNcy IS TotalCost + InvNcy ; The added elements in the CIF value are the External Freight (Efr), and Other charges (Otc).