X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htdocs%2Fdocs%2Fman%2FFS%2Fcust_main.html;fp=htdocs%2Fdocs%2Fman%2FFS%2Fcust_main.html;h=c5df1da1253667479da74cff1b1ad0fcd8976526;hp=384e3de159aab142463b22ef047d9acfacc80d77;hb=f3235d39d083518d47f21cd5585e5f9a13070763;hpb=ece31063b782031e21ba1f57476afab555af5363 diff --git a/htdocs/docs/man/FS/cust_main.html b/htdocs/docs/man/FS/cust_main.html index 384e3de15..c5df1da12 100644 --- a/htdocs/docs/man/FS/cust_main.html +++ b/htdocs/docs/man/FS/cust_main.html @@ -1,276 +1,251 @@
-
-FS::cust_main - Object methods for cust_main records - +
FS::cust_main - Object methods for cust_main records
-
use FS::cust_main; --
-
$record = new FS::cust_main \%hash; - $record = new FS::cust_main { 'column' => 'value' }; --
-
$error = $record->insert; --
-
$error = $new_record->replace($old_record); --
-
$error = $record->delete; --
-
$error = $record->check; --
-
@cust_pkg = $record->all_pkgs; --
-
@cust_pkg = $record->ncancelled_pkgs; --
-
$error = $record->bill; +SYNOPSIS
++ use FS::cust_main;++ $record = new FS::cust_main \%hash; + $record = new FS::cust_main { 'column' => 'value' };++ $error = $record->insert;++ $error = $new_record->replace($old_record);++ $error = $record->delete;++ $error = $record->check;++ @cust_pkg = $record->all_pkgs;++ @cust_pkg = $record->ncancelled_pkgs;++ $error = $record->bill; $error = $record->bill %options; - $error = $record->bill 'time' => $time; ---
$error = $record->collect; + $error = $record->bill 'time' => $time;++ $error = $record->collect; $error = $record->collect %options; $error = $record->collect 'invoice_time' => $time, 'batch_card' => 'yes', 'report_badcard' => 'yes', - ; -+ ;
-An FS::cust_main object represents a customer. FS::cust_main inherits from -FS::Record. The following fields are currently supported: - +
An FS::cust_main object represents a customer. FS::cust_main inherits from +FS::Record. The following fields are currently supported:
-Creates a new customer. To add the customer to the database, see insert. - -
-Note that this stores the hash reference, not a distinct copy of the hash -it points to. You can ask the object for a copy with the hash method. - -
-Adds this customer to the database. If there is an error, returns the -error, otherwise returns false. - -
-This deletes the customer. If there is an error, returns the error, +
Note that this stores the hash reference, not a distinct copy of the hash it +points to. You can ask the object for a copy with the hash method.
+ +-This will completely remove all traces of the customer record. This is not +
There is a special insert mode in which you pass a data structure to the insert +method containing FS::cust_pkg and FS::svc_tablename objects. When +running under a transactional database, all records are inserted atomicly, or +the transaction is rolled back. There should be a better explanation of this, +but until then, here's an example:
++ use Tie::RefHash; + tie %hash, 'Tie::RefHash'; #this part is important + %hash = { + $cust_pkg => [ $svc_acct ], + }; + $cust_main->insert( \%hash );+ +
This will completely remove all traces of the customer record. This is not what you want when a customer cancels service; for that, cancel all of the -customer's packages (see cancel). - -
-If the customer has any packages, you need to pass a new (valid) customer -number for those packages to be transferred to. - -
-You can't delete a customer with invoices (see FS::cust_bill), or credits (see FS::cust_credit). - -
-Replaces the OLD_RECORD with this one in the database. If there is an -error, returns the error, otherwise returns false. - -
-Checks all fields to make sure this is a valid customer record. If there is -an error, returns the error, otherwise returns false. Called by the insert +customer's packages (see cancel in the FS::cust_pkg manpage).
+If the customer has any packages, you need to pass a new (valid) customer +number for those packages to be transferred to.
+You can't delete a customer with invoices (see the FS::cust_bill manpage), +or credits (see the FS::cust_credit manpage).
+ +-Returns all packages (see FS::cust_pkg) for this customer. - -
-Returns all non-cancelled packages (see FS::cust_pkg) for this customer. - -
-Generates invoices (see FS::cust_bill) for this customer. Usually used in conjunction with the collect method. - -
-The only currently available option is `time', which bills the customer as -if it were that time. It is specified as a UNIX timestamp; see -perlfunc). Also see Time::Local and Date::Parse for conversion functions. - -
-If there is an error, returns the error, otherwise returns false. - -
+
+The only currently available option is `time', which bills the customer as if +it were that time. It is specified as a UNIX timestamp; see +perlfunc/``time''). Also see the Time::Local manpage and the Date::Parse manpage for conversion +functions.
+If there is an error, returns the error, otherwise returns false.
+ +-Depending on the value of `payby', this may print an invoice (`BILL'), -charge a credit card (`CARD'), or just add any necessary (pseudo-)payment -(`COMP'). - -
-If there is an error, returns the error, otherwise returns false. - -
-Currently available options are: - -
-invoice_time - Use this time when deciding when to print invoices and late -notices on those invoices. The default is now. It is specified as a UNIX -timestamp; see perlfunc). Also see Time::Local and Date::Parse -for conversion functions. - -
-batch_card - Set this true to batch cards (see the cust_pay_batch manpage). By default, cards are processed immediately, which will generate an -error if CyberCash is not installed. - -
-report_badcard - Set this true if you want bad card transactions to return -an error. By default, they don't. - -
-Returns the total owed for this customer on all invoices (see FS::cust_bill). - -
-Returns the total credits (see FS::cust_credit) for this customer. - -
+the FS::cust_bill manpage). Usually used after the bill method. +
Depending on the value of `payby', this may print an invoice (`BILL'), charge +a credit card (`CARD'), or just add any necessary (pseudo-)payment (`COMP').
+If there is an error, returns the error, otherwise returns false.
+Currently available options are:
+invoice_time - Use this time when deciding when to print invoices and +late notices on those invoices. The default is now. It is specified as a UNIX timestamp; see perlfunc/``time''). Also see the Time::Local manpage and the Date::Parse manpage +for conversion functions.
+batch_card - Set this true to batch cards (see the cust_pay_batch manpage). By +default, cards are processed immediately, which will generate an error if +CyberCash is not installed.
+report_badcard - Set this true if you want bad card transactions to +return an error. By default, they don't.
+ ++
+-Returns a list of email addresses (with svcnum entries expanded). - -
-Note: You can clear the invoicing list by passing an empty ARRAYREF. You -can check it without disturbing anything by passing nothing. - -
-This interface may change in the future. - -
-Checks these arguements as valid input for the invoicing_list method. If -there is an error, returns the error, otherwise returns false. - -
Returns a list of email addresses (with svcnum entries expanded).
+Note: You can clear the invoicing list by passing an empty ARRAYREF. You can +check it without disturbing anything by passing nothing.
+This interface may change in the future.
+ +
-$Id: cust_main.html,v 1.2 2000-03-03 18:22:43 ivan Exp $ - +
$Id: cust_main.html,v 1.3 2001-04-23 12:40:31 ivan Exp $
-The delete method. - -
-The delete method should possibly take an FS::cust_main object reference -instead of a scalar customer number. - -
-Bill and collect options should probably be passed as references instead of -a list. - -
-CyberCash v2 forces us to define some variables in package main. - -
-There should probably be a configuration file with a list of allowed credit -card types. - -
-CyberCash is the only processor. - -
-No multiple currency support (probably a larger project than just this -module). - +
The delete method.
+The delete method should possibly take an FS::cust_main object reference +instead of a scalar customer number.
+Bill and collect options should probably be passed as references instead of a +list.
+CyberCash v2 forces us to define some variables in package main.
+There should probably be a configuration file with a list of allowed credit +card types.
+CyberCash is the only processor.
+No multiple currency support (probably a larger project than just this module).
-FS::Record, FS::cust_pkg, FS::cust_bill, FS::cust_credit - -FS::cust_pay_batch, FS::agent, FS::part_referral, -FS::cust_main_county, FS::cust_main_invoice, -FS::UID, schema.html from the base documentation. +
the FS::Record manpage, the FS::cust_pkg manpage, the FS::cust_bill manpage, the FS::cust_credit manpage +the FS::cust_pay_batch manpage, the FS::agent manpage, the FS::part_referral manpage, +the FS::cust_main_county manpage, the FS::cust_main_invoice manpage, +the FS::UID manpage, schema.html from the base documentation.