[freeside-commits] freeside/FS/FS/part_pkg torrus_Common.pm, 1.4, 1.5
Ivan,,,
ivan at wavetail.420.am
Sun Jan 23 16:38:02 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv13253
Modified Files:
torrus_Common.pm
Log Message:
torrus, RT#10574
Index: torrus_Common.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/torrus_Common.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- torrus_Common.pm 24 Jan 2011 00:26:11 -0000 1.4
+++ torrus_Common.pm 24 Jan 2011 00:38:00 -0000 1.5
@@ -30,9 +30,12 @@
my $self = shift;
my($cust_pkg, $sdate, $details, $param ) = @_;
-
my @sdate = localtime($$sdate);
- my $rep_date = ($sdate[5]+1900). '-'. ($sdate[4]+1). '-01';
+ #sdate is next bill date, but we want the report from last month
+ my($m, $y) = ($sdate[4], $sdate[5]);
+ if ( $m == 0 ) { $m=12; $y--; }
+ $m = "0$m" if length($m) == 1;
+ my $rep_date = "$y-$m-01";
warn "searching for MonthlyUsage report for $rep_date\n" if $DEBUG;
my $rep_sql = "
SELECT id FROM reports WHERE rep_date = ?
More information about the freeside-commits
mailing list