Lines 728-734
for (i=1;i<=2;i++) {
Link Here
|
728 |
url: url, |
728 |
url: url, |
729 |
mimeType: 'text/xml', |
729 |
mimeType: 'text/xml', |
730 |
success: function (data, textStatus, xmlhttp) { |
730 |
success: function (data, textStatus, xmlhttp) { |
731 |
// rc = eval ( xmlhttp.responseText ); |
|
|
732 |
var retRootType = jQuery(xmlhttp.responseXML).children().first().get(0).nodeName.toLowerCase(); |
731 |
var retRootType = jQuery(xmlhttp.responseXML).children().first().get(0).nodeName.toLowerCase(); |
733 |
var hasInputs = $sort_zone.has('input').length > 0; |
732 |
var hasInputs = $sort_zone.has('input').length > 0; |
734 |
if (hasInputs && retRootType == 'input') { |
733 |
if (hasInputs && retRootType == 'input') { |
Lines 757-763
function totalExceedsBudget(budgetId, total) {
Link Here
|
757 |
mimeType: 'text/xml', |
756 |
mimeType: 'text/xml', |
758 |
async: false, // non-async because we need to return a value based on the result |
757 |
async: false, // non-async because we need to return a value based on the result |
759 |
success: function(data, textStatus, xmlhttp) { |
758 |
success: function(data, textStatus, xmlhttp) { |
760 |
actTotal = eval ( xmlhttp.responseText ); |
759 |
actTotal = parseFloat ( xmlhttp.responseText ); |
761 |
|
760 |
|
762 |
if ( Math.abs(actTotal) < Math.abs(total) ) { |
761 |
if ( Math.abs(actTotal) < Math.abs(total) ) { |
763 |
// if budget is to low :( |
762 |
// if budget is to low :( |
Lines 788-798
if ( newBudgetParent ) { url += '&parent_id=' + newBudgetParent};
Link Here
|
788 |
mimeType: 'text/xml', |
787 |
mimeType: 'text/xml', |
789 |
async: false, // non-async because we need to return a value based on the result |
788 |
async: false, // non-async because we need to return a value based on the result |
790 |
success: function(data, textStatus, xmlhttp) { |
789 |
success: function(data, textStatus, xmlhttp) { |
791 |
var result = eval ( xmlhttp.responseText ); |
790 |
var result = parseInt ( xmlhttp.responseText ); |
792 |
|
791 |
|
793 |
if (result == '1') { |
792 |
if (result == 1) { |
794 |
ret = _("- Budget total exceeds parent allocation\n"); |
793 |
ret = _("- Budget total exceeds parent allocation\n"); |
795 |
} else if (result == '2') { |
794 |
} else if (result == 2) { |
796 |
ret = _("- Budget total exceeds period allocation\n"); |
795 |
ret = _("- Budget total exceeds period allocation\n"); |
797 |
} else { |
796 |
} else { |
798 |
ret = false; |
797 |
ret = false; |
Lines 814-824
function checkBudgetParent(budgetId, newBudgetParent) {
Link Here
|
814 |
mimeType: 'text/xml', |
813 |
mimeType: 'text/xml', |
815 |
async: false, // non-async because we need to return a value based on the result |
814 |
async: false, // non-async because we need to return a value based on the result |
816 |
success: function(data, textStatus, xmlhttp) { |
815 |
success: function(data, textStatus, xmlhttp) { |
817 |
var result = eval ( xmlhttp.responseText ); |
816 |
var result = parseInt ( xmlhttp.responseText ); |
818 |
|
817 |
|
819 |
if (result == '1') { |
818 |
if (result == 1) { |
820 |
return _("- New budget-parent is beneath budget\n"); |
819 |
return _("- New budget-parent is beneath budget\n"); |
821 |
// } else if (result == '2') { |
820 |
// } else if (result == 2) { |
822 |
// return "- New budget-parent has insufficent funds\n"; |
821 |
// return "- New budget-parent has insufficent funds\n"; |
823 |
// } else { |
822 |
// } else { |
824 |
// return false; |
823 |
// return false; |
825 |
- |
|
|