order quries update

This commit is contained in:
Yan
2017-06-12 20:14:20 +06:30
10 changed files with 66 additions and 46 deletions

View File

@@ -190,11 +190,17 @@ $(document).ready(function(){
function show_customer_details(customer_id){
$('.customer_detail').removeClass('hide');
if(window.location.pathname.substring(0, 12) == "/origami/SAL"){
var url = customer_id+"/get_customer/"
}else{
var url = "origami/"+customer_id+"/get_customer/"
}
$('.customer_detail').removeClass('hide');
//Start Ajax
$.ajax({
type: "GET",
url: "origami/"+customer_id+"/get_customer/",
$.ajax({
type: "GET",
url: url,
data: {},
dataType: "json",
success: function(data) {
@@ -203,10 +209,10 @@ $(document).ready(function(){
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
var balance = data["response_data"]["data"][i]["balance"];
console.log(balance);
if (balance) {
$("#customer_amount").text(balance);
if (balance == "0.0") {
$("#customer_amount").text('0.0');
}else{
$("#customer_amount").text('00');
$("#customer_amount").text(balance);
}