clsImportExchangeRateForPlanning Class |
This rate is for example necessary, when a user plans a sales position into the furture. The planned revenue in the system currency will be calculated based on this monthly exchange rate.
Changing exhange rates in the past will recalculate the planning lines and time bookings lines for contracts linked to foreign currencies.
Use MPInterface.bImportExchangeRateForPlanning(clsImportExchangeRateForPlanning, clsImportBaseeImportMode) to import.
Namespace: MARIInterface
The clsImportExchangeRateForPlanning type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportExchangeRateForPlanning | Initializes a new instance of the clsImportExchangeRateForPlanning class |
| Name | Description | |
|---|---|---|
| bSaveRSToMDB | (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).) |
| Name | Description | |
|---|---|---|
| Currency | ISO Currency Code. Has to be different to the system currency of MARIProject. | |
| ExchangeRate | ExchangeRate Between the Currency and the MARIProject System Currency | |
| PeriodFrom | The new MARIProject Exchange Rate will start at the given period. YYYYMMM |
/// <summary> /// Setting the MARIProject month exchange rate for planning cost (also in the future) for contracts in a foreign currency /// </summary> /// <param name="sCurrency">EUR, USD, CAD</param> /// <param name="sngExRate">1.12</param> /// <param name="lPeriodStart">2020012</param> /// <returns></returns> private bool FillExchangeRate(string sCurrency, decimal cExRate, int lPeriodStart) { clsImportExchangeRateForPlanning oNewRate = new clsImportExchangeRateForPlanning(); oNewRate.Currency = sCurrency; // USD versus system currency EUR. or CAD versus system currency USD oNewRate.ExchangeRate = cExRate; // Depending on the settings in the first SBO database the rate has to be used as USD/EUR or EUR/USD oNewRate.PeriodFrom = lPeriodStart; if (oMPInterface.bImportExchangeRateForPlanning(oNewRate, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) { Log($"FillExchangeRate({sCurrency},{cExRate},{lPeriodStart}) Saved."); oMPInterface.oErrors.Clear(); return true; } else { LogFail($"FillExchangeRate({sCurrency},{cExRate},{lPeriodStart}): {oMPInterface.oErrors.PrintErrors()}"); return false; } }