1 package FS::cust_credit_source_bill_pkg;
2 use base qw( FS::cust_main_Mixin FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
9 FS::cust_credit_source_bill_pkg - Object methods for cust_credit_source_bill_pkg records
13 use FS::cust_credit_source_bill_pkg;
15 $record = new FS::cust_credit_source_bill_pkg \%hash;
16 $record = new FS::cust_credit_source_bill_pkg { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::cust_credit_source_bill_pkg object represents the record that a credit
29 was triggered by a specific line item. FS::cust_credit_source_bill_pkg
30 inherits from FS::Record. The following fields are currently supported:
34 =item creditsourcebillpkgnum
40 Credit (see L<FS::cust_credit>)
44 Line item (see L<FS::cust_bill_pkg>)
48 Amount specific to this line item.
62 Creates a new record. To add the record to the database, see L<"insert">.
64 Note that this stores the hash reference, not a distinct copy of the hash it
65 points to. You can ask the object for a copy with the I<hash> method.
69 sub table { 'cust_credit_source_bill_pkg'; }
73 Adds this record to the database. If there is an error, returns the error,
74 otherwise returns false.
78 Delete this record from the database.
80 =item replace OLD_RECORD
82 Replaces the OLD_RECORD with this one in the database. If there is an error,
83 returns the error, otherwise returns false.
87 Checks all fields to make sure this is a valid record. If there is
88 an error, returns the error, otherwise returns false. Called by the insert
97 $self->ut_numbern('creditsourcebillpkgnum')
98 || $self->ut_foreign_key('crednum', 'cust_credit', 'crednum')
99 || $self->ut_foreign_key('billpkgnum', 'cust_bill_pkg', 'billpkgnum')
100 || $self->ut_money('amount')
101 || $self->ut_currencyn('currency')
103 return $error if $error;
112 Terminology/documentation surrounding credit "sources" vs. credit
113 "applications" is hard to understand.
117 L<FS::cust_credit>, L<FS::cust_bill_pkg>, L<FS::Record>