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