From 122c4b72fd000449f4f474f5b2bc8cbbe3069675 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 31 Aug 2017 13:47:55 +0630 Subject: [PATCH 01/50] updat --- public/image/menu_images/images__4_.jpg | Bin 0 -> 11463 bytes public/image/menu_images/images__5_.jpg | Bin 0 -> 14333 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 public/image/menu_images/images__4_.jpg create mode 100644 public/image/menu_images/images__5_.jpg diff --git a/public/image/menu_images/images__4_.jpg b/public/image/menu_images/images__4_.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d47dafb7786f2b85029a0cf301e61c1fc6fa0e6f GIT binary patch literal 11463 zcmZv>bx<5U_$|D+6^;9lP7b|$>fhDPo7twcK{@sY7jL58X5qA_OAe*zXD9N@@mLIvQ#!25M>sW?EWiE@o<4PC6=T7BCAtH?M$z05y|{qzJzR z7ry{68a_Tg5g`#R2?-rP2QvphKfmDrU;j1#2mWXD|B2^804Xk@5=|HbjTL}SiiSao z_B;xp2LRB~G5*Ku{{|)&1~vc<9S8ScREy+a4-*pu6B`>F2OH<#6f|^F00t%t77(mx zVC#d;8ks>R3@vTFU{mrPn%gC(u!EQF;ZTZ1mCs+Q82UwL?kgMFJG2ci{3D}91N`4g z|H%GvVPXG^@sa+sfrg2Ofq{vR@&7sbr-XqCWC0tHu__ANMq>G7l#;jp(|BG7yukQJ zMT$WRkOwqC**}cBR-5K&D)-V_Zt-qc)hm?Eb(+**&%E6NjO3l9ryFhk`IUtFCgq2* zY+M`YJ1n84U8cy~JTD~2i!xNcN^VmcN4ydjCMvLTwt48wUwP1$;`vOiW{=b>MS?` z1|!^_zDiIi2h#!oTMvIO#IzTa(awDi>^mCS%^%C8*Ld(|w5n@jrZ}m)_%?Z!E;lXG z(RFhn&X@BvWp?DaCNWCAVz@+_n%6G*?eF{-T+pq2p&>{7H$k3(ON|uVRqhL?_L?Gm zMoHZMnVxB+Bz6v5v79Tk*CbWVw2B%UhDK->DWAHnrH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QPlJCcvM z&CZkFoQX)0PnT%s9Vh{yg z{gq!BJm)b?2%97B|7SDEBb~X2CLi|iBJ$Ysqk-_3oVw>l_ZtrQDlJkyXft{hE5D?| zYQ7Z%phmd)1FcVU85!dB?CYfyCvB!j18Yya*e};^KNCO-05&*t{nqw~uRmNZEkm0%eY^(#C5_5c@K&7C+Z=TTp1}{1| M=&3ORBA(a&7xTUE$^ZZW literal 0 HcmV?d00001 diff --git a/public/image/menu_images/images__5_.jpg b/public/image/menu_images/images__5_.jpg new file mode 100644 index 0000000000000000000000000000000000000000..08eb6859145715691df413b01f26facc4669db3b GIT binary patch literal 14333 zcmb7KV{jc%x4khM+cs{j+t{|z*txOQSWOz6josL2)ZoTuW7}x(`n@;r&-?fGnK^&X znRV8gJ+o)+HTz@vV+(*GFD)kxfPw-5p#Cku#~L6EfCP_#jfI7ajg5_mhl`I-Kuqv2 z@X7vXCndngCnX?dpdcWkCB`S93xcYOQ;U?Ku~p%7u9Fagk*P%xNKAAOWNfH(=qQVc?+v2>%X6F#ym| z(6BJ@FmUj2urUAm4>TqK1{RBw15Qj09-GS4C73huhj@M8%oUEhnd|m70yS4i5-v?c zKc3r-#(&_U{x3Wf3;-Gy4*oyzT>p4LL&5xe?tj4lG5Cl7-|%8^*lJXq|KJmG#DC0O z)%R^*Q*)_He5?Xc{?Yh%2@@a!n1sUzr+!{!P;liP1t;bY2sAqvxmH>Zw-a5|Vp zTQJdK;l9RVb<^l=>P28~=;3b?bFJ$Oi?(6H-e`v2FWBS${daKUHbGHKh5d69iKZ9USlUQ3tS0FGQ0&=^Cw1-CgFQ zK62|5sDC2-lk=3VAmYIi6_Vwl&EkVxcLnexFY~>kx!T~GAaxtfvnnu+S-1HZgp7)T?ORm z)GWN~9H2#F+uw@iL&XE{2y`ye+VTc(Qe z?N`j)^llehxe!?vnM}3&MgQ{R4uXcK2%dgVyC;0}#)xl9IT-4@0|p!d=_V8x1ai}^ zoOt&Hg%6v;-zqYvgdJlN3j;@28{e%sUk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Su}1HFP#i#u#?<|LBK4&;tt7=BOQ^G1e2 zb!1qjh_sr}fu%NG zZGWL`Z*YF%G&>@;(ttBgp92^J{rxEOBLbGmM819LppyL(V!kx>$F6Zgfaxew0*C6d z3c4k^f;+3>Jh??C6(?v#BeP%u&oGfu9RfsN4sM?+6YIZ72jHxV`li|U*tqITbVs%#LZ%yQ&4%swG1A55Z zZIO*&!o?7=X)!_Kn=OE)G9k}JtRR=qP7OJ0Z=pOaWV!(hY09o9;o6x=D zwF-wAiAwaA$NNTn&}q6#O?onkVH%s!;`96wcFc;3K4Wkd-DOrNm6W}Z4V_-GoJ?y8 zUY{h<7LIxYZu9IK@@E^N82Rs3cAHdGte)IBo^=UOaav6h6V_&SH4)KV!DX}I7{?@| zL0=8aG15%9iRYoM!~5O;R?dF{5fu>bO5%t Date: Fri, 1 Sep 2017 09:40:50 +0630 Subject: [PATCH 02/50] Update --- dump.rdb | Bin 777 -> 777 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dump.rdb b/dump.rdb index c92644232990e62aed0295b08f00a1ce8d263f35..0d22b51fd1d80209ebb112324c3d28de42fd095e 100644 GIT binary patch delta 73 zcmV-P0Ji^$28jlcFc`4fr&;<4b#rB8Ep26O!XV%k0R8~`5do8q0vWMk8vz52Bd?Qx f0WS Date: Fri, 1 Sep 2017 16:03:55 +0630 Subject: [PATCH 03/50] update item edit --- app/controllers/origami/sale_edit_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/origami/sale_edit_controller.rb b/app/controllers/origami/sale_edit_controller.rb index 900b0431..939e1cbf 100644 --- a/app/controllers/origami/sale_edit_controller.rb +++ b/app/controllers/origami/sale_edit_controller.rb @@ -77,7 +77,9 @@ class Origami::SaleEditController < BaseOrigamiController saleitemObj.unit_price = update_price saleitemObj.taxable_price = update_qty.to_f * update_price.to_f # saleitemObj.remark = 'edit' - saleitemObj.product_name = saleitemObj.product_name + " - updated" + if !saleitemObj.product_name.include? "updated" + saleitemObj.product_name = saleitemObj.product_name + " - updated" + end saleitemObj.save # re-calc tax From fc5192157b0979c3a8505d3b565c62a4848b0473 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 1 Sep 2017 16:55:51 +0630 Subject: [PATCH 04/50] update --- app/assets/javascripts/addorder.js | 5 ++- app/assets/javascripts/cable.js | 10 ++--- .../channels/order_queue_station.js | 45 ++++++++++--------- app/channels/application_cable/channel.rb | 2 +- app/channels/application_cable/connection.rb | 3 ++ app/channels/order_queue_station_channel.rb | 1 + app/jobs/order_queue_processor_job.rb | 6 ++- app/views/oqs/home/index.html.erb | 3 ++ config/cable.yml | 12 +++-- config/environments/development.rb | 4 +- config/routes.rb | 2 +- 11 files changed, 55 insertions(+), 38 deletions(-) diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 095ae4e0..a27b4afd 100644 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -276,6 +276,7 @@ $(function(){ disabled = "" status =""; + if(parseInt(jQuery.inArray(value[i], selected_item))!== -1){ status = "selected-attribute"; } @@ -417,7 +418,7 @@ $(function(){ }); //End Add Icon Click function show_item_detail(data){ - console.log(data) + qty = parseInt(data.attr('data-qty')); append = 0; price = parseFloat(data.attr('data-price')).toFixed(2); @@ -599,7 +600,7 @@ $(function(){ var item_row = $('.summary-items tbody tr'); $(item_row).each(function(i){ var order_item = {}; - console.log($(item_row[i]).attr('data-options')); + order_item.order_item_id = $(item_row[i]).attr('data-row'); order_item.item_instance_code = $(item_row[i]).attr('data-instance-code'); order_item.quantity = $(item_row[i]).children('#item_qty').text(); diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js index ce5ac871..55bfd46b 100644 --- a/app/assets/javascripts/cable.js +++ b/app/assets/javascripts/cable.js @@ -1,14 +1,14 @@ // Action Cable provides the framework to deal with WebSockets in Rails. // You can generate new channels where WebSocket features live using the `rails generate channel` command. -// + //= require action_cable //= require_self //= require_tree ./channels // Temp Disable -// (function() { -// this.App || (this.App = {}); +(function() { + this.App || (this.App = {}); -// App.cable = ActionCable.createConsumer(); + App.cable = ActionCable.createConsumer(); -// }).call(this); +}).call(this); diff --git a/app/assets/javascripts/channels/order_queue_station.js b/app/assets/javascripts/channels/order_queue_station.js index 85706bb5..79708e36 100644 --- a/app/assets/javascripts/channels/order_queue_station.js +++ b/app/assets/javascripts/channels/order_queue_station.js @@ -1,24 +1,29 @@ -// App.order_queue_station = App.cable.subscriptions.create("OrderQueueStationChannel", { -// connected: function() {}, +App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChannel', { +// App.messages = App.cable.subscriptions.create('MessagesChannel', { -// disconnected: function() {}, + connected: function() {}, -// received: function(message) { -// alert(message); -// }, + disconnected: function() {}, -// order: function(message) { -// return this.perform('order', { -// message: message -// }); -// } -// }); + received: function(data) { + console.log(data); + alert(data); + console.log("hiiiiiiiiiiii"); + $('#test').append(data); + }, -// $(function(){ -// $("#submit_order").on('click', function(event) { -// var orderData=$("#new_order").serializeObject(); -// App.order_station.order(orderData); -// //orderData=''; -// return event.preventDefault(); -// }); -// }); + order: function(message) { + return this.perform('order', { + message: message + }); + } +}); + +$(function(){ + $("#submit_order").on('click', function(event) { + var orderData=$("#new_order").serializeObject(); + App.order_station.order(orderData); + //orderData=''; + return event.preventDefault(); + }); +}); diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb index a66bc071..a087eaec 100644 --- a/app/channels/application_cable/channel.rb +++ b/app/channels/application_cable/channel.rb @@ -7,7 +7,7 @@ module ApplicationCable end # Order Queue Station Channel - class OQSChannel < ActionCable::Channel::Base + class OrderQueueStationChannel < ActionCable::Channel::Base end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb index 0ff5442f..9da60bf4 100644 --- a/app/channels/application_cable/connection.rb +++ b/app/channels/application_cable/connection.rb @@ -1,4 +1,7 @@ module ApplicationCable class Connection < ActionCable::Connection::Base + def connect + logger.add_tags "ActionCable" + end end end diff --git a/app/channels/order_queue_station_channel.rb b/app/channels/order_queue_station_channel.rb index 8206c64b..b815a446 100644 --- a/app/channels/order_queue_station_channel.rb +++ b/app/channels/order_queue_station_channel.rb @@ -4,6 +4,7 @@ class OrderQueueStationChannel < ApplicationCable::Channel end def unsubscribed + stop_all_streams # Any cleanup needed when channel is unsubscribed end diff --git a/app/jobs/order_queue_processor_job.rb b/app/jobs/order_queue_processor_job.rb index 5b3423dc..4a6d2862 100644 --- a/app/jobs/order_queue_processor_job.rb +++ b/app/jobs/order_queue_processor_job.rb @@ -4,8 +4,9 @@ class OrderQueueProcessorJob < ApplicationJob def perform(order_id, table_id) # Do something later #Order ID - order = Order.find(order_id) + order = Order.find(order_id) + ActionCable.server.broadcast "order_queue_station_channel",message: order #Loop through the order stations and process the items #Execute orders and send to order stations if order @@ -13,5 +14,8 @@ class OrderQueueProcessorJob < ApplicationJob oqs.process_order(order, table_id) end + + + end end diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 824618e6..ca52292e 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -12,6 +12,9 @@ <% end %> +
+

+

diff --git a/config/cable.yml b/config/cable.yml index 0bbde6f7..a383c5af 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,9 +1,7 @@ -development: - adapter: async - -test: - adapter: async - -production: +redis: &redis adapter: redis url: redis://localhost:6379/1 + +production: *redis +development: *redis +test: *redis \ No newline at end of file diff --git a/config/environments/development.rb b/config/environments/development.rb index 4d8fc580..4c681ee6 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -45,6 +45,8 @@ Rails.application.configure do # Suppress logger output for asset requests. config.assets.quiet = true + config.web_console.whiny_requests = false + # Raises error for missing translations # config.action_view.raise_on_missing_translations = true @@ -53,5 +55,5 @@ Rails.application.configure do config.file_watcher = ActiveSupport::EventedFileUpdateChecker # Set Cable URL - # config.action_cable.url = "ws://192.168.1.140:3002/cable" + config.action_cable.url = "ws://192.168.1.39:3002/cable" end diff --git a/config/routes.rb b/config/routes.rb index 1efacd83..7b8f7ea4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,7 @@ Rails.application.routes.draw do mount Sidekiq::Web => '/kiq' # Action Cable Creation - # mount ActionCable.server => "/cable" + mount ActionCable.server => "/cable" #--------- SmartSales Installation ------------# get 'install' => 'install#index' From 2eaf89174847a6a9be5729d1df42ec832e5ef213 Mon Sep 17 00:00:00 2001 From: Phyo Date: Mon, 4 Sep 2017 10:22:54 +0630 Subject: [PATCH 05/50] Promotion multiple order --- app/models/promotion.rb | 34 ++++++++++++-------- app/views/settings/promotions/_form.html.erb | 30 ++++++++--------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/app/models/promotion.rb b/app/models/promotion.rb index dfab86e9..624818f1 100644 --- a/app/models/promotion.rb +++ b/app/models/promotion.rb @@ -28,8 +28,13 @@ class Promotion < ApplicationRecord end def self.combine_item(saleObj) - order_id = saleObj.sale_orders[0].order_id - itemList = OrderItem.where("order_id = ?", order_id).group(:item_instance_code).sum(:qty) + # order_id = saleObj.sale_orders[0].order_id + # itemList = OrderItem.where("order_id = ?", order_id).group(:item_instance_code).sum(:qty) + itemList = [] + saleObj.sale_orders.each do |so| + itemList << OrderItem.where("order_id = ?",so.order_id).group(:item_instance_code).sum(:qty) + end + return itemList end def self.is_promo_day(promoList, day, orderitemList, sale_id) @@ -46,13 +51,15 @@ class Promotion < ApplicationRecord def self.find_promo_item(promo, orderitem, sale_id) # item_code = OrderItem.find_by_item_instance_code(orderitem[0]).item_code - if promo.original_product.to_s == orderitem[0] - if promo.min_qty.to_i > orderitem[1].to_i - return false - else - check_promo_type(promo,orderitem, sale_id) - end - end + orderitem.each do |odr_item| + if promo.original_product.to_s == odr_item[0] + if promo.min_qty.to_i > odr_item[1].to_i + return false + else + check_promo_type(promo,odr_item, sale_id) + end + end + end end def self.check_promo_type(promo, orderitem, sale_id) @@ -126,7 +133,6 @@ class Promotion < ApplicationRecord # AA - 10 # 3 # BB # orderList, #S34345 def self.give_promotion_second_product(orderitem_count, foc_min_qty, promo_product, orderitem, sale_id) puts "..... orderitem_count: " + orderitem_count.to_s + " / foc_min_qty: " + foc_min_qty.to_s + " /promo_product: " + promo_product + " orderitem: " + orderitem.to_s - byebug promotion_qty = orderitem_count.to_i / foc_min_qty.to_i # get foc item qty foc_qty = find_second_item_qty(sale_id, promo_product) if (foc_qty < promotion_qty) @@ -212,9 +218,11 @@ class Promotion < ApplicationRecord saleObj = Sale.find_by_sale_id(sale_id) itemList = combine_item(saleObj) itemList.each do |item| - if item[0] == promo_item - return item[1] - end + item.each do |i| + if i[0] == promo_item + return i[1] + end + end end return 0 end diff --git a/app/views/settings/promotions/_form.html.erb b/app/views/settings/promotions/_form.html.erb index bea1f981..c832461d 100644 --- a/app/views/settings/promotions/_form.html.erb +++ b/app/views/settings/promotions/_form.html.erb @@ -41,16 +41,16 @@
- <%= f.hidden_field :promo_day, :value => "", :class => "form-control col-md-1" %> -
Sun
-
Mon
-
Tue
-
Wed
-
Thu
-
Fri
-
Sat
+ <%= f.hidden_field :promo_day, :value => "", :class => "form-control col-md-1" %> +
Sun
+
Mon
+
Tue
+
Wed
+
Thu
+
Fri
+
Sat
- +
<%= f.input :promo_type,input_html: { class: "" }, @@ -166,13 +166,13 @@ $(document).ready(function(){ var form = document.getElementById("new_promotion"); - var inputs = form.getElementsByTagName("input"); + var inputs = $("input"); var arr = []; var count = 0; var day = "["; - -$(".select").click(function() { - + +$(".selectDay").click(function() { + // debugger; day = "["; for (var j = 8; j <=15; j += 1){ @@ -192,8 +192,8 @@ $(".select").click(function() { } document.getElementById("promotion_promo_day").value = ''; document.getElementById("promotion_promo_day").value = day; - }); - + }); + $("#promotion_original_product").select2(); $(".item_code_place").select2(); $(".item_code_place").on('change', function(event) { From 98dae6d712d6ab7f0f80ffc58e4a18caf13b2c73 Mon Sep 17 00:00:00 2001 From: Zin Lin Phyo Date: Mon, 4 Sep 2017 10:24:24 +0630 Subject: [PATCH 06/50] show and update changes in commission and report --- .idea/workspace.xml | 482 ++++++++++-------- .../origami/sale_edit_controller.rb | 11 +- app/models/product_commission.rb | 32 +- .../load_commissioners.html.erb | 2 +- app/views/reports/commission/index.html.erb | 14 +- app/views/settings/commissions/_form.html.erb | 2 +- dump.rdb | Bin 777 -> 908 bytes 7 files changed, 306 insertions(+), 237 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0840cec0..7d13c01d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,13 @@ + + + + + + @@ -17,7 +23,7 @@ - + @@ -44,21 +50,11 @@ - + - - - - - - - - - - - - + + @@ -67,8 +63,18 @@ - - + + + + + + + + + + + + @@ -77,18 +83,68 @@ - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -129,8 +185,6 @@ @@ -204,10 +260,10 @@ - @@ -227,9 +283,6 @@ - - - @@ -291,6 +344,21 @@ + + + + + + + + + + + + + + + @@ -321,6 +389,9 @@ @@ -783,12 +779,12 @@ - + - @@ -810,7 +806,7 @@ - + @@ -879,39 +875,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -969,13 +937,6 @@ - - - - - - - @@ -990,20 +951,6 @@ - - - - - - - - - - - - - - @@ -1011,20 +958,6 @@ - - - - - - - - - - - - - - @@ -1069,13 +1002,6 @@ - - - - - - - @@ -1083,13 +1009,6 @@ - - - - - - - @@ -1190,14 +1109,6 @@ - - - - - - - - @@ -1222,14 +1133,6 @@ - - - - - - - - @@ -1248,8 +1151,114 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/controllers/origami/in_juties_controller.rb b/app/controllers/origami/in_juties_controller.rb index ff76d3b1..d78ef348 100644 --- a/app/controllers/origami/in_juties_controller.rb +++ b/app/controllers/origami/in_juties_controller.rb @@ -16,8 +16,7 @@ class Origami::InJutiesController < BaseOrigamiController # GET /in_juties/1 # GET /in_juties/1.json - def show - end + def show; end # GET /in_juties/new def new @@ -29,8 +28,7 @@ class Origami::InJutiesController < BaseOrigamiController end # GET /in_juties/1/edit - def edit - end + def edit; end def edit_in_juty @in_juty = InJuty.find(params[:id]) @@ -71,7 +69,7 @@ class Origami::InJutiesController < BaseOrigamiController out_time = out_time.change(offset: '+06:30') @in_juty = InJuty.new in_juty_id = in_juty[:id] - unless in_juty_id.nil? + unless in_juty_id.empty? @in_juty = InJuty.find(in_juty_id.to_i) end diff --git a/app/controllers/origami/product_commissions_controller.rb b/app/controllers/origami/product_commissions_controller.rb index ada68f59..74dd8095 100644 --- a/app/controllers/origami/product_commissions_controller.rb +++ b/app/controllers/origami/product_commissions_controller.rb @@ -1,4 +1,4 @@ -class Origami::ProductCommissionsController < ApplicationController +class Origami::ProductCommissionsController < BaseOrigamiController before_action :set_product_commission, only: [:show, :edit, :update, :destroy] # GET /product_commissions diff --git a/app/views/inventory/inventory_definitions/_form.html.erb b/app/views/inventory/inventory_definitions/_form.html.erb index 36b80822..66c073ad 100644 --- a/app/views/inventory/inventory_definitions/_form.html.erb +++ b/app/views/inventory/inventory_definitions/_form.html.erb @@ -4,6 +4,47 @@
<%= f.input :item_code %> + +
+ <% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %> + <% Product.order("name desc").pluck(:name,:item_code).each do |p| %> + <% arr.push(p) %> + <% end %> +
+ + + +
+ + <% sample = [] %> + <% if @inventory_definition.item_code.nil? %> + <% if !MenuItemInstance.find_by_item_instance_code(@inventory_definition.item_code).nil? %> + <% sample = MenuItemInstance.where("item_instance_code=?",@inventory_definition.item_code).pluck(:item_instance_name,:item_instance_code)%> + <% else %> + <% sample = Product.where("item_code=?",@inventory_definition.item_code).pluck(:name,:item_code)%> + <% end %> + <% end %> +
<%= f.input :item_code, collection: sample %>
+ +
<%= f.input :min_qty %>
+
+ <%= f.input :min_order_level %> <%= f.input :max_stock_level %>
diff --git a/app/views/origami/in_juties/_assign_in_juty.html.erb b/app/views/origami/in_juties/_assign_in_juty.html.erb index b6363195..21bf2e2d 100644 --- a/app/views/origami/in_juties/_assign_in_juty.html.erb +++ b/app/views/origami/in_juties/_assign_in_juty.html.erb @@ -4,22 +4,11 @@ <%= f.hidden_field :id, :class => "form-control col-md-6 " %>
- <%= f.hidden_field :dinning_id, :value => @table.id, :class => "form-control col-md-4 " %> - - - <%= @table.name %> -
-
- <%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %> -

- <%= f.input :in_time, :placeholder => "From Date", :class => "form-control" %> - <%= f.input :out_time, :placeholder => "To Date", :class => "form-control" %> -

diff --git a/app/views/origami/in_juties/_form.html.erb b/app/views/origami/in_juties/_form.html.erb index 9bed9152..61342d7b 100644 --- a/app/views/origami/in_juties/_form.html.erb +++ b/app/views/origami/in_juties/_form.html.erb @@ -4,22 +4,15 @@ <%= f.hidden_field :id, :class => "form-control col-md-6 " %>
- - <%= f.hidden_field :dinning_id, :value => @table.id, :class => "form-control col-md-4 " %> - <%= @table.name %> -
-
- +

+ <%= f.hidden_field :dinning_id, :value => @table.id, :class => "form-control col-md-4 " %> <%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %> -

- +
<%= f.input :in_time, :placeholder => "From Date", :class => "form-control" %> - <%= f.input :out_time, :placeholder => "To Date", :class => "form-control" %> -

diff --git a/app/views/origami/in_juties/index_in_juty.html.erb b/app/views/origami/in_juties/index_in_juty.html.erb index 52d79c89..421e8a7f 100644 --- a/app/views/origami/in_juties/index_in_juty.html.erb +++ b/app/views/origami/in_juties/index_in_juty.html.erb @@ -1,6 +1,10 @@
-
+
+ + <%= @table.name %> +
+ @@ -33,11 +37,11 @@
<%= render 'form', in_juty: @in_juty, table: @table %>
- -
-      - +
+ + +
\ No newline at end of file diff --git a/app/views/inventory/stock_checks/index.html.erb b/app/views/inventory/stock_checks/index.html.erb index 812d4409..a6d33204 100644 --- a/app/views/inventory/stock_checks/index.html.erb +++ b/app/views/inventory/stock_checks/index.html.erb @@ -7,17 +7,23 @@
- -
+ +

- Product + Item
- +

@@ -27,14 +33,14 @@ Qty
- +

- +
@@ -47,6 +53,7 @@ +
# Product Balance
@@ -54,49 +61,58 @@
- +
diff --git a/app/views/layouts/_header_inventory.html.erb b/app/views/layouts/_header_inventory.html.erb new file mode 100644 index 00000000..17a8e764 --- /dev/null +++ b/app/views/layouts/_header_inventory.html.erb @@ -0,0 +1,38 @@ +
+
+
+ Inventory - +
+
+ <% if current_login_employee %> + <%= current_login_employee.name %> | <%= link_to 'Logout', logout_path, method: :delete, data: { confirm: 'Are you sure?' } %> + <% end %> +
+
+
+ +
diff --git a/app/views/layouts/inventory.html.erb b/app/views/layouts/inventory.html.erb index d6bbf436..8982d546 100644 --- a/app/views/layouts/inventory.html.erb +++ b/app/views/layouts/inventory.html.erb @@ -9,14 +9,14 @@ SmartSales : Restaurant <%= csrf_meta_tags %> - <%= stylesheet_link_tag 'origami', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= stylesheet_link_tag 'inventory_definitions', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> <%= stylesheet_link_tag 'jquery-confirm', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'jquery-confirm', 'data-turbolinks-track': 'reload' %> - <%= render 'layouts/header_orgiami' %> + <%= render 'layouts/header_inventory' %>
<% flash.each do |type, message| %> <% if !flash["errors"]%> diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index adb297d1..66b8d4c0 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -32,3 +32,6 @@ Rails.application.config.assets.precompile += %w( jquery-confirm.js ) # --- Image Uploader ---- Rails.application.config.assets.precompile += %w( fileinput.min.js ) + +# --- Inventory Definition ---- +Rails.application.config.assets.precompile += %w( inventory_definitions.css ) From bb6e938f47ec09b97432dd493bdcf2335cb2b208 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 5 Sep 2017 16:51:41 +0630 Subject: [PATCH 19/50] update oqs action cable for order cahnnel and oqs channel --- app/assets/javascripts/OQS.js | 13 ++++++------ .../channels/order_queue_station.js | 20 +++++++++++++------ app/views/oqs/home/index.html.erb | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index ed5defe3..d12c38e4 100644 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -19,12 +19,7 @@ $(document).ready(function(){ - // auto refresh every 10 seconds - // setTimeout(function(){ - // window.location.reload(1); - // }, 10000); - // $oqs_count = document.getElementById("oqsBox").style.order =1; - // $("#oqsBox").css("order", 1); + $(".nav-completed").on("click", function(){ $("#completed").removeClass('hide') @@ -33,14 +28,18 @@ $(document).ready(function(){ $(".oqs_click").on("click", function(){ $(".oqs_click").removeClass('oqs_active'); + $(".queue_station").removeClass('queue_station_box'); $("#completed").addClass('hide'); $(".oqs_append").removeClass('hide'); $(this).addClass('oqs_active'); + $(".queue_station").addClass('queue_station_box'); var oqs_id = $(this).find(".oqs-id").text(); var url = 'oqs/get_items/'+oqs_id; show_details(url); + + }); //End Click function show_details(url){ @@ -66,7 +65,7 @@ $(document).ready(function(){ var date = new Date(data[field]["created_at"]); var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes(); - row ='
' + row ='
' +'
' +'

' +''+data[field]["table_type"]+'- ' diff --git a/app/assets/javascripts/channels/order_queue_station.js b/app/assets/javascripts/channels/order_queue_station.js index 5c7c710a..9ad1a454 100644 --- a/app/assets/javascripts/channels/order_queue_station.js +++ b/app/assets/javascripts/channels/order_queue_station.js @@ -11,7 +11,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann items = data.order; for(var field in items) { var price = parseFloat(items[field].price).toFixed(2); - if (items[field]["options"] == "[]" || data[field]["options"] == "") { + if (items[field]["options"] == "[]" || items[field]["options"] == "") { var options = ""; }else{ var options = items.options; @@ -34,7 +34,8 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann if (oqs_id == items[field]["order_queue_station_id"]) { - row ='
' + row ='
' + +'' +'
' +'

' +''+items[field]["table_type"]+'- ' @@ -65,11 +66,18 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann +'' +' ' +'

' - +'
'; - $('.oqs_append').append(row); + +'
'; + $('.oqs_append').append(row); } - } - // $("[data-behaviour='message']").html(data.order); + }//end looping + + var $divs = $("div.queue_station"); + var SortListDivs = $divs.sort(function (a, b) { + first = $(a).attr('data-date'); + next = $(b).attr('data-date'); + return new Date(first).getTime() < new Date(next).getTime(); + }); + $("#oqs_container").html(SortListDivs); }, }); diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 79e0e69f..468cd58b 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -110,7 +110,7 @@ -
+
From d1db57e9b57ad31253b3b296845b47ea1d9c5699 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 5 Sep 2017 18:06:57 +0630 Subject: [PATCH 20/50] update oqs action cable sorting --- app/assets/javascripts/OQS.js | 2 +- app/assets/javascripts/channels/order.js | 1 + app/assets/javascripts/channels/order_queue_station.js | 8 ++++++-- app/views/origami/home/show.html.erb | 2 ++ app/views/origami/rooms/show.html.erb | 6 ++++-- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index d12c38e4..c4035ead 100644 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -65,7 +65,7 @@ $(document).ready(function(){ var date = new Date(data[field]["created_at"]); var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes(); - row ='
' + row ='
' +'
' +'

' +''+data[field]["table_type"]+'- ' diff --git a/app/assets/javascripts/channels/order.js b/app/assets/javascripts/channels/order.js index eb73c5d1..691834e1 100644 --- a/app/assets/javascripts/channels/order.js +++ b/app/assets/javascripts/channels/order.js @@ -9,6 +9,7 @@ App.order = App.cable.subscriptions.create('OrderChannel', { $('.table_'+data.table.id).removeClass('green'); $('.table_'+data.table.id).addClass('blue'); + $('.new_text_'+data.table.id).removeClass('hide') }, diff --git a/app/assets/javascripts/channels/order_queue_station.js b/app/assets/javascripts/channels/order_queue_station.js index 9ad1a454..a2da084a 100644 --- a/app/assets/javascripts/channels/order_queue_station.js +++ b/app/assets/javascripts/channels/order_queue_station.js @@ -34,7 +34,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann if (oqs_id == items[field]["order_queue_station_id"]) { - row ='
' + row ='
' +'' +'
' +'

' @@ -75,8 +75,12 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann var SortListDivs = $divs.sort(function (a, b) { first = $(a).attr('data-date'); next = $(b).attr('data-date'); - return new Date(first).getTime() < new Date(next).getTime(); + console.log(parseInt(first.substring(4, 16))); + console.log(parseInt(next.substring(4, 16))); + return parseInt(next.substring(4, 16)) - parseInt(first.substring(4, 16)); + console.log(parseInt(first.substring(4, 16)) > parseInt(next.substring(4, 16))); }); + console.log(SortListDivs); $("#oqs_container").html(SortListDivs); }, diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 2d7cb895..45750d6f 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -62,6 +62,7 @@
<%= table.name %> + new
<% end %> @@ -89,6 +90,7 @@
<%= room.name %> +
<% end %> diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index 673b733d..1fed161c 100644 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -54,9 +54,10 @@

<% end %> <% else %> -
+
<%= table.name %> +
<% end %> @@ -87,9 +88,10 @@
<% end %> <% else %> -
+
<%= room.name %> +
<% end %> From 784e740da3844422a3de4f38c3fd780b2b215b2d Mon Sep 17 00:00:00 2001 From: Zin Lin Phyo Date: Wed, 6 Sep 2017 11:18:02 +0630 Subject: [PATCH 21/50] rename in_juty to in_duty --- .idea/workspace.xml | 683 ++++++++++-------- .../origami/in_duties_controller.rb | 170 +++++ .../origami/in_juties_controller.rb | 170 ----- app/helpers/origami/in_duties_helper.rb | 2 + app/helpers/origami/in_juties_helper.rb | 2 - app/models/{in_juty.rb => in_duty.rb} | 2 +- app/views/origami/home/show.html.erb | 6 +- .../_assign_in_duty.html.erb} | 0 .../_edit_in_duty.html.erb} | 2 +- .../{in_juties => in_duties}/_form.html.erb | 2 +- .../origami/in_duties/_in_duty.json.jbuilder | 2 + .../assign_in_duty.html.erb} | 20 +- .../{in_juties => in_duties}/edit.html.erb | 4 +- .../origami/in_duties/edit_in_duty.html.erb | 6 + .../{in_juties => in_duties}/index.html.erb | 46 +- .../origami/in_duties/index.json.jbuilder | 1 + .../index_in_duty.html.erb} | 48 +- .../{in_juties => in_duties}/new.html.erb | 4 +- .../{in_juties => in_duties}/show.html.erb | 18 +- .../origami/in_duties/show.json.jbuilder | 1 + .../origami/in_juties/_in_juty.json.jbuilder | 2 - .../origami/in_juties/edit_in_juty.html.erb | 6 - .../origami/in_juties/index.json.jbuilder | 1 - .../origami/in_juties/show.json.jbuilder | 1 - config/routes.rb | 16 +- ....rb => 20170823081748_create_in_duties.rb} | 6 +- ...r_spec.rb => in_duties_controller_spec.rb} | 4 +- .../{in_juty_spec.rb => in_duty_spec.rb} | 2 +- 28 files changed, 640 insertions(+), 587 deletions(-) create mode 100644 app/controllers/origami/in_duties_controller.rb delete mode 100644 app/controllers/origami/in_juties_controller.rb create mode 100644 app/helpers/origami/in_duties_helper.rb delete mode 100644 app/helpers/origami/in_juties_helper.rb rename app/models/{in_juty.rb => in_duty.rb} (78%) rename app/views/origami/{in_juties/_assign_in_juty.html.erb => in_duties/_assign_in_duty.html.erb} (100%) rename app/views/origami/{in_juties/_edit_in_juty.html.erb => in_duties/_edit_in_duty.html.erb} (87%) rename app/views/origami/{in_juties => in_duties}/_form.html.erb (95%) create mode 100644 app/views/origami/in_duties/_in_duty.json.jbuilder rename app/views/origami/{in_juties/assign_in_juty.html.erb => in_duties/assign_in_duty.html.erb} (76%) rename app/views/origami/{in_juties => in_duties}/edit.html.erb (61%) create mode 100644 app/views/origami/in_duties/edit_in_duty.html.erb rename app/views/origami/{in_juties => in_duties}/index.html.erb (54%) create mode 100644 app/views/origami/in_duties/index.json.jbuilder rename app/views/origami/{in_juties/index_in_juty.html.erb => in_duties/index_in_duty.html.erb} (58%) rename app/views/origami/{in_juties => in_duties}/new.html.erb (58%) rename app/views/origami/{in_juties => in_duties}/show.html.erb (59%) create mode 100644 app/views/origami/in_duties/show.json.jbuilder delete mode 100644 app/views/origami/in_juties/_in_juty.json.jbuilder delete mode 100644 app/views/origami/in_juties/edit_in_juty.html.erb delete mode 100644 app/views/origami/in_juties/index.json.jbuilder delete mode 100644 app/views/origami/in_juties/show.json.jbuilder rename db/migrate/{20170823081747_create_in_juties.rb => 20170823081748_create_in_duties.rb} (54%) rename spec/controllers/origami/{in_juties_controller_spec.rb => in_duties_controller_spec.rb} (97%) rename spec/models/{in_juty_spec.rb => in_duty_spec.rb} (68%) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 467886cf..3ddc5623 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,15 +2,28 @@ + + + + + + + + + + + + + + + + + + + - - - - - - - - + + @@ -25,7 +38,7 @@ - + @@ -54,68 +67,104 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - + + - - - + + + + + + + + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -124,40 +173,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -166,7 +181,7 @@ - + @@ -176,7 +191,7 @@ - + @@ -186,7 +201,7 @@ - + @@ -196,7 +211,7 @@ - + @@ -206,7 +221,7 @@ - + @@ -252,7 +267,19 @@ custom_excel load promotion_original_product + in_juti + Juty + Juti + Juties + juties + juty + + Duties + Duty + duty + duties + - @@ -946,6 +994,7 @@ + @@ -958,7 +1007,6 @@ - @@ -1023,196 +1071,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1290,7 +1148,7 @@ - + @@ -1315,7 +1173,7 @@ - + @@ -1333,7 +1191,7 @@ - + @@ -1341,7 +1199,7 @@ - + @@ -1357,7 +1215,7 @@ - + @@ -1365,7 +1223,7 @@ - + @@ -1381,7 +1239,7 @@ - + @@ -1389,18 +1247,16 @@ - + - - - - - + + + @@ -1436,10 +1292,205 @@ + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/controllers/origami/in_duties_controller.rb b/app/controllers/origami/in_duties_controller.rb new file mode 100644 index 00000000..eaf23c5a --- /dev/null +++ b/app/controllers/origami/in_duties_controller.rb @@ -0,0 +1,170 @@ +class Origami::InDutiesController < BaseOrigamiController + before_action :set_in_duty, only: %i[show edit update edit_in_duty update_for_in_duty destroy destroy_in_duty] + + # GET /in_duties + # GET /in_duties.json + def index + @in_duties = InDuty.all + end + + def index_in_duty + @duty_in = InDuty.where('dinning_id=?', params[:table_id]) + @table = DiningFacility.find(params[:table_id]) + @in_duty = InDuty.new + @duties_in = Kaminari.paginate_array(@duty_in).page(params[:page]).per(10) + end + + # GET /in_duties/1 + # GET /in_duties/1.json + def show; end + + # GET /in_duties/new + def new + # this one use for new + @in_duty = InDuty.new + @table = DiningFacility.find(params[:table_id]) + @commissioner = @in_duty.commissioner + render partial: 'form' + end + + # GET /in_duties/1/edit + def edit; end + + def edit_in_duty + @in_duty = InDuty.find(params[:id]) + @table = DiningFacility.find(params[:table_id]) + @commissioner = @in_duty.commissioner + + # render json: {in_duty: @in_duty, commissioner: @commissioner} + render partial: 'form' + end + + def assign_in_duty + @in_duty = InDuty.new + @table = DiningFacility.find(params[:table_id]) + end + + # POST /in_duties + # POST /in_duties.json + def create + @in_duty = InDuty.new(in_duty_params) + + respond_to do |format| + if @in_duty.save + format.html { redirect_to origami_in_duties_path, notice: 'In duty was successfully created.' } + format.json { render :show, status: :created, location: @in_duty } + else + format.html { render :new } + format.json { render json: @in_duty.errors, status: :unprocessable_entity } + end + end + end + + def create_for_in_duty + # this one use for create and update + in_duty = in_duty_params + in_time = DateTime.new in_duty['in_time(1i)'].to_i, in_duty['in_time(2i)'].to_i, in_duty['in_time(3i)'].to_i, in_duty['in_time(4i)'].to_i, in_duty['in_time(5i)'].to_i + in_time = in_time.change(offset: '+06:30') + out_time = DateTime.new in_duty['out_time(1i)'].to_i, in_duty['out_time(2i)'].to_i, in_duty['out_time(3i)'].to_i, in_duty['out_time(4i)'].to_i, in_duty['out_time(5i)'].to_i + out_time = out_time.change(offset: '+06:30') + @in_duty = InDuty.new + in_duty_id = in_duty[:id] + unless in_duty_id.empty? + @in_duty = InDuty.find(in_duty_id.to_i) + end + + @in_duty.dinning_id = in_duty_params[:dinning_id] + @in_duty.commissioner_ids = in_duty_params[:commissioner_ids] + @in_duty.in_time = in_time + @in_duty.out_time = out_time + + respond_to do |format| + if @in_duty.save + if in_duty_id.nil? + format.html { redirect_to origami_index_in_duty_path(in_duty_params[:dinning_id]), notice: 'In duty was successfully created.' } + format.json { render :show, status: :created, location: @in_duty } + else + format.html { redirect_to origami_index_in_duty_path(in_duty_params[:dinning_id]), notice: 'In duty was successfully updated.' } + format.json { render :show, status: :created, location: @in_duty } + end + else + format.html { render :new } + format.json { render json: @in_duty.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /in_duties/1 + # PATCH/PUT /in_duties/1.json + def update + in_duty = in_duty_params + in_time = DateTime.new in_duty['in_time(1i)'].to_i, in_duty['in_time(2i)'].to_i, in_duty['in_time(3i)'].to_i, in_duty['in_time(4i)'].to_i, in_duty['in_time(5i)'].to_i + in_time = in_time.change(offset: '+06:30') + out_time = DateTime.new in_duty['out_time(1i)'].to_i, in_duty['out_time(2i)'].to_i, in_duty['out_time(3i)'].to_i, in_duty['out_time(4i)'].to_i, in_duty['out_time(5i)'].to_i + out_time = out_time.change(offset: '+06:30') + @in_duty.commissioner_ids = in_duty_params[:commissioner_ids] + @in_duty.in_time = in_time + @in_duty.out_time = out_time + respond_to do |format| + if @in_duty.save + format.html { redirect_to origami_index_in_duty_path(in_duty_params[:dinning_id]), notice: 'In duty was successfully updated.' } + format.json { render :show, status: :ok, location: @in_duty } + else + format.html { render :edit } + format.json { render json: @in_duty.errors, status: :unprocessable_entity } + end + end + end + + def update_for_in_duty + in_duty = in_duty_params + in_time = DateTime.new in_duty['in_time(1i)'].to_i, in_duty['in_time(2i)'].to_i, in_duty['in_time(3i)'].to_i, in_duty['in_time(4i)'].to_i, in_duty['in_time(5i)'].to_i + in_time = in_time.change(offset: '+06:30') + out_time = DateTime.new in_duty['out_time(1i)'].to_i, in_duty['out_time(2i)'].to_i, in_duty['out_time(3i)'].to_i, in_duty['out_time(4i)'].to_i, in_duty['out_time(5i)'].to_i + out_time = out_time.change(offset: '+06:30') + @in_duty.commissioner_ids = in_duty_params[:commissioner_ids] + @in_duty.in_time = in_time + @in_duty.out_time = out_time + respond_to do |format| + if @in_duty.save + format.html { redirect_to origami_index_in_duty_path(in_duty_params[:dinning_id]), notice: 'In duty was successfully updated.' } + format.json { render :show, status: :ok, location: @in_duty } + else + format.html { render :edit } + format.json { render json: @in_duty.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /in_duties/1 + # DELETE /in_duties/1.json + def destroy + @in_duty.destroy + respond_to do |format| + format.html { redirect_to origami_in_duties_path, notice: 'In duty was successfully removed.' } + format.json { head :no_content } + end + end + + def destroy_in_duty + @table_id = params[:table_id] + @in_duty.destroy + + respond_to do |format| + format.html { redirect_to origami_index_in_duty_path(@table_id), notice: 'In duty was successfully removed.' } + format.json { head :no_content } + end + end + + private + + # Use callbacks to share common setup or constraints between actions. + def set_in_duty + @in_duty = InDuty.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def in_duty_params + params.require(:in_duty).permit(:id, :dinning_id, :commissioner_ids, :in_time, :out_time) + end +end diff --git a/app/controllers/origami/in_juties_controller.rb b/app/controllers/origami/in_juties_controller.rb deleted file mode 100644 index d78ef348..00000000 --- a/app/controllers/origami/in_juties_controller.rb +++ /dev/null @@ -1,170 +0,0 @@ -class Origami::InJutiesController < BaseOrigamiController - before_action :set_in_juty, only: %i[show edit update edit_in_juty update_for_in_juty destroy destroy_in_juty] - - # GET /in_juties - # GET /in_juties.json - def index - @in_juties = InJuty.all - end - - def index_in_juty - @juty_in = InJuty.where('dinning_id=?', params[:table_id]) - @table = DiningFacility.find(params[:table_id]) - @in_juty = InJuty.new - @juties_in = Kaminari.paginate_array(@juty_in).page(params[:page]).per(10) - end - - # GET /in_juties/1 - # GET /in_juties/1.json - def show; end - - # GET /in_juties/new - def new - # this one use for new - @in_juty = InJuty.new - @table = DiningFacility.find(params[:table_id]) - @commissioner = @in_juty.commissioner - render partial: 'form' - end - - # GET /in_juties/1/edit - def edit; end - - def edit_in_juty - @in_juty = InJuty.find(params[:id]) - @table = DiningFacility.find(params[:table_id]) - @commissioner = @in_juty.commissioner - - # render json: {in_juty: @in_juty, commissioner: @commissioner} - render partial: 'form' - end - - def assign_in_juty - @in_juty = InJuty.new - @table = DiningFacility.find(params[:table_id]) - end - - # POST /in_juties - # POST /in_juties.json - def create - @in_juty = InJuty.new(in_juty_params) - - respond_to do |format| - if @in_juty.save - format.html { redirect_to origami_in_juties_path, notice: 'In juty was successfully created.' } - format.json { render :show, status: :created, location: @in_juty } - else - format.html { render :new } - format.json { render json: @in_juty.errors, status: :unprocessable_entity } - end - end - end - - def create_for_in_juty - # this one use for create and update - in_juty = in_juty_params - in_time = DateTime.new in_juty['in_time(1i)'].to_i, in_juty['in_time(2i)'].to_i, in_juty['in_time(3i)'].to_i, in_juty['in_time(4i)'].to_i, in_juty['in_time(5i)'].to_i - in_time = in_time.change(offset: '+06:30') - out_time = DateTime.new in_juty['out_time(1i)'].to_i, in_juty['out_time(2i)'].to_i, in_juty['out_time(3i)'].to_i, in_juty['out_time(4i)'].to_i, in_juty['out_time(5i)'].to_i - out_time = out_time.change(offset: '+06:30') - @in_juty = InJuty.new - in_juty_id = in_juty[:id] - unless in_juty_id.empty? - @in_juty = InJuty.find(in_juty_id.to_i) - end - - @in_juty.dinning_id = in_juty_params[:dinning_id] - @in_juty.commissioner_ids = in_juty_params[:commissioner_ids] - @in_juty.in_time = in_time - @in_juty.out_time = out_time - - respond_to do |format| - if @in_juty.save - if in_juty_id.nil? - format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully created.' } - format.json { render :show, status: :created, location: @in_juty } - else - format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully updated.' } - format.json { render :show, status: :created, location: @in_juty } - end - else - format.html { render :new } - format.json { render json: @in_juty.errors, status: :unprocessable_entity } - end - end - end - - # PATCH/PUT /in_juties/1 - # PATCH/PUT /in_juties/1.json - def update - in_juty = in_juty_params - in_time = DateTime.new in_juty['in_time(1i)'].to_i, in_juty['in_time(2i)'].to_i, in_juty['in_time(3i)'].to_i, in_juty['in_time(4i)'].to_i, in_juty['in_time(5i)'].to_i - in_time = in_time.change(offset: '+06:30') - out_time = DateTime.new in_juty['out_time(1i)'].to_i, in_juty['out_time(2i)'].to_i, in_juty['out_time(3i)'].to_i, in_juty['out_time(4i)'].to_i, in_juty['out_time(5i)'].to_i - out_time = out_time.change(offset: '+06:30') - @in_juty.commissioner_ids = in_juty_params[:commissioner_ids] - @in_juty.in_time = in_time - @in_juty.out_time = out_time - respond_to do |format| - if @in_juty.save - format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully updated.' } - format.json { render :show, status: :ok, location: @in_juty } - else - format.html { render :edit } - format.json { render json: @in_juty.errors, status: :unprocessable_entity } - end - end - end - - def update_for_in_juty - in_juty = in_juty_params - in_time = DateTime.new in_juty['in_time(1i)'].to_i, in_juty['in_time(2i)'].to_i, in_juty['in_time(3i)'].to_i, in_juty['in_time(4i)'].to_i, in_juty['in_time(5i)'].to_i - in_time = in_time.change(offset: '+06:30') - out_time = DateTime.new in_juty['out_time(1i)'].to_i, in_juty['out_time(2i)'].to_i, in_juty['out_time(3i)'].to_i, in_juty['out_time(4i)'].to_i, in_juty['out_time(5i)'].to_i - out_time = out_time.change(offset: '+06:30') - @in_juty.commissioner_ids = in_juty_params[:commissioner_ids] - @in_juty.in_time = in_time - @in_juty.out_time = out_time - respond_to do |format| - if @in_juty.save - format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully updated.' } - format.json { render :show, status: :ok, location: @in_juty } - else - format.html { render :edit } - format.json { render json: @in_juty.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /in_juties/1 - # DELETE /in_juties/1.json - def destroy - @in_juty.destroy - respond_to do |format| - format.html { redirect_to origami_in_juties_path, notice: 'In juty was successfully removed.' } - format.json { head :no_content } - end - end - - def destroy_in_juty - @table_id = params[:table_id] - @in_juty.destroy - - respond_to do |format| - format.html { redirect_to origami_index_in_juty_path(@table_id), notice: 'In juty was successfully removed.' } - format.json { head :no_content } - end - end - - private - - # Use callbacks to share common setup or constraints between actions. - def set_in_juty - @in_juty = InJuty.find(params[:id]) - end - - # Never trust parameters from the scary internet, only allow the white list through. - def in_juty_params - params.require(:in_juty).permit(:id, :dinning_id, :commissioner_ids, :in_time, :out_time) - end -end diff --git a/app/helpers/origami/in_duties_helper.rb b/app/helpers/origami/in_duties_helper.rb new file mode 100644 index 00000000..afd35e07 --- /dev/null +++ b/app/helpers/origami/in_duties_helper.rb @@ -0,0 +1,2 @@ +module Origami::InDutiesHelper +end diff --git a/app/helpers/origami/in_juties_helper.rb b/app/helpers/origami/in_juties_helper.rb deleted file mode 100644 index 2792da8d..00000000 --- a/app/helpers/origami/in_juties_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module Origami::InJutiesHelper -end diff --git a/app/models/in_juty.rb b/app/models/in_duty.rb similarity index 78% rename from app/models/in_juty.rb rename to app/models/in_duty.rb index 2f023ff0..485787c7 100644 --- a/app/models/in_juty.rb +++ b/app/models/in_duty.rb @@ -1,4 +1,4 @@ -class InJuty < ApplicationRecord +class InDuty < ApplicationRecord belongs_to :dining_facility, foreign_key: 'dinning_id' belongs_to :commissioner, foreign_key: 'commissioner_ids' end diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 680894ff..c0fd2ff5 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -333,7 +333,7 @@ - + @@ -580,9 +580,9 @@ window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/load_commissioners"; }); - $('#in_juties').on('click', function () { + $('#in_duties').on('click', function () { var dining_id = "<%= @dining.id %>" - window.location.href = '/origami/assign_in_juty/'+ dining_id; + window.location.href = '/origami/assign_in_duty/'+ dining_id; }); $('#void').on('click', function () { diff --git a/app/views/origami/in_juties/_assign_in_juty.html.erb b/app/views/origami/in_duties/_assign_in_duty.html.erb similarity index 100% rename from app/views/origami/in_juties/_assign_in_juty.html.erb rename to app/views/origami/in_duties/_assign_in_duty.html.erb diff --git a/app/views/origami/in_juties/_edit_in_juty.html.erb b/app/views/origami/in_duties/_edit_in_duty.html.erb similarity index 87% rename from app/views/origami/in_juties/_edit_in_juty.html.erb rename to app/views/origami/in_duties/_edit_in_duty.html.erb index a297ac65..41a492eb 100644 --- a/app/views/origami/in_juties/_edit_in_juty.html.erb +++ b/app/views/origami/in_duties/_edit_in_duty.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for([:origami, @in_juty]) do |f| %> +<%= simple_form_for([:origami, @in_duty]) do |f| %> <%= f.error_notification %>
diff --git a/app/views/origami/in_juties/_form.html.erb b/app/views/origami/in_duties/_form.html.erb similarity index 95% rename from app/views/origami/in_juties/_form.html.erb rename to app/views/origami/in_duties/_form.html.erb index 61342d7b..3351dbd3 100644 --- a/app/views/origami/in_juties/_form.html.erb +++ b/app/views/origami/in_duties/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for @in_juty, :url => origami_index_in_juty_path(@table.id), :method => :post do |f| %> +<%= simple_form_for @in_duty, :url => origami_index_in_duty_path(@table.id), :method => :post do |f| %> <%= f.error_notification %> <%= f.hidden_field :id, :class => "form-control col-md-6 " %> diff --git a/app/views/origami/in_duties/_in_duty.json.jbuilder b/app/views/origami/in_duties/_in_duty.json.jbuilder new file mode 100644 index 00000000..6b13c2f9 --- /dev/null +++ b/app/views/origami/in_duties/_in_duty.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! in_duty, :id, :created_at, :updated_at +json.url in_duty_url(in_duty, format: :json) diff --git a/app/views/origami/in_juties/assign_in_juty.html.erb b/app/views/origami/in_duties/assign_in_duty.html.erb similarity index 76% rename from app/views/origami/in_juties/assign_in_juty.html.erb rename to app/views/origami/in_duties/assign_in_duty.html.erb index 7176dea6..31e95a50 100644 --- a/app/views/origami/in_juties/assign_in_juty.html.erb +++ b/app/views/origami/in_duties/assign_in_duty.html.erb @@ -1,9 +1,9 @@
- <%= simple_form_for([:origami,@in_juty]) do |f| %> + <%= simple_form_for([:origami,@in_duty]) do |f| %> <%= f.error_notification %>
@@ -22,10 +22,10 @@
- <%= link_to 'Back', origami_index_in_juty_path(@table.id), class: 'btn btn-success' %> + <%= link_to 'Back', origami_index_in_duty_path(@table.id), class: 'btn btn-success' %>
- +
@@ -45,18 +45,18 @@ $(function() { $('.datepicker').css('cursor','pointer'); }); - $('#in_juty').on('click', function () { - var ajax_url = "/origami/assign_in_juty"; - var commissioner_ids = $('#in_juty_commissioner_ids').val(); - var in_time = $('#in_juty_in_time').val(); - var out_time = $('#in_juty_out_time').val(); + $('#in_duty').on('click', function () { + var ajax_url = "/origami/assign_in_duty"; + var commissioner_ids = $('#in_duty_commissioner_ids').val(); + var in_time = $('#in_duty_in_time').val(); + var out_time = $('#in_duty_out_time').val(); var dining_id = '<%= @table.id %>' $.ajax({ type: "POST", url: ajax_url, data: 'dining_id=' + dining_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time, success: function (result) { - window.location.href = '/origami/assign_in_juty/'+ dining_id; + window.location.href = '/origami/assign_in_duty/'+ dining_id; } }); }) diff --git a/app/views/origami/in_juties/edit.html.erb b/app/views/origami/in_duties/edit.html.erb similarity index 61% rename from app/views/origami/in_juties/edit.html.erb rename to app/views/origami/in_duties/edit.html.erb index 3a6fc774..3e64b2f2 100644 --- a/app/views/origami/in_juties/edit.html.erb +++ b/app/views/origami/in_duties/edit.html.erb @@ -2,9 +2,9 @@
- <%= render 'form', in_juty: @in_juty %> + <%= render 'form', in_duty: @in_duty %>
\ No newline at end of file diff --git a/app/views/origami/in_duties/edit_in_duty.html.erb b/app/views/origami/in_duties/edit_in_duty.html.erb new file mode 100644 index 00000000..bcc984aa --- /dev/null +++ b/app/views/origami/in_duties/edit_in_duty.html.erb @@ -0,0 +1,6 @@ +
+ + <%= render 'edit_in_duty', in_duty: @in_duty %> +
\ No newline at end of file diff --git a/app/views/origami/in_juties/index.html.erb b/app/views/origami/in_duties/index.html.erb similarity index 54% rename from app/views/origami/in_juties/index.html.erb rename to app/views/origami/in_duties/index.html.erb index ff5a0fd3..355a7afb 100644 --- a/app/views/origami/in_juties/index.html.erb +++ b/app/views/origami/in_duties/index.html.erb @@ -14,27 +14,27 @@ - <% @juties_in.each do |in_juty| %> - + <% @duties_in.each do |in_duty| %> + - <%= in_juty.dining_facility.name rescue '-' %> - <%= in_juty.commissioner.name rescue '-' %> - <%= in_juty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %> - <%= in_juty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %> - <%= link_to 'Destroy', origami_destroy_in_juty_path(in_juty.dining_facility.id, in_juty), method: :delete, data: {confirm: 'Are you sure?'} %> + <%= in_duty.dining_facility.name rescue '-' %> + <%= in_duty.commissioner.name rescue '-' %> + <%= in_duty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %> + <%= in_duty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %> + <%= link_to 'Destroy', origami_destroy_in_duty_path(in_duty.dining_facility.id, in_duty), method: :delete, data: {confirm: 'Are you sure?'} %> <% end %> - <%= paginate @juties_in %> + <%= paginate @duties_in %>
- <%= render 'form', in_juty: @in_juty, table: @table %> + <%= render 'form', in_duty: @in_duty, table: @table %>
- <%= link_to t('.new', :default => t("helpers.links.new")), new_origami_in_juty_path, :class => 'btn btn-primary btn-sm' %> + <%= link_to t('.new', :default => t("helpers.links.new")), new_origami_in_duty_path, :class => 'btn btn-primary btn-sm' %>
@@ -43,13 +43,13 @@
diff --git a/config/routes.rb b/config/routes.rb index 8dcdb956..18f3c0b5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -299,6 +299,7 @@ Rails.application.routes.draw do resources :promotion_products end get '/find_item_instance' => 'promotions#find_item_instance', as:'find_item_instance' + get '/find_parent_item' => 'promotions#find_parent_item', as:'find_parent_item' # commission resources :commissions From 9d4741429252894d6aec0a593071a67d67c5d18d Mon Sep 17 00:00:00 2001 From: Phyo Date: Wed, 6 Sep 2017 18:03:53 +0630 Subject: [PATCH 24/50] Timepicker Bug Fix --- app/views/settings/promotions/_form.html.erb | 30 ++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/app/views/settings/promotions/_form.html.erb b/app/views/settings/promotions/_form.html.erb index 477731a1..1760f894 100644 --- a/app/views/settings/promotions/_form.html.erb +++ b/app/views/settings/promotions/_form.html.erb @@ -42,14 +42,14 @@
- <%= f.hidden_field :promo_day, :value => "", :class => "form-control" %> -
Sun
-
Mon
-
Tue
-
Wed
-
Thu
-
Fri
-
Sat
+ <%= f.hidden_field :promo_day, :class => "form-control" %> +
+
+
+
+
+
+

@@ -168,6 +168,19 @@ $(document).ready(function(){ format:'H:m' }); + $('#promotion_promo_start_hour').on('change', function(event) { + $('#promotion_promo_start_hour').val($('#promotion_promo_start_hour').val().split(":")[0]+":00"); + }); + + $('#promotion_promo_end_hour').on('change', function(event) { + $('#promotion_promo_end_hour').val($('#promotion_promo_end_hour').val().split(":")[0]+":00"); + }); + + var dayy = $("#promotion_promo_day").val().replace("[","").replace("]",""); + jQuery.each( dayy.split(","), function( i, d ) { + $("input.selectDay[value='"+d+"']").prop( "checked", true ); + }); + var form = document.getElementById("new_promotion"); var inputs = $("input"); var arr = []; @@ -227,6 +240,7 @@ $(".selectDay").click(function() { }, 0); }); + // for promotion products data showing var promopdt = $(".promo_product"); jQuery.each( promopdt, function( i, ppdt ) { var ajax_url = "<%= settings_find_parent_item_path %>"; From 5e1e0cd5b96d6db6dbb3997e79670780dc0bc6b8 Mon Sep 17 00:00:00 2001 From: Zin Lin Phyo Date: Wed, 6 Sep 2017 18:27:58 +0630 Subject: [PATCH 25/50] stock_check report template --- .idea/workspace.xml | 1015 +++++++---------- .../inventory/stock_checks_controller.rb | 146 ++- .../reports/stock_check_controller.rb | 50 + app/models/menu_item_instance.rb | 14 +- app/models/stock_check.rb | 2 +- app/pdf/stock_result_pdf.rb | 90 +- .../inventory/_inventory_list.html.erb | 14 +- app/views/inventory/inventory/index.html.erb | 31 +- .../inventory_definitions/_form.html.erb | 3 +- .../inventory_definitions/edit.html.erb | 16 +- .../inventory/stock_checks/index.html.erb | 35 +- .../inventory/stock_checks/show.html.erb | 117 +- .../_stock_check_report_filter.html.erb | 89 ++ app/views/reports/stock_check/index.html.erb | 79 ++ app/views/reports/stock_check/index.xls.erb | 52 + config/routes.rb | 1 + 16 files changed, 940 insertions(+), 814 deletions(-) create mode 100644 app/controllers/reports/stock_check_controller.rb create mode 100644 app/views/reports/stock_check/_stock_check_report_filter.html.erb create mode 100644 app/views/reports/stock_check/index.html.erb create mode 100644 app/views/reports/stock_check/index.xls.erb diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3ddc5623..74609c4e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,27 +2,17 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + @@ -38,7 +28,7 @@ - + @@ -64,187 +54,111 @@ <% @inventory_definitions.each do |id| %> - <% item_name = MenuItemInstance.find_by_item_instance_code(id.item_code) %> - + <% end %>
@@ -50,7 +56,7 @@
- + @@ -61,6 +67,7 @@
+
@@ -80,13 +87,13 @@ count += 1; product_sku = $('#product_sku').val(); product_qty = $('#product_qty').val(); - product_name = $("#product_sku option:selected").text(); + product_name = $("#product_sku").find("option:selected").text(); var tr = '' - + '' + //+ '' + '' + + product_name + '' + '' - + '' + + '' + ''; $('#stock_item').append(tr); // $('#product_sku').val(''); @@ -101,7 +108,9 @@ for (var i = 1; i <= count; i++) { itemname = $('#item_sku_' + i).val(); itemqty = $('#item_qty_' + i).val(); - arr.push({sku: itemname, qty: itemqty}); + if(itemname !== undefined){ + arr.push({sku: itemname, qty: itemqty}); + } jsonStr = JSON.stringify(arr); } console.log(jsonStr); @@ -113,6 +122,14 @@ window.location.href = '/inventory/stock_checks/' + data['stock_id']; } }) - }) + }); + + $('#back').on('click', function () { + window.location.href = '/inventory'; + }); + + function remove_row(row) { + $("#item_remove_"+row).parent().parent().remove(); + } diff --git a/app/views/inventory/stock_checks/show.html.erb b/app/views/inventory/stock_checks/show.html.erb index 4d0e83d0..f4af6db0 100644 --- a/app/views/inventory/stock_checks/show.html.erb +++ b/app/views/inventory/stock_checks/show.html.erb @@ -3,81 +3,96 @@
- Check by + Check by
- <%= @check.check_by %> + <%= Employee.find(@check.check_by).name rescue '' %>
- Check At + Check At
- <%= @check.created_at %>
+ <%= @check.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %>
- Reason + Reason
- <%= @check.reason %> + <%= @check.reason %>

-
# Product Balance
' + count + '' + count + '' - + '
- - - - - - - - - <% - count = 0 - @check.stock_check_items.each do |item| - count += 1 - %> +
#ProductStock CountStock BalanceDifferentRemark
- - - - - - + + + + + + - <% end %> -
<%= count %><%= item.item_code %><%= item.stock_count %><%= item.stock_balance %><%= item.different %><%= item.remark %>#ProductStock CountStock BalanceDifferentRemark
+ <% + count = 0 + @check.stock_check_items.each do |item| + count += 1 + %> + + <%= count %> + + <% menu_item = MenuItemInstance.find_by_item_instance_code(item.item_code)%> + <% if menu_item.nil? %> + <%= Product.find_by_item_code(item.item_code).name rescue "-" %> + <% else %> + <%= menu_item.menu_item.name rescue "-" %> + - <%= menu_item.item_instance_name rescue "-" %> + <% end %> + + <%= item.stock_count %> + <%= item.stock_balance %> + <%= item.different %> + <%= item.remark %> + + <% end %> + +
-
- - - + + +
diff --git a/app/views/reports/stock_check/_stock_check_report_filter.html.erb b/app/views/reports/stock_check/_stock_check_report_filter.html.erb new file mode 100644 index 00000000..1bd00b7b --- /dev/null +++ b/app/views/reports/stock_check/_stock_check_report_filter.html.erb @@ -0,0 +1,89 @@ +
+
+ <%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %> + <% if period_type != false %> +
+ +
+ + <% if @daterange %> + + <% else %> + + <% end %> +
+
+ + +
+
+ +
+
+ +
+
+ <% end %> + + <% end %> +
+
+ + diff --git a/app/views/reports/stock_check/index.html.erb b/app/views/reports/stock_check/index.html.erb new file mode 100644 index 00000000..07008de8 --- /dev/null +++ b/app/views/reports/stock_check/index.html.erb @@ -0,0 +1,79 @@ + + +
+ <%= render :partial => 'stock_check_report_filter', + :locals => {:period_type => true, :shift_name => true, :report_path => reports_stock_check_index_path} %> +
+
+ +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + <% total_qty = 0 %> + <% total_price = 0 %> + <% total_amount = 0 %> + + <% @transaction.each do |result| %> + + + + + + + + + + + <% total_qty += result.qty.to_f %> + <% total_price += result.price.to_f %> + <% total_amount += result.amount.to_f %> + <% end %> + + + + + + + + + +
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %>
SaleSale ItemCommissioner NameProduct NameQtyCommission PriceCommission AmountDate
<%= result.sale_id rescue '-' %><%= result.sale_item_id rescue '-' %><%= result.commissioner.name rescue '-' %><%= result.commission.menu_item.name rescue '-' %><%= sprintf "%.2f", result.qty.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.price.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %><%= result.updated_at.strftime("%e %b %Y %I:%M%p") rescue '-' %>
<%= sprintf("%.2f", total_qty) rescue '-' %><%= sprintf("%.2f", total_price) rescue '-' %><%= sprintf("%.2f", total_amount) rescue '-' %>
+
+
+
+ \ No newline at end of file diff --git a/app/views/reports/stock_check/index.xls.erb b/app/views/reports/stock_check/index.xls.erb new file mode 100644 index 00000000..4ea1f2f0 --- /dev/null +++ b/app/views/reports/stock_check/index.xls.erb @@ -0,0 +1,52 @@ +
+
+
+ + + + + + + + + + + + + + + + <% total_qty = 0 %> + <% total_price = 0 %> + <% total_amount = 0 %> + + <% @transaction.each do |result| %> + + + + + + + + + <% total_qty += result.qty.to_f %> + <% total_price += result.price.to_f %> + <% total_amount += result.amount.to_f %> + <% end %> + + + + + + + + + +
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %>
Commissioner NameProduct NameQtyCommission PriceCommission AmountDate
+ <%= result.commissioner.name rescue '-' %> + + <%= result.commission.menu_item.name rescue '-' %> + <%= sprintf "%.2f", result.qty.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.price.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %><%= result.updated_at.strftime("%e %b %Y %I:%M%p") rescue '-' %>
<%= sprintf("%.2f", total_qty) rescue '-' %><%= sprintf("%.2f", total_price) rescue '-' %><%= sprintf("%.2f", total_amount) rescue '-' %>
+
+
+
diff --git a/config/routes.rb b/config/routes.rb index 226b7dd5..e979ac5d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -328,6 +328,7 @@ Rails.application.routes.draw do resources :credit_payment, :only => [:index, :show] resources :void_sale, :only => [:index, :show] resources :commission, :only => [:index, :show] + resources :stock_check, :only => [:index, :show] get "receipt_no/get_shift_by_date", to: "receipt_no#get_shift_by_date", as: "get_shift_by_date" end From 43cc308d89adba9d50ea994c322e6dd0b169d06b Mon Sep 17 00:00:00 2001 From: Zin Lin Phyo Date: Thu, 7 Sep 2017 10:30:20 +0630 Subject: [PATCH 26/50] stock check report --- .idea/workspace.xml | 336 +++++++++--------- .../reports/stock_check_controller.rb | 6 +- app/models/stock_check.rb | 7 +- app/models/stock_check_item.rb | 12 +- app/views/layouts/_header.html.erb | 1 + app/views/reports/stock_check/index.html.erb | 62 ++-- 6 files changed, 218 insertions(+), 206 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 74609c4e..e5ebd9a3 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,17 +3,11 @@ - - + - - - - - - - - + + + @@ -28,7 +22,7 @@ - + @@ -55,31 +49,51 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -88,28 +102,30 @@ - - + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - + + @@ -119,37 +135,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -203,8 +189,6 @@ @@ -371,6 +357,13 @@ + + + + + + + @@ -409,8 +402,8 @@ + + + + + + +

+ diff --git a/config/routes.rb b/config/routes.rb index 6ac723aa..72d129ad 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,7 +33,7 @@ Rails.application.routes.draw do resources :menu, only: [:index, :show] resources :menu_categories, only: [:index, :show] resources :menu_items, only: [:index, :show] - resources :menu_item_attributes, only: [:index] + resources :menu_item_attributes, only: [:index, :show] resources :menu_item_options, only: [:index] resources :menu_sold_out, only: [:index] resources :menu_item_instances, only: [:show] From abde6745a4634e4cf2ed83623cbbd6c1fbf2c090 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 13 Sep 2017 12:27:37 +0630 Subject: [PATCH 44/50] update addorder modefined --- app/assets/javascripts/addorder.js | 150 +++++++++++------- .../origami/addorders_controller.rb | 13 +- .../addorders/_menu_item.json.jbuilder | 117 ++++++++++++++ app/views/origami/addorders/detail.html.erb | 8 +- .../addorders/get_menu_category.json.jbuilder | 5 + config/routes.rb | 5 +- 6 files changed, 233 insertions(+), 65 deletions(-) create mode 100644 app/views/origami/addorders/_menu_item.json.jbuilder create mode 100644 app/views/origami/addorders/get_menu_category.json.jbuilder diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index ca424526..6d79ca2a 100644 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -98,10 +98,10 @@ $(function(){ } //end show list function //click item row for item set - $(document).on('click', '.set_item_box', function(event){ - $(".instance-list").empty(); - $(".options-list").empty(); - + $(document).on('click', '.set_item_box', function(event){ + $(".instance-list").empty(); + $(".options-list").empty(); + change_qty_plus_minus("set_count","set_plus","set_minus"); data = $(this).parent().children().children('.add_icon'); instances = $(this).data('instance'); @@ -149,6 +149,7 @@ $(function(){ // $('#set_total_price').text(data.attr('data-price')); $('#set_total_price').text(0); $('#set_unit_price').text(data.attr('data-price')); + // $('#set_unit_price').text(0); }); // click instance for add item set $(document).on('click', '.instance_box', function(event){ @@ -175,7 +176,7 @@ $(function(){ name = $(this).data('name'); price = $(this).data('price'); // qty = $('#set_change_qty').val(); - qty = document.getElementById("count").value; + qty = document.getElementById("set_count").value; total = qty*price; var total_price = +sub_total - +total; $(this).removeClass('selected-instance'); @@ -188,18 +189,19 @@ $(function(){ name = $(this).data('name'); price = $(this).data('price'); // qty = $('#set_change_qty').val(); - qty = document.getElementById("count").value; + qty = document.getElementById("set_count").value; total = qty*price; var total_price = +sub_total + +total; $(this).addClass('selected-instance'); } + $('#set_unit_price').text(price); $('#set_total_price').text(total_price); }); //End selecct attribute buttom // click add order $(document).on('click', '.set_order', function(event){ total_price = $('#set_total_price').text(); - qty = parseInt($('#set_change_qty').val()); + qty = parseInt($('#set_count').val()); item_code = $('#set_item_code').text(); item_name = $('#set_name').text(); @@ -251,6 +253,8 @@ $(function(){ $('.add_to_order').removeAttr('data-attributes'); $('.add_to_order').removeAttr('data-options'); + change_qty_plus_minus("count","plus","minus"); + data = $(this).parent().children().children('.add_icon'); $('#total_price').text(data.attr('data-price')); @@ -271,48 +275,44 @@ $(function(){ for(var field in instances) { value = instances[field].values; $(value).each(function(i){ - // options = value[i]; - // instance_attributes.push(options); - $.ajax({ - type: "GET", - url: '../../api/restaurant/menu_item_attributes/'+value[i], - data: {id:value[i]}, - success:function(result){ + options = value[i]; + instance_attributes.push(options); + // $.ajax({ + // type: "GET", + // url: '../../api/restaurant/menu_item_attributes/'+value[i], + // data: {id:value[i]}, + // success:function(result){ - options = result["name"]; - instance_attributes.push(options); - } - }); + // options = result["name"]; + // instance_attributes.push(options); + // } + // }); }); } - selected_arr = [] - $(selected_item).each(function(i){ - $.ajax({ - type: "GET", - url: '../../api/restaurant/menu_item_attributes/'+selected_item[i], - data: {id:selected_item[i]}, - success:function(result){ - name = result["name"]; - selected_arr.push(name); - } - }); - }); + // selected_arr = [] + // $(selected_item).each(function(i){ + // $.ajax({ + // type: "GET", + // url: '../../api/restaurant/menu_item_attributes/'+selected_item[i], + // data: {id:selected_item[i]}, + // success:function(result){ + // name = result["name"]; + // selected_arr.push(name); + // } + // }); + // }); for(var field in attributes) { value = attributes[field]["values"]; type = attributes[field]["type"] row = "

"+attributes[field]["type"]+"

"; - console.log(selected_arr); - console.log(value); - - console.log(instance_attributes); $(value).each(function(i){ disabled = "" status =""; - if(parseInt(jQuery.inArray(value[i], selected_arr)) !== -1){ + if(parseInt(jQuery.inArray(value[i], selected_item)) !== -1){ status = "selected-attribute"; } if(parseInt(jQuery.inArray(value[i], instance_attributes)) == -1){ @@ -351,6 +351,8 @@ $(function(){ // click select option icon for add $(document).on('click', '.attribute_btn', function(event){ + + $('.change_qty').val(1); value = $(this).data('value'); type = $(this).data('type'); instances = $(this).data('instances'); @@ -370,7 +372,7 @@ $(function(){ var selected_attr = get_selected_attributes('selected-attribute'); - qty = $('#change_qty').val(); + qty = $('.change_qty').val(); for(var field in instances) { item_attr = instances[field].values; @@ -677,33 +679,67 @@ $(function(){ } }); - var count = 1; - var countEl = document.getElementById("count"); + // Get Selected Class + function change_qty_plus_minus(id,plus,minus) { - $("#plus").on("click", function(){ - count++; - countEl.value = count; + var count = 1; + var countEl = document.getElementById(id); - price = $("#unit_price").text(); - $("#total_price").text(count*price); - - set_price = $("#set_unit_price").text(); - $("#set_total_price").text(qty*set_price); - }); - - $("#minus").on("click", function(){ - if (count > 1) { - count--; + $('#'+plus).on("click", function(){ + + count++; countEl.value = count; - price = $("#unit_price").text(); - $("#total_price").text(count*price); - set_price = $("#set_unit_price").text(); - $("#set_total_price").text(qty*set_price); - } - }) + if (id == "count") { + price = $("#unit_price").text(); + $("#total_price").text(count*price); + }else{ + var item_row = $('.selected-instance'); + price = $("#set_unit_price").text(); + set_total_price = $("#set_total_price").text(); + if (item_row.length > 1) { + total = 0 ; + $(item_row).each(function(i){ + total += count * $(item_row[i]).attr('data-price'); + total_price = total; + }); + }else{ + total_price = count*price; + } + + $("#set_total_price").text(total_price); + } + }); + + $('#'+minus).on("click", function(){ + if (count > 1) { + count--; + countEl.value = count; + + if (id=="count") { + price = $("#unit_price").text(); + $("#total_price").text(count*price); + }else{ + var item_row = $('.selected-instance'); + price = $("#set_unit_price").text(); + set_total_price = $("#set_total_price").text(); + + if (item_row.length > 1) { + total = 0 ; + $(item_row).each(function(i){ + total += count * $(item_row[i]).attr('data-price'); + total_price = total; + }); + }else{ + total_price = count*price; + } + $("#set_total_price").text(total_price); + } + } + }) + } // $("#set_change_qty").change(function(){ // qty = $(this).val(); // price = $("#set_total_price").text(); diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb index 1f9d70f3..6c9127ae 100644 --- a/app/controllers/origami/addorders_controller.rb +++ b/app/controllers/origami/addorders_controller.rb @@ -30,10 +30,19 @@ class Origami::AddordersController < BaseOrigamiController else @booking = nil end - - end + def get_menu_category () + if (params[:id]) + #Pull this menu + @menu = MenuCategory.find_by_id(params[:id]) + return @menu + else + MenuCategory.current_menu + end + end + + def create Rails.logger.debug "Order Source - " + params[:order_source].to_s Rails.logger.debug "Table ID - " + params[:table_id].to_s diff --git a/app/views/origami/addorders/_menu_item.json.jbuilder b/app/views/origami/addorders/_menu_item.json.jbuilder new file mode 100644 index 00000000..32451524 --- /dev/null +++ b/app/views/origami/addorders/_menu_item.json.jbuilder @@ -0,0 +1,117 @@ +# Format for attributes json +attr_format = [] +# Format for attributes json +if item.item_attributes.count > 0 + item.item_attributes.each do|attr_id| + menu_attr = MenuItemAttribute.find(attr_id) + if attr_format.count == 0 + attr_format.push({ type: menu_attr.attribute_type, values: [menu_attr.name] }) + next + end + + attr_format.each do |af| + if menu_attr.attribute_type.in? attr_format.map {|k| k[:type]} + if menu_attr.attribute_type == af[:type] + af[:values].push(menu_attr.name) + end + else + new_attr = {type: menu_attr.attribute_type, values: [ menu_attr.name ] } + attr_format.push(new_attr) + break + end + end + end +end + +# Format for option json +opt_format = [] +# Format for attributes json +if item.item_options.count > 0 + item.item_options.each do|opt| + menu_opt = MenuItemOption.find(opt) + if opt_format.count == 0 + opt_format.push({ type: menu_opt.option_type, values: [menu_opt.name] }) + next + end + + opt_format.each do |of| + if menu_opt.option_type.in? opt_format.map {|k| k[:type]} + if menu_opt.option_type == of[:type] + of[:values].push(menu_opt.name) + end + else + new_opt = {type: menu_opt.option_type, values: [ menu_opt.name ] } + opt_format.push(new_opt) + break + end + end + end +end + +#Menu Item Information +json.id item.id +json.code item.item_code +json.name item.name +json.alt_name item.alt_name +json.image item.image_path.url +json.description item.description +json.information item.information +json.type item.type +json.account_id item.account_id +json.min_qty item.min_qty +json.is_available item.is_available +json.is_sub_item item.is_sub_item +json.unit item.unit + +# Item Sets of Menu Item +json.item_sets item.item_sets do |its| + json.id its.id + json.name its.name + json.alt_name its.alt_name + json.min_selectable_qty its.min_selectable_qty + json.max_selectable_qty its.max_selectable_qty + json.instances its.menu_item_instances do |i| + json.id i.id + end +end + +json.attributes attr_format +json.options opt_format +# json.min_selectable_item item.min_selectable_item +# json.max_selectable_item item.max_selectable_item + +#Item instance +# if item.menu_item_instances.count == 1 then +# item_instance = item.menu_item_instances[0] +# json.price = item_instance.price +# json.is_available = item_instance.is_available +# json.is_on_promotion = item_instance.is_on_promotion +# json.promotion_price = item_instance.promotion_price +# json.item_attributes = item_instance.item_attributes + +json.instances item.menu_item_instances do |is| + # Convert id to name for attributes + instance_attr = [] + is.item_attributes.each do |ia| + mItemAttr = MenuItemAttribute.find(ia).name + instance_attr.push(mItemAttr) + end + + json.id is.id + json.code is.item_instance_code + json.name is.item_instance_name + json.price is.price + json.is_available is.is_available + json.is_default is.is_default + json.is_on_promotion is.is_on_promotion + json.promotion_price is.promotion_price + json.values instance_attr + # json.item_sets is.item_sets +end + +#Child Menu items +# if (item.children) then +# json.set_items item.children.each do |item| +# json.partial! 'api/restaurant/menu/menu_item', item: item +# end +# end \ No newline at end of file diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb index c5da651b..34920a1d 100644 --- a/app/views/origami/addorders/detail.html.erb +++ b/app/views/origami/addorders/detail.html.erb @@ -4,7 +4,7 @@
-
-
-
-
- - -
-
+ + + +
+
+
+
+ +
- <% if @jcbcount != 0 %> -
-
- - -
-
+
+
+ <% if @jcbcount != 0 %> +
+
+ +
- <% end %> -
-
- - -
-
-
-
-
- -
0.0
-
-
-
-
+
+
+ <% end %> +
+
+ + +
+
+
+
+
+ +
0.0
+
+
+
+
-
+
-
-
-
-
1
-
2
-
3
-
-
-
4
-
5
-
6
-
-
-
7
-
8
-
9
-
-
-
0
-
.
-
00
-
-
-
Nett
-
Del
-
Clr
-
-
-
-
-
1000
-
3000
-
-
-
5000
-
10000
-
-
-
Pay
-
-
-
- -
- -
- +
+
+
+
1
+
2
+
3
+
+
+
4
+
5
+
6
+
+
+
7
+
8
+
9
+
+
+
0
+
.
+
00
+
+
+
Nett
+
Del
+
Clr
+
+
+
+
+
1000
+
3000
+
+
+
5000
+
10000
+
+
+
Pay
+
+
+ +
+ +
+ +
diff --git a/app/views/origami/master/index.html.erb b/app/views/origami/master/index.html.erb index 6afc1081..14286215 100644 --- a/app/views/origami/master/index.html.erb +++ b/app/views/origami/master/index.html.erb @@ -7,160 +7,177 @@

Master

-
-
-
-
- - -
-
-
- <% if @mastercount != 0 %> -
-
- - -
-
-
- <% end %> -
-
- - -
-
-
-
-
- -
0.0
-
-
-
-
-
-
- -
- -
-
-
-
1
-
2
-
3
-
-
-
4
-
5
-
6
-
-
-
7
-
8
-
9
-
-
-
0
-
.
-
00
-
-
-
Nett
-
Del
-
Clr
-
-
-
-
-
1000
-
3000
-
-
-
5000
-
10000
-
-
-
Pay
-
-
+ + + +
+
+
+
+ + +
+
- + <% if @mastercount != 0 %> +
+
+ + +
+
+
+ <% end %> +
+
+ + +
+
+
+
+ +
0.0
+
+
+
+
+
+
-
- -
+
+ +
+
+
+
1
+
2
+
3
+
+
+
4
+
5
+
6
+
+
+
7
+
8
+
9
+
+
+
0
+
.
+
00
+
+
+
Nett
+
Del
+
Clr
+
+
+
+
+
1000
+
3000
+
+
+
5000
+
10000
+
+
+
Pay
+
+
+
+ +
+ +
+ +
diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb index e8e25b2f..263996b7 100644 --- a/app/views/origami/mpu/index.html.erb +++ b/app/views/origami/mpu/index.html.erb @@ -7,160 +7,178 @@

MPU

-
-
-
-
- - -
-
-
- <% if @mpucount != 0 %> -
-
- - -
-
-
- <% end %> -
-
- - -
-
-
-
-
- -
0.0
-
-
-
-
+ + + +
+
+
+
+ + +
+
+
+ <% if @mpucount != 0 %> +
+
+ + +
+
+
+ <% end %> +
+
+ + +
+
+
+
+
+ +
0.0
+
+
+
+
-
+
-
-
-
-
1
-
2
-
3
-
-
-
4
-
5
-
6
-
-
-
7
-
8
-
9
-
-
-
0
-
.
-
00
-
-
-
Nett
-
Del
-
Clr
-
-
-
-
-
1000
-
3000
-
-
-
5000
-
10000
-
-
-
Pay
-
-
-
- -
- -
- +
+
+
+
1
+
2
+
3
+
+
+
4
+
5
+
6
+
+
+
7
+
8
+
9
+
+
+
0
+
.
+
00
+
+
+
Nett
+
Del
+
Clr
+
+
+
+
+
1000
+
3000
+
+
+
5000
+
10000
+
+
+
Pay
+
+
+ +
+ +
+ +
+ }); + $('#mpu_pay').on('click',function(){ + var amount = $('#amount').text(); + var sale_id = "<%= @sale_id %>"; + if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) ){ + //start member discount 5% by pay card + var sub_total = $('#sub-total').text(); + var member_id = $('#membership_id').text(); + var member_discount = $('#member_discount').text(); + if (member_id && member_discount) { + $.ajax({ + type: "POST", + url: "/origami/" + sale_id + "/member_discount", + data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true }, + // success:function(result){ + // } + }); + } + //end member discount + //Mpu Payment + $.ajax({type: "POST", + url: "<%= origami_payment_mpu_path %>", + data: "amount="+ amount + "&sale_id="+ sale_id, + success:function(result){ + if(result){ + alert("Payment success") + window.location.href = '/origami/sale/'+ sale_id + "/payment"; + } + } + }); + }else{ + alert("Paid Amount is over!") + } + }) + diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 36c4cc0e..f0298e73 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -1,8 +1,8 @@ +
+
-
+
@@ -17,6 +17,8 @@ Customer : <%= @sale_data.customer.name%> + + Customer ID : <%= @sale_data.customer.customer_id%> @@ -26,82 +28,82 @@
- - - - + + + - -
#ItemsQTY +
#ItemsQTY Price -
-
-
- - - <% sub_total = 0 - count = 0 - %> - <% @sale_data.sale_items.each do |sale_item| - count += 1 - %> + + +
+
+
+ + + <% sub_total = 0 + count = 0 + %> + <% @sale_data.sale_items.each do |sale_item| + count += 1 + %> - <% sub_total += sale_item.price%> - + <% sub_total += sale_item.price%> + - - - - <%end %> - -
<%= count %> - <%=sale_item.product_name%>@<%=sale_item.unit_price%> - - <%=sale_item.qty%> - - <%=(sale_item.price)%> -
-
- -
+ <%=sale_item.product_name%>@<%=sale_item.unit_price%> + + + <%=sale_item.qty%> + + + <%=(sale_item.price)%> + + + <%end %> + + +
+ +
+ -->
@@ -123,159 +125,159 @@
<%= @credit %>
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0%> -
-
Other Payments
-
<%= @other %>
-
+
+
Other Payments
+
<%= @other %>
+
<% else %> -
-
Other Payments
-
+
+
Other Payments
+
<% end %> - - <% if @other != 0.0 %> -
-
-
MPU
-
<%= @other %>
-
- <% else %> - - <% end %> - - <% if @ppamount != 0.0 %> -
-
-
Redeem
-
<%= @ppamount %>
-
- <% else %> - - <% end %> - - <% if @visacount != 0.0 %> -
-
-
Visa
-
<%= @visacount %>
-
- <% else %> - - <% end %> - - <% if @jcbcount != 0.0 %> -
-
-
JCB
-
<%= @jcbcount %>
-
- <% else %> - - <% end %> - - <% if @mastercount != 0.0 %> -
-
-
Master
-
<%= @mastercount %>
-
- <% else %> - - <% end %> -
+ + <% if @other != 0.0 %> +
+
+
MPU
+
<%= @other %>
+
+ <% else %> + + <% end %> + + <% if @ppamount != 0.0 %> +
+
+
Redeem
+
<%= @ppamount %>
+
+ <% else %> + + <% end %> + + <% if @visacount != 0.0 %> +
+
+
Visa
+
<%= @visacount %>
+
+ <% else %> + + <% end %> + + <% if @jcbcount != 0.0 %> +
+
+
JCB
+
<%= @jcbcount %>
+
+ <% else %> + + <% end %> + + <% if @mastercount != 0.0 %> +
+
+
Master
+
<%= @mastercount %>
+
+ <% else %> + + <% end %> +
Balance
<%= @sale_data.grand_total %>

-
-
-
-
1
-
2
-
3
-
-
-
4
-
5
-
6
-
-
-
7
-
8
-
9
-
-
-
0
-
.
-
00
-
-
-
Nett
-
Del
-
Clr
-
-
-
-
-
1000
-
3000
-
-
-
5000
-
10000
-
-
-
Pay
-
-
-
+
+
+
+
1
+
2
+
3
+
+
+
4
+
5
+
6
+
+
+
7
+
8
+
9
+
+
+
0
+
.
+
00
+
+
+
Nett
+
Del
+
Clr
+
+
+
+
+
1000
+
3000
+
+
+
5000
+
10000
+
+
+
Pay
+
+
+
-
-
- +
+
+ - - - -
+ + + +
-
+
\ No newline at end of file diff --git a/app/views/origami/visa/index.html.erb b/app/views/origami/visa/index.html.erb index 1589ca1b..bc78608b 100644 --- a/app/views/origami/visa/index.html.erb +++ b/app/views/origami/visa/index.html.erb @@ -7,160 +7,177 @@

VISA

-
-
-
-
- - -
-
-
- <% if @visacount != 0 %> -
-
- - -
-
-
- <% end %> -
-
- - -
-
-
-
-
- -
0.0
-
-
-
-
-
-
- -
- -
-
-
-
1
-
2
-
3
-
-
-
4
-
5
-
6
-
-
-
7
-
8
-
9
-
-
-
0
-
.
-
00
-
-
-
Nett
-
Del
-
Clr
-
-
-
-
-
1000
-
3000
-
-
-
5000
-
10000
-
-
-
Pay
-
-
+ + + +
+
+
+
+ + +
+
- + <% if @visacount != 0 %> +
+
+ + +
+
+
+ <% end %> +
+
+ + +
+
+
+
+ +
0.0
+
+
+
+
+
+
-
- -
+
+ +
+
+
+
1
+
2
+
3
+
+
+
4
+
5
+
6
+
+
+
7
+
8
+
9
+
+
+
0
+
.
+
00
+
+
+
Nett
+
Del
+
Clr
+
+
+
+
+
1000
+
3000
+
+
+
5000
+
10000
+
+
+
Pay
+
+
+
+ +
+ +
+ +
From 07ea214eee4bee0dad30c5ed19ae05065304dbc0 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 14 Sep 2017 17:49:11 +0630 Subject: [PATCH 48/50] update other payment alert box --- app/views/origami/jcb/index.html.erb | 23 ++++++++++++++++++++--- app/views/origami/master/index.html.erb | 23 ++++++++++++++++++++--- app/views/origami/mpu/index.html.erb | 25 +++++++++++++++++++++---- app/views/origami/visa/index.html.erb | 23 ++++++++++++++++++++--- 4 files changed, 81 insertions(+), 13 deletions(-) diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb index 42927273..eaf1f07e 100644 --- a/app/views/origami/jcb/index.html.erb +++ b/app/views/origami/jcb/index.html.erb @@ -174,13 +174,30 @@ $('#jcb_pay').on('click',function(){ data: "amount="+ amount + "&sale_id="+ sale_id, success:function(result){ if(result){ - alert("Payment success") - window.location.href = '/origami/sale/'+ sale_id + "/payment"; + $.confirm({ + title: 'Infomation!', + content: 'Payment Successfully', + buttons: { + confirm: { + text: 'Ok', + btnClass: 'btn-green', + action: function(){ + window.location.href = '/origami/sale/'+ sale_id + "/payment"; + } + } + } + }); } } }); }else{ - alert("Paid Amount is over!"); + $.alert({ + title: 'Alert!', + content: "Paid Amount is over!", + type: 'red', + typeAnimated: true, + btnClass: 'btn-danger', + }); } }) diff --git a/app/views/origami/master/index.html.erb b/app/views/origami/master/index.html.erb index 14286215..ab396252 100644 --- a/app/views/origami/master/index.html.erb +++ b/app/views/origami/master/index.html.erb @@ -171,13 +171,30 @@ data: "amount="+ amount + "&sale_id="+ sale_id, success:function(result){ if(result){ - alert("Payment success") - window.location.href = '/origami/sale/'+ sale_id + "/payment"; + $.confirm({ + title: 'Infomation!', + content: 'Payment Successfully', + buttons: { + confirm: { + text: 'Ok', + btnClass: 'btn-green', + action: function(){ + window.location.href = '/origami/sale/'+ sale_id + "/payment"; + } + } + } + }); } } }); }else{ - alert("Paid Amount is over!"); + $.alert({ + title: 'Alert!', + content: "Paid Amount is over!", + type: 'red', + typeAnimated: true, + btnClass: 'btn-danger', + }); } }) diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb index 263996b7..30d12d35 100644 --- a/app/views/origami/mpu/index.html.erb +++ b/app/views/origami/mpu/index.html.erb @@ -172,13 +172,30 @@ data: "amount="+ amount + "&sale_id="+ sale_id, success:function(result){ if(result){ - alert("Payment success") - window.location.href = '/origami/sale/'+ sale_id + "/payment"; - } + $.confirm({ + title: 'Infomation!', + content: 'Payment Successfully', + buttons: { + confirm: { + text: 'Ok', + btnClass: 'btn-green', + action: function(){ + window.location.href = '/origami/sale/'+ sale_id + "/payment"; + } + } + } + }); + } } }); }else{ - alert("Paid Amount is over!") + $.alert({ + title: 'Alert!', + content: "Paid Amount is over!", + type: 'red', + typeAnimated: true, + btnClass: 'btn-danger', + }); } }) diff --git a/app/views/origami/visa/index.html.erb b/app/views/origami/visa/index.html.erb index bc78608b..073b7e60 100644 --- a/app/views/origami/visa/index.html.erb +++ b/app/views/origami/visa/index.html.erb @@ -171,13 +171,30 @@ data: "amount="+ amount + "&sale_id="+ sale_id, success:function(result){ if(result){ - alert("Payment success") - window.location.href = '/origami/sale/'+ sale_id + "/payment"; + $.confirm({ + title: 'Infomation!', + content: 'Payment Successfully', + buttons: { + confirm: { + text: 'Ok', + btnClass: 'btn-green', + action: function(){ + window.location.href = '/origami/sale/'+ sale_id + "/payment"; + } + } + } + }); } } }); }else{ - alert("Paid Amount is over!"); + $.alert({ + title: 'Alert!', + content: "Paid Amount is over!", + type: 'red', + typeAnimated: true, + btnClass: 'btn-danger', + }); } }) From 77c399d7cd7e0b87e20f8c2cf472dd6e962f1b72 Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 14 Sep 2017 18:23:16 +0630 Subject: [PATCH 49/50] add qr --- app/views/crm/customers/index.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index d0321e95..b0e23e6b 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -129,8 +129,9 @@ $(function() { code2lab.readQRCode(); } - // get CardNo from Java + // get QRCode from Java function setQRCode(code){ + alert(code); $("#search").val(code); } From 3e0371a9fba8ac72e5c7443c77114c876ebb981a Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 15 Sep 2017 14:20:53 +0630 Subject: [PATCH 50/50] done --- app/views/crm/customers/index.html.erb | 8 ++++---- app/views/origami/redeem_payments/index.html.erb | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index b0e23e6b..ca5404ec 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -119,19 +119,19 @@ $(function() { $("#qr_code").on('click', function(e){ var code = ""; setTimeout(function(){ - console.log("hi") - getQRCode(); + var hi=getQRCode(); + alert(hi); },100); }); // Read qrcode from java function getQRCode(){ - code2lab.readQRCode(); + return code2lab.readQRCode(); } // get QRCode from Java function setQRCode(code){ - alert(code); + $("#qr_code").text(code); $("#search").val(code); } diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index a4783010..df4e7cf9 100644 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -147,6 +147,7 @@ $(document).on('click', '.cashier_number', function(event){ return false; } }); + $("#redeem").click(function(){ valid_amount = $("#valid_amount").val(); sale_id = $("#valid_amount").attr('data-value');