Module: Dorsale::BillingMachine
- Defined in:
- app/models/dorsale/billing_machine.rb
Defined Under Namespace
Modules: ApplicationHelper, InvoicePolicyHelper, PaymentTermPolicyHelper, QuotationPdfCommonMethods, QuotationPolicyHelper
Classes: ApplicationController, Email, Invoice, InvoiceLine, InvoiceMultipleVatPdf, InvoiceSingleVatPdf, InvoicesController, PaymentTerm, PaymentTermsController, PdfFileGenerator, Quotation, QuotationLine, QuotationMultipleVatPdf, QuotationSingleVatPdf, QuotationsController
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.default_currency ⇒ Object
33
34
35
|
# File 'app/models/dorsale/billing_machine.rb', line 33
def default_currency
@default_currency ||= "€"
end
|
.default_vat_rate ⇒ Object
39
40
41
|
# File 'app/models/dorsale/billing_machine.rb', line 39
def default_vat_rate
@default_vat_rate ||= 20.0
end
|
.vat_round_by_line ⇒ Object
16
17
18
19
|
# File 'app/models/dorsale/billing_machine.rb', line 16
def vat_round_by_line
@vat_round_by_line = false if @vat_round_by_line.nil?
@vat_round_by_line
end
|
Class Method Details
.invoice_pdf_model ⇒ Object
23
24
25
|
# File 'app/models/dorsale/billing_machine.rb', line 23
def invoice_pdf_model
"::Dorsale::BillingMachine::Invoice#{vat_mode.to_s.capitalize}VatPdf".constantize
end
|
.quotation_pdf_model ⇒ Object
27
28
29
|
# File 'app/models/dorsale/billing_machine.rb', line 27
def quotation_pdf_model
"::Dorsale::BillingMachine::Quotation#{vat_mode.to_s.capitalize}VatPdf".constantize
end
|
.vat_mode ⇒ Object
7
8
9
|
# File 'app/models/dorsale/billing_machine.rb', line 7
def vat_mode
@vat_mode ||= :single
end
|
.vat_mode=(new_mode) ⇒ Object
11
12
13
14
|
# File 'app/models/dorsale/billing_machine.rb', line 11
def vat_mode=(new_mode)
raise "invalid mode #{new_mode}" unless vat_modes.include?(new_mode)
@vat_mode = new_mode
end
|
.vat_modes ⇒ Object
3
4
5
|
# File 'app/models/dorsale/billing_machine.rb', line 3
def vat_modes
[:single, :multiple]
end
|