Module: Dorsale::BillingMachine::ApplicationHelper
- Defined in:
- app/helpers/dorsale/billing_machine/application_helper.rb
Instance Method Summary collapse
- #billing_machine_payment_status_for_filter_select ⇒ Object
- #billing_machine_quotation_states_for_filter_select ⇒ Object
- #billing_machine_quotation_states_for_select ⇒ Object
- #quotation_state_classes(quotation) ⇒ Object
Instance Method Details
#billing_machine_payment_status_for_filter_select ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/helpers/dorsale/billing_machine/application_helper.rb', line 20 def billing_machine_payment_status_for_filter_select { ::Dorsale::BillingMachine::Invoice.t("payment_status.all") => "", ::Dorsale::BillingMachine::Invoice.t("payment_status.unpaid") => "unpaid", ::Dorsale::BillingMachine::Invoice.t("payment_status.pending") => "pending", ::Dorsale::BillingMachine::Invoice.t("payment_status.late") => "late", ::Dorsale::BillingMachine::Invoice.t("payment_status.paid") => "paid", } end |
#billing_machine_quotation_states_for_filter_select ⇒ Object
13 14 15 16 17 18 |
# File 'app/helpers/dorsale/billing_machine/application_helper.rb', line 13 def billing_machine_quotation_states_for_filter_select [ [::Dorsale::BillingMachine::Quotation.t("state.all"), ""], [::Dorsale::BillingMachine::Quotation.t("state.not_canceled"), "not_canceled"], ] + billing_machine_quotation_states_for_select end |
#billing_machine_quotation_states_for_select ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'app/helpers/dorsale/billing_machine/application_helper.rb', line 4 def billing_machine_quotation_states_for_select ::Dorsale::BillingMachine::Quotation::STATES.map do |e| [ ::Dorsale::BillingMachine::Quotation.t("state.#{e}"), e, ] end end |
#quotation_state_classes(quotation) ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/helpers/dorsale/billing_machine/application_helper.rb', line 30 def quotation_state_classes(quotation) if quotation.state == "pending" && quotation.date < 1.month.ago return "pending late" else return quotation.state end end |