- my ($custnum, $pkgparts, $remove_pkgnum, $return_cust_pkg, $refnum) = @_;
+ my ($custnum, $pkgparts, $remove_pkgnum, $return_cust_pkg, $refnum,
+ $locationnum);
+
+ if ( ref $_[0] ) {
+ my $args = $_[0];
+ $custnum = $args->{custnum};
+ $pkgparts = $args->{pkgparts};
+ $remove_pkgnum = $args->{remove_pkgnum};
+ $return_cust_pkg = $args->{return_cust_pkg};
+ $refnum = $args->{refnum};
+ $locationnum = $args->{locationnum};
+ } else {
+ ($custnum, $pkgparts, $remove_pkgnum, $return_cust_pkg, $refnum) = @_;
+ }