X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FAction%2Fcust_bill_print.pm;h=b94e882ffad38dfc26d9b4cef7a768445daec4d4;hb=4e0dfb0cb472d5fa4ab0581c43b4bab72ed50847;hp=6b3e6f4606d9e30c0207fac427afc4ea3780b192;hpb=982ded2d929bdcdfa72efa810273f3bc753bf036;p=freeside.git diff --git a/FS/FS/part_event/Action/cust_bill_print.pm b/FS/FS/part_event/Action/cust_bill_print.pm index 6b3e6f460..b94e882ff 100644 --- a/FS/FS/part_event/Action/cust_bill_print.pm +++ b/FS/FS/part_event/Action/cust_bill_print.pm @@ -9,6 +9,18 @@ sub eventtable_hashref { { 'cust_bill' => 1 }; } +sub option_fields { + ( + 'modenum' => { label => 'Invoice mode', + type => 'select-invoice_mode', + }, + 'skip_nopost' => { label => 'Skip customers without postal billing enabled', + type => 'checkbox', + value => 'Y', + }, + ); +} + sub default_weight { 51; } sub do_action { @@ -17,7 +29,9 @@ sub do_action { #my $cust_main = $self->cust_main($cust_bill); my $cust_main = $cust_bill->cust_main; - $cust_bill->print; + $cust_bill->set('mode' => $self->option('modenum')); + $cust_bill->print unless $self->option('skip_nopost') + && ! grep { $_ eq 'POST' } $cust_main->invoicing_list; } 1;