[freeside-commits] freeside/httemplate/misc/process timeworked.html, 1.4, 1.5

Jeff Finucane,420,, jeff at wavetail.420.am
Fri Oct 5 12:53:19 PDT 2007


Update of /home/cvs/cvsroot/freeside/httemplate/misc/process
In directory wavetail:/tmp/cvs-serv16969/httemplate/misc/process

Modified Files:
	timeworked.html 
Log Message:
new ui for assigning support time

Index: timeworked.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/process/timeworked.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- timeworked.html	2 Oct 2007 15:11:48 -0000	1.4
+++ timeworked.html	5 Oct 2007 19:53:16 -0000	1.5
@@ -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 @@
       $seconds{$_} += $adjustment;
       last;
     }
+  } else {
+    die "unexpectedly cannot apportion time";
   }
 
   foreach my $customer ( grep {$seconds{$_}} keys %seconds ) {



More information about the freeside-commits mailing list