projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[0005214] Stock Check Sheet: changed option name to less confusing for shortages...
[fa-stable.git]
/
js
/
payalloc.js
diff --git
a/js/payalloc.js
b/js/payalloc.js
index 165732795345a6a951348c7b24b2ed365d00807b..a711e603cb40daf97dcc8924cefb339c5714eabd 100644
(file)
--- a/
js/payalloc.js
+++ b/
js/payalloc.js
@@
-14,7
+14,10
@@
function focus_alloc(i) {
}
function blur_alloc(i) {
}
function blur_alloc(i) {
- var change = Math.min(get_amount(i.name), get_amount('maxval'+i.name.substr(6), 1))
+ var change = get_amount(i.name);
+
+ if (i.name != 'amount' && i.name != 'charge' && i.name != 'discount')
+ change = Math.min(change, get_amount('maxval'+i.name.substr(6), 1))
price_format(i.name, change, user.pdec);
if (i.name != 'amount' && i.name != 'charge') {
price_format(i.name, change, user.pdec);
if (i.name != 'amount' && i.name != 'charge') {
@@
-53,12
+56,20
@@
function allocate_none(doc) {
var allocations = {
'.amount': function(e) {
var allocations = {
'.amount': function(e) {
- e.onblur = function() {
- blur_alloc(this);
+ if(e.name == 'allocated_amount' || e.name == 'bank_amount')
+ {
+ e.onblur = function() {
+ var dec = this.getAttribute("dec");
+ price_format(this.name, get_amount(this.name), dec);
};
};
- e.onfocus = function() {
- focus_alloc(this);
- };
+ } else {
+ e.onblur = function() {
+ blur_alloc(this);
+ };
+ e.onfocus = function() {
+ focus_alloc(this);
+ };
+ }
}
}
}
}