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
111 Creates a new DSL. To add the DSL to the database, see L<"insert">.
113 Note that this stores the hash reference, not a distinct copy of the hash it
114 points to. You can ask the object for a copy with the I<hash> method.
118 # the new method can be inherited from FS::Record, if a table method is defined
121 my %dis1 = ( disable_default=>1, disable_fixed=>1, disable_inventory=>1, disable_select=>1 );
122 my %dis2 = ( disable_inventory=>1, disable_select=>1 );
126 'sorts' => [ 'phonenum' ],
127 'display_weight' => 55,
128 'cancel_weight' => 75,
130 'pushed' => { label => 'Pushed',
131 type => 'disabled' },
132 'desired_due_date' => { label => 'Desired Due Date', %dis2, },
133 'due_date' => { label => 'Due Date', %dis2, },
134 'vendor_order_id' => { label => 'Vendor Order Id', %dis2, },
135 'vendor_qual_id' => { label => 'Vendor Qualification Id',
136 type => 'disabled' },
137 'vendor_order_type' => { label => 'Vendor Order Type',
138 disable_inventory => 1,
140 'vendor_order_status' => { label => 'Vendor Order Status',
141 disable_inventory => 1,
143 'first' => { label => 'First Name', %dis2, },
144 'last' => { label => 'Last Name', %dis2, },
145 'company' => { label => 'Company Name', %dis2, },
146 'phonenum' => { label => 'Service Telephone Number', },
147 'loop_type' => { label => 'Loop Type',
148 disable_inventory => 1,
150 'local_voice_provider' => { label => 'Local Voice Provider',
151 disable_inventory => 1,
153 'circuitnum' => { label => 'Circuit #', },
154 'rate_band' => { label => 'Rate Band',
155 disable_inventory => 1,
157 'isp_chg' => { label => 'ISP Changing?',
158 type => 'checkbox', %dis2 },
159 'isp_prev' => { label => 'Current or Previous ISP',
160 disable_inventory => 1,
162 'username' => { label => 'PPPoE Username',
165 'password' => { label => 'PPPoE Password', %dis2 },
166 'staticips' => { label => 'Static IPs', %dis1 },
167 'monitored' => { label => 'Monitored',
168 type => 'checkbox', %dis2 },
169 'last_pull' => { label => 'Last Pull', type => 'disabled' },
174 sub table { 'svc_dsl'; }
178 return $self->phonenum if $self->phonenum;
179 return $self->username if $self->username;
180 return $self->vendor_order_id if $self->vendor_order_id;
181 return $self->svcnum;
186 Returns the set of FS::dsl_notes associated with this service
191 qsearch( 'dsl_note', { 'svcnum' => $self->svcnum } );
196 Adds this record to the database. If there is an error, returns the error,
197 otherwise returns false.
201 # the insert method can be inherited from FS::Record
205 Delete this record from the database.
209 # the delete method can be inherited from FS::Record
211 =item replace OLD_RECORD
213 Replaces the OLD_RECORD with this one in the database. If there is an error,
214 returns the error, otherwise returns false.
218 # the replace method can be inherited from FS::Record
222 Checks all fields to make sure this is a valid DSL. If there is
223 an error, returns the error, otherwise returns false. Called by the insert
228 # the check method should currently be supplied - FS::Record contains some
229 # data checking routines
235 $self->ut_numbern('svcnum')
236 || $self->ut_numbern('pushed')
237 || $self->ut_number('desired_due_date')
238 || $self->ut_numbern('due_date')
239 || $self->ut_textn('vendor_order_id')
240 || $self->ut_textn('vendor_qual_id')
241 || $self->ut_alpha('vendor_order_type')
242 || $self->ut_alphan('vendor_order_status')
243 || $self->ut_text('first')
244 || $self->ut_text('last')
245 || $self->ut_textn('company')
246 || $self->ut_numbern('phonenum')
247 || $self->ut_alphasn('loop_type')
248 || $self->ut_textn('local_voice_provider')
249 || $self->ut_textn('circuitnum')
250 || $self->ut_textn('rate_band')
251 || $self->ut_alphan('isp_chg')
252 || $self->ut_textn('isp_prev')
253 || $self->ut_textn('username')
254 || $self->ut_textn('password')
255 || $self->ut_textn('staticips')
256 || $self->ut_enum('monitored', [ '', 'Y' ])
257 || $self->ut_numbern('last_pull')
259 return $error if $error;
268 L<FS::svc_Common>, edit/part_svc.cgi from an installed web interface,
269 export.html from the base documentation, L<FS::Record>, L<FS::Conf>,
270 L<FS::cust_svc>, L<FS::part_svc>, L<FS::cust_pkg>, L<FS::queue>,
271 L<freeside-queued>, schema.html from the base documentation.