X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=c114c7eae02d8d1f7571d83efc0543665770db6a;hb=e380ecfd97aa1282832adacc34c0d5074c4e0791;hp=8f01265adac6389d57abb5034e030e6606d193a9;hpb=cf0f9e1d0e7ac2f71137b20094f234f1bfafe40c;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 8f01265ad..c114c7eae 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -336,7 +336,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; } @@ -466,7 +466,7 @@ sub list_account { $ca->{link_edit_account} = $link_edit_account . '&id=' . E($ca->{id}); } - $form->use_stylesheet("list_accounts.css"); + $::request->{layout}->use_stylesheet("list_accounts.css"); $form->{title} = $locale->text('Chart of Accounts'); $form->header; @@ -742,7 +742,7 @@ sub language_header { print $::form->parse_html_template('am/language_header', { numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00' ], - dateformats => [ qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ], + dateformats => [ qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ], }); $::lxdebug->leave_sub; @@ -847,150 +847,39 @@ sub list_buchungsgruppe { } sub buchungsgruppe_header { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text("$form->{title} Buchungsgruppe"); + $::lxdebug->enter_sub; + $::auth->assert('config'); # $locale->text('Add Accounting Group') # $locale->text('Edit Accounting Group') + $::form->{title} = $::locale->text("$::form->{title} Buchungsgruppe"); my ($acc_inventory, $acc_income, $acc_expense) = ({}, {}, {}); my %acc_type_map = ( - "IC" => $acc_inventory, - "IC_income" => $acc_income, - "IC_sale" => $acc_income, - "IC_expense" => $acc_expense, - "IC_cogs" => $acc_expense, - ); + IC => $acc_inventory, + IC_income => $acc_income, + IC_sale => $acc_income, + IC_expense => $acc_expense, + IC_cogs => $acc_expense, + ); - foreach my $key (keys(%acc_type_map)) { - foreach my $ref (@{ $form->{IC_links}{$key} }) { - $acc_type_map{$key}->{$ref->{"id"}} = $ref; + for my $key (keys %acc_type_map) { + for my $ref (@{ $::form->{IC_links}{$key} }) { + $acc_type_map{$key}{$ref->{id}} = $ref; } } - foreach my $type (qw(IC IC_income IC_expense)) { - $form->{"select$type"} = - join("", - map({ "" } - sort({ $a->{"accno"} cmp $b->{"accno"} } - values(%{$acc_type_map{$type}})))); - } - - if ($form->{id}) { - $form->{selectIC} =~ s/selected//g; - $form->{selectIC} =~ s/ value=\Q$form->{inventory_accno_id}\E/ value=$form->{inventory_accno_id} selected/; - $form->{selectIC_income} =~ s/selected//g; - $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_0}\E/ value=$form->{income_accno_id_0} selected/; - $form->{selectIC_expense} =~ s/selected//g; - $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_0}\E/ value=$form->{expense_accno_id_0} selected/; - } - - my $linkaccounts; - if ( $::instance_conf->get_inventory_system eq 'perpetual' ) { # was !$::lx_office_conf{system}->{eur}) { } - $linkaccounts = qq| - - | . $locale->text('Inventory') . qq| - - - |; - } elsif ( $::instance_conf->get_inventory_system eq 'periodic' ) { - # don't allow choice of inventory accno and don't show that line - $linkaccounts = qq| - {inventory_accno_id}>|; - }; - - - $linkaccounts .= qq| - - | . $locale->text('National Revenues') . qq| - - - - | . $locale->text('National Expenses') . qq| - - |; - if ($form->{id}) { - $form->{selectIC_income} =~ s/selected//g; - $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_1}\E/ value=$form->{income_accno_id_1} selected/; - $form->{selectIC_expense} =~ s/selected//g; - $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_1}\E/ value=$form->{expense_accno_id_1} selected/; - } - $linkaccounts .= qq| - | . $locale->text('Revenues EU with UStId') . qq| - - - - | . $locale->text('Expenses EU with UStId') . qq| - - |; - - if ($form->{id}) { - $form->{selectIC_income} =~ s/selected//g; - $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_2}\E/ value=$form->{income_accno_id_2} selected/; - $form->{selectIC_expense} =~ s/selected//g; - $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_2}\E/ value=$form->{expense_accno_id_2} selected/; - } - - $linkaccounts .= qq| - | . $locale->text('Revenues EU without UStId') . qq| - - - - | . $locale->text('Expenses EU without UStId') . qq| - - |; - - if ($form->{id}) { - $form->{selectIC_income} =~ s/selected//g; - $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_3}\E/ value=$form->{income_accno_id_3} selected/; - $form->{selectIC_expense} =~ s/selected//g; - $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_3}\E/ value=$form->{expense_accno_id_3} selected/; - } - - $linkaccounts .= qq| - | . $locale->text('Foreign Revenues') . qq| - - - - | . $locale->text('Foreign Expenses') . qq| - - -|; - - - $form->header; + my %sorted_accounts = map { + $_ => [ sort { $a->{accno} cmp $b->{accno} } values %{ $acc_type_map{$_} } ], + } keys %acc_type_map; - print qq| - - -
- -{id}> - - - - - - - - - - - - $linkaccounts - - -
$form->{title}
| . $locale->text('Buchungsgruppe') . qq|

-|; + $::form->header; + print $::form->parse_html_template('am/buchungsgruppe_header', { + accounts => \%sorted_accounts, + account_label => sub { "$_[0]{accno}--$_[0]{description}" }, + }); - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub save_buchungsgruppe { @@ -1055,7 +944,7 @@ sub edit_defaults { # default language my $all_languages = SL::DB::Manager::Language->get_all; -# EÜR = cash, Bilanzierung = accrual +# cash = IST-Versteuerung, accrual = SOLL-Versteuerung foreach my $key (keys %{ $form->{IC} }) { foreach my $accno (sort keys %{ $form->{IC}->{$key} }) { @@ -1117,7 +1006,7 @@ sub config { my %myconfig = %main::myconfig; my $locale = $main::locale; - _build_cfg_options('dateformat', qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)); + _build_cfg_options('dateformat', qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd)); _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00')); my @formats = (); @@ -1177,7 +1066,7 @@ sub config { } $form->{STYLESHEETS} = []; - foreach my $item (qw(lx-office-erp.css Win2000.css Mobile.css)) { + foreach my $item (qw(lx-office-erp.css Win2000.css Mobile.css kivitendo.css)) { push @{ $form->{STYLESHEETS} }, { 'name' => $item, 'value' => $item, @@ -1235,55 +1124,17 @@ sub save_preferences { } sub audit_control { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text('Audit Control'); - - AM->closedto(\%myconfig, \%$form); - - $form->header; - - print qq| - - - - - - - - - - -
$form->{title}
- - - - - -
| . $locale->text('Close Books up to') . qq|{closedto}>
-
- -
- -
- + $::lxdebug->enter_sub; + $::auth->assert('config'); - + $::form->{title} = $::locale->text('Audit Control'); -
+ AM->closedto(\%::myconfig, $::form); - - -|; + $::form->header; + print $::form->parse_html_template('am/audit_control'); - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub doclose { @@ -1739,7 +1590,7 @@ sub add_price_factor { $form->{title} = $locale->text('Add Price Factor'); $form->{callback} ||= build_std_url('action=add_price_factor'); - $form->{fokus} = 'description'; + $::request->{layout}->focus('#description'); $form->header(); print $form->parse_html_template('am/edit_price_factor'); @@ -1758,7 +1609,7 @@ sub edit_price_factor { $form->{title} = $locale->text('Edit Price Factor'); $form->{callback} ||= build_std_url('action=add_price_factor'); - $form->{fokus} = 'description'; + $::request->{layout}->focus('#description'); AM->get_price_factor(\%myconfig, $form); @@ -1846,7 +1697,7 @@ sub add_warehouse { $form->{title} = $locale->text('Add Warehouse'); $form->{callback} ||= build_std_url('action=add_warehouse'); - $form->{fokus} = 'description'; + $::request->{layout}->focus('#description'); $form->header(); print $form->parse_html_template('am/edit_warehouse'); @@ -1869,7 +1720,7 @@ sub edit_warehouse { $form->{title} = $locale->text('Edit Warehouse'); $form->{callback} ||= build_std_url('action=list_warehouses'); - $form->{fokus} = 'description'; + $::request->{layout}->focus('#description'); $form->header(); print $form->parse_html_template('am/edit_warehouse');