Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/reports/querytable.h
Show All 38 Lines | |||||
39 | 39 | | |||
40 | #include "mymoneyreport.h" | 40 | #include "mymoneyreport.h" | ||
41 | #include "listtable.h" | 41 | #include "listtable.h" | ||
42 | 42 | | |||
43 | namespace reports | 43 | namespace reports | ||
44 | { | 44 | { | ||
45 | 45 | | |||
46 | class ReportAccount; | 46 | class ReportAccount; | ||
47 | class CashFlowList; | ||||
47 | 48 | | |||
48 | /** | 49 | /** | ||
49 | * Calculates a query of information about the transaction database. | 50 | * Calculates a query of information about the transaction database. | ||
50 | * | 51 | * | ||
51 | * This is a middle-layer class, between the UI and the engine. The | 52 | * This is a middle-layer class, between the UI and the engine. The | ||
52 | * MyMoneyReport class holds only the CONFIGURATION parameters. This | 53 | * MyMoneyReport class holds only the CONFIGURATION parameters. This | ||
53 | * class actually does the work of retrieving the data from the engine | 54 | * class actually does the work of retrieving the data from the engine | ||
54 | * and formatting it for the user. | 55 | * and formatting it for the user. | ||
55 | * | 56 | * | ||
56 | * @author Ace Jones | 57 | * @author Ace Jones | ||
57 | * | 58 | * | ||
58 | * @short | 59 | * @short | ||
59 | **/ | 60 | **/ | ||
60 | 61 | | |||
61 | class QueryTable : public ListTable | 62 | class QueryTable : public ListTable | ||
62 | { | 63 | { | ||
63 | public: | 64 | public: | ||
64 | QueryTable(const MyMoneyReport&); | 65 | QueryTable(const MyMoneyReport&); | ||
65 | void init(); | 66 | void init(); | ||
66 | 67 | | |||
67 | protected: | 68 | protected: | ||
68 | void constructAccountTable(); | 69 | void constructAccountTable(); | ||
70 | void constructTotalRows(); | ||||
69 | void constructTransactionTable(); | 71 | void constructTransactionTable(); | ||
70 | void constructCapitalGainRow(const ReportAccount& account, TableRow& result) const; | 72 | void constructCapitalGainRow(const ReportAccount& account, TableRow& result) const; | ||
71 | void constructPerformanceRow(const ReportAccount& account, TableRow& result) const; | 73 | MyMoneyMoney helperROI(const MyMoneyMoney& buys, const MyMoneyMoney& sells, const MyMoneyMoney& startingBal, const MyMoneyMoney& endingBal, const MyMoneyMoney& cashIncome) const; | ||
74 | MyMoneyMoney helperIRR(const CashFlowList& all) const; | ||||
75 | void constructPerformanceRow(const ReportAccount& account, TableRow& result, CashFlowList &all) const; | ||||
72 | void constructSplitsTable(); | 76 | void constructSplitsTable(); | ||
73 | 77 | | |||
74 | }; | 78 | }; | ||
75 | 79 | | |||
76 | // | 80 | // | ||
77 | // Cash Flow analysis tools for investment reports | 81 | // Cash Flow analysis tools for investment reports | ||
78 | // | 82 | // | ||
79 | 83 | | |||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |