remove conflict data

This commit is contained in:
phyusin
2018-07-09 10:12:06 +06:30
parent a60f80a874
commit 96d539f141

View File

@@ -201,6 +201,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- tabs - End --> <!-- tabs - End -->
@@ -289,6 +290,7 @@
<table class="table table-striped" id="order-items-table"> <table class="table table-striped" id="order-items-table">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th class="item-name">Items</th> <th class="item-name">Items</th>
<th class="item-attr">QTY <th class="item-attr">QTY
@@ -298,48 +300,6 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% if @status_order == 'order' && @status_sale != 'sale'
puts
unless @order_items.nil? || @order_items.empty?
count = 0
@order_items.each do |order_item|
set_item_prices = 0
count += 1
sub_total = sub_total + (order_item.price * order_item.qty)
# unless order_item.price == 0 %>
<tr class="<%= @edit_order_origami==true ? 'edit_order' : '' %>" data-id='<%= order_item.order_items_id %>'>
<td><%= count %></td>
<td class='item-name'>
<%= order_item.item_name %>
<% if !order_item.options.nil? && !order_item.options.empty? && order_item.options != "undefined" %>
<% JSON.parse(order_item.options).each do |option| %>
<br><span class="font-13">
<%= option %>
</span>
<% end %>
<% end %>
<% if !order_item.set_menu_items.nil? && order_item.set_menu_items != '[]'
JSON.parse(order_item.set_menu_items).each do |item_instance|
set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f %>
<br><span class="font-13">
<%= item_instance["item_instance_name"] %>
<% if !item_instance["options"].nil? && !item_instance["options"].empty? %>
<% (item_instance["options"]).each do |set_item_option| %>
<br><span class="font-13">
<%= set_item_option %>
</span>
<% end %>
<% end %>
</span>
<% end
sub_total += set_item_prices
end %>
</td>
<td class='item-attr'><%= order_item.qty %></td>
<td class='item-attr'><%= (order_item.qty*order_item.price).to_f + set_item_prices %></td>
</tr>
<% <%
count = 0 count = 0
sub_total = 0 sub_total = 0
@@ -375,21 +335,12 @@
sub_total = sub_total + (order_item.price * order_item.qty) sub_total = sub_total + (order_item.price * order_item.qty)
# unless order_item.price == 0 %> # unless order_item.price == 0 %>
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'> <tr class="<%= @edit_order_origami==true ? 'edit_order' : '' %>" data-id='<%= order_item.order_items_id %>'>
<td><%= count %></td> <td><%= count %></td>
<td class='item-name'> <td class='item-name'>
<%= order_item.item_name %> <%= order_item.item_name %>
<% if !order_item.options.nil? && !order_item.options.empty? && order_item.options != "undefined" %> <% if !order_item.options.nil? && !order_item.options.empty? && order_item.options != "undefined" %>
<% JSON.parse(order_item.options).each do |option| %> <% JSON.parse(order_item.options).each do |option| %>
=======
%>
<tr class="<%= @edit_order_origami==true ? 'edit_order' : '' %>" data-id='<%= order_item.order_items_id %>'>
<td><%= count %>
<td class='item-name'>
<%= order_item.item_name %>
<% if !order_item.options.nil? && !order_item.options.empty? && order_item.options != "undefined" %>
<% JSON.parse(order_item.options).each do |option| %>
>>>>>>> 146f727f462174b1daa31972b597448c12e26d8c
<br><span class="font-13"> <br><span class="font-13">
<%= option %> <%= option %>
</span> </span>
@@ -488,7 +439,7 @@
set_item_prices = 0 set_item_prices = 0
count += 1 count += 1
%> %>
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'> <tr class="<%= @edit_order_origami==true ? 'edit_order' : '' %>" data-id='<%= order_item.order_items_id %>'>
<td><%= count %> <td><%= count %>
<td class='item-name'> <td class='item-name'>
<%= order_item.item_name %> <%= order_item.item_name %>
@@ -794,6 +745,7 @@
</tr> </tr>
</script> </script>
<!-- script data for credit lists --> <!-- script data for credit lists -->
<script> <script>
var cashier_type = "cashier"; var cashier_type = "cashier";
$(document).ready(function () { $(document).ready(function () {
@@ -801,14 +753,13 @@
/* check webview loaded*/ /* check webview loaded*/
var webview = <%= @webview %>; var webview = <%= @webview %>;
showHideNavbar(webview); showHideNavbar(webview);
getCreditSales(); //credit sales script data binding
/* start check first bill or not*/ /* start check first bill or not*/
var receipt_no = ""; var receipt_no = "";
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){ if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
receipt_no = ($("#receipt_no").html()).trim(); receipt_no = ($("#receipt_no").html()).trim();
} }
getCreditSales(); //credit sales script data binding
discount="<%= @membership.discount%>" discount="<%= @membership.discount%>"
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
if (discount) { if (discount) {
@@ -1004,39 +955,6 @@
calculate_member_discount(sale_id,"Cash",tax_type); calculate_member_discount(sale_id,"Cash",tax_type);
} }
} }
});
function calculate_member_discount(sale_id,type,tax_type) {
var sub_total = $('#sub-total').text();
if (type == "Cash") {
is_card = false
}else{
is_card = true
}
$.ajax({
type: "POST",
url: "/origami/" + sale_id + "/member_discount",
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':'cashier','tax_type':tax_type },
async: false,
success:function(result){
}
});
}
$(".choose_payment").on('click', function () {
$( "#loading_wrapper").show();
var sale_id = $('#sale_id').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 || parseInt(jQuery.inArray("PAYMAL",type))!= -1) {
calculate_member_discount(sale_id,"Card");
}else{
calculate_member_discount(sale_id,"Cash");
}
}
var ajax_url = "/origami/sale/" + sale_id + "/first_bill"; var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
$.ajax({ $.ajax({
type: "GET", type: "GET",
@@ -1055,7 +973,7 @@
}); });
}); });
function calculate_member_discount(sale_id,type) { function calculate_member_discount(sale_id,type,tax_type) {
var sub_total = $('#sub-total').text(); var sub_total = $('#sub-total').text();
if (type == "Cash") { if (type == "Cash") {
is_card = false is_card = false
@@ -1065,7 +983,7 @@
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/origami/" + sale_id + "/member_discount", url: "/origami/" + sale_id + "/member_discount",
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':'cashier' }, data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':'cashier','tax_type':tax_type },
async: false, async: false,
success:function(result){ success:function(result){
} }
@@ -1408,8 +1326,9 @@ $('#pay').on('click', function () {
data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: tax_type}, data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: tax_type},
success:function(data){ success:function(data){
if(data.status){ if(data.status){
// console.log(type); alert(tax_type);
localStorage.setItem("tax_type", type); localStorage.setItem("tax_type", tax_type);
alert(localStorage.getItem("tax_type"));
window.location.href = '/origami/table/'+dining_id; window.location.href = '/origami/table/'+dining_id;
} }
} }