fix one-time charge quantities &
[freeside.git] / FS / FS / cust_pkg.pm
index 98b50cb..5d449ac 100644 (file)
@@ -128,6 +128,8 @@ inherits from FS::Record.  The following fields are currently supported:
 =item manual_flag - If this field is set to 1, disables the automatic
 unsuspension of this package when using the B<unsuspendauto> config file.
 
+=item quantity - If not set, defaults to 1
+
 =back
 
 Note: setup, bill, adjourn, susp, expire and cancel are specified as UNIX timestamps;
@@ -1335,6 +1337,18 @@ sub attribute_since_sqlradacct {
 
 }
 
+=item quantity
+
+=cut
+
+sub quantity {
+  my( $self, $value ) = @_;
+  if ( defined($value) ) {
+    $self->setfield('quantity', $value);
+  }
+  $self->getfield('quantity') || 1;
+}
+
 =item transfer DEST_PKGNUM | DEST_CUST_PKG, [ OPTION => VALUE ... ]
 
 Transfers as many services as possible from this package to another package.
@@ -1567,27 +1581,71 @@ sub cancel_sql {
   "cust_pkg.cancel IS NOT NULL AND cust_pkg.cancel != 0";
 }
 
-=item search_sql HREF
+=item search_sql HASHREF
+
+(Class method)
 
-Returns a qsearch hash expression to search for parameters specified in HREF.
+Returns a qsearch hash expression to search for parameters specified in HASHREF.
 Valid parameters are
 
 =over 4
+
 =item agentnum
-=item magic - /^(active|inactive|suspended|cancell?ed)$/
-=item status - /^(active|inactive|suspended|one-time charge|inactive|cancell?ed)$/
+
+=item magic
+
+active, inactive, suspended, cancel (or cancelled)
+
+=item status
+
+active, inactive, suspended, one-time charge, inactive, cancel (or cancelled)
+
 =item classnum
-=item pkgpart - list specified how?
-=item setup     - arrayref of beginning and ending epoch date
-=item last_bill - arrayref of beginning and ending epoch date
-=item bill      - arrayref of beginning and ending epoch date
-=item adjourn   - arrayref of beginning and ending epoch date
-=item susp      - arrayref of beginning and ending epoch date
-=item expire    - arrayref of beginning and ending epoch date
-=item cancel    - arrayref of beginning and ending epoch date
-=item query - /^(pkgnum/APKG_pkgnum)$/
-=item cust_fields - a value suited to passing to FS::UI::Web::cust_header
-=item CurrentUser - specifies the user for agent virtualization
+
+=item pkgpart
+
+list specified how?
+
+=item setup
+
+arrayref of beginning and ending epoch date
+
+=item last_bill
+
+arrayref of beginning and ending epoch date
+
+=item bill
+
+arrayref of beginning and ending epoch date
+
+=item adjourn
+
+arrayref of beginning and ending epoch date
+
+=item susp
+
+arrayref of beginning and ending epoch date
+
+=item expire
+
+arrayref of beginning and ending epoch date
+
+=item cancel
+
+arrayref of beginning and ending epoch date
+
+=item query
+
+pkgnum or APKG_pkgnum
+
+=item cust_fields
+
+a value suited to passing to FS::UI::Web::cust_header
+
+=item CurrentUser
+
+specifies the user for agent virtualization
+
 =back
 
 =cut