[freeside-commits] freeside/FS/FS cust_bill.pm, 1.363, 1.364 Conf.pm, 1.490, 1.491
Ivan,,,
ivan at wavetail.420.am
Mon Nov 28 17:23:18 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv9831/FS/FS
Modified Files:
cust_bill.pm Conf.pm
Log Message:
also supress sending invoices w/selfservice-hide_invoices-taxclass, RT#15327
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.490
retrieving revision 1.491
diff -u -w -d -r1.490 -r1.491
--- Conf.pm 28 Nov 2011 01:40:16 -0000 1.490
+++ Conf.pm 29 Nov 2011 01:23:16 -0000 1.491
@@ -2494,7 +2494,7 @@
{
'key' => 'selfservice-hide_invoices-taxclass',
'section' => 'self-service',
- 'description' => 'Hide invoices with only this package tax class from self-service. Typically set to something like "Previous balance" and used when importing legacy invoices into legacy_cust_bill.',
+ 'description' => 'Hide invoices with only this package tax class from self-service and supress sending (emailing, printing, faxing) them. Typically set to something like "Previous balance" and used when importing legacy invoices into legacy_cust_bill.',
'type' => 'text',
},
Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.363
retrieving revision 1.364
diff -u -w -d -r1.363 -r1.364
--- cust_bill.pm 27 Nov 2011 00:46:10 -0000 1.363
+++ cust_bill.pm 29 Nov 2011 01:23:16 -0000 1.364
@@ -796,6 +796,23 @@
$balance;
}
+=item hide
+
+Returns true if this invoice should be hidden. See the
+selfservice-hide_invoices-taxclass configuraiton setting.
+
+=cut
+
+sub hide {
+ my $self = shift;
+ my $conf = $self->conf;
+ my $hide_taxclass = $conf->config('selfservice-hide_invoices-taxclass')
+ or return '';
+ my @cust_bill_pkg = $self->cust_bill_pkg;
+ my @part_pkg = grep $_, map $_->part_pkg, @cust_bill_pkg;
+ ! grep { $_->taxclass ne $hide_taxclass } @part_pkg;
+}
+
=item apply_payments_and_credits [ OPTION => VALUE ... ]
Applies unapplied payments and credits to this invoice.
@@ -1335,6 +1352,7 @@
#sub email_invoice {
sub email {
my $self = shift;
+ return if $self->hide;
my $conf = $self->conf;
my( $template, $invoice_from, $notice_name, $no_coupon );
@@ -1453,7 +1471,9 @@
#sub print_invoice {
sub print {
my $self = shift;
+ return if $self->hide;
my $conf = $self->conf;
+
my( $template, $notice_name );
if ( ref($_[0]) ) {
my $opt = shift;
@@ -1493,7 +1513,9 @@
sub fax_invoice {
my $self = shift;
+ return if $self->hide;
my $conf = $self->conf;
+
my( $template, $notice_name );
if ( ref($_[0]) ) {
my $opt = shift;
More information about the freeside-commits
mailing list