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'){
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);