Class: ODDB::View::User::FiPiCalculations

Inherits:
HtmlGrid::Composite show all
Defined in:
src/view/user/fipi_offer_confirm.rb

Constant Summary

COLSPAN_MAP =
{}
COMPONENTS =
{}
COMPONENTS_FI =
{
  [0,0] =>  'fachinfo_column',
  
  [0,1] =>  :fi_activation_count,
  [1,1] =>  'fi_activation_charge',
  [2,1] =>  :fi_activation_charge_value,
  
  [0,2] =>  :fi_quantity,
  [1,2] =>  :fi_charge,
  [2,2] =>  :calculate_fi_charge,
  
  [1,3] =>  :fi_update,
  [2,3] =>  :fi_update_value,
}
COMPONENTS_PI =
{
  [0,0] =>  'patinfo_column', 
  
  [0,1] =>  :pi_activation_count,
  [1,1] =>  'pi_activation_charge',
  [2,1] =>  :pi_activation_charge_value,
  
  [0,2] =>  :pi_quantity,
  [1,2] =>  :pi_charge,
  [2,2] =>  :calculate_pi_charge,
  
  [1,3] =>  :pi_update,
  [2,3] =>  :pi_update_value,
}
COMPONENTS_FIPI =
{
  [1,1] =>  'total_activation_fee',
  [2,1] =>  :fipi_activation_charge_value,
  [1,2] =>  'total_recurring_charges',
  [2,2] =>  :calculate_total_charges,
  [1,3] =>  'total',
  [2,3] =>  :calculate_total,
}
CSS_MAP =
{ }
DEFAULT_CLASS =
HtmlGrid::Value

Instance Method Summary (collapse)

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) calculate_fi_charge(model, session)



110
111
112
113
# File 'src/view/user/fipi_offer_confirm.rb', line 110

def calculate_fi_charge(model, session)
  prize = model.calculate_fi_charge
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end

- (Object) calculate_pi_charge(model, session)



142
143
144
145
# File 'src/view/user/fipi_offer_confirm.rb', line 142

def calculate_pi_charge(model, session)
  prize = model.calculate_pi_charge
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end

- (Object) calculate_total(model, session)



99
100
101
102
# File 'src/view/user/fipi_offer_confirm.rb', line 99

def calculate_total(model, session)
  prize = model.calculate_total
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end

- (Object) calculate_total_charges(model, session)



103
104
105
106
# File 'src/view/user/fipi_offer_confirm.rb', line 103

def calculate_total_charges(model, session)
  prize = model.calculate_total_charges
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end

- (Object) fi_activation_charge_value(model, session)



131
132
133
134
# File 'src/view/user/fipi_offer_confirm.rb', line 131

def fi_activation_charge_value(model, session)
  prize = model.fi_calculate_activation_charge
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end

- (Object) fi_activation_count(model, session)



121
122
123
# File 'src/view/user/fipi_offer_confirm.rb', line 121

def fi_activation_count(model, session)
  model.fi_activation_count
end

- (Object) fi_charge(model, session)



107
108
109
# File 'src/view/user/fipi_offer_confirm.rb', line 107

def fi_charge(model, session)
  @lookandfeel.lookup(:fi_charge, model.fi_charge)
end

- (Object) fi_update(model, session)



114
115
116
# File 'src/view/user/fipi_offer_confirm.rb', line 114

def fi_update(model, session)
  @lookandfeel.lookup(model.fi_update.intern, model.fi_update_charge)
end

- (Object) fi_update_value(model, session)



117
118
119
120
# File 'src/view/user/fipi_offer_confirm.rb', line 117

def fi_update_value(model, session)
  prize = model.calculate_fi_update
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end

- (Object) fipi_activation_charge_value(model, session)



127
128
129
130
# File 'src/view/user/fipi_offer_confirm.rb', line 127

def fipi_activation_charge_value(model, session)
  prize = model.fi_calculate_activation_charge + model.pi_calculate_activation_charge
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end

- (Object) init



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
# File 'src/view/user/fipi_offer_confirm.rb', line 54

def init
  offset = 0
    if(@model.fi_activation_count > 0)
      components.update(COMPONENTS_FI)
    css_map.update({
      [1,1,2,4] => 'list bg',
      [0,1,1,4] =>  'list right bg', 
      [0,0]     => 'list bg bold sum',
    })
    colspan_map.update({
      [0,0] => 3, 
    })
    offset += 5
  end
  if(@model.pi_activation_count > 0)
    COMPONENTS_PI.each { |key, val|
      newkey = key.dup
      newkey[1] += offset
      components.store(newkey, val)
    }
    css_map.update({
      [1,offset+1,2,3] => 'list bg',
      [0,offset+1,1,3]  => 'list right bg',  
      [0,offset]     => 'list bg bold sum',
    })
    colspan_map.update({
      [0,offset] => 3, 
    })
    offset += 4
  end
  COMPONENTS_FIPI.each { |key, val|
    newkey = key.dup
    newkey[1] += offset
    components.store(newkey, val)
  }
  css = {
    [0,offset,2]       => 'list bg',
    [2,offset]         =>  'list bg sum',
    [0,offset + 1,3,3] =>  'list bg bold',
    [2,offset + 2]     =>  'list bg bold sum',
    [2,offset + 3]     =>  'list bg bold total',
  }
  css_map.update(css)
  super
end

- (Object) pi_activation_charge_value(model, session)



135
136
137
138
# File 'src/view/user/fipi_offer_confirm.rb', line 135

def pi_activation_charge_value(model, session)
  prize = model.pi_calculate_activation_charge
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end

- (Object) pi_activation_count(model, session)



124
125
126
# File 'src/view/user/fipi_offer_confirm.rb', line 124

def pi_activation_count(model, session)
  model.pi_activation_count
end

- (Object) pi_charge(model, session)



139
140
141
# File 'src/view/user/fipi_offer_confirm.rb', line 139

def pi_charge(model, session)
  @lookandfeel.lookup(:pi_charge, model.pi_charge)
end

- (Object) pi_update(model, session)



146
147
148
# File 'src/view/user/fipi_offer_confirm.rb', line 146

def pi_update(model, session)
  @lookandfeel.lookup(model.pi_update.intern, model.pi_update_charge)
end

- (Object) pi_update_value(model, session)



149
150
151
152
# File 'src/view/user/fipi_offer_confirm.rb', line 149

def pi_update_value(model, session)
  prize = model.calculate_pi_update
  @lookandfeel.lookup(:swiss_francs, prize.to_s)
end