From 91dbef4f8a693cba3aeb0d014611b944785be1d1 Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 2 Oct 2007 15:11:48 +0000 Subject: [PATCH] missed file in self service support usage improvements --- httemplate/misc/process/timeworked.html | 8 ++++++-- 1 file 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, }; } -- 2.20.1