X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_pkg.pm;h=3e638a6860f0013830133e1e582a0e33e011e2a3;hb=e4419db2b564c53ba0b0aa32590b22a8e114650a;hp=dedc6374a13c3e0147aa1951bbe73d34bb5bd692;hpb=ed0b1255389309d81f1e87ad3b1d5bd7ab3dd9b7;p=freeside.git diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index dedc6374a..3e638a686 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -632,6 +632,7 @@ sub check { || $self->ut_foreign_keyn('contactnum', 'contact', 'contactnum' ) || $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum') || $self->ut_foreign_keyn('salesnum', 'sales', 'salesnum') + || $self->ut_numbern('quantity') || $self->ut_numbern('start_date') || $self->ut_numbern('setup') || $self->ut_numbern('bill') @@ -2227,7 +2228,7 @@ sub abort_change { =item set_quantity QUANTITY -Change the package's quantity field. This is the one package property +Change the package's quantity field. This is one of the few package properties 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. @@ -2237,9 +2238,23 @@ empty string. 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->quantity(shift); + $self->replace; +} + +=item set_salesnum SALESNUM + +Change the package's salesnum (sales person) field. This is one of the few +package properties 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_salesnum { + my $self = shift; + $self = $self->replace_old; # just to make sure + $self->salesnum(shift); $self->replace; }