1 package FS::legacy_cust_history;
2 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::legacy_cust_history - Object methods for legacy_cust_history records
13 use FS::legacy_cust_history;
15 $record = new FS::legacy_cust_history \%hash;
16 $record = new FS::legacy_cust_history { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::legacy_cust_history object represents an item of customer change history
29 from a previous billing system. FS::legacy_cust_history inherits from
30 FS::Record. The following fields are currently supported:
34 =item legacyhistorynum
40 Customer (see L<FS::cust_main)
44 Action, such as add, edit, delete, etc.
48 Date, as a UNIX timestamp
52 Employee (see L<FS::access_user>)
56 The item (i.e. table) which was changed.
60 A text description of the change
64 A text data structure representing the change
74 Creates a new record. To add the record to the database, see L<"insert">.
76 Note that this stores the hash reference, not a distinct copy of the hash it
77 points to. You can ask the object for a copy with the I<hash> method.
81 sub table { 'legacy_cust_history'; }
85 Adds this record to the database. If there is an error, returns the error,
86 otherwise returns false.
90 Delete this record from the database.
92 =item replace OLD_RECORD
94 Replaces the OLD_RECORD with this one in the database. If there is an error,
95 returns the error, otherwise returns false.
99 Checks all fields to make sure this is a valid record. If there is
100 an error, returns the error, otherwise returns false. Called by the insert
109 $self->ut_numbern('legacyhistorynum')
110 || $self->ut_foreign_key('custnum', 'cust_main', 'custnum')
111 || $self->ut_text('history_action')
112 || $self->ut_numbern('history_date')
113 || $self->ut_foreign_keyn('history_usernum', 'access_user', 'usernum')
114 || $self->ut_textn('item')
115 || $self->ut_textn('description')
116 || $self->ut_anything('change_data')
118 return $error if $error;