Esempio n. 1
0
 public static bool UcfMatches(this IUnrealisedCashFlow lhs, IRealisedCashFlow other, int valueDate, bool isOoc)
 {
     return(lhs.ShortCashFlowType == other.ShortCashFlowType &&
            lhs.PayDate == valueDate
            //&& lhs.CashType==other.CashType
            && lhs.Currency == (isOoc ? lhs.Currency : other.Currency));
     //&& lhs.Amount==other.Amount // match except amount and FX Fix
     //&& lhs.FxFix==other.FxFix;
 }
Esempio n. 2
0
        public UnrealisedCashFlow(IUnrealisedCashFlow ucf, bool dtd = false, double fxRate = double.NaN, bool round = false)
        {
            _ucf   = ucf;
            FxRate = fxRate;
            Amount = _ucf.Amount;
            FinAmt = dtd ? Amount : Amount * FxFix;
            USDAmt = FxRate == 0 ? double.NaN : FinAmt / FxRate;

            if (round)
            {
                Round();
            }
        }
Esempio n. 3
0
 public static bool UcfMatches(this IUnrealisedCashFlow lhs, IUnrealisedCashFlow other, bool isOoc)
 {
     if (isOoc) // eventually, logic should be simple and based on postingDate; but until PFS implements that ...
     {
         return(lhs.ShortCashFlowType == other.ShortCashFlowType &&
                lhs.PayDate == other.PayDate &&
                lhs.CashType == other.CashType &&
                lhs.Currency == other.Currency); // ignore fxFix; PFS has some bug that sends different fx rate for different dates for same ooc transaction
     }
     return(lhs.PostingDate == other.PostingDate &&
            lhs.ShortCashFlowType == other.ShortCashFlowType &&
            lhs.PayDate == other.PayDate &&
            lhs.CashType == other.CashType &&
            lhs.Currency == other.Currency
            //&& lhs.Amount==other.Amount // match except amount
            && lhs.FxFix == other.FxFix);
 }