agent-virtualize credit card surcharge percentage, RT#72961
[freeside.git] / FS / FS / queue_stat.pm
1 package FS::queue_stat;
2 use base qw( FS::Record );
3
4 use strict;
5 #use FS::Record qw( qsearch qsearchs );
6
7 =head1 NAME
8
9 FS::queue_stat - Object methods for queue_stat records
10
11 =head1 SYNOPSIS
12
13   use FS::queue_stat;
14
15   $record = new FS::queue_stat \%hash;
16   $record = new FS::queue_stat { 'column' => 'value' };
17
18   $error = $record->insert;
19
20   $error = $new_record->replace($old_record);
21
22   $error = $record->delete;
23
24   $error = $record->check;
25
26 =head1 DESCRIPTION
27
28 An FS::queue_stat object represents statistcs about a completed (queued) job.
29 FS::queue_stat inherits from FS::Record.  The following fields are currently
30 supported:
31
32 =over 4
33
34 =item statnum
35
36 primary key
37
38 =item jobnum
39
40 jobnum
41
42 =item job
43
44 job
45
46 =item custnum
47
48 custnum
49
50 =item insert_date
51
52 insert_date
53
54 =item start_date
55
56 start_date
57
58 =item end_date
59
60 end_date
61
62 =back
63
64 =head1 METHODS
65
66 =over 4
67
68 =item new HASHREF
69
70 Creates a new record.  To add the record to the database, see L<"insert">.
71
72 Note that this stores the hash reference, not a distinct copy of the hash it
73 points to.  You can ask the object for a copy with the I<hash> method.
74
75 =cut
76
77 sub table { 'queue_stat'; }
78
79 =item insert
80
81 Adds this record to the database.  If there is an error, returns the error,
82 otherwise returns false.
83
84 =item delete
85
86 Delete this record from the database.
87
88 =item replace OLD_RECORD
89
90 Replaces the OLD_RECORD with this one in the database.  If there is an error,
91 returns the error, otherwise returns false.
92
93 =item check
94
95 Checks all fields to make sure this is a valid record.  If there is
96 an error, returns the error, otherwise returns false.  Called by the insert
97 and replace methods.
98
99 =cut
100
101 sub check {
102   my $self = shift;
103
104   my $error = 
105     $self->ut_numbern('statnum')
106     || $self->ut_number('jobnum')
107     || $self->ut_text('job')
108     || $self->ut_numbern('custnum')
109     || $self->ut_number('insert_date')
110     || $self->ut_number('start_date')
111     || $self->ut_number('end_date')
112   ;
113   return $error if $error;
114
115   $self->SUPER::check;
116 }
117
118 =back
119
120 =head1 BUGS
121
122 =head1 SEE ALSO
123
124 L<FS::Record>
125
126 =cut
127
128 1;
129