1 package FS::legacy_cust_bill;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
10 FS::legacy_cust_bill - Object methods for legacy_cust_bill records
14 use FS::legacy_cust_bill;
16 $record = new FS::legacy_cust_bill \%hash;
17 $record = new FS::legacy_cust_bill { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::legacy_cust_bill object represents an invoice from a previous billing
30 system, about which full details are not availble. Instead, the rendered
31 content is stored in HTML or PDF format. FS::legacy_cust_bill invoices are
32 stored for informational and display purposes only; they have no effect upon
35 FS::legacy_cust_bill inherits from FS::Record. The following fields are
46 Invoice number or identifier from previous system
50 Customer (see L<FS::cust_main)
54 Date, as a UNIX timestamp
77 Creates a new legacy invoice. To add the example to the database, see
80 Note that this stores the hash reference, not a distinct copy of the hash it
81 points to. You can ask the object for a copy with the I<hash> method.
85 # the new method can be inherited from FS::Record, if a table method is defined
87 sub table { 'legacy_cust_bill'; }
91 Adds this record to the database. If there is an error, returns the error,
92 otherwise returns false.
96 # the insert method can be inherited from FS::Record
100 Delete this record from the database.
104 # the delete method can be inherited from FS::Record
106 =item replace OLD_RECORD
108 Replaces the OLD_RECORD with this one in the database. If there is an error,
109 returns the error, otherwise returns false.
113 # the replace method can be inherited from FS::Record
117 Checks all fields to make sure this is a valid legacy invoice. If there is
118 an error, returns the error, otherwise returns false. Called by the insert
123 # the check method should currently be supplied - FS::Record contains some
124 # data checking routines
130 $self->ut_numbern('legacyinvnum')
131 || $self->ut_textn('legacyid')
132 || $self->ut_foreign_keyn('custnum', 'cust_main', 'custnum')
133 || $self->ut_number('_date')
134 || $self->ut_money('charged')
135 || $self->ut_anything('content_pdf')
136 || $self->ut_anything('content_html')
138 return $error if $error;
145 Returns the customer (see L<FS::cust_main>) for this invoice.
151 qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
160 L<FS::Record>, schema.html from the base documentation.