Class: C2eCore::Drops::FinancialReportVatDrop

Inherits:
BaseDrop
  • Object
show all
Includes:
Helpers::FinancialReportConversions
Defined in:
/build/app/mailers/c2e_core/drops/financial_report_vat_drop.rb

Instance Method Summary collapse

Methods included from Helpers::FinancialReportConversions

#converted_price, #format_price

Constructor Details

#initialize(financial_report, vat, value) ⇒ FinancialReportVatDrop

Returns a new instance of FinancialReportVatDrop.



8
9
10
11
12
13
# File '/build/app/mailers/c2e_core/drops/financial_report_vat_drop.rb', line 8

def initialize(financial_report, vat, value)
  super()
  @financial_report = financial_report
  @vat = vat
  @value = value
end

Instance Method Details

#formatted_valueString

Returns - Total amount for this VAT record converted to financial report’s currency and formatted. E.g.: "123,45 Kč".

Returns:

  • (String)
    • Total amount for this VAT record converted to financial report’s currency and formatted.

    E.g.: "123,45 Kč".



27
28
29
# File '/build/app/mailers/c2e_core/drops/financial_report_vat_drop.rb', line 27

def formatted_value
  format_price @value
end

#percentageDecimal

Returns - Percentage of current VAT record. E.g.: 12.0.

Returns:

  • (Decimal)
    • Percentage of current VAT record. E.g.: 12.0



16
17
18
# File '/build/app/mailers/c2e_core/drops/financial_report_vat_drop.rb', line 16

def percentage
  @vat.value
end

#valueFloat

Returns - Total amount for this VAT record converted to financial report’s currency. E.g.: 78.

Returns:

  • (Float)
    • Total amount for this VAT record converted to financial report’s currency. E.g.: 78



21
22
23
# File '/build/app/mailers/c2e_core/drops/financial_report_vat_drop.rb', line 21

def value
  @value
end