|
1 | 1 | public class AccountData { |
2 | | - |
3 | | - public List<Monthly_Financial_Account_Data__c> createNewFinincial(String dateId){ |
4 | | - // add the latest date to the balances latest date |
5 | | - List<Monthly_Financial_Account_Data__c> subList = new List<Monthly_Financial_Account_Data__c>(); |
6 | | - if(financialAccountDataList != null && !financialAccountDataList.isEmpty()){ |
7 | | - for(Monthly_Financial_Account_Data__c monthlyAcount : financialAccountDataList) { |
8 | | - Monthly_Financial_Account_Data__c financialAccount; |
9 | | - financialAccount = new Monthly_Financial_Account_Data__c(); |
10 | | - financialAccount.User_Updated__c = false; |
11 | | - financialAccount.Copy_Forward__c = true; |
12 | | - financialAccount.Previous_Month__c = monthlyAcount.Id; |
13 | | - financialAccount.Current_Balance__c = monthlyAcount.Current_Balance__c; |
14 | | - financialAccount.Financial_Accounts__c = monthlyAcount.Financial_Accounts__r.Id; |
15 | | - financialAccount.Interest_Rate__c = monthlyAcount.Interest_Rate__c; |
16 | | - financialAccount.CC_Limit_Orig_Loan_Amt__c = monthlyAcount.CC_Limit_Orig_Loan_Amt__c; |
17 | | - financialAccount.Date__c = dateId; |
18 | | - financialAccount.Name = monthlyAcount.Name; |
19 | | - financialAccount.Subtype__c = monthlyAcount.Subtype__c; |
20 | | - financialAccount.Productive_Debt__c = monthlyAcount.Productive_Debt__c; |
21 | | - financialAccount.Urgent_Debt__c = monthlyAcount.Urgent_Debt__c; |
22 | | - financialAccount.Collections_Charge_offs__c = monthlyAcount.Collections_Charge_offs__c; |
23 | | - financialAccount.RecordTypeId = monthlyAcount.RecordTypeId; |
24 | | - financialAccount.Record_Type_Name__c = monthlyAcount.Record_Type_Name__c; |
25 | | - financialAccount.Monthly_Minimum_Payment__c = monthlyAcount.Monthly_Minimum_Payment__c; |
26 | | - financialAccount.Deposits__c = null; |
27 | | - subList.add(financialAccount); |
28 | | - } |
29 | | - } |
30 | | - return subList; |
| 2 | + |
| 3 | + public List<Monthly_Financial_Account_Data__c> |
| 4 | + createNewFinincial(String dateId) { |
| 5 | + // add the latest date to the balances latest date |
| 6 | + List<Monthly_Financial_Account_Data__c> subList = |
| 7 | + new List<Monthly_Financial_Account_Data__c>(); |
| 8 | + if (financialAccountDataList != null && |
| 9 | + !financialAccountDataList.isEmpty()) { |
| 10 | + for (Monthly_Financial_Account_Data__c monthlyAcount : |
| 11 | + financialAccountDataList) { |
| 12 | + Monthly_Financial_Account_Data__c financialAccount; |
| 13 | + financialAccount = new Monthly_Financial_Account_Data__c(); |
| 14 | + financialAccount.User_Updated__c = false; |
| 15 | + financialAccount.Copy_Forward__c = true; |
| 16 | + financialAccount.Previous_Month__c = monthlyAcount.Id; |
| 17 | + financialAccount.Current_Balance__c = monthlyAcount.Current_Balance__c; |
| 18 | + financialAccount.Financial_Accounts__c = |
| 19 | + monthlyAcount.Financial_Accounts__r.Id; |
| 20 | + financialAccount.Interest_Rate__c = monthlyAcount.Interest_Rate__c; |
| 21 | + financialAccount.CC_Limit_Orig_Loan_Amt__c = |
| 22 | + monthlyAcount.CC_Limit_Orig_Loan_Amt__c; |
| 23 | + financialAccount.Date__c = dateId; |
| 24 | + financialAccount.Name = monthlyAcount.Name; |
| 25 | + financialAccount.Subtype__c = monthlyAcount.Subtype__c; |
| 26 | + financialAccount.Productive_Debt__c = monthlyAcount.Productive_Debt__c; |
| 27 | + financialAccount.Urgent_Debt__c = monthlyAcount.Urgent_Debt__c; |
| 28 | + financialAccount.Collections_Charge_offs__c = |
| 29 | + monthlyAcount.Collections_Charge_offs__c; |
| 30 | + financialAccount.RecordTypeId = monthlyAcount.RecordTypeId; |
| 31 | + financialAccount.Record_Type_Name__c = |
| 32 | + monthlyAcount.Record_Type_Name__c; |
| 33 | + financialAccount.Monthly_Minimum_Payment__c = |
| 34 | + monthlyAcount.Monthly_Minimum_Payment__c; |
| 35 | + financialAccount.Deposits__c = null; |
| 36 | + subList.add(financialAccount); |
| 37 | + } |
31 | 38 | } |
| 39 | + return subList; |
| 40 | + } |
32 | 41 |
|
33 | | - public List<Monthly_Budget_Data__c> createNewBudgetFinincial(String dateId){ |
34 | | - // add the latest date to the balances latest date |
35 | | - List<Monthly_Budget_Data__c> subList = new List<Monthly_Budget_Data__c>(); |
36 | | - if(budgetDataList != null && !budgetDataList.isEmpty()){ |
37 | | - for(Monthly_Budget_Data__c monthlyBudget : budgetDataList) { |
38 | | - if(monthlyBudget.Income_Frequency__c != "One-Time/Non-Recurring") { |
39 | | - Monthly_Budget_Data__c budgetAccount; |
40 | | - budgetAccount = new Monthly_Budget_Data__c(); |
41 | | - budgetAccount.Budgets__c = monthlyBudget.Budgets__r.Id; |
42 | | - budgetAccount.User_Updated__c = false; |
43 | | - budgetAccount.Previous_Month__c = monthlyBudget.Id; |
44 | | - budgetAccount.Copy_Forward__c = true; |
45 | | - budgetAccount.Gross_Amount__c = monthlyBudget.Gross_Amount__c; |
46 | | - budgetAccount.Monthly_Actual_Amount__c = monthlyBudget.Monthly_Actual_Amount__c; |
47 | | - budgetAccount.RecordTypeId = monthlyBudget.RecordTypeId; |
48 | | - budgetAccount.Name = monthlyBudget.Name; |
49 | | - budgetAccount.Savings_Goal_Due_Date__c = monthlyBudget.Savings_Goal_Due_Date__c; |
50 | | - budgetAccount.Date__c = dateId; |
51 | | - budgetAccount.Take_Home_Amount__c = monthlyBudget.Take_Home_Amount__c; |
52 | | - budgetAccount.Income_Frequency__c = monthlyBudget.Income_Frequency__c; |
53 | | - budgetAccount.Monthly_Expected_Amount__c = monthlyBudget.Monthly_Expected_Amount__c; |
54 | | - budgetAccount.Record_Type_Name__c = monthlyBudget.Record_Type_Name__c; |
55 | | - budgetAccount.Savings_Goal_Amount__c = monthlyBudget.Savings_Goal_Amount__c; |
56 | | - budgetAccount.Total_Amount_Saved_for_Goal__c = monthlyBudget.Total_Amount_Saved_for_Goal__c; |
57 | | - budgetAccount.Target_Monthly_Savings__c = monthlyBudget.Target_Monthly_Savings__c; |
58 | | - subList.add(budgetAccount); |
59 | | - } |
60 | | - } |
| 42 | + public List<Monthly_Budget_Data__c> createNewBudgetFinincial(String dateId) { |
| 43 | + // add the latest date to the balances latest date |
| 44 | + List<Monthly_Budget_Data__c> subList = new List<Monthly_Budget_Data__c>(); |
| 45 | + if (budgetDataList != null && !budgetDataList.isEmpty()) { |
| 46 | + for (Monthly_Budget_Data__c monthlyBudget : budgetDataList) { |
| 47 | + if (monthlyBudget.Income_Frequency__c != "One-Time/Non-Recurring") { |
| 48 | + Monthly_Budget_Data__c budgetAccount; |
| 49 | + budgetAccount = new Monthly_Budget_Data__c(); |
| 50 | + budgetAccount.Budgets__c = monthlyBudget.Budgets__r.Id; |
| 51 | + budgetAccount.User_Updated__c = false; |
| 52 | + budgetAccount.Previous_Month__c = monthlyBudget.Id; |
| 53 | + budgetAccount.Copy_Forward__c = true; |
| 54 | + budgetAccount.Gross_Amount__c = monthlyBudget.Gross_Amount__c; |
| 55 | + budgetAccount.Monthly_Actual_Amount__c = |
| 56 | + monthlyBudget.Monthly_Actual_Amount__c; |
| 57 | + budgetAccount.RecordTypeId = monthlyBudget.RecordTypeId; |
| 58 | + budgetAccount.Name = monthlyBudget.Name; |
| 59 | + budgetAccount.Savings_Goal_Due_Date__c = |
| 60 | + monthlyBudget.Savings_Goal_Due_Date__c; |
| 61 | + budgetAccount.Date__c = dateId; |
| 62 | + budgetAccount.Take_Home_Amount__c = monthlyBudget.Take_Home_Amount__c; |
| 63 | + budgetAccount.Income_Frequency__c = monthlyBudget.Income_Frequency__c; |
| 64 | + budgetAccount.Monthly_Expected_Amount__c = |
| 65 | + monthlyBudget.Monthly_Expected_Amount__c; |
| 66 | + budgetAccount.Record_Type_Name__c = monthlyBudget.Record_Type_Name__c; |
| 67 | + budgetAccount.Savings_Goal_Amount__c = |
| 68 | + monthlyBudget.Savings_Goal_Amount__c; |
| 69 | + budgetAccount.Total_Amount_Saved_for_Goal__c = |
| 70 | + monthlyBudget.Total_Amount_Saved_for_Goal__c; |
| 71 | + budgetAccount.Target_Monthly_Savings__c = |
| 72 | + monthlyBudget.Target_Monthly_Savings__c; |
| 73 | + subList.add(budgetAccount); |
61 | 74 | } |
62 | | - return subList; |
| 75 | + } |
63 | 76 | } |
64 | | - |
| 77 | + return subList; |
| 78 | + } |
65 | 79 | } |
66 | | - |
|
0 commit comments