4 use vars qw( @ISA $conf $DEBUG $me );
5 use FS::Record qw( qsearch qsearchs );
8 @ISA = qw( FS::svc_Common );
10 $me = '[FS::svc_dsl]';
12 FS::UID->install_callback( sub {
19 FS::svc_dsl - Object methods for svc_dsl records
25 $record = new FS::svc_dsl \%hash;
26 $record = new FS::svc_dsl { 'column' => 'value' };
28 $error = $record->insert;
30 $error = $new_record->replace($old_record);
32 $error = $record->delete;
34 $error = $record->check;
36 $error = $record->suspend;
38 $error = $record->unsuspend;
40 $error = $record->cancel;
44 An FS::svc_dsl object represents a DSL service. FS::svc_dsl inherits from
45 FS::svc_Common. The following fields are currently supported:
49 =item svcnum - Primary key (assigned automatcially for new DSL))
51 =item pushed - Time DSL order pushed to vendor/telco, if applicable
53 =item desired_due_date - Desired Due Date
55 =item due_date - Due Date
57 =item vendor_order_id - Vendor/telco DSL order #
59 =item vendor_order_type
61 Vendor/telco DSL order type (e.g. (M)ove, (A)dd, (C)hange, (D)elete, or similar)
63 =item vendor_order_status
65 Vendor/telco DSL order status (e.g. (N)ew, (A)ssigned, (R)ejected, (M)revised,
66 (C)ompleted, (X)cancelled, or similar)
68 =item first - End-user first name
70 =item last - End-user last name
72 =item company - End-user company name
74 =item phonenum - DSL Telephone Number
76 =item loop_type - Loop-type - vendor/telco-specific
78 =item local_voice_provider - Local Voice Provider's name
80 =item circuitnum - Circuit #
82 =item rate_band - Rate Band
92 Ikano-specific fields, do not use otherwise
94 =item username - if outsourced PPPoE/RADIUS, username
96 =item password - if outsourced PPPoE/RADIUS, password
98 =item monitored - Order is monitored (auto-pull/sync), either Y or blank
100 =item last_pull - time of last data pull from vendor/telco
104 DSL order notes placed by staff or vendor/telco on the vendor/telco order
115 Creates a new DSL. To add the DSL to the database, see L<"insert">.
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.
122 # the new method can be inherited from FS::Record, if a table method is defined
125 my %dis1 = ( disable_default=>1, disable_fixed=>1, disable_inventory=>1, disable_select=>1 );
126 my %dis2 = ( disable_inventory=>1, disable_select=>1 );
130 'sorts' => [ 'phonenum' ],
131 'display_weight' => 55,
132 'cancel_weight' => 75,
134 'pushed' => { label => 'Pushed',
135 type => 'disabled' },
136 'desired_due_date' => { label => 'Desired Due Date', %dis2, },
137 'due_date' => { label => 'Due Date', %dis2, },
138 'vendor_order_id' => { label => 'Vendor Order Id', %dis2, },
139 'vendor_qual_id' => { label => 'Vendor Qualification Id',
140 type => 'disabled' },
141 'vendor_order_type' => { label => 'Vendor Order Type',
142 disable_inventory => 1,
144 'vendor_order_status' => { label => 'Vendor Order Status',
145 disable_inventory => 1,
147 'first' => { label => 'First Name', %dis2, },
148 'last' => { label => 'Last Name', %dis2, },
149 'company' => { label => 'Company Name', %dis2, },
150 'phonenum' => { label => 'Service Telephone Number', },
151 'loop_type' => { label => 'Loop Type',
152 disable_inventory => 1,
154 'local_voice_provider' => { label => 'Local Voice Provider',
155 disable_inventory => 1,
157 'circuitnum' => { label => 'Circuit #', },
158 'rate_band' => { label => 'Rate Band',
159 disable_inventory => 1,
161 'isp_chg' => { label => 'ISP Changing?',
162 type => 'checkbox', %dis2 },
163 'isp_prev' => { label => 'Current or Previous ISP',
164 disable_inventory => 1,
166 'username' => { label => 'PPPoE Username',
169 'password' => { label => 'PPPoE Password', %dis2 },
170 'staticips' => { label => 'Static IPs', %dis1 },
171 'monitored' => { label => 'Monitored',
172 type => 'checkbox', %dis2 },
173 'last_pull' => { label => 'Last Pull', type => 'disabled' },
174 'notes' => { label => 'Order Notes', %dis1 },
179 sub table { 'svc_dsl'; }
183 return $self->phonenum if $self->phonenum;
184 return $self->username if $self->username;
185 return $self->vendor_order_id if $self->vendor_order_id;
186 return $self->svcnum;
191 Adds this record to the database. If there is an error, returns the error,
192 otherwise returns false.
196 # the insert method can be inherited from FS::Record
200 Delete this record from the database.
204 # the delete method can be inherited from FS::Record
206 =item replace OLD_RECORD
208 Replaces the OLD_RECORD with this one in the database. If there is an error,
209 returns the error, otherwise returns false.
213 # the replace method can be inherited from FS::Record
217 Checks all fields to make sure this is a valid DSL. If there is
218 an error, returns the error, otherwise returns false. Called by the insert
223 # the check method should currently be supplied - FS::Record contains some
224 # data checking routines
230 $self->ut_numbern('svcnum')
231 || $self->ut_numbern('pushed')
232 || $self->ut_number('desired_due_date')
233 || $self->ut_numbern('due_date')
234 || $self->ut_textn('vendor_order_id')
235 || $self->ut_textn('vendor_qual_id')
236 || $self->ut_alpha('vendor_order_type')
237 || $self->ut_alphan('vendor_order_status')
238 || $self->ut_text('first')
239 || $self->ut_text('last')
240 || $self->ut_textn('company')
241 || $self->ut_numbern('phonenum')
242 || $self->ut_alphasn('loop_type')
243 || $self->ut_textn('local_voice_provider')
244 || $self->ut_textn('circuitnum')
245 || $self->ut_textn('rate_band')
246 || $self->ut_alphan('isp_chg')
247 || $self->ut_textn('isp_prev')
248 || $self->ut_textn('username')
249 || $self->ut_textn('password')
250 || $self->ut_textn('staticips')
251 || $self->ut_enum('monitored', [ '', 'Y' ])
252 || $self->ut_numbern('last_pull')
253 || $self->ut_textn('notes')
255 return $error if $error;
264 L<FS::svc_Common>, edit/part_svc.cgi from an installed web interface,
265 export.html from the base documentation, L<FS::Record>, L<FS::Conf>,
266 L<FS::cust_svc>, L<FS::part_svc>, L<FS::cust_pkg>, L<FS::queue>,
267 L<freeside-queued>, schema.html from the base documentation.