origamijs

This commit is contained in:
Aung Myo
2017-06-12 18:23:12 +06:30
parent e6647dd494
commit b14f4d67a5
2 changed files with 12 additions and 6 deletions

View File

@@ -188,11 +188,17 @@ $(document).ready(function(){
function show_customer_details(customer_id){
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/",
url: url,
data: {},
dataType: "json",
success: function(data) {
@@ -201,10 +207,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);
}