]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/squid-accounting/acct.pl
strongswan: Update to 5.3.1
[ipfire-2.x.git] / src / squid-accounting / acct.pl
index 59898b75fe79d8410e137bdd54f1eaab490170b2..722268945826c0cd8d2228eb2d100f5011999131 100755 (executable)
@@ -100,7 +100,7 @@ if (-f $proxyenabled && $proxylog eq $Lang::tr{'running'}){
                open (FH,">/var/log/accounting.log");
                close (FH);
                chmod 0755, "/var/log/accounting.log";
-               #move all db entries older than 2 months to second table and cumulate them hourly
+               #move all db entries older than this month to second table and cumulate them daily
                &ACCT::movedbdata;
                &ACCT::logger($settings{'LOG'},"New Month. Old trafficvalues moved to ACCT_HIST Table\n");
                if ($settings{'USEMAIL'} eq 'on'){
@@ -209,8 +209,10 @@ sub sendbill {
        my $cur = $_[2];
        my @now = localtime(time);
        $now[5] = $now[5] + 1900;
-       my $actmonth = $now[4]+1;
-       my $month                       = '0'.$actmonth if $actmonth < 10;
+       my $actmonth = $now[4];
+       my $month;
+       $month = '0'.$actmonth if $actmonth < 10;
+       $month = '12' if $actmonth == 0;
        my $actyear  = $now[5];
        my ($from,$till)=&ACCT::getmonth($actmonth,$actyear);                                   #FIXME month and year as variables!
        my @billar = &ACCT::GetTaValues($from,$till,$rggrp);