diff options
| author | Mark Wells <mark@freeside.biz> | 2013-03-26 17:01:10 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2013-03-26 17:01:51 -0700 |
| commit | 6a42226f7f1779974316111cb178a3c6a6d74931 (patch) | |
| tree | a0c5285a1ca67f4d009fe0a378f08b027e6b5a0f /FS | |
| parent | 092d75e50a900003904f8e400d6d102ba5bd16f9 (diff) | |
UI to change package quantities, #18330
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/cust_pkg.pm | 18 |
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 { |
