change order reservation
This commit is contained in:
@@ -38,6 +38,7 @@ $(function() {
|
||||
});
|
||||
|
||||
function refreshDetailData(){
|
||||
$('#requested_date_time').text("");
|
||||
$("#sr_number").text("");
|
||||
$("#delivery_info").text("");
|
||||
$("#contact_info").text("");
|
||||
@@ -45,6 +46,7 @@ $(function() {
|
||||
$('#sub_total').text("0.00");
|
||||
$('#delivery_fee').text("0.00");
|
||||
$('#total_charges').text("0.00");
|
||||
$('#discount_amount').text("0.00");
|
||||
$('#total_tax').text("0.00");
|
||||
$('#grand_total').text("0.00");
|
||||
}
|
||||
@@ -72,15 +74,7 @@ $(function() {
|
||||
var time = [newDate.getHours() - (isPM && !isMidday ? 12 : 0),
|
||||
newDate.getMinutes() || '00'].join(':') +
|
||||
(isPM ? ' PM' : 'AM');
|
||||
var month = 0;
|
||||
if(parseInt(newDate.getMonth()) > 10){
|
||||
month = parseInt(newDate.getMonth()) + 1;
|
||||
}
|
||||
else{
|
||||
month = '0' + (parseInt(newDate.getMonth()) + 1);
|
||||
}
|
||||
|
||||
var requested_date = newDate.getFullYear() + '-' + month +'-'+ newDate.getDate() +' '+time;
|
||||
var requested_date = newDate.getFullYear() + '-' + (newDate.getMonth() > 10? newDate.getMonth() : '0' + (newDate.getMonth() + 1)) +'-'+ newDate.getDate() +' '+time;
|
||||
|
||||
item_list.empty();
|
||||
|
||||
@@ -103,14 +97,25 @@ $(function() {
|
||||
$('.summary-items').append(row);
|
||||
}
|
||||
|
||||
if(data.discount_amount > 0){
|
||||
$("#discount").show();
|
||||
}
|
||||
|
||||
$('#requested_date_time').text(requested_date);
|
||||
$('#sub_total').text(data.total_amount);
|
||||
$('#delivery_fee').text(delivery.delivery_fee? delivery.delivery_fee : '0.0');
|
||||
$('#total_charges').text(data.convenience_charge?data.convenience_charge : '0.0');
|
||||
$('#delivery_fee').text((parseFloat(delivery.delivery_fee) > 0)? delivery.delivery_fee : '0.0');
|
||||
$('#total_charges').text((parseFloat(data.convenience_charge) > 0)? data.convenience_charge : '0.0');
|
||||
$('#discount_amount').text((parseFloat(data.discount_amount) > 0)? data.discount_amount : '0.0');
|
||||
$('#total_tax').text(data.total_tax);
|
||||
$('#grand_total').text(data.grand_total);
|
||||
|
||||
var address = delivery.address +', ' +delivery.township+", (" +delivery.direction_address+")"
|
||||
var address = delivery.address;
|
||||
if(delivery.township != null && delivery.township!=""){
|
||||
address += ', ' +delivery.township;
|
||||
}else if(delivery.direction_address!=null && delivery.direction_address!=""){
|
||||
address += ", (" +delivery.direction_address+")";
|
||||
}
|
||||
$('#requested_time').text(requested_date);
|
||||
$('#customer_name').text(data.customer_name);
|
||||
$('#phone').text(data.phone);
|
||||
$('#address').text(address);
|
||||
@@ -122,8 +127,10 @@ $(function() {
|
||||
|
||||
if(delivery.delivery_type == "service"){
|
||||
$("#delivery_info").text("(DELIVERY)");
|
||||
}else if(delivery.delivery_type == "self_pick_up"){
|
||||
}else if(delivery.delivery_type == "pick_up"){
|
||||
$("#delivery_info").text("(PICK-UP)");
|
||||
}else{
|
||||
$("#delivery_info").text("(DIRECT DELIVERY)");
|
||||
}
|
||||
|
||||
if(data.order_remark!=null && data.order_remark!=""){
|
||||
@@ -131,7 +138,7 @@ $(function() {
|
||||
}else if(data.reservation_remark!=null && data.reservation_remark!=""){
|
||||
$("#order_remark").text(data.reservation_remark);
|
||||
}
|
||||
$("#sr_number").text("No."+sr_no);
|
||||
$("#sr_number").text("NO."+sr_no);
|
||||
if (data["receipt_no"]) {
|
||||
$("#contact_info").text(data["receipt_no"]);
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user