-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAsset.cs
158 lines (135 loc) · 3.93 KB
/
Asset.cs
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
using System;
using System.Collections.Generic;
namespace DepCalcsCS
{
public enum TAX_Lifes
{
NONE =0,
THREE =3,
FIVE =5,
SEVEN =7,
TEN =10,
FIFTEEN =15,
TWENTY =20
};
public class Asset
{
//Public Properties
public String Name {get; set;}
//public String Description {get; set;}
public DateTime PurchaseDate {get; set;}
public double PurchasePrice {get; set;}
public double ResidualValue {get; set;}
public double Section179 {get; set;}
public int UsefulLife {get; set;}
public string GaapMethod {get; set;}
public string TaxMethod {get; set;}
private TAX_Lifes _TaxLife;
public int TaxLife {
get
{
return (int) this._TaxLife;
}
set
{
if (value == 20)
{
_TaxLife = TAX_Lifes.TWENTY;
}
else if (value == 15)
{
_TaxLife = TAX_Lifes.FIFTEEN;
}
else if (value == 10)
{
_TaxLife = TAX_Lifes.TEN;
}
else if (value == 7)
{
_TaxLife = TAX_Lifes.SEVEN;
}
else if (value ==5)
{
_TaxLife = TAX_Lifes.FIVE;
}
else if (value ==3)
{
_TaxLife = TAX_Lifes.THREE;
}
else if (value ==0)
{
_TaxLife = TAX_Lifes.NONE;
}
else
{
throw new Exception("INVALID_TAX_YEAR");
}
}
}
public List<DepYear> GaapDepreciation {get; set;}
public List<DepYear> TaxDepreciation {get; set;}
//Empty Constructor
public Asset()
{
Name = "";
PurchaseDate = DateTime.Now;
PurchasePrice = 0;
ResidualValue = 0;
UsefulLife = 0;
TaxLife = (int)TAX_Lifes.NONE;
Section179 = 0;
return;
}
//Full Constructor
public Asset (string sName, DateTime dtPurchaseDate, double fPurchasePrice, double fResidualValue, int iUSefulLife,int iTaxLife, double fSection179=0, string sDescription="" )
{
Name = sName;
//Description = sDescription;
PurchaseDate = dtPurchaseDate;
PurchasePrice = fPurchasePrice;
ResidualValue = fResidualValue;
UsefulLife = iUSefulLife;
Section179 = fSection179;
TaxLife = iTaxLife;
return;
}
//Limited Constructor
public Asset (double fPurchasePrice, double fResidualValue, int iUSefulLife, string sName="Unnamed Asset", double fSection179=0)
{
Name = sName;
//Description = "";
PurchaseDate = DateTime.Now;
PurchasePrice = fPurchasePrice;
ResidualValue = fResidualValue;
UsefulLife = iUSefulLife;
Section179 = fSection179;
TaxLife = (int)TAX_Lifes.NONE;
return;
}
// SL Calc
public void calcSL()
{
GaapDepreciation = DepCalcs.CalcSL(this);
}
public void calcDB200()
{
GaapDepreciation = DepCalcs.CalcDB200(this);
}
public void calcDB150()
{
GaapDepreciation = DepCalcs.CalcDB150(this);
}
public void calcSYD()
{
GaapDepreciation = DepCalcs.CalcSYD(this);
}
public void calcMacrsHY()
{
TaxDepreciation = DepCalcs.CalcMacrsHY(this);
}
public void calcMacrsMQ()
{
TaxDepreciation = DepCalcs.CalcMacrsMQ(this);
}
}
}