diff options
author | jeff <jeff> | 2007-10-05 19:53:16 +0000 |
---|---|---|
committer | jeff <jeff> | 2007-10-05 19:53:16 +0000 |
commit | b22e443f60965aa415b3b190b3ec6875e034dafb (patch) | |
tree | 6632e25f1b659cf41f3aa7f0badfba253c0cab50 /httemplate/misc/process | |
parent | 9eb843fefb50d8ca26a8941f2ebdf4d41b6dd0db (diff) |
new ui for assigning support time
Diffstat (limited to 'httemplate/misc/process')
-rw-r--r-- | httemplate/misc/process/timeworked.html | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/httemplate/misc/process/timeworked.html b/httemplate/misc/process/timeworked.html index 9f03995..c589d76 100644 --- a/httemplate/misc/process/timeworked.html +++ b/httemplate/misc/process/timeworked.html @@ -8,15 +8,16 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Time queue'); -my %multipliers = map { /^custnum(\d+)$/; ($cgi->param("custnum$1") => $cgi->param("multiplier$1")); } - grep /^custnum\d+$/, $cgi->param; -my $msum = 0; -foreach(values %multipliers) {$msum += $_}; - my @acct_rt_transaction; foreach my $transaction ( map { /^transactionid(\d+)$/; $1; } grep /^transactionid\d+$/, $cgi->param ) { + my $s = "multiplier${transaction}_"; + my %multipliers = map { /^$s(\d+)$/; $1 => $cgi->param("$s$1"); } + grep /^$s\d+$/, $cgi->param; + my $msum = 0; + foreach(values %multipliers) {$msum += $_}; + my $seconds = $cgi->param("seconds$transaction"); my %seconds = map { $_ => sprintf("%.0f", $seconds * $multipliers{$_} / $msum) } @@ -35,6 +36,8 @@ foreach my $transaction ( $seconds{$_} += $adjustment; last; } + } else { + die "unexpectedly cannot apportion time"; } foreach my $customer ( grep {$seconds{$_}} keys %seconds ) { |