From 9df975db1c3df81f1a13018bf1367d2e2ea101b9 Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Wed, 13 Jun 2018 11:18:32 +0630 Subject: [PATCH 1/2] Modified reprint color and click event --- .../pending_order/completed_sale.html.erb | 30 +++++++++---------- app/views/origami/sales/show.html.erb | 20 +++++++++++-- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/app/views/origami/pending_order/completed_sale.html.erb b/app/views/origami/pending_order/completed_sale.html.erb index 821414b3..1b7194f5 100644 --- a/app/views/origami/pending_order/completed_sale.html.erb +++ b/app/views/origami/pending_order/completed_sale.html.erb @@ -174,7 +174,7 @@ <% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %> <% if current_user.role == "cashier" %> Void - Re.Print + Re.Print <% else %> - + <% end %> <% end %> @@ -369,6 +369,22 @@ $(document).ready(function(){ }) }); +$('#reprint').on('click', function () { + var sale_id = $('#sale_id').val(); + var ajax_url = '/origami/'+ sale_id + "/reprint" + + $.ajax({ + type: "GET", + url: ajax_url, + success: function (result) { + if ($("#server_mode").val() == "cloud") { + code2lab.printFile(result.filepath.substr(6), result.printer_url); + } + location.reload(); + } + }); + }); + $('#pay').on('click',function() { var sale_id = $('#sale_id').val(); window.location.href = '/origami/sale/'+ sale_id + "/payment"; From 223a84ec67ab9016c643fdf2b0f29278d91ccf0f Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Wed, 13 Jun 2018 11:19:52 +0630 Subject: [PATCH 2/2] =?UTF-8?q?Pull=20from=20master=E1=80=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/addorder.js | 8 ++++---- app/views/origami/addorders/detail.html.erb | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index a9bd453a..07af7f41 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -6,8 +6,8 @@ $(function() { //click menu sidebar menu category $(".product").on("click", function(){ - // /var url = $(this).attr('data-ref'); - // /show_product_list(url); + var url = $(this).attr('data-ref'); + show_product_list(url); }); //show menu item list when click menu category function show_product_list(url_item){ @@ -43,7 +43,7 @@ $(function() { options = []; item_attributes = []; - if (product[field].image_path) { + if (product[field].image_path.url) { if (type != -1 && modify_order != -1) { image_path = '../../'+product[field].image_path.url; } @@ -74,7 +74,7 @@ $(function() { +'' +'' - +"
' + // +'Products' + // +''; + // $(".category_cache_list").append(row); + for(var i in menus) { if (menu_id == menus[i]["id"] && menus[i]["is_active"] == true) {