[freeside-commits] freeside/FS/FS pay_batch.pm,1.26,1.26.2.1
Mark Wells
mark at wavetail.420.am
Thu Nov 11 19:22:36 PST 2010
- Previous message: [freeside-commits] freeside/FS/FS/pay_batch td_canada_trust.pm, 1.1, 1.2 paymentech.pm, 1.7, 1.8 chase_canada.pm, 1.1, 1.2
- Next message: [freeside-commits] freeside/FS/FS/pay_batch td_canada_trust.pm, 1.1, 1.1.6.1 paymentech.pm, 1.7, 1.7.2.1 chase_canada.pm, 1.1, 1.1.6.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv19369
Modified Files:
Tag: FREESIDE_2_1_BRANCH
pay_batch.pm
Log Message:
better support for batch-increment_expiration, RT#10453
Index: pay_batch.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/pay_batch.pm,v
retrieving revision 1.26
retrieving revision 1.26.2.1
diff -u -w -d -r1.26 -r1.26.2.1
--- pay_batch.pm 21 Sep 2010 05:54:24 -0000 1.26
+++ pay_batch.pm 12 Nov 2010 03:22:34 -0000 1.26.2.1
@@ -7,6 +7,7 @@
use FS::Record qw( dbh qsearch qsearchs );
use FS::cust_pay;
use FS::Conf;
+use Date::Parse qw(str2time);
use Business::CreditCard qw(cardtype);
@ISA = qw(FS::Record);
@@ -482,6 +483,19 @@
my @cust_pay_batch = sort { $a->paybatchnum <=> $b->paybatchnum }
qsearch('cust_pay_batch', { batchnum => $self->batchnum } );
+ # handle batch-increment_expiration option
+ if ( $self->payby eq 'CARD' ) {
+ my ($cmon, $cyear) = (localtime(time))[4,5];
+ foreach (@cust_pay_batch) {
+ my $etime = str2time($_->exp) or next;
+ my ($day, $mon, $year) = (localtime($etime))[3,4,5];
+ if( $conf->exists('batch-increment_expiration') ) {
+ $year++ while( $year < $cyear or ($year == $cyear and $mon <= $cmon) );
+ $_->exp( sprintf('%4u-%02u-%02u', $year + 1900, $mon+1, $day) );
+ }
+ $_->setfield('expmmyy', sprintf('%02u%02u', $mon+1, $year % 100));
+ }
+ }
my $h = $info->{'header'};
if(ref($h) eq 'CODE') {
$batch .= &$h($self, \@cust_pay_batch) . "\n";
- Previous message: [freeside-commits] freeside/FS/FS/pay_batch td_canada_trust.pm, 1.1, 1.2 paymentech.pm, 1.7, 1.8 chase_canada.pm, 1.1, 1.2
- Next message: [freeside-commits] freeside/FS/FS/pay_batch td_canada_trust.pm, 1.1, 1.1.6.1 paymentech.pm, 1.7, 1.7.2.1 chase_canada.pm, 1.1, 1.1.6.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list