diff --git a/app/controllers/origami/credit_payments_controller.rb b/app/controllers/origami/credit_payments_controller.rb index a4978a6f..fde9d6f7 100755 --- a/app/controllers/origami/credit_payments_controller.rb +++ b/app/controllers/origami/credit_payments_controller.rb @@ -8,7 +8,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController @creditcount = 0 others = 0 sale_data.sale_payments.each do |sale_payment| - if sale_payment.payment_method == "visa" + if sale_payment.payment_method == "creditnote" @creditcount = @creditcount + sale_payment.payment_amount else others = others + sale_payment.payment_amount diff --git a/app/controllers/settings/menu_item_instances_controller.rb b/app/controllers/settings/menu_item_instances_controller.rb index 66f67522..60646323 100755 --- a/app/controllers/settings/menu_item_instances_controller.rb +++ b/app/controllers/settings/menu_item_instances_controller.rb @@ -67,7 +67,11 @@ class Settings::MenuItemInstancesController < ApplicationController respond_to do |format| if @settings_menu_item_instances.save +<<<<<<< HEAD @settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].split("") +======= + @settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].split(" ") +>>>>>>> 7a28dc1ddc100e61789fae7f1f3503e2f703711e @settings_menu_item_instances.save format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully created.' } format.json { render :show, status: :created, location: @settings_menu_item_instances } diff --git a/app/models/print_setting.rb b/app/models/print_setting.rb index c326f715..a13229dc 100755 --- a/app/models/print_setting.rb +++ b/app/models/print_setting.rb @@ -1,4 +1,4 @@ class PrintSetting < ApplicationRecord # validations - validates_presence_of :name, :unique_code, :printer_name, :page_width, :page_height + validates_presence_of :name, :unique_code, :printer_name, :page_width, :page_height, :print_copies end diff --git a/app/views/origami/credit_payments/index.html.erb b/app/views/origami/credit_payments/index.html.erb index e9ccc8c4..a3243b57 100755 --- a/app/views/origami/credit_payments/index.html.erb +++ b/app/views/origami/credit_payments/index.html.erb @@ -40,13 +40,13 @@ <% end %> -
+

diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 0fd7fa89..d18e0c8f 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -374,14 +374,14 @@ <% end %> <% if @status_sale == 'sale' %> - + - + <% end %> @@ -617,7 +617,12 @@ $('#edit').on('click', function () { var dining_id = "<%= @dining.id %>" var sale_id = "<%= @obj_sale.sale_id rescue "" %>" - window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/edit"; + if ($(this).attr('active')=== "true") { + window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/edit"; + }else{ + swal("Opps","You are not authorized for void","warning") + } + }); $('#commissions').on('click', function () { @@ -632,6 +637,7 @@ }); $('#void').on('click', function () { + if ($(this).attr('active')=== "true") { swal({ title: "Alert", text: "Are you sure want to Void?", @@ -652,7 +658,10 @@ } }); } - }); + }); + }else{ + swal("Opps","You are not authorized for void","warning") + } }); $('#add_order').on('click', function () { diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 291060de..db23f9ba 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -276,8 +276,8 @@ reply Back - - + + @@ -431,20 +431,25 @@ }); $('#void').on('click',function () { - swal({ - title: "Information!", - text: 'Are you sure want to Void !', - }, function () { - var sale_id = $('#sale_id').text(); - var ajax_url = "/origami/sale/" + sale_id + '/void'; - $.ajax({ - type: 'POST', - url: ajax_url, - success: function () { - window.location.href = '/origami/'; - } - }) - }); + if ($(this).attr('active') === "true") { + swal({ + title: "Information!", + text: 'Are you sure want to Void !', + }, function () { + var sale_id = $('#sale_id').text(); + var ajax_url = "/origami/sale/" + sale_id + '/void'; + $.ajax({ + type: 'POST', + url: ajax_url, + success: function () { + window.location.href = '/origami/'; + } + }) + }); + }else{ + swal("Opps","You are not authorized for void","warning") + } + }); }); @@ -463,19 +468,21 @@ } $('#foc').click(function() { - $( "#loading_wrapper" ).show(); + //$( "#loading_wrapper" ).show(); // payment var cash = $('#amount_due').text(); var sub_total = $('#sub-total').text(); var sale_id = $('#sale_id').text(); var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total }; - $.ajax({type: "POST", + if ($(this).attr('active')=== "true") { + $.ajax({ + type: "POST", url: "<%= origami_payment_foc_path %>", data: params, success:function(result){ - $( "#loading_wrapper" ).hide(); + //$( "#loading_wrapper" ).hide(); if (cash > 0) { swal({ @@ -488,6 +495,9 @@ } }); + }else{ + swal("Opps","You are not authorized for foc","warning") + } }); function calculate_member_discount(sale_id) { diff --git a/app/views/print_settings/_form.html.erb b/app/views/print_settings/_form.html.erb index b795c380..51ee0eaa 100755 --- a/app/views/print_settings/_form.html.erb +++ b/app/views/print_settings/_form.html.erb @@ -15,7 +15,7 @@ <%= f.input :api_settings %> <%= f.input :page_width %> <%= f.input :page_height %> - <%= f.input :print_copies %> + <%= f.input :print_copies, input_html: { min: '1', step: '1', :onkeypress => "return isNumberKey(event);", :onkeyup => "greaterThanOne(this.value);" } %> <%= f.input :precision %> <%= f.input :delimiter %> <%= f.input :heading_space %> @@ -58,4 +58,19 @@ - \ No newline at end of file + + + \ No newline at end of file