diff --git a/app/assets/javascripts/foodcourt.js b/app/assets/javascripts/foodcourt.js
new file mode 100644
index 00000000..4febbe86
--- /dev/null
+++ b/app/assets/javascripts/foodcourt.js
@@ -0,0 +1,186 @@
+//= require jquery
+//= require tether
+//= require jquery_ujs
+//= require bootstrap/js/popper.min
+//= require bootstrap/js/bootstrap-material-design.min
+//= require momentjs/moment
+//= require bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker
+//= require jquery-slimscroll/jquery.slimscroll.js
+//= require bootstrap-notify/bootstrap-notify.js
+//= require node-waves/waves.js
+//= require sweetalert/sweetalert.min.js
+//= require fileinput.min
+//= require cable
+//= require turbolinks
+//= require BSBMaterial/turbolink_admin.js
+//= require BSBMaterial/demo.js
+
+/* Constant Varaibles */
+_CREDIT_PAYMENTS_ = "/ CREDIT PAYMENTS";
+_CUSTOMERS_ = "/ CUSTOMERS";
+_DISCOUNTS_ = "/ DISCOUNTS";
+_IN_DUTIES_ = "/ IN DUTIES";
+_JCB_ = "/ JCB PAYMENT";
+_MASTER_ = "/ MASTER PAYMENT";
+_MPU_ = "/ MPU PAYMENT";
+_ALIPAY_ = "/ Alipay";
+_JUNCTIONPAY_ = "/ JunctionPay";
+_PAYMAL_ = "/ PAYMAL";
+_DINGA_ = "/ DINGA PAYMENT";
+_GIFT_VOUCHER_ = "/ GIFT VOUCHER";
+_OTHER_CHARGES_ = "/ CHARGES";
+_OTHER_PAYMENTS_ = "/ OTHER PAYMENT";
+_PAYMENTS_ = "/ PAYMENT";
+_PAYPAR_PAYMENT_ = "/ PAYPAR PAYMENT";
+_COMMISSIONS_ = "/ COMMISSIONS";
+_REDEEM_PAYMENT_ = "/ REDEEM PAYMENT";
+_SALE_EDIT_ = "/ SALE EDIT";
+_SPLIT_BILL_ = "/ SPLIT BILL";
+_UNION_ = "/ UNION PAYMENT";
+_VISA_ = "/ VISA PAYMENT";
+_VOUCHER_ = "/ VOUCHER";
+_SURVEY_ = "/ SURVEY";
+/* Constant Varaibles */
+
+$(document).on('turbolinks:load', function() {
+
+ $("#customer_image_path").fileinput({
+ previewFileType: "image",
+ allowedFileExtensions: ["jpg", "gif", "png"],
+ browseClass: "btn btn-success",
+ browseLabel: "Pick Image",
+ browseIcon: " ",
+ removeClass: "btn btn-danger",
+ removeLabel: "Delete",
+ removeIcon: " ",
+ showUpload: false,
+ // uploadClass: "btn btn-info",
+ // uploadLabel: "Upload",
+ // uploadIcon: " ",
+ previewTemplates: {
+ image: '
<% if !@booking.nil?%>
-
+
<% else %>
<% end %>
@@ -57,80 +58,168 @@
<% if !@booking.nil?%>
-
diff --git a/app/views/foodcourt/payments/show.html.erb b/app/views/foodcourt/payments/show.html.erb
index 336c7a2d..859f35b9 100755
--- a/app/views/foodcourt/payments/show.html.erb
+++ b/app/views/foodcourt/payments/show.html.erb
@@ -389,53 +389,22 @@
-
- <% if current_login_employee.role == "cashier" %>
- <% if @other_payment <= 0 && @sale_payment.nil? %>
+ <% if @sale_payment.nil? %>
+
+ <% if @other_payment <= 0 %>
<%if @sale_data.total_discount == 0 %>
-
FOC
- <% end %>
- <%end %>
- <% if @sale_payment.nil? %>
-
Void
- <% if @other_payment <= 0 %>
- <%if @sale_data.total_discount == 0 %>
-
Waste
-
Spoile
- <% end %>
- <% end %>
- <% end %>
- <% else %>
- <% if @other_payment <= 0 && @sale_payment.nil?%>
- <%if @sale_data.total_discount == 0 %>
-
- <%end %>
- <%end %>
- <% if @sale_payment.nil? %>
-
- <% if @other_payment <= 0 %>
- <%if @sale_data.total_discount == 0 %>
-
-
- <% end %>
+
+
<% end %>
<% end %>
<% end %>
-
-<% if (@cashier_type=="quick_service" || @cashier_type=="food_court") && @sale_payment.nil? %>
-
- <% if current_login_employee.role == "cashier" %>
-
Edit
- <% else %>
-
- <% end %>
-
-
-
-
+ <% if @sale_payment.nil? %>
+
+
+
+
<%end %>
">
@@ -1313,55 +1282,6 @@ $(document).ready(function(){
var sale_id = $("#sale_id").text() || 0;
update_sale("", customer_id, customer_name, sale_id);
});
-
- $(document).on('click', '.access_modal', function(event){
- type = $(this).data("type");
- $(".ok").attr("data-action",type)
- $('#AccessCodeModal').modal('show');
- });
-
- function check_emp_access_code(access_code,type) {
- var url = "/foodcourt/check_emp_access_code/" + access_code ;
- $.ajax({
- type: 'POST',
- url: url,
- data: {},
- success: function (result) {
- // console.log(result)
- if (result.status == true) {
- createAccessCode(code);
- if (type == "edit") {
- var dining_id = $('#dining').text();
- var sale_id = $('#sale_id').text();
- if (dining_id) {
- window.location.href = '/foodcourt/table/' + dining_id + "/sale/" + sale_id + "/"+cashier_type+"/edit";
- }else{
- window.location.href = "/foodcourt/table/sale/" + sale_id + "/"+cashier_type+"/edit";
- }
- }else if(type == "void"){
- $('#AccessCodeModal').modal('hide');
- $('#voidModal').modal('show');
- // overall_void();
- }else if(type == "waste") {
- // $('#AccessCodeModal').modal('hide');
- // $('#focModal').modal('show');
- waste_and_spoilage("waste")
- }else if(type == "spoile") {
- // $('#AccessCodeModal').modal('hide');
- // $('#voidModal').modal('show');
- waste_and_spoilage("spoile")
- }else if(type == "foc"){
- $('#AccessCodeModal').modal('hide');
- $('#focModal').modal('show');
- // overall_foc();
- }
- }else{
- swal("Oops",result.message,"warning");
- }
- }
- });
- }
-
$('#foc').on('click', function () {
var access_code = localStorage.getItem("access_code");
var remark = $("#foc_remark").val();
@@ -1417,50 +1337,6 @@ $(document).ready(function(){
});
});
- $('#void').on('click', function () {
- var access_code = localStorage.getItem("access_code");
- swal({
- title: "Alert",
- text: "Are you sure want to Void?",
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "Yes, void it!",
- closeOnConfirm: false
- }, function (isConfirm) {
- if (isConfirm) {
- $('.confirm').prop("disabled",true);
- var sale_id = $('#sale_id').text();
- var remark = $("#remark").val();
- var ajax_url = "/foodcourt/sale/" + sale_id +'/'+cashier_type+ '/void';
- $.ajax({
- type: 'POST',
- url: ajax_url,
- data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
- success: function (result) {result
- customer_display_view(null,"reload");
- // For Server Print - from jade
- if ($("#server_mode").val() == "cloud") {
- if(typeof code2lab != 'undefined'){
- code2lab.printFile(result.filepath.substr(6), result.printer_url);
- }
- }
- var flag = localStorage.getItem("trans_flag");
- if((flag!=null) && (flag != "true")){
- window.location.href = '/transactions/sales/'+sale_id;
- }else{
- if (cashier_type=="cashier") {
- window.location.href = '/foodcourt';
- }else{
- window.location.href = '/foodcourt/'+cashier_type;
- }
- }
- }
- })
- }
- });
- });
-
function waste_and_spoilage(remark) {
var access_code = localStorage.getItem("access_code");
var sale_id = $('#sale_id').text();
@@ -1784,4 +1660,39 @@ $(document).ready(function(){
}
},100);
});
+ $('#void').on('click', function () {
+ alert("in void");
+ var access_code = localStorage.getItem("access_code");
+ swal({
+ title: "Alert",
+ text: "Are you sure want to Void?",
+ type: "warning",
+ showCancelButton: true,
+ confirmButtonColor: "#DD6B55",
+ confirmButtonText: "Yes, void it!",
+ closeOnConfirm: false
+ }, function (isConfirm) {
+ if (isConfirm) {
+ $('.confirm').prop("disabled",true);
+ var sale_id = $('#sale_id').text();
+ var remark = $("#remark").val();
+ var ajax_url = "/foodcourt/sale/" + sale_id +'/food_court/void';
+ $.ajax({
+ type: 'POST',
+ url: ajax_url,
+ data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
+ success: function (result) {result
+ customer_display_view(null,"reload");
+ // For Server Print - from jade
+ if ($("#server_mode").val() == "cloud") {
+ if(typeof code2lab != 'undefined'){
+ code2lab.printFile(result.filepath.substr(6), result.printer_url);
+ }
+ }
+ window.location.href = '/foodcourt/food_court';
+ }
+ })
+ }
+ });
+ });
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index 3b4a86c9..08464b45 100755
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -62,3 +62,5 @@ Rails.application.config.assets.precompile += %w( reservation.css )
Rails.application.config.assets.precompile += %w( reservation.js )
Rails.application.config.assets.precompile += %w( custom.js )
+
+Rails.application.config.assets.precompile += %w( foodcourt.js )
diff --git a/config/puma.rb b/config/puma.rb
index d24425ae..f0013d25 100755
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -1,11 +1,11 @@
-application_path="#{File.expand_path("../..", __FILE__)}"
-directory application_path
-#environment ENV.fetch("RAILS_ENV") { "production" }
-environment "production"
-pidfile "#{application_path}/tmp/puma/pid"
-state_path "#{application_path}/tmp/puma/state"
-stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
-port ENV.fetch("PORT") { 62158 }
-workers 2
-preload_app!
-threads 1,1
+# application_path="#{File.expand_path("../..", __FILE__)}"
+# directory application_path
+# #environment ENV.fetch("RAILS_ENV") { "production" }
+# environment "production"
+# pidfile "#{application_path}/tmp/puma/pid"
+# state_path "#{application_path}/tmp/puma/state"
+# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
+# port ENV.fetch("PORT") { 62158 }
+# workers 2
+# preload_app!
+# threads 1,1
diff --git a/server2.pid b/server2.pid
index 14ad7c64..489250e3 100644
--- a/server2.pid
+++ b/server2.pid
@@ -1 +1 @@
-12343
\ No newline at end of file
+3072
\ No newline at end of file