[freeside-commits] freeside/httemplate/search cust_credit_bill_pkg.html, 1.1, 1.2

Ivan,,, ivan at wavetail.420.am
Sat Dec 12 15:53:26 PST 2009


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv22035

Modified Files:
	cust_credit_bill_pkg.html 
Log Message:
better reporting for tax credits, RT#4729

Index: cust_credit_bill_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_credit_bill_pkg.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cust_credit_bill_pkg.html	12 Dec 2009 23:32:24 -0000	1.1
+++ cust_credit_bill_pkg.html	12 Dec 2009 23:53:24 -0000	1.2
@@ -8,41 +8,32 @@
                    #'#',
 
                    'Amount',
-                   # credit date, By, Reason,
-                   # line item, invoice
 
+                   #credit
+                   'Date',
+                   'By',
+                   'Reason',
+
+                   # line item
                    'Description',
-                   'Setup charge',
-                   ( $use_usage eq 'usage'
-                     ? 'Usage charge'
-                     : 'Recurring charge'
-                   ),
+
+                   #invoice
                    'Invoice',
                    'Date',
                    FS::UI::Web::cust_header(),
                  ],
                  'fields'      => [
                    #'creditbillpkgnum',
-                   'amount',
+                   sub { sprintf($money_char.'%.2f', shift->amount ) },
+
+                   sub { time2str('%b %d %Y', shift->get('cust_credit_date') ) },
+                   'otaker',
+                   sub { shift->cust_credit_bill->cust_credit->reason },
 
                    sub { $_[0]->pkgnum > 0
                            ? $_[0]->get('pkg')      # possibly use override.pkg
                            : $_[0]->get('itemdesc') # but i think this correct
                        },
-                   #strikethrough or "N/A ($amount)" or something these when
-                   # they're not applicable to pkg_tax search
-                   sub { sprintf($money_char.'%.2f', shift->setup ) },
-                   sub { my $row = shift;
-                         my $value = 0;
-                         if ( $use_usage eq 'recurring' ) {
-                           $value = $row->recur - $row->usage;
-                         } elsif ( $use_usage eq 'usage' ) {
-                           $value = $row->usage;
-                         } else {
-                           $value = $row->recur;
-                         }
-                         sprintf($money_char.'%.2f', $value );
-                       },
                    'invnum',
                    sub { time2str('%b %d %Y', shift->_date ) },
                    \&FS::UI::Web::cust_fields,
@@ -52,13 +43,14 @@
                    '',
                    '',
                    '',
+                   '',
                    $ilink,
                    $ilink,
                    ( map { $_ ne 'Cust. Status' ? $clink : '' }
                          FS::UI::Web::cust_header()
                    ),
                  ],
-                 'align' => 'rlrrrc'.FS::UI::Web::cust_aligns(),
+                 'align' => 'rrlllrr'.FS::UI::Web::cust_aligns(),
                  'color' => [ 
                               '',
                               '',
@@ -66,6 +58,7 @@
                               '',
                               '',
                               '',
+                              '',
                               FS::UI::Web::cust_colors(),
                             ],
                  'style' => [ 
@@ -75,6 +68,7 @@
                               '',
                               '',
                               '',
+                              '',
                               FS::UI::Web::cust_styles(),
                             ],
            )
@@ -495,8 +489,10 @@
                       $where";
 #}
 
-my @select = ( 'cust_credit_bill_pkg.amount',
+my @select = ( 'cust_credit_bill_pkg.*',
                'cust_bill_pkg.*',
+               'cust_credit.otaker',
+               'cust_credit._date AS cust_credit_date',
                'cust_bill._date',
              );
 push @select, 'part_pkg.pkg' unless $cgi->param('istax');



More information about the freeside-commits mailing list