예제 #1
0
파일: Cash.cs 프로젝트: aelhadi/opencbs
        private static OCurrency _LoanLossReserveBalance(Loan pCredit,ProvisionTable pProvisionningTable, int writeOffDays)
        {
            OCurrency balance = 0;
            if (!pCredit.Disbursed) return balance;

            if (pCredit.GetPastDueDays(TimeProvider.Today) == 0) return balance;
            if (pCredit.GetPastDueDays(TimeProvider.Today) > writeOffDays) return balance;
            foreach (Installment installment in pCredit.InstallmentList)
            {
                if (installment.ExpectedDate >= TimeProvider.Today)
                    break;
                balance += (installment.InterestsRepayment - installment.PaidInterests);
            }

            balance += pCredit.GetUnpaidLatePenalties(TimeProvider.Today);
            
            int pastDueDays = pCredit.GetPastDueDays(TimeProvider.Today);
            balance += pCredit.GetOlb() * Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(pastDueDays).Rate);
            
            OCurrency realBalance = 0;
            
            return balance > realBalance ? balance : realBalance;
        }
예제 #2
0
파일: Cash.cs 프로젝트: aelhadi/opencbs
 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;
 }
예제 #3
0
파일: Cash.cs 프로젝트: aelhadi/opencbs
        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;
        }
예제 #4
0
파일: Cash.cs 프로젝트: aelhadi/opencbs
 private static OCurrency _LiabilitiesLoanLossBalance(Loan pCredit,ProvisionTable pProvisionningTable)
 {
     if (pCredit.Disbursed && !pCredit.BadLoan)
         if (pCredit.GetPastDueDays(TimeProvider.Today) == 0)
             return pCredit.GetOlb() * Convert.ToDecimal(pProvisionningTable.GetProvisiningRateByNbOfDays(0).Rate);
         else
             return 0;
     else
         return 0;
 }