Adding transactions

-Need to create a customers table to store contact information of customers who are not a user.
-Need to scope "User Transactions" for users, staff, and admin. Need to have a "All Shop Transactions" tab.
-Need to add conditional UX to form.
This commit is contained in:
Jason Denney
2013-01-19 15:59:47 -05:00
parent a9533e6249
commit 11e738b428
7 changed files with 42 additions and 5 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ class AppTabPanel < Netzke::Basepack::TabPanel
#all users
# (had to use hash for borders to get the title to display properly)
@@app_tab_panel_items = [ :bikes_border, {layout: :fit, wrappedComponent: :brands_and_models_border, title: "Brands/Models"}]
@@app_tab_panel_items = [ :transactions, :bikes_border, {layout: :fit, wrappedComponent: :brands_and_models_border, title: "Brands/Models"}]
#for users
if controller.current_user.user?
+17
View File
@@ -0,0 +1,17 @@
class Transactions < Netzke::Basepack::Grid
def configure(c)
super
c.model = "Transaction"
c.strong_default_attrs = { :vendor_id => controller.current_user.id }
c.columns = [
:amount,
:item,
{ :name => :bike__serial_number},
{ :name => :vendor, :getter => lambda { |rec|
user = rec.vendor
user.nil? ? "" : "#{user.first_name} #{user.last_name}"
}
}
]
end
end