diff options
| author | Mark Wells <mark@freeside.biz> | 2012-12-30 15:36:25 -0800 | 
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2012-12-30 15:36:25 -0800 | 
| commit | bce3e7d93335196a137f6dbfc75335668842ecff (patch) | |
| tree | 4feaa8161fd045794da4bf0806f2b896c789398c | |
| parent | 49e08fcef54f4c4a3463d91f1cfcb69f121b2c5a (diff) | |
set default location on one-time charges, related to #940
| -rw-r--r-- | FS/FS/cust_main.pm | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 4ea4a6b9d..45d57cd79 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3403,6 +3403,8 @@ New-style, with a hashref of options:                                      'setuptax'   => '', # or 'Y' for tax exempt +                                    'locationnum'=> 1234, # optional +                                      #internal taxation                                      'taxclass'   => 'Tax class', @@ -3434,6 +3436,7 @@ sub charge {    my $no_auto = '';    my $cust_pkg_ref = '';    my ( $bill_now, $invoice_terms ) = ( 0, '' ); +  my $locationnum;    if ( ref( $_[0] ) ) {      $amount     = $_[0]->{amount};      $quantity   = exists($_[0]->{quantity}) ? $_[0]->{quantity} : 1; @@ -3451,6 +3454,7 @@ sub charge {      $cust_pkg_ref = exists($_[0]->{cust_pkg_ref}) ? $_[0]->{cust_pkg_ref} : '';      $bill_now = exists($_[0]->{bill_now}) ? $_[0]->{bill_now} : '';      $invoice_terms = exists($_[0]->{invoice_terms}) ? $_[0]->{invoice_terms} : ''; +    $locationnum = $_[0]->{locationnum} || $self->ship_locationnum;    } else {      $amount     = shift;      $quantity   = 1; @@ -3517,6 +3521,7 @@ sub charge {      'quantity'   => $quantity,      'start_date' => $start_date,      'no_auto'    => $no_auto, +    'locationnum'=> $locationnum,    } );    $error = $cust_pkg->insert;  | 
