1 package FS::part_bill_event;
5 use FS::Record qw( qsearch qsearchs );
11 FS::part_bill_event - Object methods for part_bill_event records
15 use FS::part_bill_event;
17 $record = new FS::part_bill_event \%hash;
18 $record = new FS::part_bill_event { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::part_bill_event object represents an invoice event definition -
31 a callback which is triggered when an invoice is a certain amount of time
32 overdue. FS::part_bill_event inherits from
33 FS::Record. The following fields are currently supported:
37 =item eventpart - primary key
39 =item payby - CARD, BILL, or COMP
41 =item event - event name
43 =item eventcode - event action
45 =item seconds - how long after the invoice date events of this type are triggered
47 =item disabled - Disabled flag, empty or `Y'
57 Creates a new invoice event definition. To add the example to the database,
60 Note that this stores the hash reference, not a distinct copy of the hash it
61 points to. You can ask the object for a copy with the I<hash> method.
65 # the new method can be inherited from FS::Record, if a table method is defined
67 sub table { 'part_bill_event'; }
71 Adds this record to the database. If there is an error, returns the error,
72 otherwise returns false.
76 # the insert method can be inherited from FS::Record
80 Delete this record from the database.
84 # the delete method can be inherited from FS::Record
86 =item replace OLD_RECORD
88 Replaces the OLD_RECORD with this one in the database. If there is an error,
89 returns the error, otherwise returns false.
93 # the replace method can be inherited from FS::Record
97 Checks all fields to make sure this is a valid invoice event definition. If
98 there is an error, returns the error, otherwise returns false. Called by the
99 insert and replace methods.
103 # the check method should currently be supplied - FS::Record contains some
104 # data checking routines
109 $self->ut_numbern('eventpart')
110 || $self->ut_enum('payby', [qw( CARD BILL COMP )] )
111 || $self->ut_text('event')
112 || $self->ut_anything('eventcode')
113 || $self->ut_number('seconds')
114 || $self->ut_enum('disabled', [ '', 'Y' ] )
126 L<FS::cust_bill>, L<FS::cust_bill_event>, L<FS::Record>, schema.html from the