Class: Planik::Lohnausweis::Abzug
- Inherits:
-
Eintrag
- Object
- Eintrag
- Planik::Lohnausweis::Abzug
show all
- Defined in:
- lib/lohnausweis/daten_eintrag.rb
Instance Attribute Summary
Attributes inherited from Eintrag
#ansatz, #einheit, #menge, #name
Instance Method Summary
collapse
Methods inherited from Eintrag
#betrag_gerundet_to_s
Constructor Details
#initialize(name, menge, ansatz) ⇒ Abzug
100
101
102
|
# File 'lib/lohnausweis/daten_eintrag.rb', line 100
def initialize name, menge, ansatz
super(name, menge, ansatz)
end
|
Instance Method Details
#ansatz_to_s ⇒ Object
112
113
114
115
|
# File 'lib/lohnausweis/daten_eintrag.rb', line 112
def ansatz_to_s
x = ActiveSupport::NumberHelper.number_to_rounded(ansatz, precision: 2)
"#{x}%"
end
|
#betrag ⇒ Object
104
105
106
|
# File 'lib/lohnausweis/daten_eintrag.rb', line 104
def betrag
menge * (ansatz / 100)
end
|
#menge_to_s ⇒ Object
108
109
110
|
# File 'lib/lohnausweis/daten_eintrag.rb', line 108
def menge_to_s
menge.nil? ? nil : value_gerundet_to_s(menge)
end
|