mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
Updating the admin account view to show use the new account_invoice model to display data
This commit is contained in:
@@ -25,14 +25,19 @@ class BillablePeriod < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def adjustment_label
|
||||
def label
|
||||
enterprise_version = enterprise.version_at(begins_at)
|
||||
category = enterprise_version.category.to_s.titleize
|
||||
category += (trial ? " Trial" : "")
|
||||
|
||||
"#{enterprise_version.name} (#{category})"
|
||||
end
|
||||
|
||||
def adjustment_label
|
||||
begins = begins_at.localtime.strftime("%d/%m/%y")
|
||||
ends = ends_at.localtime.strftime("%d/%m/%y")
|
||||
|
||||
"#{enterprise_version.name} (#{category}) [#{begins} - #{ends}]"
|
||||
"#{label} [#{begins} - #{ends}]"
|
||||
end
|
||||
|
||||
def delete
|
||||
|
||||
@@ -7,6 +7,7 @@ Spree.user_class.class_eval do
|
||||
has_many :enterprises, through: :enterprise_roles
|
||||
has_many :owned_enterprises, class_name: 'Enterprise', foreign_key: :owner_id, inverse_of: :owner
|
||||
has_many :owned_groups, class_name: 'EnterpriseGroup', foreign_key: :owner_id, inverse_of: :owner
|
||||
has_many :account_invoices
|
||||
has_many :billable_periods, foreign_key: :owner_id, inverse_of: :owner
|
||||
has_one :cart
|
||||
has_many :customers
|
||||
|
||||
Reference in New Issue
Block a user