forked from svs/misfit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_fields.html.haml
85 lines (85 loc) · 2.61 KB
/
_fields.html.haml
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
- if @insurance_policy and @insurance_policy.id and not @insurance_policy.id.blank?
= hidden_field :id
%table
%tr
%td
Insurance Product
%td
- if defined? :product_fixed? and @insurance_policy.insurance_product
= @insurance_policy.insurance_product.name
= hidden_field :insurance_product_id, :value => @insurance_policy.insurance_product.id
- else
= select :insurance_product_id, :collection => InsuranceProduct.all, :prompt => "---", :value_method => :id, :text_method => :name
= link_to 'Add a product', resource(:insurance_products, :new, {:return => (@client ? resource(@client, :insurance_policies, :new) : nil)}), :class => "_remote_"
%tr
%td
Policy Number
%td
= text_field :policy_no
%tr
%td
Application number
%td
= text_field :application_number
%tr
%td
Sum Insured
%td
= text_field :sum_insured
%tr
%td
Premium
%td
= text_field :premium
-# - if @insurance_policy.id.nil? and @loan_product
-# %tr{:style => "background-color:#fff370"}
-# %td
-# Apply premium as
-# %td
-# - @loan_product.insurance_product.fees.each do |f|
-# %ul
-# %li
-# = check_box(:name => "fee_#{f.id}", :checked => true)
-# = f.name
-# %tr{:style => "background-color:#fff370"}
-# %td
-# payable on
-# %td
-# = date_select :fee_date, nil
-# - elsif not @insurance_policy.loan.nil?
-# %tr{:style => "background-color:#fff370"}
-# %td
-# Apply premium as
-# %td
-# - @loan_product = LoanProduct.get(@insurance_policy.loan.loan_product_id) if @loan_product.nil?
-# - @loan_product.insurance_product.fees.each do |f|
-# %ul
-# %li
-# = check_box(:name => "fee_#{f.id}", :checked => true)
-# = f.name
-# %tr{:style => "background-color:#fff370"}
-# %td
-# payable on
-# %td
-# = date_select :fee_date, nil
%tr
%td
Date from
%td
= date_select_for(@insurance_policy, "date_from", :date => @insurance_policy.date_from)
%tr
%td
Date to
%td
= date_select_for(@insurance_policy, "date_to", :date => @insurance_policy.date_to, :max_date => Date.today + 3650)
= hidden_field :client_id, :value => @client.id
%tr
%td
Status
%td
= select(:status, :collection => InsurancePolicy::POLICY_STATUSES.map{|x| [x, x]})
%tr
%td
Cover for
%td
= select(:cover_for, :collection => InsurancePolicy::COVER_FOR.map{|x| [x, x]})