|
Lines 780-809
for (i=1;i<=2;i++) {
Link Here
|
| 780 |
|
780 |
|
| 781 |
//USED BY NEWORDEREMPTY.PL |
781 |
//USED BY NEWORDEREMPTY.PL |
| 782 |
function totalExceedsBudget(budgetId, total) { |
782 |
function totalExceedsBudget(budgetId, total) { |
| 783 |
|
783 |
budgetTotal = 0; |
| 784 |
var xmlhttp = null; |
784 |
$.ajax({ |
| 785 |
xmlhttp = new XMLHttpRequest(); |
785 |
url: "/cgi-bin/koha/acqui/check_budget_total.pl", |
| 786 |
if ( typeof xmlhttp.overrideMimeType != 'undefined') { |
786 |
async:false, |
| 787 |
xmlhttp.overrideMimeType('text/xml'); |
787 |
method: "post", |
| 788 |
} |
788 |
data: {budget_id : budgetId, total : total}, |
| 789 |
|
789 |
success: function(actTotal) { |
| 790 |
var url = '../acqui/check_budget_total.pl?budget_id=' + budgetId + "&total=" + total; |
790 |
actTotal = Math.abs(actTotal); |
| 791 |
xmlhttp.open('GET', url, false); |
791 |
exceeds = (actTotal < Math.abs(total)) |
| 792 |
xmlhttp.send(null); |
792 |
if (exceeds) |
| 793 |
|
793 |
budgetTotal = actTotal; |
| 794 |
xmlhttp.onreadystatechange = function() { |
|
|
| 795 |
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { |
| 796 |
|
| 797 |
actTotal = eval ( xmlhttp.responseText ); |
| 798 |
|
| 799 |
if ( Math.abs(actTotal) < Math.abs(total) ) { |
| 800 |
// if budget is to low :( |
| 801 |
return true ; |
| 802 |
} else { |
| 803 |
return false; |
| 804 |
} |
| 805 |
} |
794 |
} |
| 806 |
} |
795 |
}); |
|
|
796 |
return budgetTotal; |
| 807 |
} |
797 |
} |
| 808 |
|
798 |
|
| 809 |
|
799 |
|