[freeside-commits] branch FREESIDE_3_BRANCH updated. b77e2c257c0ac8c6195a0525c599eafd72997192
Mark Wells
mark at 420.am
Thu Aug 14 20:14:59 PDT 2014
The branch, FREESIDE_3_BRANCH has been updated
via b77e2c257c0ac8c6195a0525c599eafd72997192 (commit)
from c38e357810363b8c7ec621d2b85d94849adf1d30 (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 b77e2c257c0ac8c6195a0525c599eafd72997192
Author: Mark Wells <mark at freeside.biz>
Date: Thu Aug 14 20:14:40 2014 -0700
adjust calculation of upload date, #20384
diff --git a/FS/FS/pay_batch/eft_canada.pm b/FS/FS/pay_batch/eft_canada.pm
index 3c1d219..310c400 100644
--- a/FS/FS/pay_batch/eft_canada.pm
+++ b/FS/FS/pay_batch/eft_canada.pm
@@ -116,16 +116,23 @@ sub download_note { # is a class method
my $conf = FS::Conf->new;
my $agentnum = $pay_batch->agentnum;
my $tomorrow = (localtime(time))[2] >= 10;
- my $upload_date = time;
- $upload_date += 86400 if $tomorrow;
my $process_date = process_date($conf, $agentnum);
+ my $upload_date = $process_date - 86400;
my $date_format = $conf->config('date_format') || '%D';
- 'Upload this file before 11:00 AM '.
- ($tomorrow ? 'tomorrow' : 'today') .
- ' (' . time2str($date_format, $upload_date) . '). '.
- 'Payments will be processed on '.
+ my $note = '';
+ if ( $process_date - time < 86400*2 ) {
+ $note = 'Upload this file before 11:00 AM '.
+ ($tomorrow ? 'tomorrow' : 'today') .
+ ' (' . time2str($date_format, $upload_date) . '). ';
+ } else {
+ $note = 'Upload this file before 11:00 AM on '.
+ time2str($date_format, $upload_date) . '. ';
+ }
+ $note .= 'Payments will be processed on '.
time2str($date_format, $process_date) . '.';
+
+ $note;
}
sub process_date {
@@ -139,7 +146,7 @@ sub process_date {
my $process_delay = $config[3] || 1;
- if ( (localtime(time))[2] >= 10 ) {
+ if ( (localtime(time))[2] >= 10 and $process_delay == 1 ) {
# If downloading the batch after 10:00 local time, it likely won't make
# the cutoff for next-day turnaround, and EFT will reject it.
$process_delay++;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/pay_batch/eft_canada.pm | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
More information about the freeside-commits
mailing list