[freeside-commits] branch FREESIDE_2_3_BRANCH updated. abc5455434e69165b722b0b443cb005edad6db28
Ivan
ivan at 420.am
Sat Aug 4 09:26:29 PDT 2012
The branch, FREESIDE_2_3_BRANCH has been updated
via abc5455434e69165b722b0b443cb005edad6db28 (commit)
from e03a0c7c4cc4f0742a8ded7956cad5558f87bd16 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit abc5455434e69165b722b0b443cb005edad6db28
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sat Aug 4 09:26:26 2012 -0700
fix skipping processing fee for first payment, RT#18345
diff --git a/FS/FS/ClientAPI/MasonComponent.pm b/FS/FS/ClientAPI/MasonComponent.pm
index 252d402..357ca87 100644
--- a/FS/FS/ClientAPI/MasonComponent.pm
+++ b/FS/FS/ClientAPI/MasonComponent.pm
@@ -55,7 +55,7 @@ my %session_callbacks = (
%args,
'process-pkgpart' => scalar($conf->config('selfservice_process-pkgpart')),
'process-display' => scalar($conf->config('selfservice_process-display')),
- 'process-skip-first' => $conf->exists('selfservice_process-skip_first'),
+ 'process-skip_first' => $conf->exists('selfservice_process-skip_first'),
'num_payments' => scalar($cust_main->cust_pay),
'surcharge_percentage' => scalar($conf->config('credit-card-surcharge-percentage')),
);
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 15c47c6..334614b 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -898,7 +898,12 @@ sub validate_payment {
my $conf = new FS::Conf;
my $fee_display = $conf->config('selfservice_process-display') || 'add';
my $fee_pkgpart = $conf->config('selfservice_process-pkgpart');
- if ( $fee_display eq 'add' && $fee_pkgpart ) {
+ my $fee_skip_first = $conf->exists('selfservice_process-skip_first');
+ if ( $fee_display eq 'add'
+ and $fee_pkgpart
+ and ! $fee_skip_first || scalar($cust_main->cust_pay)
+ )
+ {
my $fee_pkg = qsearchs('part_pkg', { pkgpart=>$fee_pkgpart } );
$amount = sprintf('%.2f', $amount + $fee_pkg->option('setup_fee') );
}
@@ -1065,7 +1070,9 @@ sub do_process_payment {
#no error, so order the fee package if applicable...
my $conf = new FS::Conf;
my $fee_pkgpart = $conf->config('selfservice_process-pkgpart');
- if ( $fee_pkgpart ) {
+ my $fee_skip_first = $conf->exists('selfservice_process-skip_first');
+
+ if ( $fee_pkgpart and ! $fee_skip_first || scalar($cust_main->cust_pay) ) {
my $cust_pkg = new FS::cust_pkg { 'pkgpart' => $fee_pkgpart };
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index e221c60..2d73072 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -14,7 +14,7 @@
'amount' => $amount,
'process-pkgpart' => scalar($conf->config('manual_process-pkgpart')),
'process-display' => scalar($conf->config('manual_process-display')),
- 'process-skip-first' => $conf->exists('manual_process-skip_first'),
+ 'process-skip_first' => $conf->exists('manual_process-skip_first'),
'num_payments' => scalar($cust_main->cust_pay),
'surcharge_percentage' => scalar($conf->config('credit-card-surcharge-percentage')),
&>
-----------------------------------------------------------------------
Summary of changes:
FS/FS/ClientAPI/MasonComponent.pm | 2 +-
FS/FS/ClientAPI/MyAccount.pm | 11 +++++++++--
httemplate/misc/payment.cgi | 2 +-
3 files changed, 11 insertions(+), 4 deletions(-)
More information about the freeside-commits
mailing list