-
<%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %>
+
<%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %>
- <% if ENV["SERVER_MODE"] == "cloud" %>
-
- <% else %>
+
<%if @membership.discount && @obj_sale.customer.membership_id %>
<%else%>
<%end%>
- <% end %>
+
<% end %>
<% end %>
@@ -522,30 +520,31 @@
<%= @membership.discount%>
<%= @obj_sale.customer.membership_id rescue 0%>
-
-
-
-
-
+
@@ -715,6 +714,7 @@
$("#first_bill").on('click', function () {
var sale_id = $('#sale_id').val();
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
+ var server_mode =
$.ajax({
type: "GET",
@@ -723,17 +723,40 @@
receipt_no = ($("#receipt_no").html()).trim();
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,"");
-
+
+ // For Server Print - from jade
+ if ($("#server_mode").val() == "cloud") {
+ code2lab.printFile(result.filepath.substr(6), result.printer_url);
+ }
+
+ // console.log(result);
+ // code2lab.printBill(result.filepath, result.printer_model, result.printer_url);
location.reload();
}
- });
+ });
});
+ // click select option icon for add
+ $(document).on('click', '.payment_btn', function(event){
+ active = $(this).hasClass('selected-payment');
+ value = $(this).data('value');
+ type = $(this).data('type');
+ group = $(this).data('group');
+ payments = $(".payment_btn");
+
+ if (active) {
+ $(this).removeClass('selected-payment');
+ }else{
+ $(this).addClass('selected-payment');
+ }
+ }); //End selecct attribute buttom
+
$(".choose_payment").on('click', function () {
$( "#loading_wrapper").show();
var sale_id = $('#sale_id').val();
- type = $('.payment_method').val();
+ // type = $('.payment_method').val();
+ type = get_selected_attributes('selected-payment');
if(parseInt(jQuery.inArray("Credit", type)) == -1){
if (parseInt(jQuery.inArray("MPU", type)) != -1 || parseInt(jQuery.inArray("VISA", type)) != -1 || parseInt(jQuery.inArray("JCB", type)) != -1 || parseInt(jQuery.inArray("Master", type)) != -1 || parseInt(jQuery.inArray("UNIONPAY", type)) != -1 || parseInt(jQuery.inArray("Redeem", type)) != -1) {
calculate_member_discount(sale_id,"Card");
@@ -751,7 +774,11 @@
receipt_no = ($("#receipt_no").html()).trim();
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,type);
- location.reload();
+ // For Server Print - from jade
+ if ($("#server_mode").val() == "cloud") {
+ code2lab.printFile(result.filepath.substr(6), result.printer_url);
+ }
+ location.reload();
}
});
});
@@ -801,7 +828,7 @@
//split bill process
$('#split_bills').click(function(){
var dining_id = "<%= @dining.id %>";
- window.location.href = '/origami/table/' + dining_id + "/split_bills";
+ window.location.href = '/origami/table/' + dining_id + "/" + cashier_type +"/split_bills";
});
$('#move').on('click', function () {
@@ -905,15 +932,19 @@
}, function (isConfirm) {
if (isConfirm) {
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
- var ajax_url = "/origami/sale/" + sale_id + '/void';
+ var ajax_url = "/origami/sale/" + sale_id + '/cashier/void';
var remark = $("#remark").val();
$.ajax({
type: 'POST',
url: ajax_url,
data: "remark="+ remark + "&sale_id=" + sale_id,
- success: function () {
- window.location.href = '/origami/';
+ success: function (result) {
+ // For Server Print - from jade
+ if ($("#server_mode").val() == "cloud") {
+ code2lab.printFile(result.filepath.substr(6), result.printer_url);
+ }
+ window.location.href = '/origami/';
}
});
}
@@ -971,4 +1002,16 @@
window.location.href = '/oqs/'+ assigned_order_item_id + "/edit/"+dining_id;
}
});
+
+ // Get Selected Class
+ function get_selected_attributes(selected_class) {
+ var item_row = $('.'+selected_class);
+ var attribute_arr = [];
+ $(item_row).each(function(i){
+ value = $(item_row[i]).attr('data-value');
+ str = value;
+ attribute_arr.push(str);
+ });
+ return attribute_arr;
+ }
diff --git a/app/views/origami/junction_pay/create.json.jbuilder b/app/views/origami/junction_pay/create.json.jbuilder
new file mode 100755
index 00000000..9767a7d8
--- /dev/null
+++ b/app/views/origami/junction_pay/create.json.jbuilder
@@ -0,0 +1,5 @@
+if(@status)
+ json.status @status
+else
+ json.status false
+end
diff --git a/app/views/origami/junction_pay/index.html.erb b/app/views/origami/junction_pay/index.html.erb
new file mode 100755
index 00000000..cdbdc47d
--- /dev/null
+++ b/app/views/origami/junction_pay/index.html.erb
@@ -0,0 +1,300 @@
+
+
+
+
+
+
<%= @membership_id%>
+
<%= @member_discount%>
+
<%= @sub_total%>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/views/origami/other_charges/index.html.erb b/app/views/origami/other_charges/index.html.erb
index 6a9e1bb6..1423d1a6 100755
--- a/app/views/origami/other_charges/index.html.erb
+++ b/app/views/origami/other_charges/index.html.erb
@@ -309,7 +309,7 @@ var cashier_type = "<%= @cashier_type %>";
var other_charges_items = JSON.stringify(get_other_item_rows());
var ajax_url = "/origami/" + sale_id + "/other_charges";
- var params = { 'sale_id': sale_id, 'sub_total': sub_total, 'other_charges_items': other_charges_items };
+ var params = { 'cashier_type' : cashier_type,'sale_id': sale_id, 'sub_total': sub_total, 'other_charges_items': other_charges_items };
$.ajax({
type: "POST",
diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb
index acd97d0b..8226c75a 100755
--- a/app/views/origami/payments/show.html.erb
+++ b/app/views/origami/payments/show.html.erb
@@ -100,10 +100,10 @@
Tax
(<% @i = 0
@account_arr.each do |ct| %>
- <%=ct.name%>
- <% if @account_arr.count != @i+1%>
- + <% @i =+1 %>
- <%end%>
+ <%=ct.name%>
+ <% if @account_arr.count != @i+1%>
+ + <% @i =+1 %>
+ <%end%>
<%end %>)
|
<%= number_with_precision(@sale_data.total_tax, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%> |
@@ -265,6 +265,20 @@
<%= number_with_precision(0, precision: precision.to_i ) %>
<% end %>
+
+ <% if @junctionpaycount != 0.0 %>
+