summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-03-26 19:00:33 -0700
committerIvan Kohler <ivan@freeside.biz>2013-03-26 19:00:33 -0700
commitd06f67ed49d71e8d2c957d877fe738a8cac0cfe2 (patch)
tree304285d7a9c54175d6662a6af9411108aba8e097 /FS
parent8a6bdb6425eac988c19822f301a5849468f85f2e (diff)
parent6a42226f7f1779974316111cb178a3c6a6d74931 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_pkg.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 87acf0e52..374cf7a12 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1931,6 +1931,24 @@ sub change {
}
+=item set_quantity QUANTITY
+
+Change the package's quantity field. This is the one package property
+that can safely be changed without canceling and reordering the package
+(because it doesn't affect tax eligibility). Returns an error or an
+empty string.
+
+=cut
+
+sub set_quantity {
+ my $self = shift;
+ $self = $self->replace_old; # just to make sure
+ my $qty = shift;
+ ($qty =~ /^\d+$/ and $qty > 0) or return "bad package quantity $qty";
+ $self->set('quantity' => $qty);
+ $self->replace;
+}
+
use Storable 'thaw';
use MIME::Base64;
sub process_bulk_cust_pkg {