From 218d2d75f5b47bcfe92b98fb888edb690aa9eeae Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Fri, 2 Jan 2015 07:46:21 +0100 Subject: [PATCH] BUG10693: Fix wrong monthnumber in PDF Bill --- lfs/squid-accounting | 2 +- src/squid-accounting/acct-lib.pl | 1 + src/squid-accounting/acct.pl | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lfs/squid-accounting b/lfs/squid-accounting index 0dca63f751..9ef8324110 100644 --- a/lfs/squid-accounting +++ b/lfs/squid-accounting @@ -15,7 +15,7 @@ THISAPP = squid-accounting-$(VER) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = squid-accounting -PAK_VER = 3 +PAK_VER = 4 DEPS = "perl-DBI perl-DBD-SQLite perl-File-ReadBackwards perl-PDF-API2 sendEmail" diff --git a/src/squid-accounting/acct-lib.pl b/src/squid-accounting/acct-lib.pl index a19140d04c..bac1e3632f 100644 --- a/src/squid-accounting/acct-lib.pl +++ b/src/squid-accounting/acct-lib.pl @@ -387,6 +387,7 @@ sub pdf2 { my @billar = @{$_[0]}; #DATA from sendbill (just host/values) my $month = $_[1]; $month = '0'.$month if $month < 10; + $month = '12' if $month == 0; my $year = $_[2]; my $mwst = $_[3]; my @address_cust= @{$_[4]}; #Array which contains customer and hoster adresses and some additional info from billgroup diff --git a/src/squid-accounting/acct.pl b/src/squid-accounting/acct.pl index d535901b67..79fc7bae43 100755 --- a/src/squid-accounting/acct.pl +++ b/src/squid-accounting/acct.pl @@ -210,7 +210,9 @@ sub sendbill { my @now = localtime(time); $now[5] = $now[5] + 1900; my $actmonth = $now[4]; - my $month = '0'.$actmonth if $actmonth < 10; + 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); -- 2.39.5