From 8e7fd2d747e857c5772da08993e3ec93068db21a Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Thu, 26 Apr 2018 17:23:01 +0630 Subject: [PATCH 1/6] Edit in Reference No in CB --- app/assets/javascripts/origami.js | 1 + app/views/origami/alipay/index.html.erb | 18 +++++++----------- app/views/origami/jcb/index.html.erb | 6 +----- app/views/origami/master/index.html.erb | 4 ---- app/views/origami/mpu/index.html.erb | 20 ++++++++------------ app/views/origami/unionpay/index.html.erb | 4 ---- app/views/origami/visa/index.html.erb | 16 ++++++---------- 7 files changed, 23 insertions(+), 46 deletions(-) diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index ca021430..715a9fe1 100755 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -361,6 +361,7 @@ function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amo function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port,cashier_type) { $("#loading_wrapper").hide(); var jobj = $.parseJSON(resMsg); + $("#reference_no").val(jobj.REFNUM); if(jobj.STATUS == "Approved"){ $.ajax({type: "POST", url: "/origami/payment/"+payment_type, diff --git a/app/views/origami/alipay/index.html.erb b/app/views/origami/alipay/index.html.erb index abd065fb..5552d3f8 100755 --- a/app/views/origami/alipay/index.html.erb +++ b/app/views/origami/alipay/index.html.erb @@ -204,8 +204,7 @@ var bank_integration = "<%= @bank_integration %>"; var cashier_type = "<%= @cashier_type %>"; $("#reference_no_Err").html(""); - if(reference_no.length > 0){ - if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ $(this).off("click"); //start member discount 5% by pay card // var sub_total = $('#sub-total').text(); @@ -244,15 +243,12 @@ }); } - }else{ - if (amount>0) { - swal ( "Oops" , "Paid Amount is over!" , "error" ); - }else{ - swal ( "Oops" , "Enter Amount!" , "error" ); - } - } - }else{ - $("#reference_no_Err").html("can't be blank"); + }else{ + if (amount>0) { + swal ( "Oops" , "Paid Amount is over!" , "error" ); + }else{ + swal ( "Oops" , "Enter Amount!" , "error" ); + } } }) diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb index 51481148..28d6a4d8 100755 --- a/app/views/origami/jcb/index.html.erb +++ b/app/views/origami/jcb/index.html.erb @@ -200,8 +200,7 @@ $('#jcb_pay').on('click',function(){ var receipt_no = "<%= @receipt_no %>"; var bank_integration = "<%= @bank_integration %>"; $("#reference_no_Err").html(""); - if(reference_no.length > 0){ - if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ $(this).off("click"); //start member discount 5% by pay card // var sub_total = $('#sub-total').text(); @@ -247,8 +246,5 @@ $('#jcb_pay').on('click',function(){ swal ( "Oops" , "Enter Amount!" , "error" ); } } - }else{ - $("#reference_no_Err").html("can't be blank"); - } }) diff --git a/app/views/origami/master/index.html.erb b/app/views/origami/master/index.html.erb index 38237f1a..301452b8 100755 --- a/app/views/origami/master/index.html.erb +++ b/app/views/origami/master/index.html.erb @@ -198,7 +198,6 @@ var receipt_no = "<%= @receipt_no %>"; var bank_integration = "<%= @bank_integration %>"; $("#reference_no_Err").html(""); - if(reference_no.length > 0){ if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ $(this).off("click"); @@ -245,8 +244,5 @@ swal ( "Oops" , "Enter Amount!" , "error" ); } } - }else{ - $("#reference_no_Err").html("can't be blank"); - } }) diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb index f0115c0e..3edb1f7a 100755 --- a/app/views/origami/mpu/index.html.erb +++ b/app/views/origami/mpu/index.html.erb @@ -204,9 +204,8 @@ var bank_integration = "<%= @bank_integration %>"; var cashier_type = "<%= @cashier_type %>"; $("#reference_no_Err").html(""); - if(reference_no.length > 0){ - if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ - $(this).off("click"); + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + $(this).off("click"); //start member discount 5% by pay card // var sub_total = $('#sub-total').text(); // var member_id = $('#membership_id').text(); @@ -244,15 +243,12 @@ }); } - }else{ - if (amount>0) { - swal ( "Oops" , "Paid Amount is over!" , "error" ); - }else{ - swal ( "Oops" , "Enter Amount!" , "error" ); - } - } - }else{ - $("#reference_no_Err").html("can't be blank"); + }else{ + if (amount>0) { + swal ( "Oops" , "Paid Amount is over!" , "error" ); + }else{ + swal ( "Oops" , "Enter Amount!" , "error" ); + } } }) diff --git a/app/views/origami/unionpay/index.html.erb b/app/views/origami/unionpay/index.html.erb index 250f97d1..73b7001c 100755 --- a/app/views/origami/unionpay/index.html.erb +++ b/app/views/origami/unionpay/index.html.erb @@ -202,7 +202,6 @@ var receipt_no = "<%= @receipt_no %>"; $("#reference_no_Err").html(""); - if(reference_no.length > 0){ if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ $(this).off("click"); //start member discount 5% by pay card @@ -250,8 +249,5 @@ swal ( "Oops" , "Enter Amount!" , "error" ); } } - }else{ - $("#reference_no_Err").html("can't be blank"); - } }) diff --git a/app/views/origami/visa/index.html.erb b/app/views/origami/visa/index.html.erb index 52d14c4b..a03a886b 100755 --- a/app/views/origami/visa/index.html.erb +++ b/app/views/origami/visa/index.html.erb @@ -201,9 +201,8 @@ var receipt_no = "<%= @receipt_no %>"; console.log(amount); console.log($("#validamount").attr("value")); - $("#reference_no_Err").html(""); - if(reference_no.length > 0){ - if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + $("#reference_no_Err").html(""); + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ $(this).off("click"); //start member discount 5% by pay card // var sub_total = $('#sub-total').text(); @@ -244,14 +243,11 @@ }); } }else{ - if (amount>0) { - swal ( "Oops" , "Paid Amount is over!" , "error" ); - }else{ - swal ( "Oops" , "Enter Amount!" , "error" ); - } + if (amount>0) { + swal ( "Oops" , "Paid Amount is over!" , "error" ); + }else{ + swal ( "Oops" , "Enter Amount!" , "error" ); } - }else{ - $("#reference_no_Err").html("can't be blank"); } }); From e3b2fee46e5a4eb418442e79a867ea3ad158d530 Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Wed, 2 May 2018 15:10:58 +0630 Subject: [PATCH 2/6] Change table view in OQS --- app/assets/javascripts/OQS.js | 22 +++++++++-- app/assets/javascripts/custom.js | 10 +++++ app/controllers/oqs/backhome_controller.rb | 1 + app/controllers/oqs/home_controller.rb | 6 +-- app/views/oqs/home/index.html.erb | 46 ++++++++++++++++------ 5 files changed, 67 insertions(+), 18 deletions(-) diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index 1409c829..5e866699 100755 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -33,9 +33,25 @@ $(document).on('turbolinks:load', function() { $(".tables").on("click", function(){ - var table_id = $(this).val(); - $('#table_id').val(table_id); - oqs_id = $("#oqs_id").val(); + active = $(this).hasClass('selected-table'); + if (active) { + $(this).removeClass('bg-blue'); + $(this).addClass('green'); + $(this).removeClass('selected-table'); + }else{ + $(this).removeClass('green'); + $(this).addClass('bg-blue'); + $(this).addClass('selected-table'); + } + var list = document.getElementsByClassName('selected-table'); + var i; + var table_id =[]; + for (i = 0; i < list.length; i++) { + table_id.push(list[i].value); + } + $('#table_id').val(table_id); + + oqs_id = $("#oqs_id").val(); if (table_id){ var table = table_id }else{ diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index 043fbb03..ca1bd0b9 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -13,6 +13,16 @@ $(document).ready(function() { touchScrollStep : 50 }); + $('#table-slimscroll').slimScroll({ + height: height, + size: '5px', + color: 'rgba(0,0,0,0.5)', + alwaysVisible: false, + borderRadius: '0', + railBorderRadius: '0', + touchScrollStep : 50 + }); + $('#order-detail-slimscroll').slimScroll({ height: height-$('#order-detail-slimscroll').attr('data-height'), size: '5px', diff --git a/app/controllers/oqs/backhome_controller.rb b/app/controllers/oqs/backhome_controller.rb index 4ac5f0a2..f809ef9f 100755 --- a/app/controllers/oqs/backhome_controller.rb +++ b/app/controllers/oqs/backhome_controller.rb @@ -89,6 +89,7 @@ class Oqs::HomeController < BaseOqsController # Query for OQS with delivery status def queue_items_query(status) + byebug AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at") .joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id diff --git a/app/controllers/oqs/home_controller.rb b/app/controllers/oqs/home_controller.rb index 23d6341e..c39de390 100755 --- a/app/controllers/oqs/home_controller.rb +++ b/app/controllers/oqs/home_controller.rb @@ -161,9 +161,9 @@ class Oqs::HomeController < BaseOqsController oqs = "and assigned_order_items.order_queue_station_id = '#{oqs_id}' " end - if table_id.to_i>0 - table = "and df.id = '#{table_id}' " - + if !table_id.empty? + tableId = table_id.to_a.map{|h| h}.join(",") + table = "and df.id IN (#{tableId})" else table = '' end diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index ee73d560..ee786127 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -1,9 +1,10 @@
-
+
-
+
+
-
- - -
+
+ +
+
+
+ +
+
+ <% @tables.each do |table| %> +
+ +
+ <% end %> +
+
+ <% @rooms.each do |room| %> +
+ +
+ <% end %> +
+
+
+
+
+

@@ -168,4 +188,6 @@ window.location.href = '/dashboard'; }); }); + document.getElementById("defaultOpen").click(); + From bd078fc6755ddceb4d53796c05cb2786d116e191 Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Wed, 2 May 2018 16:00:19 +0630 Subject: [PATCH 3/6] Edit in customer of Tax Profile --- app/controllers/crm/customers_controller.rb | 2 +- app/controllers/origami/customers_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 3082687b..1d0ad8e4 100755 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -39,7 +39,7 @@ class Crm::CustomersController < BaseCrmController @membership_types = Lookup.collection_of("member_group_type") - @taxes = TaxProfile.all.order("order_by asc") + @taxes = TaxProfile.where(:group_type => 'cashier') @filter = filter diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index 537703a1..ec559870 100755 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -86,7 +86,7 @@ class Origami::CustomersController < BaseOrigamiController @crm_customer = Customer.new @count_customer = Customer.count_customer - @taxes = TaxProfile.all.order("order_by asc") + @taxes = TaxProfile.where(:group_type => 'cashier') # if flash["errors"] # @crm_customer.valid? # end From caa0180e8cc3b73086e73cc52812e1d669273f68 Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Wed, 2 May 2018 17:55:53 +0630 Subject: [PATCH 4/6] Edit UI design and table in OQS --- app/assets/stylesheets/OQS.scss | 16 ++++ app/controllers/oqs/home_controller.rb | 3 +- app/views/oqs/home/index.html.erb | 123 ++++++++++++------------- 3 files changed, 78 insertions(+), 64 deletions(-) diff --git a/app/assets/stylesheets/OQS.scss b/app/assets/stylesheets/OQS.scss index 88b00402..d66fcd1e 100755 --- a/app/assets/stylesheets/OQS.scss +++ b/app/assets/stylesheets/OQS.scss @@ -104,4 +104,20 @@ select.form-control { i.logout_icon{ position: relative; top: 5px; +} + +.table-block{ + padding: 24px 8px 0 0; +} + +.label-align{ + padding-left: 10px; +} + +.table-float{ + float: left; +} + +.table-width{ + width: 100%; } \ No newline at end of file diff --git a/app/controllers/oqs/home_controller.rb b/app/controllers/oqs/home_controller.rb index c39de390..48e686b6 100755 --- a/app/controllers/oqs/home_controller.rb +++ b/app/controllers/oqs/home_controller.rb @@ -5,7 +5,8 @@ class Oqs::HomeController < BaseOqsController # @queue_items_details = queue_items_query(false) # Query for OQS with delivery status true - @tables = DiningFacility.all.active.order('status desc') + # @tables = DiningFacility.all.active.order('status desc') + @tables = DiningFacility.where(:type => 'Table').order('status desc') @rooms = Room.all.active.order('status desc') @filter = params[:filter] diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index ee786127..fe7f4b4e 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -3,8 +3,8 @@
-
- +
+ " id="server_mode"> + + \ No newline at end of file diff --git a/app/views/origami/paymal/index.html.erb b/app/views/origami/paymal/index.html.erb index 6818fbad..df5464dd 100644 --- a/app/views/origami/paymal/index.html.erb +++ b/app/views/origami/paymal/index.html.erb @@ -281,7 +281,7 @@ }); }else{ - swal ( "Information" , result.message); + swal ( "Opps",result.message ,"warning" ); } } }); @@ -328,7 +328,6 @@ var payment_amount = parseFloat($("#used_amount").text()); setTimeout(function(){ code=getQRCode(); - alert(code) if(sale_id != 0 && code != ""){ $.ajax({ type: "POST", @@ -345,7 +344,6 @@ url: "<%=origami_payment_paymal_path%>", data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code}, success: function(result){ - alert(result) if(result.status == true){ swal({ title: "Information!", @@ -359,7 +357,7 @@ }); }else{ - swal ( "Information" , result.message); + swal ( "Opps",result.message ,"warning" ); } } }); diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 100b1425..d1a9eef4 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -530,7 +530,6 @@ var customer_name = "<%= @customer.name %>"; } else{ $("#credit_payment").show(); } -console.log(jQuery.inArray("Master", payment_type)) if(parseInt(jQuery.inArray("MPU", payment_type)) != -1 || parseInt(jQuery.inArray("VISA", payment_type)) != -1 || parseInt(jQuery.inArray("JCB", payment_type)) != -1 || @@ -1020,7 +1019,7 @@ console.log(jQuery.inArray("Master", payment_type)) $.ajax({ type: "POST", url: "/origami/" + sale_id + "/member_discount", - data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card }, + data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':cashier_type }, async: false, success:function(result){ } diff --git a/app/views/print_settings/_form.html.erb b/app/views/print_settings/_form.html.erb index ae1f90c1..e07da111 100755 --- a/app/views/print_settings/_form.html.erb +++ b/app/views/print_settings/_form.html.erb @@ -16,7 +16,7 @@ <% if(@server_mode != 'cloud') %> <%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %> <% else %> - <%= f.input :printer_name, :as => :select, :collection => [] %> + <%= f.input :printer_name %> <% end %> <%= f.input :brand_name %> <%= f.input :printer_type %> diff --git a/app/views/reports/order_reservation/_shift_sale_report_filter.html.erb b/app/views/reports/order_reservation/_shift_sale_report_filter.html.erb new file mode 100755 index 00000000..a1db6824 --- /dev/null +++ b/app/views/reports/order_reservation/_shift_sale_report_filter.html.erb @@ -0,0 +1,128 @@ +
+ <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> + <% if period_type != false %> +
+
+ + +
+ <% if defined? payments %> +
+ + <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %> +
+ <% end %> +
+ + + +
+
+ + +
+
+ + +
+
+
+ +
+
+ <% end %> + + <% end %> +
+ + diff --git a/app/views/reports/order_reservation/index.html.erb b/app/views/reports/order_reservation/index.html.erb new file mode 100755 index 00000000..567b056b --- /dev/null +++ b/app/views/reports/order_reservation/index.html.erb @@ -0,0 +1,248 @@ + +
+
+ + + <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %> +
+ + + + + + + + +
+
+ + + + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> + + + + + + + <% @tax_profiles.each do |tax| %> + + <% end %> + + + + + + + + <% if @print_settings.precision.to_i > 0 + precision = @print_settings.precision + else + precision = 0 + end + #check delimiter + if @print_settings.delimiter + delimiter = "," + else + delimiter = "" + end + + puts precision + puts "predelidm" + puts delimiter %> + + <% grand_total = 0 %> + <% old_grand_total = 0 %> + <% total_tax = 0 %> + <% guest_count = 0 %> + <% total_sum = 0 %> + <% discount_amt = 0 %> + <% other_amt = 0 %> + <% total_nett = 0 %> + <% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %> + <%if @sale_data %> + <% @sale_data.each do |result| %> + + <% grand_total = grand_total.to_f + result.grand_total.to_f %> + <% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %> + <% total_tax += result.total_tax.to_f %> + <% total_sum += result.total_amount.to_f %> + <% discount_amt += result.total_discount.to_f %> + <% rounding_adj += result.rounding_adjustment.to_f %> + + + + + + + + <%if result.customer.customer_type == "Takeaway"%> + + <%end%> + <% result.sale_taxes.each do |tax| %> + + <%end%> + + + + + + + <% end %> + + + + + <% @sale_taxes.each do |tax| %> + + <% end %> + + + + + + + + + + <% @tax_profiles.each do |tax| %> + + <% end %> + + + + + <%end%> + +
<%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
<%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
<%= t("views.right_panel.detail.receipt_no") %><%= t :cashier %> <%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> <%= tax.name %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
+ <%= t("views.right_panel.detail.rnd_adj_sh") %> +
<%= result.receipt_no rescue '-' %> <%= result.cashier_name rescue '-' %><%= number_with_precision(result.total_amount, precision: precision.to_i ,delimiter: delimiter) %><%= number_with_precision(result.total_discount, precision: precision.to_i ,delimiter: delimiter) %><%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %><%= number_with_precision(tax.tax_payable_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %><%= number_with_precision(result.grand_total, precision: precision.to_i ,delimiter: delimiter) %><%= result.rounding_adjustment.to_f rescue '-' %><%= number_with_precision(result.grand_total_after_rounding(), precision: precision.to_i ,delimiter: delimiter) rescue '-' %>
 <%= number_with_precision(total_sum, precision: precision.to_i ,delimiter: delimiter) rescue '-' %><%= number_with_precision(discount_amt, precision: precision.to_i ,delimiter: delimiter) rescue '-' %><%= number_with_precision(tax.st_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %><%= number_with_precision(grand_total.to_f, precision: precision.to_i ,delimiter: delimiter) rescue '-' %><%= rounding_adj.to_f rescue '-' %><%= number_with_precision(grand_total.to_f.round + rounding_adj, precision: precision.to_i ,delimiter: delimiter) %>
 <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %><%= tax.name %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
+ <%= t("views.right_panel.detail.rnd_adj_sh") %> +
+
+
+
+
+ + \ No newline at end of file diff --git a/app/views/reports/order_reservation/index.xls.erb b/app/views/reports/order_reservation/index.xls.erb new file mode 100755 index 00000000..c8521b0d --- /dev/null +++ b/app/views/reports/order_reservation/index.xls.erb @@ -0,0 +1,106 @@ + +
+
+
+
+ + + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> + + + + + + + <% @tax_profiles.each do |tax| %> + + <% end %> + + + + + + + + <% grand_total = 0 %> + <% old_grand_total = 0 %> + <% total_tax = 0 %> + <% guest_count = 0 %> + <% total_sum = 0 %> + <% discount_amt = 0 %> + <% other_amt = 0 %> + <% total_nett = 0 %> + <% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %> + <%if @sale_data %> + <% @sale_data.each do |result| %> + + <% grand_total = grand_total.to_f + result.grand_total.to_f %> + <% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %> + <% total_tax += result.total_tax.to_f %> + <% total_sum += result.total_amount.to_f %> + <% discount_amt += result.total_discount.to_f %> + <% rounding_adj += result.rounding_adjustment.to_f %> + + + + + + + + <%if result.customer.customer_type == "Takeaway"%> + + <%end%> + <% result.sale_taxes.each do |tax| %> + + <%end%> + + + + + + + <% end %> + + + + + <% @sale_taxes.each do |tax| %> + + <% end %> + + + + + + + + + + <% @tax_profiles.each do |tax| %> + + <% end %> + + + + + <%end%> + +
<%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
<%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
<%= t("views.right_panel.detail.receipt_no") %><%= t :cashier %> <%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> <%= tax.name %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
+ <%= t("views.right_panel.detail.rnd_adj_sh") %> +
<%= result.receipt_no rescue '-' %> <%= result.cashier_name rescue '-' %><%= result.total_amount rescue '-' %><%= result.total_discount rescue '-' %>0.0<%= tax.tax_payable_amount rescue '-' %><%= result.grand_total %><%= result.rounding_adjustment.to_f rescue '-' %><%= result.grand_total_after_rounding() rescue '-'%>
 <%= total_sum rescue '-'%><%= discount_amt rescue '-'%><%= tax.st_amount.round(2) %><%= grand_total.to_f.round(2) rescue '-'%><%= rounding_adj rescue '-'%><%= grand_total.to_f.round + rounding_adj %>
 <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %><%= tax.name %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
+ <%= t("views.right_panel.detail.rnd_adj_sh") %> +
+
+
+
+
\ No newline at end of file diff --git a/config/initializers/mysql2_adapter.rb b/config/initializers/mysql2_adapter.rb index 6a8e43fa..11b20b0f 100755 --- a/config/initializers/mysql2_adapter.rb +++ b/config/initializers/mysql2_adapter.rb @@ -24,7 +24,7 @@ module ActiveRecord end client = Mysql2::Client.new(config.symbolize_keys) - options = [config[:host], config[:username], config[:password], config[:database], config[:port], config[:socket], config[:wait_timeout], 0] + options = [config[:host], config[:username], config[:password], config[:database], config[:port], config[:socket], config[:pool], config[:wait_timeout], 0] ConnectionAdapters::Mysql2Adapter.new(client, logger, options, config) end end diff --git a/config/routes.rb b/config/routes.rb index 30b78fd9..760ee999 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -436,6 +436,7 @@ scope "(:locale)", locale: /en|mm/ do resources :stock_check, :only => [:index, :show] resources :payment_method resources :product_sale, :only => [:index, :show] + resources :order_reservation, :only => [:index, :show] get "saleitem/get_shift_by_date", to: "saleitem#show", as: "get_shift_by_sale_item" get "receipt_no/get_shift_by_date", to: "receipt_no#get_shift_by_date", as: "get_shift_by_date" diff --git a/config/secrets.yml b/config/secrets.yml index b0d7c5c8..2768d134 100755 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -12,8 +12,8 @@ development: secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61 - sx_provision_url: https://connect.pos-myanmar.com/bensai/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api - server_mode: cloud + sx_provision_url: connect.pos-myanmar.com/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api + server_mode: application cipher_type: AES-256-CBC sx_key: Wh@t1$C2L @@ -24,7 +24,7 @@ test: # instead read values from the environment. production: secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22 - sx_provision_url: https://connect.pos-myanmar.com/api #192.168.1.147:3002/api + sx_provision_url: connect.pos-myanmar.com/api #192.168.1.147:3002/api server_mode: application cipher_type: AES-256-CBC sx_key: Wh@t1$C2L diff --git a/db/migrate/20180406080240_create_order_reservations.rb b/db/migrate/20180406080240_create_order_reservations.rb index 740ce6f1..b96b92ca 100644 --- a/db/migrate/20180406080240_create_order_reservations.rb +++ b/db/migrate/20180406080240_create_order_reservations.rb @@ -13,9 +13,11 @@ class CreateOrderReservations < ActiveRecord::Migration[5.1] t.string :payment_type t.string :payment_status t.string :payment_ref + t.json :taxes t.decimal :total_amount, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :total_tax, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :discount_amount, :precision => 10, :scale => 2, :null => false, :default => 0.00 + t.decimal :convenience_charge, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :grand_total, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.string :status, :null => false, :default => "new" t.string :order_remark diff --git a/lib/tasks/clear_data.rake b/lib/tasks/clear_data.rake index cd4fec49..6e556c52 100755 --- a/lib/tasks/clear_data.rake +++ b/lib/tasks/clear_data.rake @@ -20,6 +20,9 @@ namespace :clear do SeedGenerator.where("id > 1").update(:current => 0, :next => 0) Receipt.delete_all ReceiptDetail.delete_all + OrderReservation.delete_all + OrderReservationItem.delete_all + Delivery.delete_all puts "Clear Data Done." end diff --git a/public/menus/Main Menu.xlsx b/public/menus/Main Menu.xlsx deleted file mode 100644 index 2987ce8986a0cb975aca8635c3972fecdc96eca0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4585 zcmaJ_2{cr18y^N)B5TQ(q-?`ji!jNSC3}`^WsF^x!PvJ@5ff7klO_Akge=)*3u8(4 z#=Z=avJIiW>HB}@>z{8q_q_ML?>YDPoZs`j&wZcYbM>`>6s!OMfEv&ub@8*Utjos< z(&{ET06<5Y@4@X{y})9>?xmUneUjKXK`GuOmTwkNQ> zYETRZLLI3Yl)aIJ0ofT~IHXJVsO)wNQw;AC$qC%?;~SG>VRskB2tu2$^JRfw^9J4uK;#se@9NE~c_k z(Lbg%1V6_8aQ6SaAX(GoR8p+s@7X<@+NnN*Ru3yqbckg}Ka$=2d8K|REVrM1MK5W| zRHD?E+R`dK^_l2dC9fhbm1xv+8hLx^@M@9SfqZYE-=~b}PCVQ8O?%e4W~074kuQxI z%*Pr+9Xrxj@%pN#*w*{X*2E0J;tW3Rjo2>fR>~z@q@a8nWXp%$3yI%e$00<)^o%6nyVo}&ndK^jxAwvWWx{VLq`ew>$7X^a;Za1 z4K${6FK)vw?5O%!nR@rO(;pfg9c&#XHDO#hv#`vJ;6&Jmh$p2hS? zV>j5OmyaaHY@Re2{~kLV5077=OGCbP{U-H1XZ4;qU$y_!fdx^}HuP&~8xOMo*q6LOlmzjl>V5bVZLvNRwC98t<$fhw>(F7m*>TGt#S6jhobLH1tFaQOQE?*ef41cBZqDX zzWZL;bmNJA-{&g5{FcNSP1<)3(o8y({yLd`-Qg}!cXyXx4*YdW$Lr9w{W_(8#G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L0OH zd^RidrSQGXk)=Or&koS0)ofDryCq z|J?(TuOEP{mw;!{$6r5mM3g|v*5UZ~zkt-_>8D155=vRvoj{+ERp1|G9wnTzvN?eh zXn%nJr_P~7Q`QzIXf)mbt28L>P-g5CJNN1TYyPG*K$)IS3=kRqy^$Z26(yKb=1;&Q qjDLgwpXgH>q}1ROgNZ;&gC~k?Vn|1J761T}A0u)fNqyWz0{#VO$fpzl From 66a1d0bdad21d2ce71e785dc5eee0cc2bcc4dac0 Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Thu, 3 May 2018 10:27:04 +0630 Subject: [PATCH 6/6] Edit button color effect --- app/assets/stylesheets/OQS.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/OQS.scss b/app/assets/stylesheets/OQS.scss index d66fcd1e..6a97bdcb 100755 --- a/app/assets/stylesheets/OQS.scss +++ b/app/assets/stylesheets/OQS.scss @@ -87,7 +87,7 @@ select.form-control { } .green{ - background-color: #009900; + background-color: #009900 !important; } .left{ margin-left:1px;