loan_creator_web 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/lib/loan_creator_web/app.rb +1 -0
- data/lib/loan_creator_web/helpers/application_helper.rb +3 -0
- data/lib/loan_creator_web/version.rb +1 -1
- data/lib/loan_creator_web/views/form.erb +107 -109
- data/lib/loan_creator_web/views/index.erb +4 -2
- data/lib/loan_creator_web/views/stylesheet.erb +3 -1
- data/lib/loan_creator_web/views/table.erb +5 -1
- data/lib/loan_creator_web/views/table_head.erb +1 -0
- data/lib/loan_creator_web/views/table_row.erb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a0006b273338281b259f833896c04bc5da2bce4
|
4
|
+
data.tar.gz: 8e18811695f38f2a765303410c2fe7f6e6e7a181
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28479f266deba31a1dfbb28940596ced475981c7b385b8f187acb3eabca91274f9b75b8140e4cb5d69cd70fed6f4626dc5c5ed4598448c7cf697fd18b166d805
|
7
|
+
data.tar.gz: 9a0e888e95ed4044fd55b7c8774f7b94b713bcf7048960b23e2f2751b54bccfad15480b089dac4ace58d5ec4847f3d07aa2bc583eec2ff891c4139dd06065cf6
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/lib/loan_creator_web/app.rb
CHANGED
@@ -13,6 +13,7 @@ module LoanCreatorWeb
|
|
13
13
|
h[:annual_interests_rate] = to_right_format(params: 'annual_interests_rate', value: params[:annual_interests_rate])
|
14
14
|
h[:starts_on] = to_right_format(params: 'starts_on', value: params[:starts_on])
|
15
15
|
h[:duration_in_periods] = to_right_format(params: 'duration_in_periods', value: params[:duration_in_periods])
|
16
|
+
h[:term_dates] = to_right_format(params: 'term_dates', value: params[:term_dates]) if params[:button] == 'update'
|
16
17
|
h[:initial_values] = {}.tap do |ivh|
|
17
18
|
ivh[:paid_capital] = to_right_format(params: 'paid_capital', value: params[:initial_values][:paid_capital])
|
18
19
|
ivh[:paid_interests] = to_right_format(params: 'paid_interests', value: params[:initial_values][:paid_interests])
|
@@ -33,6 +34,8 @@ module LoanCreatorWeb
|
|
33
34
|
value.to_i
|
34
35
|
when 'starting_index'
|
35
36
|
(value.blank? && value.to_i.zero?) ? nil : value.to_i
|
37
|
+
when 'term_dates'
|
38
|
+
value.values
|
36
39
|
end
|
37
40
|
end
|
38
41
|
|
@@ -1,127 +1,125 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<span>Année au réel</span>
|
1
|
+
<label class="switch">
|
2
|
+
<input name="realistic_durations" type="checkbox" <%= checked(params: fixed_params[:realistic_durations]) %>>
|
3
|
+
<span class="slider round"></span>
|
4
|
+
</label>
|
5
|
+
<span>Realistic duration</span>
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<div class="col form-group">
|
23
|
-
<label for="amount" id="amount">
|
24
|
-
Amount
|
25
|
-
</label>
|
26
|
-
<input type="number" class="form-control" name="amount" value=<%= fixed_params[:amount] %>>
|
27
|
-
</div>
|
7
|
+
<div class="row">
|
8
|
+
<div class="col form-group">
|
9
|
+
<label for="type">
|
10
|
+
Type
|
11
|
+
</label>
|
12
|
+
<select name="type" class="form-control" id="type-select">
|
13
|
+
<option value="">--Chose an option--</option>
|
14
|
+
<option value="standard" <%= selected(params: fixed_params[:type], value: 'standard') %>>Standard</option>
|
15
|
+
<option value="in_fine" <%= selected(params: fixed_params[:type], value: 'in_fine') %>>In fine</option>
|
16
|
+
<option value="bullet" <%= selected(params: fixed_params[:type], value: 'bullet') %>>Bullet</option>
|
17
|
+
<option value="linear" <%= selected(params: fixed_params[:type], value: 'linear') %>>Linear</option>
|
18
|
+
</select>
|
19
|
+
</div>
|
28
20
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
<option value="">--Chose an option--</option>
|
35
|
-
<option value="month" <%= selected(params: fixed_params[:period], value: 'month') %>>Month</option>
|
36
|
-
<option value="quarter" <%= selected(params: fixed_params[:period], value: 'quarter') %>>Quarter</option>
|
37
|
-
<option value="semester" <%= selected(params: fixed_params[:period], value: 'semester') %>>Semester</option>
|
38
|
-
<option value="year" <%= selected(params: fixed_params[:period], value: 'year') %>>Year</option>
|
39
|
-
</select>
|
40
|
-
</div>
|
21
|
+
<div class="col form-group">
|
22
|
+
<label for="amount" id="amount">
|
23
|
+
Amount
|
24
|
+
</label>
|
25
|
+
<input type="number" class="form-control" name="amount" value=<%= fixed_params[:amount] %>>
|
41
26
|
</div>
|
42
27
|
|
43
|
-
<div class="
|
44
|
-
<
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
<
|
49
|
-
|
28
|
+
<div class="col form-group">
|
29
|
+
<label for="period">
|
30
|
+
Period
|
31
|
+
</label>
|
32
|
+
<select name="period" class="form-control" id="period-select">
|
33
|
+
<option value="">--Chose an option--</option>
|
34
|
+
<option value="month" <%= selected(params: fixed_params[:period], value: 'month') %>>Month</option>
|
35
|
+
<option value="quarter" <%= selected(params: fixed_params[:period], value: 'quarter') %>>Quarter</option>
|
36
|
+
<option value="semester" <%= selected(params: fixed_params[:period], value: 'semester') %>>Semester</option>
|
37
|
+
<option value="year" <%= selected(params: fixed_params[:period], value: 'year') %>>Year</option>
|
38
|
+
</select>
|
39
|
+
</div>
|
40
|
+
</div>
|
50
41
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
</div>
|
42
|
+
<div class="row">
|
43
|
+
<div class="col form-group">
|
44
|
+
<label for="annual_interests_rate" id="annual_interests_rate">
|
45
|
+
Annual Interests Rate
|
46
|
+
</label>
|
47
|
+
<input type="number" class="form-control" step="0.01" name="annual_interests_rate" value=<%= fixed_params[:annual_interests_rate] %>>
|
48
|
+
</div>
|
59
49
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
</div>
|
50
|
+
<div class="col form-group">
|
51
|
+
<label for="starts_on">Starts on</label>
|
52
|
+
<input type="date"
|
53
|
+
class="form-control"
|
54
|
+
name="starts_on"
|
55
|
+
id="starts_on"
|
56
|
+
value= <%= fixed_params[:starts_on] %>>
|
68
57
|
</div>
|
69
58
|
|
70
|
-
<div class="
|
71
|
-
<
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
</div>
|
59
|
+
<div class="col form-group">
|
60
|
+
<label for="duration_in_periods">Duration in periods</label>
|
61
|
+
<input type="number"
|
62
|
+
class="form-control"
|
63
|
+
name="duration_in_periods"
|
64
|
+
id="duration_in_periods"
|
65
|
+
value= <%= fixed_params[:duration_in_periods] %>>
|
66
|
+
</div>
|
67
|
+
</div>
|
80
68
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
69
|
+
<div class="row">
|
70
|
+
<div class="col form-group">
|
71
|
+
<label for="initial_values[starting_index]">Initial values[starting index]</label>
|
72
|
+
<input step="0.01"
|
73
|
+
class="form-control"
|
74
|
+
type="number"
|
75
|
+
name="initial_values[starting_index]"
|
76
|
+
id="initial_values[starting_index]"
|
77
|
+
value= <%= initial_values_for_form(fixed_params[:initial_values][:starting_index]) %>>
|
78
|
+
</div>
|
90
79
|
|
91
|
-
|
92
|
-
|
93
|
-
|
80
|
+
<div class="col form-group">
|
81
|
+
<label for="initial_values[due_interests]">Initial values[due interests]</label>
|
82
|
+
<input step="0.01"
|
94
83
|
class="form-control"
|
95
84
|
type="number"
|
96
|
-
name="initial_values[
|
97
|
-
id="initial_values[
|
98
|
-
value= <%= initial_values_for_form(fixed_params[:initial_values][:
|
99
|
-
</div>
|
85
|
+
name="initial_values[due_interests]"
|
86
|
+
id="initial_values[due_interests]"
|
87
|
+
value= <%= initial_values_for_form(fixed_params[:initial_values][:due_interests]) %>>
|
100
88
|
</div>
|
101
89
|
|
102
|
-
<div class="
|
103
|
-
<
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
90
|
+
<div class="col form-group">
|
91
|
+
<label for="initial_values[accrued_delta_interests]">Initial values[accrued delta interests]</label>
|
92
|
+
<input step="1.0e-07"
|
93
|
+
class="form-control"
|
94
|
+
type="number"
|
95
|
+
name="initial_values[accrued_delta_interests]"
|
96
|
+
id="initial_values[accrued_delta_interests]"
|
97
|
+
value= <%= initial_values_for_form(fixed_params[:initial_values][:accrued_delta_interests]) %>>
|
98
|
+
</div>
|
99
|
+
</div>
|
112
100
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
101
|
+
<div class="row">
|
102
|
+
<div class="col form-group">
|
103
|
+
<label for="initial_values[paid_interests]">Initial values[paid interests]</label>
|
104
|
+
<input step="0.01"
|
105
|
+
class="form-control"
|
106
|
+
type="number"
|
107
|
+
name="initial_values[paid_interests]"
|
108
|
+
id="initial_values[paid_interests]"
|
109
|
+
value= <%= initial_values_for_form(fixed_params[:initial_values][:paid_interests]) %>>
|
122
110
|
</div>
|
123
111
|
|
124
|
-
<div class="
|
125
|
-
<
|
112
|
+
<div class="col form-group">
|
113
|
+
<label for="initial_values[paid_capital]">Initial values[paid capital]</label>
|
114
|
+
<input step="0.01"
|
115
|
+
class="form-control"
|
116
|
+
type="number"
|
117
|
+
name="initial_values[paid_capital]"
|
118
|
+
id="initial_values[paid_capital]"
|
119
|
+
value= <%= initial_values_for_form(fixed_params[:initial_values][:paid_capital]) %>>
|
126
120
|
</div>
|
127
|
-
</
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div class="d-flex justify-content-center">
|
124
|
+
<input type="submit" class="btn btn-primary btn-lg my-2" value="generate">
|
125
|
+
</div>
|
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
<%= erb :
|
1
|
+
<form action="<%= env["SCRIPT_NAME"] %>/" method="GET" id="loan-form">
|
2
|
+
<%= erb :form, locals: { fixed_params: fixed_params } %>
|
3
|
+
<%= erb :table, locals: { terms: terms } %>
|
4
|
+
</form>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
}
|
31
31
|
|
32
32
|
.container {
|
33
|
-
width:
|
33
|
+
width: 80%;
|
34
34
|
padding-right: 15px;
|
35
35
|
}
|
36
36
|
|
@@ -141,6 +141,8 @@
|
|
141
141
|
user-select: none;
|
142
142
|
border: 1px solid transparent;
|
143
143
|
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
|
144
|
+
-webkit-appearance: button;
|
145
|
+
cursor: pointer;
|
144
146
|
}
|
145
147
|
|
146
148
|
[type=submit] {
|
@@ -1,6 +1,10 @@
|
|
1
|
-
<table class="table">
|
1
|
+
<table class="table" id="container">
|
2
2
|
<%= erb :table_head %>
|
3
3
|
<% terms.each do |term| %>
|
4
4
|
<%= erb :table_row, locals: { term: term } %>
|
5
5
|
<% end %>
|
6
6
|
</table>
|
7
|
+
|
8
|
+
<div class="d-flex justify-content-center">
|
9
|
+
<button name="button" class="btn btn-primary btn-lg my-2" type="submit" value="update">update</button>
|
10
|
+
</div>
|
@@ -1,10 +1,13 @@
|
|
1
1
|
<tr>
|
2
2
|
<td><%= term.index %></td>
|
3
|
-
<td
|
3
|
+
<td>
|
4
|
+
<input type="date" class="form-control" name="term_dates[<%= term.index %>]" value= <%= term.due_on %>>
|
5
|
+
</td>
|
4
6
|
<td><%= number_to_euro(term.period_amount_to_pay) %></td>
|
5
7
|
<td><%= number_to_euro(term.period_capital) %></td>
|
6
8
|
<td><%= number_to_euro(term.period_interests) %></td>
|
7
9
|
<td><%= number_to_euro(term.crd_end_of_period) %></td>
|
10
|
+
<td><%= number_to_euro(term.due_interests_end_of_period) %></td>
|
8
11
|
<td><%= number_to_euro(term.total_paid_capital_end_of_period) %></td>
|
9
12
|
<td><%= number_to_euro(term.total_paid_interests_end_of_period) %></td>
|
10
13
|
</tr>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loan_creator_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juliette Audema
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|