Bugzilla – Attachment 5264 Details for
Bug 6832
Validation of total > budget in neworderempty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Fix multiple bugs and refactor the code to fix the alert of the total exceeding the budget in neworderempty
0001-Fix-multiple-bugs-and-refactor-the-code-to-fix-the-a.patch (text/plain), 2.68 KB, created by
Maxime Pelletier
on 2011-09-01 19:55:36 UTC
(
hide
)
Description:
[PATCH] Fix multiple bugs and refactor the code to fix the alert of the total exceeding the budget in neworderempty
Filename:
MIME Type:
Creator:
Maxime Pelletier
Created:
2011-09-01 19:55:36 UTC
Size:
2.68 KB
patch
obsolete
>From f0c36e1cc5fdd71f823eb8721c9c2da65c93689d Mon Sep 17 00:00:00 2001 >From: Maxime Pelletier <maxime.pelletier@libeo.com> >Date: Thu, 1 Sep 2011 15:35:20 -0400 >Subject: [PATCH] Fix multiple bugs and refactor the code to fix the alert of the total exceeding the budget in neworderempty > >--- > koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 36 +++++++------------ > .../prog/en/modules/acqui/neworderempty.tmpl | 2 +- > 2 files changed, 14 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >index 4b65f82..0d74b13 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >@@ -752,30 +752,20 @@ for (i=1;i<=2;i++) { > > //USED BY NEWORDEREMPTY.PL > function totalExceedsBudget(budgetId, total) { >- >- var xmlhttp = null; >- xmlhttp = new XMLHttpRequest(); >- if ( typeof xmlhttp.overrideMimeType != 'undefined') { >- xmlhttp.overrideMimeType('text/xml'); >- } >- >- var url = '../acqui/check_budget_total.pl?budget_id=' + budgetId + "&total=" + total; >- xmlhttp.open('GET', url, false); >- xmlhttp.send(null); >- >- xmlhttp.onreadystatechange = function() { >- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { >- >- actTotal = eval ( xmlhttp.responseText ); >- >- if ( Math.abs(actTotal) < Math.abs(total) ) { >- // if budget is to low :( >- return true ; >- } else { >- return false; >- } >+ budgetTotal = 0; >+ $.ajax({ >+ url: "/cgi-bin/koha/acqui/check_budget_total.pl", >+ async:false, >+ method: "post", >+ data: {budget_id : budgetId, total : total}, >+ success: function(actTotal) { >+ actTotal = Math.abs(actTotal); >+ exceeds = (actTotal < Math.abs(total)) >+ if (exceeds) >+ budgetTotal = actTotal; > } >- } >+ }); >+ return budgetTotal; > } > > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl >index a76cb5c..f365672 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl >@@ -34,7 +34,7 @@ function Check(ff) { > _alertString += "\n- " + _("Total must be a number"); > } > >- if (totalExceedsBudget(ff.budget_id.value, ff.total.value ) ) { >+ if (actTotal = totalExceedsBudget(ff.budget_id.value, ff.total.value ) ) { > ok=1; > _alertString += "\n- " + _("Order total (") + ff.total.value + > _(") exceeds budget available (") + actTotal+")"; >-- >1.5.6.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6832
:
5264
|
6058
|
6895
|
10631
|
11209
|
11425