Calculating purchase cost - USD

The statement to calculate purchase cost in US dollars is similar to the statement that calculates price per Kg in U.S. dollars.

The statement divides purchase cost in local currency by the exchange rate for the local currency:

['Purchase Cost - USD']=N:['Purchase Cost - LC']\ DB('CurrencyExchangeRate',
DB('Currency',!market,'MarketCurrency'),!date);

Procedure

  1. Double-click the Purchase rule in the Server Explorer.
    The Rules Editor displays.
  2. Add the above statement immediately following the last calculation statement in the rule.
    The complete Purchase rule should now appear as follows:
    ['Purchase Cost - LC']=N:['Quantity Purchased - Kgs']*['Price/Kg-LC'];
    #['Price/Kg - USD']=['Price/Kg - LC']\DB('MarketExchange',!market,!date);
    ['Price/Kg - USD']=['Price/Kg - LC']\DB('CurrencyExchangeRate',
    DB('Currency',!market,'MarketCurrency'),!date);
    ['Purchase Cost - USD']=N:['Purchase Cost - LC']\DB('CurrencyExchangeRate',
    DB('Currency',!market,'MarketCurrency'),!date);
  3. Click Save to save the rule.