X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg.pm;h=ba5016efbf67382d6e55c5c89468500b78677550;hp=d00f0397ba2cf4c3e7c7a050d568a977810330e3;hb=772656864b377bbd2ef2febd40891ef1206b5be0;hpb=2a557042a62c71b2bcee3d4d2b7e6c79bc52e67a diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index d00f0397b..ba5016efb 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -147,7 +147,7 @@ Billing item definition (see L) =item locationnum -Optional link to package location (see L) +Optional link to package location (see L) =item order_date @@ -623,7 +623,7 @@ Available options are: =item reason -can be set to a cancellation reason (see L), either a reasonnum of an existing reason, or passing a hashref will create a new reason. The hashref should have the following keys: typenum - Reason type (see L, reason - Text of the new reason. +can be set to a cancellation reason (see L), either a reasonnum of an existing reason, or passing a hashref will create a new reason. The hashref should have the following keys: typenum - Reason type (see L, reason - Text of the new reason. =item reason_otaker @@ -869,7 +869,7 @@ correctly. Note however that this is an immediate cancel and just changes the date. You are PROBABLY looking to expire the account instead of using this. -=item reason - can be set to a cancellation reason (see L), +=item reason - can be set to a cancellation reason (see L), either a reasonnum of an existing reason, or passing a hashref will create a new reason. The hashref should have the following keys: typenum - Reason type (see L, reason - Text of the new reason. @@ -1521,7 +1521,7 @@ Available options are: =over 4 -=item reason - can be set to a cancellation reason (see L), +=item reason - can be set to a cancellation reason (see L), either a reasonnum of an existing reason, or passing a hashref will create a new reason. The hashref should have the following keys: - typenum - Reason type (see L @@ -4767,7 +4767,7 @@ Available options are: =item reason -can be set to a cancellation reason (see L), either a reasonnum of an existing reason, or passing a hashref will create a new reason. The hashref should have the following keys: typenum - Reason type (see L, reason - Text of the new reason. +can be set to a cancellation reason (see L), either a reasonnum of an existing reason, or passing a hashref will create a new reason. The hashref should have the following keys: typenum - Reason type (see L, reason - Text of the new reason. =item reason_otaker @@ -5463,6 +5463,24 @@ sub fcc_477_count { } +=item fcc_477_record + +Returns a fcc_477 record based on option name. + +=cut + +sub fcc_477_record { + my ($self, $option_name) = @_; + + my $fcc_record = qsearchs({ + 'table' => 'part_pkg_fcc_option', + 'hashref' => { 'pkgpart' => $self->{Hash}->{pkgpart}, 'fccoptionname' => $option_name, }, + }); + + return ( $fcc_record ); + +} + =item tax_locationnum_sql Returns an SQL expression for the tax location for a package, based @@ -5596,6 +5614,8 @@ sub _X_show_zero { =item order CUSTNUM, PKGPARTS_ARYREF, [ REMOVE_PKGNUMS_ARYREF [ RETURN_CUST_PKG_ARRAYREF [ REFNUM ] ] ] +=item order \%PARAMS + Bulk cancel + order subroutine. Perhaps slightly deprecated, only used by the bulk cancel+order in the web UI and nowhere else (edit/process/cust_pkg.cgi) @@ -5620,10 +5640,25 @@ setting I to an array reference of refnums or a hash reference with refnums as keys. If no I is defined, a default FS::pkg_referral record will be created corresponding to cust_main.refnum. +LOCATIONNUM, if specified, will be set on newly created cust_pkg records + =cut sub order { - 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) = @_; + } my $conf = new FS::Conf; @@ -5667,6 +5702,8 @@ sub order { } + $hash{locationnum} = $locationnum if $locationnum; + # Create the new packages. foreach my $pkgpart (@$pkgparts) {