diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-04-03 17:24:02 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-04-03 17:24:02 -0700 |
commit | ff6d9d364fbd070a3b632290ea9363b2ab1ae502 (patch) | |
tree | 5ec148945cb9fc789625112e2136dce61c33d585 /FS/FS/cust_main.pm | |
parent | 65e3d153162c86acc526849af93a027696f9b843 (diff) |
discounts on one-time charges< RT#75448
Diffstat (limited to 'FS/FS/cust_main.pm')
-rw-r--r-- | FS/FS/cust_main.pm | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 9e0fda4..44faa27 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3481,6 +3481,7 @@ sub charge { my $cust_pkg_ref = ''; my ( $bill_now, $invoice_terms ) = ( 0, '' ); my $locationnum; + my ( $discountnum, $discountnum_amount, $discountnum_percent ) = ( '','','' ); if ( ref( $_[0] ) ) { $amount = $_[0]->{amount}; $setup_cost = $_[0]->{setup_cost}; @@ -3501,6 +3502,9 @@ sub charge { $invoice_terms = exists($_[0]->{invoice_terms}) ? $_[0]->{invoice_terms} : ''; $locationnum = $_[0]->{locationnum} || $self->ship_locationnum; $separate_bill = $_[0]->{separate_bill} || ''; + $discountnum = $_[0]->{setup_discountnum}; + $discountnum_amount = $_[0]->{setup_discountnum_amount}; + $discountnum_percent = $_[0]->{setup_discountnum_percent}; } else { # yuck $amount = shift; $setup_cost = ''; @@ -3564,13 +3568,16 @@ sub charge { } my $cust_pkg = new FS::cust_pkg ( { - 'custnum' => $self->custnum, - 'pkgpart' => $pkgpart, - 'quantity' => $quantity, - 'start_date' => $start_date, - 'no_auto' => $no_auto, - 'separate_bill' => $separate_bill, - 'locationnum'=> $locationnum, + 'custnum' => $self->custnum, + 'pkgpart' => $pkgpart, + 'quantity' => $quantity, + 'start_date' => $start_date, + 'no_auto' => $no_auto, + 'separate_bill' => $separate_bill, + 'locationnum' => $locationnum, + 'setup_discountnum' => $discountnum, + 'setup_discountnum_amount' => $discountnum_amount, + 'setup_discountnum_percent' => $discountnum_percent, } ); $error = $cust_pkg->insert; |