X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=21f66b92ed8a6564203e142011f5cbd936ed99c9;hb=5a52da30588e8811338845ce2edaf0631acad479;hp=c0fb5d297a6d73cd175e6f49c6ba77fb866d3c3d;hpb=3f4c9d34c4a031ca061f2f53f6ec4d893b5c3d40;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index c0fb5d297..21f66b92e 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2,7 +2,10 @@ package FS::cust_main; require 5.006; use strict; -use base qw( FS::otaker_Mixin FS::payinfo_Mixin FS::Record ); +use base qw( FS::cust_main::Billing FS::cust_main::Billing_Realtime + FS::otaker_Mixin FS::payinfo_Mixin FS::cust_main_Mixin + FS::Record + ); use vars qw( @EXPORT_OK $DEBUG $me $conf @encrypted_fields $import $ignore_expired_card @@ -10,7 +13,6 @@ use vars qw( @EXPORT_OK $DEBUG $me $conf @paytypes ); use vars qw( $realtime_bop_decline_quiet ); #ugh -use Safe; use Carp; use Exporter; use Scalar::Util qw( blessed ); @@ -31,14 +33,11 @@ use FS::UID qw( getotaker dbh driver_name ); use FS::Record qw( qsearchs qsearch dbdef regexp_sql ); use FS::Misc qw( generate_email send_email generate_ps do_print ); use FS::Msgcat qw(gettext); +use FS::CurrentUser; use FS::payby; use FS::cust_pkg; use FS::cust_svc; use FS::cust_bill; -use FS::cust_bill_pkg; -use FS::cust_bill_pkg_display; -use FS::cust_bill_pkg_tax_location; -use FS::cust_bill_pkg_tax_rate_location; use FS::cust_pay; use FS::cust_pay_pending; use FS::cust_pay_void; @@ -51,15 +50,10 @@ use FS::cust_location; use FS::cust_class; use FS::cust_main_exemption; use FS::cust_tax_adjustment; -use FS::tax_rate; -use FS::tax_rate_location; use FS::cust_tax_location; -use FS::part_pkg_taxrate; use FS::agent; use FS::cust_main_invoice; use FS::cust_tag; -use FS::cust_credit_bill; -use FS::cust_bill_pay; use FS::prepay_credit; use FS::queue; use FS::part_pkg; @@ -75,7 +69,7 @@ use FS::TicketSystem; @EXPORT_OK = qw( smart_search ); -$realtime_bop_decline_quiet = 0; +$realtime_bop_decline_quiet = 0; #move to Billing_Realtime # 1 is mostly method/subroutine entry and options # 2 traces progress of some operations @@ -1790,7 +1784,8 @@ sub check { # bad idea to disable, causes billing to fail because of no tax rates later -# unless ( $import ) { +# except we don't fail any more + unless ( $import ) { unless ( qsearch('cust_main_county', { 'country' => $self->country, 'state' => '', @@ -1803,7 +1798,7 @@ sub check { 'country' => $self->country, } ); } -# } + } $error = $self->ut_phonen('daytime', $self->country) @@ -2072,7 +2067,7 @@ sub check { $self->$flag($1); } - $self->otaker(getotaker) unless $self->otaker; + $self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum; warn "$me check AFTER: \n". $self->_dump if $DEBUG > 2; @@ -2661,257 +2656,200 @@ sub classname { : ''; } +=item BILLING METHODS -=item bill_and_collect - -Cancels and suspends any packages due, generates bills, applies payments and -credits, and applies collection events to run cards, send bills and notices, -etc. +Documentation on billing methods has been moved to +L. -By default, warns on errors and continues with the next operation (but see the -"fatal" flag below). +=item do_cust_event [ HASHREF | OPTION => VALUE ... ] -Options are passed as name-value pairs. Currently available options are: +Runs billing events; see L and the billing events web +interface. -=over 4 +If there is an error, returns the error, otherwise returns false. -=item time +Options are passed as name-value pairs. -Bills the customer as if it were that time. Specified as a UNIX timestamp; see L). Also see L and L for conversion functions. For example: +Currently available options are: - use Date::Parse; - ... - $cust_main->bill( 'time' => str2time('April 20th, 2001') ); +=over 4 -=item invoice_time +=item time -Used in conjunction with the I