1 package FS::legacy_cust_bill;
2 use base qw( FS::Record );
8 FS::legacy_cust_bill - Object methods for legacy_cust_bill records
12 use FS::legacy_cust_bill;
14 $record = new FS::legacy_cust_bill \%hash;
15 $record = new FS::legacy_cust_bill { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::legacy_cust_bill object represents an invoice from a previous billing
28 system, about which full details are not availble. Instead, the rendered
29 content is stored in HTML or PDF format. FS::legacy_cust_bill invoices are
30 stored for informational and display purposes only; they have no effect upon
33 FS::legacy_cust_bill inherits from FS::Record. The following fields are
44 Invoice number or identifier from previous system
48 Customer (see L<FS::cust_main)
52 Date, as a UNIX timestamp
75 Creates a new legacy invoice. To add the example to the database, see
78 Note that this stores the hash reference, not a distinct copy of the hash it
79 points to. You can ask the object for a copy with the I<hash> method.
83 # the new method can be inherited from FS::Record, if a table method is defined
85 sub table { 'legacy_cust_bill'; }
89 Adds this record to the database. If there is an error, returns the error,
90 otherwise returns false.
94 # the insert method can be inherited from FS::Record
98 Delete this record from the database.
102 # the delete method can be inherited from FS::Record
104 =item replace OLD_RECORD
106 Replaces the OLD_RECORD with this one in the database. If there is an error,
107 returns the error, otherwise returns false.
111 # the replace method can be inherited from FS::Record
115 Checks all fields to make sure this is a valid legacy invoice. If there is
116 an error, returns the error, otherwise returns false. Called by the insert
121 # the check method should currently be supplied - FS::Record contains some
122 # data checking routines
128 $self->ut_numbern('legacyinvnum')
129 || $self->ut_textn('legacyid')
130 || $self->ut_foreign_keyn('custnum', 'cust_main', 'custnum')
131 || $self->ut_number('_date')
132 || $self->ut_money('charged')
133 || $self->ut_anything('content_pdf')
134 || $self->ut_anything('content_html')
136 return $error if $error;
143 Returns the customer (see L<FS::cust_main>) for this invoice.
151 L<FS::Record>, schema.html from the base documentation.