[freeside-commits] freeside/FS/FS Schema.pm, 1.246, 1.247 qual.pm, 1.2, 1.3 svc_dsl.pm, 1.3, 1.4
Erik Levinson
levinse at wavetail.420.am
Sun Nov 28 12:08:52 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv23034/FS/FS
Modified Files:
Schema.pm qual.pm svc_dsl.pm
Log Message:
ikano, svc_dsl, qual, on-going implementation, RT7111
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.246
retrieving revision 1.247
diff -u -w -d -r1.246 -r1.247
--- Schema.pm 25 Nov 2010 01:46:33 -0000 1.246
+++ Schema.pm 28 Nov 2010 20:08:49 -0000 1.247
@@ -1681,15 +1681,18 @@
'qual' => {
'columns' => [
'qualnum', 'serial', '', '', '', '',
- 'contactnum', 'int', '', '', '', '',
- 'svctn', 'varchar', 'NULL', 24, '', '',
- 'svcdb', 'varchar', '', $char_d, '', '',
+ 'custnum', 'int', 'NULL', '', '', '',
+ 'prospectnum', 'int', 'NULL', '', '', '',
+ 'locationnum', 'int', 'NULL', '', '', '',
+ 'phonenum', 'varchar', 'NULL', 24, '', '',
+ 'exportnum', 'int', '', '', '', '',
'vendor_qual_id', 'varchar', 'NULL', $char_d, '', '',
'status', 'char', '', 1, '', '',
],
'primary_key' => 'qualnum',
'unique' => [],
- 'index' => [ [ 'contactnum' ] ],
+ 'index' => [ [ 'locationnum' ], ['custnum'], ['prospectnum'],
+ ['phonenum'], ['vendor_qual_id'] ],
},
'qual_option' => {
@@ -1837,8 +1840,8 @@
'columns' => [
'svcnum', 'int', '', '', '', '',
'pushed', 'int', 'NULL', '', '', '',
- 'desired_dd', 'int', 'NULL', '', '', '',
- 'dd', 'int', 'NULL', '', '', '',
+ 'desired_due_date', 'int', 'NULL', '', '', '',
+ 'due_date', 'int', 'NULL', '', '', '',
'vendor_order_id', 'varchar', 'NULL', $char_d, '', '',
'vendor_qual_id', 'varchar', 'NULL', $char_d, '', '',
'vendor_order_type', 'char', 'NULL', 1, '', '',
@@ -1846,10 +1849,10 @@
'first', 'varchar', 'NULL', $char_d, '', '',
'last', 'varchar', 'NULL', $char_d, '', '',
'company', 'varchar', 'NULL', $char_d, '', '',
- 'svctn', 'varchar', 'NULL', 24, '', '',
+ 'phonenum', 'varchar', 'NULL', 24, '', '',
'loop_type', 'char', 'NULL', 1, '', '',
- 'lvp', 'varchar', 'NULL', $char_d, '', '',
- 'cktnum', 'varchar', 'NULL', $char_d, '', '',
+ 'local_voice_provider', 'varchar', 'NULL', $char_d, '', '',
+ 'circuitnum', 'varchar', 'NULL', $char_d, '', '',
'rate_band', 'varchar', 'NULL', $char_d, '', '',
'isp_chg', 'char', 'NULL', 1, '', '',
'isp_prev', 'varchar', 'NULL', $char_d, '', '',
@@ -1862,7 +1865,7 @@
],
'primary_key' => 'svcnum',
'unique' => [ ],
- 'index' => [ ['svctn'] ],
+ 'index' => [ ['phonenum'], ['vendor_order_id'] ],
},
Index: qual.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/qual.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- qual.pm 27 Nov 2010 05:17:51 -0000 1.2
+++ qual.pm 28 Nov 2010 20:08:50 -0000 1.3
@@ -32,12 +32,20 @@
=item qualnum - primary key
-=item contactnum - Contact (Prospect/Customer) - see L<FS::contact>
+=item prospectnum
-=item svctn - Service Telephone Number
+=item custnum
-=item svcdb - table used for this service. See L<FS::svc_dsl> and
-L<FS::svc_broadband>, among others.
+=item locationnum
+
+Either one of these cases must be true:
+-locationnum is non-null and prospectnum is null and custnum is null
+-locationnum is null and (prospectnum is non-null or custnum is non-null, but not both non-null)
+
+=item phonenum - Service Telephone Number
+
+=item exportnum - export instance providing service-qualification capabilities,
+see L<FS::part_export>
=item vendor_qual_id - qualification id from vendor/telco
@@ -105,14 +113,26 @@
my $error =
$self->ut_numbern('qualnum')
- || $self->ut_number('contactnum')
- || $self->ut_numbern('svctn')
- || $self->ut_alpha('svcdb')
+ || $self->ut_foreign_keyn('custnum', 'cust_main', 'qualnum')
+ || $self->ut_foreign_keyn('prospectnum', 'prospect_main', 'prospectnum')
+ || $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum')
+ || $self->ut_numbern('phonenum')
+ || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum')
|| $self->ut_textn('vendor_qual_id')
|| $self->ut_alpha('status')
;
return $error if $error;
+#Either one of these cases must be true:
+#1. locationnum is non-null and prospectnum is null and custnum is null
+#2. locationnum is null and (prospectnum is non-null or custnum is non-null, but not both non-null)
+ return "Invalid prospect/customer/location combination" unless (
+ ( $self->locationnum && !$self->prospectcnum && !$self->custnum ) #1
+ ||
+ ( !$self->locationnum && ( $self->prospectnum || $self->custnum )
+ && !( $self->custnum && $self->prospectnum ) ) #2
+ );
+
$self->SUPER::check;
}
Index: svc_dsl.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_dsl.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- svc_dsl.pm 27 Nov 2010 05:17:52 -0000 1.3
+++ svc_dsl.pm 28 Nov 2010 20:08:50 -0000 1.4
@@ -46,25 +46,15 @@
=over 4
-=item svcnum
-
-Primary key (assigned automatcially for new DSL))
-
-=item pushed
-
-Time the DSL order was pushed to a vendor, if exporting orders to a vendor/telco
-
-=item desired_dd
-
-Desired Due Date
+=item svcnum - Primary key (assigned automatcially for new DSL))
-=item dd
+=item pushed - Time DSL order pushed to vendor/telco, if applicable
-Due Date (e.g. once order is in Assigned status or similar by the telco)
+=item desired_due_date - Desired Due Date
-=item vendor_order_id
+=item due_date - Due Date
-Vendor/telco DSL order #
+=item vendor_order_id - Vendor/telco DSL order #
=item vendor_order_type
@@ -75,37 +65,21 @@
Vendor/telco DSL order status (e.g. (N)ew, (A)ssigned, (R)ejected, (M)revised,
(C)ompleted, (X)cancelled, or similar)
-=item first
-
-End-user first name
-
-=item last
-
-End-user last name
-
-=item company
-
-End-user company name
-
-=item svctn
-
-DSL Telephone Number
-
-=item loop_type
+=item first - End-user first name
-Loop-type - vendor/telco-specific
+=item last - End-user last name
-=item lvp
+=item company - End-user company name
-Local Voice Provider's name
+=item phonenum - DSL Telephone Number
-=item cktnum
+=item loop_type - Loop-type - vendor/telco-specific
-Circuit #
+=item local_voice_provider - Local Voice Provider's name
-=item rate_band
+=item circuitnum - Circuit #
-Rate Band
+=item rate_band - Rate Band
=item isp_chg
@@ -117,21 +91,13 @@
Ikano-specific fields, do not use otherwise
-=item username
-
-If outsourced PPPoE/RADIUS, username
-
-=item password
-
-If outsourced PPPoE/RADIUS, password
-
-=item monitored
+=item username - if outsourced PPPoE/RADIUS, username
-Order is monitored (auto-pull/sync), either Y or blank
+=item password - if outsourced PPPoE/RADIUS, password
-=item last_pull
+=item monitored - Order is monitored (auto-pull/sync), either Y or blank
-Time of last data pull from vendor/telco
+=item last_pull - time of last data pull from vendor/telco
=item notes
@@ -161,14 +127,14 @@
{
'name' => 'DSL',
- 'sorts' => [ 'svctn' ],
+ 'sorts' => [ 'phonenum' ],
'display_weight' => 55,
'cancel_weight' => 75,
'fields' => {
'pushed' => { label => 'Pushed',
type => 'disabled' },
- 'desired_dd' => { label => 'Desired Due Date', %dis2, },
- 'dd' => { label => 'Due Date', %dis2, },
+ 'desired_due_date' => { label => 'Desired Due Date', %dis2, },
+ 'due_date' => { label => 'Due Date', %dis2, },
'vendor_order_id' => { label => 'Vendor Order Id', %dis2, },
'vendor_qual_id' => { label => 'Vendor Qualification Id',
type => 'disabled' },
@@ -181,14 +147,14 @@
'first' => { label => 'First Name', %dis2, },
'last' => { label => 'Last Name', %dis2, },
'company' => { label => 'Company Name', %dis2, },
- 'svctn' => { label => 'Service Telephone Number', },
+ 'phonenum' => { label => 'Service Telephone Number', },
'loop_type' => { label => 'Loop Type',
disable_inventory => 1,
},
- 'lvp' => { label => 'Local Voice Provider',
+ 'local_voice_provider' => { label => 'Local Voice Provider',
disable_inventory => 1,
},
- 'cktnum' => { label => 'Circuit #', },
+ 'circuitnum' => { label => 'Circuit #', },
'rate_band' => { label => 'Rate Band',
disable_inventory => 1,
},
@@ -214,7 +180,7 @@
sub label {
my $self = shift;
- return $self->svctn if $self->svctn;
+ return $self->phonenum if $self->phonenum;
return $self->username if $self->username;
return $self->vendor_order_id if $self->vendor_order_id;
return $self->svcnum;
@@ -263,8 +229,8 @@
my $error =
$self->ut_numbern('svcnum')
|| $self->ut_numbern('pushed')
- || $self->ut_number('desired_dd')
- || $self->ut_numbern('dd')
+ || $self->ut_number('desired_due_date')
+ || $self->ut_numbern('due_date')
|| $self->ut_textn('vendor_order_id')
|| $self->ut_textn('vendor_qual_id')
|| $self->ut_alpha('vendor_order_type')
@@ -272,10 +238,10 @@
|| $self->ut_text('first')
|| $self->ut_text('last')
|| $self->ut_textn('company')
- || $self->ut_numbern('svctn')
+ || $self->ut_numbern('phonenum')
|| $self->ut_alphasn('loop_type')
- || $self->ut_textn('lvp')
- || $self->ut_textn('cktnum')
+ || $self->ut_textn('local_voice_provider')
+ || $self->ut_textn('circuitnum')
|| $self->ut_textn('rate_band')
|| $self->ut_alphan('isp_chg')
|| $self->ut_textn('isp_prev')
More information about the freeside-commits
mailing list