Exemplo n.º 1
0
 private static OCurrency _ExpensesLoanLossBalance(Loan pCredit,ProvisionTable pProvisionningTable)
 {
     if (pCredit.Disbursed && !pCredit.AllInstallmentsRepaid && !pCredit.WrittenOff)
         return pCredit.Amount * Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(0).Rate);
     else
         return 0;
 }
Exemplo n.º 2
0
        private static OCurrency _IncomeLoanLossBalance(Loan pCredit, ProvisionTable pProvisionningTable)
        {
            OCurrency olb  = pCredit.GetOlb();
            OCurrency rate = Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(0).Rate);

            if (pCredit.GetPastDueDays(TimeProvider.Today) != 0)
            {
                olb = 0;
            }
            if (pCredit.WrittenOff)
            {
                return(0);
            }

            if (!pCredit.Disbursed)
            {
                return(0);
            }

            if (pCredit.AllInstallmentsRepaid)
            {
                return(0);
            }

            if (!pCredit.BadLoan)
            {
                return((pCredit.Amount - olb) * rate);
            }

            return((pCredit.Amount) * rate);
        }
Exemplo n.º 3
0
 private static OCurrency _LiabilitiesLoanLossBalance(Loan pCredit, ProvisionTable pProvisionningTable)
 {
     if (pCredit.Disbursed && !pCredit.BadLoan)
     {
         return(pCredit.GetPastDueDays(TimeProvider.Today) == 0
                    ? pCredit.GetOlb() * Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(0).Rate)
                    : 0);
     }
     return(0);
 }
Exemplo n.º 4
0
 private static OCurrency _ExpensesLoanLossBalance(Loan pCredit, ProvisionTable pProvisionningTable)
 {
     if (pCredit.Disbursed && !pCredit.AllInstallmentsRepaid && !pCredit.WrittenOff)
     {
         return(pCredit.Amount * Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(0).Rate));
     }
     else
     {
         return(0);
     }
 }
Exemplo n.º 5
0
        private static OCurrency _IncomeLoanLossBalance(Loan pCredit, ProvisionTable pProvisionningTable)
        {
            OCurrency olb = pCredit.GetOlb();
            OCurrency rate = Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(0).Rate);
            if (pCredit.GetPastDueDays(TimeProvider.Today) != 0) olb = 0;
            if (pCredit.WrittenOff) return 0;

            if (!pCredit.Disbursed) return 0;

            if (pCredit.AllInstallmentsRepaid) return 0;

            if (!pCredit.BadLoan) return (pCredit.Amount - olb) * rate;

            else return (pCredit.Amount) * rate;
        }
Exemplo n.º 6
0
        private static OCurrency _LoanLossReserveBalance(Loan pCredit, ProvisionTable pProvisionningTable, int writeOffDays)
        {
            OCurrency theoricBalance = 0;

            if (!pCredit.Disbursed)
            {
                return(theoricBalance);
            }

            if (pCredit.GetPastDueDays(TimeProvider.Today) == 0)
            {
                return(theoricBalance);
            }
            if (pCredit.GetPastDueDays(TimeProvider.Today) > writeOffDays)
            {
                return(theoricBalance);
            }

            foreach (Installment installment in pCredit.InstallmentList)
            {
                if (installment.ExpectedDate >= TimeProvider.Today)
                {
                    break;
                }
                theoricBalance += (installment.InterestsRepayment - installment.PaidInterests);
            }

            theoricBalance += pCredit.GetUnpaidLatePenalties(TimeProvider.Today);

            int pastDueDays = pCredit.GetPastDueDays(TimeProvider.Today);

            theoricBalance += pCredit.GetOlb() * Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(pastDueDays).Rate);

            OCurrency realBalance = 0;

            return(theoricBalance > realBalance ? theoricBalance : realBalance);
        }
Exemplo n.º 7
0
        private static OCurrency _LoanLossReserveBalance(Loan pCredit, ProvisionTable pProvisionningTable, int writeOffDays)
        {
            OCurrency theoricBalance = 0;
            if (!pCredit.Disbursed) return theoricBalance;

            if (pCredit.GetPastDueDays(TimeProvider.Today) == 0) return theoricBalance;
            if (pCredit.GetPastDueDays(TimeProvider.Today) > writeOffDays) return theoricBalance;

            foreach (Installment installment in pCredit.InstallmentList)
            {
                if (installment.ExpectedDate >= TimeProvider.Today)
                    break;
                theoricBalance += (installment.InterestsRepayment - installment.PaidInterests);
            }

            theoricBalance += pCredit.GetUnpaidLatePenalties(TimeProvider.Today);

            int pastDueDays = pCredit.GetPastDueDays(TimeProvider.Today);
            theoricBalance += pCredit.GetOlb() * Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(pastDueDays).Rate);

            OCurrency realBalance = 0;
            return theoricBalance > realBalance ? theoricBalance : realBalance;
        }
Exemplo n.º 8
0
 private static OCurrency _LiabilitiesLoanLossBalance(Loan pCredit, ProvisionTable pProvisionningTable)
 {
     if (pCredit.Disbursed && !pCredit.BadLoan)
         return pCredit.GetPastDueDays(TimeProvider.Today) == 0
                    ? pCredit.GetOlb()* Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(0).Rate)
                    : 0;
     return 0;
 }
Exemplo n.º 9
0
 public void TestGetProvisioningRateByNbOfDays()
 {
     Assert.AreEqual(10, provisionTable.GetProvisiningRateByNbOfDays(21).Rate);
 }