File tree 4 files changed +26
-1
lines changed
ProjectIvy.BL/Handlers/Expense
4 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ public View.Expense Get(string expenseId)
85
85
{
86
86
var result = context . Expenses . Include ( x => x . ExpenseType )
87
87
. Include ( x => x . Currency )
88
+ . Include ( x => x . ParentCurrency )
88
89
. Include ( x => x . Poi )
89
90
. Include ( x => x . Vendor )
90
91
. Include ( x => x . PaymentType )
Original file line number Diff line number Diff line change @@ -168,6 +168,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
168
168
modelBuilder . Entity < Expense > ( )
169
169
. HasOne ( x => x . Currency ) ;
170
170
171
+ modelBuilder . Entity < Expense > ( )
172
+ . HasOne ( x => x . ParentCurrency ) ;
173
+
171
174
modelBuilder . Entity < Expense > ( )
172
175
. HasOne ( x => x . Poi ) ;
173
176
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class Expense : UserEntity, IHasValueId
11
11
public Expense ( )
12
12
{
13
13
Modified = DateTime . Now ;
14
+ Timestamp = DateTime . Now ;
14
15
}
15
16
16
17
[ Key ]
@@ -23,13 +24,19 @@ public Expense()
23
24
public string Comment { get ; set ; }
24
25
25
26
public int CurrencyId { get ; set ; }
26
-
27
+
28
+ public int ? ParentCurrencyId { get ; set ; }
29
+
30
+ public decimal ? ParentCurrencyExchangeRate { get ; set ; }
31
+
27
32
public DateTime Date { get ; set ; }
28
33
29
34
public int ExpenseTypeId { get ; set ; }
30
35
31
36
public DateTime ? Modified { get ; set ; }
32
37
38
+ public DateTime ? Timestamp { get ; set ; }
39
+
33
40
public int ? PoiId { get ; set ; }
34
41
35
42
public int ? VendorId { get ; set ; }
@@ -40,6 +47,8 @@ public Expense()
40
47
41
48
public Currency Currency { get ; set ; }
42
49
50
+ public Currency ParentCurrency { get ; set ; }
51
+
43
52
public Card Card { get ; set ; }
44
53
45
54
public ExpenseType ExpenseType { get ; set ; }
Original file line number Diff line number Diff line change @@ -12,24 +12,36 @@ public Expense(DatabaseModel.Finance.Expense x)
12
12
Card = x . Card . ConvertTo ( y => new Card . Card ( y ) ) ;
13
13
Comment = x . Comment ;
14
14
Currency = x . Currency . ConvertTo ( y => new Currency . Currency ( y ) ) ;
15
+ ParentCurrency = x . ParentCurrency ? . ConvertTo ( y => new Currency . Currency ( y ) ) ;
15
16
Date = x . Date ;
16
17
ExpenseType = x . ExpenseType . ConvertTo ( y => new ExpenseType . ExpenseType ( y ) ) ;
17
18
Id = x . ValueId ;
18
19
PaymentType = x . PaymentType . ConvertTo ( y => new PaymentType . PaymentType ( y ) ) ;
19
20
Poi = x . Poi . ConvertTo ( y => new Poi . Poi ( y ) ) ;
20
21
Vendor = x . Vendor . ConvertTo ( y => new Vendor . Vendor ( y ) ) ;
22
+ ParentCurrencyExchangeRate = x . ParentCurrencyExchangeRate ;
23
+ Modified = x . Modified ;
24
+ Timestamp = x . Timestamp ;
21
25
}
22
26
23
27
public decimal Amount { get ; set ; }
24
28
29
+ public decimal ? ParentCurrencyExchangeRate { get ; set ; }
30
+
25
31
public string Comment { get ; set ; }
26
32
27
33
public Card . Card Card { get ; set ; }
28
34
29
35
public Currency . Currency Currency { get ; set ; }
30
36
37
+ public Currency . Currency ParentCurrency { get ; set ; }
38
+
31
39
public DateTime Date { get ; set ; }
32
40
41
+ public DateTime ? Modified { get ; set ; }
42
+
43
+ public DateTime ? Timestamp { get ; set ; }
44
+
33
45
public ExpenseType . ExpenseType ExpenseType { get ; set ; }
34
46
35
47
public Poi . Poi Poi { get ; set ; }
You can’t perform that action at this time.
0 commit comments