X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fam.pl;h=5a3b742230f7ee65a2a1191ef0a97f66d04bef18;hb=ee56f1b20ab915671ded297f593c0e2e245bad70;hp=2dacb6f98245760af9c5100b25384bf59ca5f525;hpb=73be6af449d872825d1fbdffe536b9061ca649c8;p=kivitendo-erp.git
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index 2dacb6f98..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,7 +43,11 @@ use SL::User;
use SL::USTVA;
use SL::Iconv;
use SL::TODO;
-use SL::Printer;
+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;
require "bin/mozilla/common.pl";
@@ -85,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})) {
@@ -144,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;
@@ -254,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 = (
@@ -336,7 +362,7 @@ sub account_header {
# account where AR_tax or AP_tax is set are not orphaned if they are used as
# tax-o-matic account
- if ( $form->{id} && !$form->{orphaned} && ($form->{link} =~ m/(AP_tax|AR_tax)/) ) {
+ if ( $form->{id} && $form->{orphaned} && ($form->{link} =~ m/(AP_tax|AR_tax)/) ) {
if (SL::DB::Manager::Tax->find_by(chart_id => $form->{id})) {
$form->{orphaned} = 0;
}
@@ -356,6 +382,7 @@ sub account_header {
select_bwa => $select_bwa,
select_bilanz => $select_bilanz,
select_eur => $select_eur,
+ select_er => $select_er,
};
# Ausgabe des Templates
@@ -366,44 +393,18 @@ sub account_header {
}
sub form_footer {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- print qq|
-
-
-
-
|;
- if ((!$form->{id}) || ($form->{id} && $form->{orphaned}) || (($form->{type} eq "account") && (!$form->{new_chart_valid}))) {
- print qq|
-
-|;
-}
-
- if ($form->{id} && $form->{orphaned}) {
- print qq||;
- }
-
- if ($form->{id} && $form->{type} eq "account") {
- print qq|
- |;
- }
-
- print qq|
-
-
-