X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fam.pl;h=d0415618717701f7910e3d82d7067b12620eeaa7;hb=249c0c6f38350cc67eb2304538aa4ef7f329eb79;hp=b6996d169b1e34edda36daa47affa331d5e93f0c;hpb=74fca575d438232002756175338c23f55b8a6c12;p=kivitendo-erp.git
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index b6996d169..d04156187 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
@@ -33,17 +34,25 @@
use utf8;
+use List::MoreUtils qw(any);
+
use SL::Auth;
use SL::Auth::PasswordPolicy;
use SL::AM;
use SL::CA;
use SL::Form;
+use SL::Helper::Flash;
+use SL::Helper::UserPreferences;
use SL::User;
use SL::USTVA;
use SL::Iconv;
+use SL::Locale::String qw(t8);
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;
require "bin/mozilla/common.pl";
@@ -76,7 +85,6 @@ sub add_account {
$form->{callback} = "am.pl?action=list_account" unless $form->{callback};
&account_header;
- &form_footer;
$main::lxdebug->leave_sub();
}
@@ -86,10 +94,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})) {
@@ -97,7 +112,6 @@ sub edit_account {
}
&account_header;
- &form_footer;
$main::lxdebug->leave_sub();
}
@@ -145,7 +159,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;
@@ -213,38 +227,7 @@ sub account_header {
}
my $select_eur = q|\n|;
- my %eur = (
- 1 => "Umsatzerlöse",
- 2 => "sonstige Erlöse",
- 3 => "Privatanteile",
- 4 => "Zinserträge",
- 5 => "Ausserordentliche Erträge",
- 6 => "Vereinnahmte Umsatzst.",
- 7 => "Umsatzsteuererstattungen",
- 8 => "Wareneingänge",
- 9 => "Löhne und Gehälter",
- 10 => "Gesetzl. sozialer Aufw.",
- 11 => "Mieten",
- 12 => "Gas, Strom, Wasser",
- 13 => "Instandhaltung",
- 14 => "Steuern, Versich., Beiträge",
- 15 => "Kfz-Steuern",
- 16 => "Kfz-Versicherungen",
- 17 => "Sonst. Fahrzeugkosten",
- 18 => "Werbe- und Reisekosten",
- 19 => "Instandhaltung u. Werkzeuge",
- 20 => "Fachzeitschriften, Bücher",
- 21 => "Miete für Einrichtungen",
- 22 => "Rechts- und Beratungskosten",
- 23 => "Bürobedarf, Porto, Telefon",
- 24 => "Sonstige Aufwendungen",
- 25 => "Abschreibungen auf Anlagever.",
- 26 => "Abschreibungen auf GWG",
- 27 => "Vorsteuer",
- 28 => "Umsatzsteuerzahlungen",
- 29 => "Zinsaufwand",
- 30 => "Ausserordentlicher Aufwand",
- 31 => "Betriebliche Steuern");
+ my %eur = %{ AM->get_eur_categories(\%myconfig, $form) };
foreach my $item (sort({ $a <=> $b } keys(%eur))) {
my $text = H($::locale->{iconv_utf8}->convert($eur{$item}));
if ($item == $form->{pos_eur}) {
@@ -255,31 +238,23 @@ 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 = (
- 1 => 'Umsatzerlöse',
- 2 => 'Best.Verdg.FE/UE',
- 3 => 'Aktiv.Eigenleistung',
- 4 => 'Mat./Wareneinkauf',
- 5 => 'So.betr.Erlöse',
- 10 => 'Personalkosten',
- 11 => 'Raumkosten',
- 12 => 'Betriebl.Steuern',
- 13 => 'Vers./Beiträge',
- 14 => 'Kfz.Kosten o.St.',
- 15 => 'Werbe-Reisek.',
- 16 => 'Kosten Warenabgabe',
- 17 => 'Abschreibungen',
- 18 => 'Rep./instandhlt.',
- 19 => 'Ãbrige Steuern',
- 20 => 'Sonst.Kosten',
- 30 => 'Zinsauwand',
- 31 => 'Sonst.neutr.Aufw.',
- 32 => 'Zinserträge',
- 33 => 'Sonst.neutr.Ertrag',
- 34 => 'Verr.kalk.Kosten',
- 35 => 'Steuern Eink.u.Ertr.');
+ my %bwapos = %{ AM->get_bwa_categories(\%myconfig, $form) };
foreach my $item (sort({ $a <=> $b } keys %bwapos)) {
my $text = H($::locale->{iconv_utf8}->convert($bwapos{$item}));
if ($item == $form->{pos_bwa}) {
@@ -329,36 +304,37 @@ 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|