summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_pkg.pm
diff options
context:
space:
mode:
authorivan <ivan>2008-06-03 21:06:22 +0000
committerivan <ivan>2008-06-03 21:06:22 +0000
commit59e56007d602991c13fcb18e928762c070c394e6 (patch)
treea00adaf397b1cf409943121920337d6cde0475b9 /FS/FS/cust_bill_pkg.pm
parent6e378bcfac9d6a5107ba4154b3882aa7ea512905 (diff)
very basic start at adding quantities
Diffstat (limited to 'FS/FS/cust_bill_pkg.pm')
-rw-r--r--FS/FS/cust_bill_pkg.pm46
1 files changed, 46 insertions, 0 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 31d5378..d15200e 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -57,6 +57,12 @@ supported:
=item itemdesc - Line item description (currentlty used only when pkgnum is 0 or -1)
+=item quantity - If not set, defaults to 1
+
+=item unitsetup - If not set, defaults to setup
+
+=item unitrecur - If not set, defaults to recur
+
=back
sdate and edate are specified as UNIX timestamps; see L<perlfunc/"time">. Also
@@ -367,6 +373,46 @@ sub units {
$self->part_pkg->calc_units($self->cust_pkg);
}
+=item quantity
+
+=cut
+
+sub quantity {
+ my( $self, $value ) = @_;
+ if ( defined($value) ) {
+ $self->setfield('quantity', $value);
+ }
+ $self->getfield('quantity') || 1;
+}
+
+=item unitsetup
+
+=cut
+
+sub unitsetup {
+ my( $self, $value ) = @_;
+ if ( defined($value) ) {
+ $self->setfield('unitsetup', $value);
+ }
+ $self->getfield('unitsetup') eq ''
+ ? $self->getfield('setup')
+ : $self->getfield('unitsetup');
+}
+
+=item unitrecur
+
+=cut
+
+sub unitrecur {
+ my( $self, $value ) = @_;
+ if ( defined($value) ) {
+ $self->setfield('unitrecur', $value);
+ }
+ $self->getfield('unitrecur') eq ''
+ ? $self->getfield('recur')
+ : $self->getfield('unitrecur');
+}
+
=back
=head1 BUGS