diff --git a/app/assets/images/ajax-loader.gif b/app/assets/images/ajax-loader.gif new file mode 100644 index 00000000..4155add2 Binary files /dev/null and b/app/assets/images/ajax-loader.gif differ diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 7935b50e..ffd8aded 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -211,3 +211,29 @@ tr.discount-item-row:hover { margin-left:-40px !important; margin-top:-40px !important; } + +/*Loading gif for payment*/ + +#loading_wrapper{ + + position: fixed; + background-color: #C8C8C8 ; + height: 100%; + width: 100%; + left: 0; + opacity: 0.6; + top: 0; + z-index: 9999999; +} +#loading{ + position: relative; + height: 100%; + width: 100%; + background-image: url('../../../image/loading-ajax.gif'); + background-position: center center; + background-repeat: no-repeat; + opacity: 1; + filter: alpha(opacity=100); /* ie */ + -moz-opacity: 1; /* mozilla */ + +} \ No newline at end of file diff --git a/app/controllers/origami/discounts_controller.rb b/app/controllers/origami/discounts_controller.rb index 4645ff1d..f7e1c63a 100644 --- a/app/controllers/origami/discounts_controller.rb +++ b/app/controllers/origami/discounts_controller.rb @@ -189,15 +189,15 @@ class Origami::DiscountsController < BaseOrigamiController discount_amount = discount_amount + response["discount_bonus_earned"] end sale.compute_by_sale_items(sale_id, sale.sale_items, discount_amount, 'member_discount') - result = {:status=> "Success", :table_id => table_id,:table_type => table_type } + result = {:status=> "Success",:title=>"Member Discount", :table_id => table_id,:table_type => table_type } end if response["status"] == "500" - result = {:status=> response["error"], :table_id => table_id,:table_type => table_type } + result = {:status=> response["error"],:title=>"Alert", :table_id => table_id,:table_type => table_type } end if !response.nil? if response[:status] == false - result = {:status=> response[:message], :table_id => table_id,:table_type => table_type } + result = {:status=> response[:message],:title=>"Alert", :table_id => table_id,:table_type => table_type } end end diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 32f4ab12..7ee03e47 100644 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -4,7 +4,7 @@ class Origami::HomeController < BaseOrigamiController def index @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('date desc') # @shift = ShiftSale.current_open_shift(current_user.id) end @@ -13,7 +13,7 @@ class Origami::HomeController < BaseOrigamiController def show @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('date desc') @status_order = "" @status_sale = "" diff --git a/app/controllers/origami/orders_controller.rb b/app/controllers/origami/orders_controller.rb index ef213ddd..f3cddd74 100644 --- a/app/controllers/origami/orders_controller.rb +++ b/app/controllers/origami/orders_controller.rb @@ -3,7 +3,7 @@ class Origami::OrdersController < BaseOrigamiController def show @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('status desc') @order = Order.find(params[:order_id]) sale_order = SaleOrder.find_by_order_id(@order.order_id) diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index df1fbfcb..24d63b71 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -91,9 +91,9 @@ class Origami::PaymentsController < BaseOrigamiController #get customer amount @customer = Customer.find(@sale_data.customer_id) - + rebate = MembershipSetting.find_by_rebate(1) # get member information - if @customer.membership_id != nil + if @customer.membership_id != nil && rebate response = Customer.get_member_account(@customer) if response["status"]==true response["data"].each do |res| diff --git a/app/controllers/origami/rooms_controller.rb b/app/controllers/origami/rooms_controller.rb index e5728f99..823136b9 100644 --- a/app/controllers/origami/rooms_controller.rb +++ b/app/controllers/origami/rooms_controller.rb @@ -3,7 +3,7 @@ class Origami::RoomsController < BaseOrigamiController def show @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('date desc') @room = DiningFacility.find(params[:room_id]) @sale_array = Array.new @@ -31,9 +31,6 @@ class Origami::RoomsController < BaseOrigamiController end end end - puts "hhhhhhhhhh" - puts @status - puts @obj.to_json end diff --git a/app/controllers/origami/sales_controller.rb b/app/controllers/origami/sales_controller.rb index c397da0f..3a9586fb 100644 --- a/app/controllers/origami/sales_controller.rb +++ b/app/controllers/origami/sales_controller.rb @@ -3,7 +3,7 @@ class Origami::SalesController < BaseOrigamiController def show @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('date desc') @sale = Sale.find(params[:sale_id]) end diff --git a/app/models/ability.rb b/app/models/ability.rb index 1cf1d902..f9d98bfc 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -75,8 +75,8 @@ class Ability can :read, Sale can :update, Sale - can :add_customer, Customer - can :update_sale_by_customer, Customer + can :add_customer, Customer + can :update_sale_by_customer, Customer can :index, :other_charge can :create, :other_charge diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb index 66a16b2b..8b84b4b9 100644 --- a/app/views/crm/customers/_new_form.html.erb +++ b/app/views/crm/customers/_new_form.html.erb @@ -46,11 +46,11 @@
- <%= f.input :nrc_no, :class => "form-control nrc_no" %> + <%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %>
- <%= f.input :company, :class => "form-control col-md-6 company",:required => true%> + <%= f.input :company, :class => "form-control col-md-6 company"%> <% flash.each do |name, msg| %> <% str="[\"#{msg['company']}\"]" diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index a1d359e8..1f06704b 100644 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -121,10 +121,10 @@
- <%= f.input :nrc_no, :class => "form-control nrc_no" %> + <%= f.input :nrc_no, :label => "NRC No",:class => "form-control nrc_no" %>
- <%= f.input :company, :class => "form-control col-md-6 company",:required => true%> + <%= f.input :company, :class => "form-control col-md-6 company"%> <% flash.each do |name, msg| %> <% str="[\"#{msg['company']}\"]" diff --git a/app/views/origami/discounts/index.html.erb b/app/views/origami/discounts/index.html.erb index 88e2bce6..b0e324a5 100644 --- a/app/views/origami/discounts/index.html.erb +++ b/app/views/origami/discounts/index.html.erb @@ -519,7 +519,7 @@ $(document).ready(function(){ } $.confirm({ - title: 'Infomation!', + title: result.title, content: result.status, columnClass: 'small', type: type, @@ -542,18 +542,14 @@ $(document).ready(function(){ } }); }else{ - $.confirm({ - title: 'Alert !', - content: 'Please Select Account', - type: 'red', + $.alert({ + title: 'Alert!', + content: 'Please Select Account', + type: 'red', typeAnimated: true, - buttons: { - confirm: { - text: 'Ok', - btnClass: 'btn-danger', - } - } - }); + btnClass: 'btn-danger', + }); + } });//end member discount diff --git a/app/views/origami/moveroom/move_dining.html.erb b/app/views/origami/moveroom/move_dining.html.erb index a8620d6e..3cc878a3 100644 --- a/app/views/origami/moveroom/move_dining.html.erb +++ b/app/views/origami/moveroom/move_dining.html.erb @@ -15,13 +15,13 @@ -
+
-
+
<% @tables.each do |table| %> <% if table.status == 'occupied' %>
@@ -42,7 +42,7 @@
-
+
<% @rooms.each do |room| %> <% if room.status == 'occupied' %>
@@ -95,7 +95,7 @@
-
+
diff --git a/app/views/origami/movetable/move_dining.html.erb b/app/views/origami/movetable/move_dining.html.erb index d64b71f0..d8abdd86 100644 --- a/app/views/origami/movetable/move_dining.html.erb +++ b/app/views/origami/movetable/move_dining.html.erb @@ -15,13 +15,13 @@ -
+
-
+
<% @tables.each do |table| %> <% if table.status == 'occupied' %>
@@ -42,7 +42,7 @@
-
+
<% @rooms.each do |room| %> <% if room.status == 'occupied' %>
@@ -95,7 +95,7 @@
-
+
diff --git a/app/views/origami/orders/show.html.erb b/app/views/origami/orders/show.html.erb index e8c391d1..bc614504 100644 --- a/app/views/origami/orders/show.html.erb +++ b/app/views/origami/orders/show.html.erb @@ -175,11 +175,9 @@ - <%if @selected_item.discount_type == 'member_discount'%> - - <%else%> + - <%end%> + diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 63b6b0d0..83373b8e 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -1,4 +1,6 @@ - +
@@ -104,6 +106,7 @@
+
Amount Due
@@ -258,6 +261,8 @@
+ +
+ \ No newline at end of file diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index 988bcf5a..d115b765 100644 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -203,7 +203,7 @@ - <%if @obj.discount_type == 'member_discount'%> + <%if @obj != nil && @status_sale == 'sale' && @obj.discount_type == 'member_discount'%> <%else%> diff --git a/app/views/origami/shifts/new.html.erb b/app/views/origami/shifts/new.html.erb index 8d3ca457..a8ded240 100644 --- a/app/views/origami/shifts/new.html.erb +++ b/app/views/origami/shifts/new.html.erb @@ -110,7 +110,7 @@ $(document).on('focusout', '.float-value', function(event){ $('#open_cashier').on('click',function(){ var cashier_terminal = $('#cashier_terminal').val(); - var amount = $('#total').text(); + var amount = $('#total').text()||0; $.ajax({type: "POST", url: "<%= origami_shifts_path %>", data: "opening_balance=" + amount + "&cashier_terminal="+ cashier_terminal, diff --git a/app/views/settings/membership_settings/_form.html.erb b/app/views/settings/membership_settings/_form.html.erb index 98ae8f0a..77a189c4 100644 --- a/app/views/settings/membership_settings/_form.html.erb +++ b/app/views/settings/membership_settings/_form.html.erb @@ -11,7 +11,6 @@ <%= f.input :rebate %> <%= f.input :bonus %> <%= f.input :point %> - <%= f.input :created_by %>
diff --git a/app/views/settings/membership_settings/index.html.erb b/app/views/settings/membership_settings/index.html.erb index f03683e1..e382f026 100644 --- a/app/views/settings/membership_settings/index.html.erb +++ b/app/views/settings/membership_settings/index.html.erb @@ -22,7 +22,6 @@
- @@ -40,7 +39,6 @@ - diff --git a/app/views/settings/order_queue_stations/show.html.erb b/app/views/settings/order_queue_stations/show.html.erb index fbb19182..97c5dd4c 100644 --- a/app/views/settings/order_queue_stations/show.html.erb +++ b/app/views/settings/order_queue_stations/show.html.erb @@ -32,7 +32,7 @@ - + diff --git a/public/image/loading-ajax.gif b/public/image/loading-ajax.gif new file mode 100755 index 00000000..e3d3cb83 Binary files /dev/null and b/public/image/loading-ajax.gif differ
<%= sub_total %>
Member Discount:Discount:(<%=@selected_item.total_discount rescue 0%>)
<%= sub_total %>
Member Discount:Discount: Rebate Bonus PointCreated by
<%= settings_membership_setting.rebate %> <%= settings_membership_setting.bonus %> <%= settings_membership_setting.point %><%= settings_membership_setting.created_by %> <%= link_to 'Edit', edit_settings_membership_setting_path(settings_membership_setting) %> <%= link_to 'Destroy', settings_membership_setting_path(settings_membership_setting), method: :delete, data: { confirm: 'Are you sure?' } %>
<%= @settings_order_queue_station.station_name %> <%= @settings_order_queue_station.is_active %> <%= @settings_order_queue_station.auto_print %><%= @settings_order_queue_station.processing_items %><%= JSON.parse(@settings_order_queue_station.processing_items).count %> <%= @settings_order_queue_station.print_copy %> <%= @settings_order_queue_station.printer_name %> <%= @settings_order_queue_station.font_size %>