X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fam.pl;h=27ccd06bdac572e5dbf0678c30c8be5e86b46361;hb=94fe7579546e991aa67703b1da36b9c2765203f6;hp=9e2aff932ee9f5b45c789519c7a8ac72a25c342b;hpb=d05861aff6d05095c5e1711c0a7db6887f489f2e;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 9e2aff932..27ccd06bd 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 @@ -94,14 +96,13 @@ sub account_header { $form->{description} =~ s/\"/"/g; if (@{ $form->{TAXKEY} }) { - $form->{selecttaxkey} = "|; + foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) { + $numberformat .= + ($item eq $form->{output_numberformat}) + ? ""; + } + + my $dateformat = + qq||; + foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) { + $dateformat .= + ($item eq $form->{output_dateformat}) + ? ""; + } + print qq| @@ -1661,15 +1668,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|
@@ -1712,8 +1737,10 @@ 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); - if ($eur) { - $form->{"inventory_accno_id"} = $form->{"std_inventory_accno_id"}; + $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; @@ -1748,14 +1775,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|| . $locale->text(| + . qq||; + $column_header{down} = + qq|| + . qq|| . $locale->text(| + . 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} = @@ -1812,6 +1851,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++; @@ -1821,6 +1865,27 @@ sub list_buchungsgruppe { |; + if ($row) { + my $pref = $form->{ALL}->[$row - 1]; + $column_data{up} = + qq|| . + qq|| . + qq|| . $locale->text(| . + 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|| . $locale->text(| . + 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}|; @@ -1843,6 +1908,8 @@ sub list_buchungsgruppe { print qq| |; + + $row++; } print qq| @@ -1866,14 +1933,7 @@ sub list_buchungsgruppe { {password}> |; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| + . $locale->text('Add') . qq|"> @@ -2044,6 +2104,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(); @@ -2168,14 +2237,7 @@ sub list_printer { {password}> |; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| + . $locale->text('Add') . qq|"> @@ -2264,6 +2326,13 @@ 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; + my @languages = AM->language(\%myconfig, $form, 1); + map({ $_->{"language"} = $_->{"description"}; + $_->{"language_id"} = $_->{"id"}; } @languages); + $form->{"TRANSLATION"} = \@languages; &payment_header; &form_footer; @@ -2275,7 +2344,9 @@ sub edit_payment { $form->{title} = "Edit"; - AM->get_payment(\%myconfig, \%$form); + AM->get_payment(\%myconfig, $form); + $form->{percent_skonto} = + $form->format_amount(\%myconfig, $form->{percent_skonto} * 100); &payment_header; @@ -2290,15 +2361,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|| . $locale->text(| + . qq||; + $column_header{down} = + qq|| + . qq|| . $locale->text(| + . qq||; $column_header{description} = qq|| . $locale->text('Description') @@ -2342,6 +2421,9 @@ sub list_payment { |; + my $swap_link = build_std_url("action=swap_payment_terms"); + + my $row = 0; foreach $ref (@{ $form->{ALL} }) { $i++; @@ -2351,21 +2433,48 @@ sub list_payment { |; + if ($row) { + my $pref = $form->{ALL}->[$row - 1]; + $column_data{up} = + qq|| . + qq|| . + qq|| . $locale->text(| . + 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|| . $locale->text(| . + 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| @@ -2382,21 +2491,14 @@ sub list_payment { - + {path}> {login}> {password}> |; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| + . $locale->text('Add') . qq|"> @@ -2438,14 +2540,26 @@ sub payment_header { | . $locale->text('Description') . qq| - - | . $locale->text('Ranking') . qq| - - | . $locale->text('Long Description') . qq| +|; + + foreach my $language (@{ $form->{"TRANSLATION"} }) { + print qq| + + | . + sprintf($locale->text('Translation (%s)'), + $language->{"language"}) + . qq| + + +|; + } + + print qq| | . $locale->text('Netto Terms') . qq| @@ -2461,7 +2575,38 @@ sub payment_header {
-|; + +

| . $locale->text("You can use the following strings in the long " . + "description and all translations. They will be " . + "replaced by their actual values by Lx-Office " . + "before they're output.") +. qq|

+ +|; $lxdebug->leave_sub(); } @@ -2469,7 +2614,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!')); @@ -2485,6 +2632,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(); @@ -2608,14 +2764,8 @@ sub list_sic { {password}> |; + . $locale->text('Add') . qq|"> - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| @@ -2738,14 +2888,8 @@ $form->{body} {password}> |; + . $locale->text('Edit') . qq|"> - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| @@ -2787,14 +2931,8 @@ $form->{body}
|; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } + . $locale->text('Save') . qq|"> - print q| @@ -2842,6 +2980,58 @@ sub config { $myconfig{$item} =~ s/\\n/\r\n/g; } + @formats = (); + if ($opendocument_templates && $openofficeorg_writer_bin && + $xvfb_bin && (-x $openofficeorg_writer_bin) && (-x $xvfb_bin)) { + push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"), + "value" => "opendocument_pdf" }); + } + if ($latex_templates) { + push(@formats, { "name" => $locale->text("PDF"), "value" => "pdf" }); + } + push(@formats, { "name" => "HTML", "value" => "html" }); + if ($latex_templates) { + push(@formats, { "name" => $locale->text("Postscript"), + "value" => "postscript" }); + } + if ($opendocument_templates) { + push(@formats, { "name" => $locale->text("OpenDocument/OASIS"), + "value" => "opendocument" }); + } + + if (!$myconfig{"template_format"}) { + $myconfig{"template_format"} = "pdf"; + } + my $template_format = ""; + foreach $item (@formats) { + $template_format .= + ""; + } + + if (!$myconfig{"default_media"}) { + $myconfig{"default_media"} = "screen"; + } + my %selected = ($myconfig{"default_media"} => "selected"); + my $default_media = qq| + + + +|; + + %selected = (); + $selected{$myconfig{"default_printer_id"}} = "selected" + if ($myconfig{"default_printer_id"}); + my $default_printer = qq||; + AM->printer(\%myconfig, $form); + foreach my $printer (@{$form->{"ALL"}}) { + $default_printer .= qq||; + } + %countrycodes = User->country_codes; $countrycodes = ''; foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} } @@ -2854,19 +3044,6 @@ sub config { } $countrycodes = "