diff options
-rw-r--r-- | httemplate/misc/process/timeworked.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/httemplate/misc/process/timeworked.html b/httemplate/misc/process/timeworked.html index 8e1a66336..9f0399531 100644 --- a/httemplate/misc/process/timeworked.html +++ b/httemplate/misc/process/timeworked.html @@ -10,14 +10,17 @@ die "access denied" 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 $seconds = $cgi->param("seconds$transaction"); - my %seconds = map { $_ => sprintf("%.0f", $seconds * $multipliers{$_}) } - (keys %multipliers); + my %seconds = + map { $_ => sprintf("%.0f", $seconds * $multipliers{$_} / $msum) } + (keys %multipliers); my $sum = 0; my $count = 0; foreach (values %seconds) { @@ -39,6 +42,7 @@ foreach my $transaction ( 'custnum' => $customer, 'transaction_id' => $transaction, 'seconds' => $seconds{$customer}, + 'support' => $seconds{$customer} * $msum, }; } |