X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fca.pl;h=774da855a9c37c3449e74d35dbe2cfa4719e968e;hb=22f2c3e86aeea63b9e25b6ba249ca9062ae337f8;hp=229e43004c24b4e5671f244c4dd39e0a9e2ce9e1;hpb=9c8799530caff44dca79d0bdfd0ff5964c15194c;p=kivitendo-erp.git
diff --git a/bin/mozilla/ca.pl b/bin/mozilla/ca.pl
index 229e43004..774da855a 100644
--- a/bin/mozilla/ca.pl
+++ b/bin/mozilla/ca.pl
@@ -24,7 +24,8 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
#======================================================================
#
# module for Chart of Accounts, Income Statement and Balance Sheet
@@ -35,10 +36,13 @@
use POSIX qw(strftime);
use SL::CA;
+use SL::DB::Default;
use SL::ReportGenerator;
require "bin/mozilla/reportgenerator.pl";
+use strict;
+
1;
# end of main
@@ -72,10 +76,21 @@ require "bin/mozilla/reportgenerator.pl";
# $locale->text('Dec')
sub chart_of_accounts {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
+ $main::auth->assert('report');
$form->{title} = $locale->text('Chart of Accounts');
+ if ( $::instance_conf->get_accounting_method eq 'cash' ) {
+ # $form->{method} can probably be made redundant now that we have get_accounting_method
+ $form->{method} = "cash";
+ }
+
CA->all_accounts(\%myconfig, \%$form);
my @columns = qw(accno description debit credit);
@@ -94,6 +109,7 @@ sub chart_of_accounts {
'std_column_visibility' => 1,
);
$report->set_options_from_form();
+ $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
$report->set_columns(%column_defs);
$report->set_column_order(@columns);
@@ -105,6 +121,7 @@ sub chart_of_accounts {
my %totals = ('debit' => 0, 'credit' => 0);
foreach my $ca (@{ $form->{CA} }) {
+ next unless defined $ca->{amount};
my $row = { };
foreach (qw(debit credit)) {
@@ -130,94 +147,162 @@ sub chart_of_accounts {
$report->generate_with_headers();
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub list {
- $lxdebug->enter_sub();
+ $::lxdebug->enter_sub;
+ $::auth->assert('report');
- $form->{title} = $locale->text('List Transactions');
- $form->{title} .= " - " . $locale->text('Account') . " $form->{accno}";
+ $::form->{title} = $::locale->text('List Transactions') . " - " . $::locale->text('Account') . " $::form->{accno}" . " - " . $::form->{description};
- # get departments
- $form->all_departments(\%myconfig);
- if (@{ $form->{all_departments} }) {
- $form->{selectdepartment} = "