fixed conflict

This commit is contained in:
Aung Myo
2017-06-11 18:09:00 +06:30
42 changed files with 610 additions and 431 deletions

View File

@@ -18,17 +18,17 @@
$(document).ready(function(){
$(".orders").on('click', function(){
var zone_name=$(this).find(".orders-table").text();
var zone_name=$(this).find(".orders-table").text();
var receipt_no=$(this).find(".orders-receipt-no").text();
var unique_id=$(this).find(".orders-id").text();
var order_status=$(this).find(".orders-order-status").text().trim();
var unique_id = $(this).find(".orders-id").text();
var order_status=$(this).find(".orders-order-status").text().trim();
// Enable/Disable Button
control_button(order_status);
//for customer button
if(unique_id.charAt(0) == 'S'){
$("#customer").removeAttr('disabled');
$("#customer").removeAttr('disabled');
}else{
$("#customer").attr('disabled','disabled');
}
@@ -53,7 +53,7 @@ $(document).ready(function(){
type: "GET",
url: "origami/" + unique_id,
data: { 'id' : unique_id },
success:function(result){
success:function(result){
for (i = 0; i < result.length; i++) {
var data = JSON.stringify(result[i]);
var parse_data = JSON.parse(data);
@@ -82,7 +82,7 @@ $(document).ready(function(){
$("#order-grand-total").text(grand_total_amount);
// Ordered Items
var order_items_rows = "<tr>" +
var order_items_rows = "<tr>" +
"<td class='item-name'>" + parse_data.item_name + "</td>" +
"<td class='item-attr'>" + parse_data.qty + "</td>" +
"<td class='item-attr'>" + parse_data.qty*parse_data.price + "</td>" +
@@ -98,9 +98,9 @@ $(document).ready(function(){
$(this).addClass('selected-item');
});
// Bill Request
// Bill Request
$('#request_bills').click(function() {
var order_id=$(".selected-item").find(".orders-id").text();
var order_id=$(".selected-item").find(".orders-id").text();
if(order_id!=""){
window.location.href = '/origami/request_bills/'+ order_id
}
@@ -110,16 +110,16 @@ $(document).ready(function(){
return false;
});
// Discount for Payment
// Discount for Payment
$('#discount').click(function() {
var order_id=$(".selected-item").find(".orders-id").text();
var order_id=$(".selected-item").find(".orders-id").text();
if(order_id!=""){
window.location.href = '/origami/discount/'+ order_id
}
else {
alert("Please select an order!");
}
}
return false;
});
@@ -129,11 +129,11 @@ $(document).ready(function(){
var sub_total = $('#order-sub-total').text();
var grand_total = $('#order-grand-total').text();
var discount_type = $('#discount-type').val();
var discount_value = $('#discount-amount').val();
var discount_value = $('#discount-amount').val();
var discount_amount = discount_value;
// For Percentage Discount
if(discount_type == 1){
if(discount_type == 1){
discount_amount=(sub_total*discount_value)/100;
}
@@ -155,8 +155,8 @@ $(document).ready(function(){
}
else {
alert("Please select an order!");
}
}
return false;
});
@@ -190,7 +190,7 @@ $(document).ready(function(){
original_value = $('#discount-amount').val();
var input_type = $(this).attr("data-type");
switch (input_type) {
case 'num':
var input_value = $(this).attr("data-value");
@@ -201,7 +201,7 @@ $(document).ready(function(){
else{
$('#discount-amount').val(original_value + '' + input_value);
update_balance();
}
}
break;
case 'add':
@@ -232,16 +232,16 @@ $(document).ready(function(){
});
/* Button Control by Status */
function control_button(order_status){
function control_button(order_status){
if(order_status=="billed"){
$("#request_bills").prop('disabled', true);
$("#discount").prop('disabled', false);
$("#pay").prop('disabled', false);
$("#pay-bill").prop('disabled', false);
}
else if(order_status=="new") {
$("#request_bills").prop('disabled', false);
$("#discount").prop('disabled', true);
$("#pay").prop('disabled', true);
$("#pay-bill").prop('disabled', true);
}
}
@@ -258,9 +258,6 @@ function update_balance(){
}
var total = (parseFloat(sub_total) + parseFloat(tax)) - discount_amount;
$('#order-discount').text(discount_amount);
$('#order-discount').text(discount_amount);
$('#order-grand-total').text(total);
}