1 package FS::cust_bill_pay_pkg;
5 use FS::Record qw( qsearch qsearchs );
11 FS::cust_bill_pay_pkg - Object methods for cust_bill_pay_pkg records
15 use FS::cust_bill_pay_pkg;
17 $record = new FS::cust_bill_pay_pkg \%hash;
18 $record = new FS::cust_bill_pay_pkg { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::cust_bill_pay_pkg object represents application of a payment (see
31 L<FS::cust_bill_pay>) to a specific line item within an invoice (see
32 L<FS::cust_bill_pkg>). FS::cust_bill_pay_pkg inherits from FS::Record. The
33 following fields are currently supported:
37 =item billpaypkgnum - primary key
39 =item billpaynum - Payment application to the overall invoice (see L<FS::cust_bill_pay>)
41 =item billpkgnum - Line item to which payment is applied (see L<FS::cust_bill_pkg>)
43 =item amount - Amount of the payment applied to this line item.
45 =item setuprecur - 'setup' or 'recur', designates whether the payment was applied to the setup or recurring portion of the line item.
55 Creates a new record. To add the record to the database, see L<"insert">.
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 # the new method can be inherited from FS::Record, if a table method is defined
64 sub table { 'cust_bill_pay_pkg'; }
68 Adds this record to the database. If there is an error, returns the error,
69 otherwise returns false.
73 # the insert method can be inherited from FS::Record
77 Delete this record from the database.
81 # the delete method can be inherited from FS::Record
83 =item replace OLD_RECORD
85 Replaces the OLD_RECORD with this one in the database. If there is an error,
86 returns the error, otherwise returns false.
90 # the replace method can be inherited from FS::Record
94 Checks all fields to make sure this is a valid payment application. If there
95 is an error, returns the error, otherwise returns false. Called by the insert
100 # the check method should currently be supplied - FS::Record contains some
101 # data checking routines
107 $self->ut_numbern('billpaypkgnum')
108 || $self->ut_foreign_key('billpaynum', 'cust_bill_pay', 'billpaynum' )
109 || $self->ut_foreign_key('billpkgnum', 'cust_bill_pkg', 'billpkgnum' )
110 || $self->ut_money('amount')
111 || $self->ut_enum('setuprecur', [ 'setup', 'recur' ] )
113 return $error if $error;
122 B<setuprecur> field is a kludge to compensate for cust_bill_pkg having separate
123 setup and recur fields. It should be removed once that's fixed.
127 L<FS::Record>, schema.html from the base documentation.