From 6a42226f7f1779974316111cb178a3c6a6d74931 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 26 Mar 2013 17:01:10 -0700 Subject: UI to change package quantities, #18330 --- FS/FS/cust_pkg.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'FS') 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 { -- cgit v1.2.1