X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/652397fced242d39ff1b5700c7fce1cbbaa37d5a..828bd68326ee5bd732d3d01e9f166dacb7424657:/bin/mozilla/am.pl
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index c336f3a70..1571e24c0 100644
--- a/bin/mozilla/am.pl
+++ b/bin/mozilla/am.pl
@@ -2348,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;
@@ -2362,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')
@@ -2414,6 +2424,9 @@ sub list_payment {
|;
+ my $swap_link = build_std_url("action=swap_payment_terms");
+
+ my $row = 0;
foreach $ref (@{ $form->{ALL} }) {
$i++;
@@ -2423,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|
@@ -2530,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!'));
@@ -2546,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();