mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
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:
@@ -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?
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user