Sha256: b611294f2d1ec5ccfc51b1e59e9ff62e799f91fe4bd6d6df6ee38a273c0f6f40
Contents?: true
Size: 852 Bytes
Versions: 45
Compression:
Stored size: 852 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 delegate :checked_out?, to: :current_order, prefix: true, allow_nil: true # 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
45 entries across 45 versions & 1 rubygems