From f8cd712ad1f2e958e40c9cc8d98fd5a0e35c98c9 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 9 Nov 2017 17:25:54 +0630 Subject: [PATCH] update feedback testing --- README.md | 4 +-- app/assets/javascripts/OQS.js | 2 +- app/controllers/home_controller.rb | 2 +- app/models/menu_item.rb | 9 +++--- .../origami/credit_payments/index.html.erb | 29 ++++++++++++------- app/views/origami/discounts/index.html.erb | 10 +++---- app/views/origami/home/show.html.erb | 2 +- app/views/origami/jcb/index.html.erb | 10 +++++-- app/views/origami/master/index.html.erb | 10 +++++-- app/views/origami/mpu/index.html.erb | 10 +++++-- .../origami/other_charges/index.html.erb | 2 +- app/views/origami/payments/show.html.erb | 8 ++--- .../origami/redeem_payments/index.html.erb | 2 +- app/views/origami/rooms/show.html.erb | 2 +- app/views/origami/sale_edit/edit.html.erb | 2 +- app/views/origami/visa/index.html.erb | 12 ++++++-- app/views/print_settings/show.html.erb | 2 +- .../payment_method_settings/show.html.erb | 4 +-- 18 files changed, 74 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 081ba3ac..175b0d20 100755 --- a/README.md +++ b/README.md @@ -86,8 +86,8 @@ ruby 2.4.1p111 1. Layout - 1. 2-Column => Main Content - col-9, Infomation - col-3 - 2. 3-Column => Sub Lint - col-2, Main Content - col-7, Infomation - col-3 + 1. 2-Column => Main Content - col-9, Information - col-3 + 2. 3-Column => Sub Lint - col-2, Main Content - col-7, Information - col-3 > Pixel diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index 2f8d866d..609fdfc2 100755 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -198,7 +198,7 @@ $(document).on('turbolinks:load', function() { $("#completed_count").text(parseInt($("#completed_count").text()) + data.length); swal({ - title: "Infomation !", + title: "Information !", text: 'Order has been successfully created', confirmButtonColor: "green", confirmButtonText: "Yes!", diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 71ed8d07..1586158e 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -55,7 +55,7 @@ class HomeController < ApplicationController render :index end else - redirect_to origami_root_path, :notice => "Username and Password dosn't match!" + redirect_to origami_root_path, :notice => "Username and Password doesn't match!" end end diff --git a/app/models/menu_item.rb b/app/models/menu_item.rb index dba5f951..26577582 100755 --- a/app/models/menu_item.rb +++ b/app/models/menu_item.rb @@ -13,7 +13,7 @@ class MenuItem < ApplicationRecord has_many :menu_item_sets has_many :item_sets, through: :menu_item_sets - validates_presence_of :name, :type, :min_qty, :taxable + validates_presence_of :name, :type, :min_qty, :taxable,:account_id default_scope { order('item_code asc') } @@ -53,13 +53,12 @@ class MenuItem < ApplicationRecord end def self.deleteRecursive(menu_item) - # find the sub menu item of current item - sub_menu_items = MenuItem.where("menu_item_id=?",menu_item.id) + sub_menu_items = MenuItem.where("id=?",menu_item.id) if sub_menu_items.length != 0 sub_menu_items.each do |subitem| - if deleteRecursive(subitem) - end + # if deleteRecursive(subitem) + # end end # find the instances of current menu item instances = MenuItemInstance.where("menu_item_id=?",menu_item.id) diff --git a/app/views/origami/credit_payments/index.html.erb b/app/views/origami/credit_payments/index.html.erb index 2d246ce4..c7827808 100755 --- a/app/views/origami/credit_payments/index.html.erb +++ b/app/views/origami/credit_payments/index.html.erb @@ -1,12 +1,17 @@
-
-
-

CREDIT PAYMENT

-
+
-
+
@@ -104,10 +109,10 @@
- +
diff --git a/app/views/origami/discounts/index.html.erb b/app/views/origami/discounts/index.html.erb index e1bcd3ee..a2fbaafb 100755 --- a/app/views/origami/discounts/index.html.erb +++ b/app/views/origami/discounts/index.html.erb @@ -387,7 +387,7 @@ success:function(result){ $("#loading_wrapper").hide(); swal({ - title: "Infomation!", + title: "Information!", text: result.status, }, function () { if(result.table_type == "Table"){ @@ -410,7 +410,7 @@ // Selected Items var sale_items = get_selected_sale_items(); if(sale_items.length == 0){ - //swal("Infomation!", "You have no selected item!"); + //swal("Information!", "You have no selected item!"); swal ( "Oops" , "You have no selected item!" , "error" ); } @@ -430,7 +430,7 @@ data: params, success: function(result){ swal({ - title: "Infomation!", + title: "Information!", text: result.status, type: "success", }, function () { @@ -453,7 +453,7 @@ url: "/origami/" + sale_id + "/remove_all_discount", success: function(result){ swal({ - title: "Infomation!", + title: "Information!", text: result.status, type: "success", }, function () { @@ -497,7 +497,7 @@ btn_color = 'red' } swal({ - title: "Infomation!", + title: "Information!", text: result.status, confirmButtonText: 'OK', confirmButtonColor: btn_color, diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 1d5c37d0..9437ad52 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -507,7 +507,7 @@ // data: 'order_id='+ order_id, success: function (result) { if (!result.status) { - swal("Infomation!", result.error_message); + swal("Information!", result.error_message); } else { location.reload(); diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb index b65686c4..f138b6ed 100755 --- a/app/views/origami/jcb/index.html.erb +++ b/app/views/origami/jcb/index.html.erb @@ -158,7 +158,7 @@ $(document).on('click', '.cashier_number', function(event){ $('#jcb_pay').on('click',function(){ var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; - if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) ){ + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ //start member discount 5% by pay card var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -179,7 +179,7 @@ $('#jcb_pay').on('click',function(){ success:function(result){ if(result){ swal({ - title: "Infomation!", + title: "Information!", text: "Payment Successfully", },function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; @@ -188,7 +188,11 @@ $('#jcb_pay').on('click',function(){ } }); }else{ - swal ( "Oops" , "Paid Amount is over!" , "error" ); + if (amount>0) { + swal ( "Oops" , "Paid Amount is over!" , "error" ); + }else{ + swal ( "Oops" , "Enter Amount!" , "error" ); + } } }) diff --git a/app/views/origami/master/index.html.erb b/app/views/origami/master/index.html.erb index d42576bd..6176b5cd 100755 --- a/app/views/origami/master/index.html.erb +++ b/app/views/origami/master/index.html.erb @@ -155,7 +155,7 @@ $('#master_pay').on('click',function(){ var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; - if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) ){ + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ //start member discount 5% by pay card var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -176,7 +176,7 @@ success:function(result){ if(result){ swal({ - title: "Infomation!", + title: "Information!", text: "Payment Successfully", },function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; @@ -185,7 +185,11 @@ } }); }else{ - swal ( "Oops" , "Paid Amount is over!" , "error" ); + if (amount>0) { + swal ( "Oops" , "Paid Amount is over!" , "error" ); + }else{ + swal ( "Oops" , "Enter Amount!" , "error" ); + } } }) diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb index 9d4ecf41..51305466 100755 --- a/app/views/origami/mpu/index.html.erb +++ b/app/views/origami/mpu/index.html.erb @@ -155,7 +155,7 @@ $('#mpu_pay').on('click',function(){ var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; - if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) ){ + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ //start member discount 5% by pay card var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -177,7 +177,7 @@ success:function(result){ if(result){ swal({ - title: "Infomation!", + title: "Information!", text: "Payment Successfully", }, function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; @@ -186,7 +186,11 @@ } }); }else{ - swal ( "Oops" , "Paid Amount is over!" , "error" ); + if (amount>0) { + swal ( "Oops" , "Paid Amount is over!" , "error" ); + }else{ + swal ( "Oops" , "Enter Amount!" , "error" ); + } } }) diff --git a/app/views/origami/other_charges/index.html.erb b/app/views/origami/other_charges/index.html.erb index cc75c4f9..6dcf38a6 100755 --- a/app/views/origami/other_charges/index.html.erb +++ b/app/views/origami/other_charges/index.html.erb @@ -294,7 +294,7 @@ data: params, success:function(result){ swal({ - title: "Infomation!", + title: "Information!", text: "Success", }, function () { if(result.table_type == "Table"){ diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 58763ae0..57c196ea 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -403,7 +403,7 @@ $( "#loading_wrapper" ).hide(); if($('#balance').text() < 0){ swal({ - title: "Infomation!", + title: "Information!", text: 'Changed amount ' + $('#balance').text() * (-1), }, function () { window.location.href = '/origami'; @@ -411,7 +411,7 @@ }else{ $('#pay').text("Pay"); swal({ - title: "Infomation!", + title: "Information!", text: 'Thank You !', }, function () { window.location.href = '/origami'; @@ -424,7 +424,7 @@ $('#void').on('click',function () { swal({ - title: "Infomation!", + title: "Information!", text: 'Are you sure want to Void !', }, function () { var sale_id = $('#sale_id').text(); @@ -472,7 +472,7 @@ if (cash > 0) { swal({ - title: "Infomation!", + title: "Information!", text: 'Thank You !', }, function () { window.location.href = '/origami'; diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index ee8619c0..d5100040 100755 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -174,7 +174,7 @@ success: function(result){ if(result.status == true){ swal({ - title: "Infomation!", + title: "Information!", text: result.status, }, function () { window.location.href = '/origami/sale/'+ sale_id + "/payment" diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index 58ac1c96..092ff742 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -524,7 +524,7 @@ $('#request_bills').click(function() { success:function(result){ if(!result.status){ $.confirm({ - title: 'Infomation!', + title: 'Information!', content: result.error_message, buttons: { confirm: { diff --git a/app/views/origami/sale_edit/edit.html.erb b/app/views/origami/sale_edit/edit.html.erb index 04841e1a..960701ab 100755 --- a/app/views/origami/sale_edit/edit.html.erb +++ b/app/views/origami/sale_edit/edit.html.erb @@ -143,7 +143,7 @@ data: 'sale_item_id=' + sale_item_id + "&update_qty=" + qty + "&update_price=" + price, success: function (result) { swal({ - title: "Infomation!", + title: "Information!", text: "Qty and Price was successfully Updated", }, function () { location.reload(); diff --git a/app/views/origami/visa/index.html.erb b/app/views/origami/visa/index.html.erb index f8677d13..615a9d3f 100755 --- a/app/views/origami/visa/index.html.erb +++ b/app/views/origami/visa/index.html.erb @@ -155,7 +155,9 @@ $('#visa_pay').on('click',function(){ var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; - if(parseFloat(amount) <= parseFloat($("#validamount").attr("value"))){ + console.log(amount); + console.log($("#validamount").attr("value")); + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ //start member discount 5% by pay card var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -176,7 +178,7 @@ success:function(result){ if(result){ swal({ - title: "Infomation!", + title: "Information!", text: "Payment Successfully", }, function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; @@ -185,7 +187,11 @@ } }); }else{ - swal ( "Oops" , "Paid Amount is over!" , "error" ); + if (amount>0) { + swal ( "Oops" , "Paid Amount is over!" , "error" ); + }else{ + swal ( "Oops" , "Enter Amount!" , "error" ); + } } }) diff --git a/app/views/print_settings/show.html.erb b/app/views/print_settings/show.html.erb index a7fc38e2..1d76a088 100755 --- a/app/views/print_settings/show.html.erb +++ b/app/views/print_settings/show.html.erb @@ -4,7 +4,7 @@ - <%= link_to t('.back', :default => t("views.btn.back")), settings_employees_path %> + <%= link_to t('.back', :default => t("views.btn.back")), print_settings_path %>
diff --git a/app/views/settings/payment_method_settings/show.html.erb b/app/views/settings/payment_method_settings/show.html.erb index 7c0d4354..0b0cdec9 100755 --- a/app/views/settings/payment_method_settings/show.html.erb +++ b/app/views/settings/payment_method_settings/show.html.erb @@ -1,10 +1,10 @@