|
Lines 752-781
for (i=1;i<=2;i++) {
Link Here
|
| 752 |
|
752 |
|
| 753 |
//USED BY NEWORDEREMPTY.PL |
753 |
//USED BY NEWORDEREMPTY.PL |
| 754 |
function totalExceedsBudget(budgetId, total) { |
754 |
function totalExceedsBudget(budgetId, total) { |
| 755 |
|
755 |
budgetTotal = 0; |
| 756 |
var xmlhttp = null; |
756 |
$.ajax({ |
| 757 |
xmlhttp = new XMLHttpRequest(); |
757 |
url: "/cgi-bin/koha/acqui/check_budget_total.pl", |
| 758 |
if ( typeof xmlhttp.overrideMimeType != 'undefined') { |
758 |
async:false, |
| 759 |
xmlhttp.overrideMimeType('text/xml'); |
759 |
method: "post", |
| 760 |
} |
760 |
data: {budget_id : budgetId, total : total}, |
| 761 |
|
761 |
success: function(actTotal) { |
| 762 |
var url = '../acqui/check_budget_total.pl?budget_id=' + budgetId + "&total=" + total; |
762 |
actTotal = Math.abs(actTotal); |
| 763 |
xmlhttp.open('GET', url, false); |
763 |
exceeds = (actTotal < Math.abs(total)) |
| 764 |
xmlhttp.send(null); |
764 |
if (exceeds) |
| 765 |
|
765 |
budgetTotal = actTotal; |
| 766 |
xmlhttp.onreadystatechange = function() { |
|
|
| 767 |
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { |
| 768 |
|
| 769 |
actTotal = eval ( xmlhttp.responseText ); |
| 770 |
|
| 771 |
if ( Math.abs(actTotal) < Math.abs(total) ) { |
| 772 |
// if budget is to low :( |
| 773 |
return true ; |
| 774 |
} else { |
| 775 |
return false; |
| 776 |
} |
| 777 |
} |
766 |
} |
| 778 |
} |
767 |
}); |
|
|
768 |
return budgetTotal; |
| 779 |
} |
769 |
} |
| 780 |
|
770 |
|
| 781 |
|
771 |
|