X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=5a3b742230f7ee65a2a1191ef0a97f66d04bef18;hb=ee56f1b20ab915671ded297f593c0e2e245bad70;hp=e96c604a189e9d4d1658dfdc068a647ebff8c665;hpb=047a0b577ec117c9061d40728803c70ff8191962;p=kivitendo-erp.git
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index e96c604a1..5a3b74223 100644
--- a/bin/mozilla/am.pl
+++ b/bin/mozilla/am.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.
#======================================================================
#
# administration
@@ -42,12 +43,13 @@ use SL::User;
use SL::USTVA;
use SL::Iconv;
use SL::TODO;
-use SL::Printer;
-use CGI::Ajax;
+use SL::DB::Printer;
+use SL::DB::Tax;
+use SL::DB::Language;
+use SL::DB::Default;
+use SL::DBUtils qw(selectall_array_query conv_dateq);
use CGI;
-use Data::Dumper;
-
require "bin/mozilla/common.pl";
use strict;
@@ -88,10 +90,17 @@ sub edit_account {
my $form = $main::form;
my %myconfig = %main::myconfig;
+ my $defaults = SL::DB::Default->get;
$main::auth->assert('config');
$form->{title} = "Edit";
+ $form->{feature_balance} = $defaults->feature_balance;
+ $form->{feature_datev} = $defaults->feature_datev;
+ $form->{feature_erfolgsrechnung} = $defaults->feature_erfolgsrechnung;
+ $form->{feature_eurechnung} = $defaults->feature_eurechnung;
+ $form->{feature_ustva} = $defaults->feature_ustva;
+
AM->get_account(\%myconfig, \%$form);
foreach my $item (split(/:/, $form->{link})) {
@@ -147,7 +156,7 @@ sub account_header {
rate => '',
taxkey_id => '',
pos_ustva => '',
- startdate => '',
+ startdate => $form->{account_exists} ? '' : DateTime->new(year => 1970, month => 1, day => 1)->to_lxoffice,
};
push @{ $form->{ACCOUNT_TAXKEYS} }, $newtaxkey_ref;
@@ -257,6 +266,20 @@ sub account_header {
}
+ my $select_er = q|\n|;
+ my %er = (
+ 1 => "Ertrag",
+ 6 => "Aufwand");
+ foreach my $item (sort({ $a <=> $b } keys(%er))) {
+ my $text = H($::locale->{iconv_utf8}->convert($er{$item}));
+ if ($item == $form->{pos_er}) {
+ $select_er .= qq|\n|;
+ } else {
+ $select_er .= qq|\n|;
+ }
+
+ }
+
my $select_bwa = q|\n|;
my %bwapos = (
@@ -331,34 +354,35 @@ sub account_header {
}
# preselection chart type
- my $select_charttype = q{};
-
- my %charttype = (
- 'A' => $locale->text('Account'),
- 'H' => $locale->text('Heading'),
- );
+ my @all_charttypes = ({'name' => $locale->text('Account'), 'value' => 'A'},
+ {'name' => $locale->text('Heading'), 'value' => 'H'},
+ );
+ my $selected_charttype = $form->{charttype};
- foreach my $item ( sort({ $a <=> $b } keys %charttype) ) {
- if ($item eq $form->{charttype}) {
- $select_charttype .= qq|