eFinancialPlanner  V1.0 (proof of concept)
Personal Financial Planning based on Maslowian Portfolio Theory
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
bona_cf.class.cpp
Go to the documentation of this file.
1 /*
2  *
3  * class cash_flow
4  *
5  * copyright: (c) Philippe De Brouwer 2014
6  *
7  * last modification:
8  *
9  */
10 
11 class cash_flow: public bona
12 {
13 public:
14  // -- the specific fields ready to use. ... unless we can make the tbl map map::<string, column> so that we can reference
15  // the tbl by tbl['currency'] ... but can we still use the indexing then? XXX
16 
17 /* string get_description();
18  float get_amount();
19  string get_currency();
20  tm get_from_date();
21  tm get_till_date();
22  string get_frequency();*/
23 
24  cash_flow(); // the CONSTRUCTOR
25 };
26 
27 
28 /**********************************************
29  * cash_flow
30  * CONSTRUCTOR
31  * ********************************************/
33 {
34  int i;
35  tbl_name = oConfig.tbl_prefix + "_cash_flows";
36  class_name = "cash_flow";
37  action_ref = "c";
38  i=1;
39  tbl[i].column_name = "cash_flow_id";
40  tbl[i].post_code = "cid";
41  tbl[i].placeholder = "";
42  tbl[i].col_type = 'i';
43  tbl[i].input_type = "hidden";
44  defList[tbl[i].column_name] = i;
45  i++;
46  tbl[i].column_name = "investor";
47  tbl[i].post_code = "iid";
48  tbl[i].placeholder = "";
49  tbl[i].col_type = 'i';
50  tbl[i].input_type = "hidden";
51  defList[tbl[i].column_name] = i;
52  i++;
53  tbl[i].column_name = "description";
54  tbl[i].post_code = "desc";
55  tbl[i].label = "Description";
56  tbl[i].placeholder = "describe the cash_flow in your own words";
57  tbl[i].col_type = 's';
58  tbl[i].input_type = "text";
59  defList[tbl[i].column_name] = i;
60  i++;
61  tbl[i].column_name = "amount";
62  tbl[i].post_code = "amt";
63  tbl[i].label = "Amount";
64  tbl[i].placeholder = "10000";
65  tbl[i].col_type = 'f';
66  tbl[i].input_type = "number";
67  defList[tbl[i].column_name] = i;
68  i++;
69  tbl[i].column_name = "currency";
70  tbl[i].post_code = "curr";
71  tbl[i].label = "Currency";
72  tbl[i].placeholder = "5000";
73  tbl[i].col_type = 's';
74  tbl[i].input_type = "dropDown";
75  tbl[i].drop_down_table = oConfig.tbl_prefix + "_currencies";
76  tbl[i].drop_down_keyField = "currency_id";
77  tbl[i].drop_down_keyFieldQuote = "'";
78  tbl[i].drop_down_showField = "currency_id";
79  tbl[i].drop_down_default = "EUR";
80  defList[tbl[i].column_name] = i;
81  i++;
82  tbl[i].column_name = "from_date";
83  tbl[i].post_code = "fdt";
84  tbl[i].label = "From Date";
85  tbl[i].placeholder = "2025-12-25";
86  tbl[i].col_type = 'd';
87  tbl[i].input_type = "date";
88  defList[tbl[i].column_name] = i;
89  i++;
90  tbl[i].column_name = "till_date";
91  tbl[i].post_code = "tdt";
92  tbl[i].label = "Till Date";
93  tbl[i].placeholder = "2030-12-25";
94  tbl[i].col_type = 'd';
95  tbl[i].input_type = "date";
96  defList[tbl[i].column_name] = i;
97  i++;
98  tbl[i].column_name = "frequency";
99  tbl[i].post_code = "freq";
100  tbl[i].label = "Frequency";
101  tbl[i].placeholder = "";
102  tbl[i].col_type = 's';
103  tbl[i].input_type = "dropDown";
104  tbl[i].drop_down_table = oConfig.tbl_prefix + "_frequencies";
105  tbl[i].drop_down_keyField = "frequency_id";
106  tbl[i].drop_down_keyFieldQuote = "'";
107  tbl[i].drop_down_showField = "frequency_name";
108  tbl[i].drop_down_default = "M";
109  defList[tbl[i].column_name] = i;
110 
111  tbl[1].set_value(0); // to initialize the cash_flow_id to zero (avoid NULLs)
112 }
string action_ref
Definition: bona.class.cpp:17
const string tbl_prefix
tables start with "" + oConfig.tbl_prefix + "_" if the prefix is eg. "tbl" then we have "tbl_invesotr...
std::map< int, column > tbl
Definition: bona.class.cpp:14
string tbl_name
Definition: bona.class.cpp:15
std::map< string, int > defList
list holding the column names in the table connected to the correct id of the column ...
Definition: bona.class.cpp:26
config oConfig
mysql connection mysql connector from dev.mysql.com
Definition: efp.cpp:149
string class_name
Definition: bona.class.cpp:16