Sha256: 21a01b00a4701ec0449a4a1ee9df706fe462bd91b2903419f7df08da97fe7d35
Contents?: true
Size: 854 Bytes
Versions: 13
Compression:
Stored size: 854 Bytes
Contents
# frozen_string_literal: true module Decidim module Budgets # A helper to render order and budgets actions module ProjectsHelper # Render a budget as a currency # # budget - A integer to represent a budget def budget_to_currency(budget) number_to_currency budget, unit: Decidim.currency_unit, precision: 0 end # Return a percentage of the current order budget from the total budget def current_order_budget_percent current_order&.budget_percent.to_f.floor end # Return true if the current order is checked out def current_order_checked_out? current_order&.checked_out? end # Return true if the user can continue to the checkout process def current_order_can_be_checked_out? current_order&.can_checkout? end end end end
Version data entries
13 entries across 13 versions & 2 rubygems