X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=1f64b9ec18ffa38a651c9a21a19a75cd3af3d04f;hb=e334c4383752a12527396a498b629537e92f05bd;hp=6afbd1cf595a05d26ceda072158adbda12e8d93d;hpb=c34a48fd2107adbc7ea08cf3aae007d70ec60b61;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 6afbd1cf5..1f64b9ec1 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -599,7 +599,18 @@ sub insert { warn " setting cust_payby\n" if $DEBUG > 1; - if ( my $cust_payby_params = delete $options{'cust_payby_params'} ) { + if ( $options{cust_payby} ) { + + foreach my $cust_payby ( @{ $options{cust_payby} } ) { + $cust_payby->custnum($self->custnum); + my $error = $cust_payby->insert; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; + } + } + + } elsif ( my $cust_payby_params = delete $options{'cust_payby_params'} ) { my $error = $self->process_o2m( 'table' => 'cust_payby', @@ -4053,6 +4064,30 @@ sub tickets { (@tickets); } +=item appointments [ STATUS ] + +Returns an array of hashes representing the customer's RT tickets which +are appointments. + +=cut + +sub appointments { + my $self = shift; + my $status = ( @_ && $_[0] ) ? shift : ''; + + return () unless $conf->config('ticket_system'); + + my $queueid = $conf->config('ticket_system-appointment-queueid'); + + @{ FS::TicketSystem->customer_tickets( $self->custnum, + 99, + undef, + $status, + $queueid, + ) + }; +} + # Return services representing svc_accts in customer support packages sub support_services { my $self = shift;