-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.h
More file actions
119 lines (99 loc) · 2.01 KB
/
Copy pathmodel.h
File metadata and controls
119 lines (99 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#pragma once
#include <string>
class Entry {
private:
int _id, _amount, _time, _debitId, _creditId;
std::string _narration;
public:
Entry(int id, int amount, int time, int debitId, int creditId, const std::string &narration) {
_id = id;
_amount = amount;
_time = time;
_debitId = debitId;
_creditId = creditId;
_narration = narration;
}
int getId() {
return _id;
};
int getAmount() {
return _amount;
}
int getTime() {
return _time;
}
int getDebitId() {
return _debitId;
}
int getCreditId() {
return _creditId;
}
std::string getNarration() {
return _narration;
}
std::string stringify() {
return "E"+std::to_string(_id)+","+std::to_string(_amount)
+","+std::to_string(_time)+","+std::to_string(_debitId)+","+
std::to_string(_creditId)+","+_narration;
}
};
class Ledger {
private:
int _id, _type;
std::string _name;
public:
static const int REVENUE = 0;
static const int EXPENDITURE = 1;
static const int ASSET = 2;
static const int LIABILITY = 3;
static const int EQUITY = 4;
Ledger(int id, int type, const std::string &name) {
_id = id;
_type = type;
_name = name;
}
int getId() {
return _id;
}
int getType() {
return _type;
}
std::string getName() {
return _name;
}
std::string stringify() {
return "L"+std::to_string(_id)+","+std::to_string(_type)+","+_name;
}
};
class Journal {
private:
int _id, _amount, _time;
std::string _narration;
Ledger _debit, _credit;
public:
Journal(int id, int amount, int time, Ledger debit, Ledger credit,
const std::string &narration ):_debit(debit),_credit(credit) {
_id = id;
_amount = amount;
_time = time;
_narration = narration;
}
int getId() {
return _id;
};
int getAmount() {
return _amount;
}
int getTime() {
return _time;
}
Ledger getDebit() {
return _debit;
}
Ledger getCredit() {
return _credit;
}
std::string getNarration() {
return _narration;
}
};