remove conflict

This commit is contained in:
phyusin
2018-07-09 09:44:36 +06:30
35 changed files with 257 additions and 126 deletions

View File

@@ -323,7 +323,7 @@
sub_total = sub_total + (order_item.price * order_item.qty)
# 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 class='item-name'>
<%= order_item.item_name %>
@@ -427,7 +427,7 @@
set_item_prices = 0
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 class='item-name'>
<%= order_item.item_name %>
@@ -742,7 +742,7 @@
<script>
var cashier_type = "cashier";
$(document).ready(function(){
localStorage.removeItem("tax_type");
// localStorage.removeItem("tax_type");
/* check webview loaded*/
var webview = <%= @webview %>;
showHideNavbar(webview);
@@ -963,14 +963,14 @@ $(".choose_payment").on('click', function () {
$( "#loading_wrapper").show();
var sale_id = $('#sale_id').val();
type = get_selected_attributes('selected-payment');
var tax_type = localStorage.getItem("tax_type") ? localStorage.getItem("tax_type") : 'all';
// type = $('.payment_method').val();
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");
calculate_member_discount(sale_id,"Card",tax_type);
}else{
calculate_member_discount(sale_id,"Cash");
calculate_member_discount(sale_id,"Cash",tax_type);
}
}
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
@@ -992,7 +992,7 @@ $(".choose_payment").on('click', function () {
}
});
});
function calculate_member_discount(sale_id,type) {
function calculate_member_discount(sale_id,type,tax_type) {
var sub_total = $('#sub-total').text();
if (type == "Cash") {
is_card = false
@@ -1002,12 +1002,11 @@ function calculate_member_discount(sale_id,type) {
$.ajax({
type: "POST",
url: "/origami/" + sale_id + "/member_discount",
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card },
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){
}
});
}
$('#pay').on('click',function() {
@@ -1369,7 +1368,7 @@ $('#add_invoice').on('click',function(){
});
$("button[name=tax_type]").on("click", function(){
var type = $(this).attr("data-value");
var tax_type = $(this).attr("data-value");
var cashier_type = 'cashier';
var sale_id = $('#sale_id').text();
var dining_id = "<%= @room.id rescue "" %> ";
@@ -1388,11 +1387,11 @@ $('#add_invoice').on('click',function(){
$.ajax({
type: "POST",
url: "/origami/payment/"+cashier_type+"/change_tax",
data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: type},
data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: tax_type},
success:function(data){
if(data.status){
// console.log(type);
localStorage.setItem("tax_type", type);
// console.log(tax_type);
localStorage.setItem("tax_type", tax_type);
window.location.href = '/origami/room/'+dining_id;
}
}