[freeside-commits] freeside/FS/FS cust_pkg_detail.pm, 1.1.2.2, 1.1.2.3
Ivan,,,
ivan at wavetail.420.am
Tue Sep 9 13:58:18 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv2788
Modified Files:
Tag: FREESIDE_1_7_BRANCH
cust_pkg_detail.pm
Log Message:
1.7 somehow got an old copy of cust_pkg_detail, doh
Index: cust_pkg_detail.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg_detail.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- cust_pkg_detail.pm 8 Sep 2008 02:42:30 -0000 1.1.2.2
+++ cust_pkg_detail.pm 9 Sep 2008 20:58:12 -0000 1.1.2.3
@@ -2,7 +2,7 @@
use strict;
use vars qw( @ISA );
-use FS::Record qw( qsearch qsearchs );
+use FS::Record; # qw( qsearch qsearchs );
@ISA = qw(FS::Record);
@@ -27,8 +27,9 @@
=head1 DESCRIPTION
-An FS::cust_pkg_detail object represents an example. FS::cust_pkg_detail inherits from
-FS::Record. The following fields are currently supported:
+An FS::cust_pkg_detail object represents additional customer package details.
+FS::cust_pkg_detail inherits from FS::Record. The following fields are
+currently supported:
=over 4
@@ -38,7 +39,7 @@
=item pkgnum
-pkgnum
+pkgnum (see L<FS::cust_pkg>)
=item detail
@@ -46,12 +47,11 @@
=item detailtype
-detailtype
+"I" for Invoice details or "C" for comments
=item weight
-weight
-
+Optional display weight
=back
@@ -61,7 +61,7 @@
=item new HASHREF
-Creates a new example. To add the example to the database, see L<"insert">.
+Creates a new record. To add the record to the database, see L<"insert">.
Note that this stores the hash reference, not a distinct copy of the hash it
points to. You can ask the object for a copy with the I<hash> method.
@@ -100,7 +100,7 @@
=item check
-Checks all fields to make sure this is a valid example. If there is
+Checks all fields to make sure this is a valid record. If there is
an error, returns the error, otherwise returns false. Called by the insert
and replace methods.
@@ -114,13 +114,15 @@
my $error =
$self->ut_numbern('pkgdetailnum')
- || $self->ut_number('pkgnum')
+ || $self->ut_foreign_key('pkgnum', 'cust_pkg', 'pkgnum')
|| $self->ut_text('detail')
- || $self->ut_('detailtype')
- || $self->ut_number('weight')
+ || $self->ut_enum('detailtype', [ 'I', 'C' ] )
+ || $self->ut_numbern('weight')
;
return $error if $error;
+ $self->weight(0) unless $self->weight;
+
$self->SUPER::check;
}
@@ -128,11 +130,9 @@
=head1 BUGS
-The author forgot to customize this manpage.
-
=head1 SEE ALSO
-L<FS::Record>, schema.html from the base documentation.
+L<FS::cust_pkg>, L<FS::Record>, schema.html from the base documentation.
=cut
More information about the freeside-commits
mailing list