X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fam.pl;h=1571e24c0786007956a283efa275f14be2fcf1e7;hb=3ac9bdcaf2633da20fc12464eddc946417689b48;hp=306cf65259c66c8cff754cc3d9580a4f78db0595;hpb=9ecdc996e7a73cede3cb8fd0e5617154f0c95367;p=kivitendo-erp.git
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index 306cf6525..1571e24c0 100644
--- a/bin/mozilla/am.pl
+++ b/bin/mozilla/am.pl
@@ -40,6 +40,8 @@ use Data::Dumper;
1;
+require "$form->{path}/common.pl";
+
# end of main
sub add { &{"add_$form->{type}"} }
@@ -92,14 +94,13 @@ sub account_header {
$form->{description} =~ s/\"/"/g;
if (@{ $form->{TAXKEY} }) {
- $form->{selecttaxkey} = "
@@ -1659,15 +1675,33 @@ sub language_header {
| . $locale->text('Language') . qq| |
- |
+ |
| . $locale->text('Template Code') . qq| |
- {template_code}> |
+ |
| . $locale->text('Article Code') . qq| |
- {article_code}> |
+ |
+
+
+ | . $locale->text('Number Format') . qq| |
+ |
+
+
+ | . $locale->text('Date Format') . qq| |
+ |
+
+
+ | . $locale->text('Long Dates') . qq| |
+ {output_longdates} ? " checked" : "") .
+ qq|>| . $locale->text("Yes") .
+ qq|{output_longdates} ? "" : " checked") .
+ qq|>| . $locale->text("No") .
+ qq| |
|
@@ -1710,6 +1744,11 @@ sub add_buchungsgruppe {
"$form->{script}?action=add_buchungsgruppe&path=$form->{path}&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
AM->get_buchungsgruppe(\%myconfig, \%$form);
+ $form->{"inventory_accno_id"} = $form->{"std_inventory_accno_id"};
+ for (my $i = 0; 4 > $i; $i++) {
+ map({ $form->{"${_}_accno_id_$i"} = $form->{"std_${_}_accno_id"}; }
+ qw(income expense));
+ }
&buchungsgruppe_header;
&form_footer;
@@ -1743,14 +1782,26 @@ sub list_buchungsgruppe {
$form->{title} = $locale->text('Buchungsgruppen');
- @column_index = qw(description inventory_accno income_accno_0 expense_accno_0 income_accno_1 expense_accno_1 income_accno_2 expense_accno_2 income_accno_3 expense_accno_3 );
+ @column_index = qw(up down description inventory_accno
+ income_accno_0 expense_accno_0
+ income_accno_1 expense_accno_1
+ income_accno_2 expense_accno_2
+ income_accno_3 expense_accno_3 );
+ $column_header{up} =
+ qq||
+ . qq| |
+ . qq| | |;
+ $column_header{down} =
+ qq||
+ . qq| |
+ . qq| | |;
$column_header{description} =
- qq||
+ qq| | |
. $locale->text('Description')
. qq| | |;
$column_header{inventory_accno} =
- qq||
+ qq| | |
. $locale->text('Bestandskonto')
. qq| | |;
$column_header{income_accno_0} =
@@ -1807,6 +1858,11 @@ sub list_buchungsgruppe {
|;
+ my $swap_link = qq|$form->{script}?action=swap_buchungsgruppen&|;
+ map({ $swap_link .= $_ . "=" . $form->escape($form->{$_}) . "&" }
+ qw(login password path));
+
+ my $row = 0;
foreach $ref (@{ $form->{ALL} }) {
$i++;
@@ -1816,6 +1872,27 @@ sub list_buchungsgruppe {
|;
+ if ($row) {
+ my $pref = $form->{ALL}->[$row - 1];
+ $column_data{up} =
+ qq|| .
+ qq|| .
+ qq| | .
+ qq| | |;
+ } else {
+ $column_data{up} = qq| | |;
+ }
+
+ if ($row == (scalar(@{ $form->{ALL} }) - 1)) {
+ $column_data{down} = qq| | |;
+ } else {
+ my $nref = $form->{ALL}->[$row + 1];
+ $column_data{down} =
+ qq|| .
+ qq|| .
+ qq| | .
+ qq| | |;
+ }
$column_data{description} =
qq|{script}?action=edit_buchungsgruppe&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description} | |;
@@ -1838,6 +1915,8 @@ sub list_buchungsgruppe {
print qq|
|;
+
+ $row++;
}
print qq|
@@ -1861,14 +1940,7 @@ sub list_buchungsgruppe {
{password}>
|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
+ . $locale->text('Add') . qq|">
@@ -1887,46 +1959,29 @@ sub buchungsgruppe_header {
# $locale->text('Buchungsgruppe hinzufügen')
# $locale->text('Buchungsgruppe bearbeiten')
- $form->{description} =~ s/\"/"/g;
+ 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,
+ );
- # build the popup menus
- $form->{taxaccounts} = "";
- foreach $key (keys %{ $form->{IC_links} }) {
+ foreach $key (keys(%acc_type_map)) {
foreach $ref (@{ $form->{IC_links}{$key} }) {
-
- # if this is a tax field
- if ($key =~ /IC_tax/) {
- if ($key =~ /$item/) {
- $form->{taxaccounts} .= "$ref->{accno} ";
- $form->{"IC_tax_$ref->{accno}_description"} =
- "$ref->{accno}--$ref->{description}";
-
- if ($form->{id}) {
- if ($form->{amount}{ $ref->{accno} }) {
- $form->{"IC_tax_$ref->{accno}"} = "checked";
- }
- } else {
- $form->{"IC_tax_$ref->{accno}"} = "checked";
- }
- }
- } else {
-
- $form->{"select$key"} .=
- "" }
+ sort({ $a->{"accno"} cmp $b->{"accno"} }
+ values(%{$acc_type_map{$type}}))));
+ }
if ($form->{id}) {
$form->{selectIC} =~ s/selected//g;
@@ -1947,10 +2002,10 @@ sub buchungsgruppe_header {
} else {
$linkaccounts = qq|
{inventory_accno_id}>|;
- }
+ }
- $linkaccounts .= qq|
+ $linkaccounts .= qq|
| . $locale->text('Erlöse Inland') . qq| |
|
@@ -2025,7 +2080,7 @@ sub buchungsgruppe_header {
| . $locale->text('Buchungsgruppe') . qq| |
- |
+ |
$linkaccounts
|
@@ -2056,6 +2111,15 @@ sub delete_buchungsgruppe {
$lxdebug->leave_sub();
}
+sub swap_buchungsgruppen {
+ $lxdebug->enter_sub();
+
+ AM->swap_sortkeys(\%myconfig, $form, "buchungsgruppen");
+ list_buchungsgruppe();
+
+ $lxdebug->leave_sub();
+}
+
sub add_printer {
$lxdebug->enter_sub();
@@ -2180,14 +2244,7 @@ sub list_printer {
{password}>
|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
+ . $locale->text('Add') . qq|">
@@ -2276,6 +2333,9 @@ sub add_payment {
"$form->{script}?action=add_payment&path=$form->{path}&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
+ $form->{terms_netto} = 0;
+ $form->{terms_skonto} = 0;
+ $form->{percent_skonto} = 0;
&payment_header;
&form_footer;
@@ -2288,6 +2348,8 @@ sub edit_payment {
$form->{title} = "Edit";
AM->get_payment(\%myconfig, \%$form);
+ $form->{percent_skonto} =
+ $form->format_amount(\%myconfig, $form->{percent_skonto} * 100);
&payment_header;
@@ -2302,15 +2364,23 @@ sub list_payment {
AM->payment(\%myconfig, \%$form);
- $form->{callback} =
- "$form->{script}?action=list_payment&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+ $form->{callback} = build_std_url("action=list_payment");
$callback = $form->escape($form->{callback});
$form->{title} = $locale->text('Payment Terms');
- @column_index = qw(description description_long terms_netto terms_skonto percent_skonto);
+ @column_index = qw(up down description description_long terms_netto
+ terms_skonto percent_skonto);
+ $column_header{up} =
+ qq||
+ . qq| |
+ . qq| | |;
+ $column_header{down} =
+ qq||
+ . qq| |
+ . qq| | |;
$column_header{description} =
qq||
. $locale->text('Description')
@@ -2354,6 +2424,9 @@ sub list_payment {
|
|;
+ my $swap_link = build_std_url("action=swap_payment_terms");
+
+ my $row = 0;
foreach $ref (@{ $form->{ALL} }) {
$i++;
@@ -2363,21 +2436,48 @@ sub list_payment {
|;
+ if ($row) {
+ my $pref = $form->{ALL}->[$row - 1];
+ $column_data{up} =
+ qq|| .
+ qq|| .
+ qq| | .
+ qq| | |;
+ } else {
+ $column_data{up} = qq| | |;
+ }
+
+ if ($row == (scalar(@{ $form->{ALL} }) - 1)) {
+ $column_data{down} = qq| | |;
+ } else {
+ my $nref = $form->{ALL}->[$row + 1];
+ $column_data{down} =
+ qq|| .
+ qq|| .
+ qq| | .
+ qq| | |;
+ }
$column_data{description} =
- qq|{script}?action=edit_payment&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description} | |;
- $column_data{description_long} = qq|$ref->{description_long} | |;
+ qq|{id}", "callback=$callback") .
+ qq|">| . H($ref->{description}) . qq| | |;
+ $column_data{description_long} =
+ qq|| . H($ref->{description_long}) . qq| | |;
$column_data{terms_netto} =
qq|$ref->{terms_netto} | |;
$column_data{terms_skonto} =
qq|$ref->{terms_skonto} | |;
$column_data{percent_skonto} =
- qq|$ref->{percent_skonto} % | |;
+ qq|| .
+ $form->format_amount(\%myconfig, $ref->{percent_skonto} * 100) .
+ qq|% | |;
map { print "$column_data{$_}\n" } @column_index;
print qq|
|;
+ $row++;
}
print qq|
@@ -2394,21 +2494,14 @@ sub list_payment {
-
+
{path}>
{login}>
{password}>
|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
+ . $locale->text('Add') . qq|">
@@ -2450,10 +2543,6 @@ sub payment_header {
| . $locale->text('Description') . qq| |
|
-
- | . $locale->text('Ranking') . qq| |
- |
-
| . $locale->text('Long Description') . qq| |
|
@@ -2481,7 +2570,9 @@ sub payment_header {
sub save_payment {
$lxdebug->enter_sub();
- $form->isblank("description", $locale->text('Language missing!'));
+ $form->isblank("description", $locale->text('Description missing!'));
+ $form->{"percent_skonto"} =
+ $form->parse_amount(\%myconfig, $form->{percent_skonto}) / 100;
AM->save_payment(\%myconfig, \%$form);
$form->redirect($locale->text('Payment Terms saved!'));
@@ -2497,6 +2588,15 @@ sub delete_payment {
$lxdebug->leave_sub();
}
+sub swap_payment_terms {
+ $lxdebug->enter_sub();
+
+ AM->swap_sortkeys(\%myconfig, $form, "payment_terms");
+ list_payment();
+
+ $lxdebug->leave_sub();
+}
+
sub add_sic {
$lxdebug->enter_sub();
@@ -2620,14 +2720,8 @@ sub list_sic {
{password}>
|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
+ . $locale->text('Add') . qq|">
- print qq|
@@ -2981,10 +3126,43 @@ sub config {
| . $locale->text('Setup Menu') . qq| |
- New
- Old |
-
+ | .
+ $locale->text("Top (CSS)") . qq|
+ | .
+ $locale->text("Top (Javascript)") . qq|
+ | .
+ $locale->text("Old (on the side)") . qq| |
+
+
+ | . $locale->text('Form details (second row)') . qq| |
+
+
+
+ |
+
+
+ | . $locale->text("Print options") . qq| |
+
+
+ | . $locale->text('Default template format') . qq| |
+ |
+
+
+ | . $locale->text('Default output medium') . qq| |
+ |
+
+
+ | . $locale->text('Default printer') . qq| |
+ |
+
+
+ | . $locale->text('Number of copies') . qq| |
+ |
+
+
+
|
@@ -2993,16 +3171,8 @@ sub config {
|
-
-
- |
|
@@ -3088,40 +3258,40 @@ sub config {
|
-
-
- | . $locale->text('Tax Accounts') . qq| |
-
-
-
-
- |
-
-
+ |;
+#
+# | . $locale->text('Tax Accounts') . qq| |
+#
+#
+#
+#
+# |
+#
+print qq|
@@ -3135,14 +3305,8 @@ sub config {
|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
+ . $locale->text('Save') . qq|">
- print qq|