[freeside-commits] freeside/httemplate/edit part_bill_event.cgi, 1.25, 1.26

Ivan,,, ivan at wavetail.420.am
Sun Nov 27 13:59:26 PST 2005


Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv12216/httemplate/edit

Modified Files:
	part_bill_event.cgi 
Log Message:
per-agent billco spools

Index: part_bill_event.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_bill_event.cgi,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- part_bill_event.cgi	1 Nov 2005 05:14:08 -0000	1.25
+++ part_bill_event.cgi	27 Nov 2005 21:59:24 -0000	1.26
@@ -223,7 +223,7 @@
                                    );',
     'html' =>
         '<TABLE BORDER=0>'.
-        '<TR><TD align="right">Format ("default" or "billco"): </TD>'.
+        '<TR><TD ALIGN="right">Format ("default" or "billco"): </TD>'.
           '<TD>'.
             '<!--'.
             '<SELECT NAME="ftpformat">'.
@@ -251,31 +251,58 @@
 
   'spool_csv' => {
     'name' => 'Spool CSV invoice data',
-    'code' => '$cust_bill->spool_csv( \'format\' => \'%%%spoolformat%%%\',
-                                      \'dest\'   => \'%%%spooldest%%%\',
-                                    );',
-    'html' =>
-        '<TABLE BORDER=0>'.
-        '<TR><TD align="right">Format ("default" or "billco"): </TD>'.
-          '<TD>'.
-            '<!--'.
-            '<SELECT NAME="spoolformat">'.
-              '<OPTION VALUE="default">Default'.
-              '<OPTION VALUE="billco">Billco'.
-            '</SELECT>'.
-            '-->'.
-            '<INPUT TYPE="text" NAME="spoolformat" VALUE="%%%spoolformat%%%">'.
-          '</TD></TR>'.
-        '<TR><TD align="right">For destination: </TD>'.
-          '<TD>'.
-            '<SELECT NAME="spooldest">'.
-              '<OPTION VALUE="">(all)'.
-              '<OPTION VALUE="POST">Postal mail'.
-              '<OPTION VALUE="EMAIL">Email'.
-              '<OPTION VALUE="Fax">Fax'.
-            '</SELECT>'.
-          '</TD></TR>'.
-        '</TABLE>',
+    'code' => '$cust_bill->spool_csv(
+                 \'format\' => \'%%%spoolformat%%%\',
+                 \'dest\'   => \'%%%spooldest%%%\',
+                 \'agent_spools\' => \'%%%spoolagent_spools%%%\',
+               );',
+    'html' => sub {
+       my $plandata = shift;
+
+       my $html =
+       '<TABLE BORDER=0>'.
+       '<TR><TD ALIGN="right">Format: </TD>'.
+         '<TD>'.
+           '<SELECT NAME="spoolformat">';
+
+       foreach my $option (qw( default billco )) {
+         $html .= qq(<OPTION VALUE="$option");
+         $html .= ' SELECTED' if $option eq $plandata->{'spoolformat'};
+         $html .= ">\u$option";
+       }
+
+       $html .= 
+           '</SELECT>'.
+         '</TD></TR>'.
+       '<TR><TD ALIGN="right">For destination: </TD>'.
+         '<TD>'.
+           '<SELECT NAME="spooldest">';
+
+       tie my %dest, 'Tie::IxHash', 
+         ''      => '(all)',
+         'POST'  => 'Postal Mail',
+         'EMAIL' => 'Email',
+         'FAX'   => 'Fax',
+       ;
+
+       foreach my $dest (keys %dest) {
+         $html .= qq(<OPTION VALUE="$dest");
+         $html .= ' SELECTED' if $dest eq $plandata->{'spooldest'};
+         $html .= '>'. $dest{$dest};
+       }
+
+       $html .=
+           '</SELECT>'.
+         '</TD></TR>'.
+       '<TR><TD ALIGN="right">Individual per-agent spools? </TD>'.
+         '<TD><INPUT TYPE="checkbox" NAME="spoolagent_spools" VALUE="1" '.
+           ( $plandata->{'spoolagent_spools'} ? 'CHECKED' : '' ).
+           '>'.
+         '</TD></TR>'.
+       '</TABLE>';
+
+       $html;
+    },
     'weight' => 50,
   },
 



More information about the freeside-commits mailing list