X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sql-ledger%2Fsql-ledger%2Fbin%2Fmozilla%2Fca.pl;fp=sql-ledger%2Fsql-ledger%2Fbin%2Fmozilla%2Fca.pl;h=9ee602e743c9011dfdc81f4ed996b7c62ad6962a;hb=52072fcd26f2faf57923f598c358e7f47c4e2643;hp=0000000000000000000000000000000000000000;hpb=f6c9088e16c4c083174dd1130ae58d213923cdef;p=freeside.git diff --git a/sql-ledger/sql-ledger/bin/mozilla/ca.pl b/sql-ledger/sql-ledger/bin/mozilla/ca.pl new file mode 100644 index 000000000..9ee602e74 --- /dev/null +++ b/sql-ledger/sql-ledger/bin/mozilla/ca.pl @@ -0,0 +1,478 @@ +#===================================================================== +# SQL-Ledger Accounting +# Copyright (C) 2001 +# +# Author: Dieter Simader +# Email: dsimader@sql-ledger.org +# Web: http://www.sql-ledger.org +# +# Contributors: +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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. +#====================================================================== +# +# module for Chart of Accounts, Income Statement and Balance Sheet +# search and edit transactions posted by the GL, AR and AP +# +#====================================================================== + +use SL::CA; + +1; +# end of main + +# this is for our long dates +# $locale->text('January') +# $locale->text('February') +# $locale->text('March') +# $locale->text('April') +# $locale->text('May ') +# $locale->text('June') +# $locale->text('July') +# $locale->text('August') +# $locale->text('September') +# $locale->text('October') +# $locale->text('November') +# $locale->text('December') + +# this is for our short month +# $locale->text('Jan') +# $locale->text('Feb') +# $locale->text('Mar') +# $locale->text('Apr') +# $locale->text('May') +# $locale->text('Jun') +# $locale->text('Jul') +# $locale->text('Aug') +# $locale->text('Sep') +# $locale->text('Oct') +# $locale->text('Nov') +# $locale->text('Dec') + + +sub chart_of_accounts { + + CA->all_accounts(\%myconfig, \%$form); + + @column_index = qw(accno gifi_accno description debit credit); + + $column_header{accno} = qq||.$locale->text('Account').qq|\n|; + $column_header{gifi_accno} = qq||.$locale->text('GIFI').qq|\n|; + $column_header{description} = qq||.$locale->text('Description').qq|\n|; + $column_header{debit} = qq||.$locale->text('Debit').qq|\n|; + $column_header{credit} = qq||.$locale->text('Credit').qq|\n|; + + + $form->{title} = $locale->text('Chart of Accounts'); + + $colspan = $#column_index + 1; + + $form->header; + + print qq| + + + + + + |; + + map { print $column_header{$_} } @column_index; + + print qq| + +|; + + + foreach $ca (@{ $form->{CA} }) { + + $description = $form->escape($ca->{description}); + $gifi_description = $form->escape($ca->{gifi_description}); + + $href = qq|$form->{script}?path=$form->{path}&action=list&accno=$ca->{accno}&login=$form->{login}&sessionid=$form->{sessionid}&description=$description&gifi_accno=$ca->{gifi_accno}&gifi_description=$gifi_description|; + + if ($ca->{charttype} eq "H") { + print qq||; + map { $column_data{$_} = ""; } qw(accno description); + $column_data{gifi_accno} = ""; + } else { + $i++; $i %= 2; + print qq||; + $column_data{accno} = ""; + $column_data{gifi_accno} = ""; + $column_data{description} = ""; + } + + $column_data{debit} = "\n"; + $column_data{credit} = "\n"; + + $totaldebit += $ca->{debit}; + $totalcredit += $ca->{credit}; + + map { print $column_data{$_} } @column_index; + + print qq| + +|; + } + + map { $column_data{$_} = ""; } qw(accno gifi_accno description); + + $column_data{debit} = ""; + $column_data{credit} = ""; + + print ""; + + map { print $column_data{$_} } @column_index; + + print qq| + + + + +
$form->{title}
$ca->{$_}$ca->{gifi_accno} 
$ca->{accno}$ca->{gifi_accno} $ca->{description}".$form->format_amount(\%myconfig, $ca->{debit}, 2, " ")."".$form->format_amount(\%myconfig, $ca->{credit}, 2, " ")."
 ".$form->format_amount(\%myconfig, $totaldebit, 2, 0)."".$form->format_amount(\%myconfig, $totalcredit, 2, 0)."

+ + + +|; + +} + + +sub list { + + $form->{title} = $locale->text('List Transactions'); + if ($form->{accounttype} eq 'gifi') { + $form->{title} .= " - ".$locale->text('GIFI')." $form->{gifi_accno}"; + } else { + $form->{title} .= " - ".$locale->text('Account')." $form->{accno}"; + } + + # get departments + $form->all_departments(\%myconfig); + if (@{ $form->{all_departments} }) { + $form->{selectdepartment} = "