add status and statustext fields to cust_bill_event
authorivan <ivan>
Wed, 27 Feb 2002 22:39:14 +0000 (22:39 +0000)
committerivan <ivan>
Wed, 27 Feb 2002 22:39:14 +0000 (22:39 +0000)
FS/FS/cust_bill_event.pm
README.1.4.0pre12 [new file with mode: 0644]
bin/fs-setup
httemplate/docs/schema.html
httemplate/docs/upgrade8.html
httemplate/view/cust_bill.cgi

index cc9ce7c..242b39e 100644 (file)
@@ -107,6 +107,8 @@ sub check {
     || $self->ut_number('invnum')
     || $self->ut_number('eventpart')
     || $self->ut_number('_date')
+    || $self->ut_enum('status', [qw( done failed )]
+    || $self->ut_textn('statustext');
   ;
 
   return "Unknown invnum"
diff --git a/README.1.4.0pre12 b/README.1.4.0pre12
new file mode 100644 (file)
index 0000000..3f30aa4
--- /dev/null
@@ -0,0 +1,19 @@
+the following is necessary to upgrade from 1.4.0pre11 to 1.4.0pre12
+
+if you're upgrading from before 1.4.0pre12 see README.1.4.0pre11 first!
+
+if you're upgrading from 1.3.1 follow the instructions in
+httemplate/docs/upgrade8.html instead
+
+----
+
+install the FS perl modules and httemplate as per install.html or upgrade8.html
+
+ALTER TABLE cust_bill_event ADD status varchar(80);
+ALTER TABLE cust_bill_event ADD statustext text NULL;
+UPDATE cust_bill_event SET status = 'done';
+
+Run bin/dbdef-create
+
+Restart Apache and freeside-queued
+
index 3ad0bbd..62c2cd4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -Tw
 #
-# $Id: fs-setup,v 1.81 2002-02-22 07:50:19 ivan Exp $
+# $Id: fs-setup,v 1.82 2002-02-27 22:39:14 ivan Exp $
 
 #to delay loading dbdef until we're ready
 BEGIN { $FS::Record::setup_hack = 1; }
@@ -329,10 +329,12 @@ sub tables_hash_hack {
         'invnum',   'int',  '', '',
         'eventpart',   'int',  '', '',
         '_date',     @date_type,
+        'status', 'varchar', '', $char_d,
+        'statustext', 'text', 'NULL', '',
       ],
       'primary_key' => 'eventnum',
       'unique' => [ [ 'eventpart', 'invnum' ] ],
-      'index' => [ ['invnum'] ],
+      'index' => [ ['invnum'], ['status'] ],
     },
 
     'part_bill_event' => {
index 8420161..b828213 100644 (file)
@@ -32,6 +32,8 @@
         <li>invnum - <a href="#cust_bill">invoice</a>
         <li>eventpart - <a href="#part_bill_event">event definition</a>
         <li>_date
+        <li>status
+        <li>statustext
       </ul>
     <li><a name="part_bill_event" href="man/FS/part_bill_event.html">part_bill_event</a> - Invoice event definitions
       <ul>
index 3edf425..a4fb176 100644 (file)
@@ -188,6 +188,8 @@ ALTER TABLE cust_bill ADD closed char(1) NULL;
 ALTER TABLE cust_pay ADD closed char(1) NULL;
 ALTER TABLE cust_credit ADD closed char(1) NULL;
 ALTER TABLE cust_refund ADD closed char(1) NULL;
+ALTER TABLE cust_bill_event ADD status varchar(80);
+ALTER TABLE cust_bill_event ADD statustext text NULL;
 CREATE INDEX cust_main3 ON cust_main ( referral_custnum );
 CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum );
 CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum );
index 7c2af06..95f1a0a 100755 (executable)
@@ -22,13 +22,17 @@ print qq!<A HREF="${p}edit/cust_pay.cgi?$invnum">Enter payments (check/cash) aga
 
 print qq!<A HREF="${p}misc/print-invoice.cgi?$invnum">Reprint this invoice</A>!.      '<BR><BR>';
 
+print table(). '<TR><TH>Event</TH><TH>Date</TH><TH>Status</TH></TR>';
 foreach my $cust_bill_event (
   sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event
 ) {
-  print time2str("%a %b %e %T %Y", $cust_bill_event->_date). ' - '.
-        $cust_bill_event->part_bill_event->event. '<BR>';
+  my $status = $cust_bill_event->status;
+  $status .= ': '. $cust_bill_event->statustext if $cust_bill_event->statustext;
+  print '<TR><TD>'. $cust_bill_event->part_bill_event->event. '</TD><TD>'.
+        time2str("%a %b %e %T %Y", $cust_bill_event->_date). '</TD><TD>'.
+        $status. '</TD></TR>';
 }
-print '<BR><PRE>';
+print '</TABLE><BR><PRE>';
 
 print $cust_bill->print_text;