communigate provisioning phase 2: add svc_domain.trailer -> communigate TrailerText...
[freeside.git] / FS / FS / cust_recon.pm
1 package FS::cust_recon;
2
3 use strict;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
6
7 =head1 NAME
8
9 FS::cust_recon - Object methods for cust_recon records
10
11 =head1 SYNOPSIS
12
13   use FS::cust_recon;
14
15   $record = new FS::cust_recon \%hash;
16   $record = new FS::cust_recon { '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::cust_recon object represents a customer reconcilation.  FS::cust_recon
29 inherits from FS::Record.  The following fields are currently supported:
30
31 =over 4
32
33 =item reconid
34
35 primary key
36
37 =item recondate
38
39 recondate
40
41 =item custnum
42
43 custnum
44
45 =item agentnum
46
47 agentnum
48
49 =item last
50
51 last
52
53 =item first
54
55 first
56
57 =item address1
58
59 address1
60
61 =item address2
62
63 address2
64
65 =item city
66
67 city
68
69 =item state
70
71 state
72
73 =item zip
74
75 zip
76
77 =item pkg
78
79 pkg
80
81 =item adjourn
82
83 adjourn
84
85 =item status
86
87 status
88
89 =item agent_custid
90
91 agent_custid
92
93 =item agent_pkg
94
95 agent_pkg
96
97 =item agent_adjourn
98
99 agent_adjourn
100
101 =item comments
102
103 comments
104
105
106 =back
107
108 =head1 METHODS
109
110 =over 4
111
112 =item new HASHREF
113
114 Creates a new customer reconcilation.  To add the reconcilation to the database,
115 see L<"insert">.
116
117 Note that this stores the hash reference, not a distinct copy of the hash it
118 points to.  You can ask the object for a copy with the I<hash> method.
119
120 =cut
121
122 sub table { 'cust_recon'; }
123
124 =item insert
125
126 Adds this record to the database.  If there is an error, returns the error,
127 otherwise returns false.
128
129 =cut
130
131 =item delete
132
133 Delete this record from the database.
134
135 =cut
136
137 =item replace OLD_RECORD
138
139 Replaces the OLD_RECORD with this one in the database.  If there is an error,
140 returns the error, otherwise returns false.
141
142 =cut
143
144 =item check
145
146 Checks all fields to make sure this is a valid reconcilation.  If there is
147 an error, returns the error, otherwise returns false.  Called by the insert
148 and replace methods.
149
150 =cut
151
152 sub check {
153   my $self = shift;
154
155   my $error = 
156     $self->ut_numbern('reconid')
157     || $self->ut_numbern('recondate')
158     || $self->ut_number('custnum')
159     || $self->ut_number('agentnum')
160     || $self->ut_text('last')
161     || $self->ut_text('first')
162     || $self->ut_text('address1')
163     || $self->ut_textn('address2')
164     || $self->ut_text('city')
165     || $self->ut_textn('state')
166     || $self->ut_textn('zip')
167     || $self->ut_textn('pkg')
168     || $self->ut_numbern('adjourn')
169     || $self->ut_textn('status')
170     || $self->ut_text('agent_custid')
171     || $self->ut_textn('agent_pkg')
172     || $self->ut_numbern('agent_adjourn')
173     || $self->ut_textn('comments')
174   ;
175   return $error if $error;
176
177   $self->SUPER::check;
178 }
179
180 =back
181
182 =head1 BUGS
183
184 Possibly the existance of this module.
185
186 =head1 SEE ALSO
187
188 L<FS::Record>, schema.html from the base documentation.
189
190 =cut
191
192 1;
193