display recurring custom line items on invoices as well as one-shot ones
authorivan <ivan>
Wed, 14 May 2003 16:51:43 +0000 (16:51 +0000)
committerivan <ivan>
Wed, 14 May 2003 16:51:43 +0000 (16:51 +0000)
FS/FS/cust_bill.pm

index 76c0752..a0634d9 100644 (file)
@@ -983,13 +983,20 @@ sub print_text {
 
       push @buf, map { [ "  $_", '' ] } $cust_bill_pkg->details;
 
-    } else { #pkgnum tax
+    } else { #pkgnum tax or one-shot line item
       my $itemdesc = defined $cust_bill_pkg->dbdef_table->column('itemdesc')
                      ? ( $cust_bill_pkg->itemdesc || 'Tax' )
                      : 'Tax';
-      push @buf, [ $itemdesc,
-                   $money_char. sprintf("%10.2f", $cust_bill_pkg->setup) ] 
-        if $cust_bill_pkg->setup != 0;
+      if ( $cust_bill_pkg->setup != 0 ) {
+        push @buf, [ $itemdesc,
+                     $money_char. sprintf("%10.2f", $cust_bill_pkg->setup) ];
+      }
+      if ( $cust_bill_pkg->recur != 0 ) {
+        push @buf, [ "$itemdesc (". time2str("%x", $cust_bill_pkg->sdate). " - "
+                                  . time2str("%x", $cust_bill_pkg->edate). ")",
+                     $money_char. sprintf("%10.2f", $cust_bill_pkg->recur)
+                   ];
+      }
     }
   }