| Line 456... |
Line 456... |
| 456 |
var creditLimit = parseInt(localStorage.getItem('creditLimit'));
|
456 |
var creditLimit = parseInt(localStorage.getItem('creditLimit'));
|
| 457 |
var cart_details = localStorage.getItem('cart_details');
|
457 |
var cart_details = localStorage.getItem('cart_details');
|
| 458 |
var totalPayable = parseInt(localStorage.getItem('totalPayable'));
|
458 |
var totalPayable = parseInt(localStorage.getItem('totalPayable'));
|
| 459 |
|
459 |
|
| 460 |
var creditAvailable = $(this).attr('credit_available');
|
460 |
var creditAvailable = $(this).attr('credit_available');
|
| - |
|
461 |
if($('span#CreditError').html()!=''){
|
| 461 |
localStorage.setItem('CreditError',$('span#CreditError').text());
|
462 |
localStorage.setItem('CreditError',$('span#CreditError').html());
|
| - |
|
463 |
}
|
| 462 |
if(creditAvailable=='false'){
|
464 |
if(creditAvailable=='false'){
|
| 463 |
$('button.confirmcredit').prop( "disabled", true );
|
465 |
$('button.confirmcredit').prop( "disabled", true );
|
| 464 |
$('button.confirmcredit').attr('style', 'background-color: #B4CAB4;');
|
466 |
$('button.confirmcredit').attr('style', 'background-color: #B4CAB4;');
|
| 465 |
$('span#CreditError').text('');
|
467 |
$('span#CreditError').html('');
|
| 466 |
}else{
|
468 |
}else{
|
| 467 |
var errorSpanText = localStorage.getItem('CreditError');
|
469 |
var errorSpanText = localStorage.getItem('CreditError');
|
| 468 |
if(cart_details == undefined || creditTicketSize>totalPayable || totalPayable>=creditLimit){
|
470 |
if(cart_details == undefined || creditTicketSize>totalPayable || totalPayable>=creditLimit){
|
| 469 |
$('button.confirmcredit').prop( "disabled", true );
|
471 |
$('button.confirmcredit').prop( "disabled", true );
|
| 470 |
$('button.confirmcredit').attr('style', 'background-color: #B4CAB4;');
|
472 |
$('button.confirmcredit').attr('style', 'background-color: #B4CAB4;');
|
| 471 |
$('span#CreditError').text(errorSpanText);
|
473 |
$('span#CreditError').html(errorSpanText);
|
| 472 |
}else{
|
474 |
}else{
|
| 473 |
$('button.confirmcredit').prop( "disabled", false );
|
475 |
$('button.confirmcredit').prop( "disabled", false );
|
| 474 |
$('button.confirmcredit').attr('style', 'background-color: #5cb85c;color: #fff');
|
476 |
$('button.confirmcredit').attr('style', 'background-color: #5cb85c;color: #fff');
|
| 475 |
}
|
477 |
}
|
| 476 |
}
|
478 |
}
|