diff --git a/app/views/origami/discounts/index.html.erb b/app/views/origami/discounts/index.html.erb index d2fd5db8..07d67b84 100644 --- a/app/views/origami/discounts/index.html.erb +++ b/app/views/origami/discounts/index.html.erb @@ -578,24 +578,25 @@ function calculate_item_discount(type, amount, sale_items, account_types){ } } - if(account_types.length > 0){ - var item_rows=get_item_rows(); - if(item_rows.length > 0){ - for(var k=0; k < item_rows.length; k++){ - for(var j=0; j < account_types.length; j++){ - if(item_rows[k].account_id == account_types[j].id){ - // Discount Items - var discount_item_row = item_row_template(type, item_rows[k], dis_amount, amount); - $("#order-items-table tbody").append(discount_item_row); - total_discount = total_discount + amount; - } - } - } - } - else { - alert("No Items!"); - } - } + // No Needs For Auto Selected + // if(account_types.length > 0){ + // var item_rows=get_item_rows(); + // if(item_rows.length > 0){ + // for(var k=0; k < item_rows.length; k++){ + // for(var j=0; j < account_types.length; j++){ + // if(item_rows[k].account_id == account_types[j].id){ + // // Discount Items + // var discount_item_row = item_row_template(type, item_rows[k], dis_amount, amount); + // $("#order-items-table tbody").append(discount_item_row); + // total_discount = total_discount + amount; + // } + // } + // } + // } + // else { + // alert("No Items!"); + // } + // } sub_total = origin_sub_total - total_discount; } @@ -631,27 +632,28 @@ function calculate_item_discount(type, amount, sale_items, account_types){ } } + // No Needs For Auto Selected // Check account types exists - if(account_types.length > 0){ - var item_rows=get_item_rows(); - console.log(account_types); - if(item_rows.length > 0){ - for(var k=0; k < item_rows.length; k++){ - for(var j=0; j < account_types.length; j++){ - if(item_rows[k].account_id == account_types[j].id){ - // Discount Items - dis_amount = 0 - ((item_rows[k].price * amount)/100); - var discount_item_row = item_row_template(type, item_rows[k], dis_amount, amount); - $("#order-items-table tbody").append(discount_item_row); - total_discount = total_discount + dis_amount; - } - } - } - } - else { - alert("No Items!"); - } - } + // if(account_types.length > 0){ + // var item_rows=get_item_rows(); + // console.log(account_types); + // if(item_rows.length > 0){ + // for(var k=0; k < item_rows.length; k++){ + // for(var j=0; j < account_types.length; j++){ + // if(item_rows[k].account_id == account_types[j].id){ + // // Discount Items + // dis_amount = 0 - ((item_rows[k].price * amount)/100); + // var discount_item_row = item_row_template(type, item_rows[k], dis_amount, amount); + // $("#order-items-table tbody").append(discount_item_row); + // total_discount = total_discount + dis_amount; + // } + // } + // } + // } + // else { + // alert("No Items!"); + // } + // } sub_total = origin_sub_total + total_discount; } diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 505050eb..120f0203 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -360,7 +360,7 @@ $( document ).ready(function() { if($('#balance').text() < 0){ $.confirm({ - title: 'Hi!', + title: 'Infomation!', content: 'Changed amount ' + $('#balance').text() * (-1), buttons: { confirm: { @@ -377,7 +377,7 @@ $( document ).ready(function() { $('#pay').text("Pay") $.confirm({ - title: 'Hi!', + title: 'Infomation!', content: 'Thank you !', buttons: { confirm: {