sub table { 'cust_event'; }
-sub cust_linked { $_[0]->cust_main_custnum; }
+sub cust_linked { $_[0]->cust_main_custnum || $_[0]->custnum }
sub cust_unlinked_msg {
my $self = shift;
"WARNING: can't find cust_main.custnum ". $self->custnum;
=item ending
-=item payby
-
-=item
-
=back
=cut
process_re_X('fax', @_);
}
-use Storable qw(thaw);
use Data::Dumper;
-use MIME::Base64;
sub process_re_X {
- my( $method, $job ) = ( shift, shift );
-
- my $param = thaw(decode_base64(shift));
+ my( $method, $job, $param ) = @_;
warn Dumper($param) if $DEBUG;
re_X(
my $cust_X = $cust_event->cust_X; # cust_bill
next unless $cust_X->can($method);
- $cust_X->$method( $cust_event->part_event->templatename
- || $cust_X->agent_template
- );
+ my $part_event = $cust_event->part_event;
+ my $template = $part_event->templatename
+ || $cust_X->agent_template;
+ my $modenum = $part_event->option('modenum') || '';
+ my $invoice_from = $part_event->option('agent_invoice_from') || '';
+ $cust_X->set('mode' => $modenum);
+ $cust_X->$method( { template => $template,
+ modenum => $modenum,
+ from => $invoice_from,
+ } );
if ( $job ) { #progressbar foo
$num++;