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 | |
| parent | 65e3d153162c86acc526849af93a027696f9b843 (diff) | |
discounts on one-time charges< RT#75448
Diffstat (limited to 'FS/FS')
| -rw-r--r-- | FS/FS/cust_main.pm | 21 | ||||
| -rw-r--r-- | FS/FS/quotation.pm | 19 |
2 files changed, 27 insertions, 13 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 9e0fda438..44faa273d 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; diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm index c61e001c6..2f95425cc 100644 --- a/FS/FS/quotation.pm +++ b/FS/FS/quotation.pm @@ -510,6 +510,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}; @@ -529,6 +530,9 @@ sub charge { $bill_now = exists($_[0]->{bill_now}) ? $_[0]->{bill_now} : ''; $invoice_terms = exists($_[0]->{invoice_terms}) ? $_[0]->{invoice_terms} : ''; $locationnum = $_[0]->{locationnum}; + $discountnum = $_->{setup_discountnum}; + $discountnum_amount = $_->{setup_discountnum_amount}; + $discountnum_percent = $_->{setup_discountnum_percent}; } else { $amount = shift; $setup_cost = ''; @@ -599,12 +603,15 @@ sub charge { # of ordering a customer package, no "bill now") my $quotation_pkg = new FS::quotation_pkg ( { - 'quotationnum' => $self->quotationnum, - 'pkgpart' => $pkgpart, - 'quantity' => $quantity, - #'start_date' => $start_date, - #'no_auto' => $no_auto, - 'locationnum'=> $locationnum, + 'quotationnum' => $self->quotationnum, + 'pkgpart' => $pkgpart, + 'quantity' => $quantity, + #'start_date' => $start_date, + #'no_auto' => $no_auto, + 'locationnum' => $locationnum, + 'setup_discountnum' => $discountnum, + 'setup_discountnum_amount' => $discountnum_amount, + 'setup_discountnum_percent' => $discountnum_percent, } ); $error = $quotation_pkg->insert; |
