# connect to database
my $dbh = $form->dbconnect_noauto($myconfig);
- foreach my $table (qw(translation_payment_terms units_language)) {
+ foreach my $table (qw(generic_translations units_language)) {
$query = qq|DELETE FROM $table WHERE language_id = ?|;
do_query($form, $dbh, $query, $form->{"id"});
}
$main::lxdebug->leave_sub();
}
-sub payment {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
-
- # connect to database
- my $dbh = $form->dbconnect($myconfig);
-
- my $query = qq|SELECT * FROM payment_terms ORDER BY sortkey|;
-
- my $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
-
- $form->{ALL} = [];
- while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
- push @{ $form->{ALL} }, $ref;
- }
-
- $sth->finish;
- $dbh->disconnect;
-
- $main::lxdebug->leave_sub();
-}
-
-sub get_payment {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
-
- # connect to database
- my $dbh = $form->dbconnect($myconfig);
-
- my $query = qq|SELECT * FROM payment_terms WHERE id = ?|;
- my $sth = $dbh->prepare($query);
- $sth->execute($form->{"id"}) || $form->dberror($query . " ($form->{id})");
-
- my $ref = $sth->fetchrow_hashref("NAME_lc");
- map { $form->{$_} = $ref->{$_} } keys %$ref;
- $sth->finish();
-
- $query =
- qq|SELECT t.language_id, t.description_long, l.description AS language | .
- qq|FROM translation_payment_terms t | .
- qq|LEFT JOIN language l ON t.language_id = l.id | .
- qq|WHERE t.payment_terms_id = ? | .
- qq|UNION | .
- qq|SELECT l.id AS language_id, NULL AS description_long, | .
- qq| l.description AS language | .
- qq|FROM language l|;
- $sth = $dbh->prepare($query);
- $sth->execute($form->{"id"}) || $form->dberror($query . " ($form->{id})");
-
- my %mapping;
- while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
- $mapping{ $ref->{"language_id"} } = $ref
- unless (defined($mapping{ $ref->{"language_id"} }));
- }
- $sth->finish;
-
- $form->{"TRANSLATION"} = [sort({ $a->{"language"} cmp $b->{"language"} }
- values(%mapping))];
-
- $dbh->disconnect;
-
- $main::lxdebug->leave_sub();
-}
-
-sub save_payment {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
-
- # connect to database
- my $dbh = $form->dbconnect_noauto($myconfig);
-
- my $query;
-
- if (!$form->{id}) {
- $query = qq|SELECT nextval('id'), COALESCE(MAX(sortkey) + 1, 1) | .
- qq|FROM payment_terms|;
- my $sortkey;
- ($form->{id}, $sortkey) = selectrow_query($form, $dbh, $query);
-
- $query = qq|INSERT INTO payment_terms (id, sortkey) VALUES (?, ?)|;
- do_query($form, $dbh, $query, $form->{id}, $sortkey);
-
- } else {
- $query =
- qq|DELETE FROM translation_payment_terms | .
- qq|WHERE payment_terms_id = ?|;
- do_query($form, $dbh, $query, $form->{"id"});
- }
-
- $query = qq|UPDATE payment_terms SET
- description = ?, description_long = ?,
- terms_netto = ?, terms_skonto = ?,
- percent_skonto = ?
- WHERE id = ?|;
- my @values = ($form->{description}, $form->{description_long},
- $form->{terms_netto} * 1, $form->{terms_skonto} * 1,
- $form->{percent_skonto} * 1,
- $form->{id});
- do_query($form, $dbh, $query, @values);
-
- $query = qq|SELECT id FROM language|;
- my @language_ids;
- my $sth = $dbh->prepare($query);
- $sth->execute() || $form->dberror($query);
-
- while (my ($id) = $sth->fetchrow_array()) {
- push(@language_ids, $id);
- }
- $sth->finish();
-
- $query =
- qq|INSERT INTO translation_payment_terms | .
- qq|(language_id, payment_terms_id, description_long) | .
- qq|VALUES (?, ?, ?)|;
- $sth = $dbh->prepare($query);
-
- foreach my $language_id (@language_ids) {
- do_statement($form, $sth, $query, $language_id, $form->{"id"},
- $form->{"description_long_${language_id}"});
- }
- $sth->finish();
-
- $dbh->commit();
- $dbh->disconnect;
-
- $main::lxdebug->leave_sub();
-}
-
-sub delete_payment {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
-
- # connect to database
- my $dbh = $form->dbconnect_noauto($myconfig);
-
- my $query =
- qq|DELETE FROM translation_payment_terms WHERE payment_terms_id = ?|;
- do_query($form, $dbh, $query, $form->{"id"});
-
- $query = qq|DELETE FROM payment_terms WHERE id = ?|;
- do_query($form, $dbh, $query, $form->{"id"});
-
- $dbh->commit();
- $dbh->disconnect;
-
- $main::lxdebug->leave_sub();
-}
-
-
sub prepare_template_filename {
$main::lxdebug->enter_sub();
--- /dev/null
+package SL::Controller::PaymentTerm;
+
+use strict;
+
+use parent qw(SL::Controller::Base);
+
+use SL::DB::PaymentTerm;
+use SL::DB::Language;
+use SL::Helper::Flash;
+
+use Rose::Object::MakeMethods::Generic
+(
+ scalar => [ qw(payment_term languages) ],
+);
+
+__PACKAGE__->run_before('load_payment_term', only => [ qw( edit update destroy move_up move_down) ]);
+__PACKAGE__->run_before('load_languages', only => [ qw(new list edit create update) ]);
+
+#
+# actions
+#
+
+sub action_list {
+ my ($self) = @_;
+
+ $self->render('payment_term/list',
+ title => $::locale->text('Payment terms'),
+ PAYMENT_TERMS => SL::DB::Manager::PaymentTerm->get_all_sorted);
+}
+
+sub action_new {
+ my ($self) = @_;
+
+ $self->{payment_term} = SL::DB::PaymentTerm->new;
+ $self->render('payment_term/form', title => $::locale->text('Create a new payment term'));
+}
+
+sub action_edit {
+ my ($self) = @_;
+ $self->render('payment_term/form', title => $::locale->text('Edit payment term'));
+}
+
+sub action_create {
+ my ($self) = @_;
+
+ $self->{payment_term} = SL::DB::PaymentTerm->new;
+ $self->create_or_update;
+}
+
+sub action_update {
+ my ($self) = @_;
+ $self->create_or_update;
+}
+
+sub action_destroy {
+ my ($self) = @_;
+
+ if (eval { $self->{payment_term}->delete; 1; }) {
+ flash_later('info', $::locale->text('The payment term has been deleted.'));
+ } else {
+ flash_later('error', $::locale->text('The payment term is in use and cannot be deleted.'));
+ }
+
+ $self->redirect_to(action => 'list');
+}
+
+sub action_move_up {
+ my ($self) = @_;
+ $self->{payment_term}->move_position_up;
+ $self->redirect_to(action => 'list');
+}
+
+sub action_move_down {
+ my ($self) = @_;
+ $self->{payment_term}->move_position_down;
+ $self->redirect_to(action => 'list');
+}
+
+#
+# helpers
+#
+
+sub create_or_update {
+ my $self = shift;
+ my $is_new = !$self->{payment_term}->id;
+ my $params = delete($::form->{payment_term}) || { };
+
+ $self->{payment_term}->assign_attributes(%{ $params });
+
+ my @errors = $self->{payment_term}->validate;
+
+ if (@errors) {
+ flash('error', @errors);
+ $self->render('payment_term/form', title => $is_new ? $::locale->text('Create a new payment term') : $::locale->text('Edit payment term'));
+ return;
+ }
+
+ $self->{payment_term}->save;
+ foreach my $language (@{ $self->{languages} }) {
+ $self->{payment_term}->save_attribute_translation('description_long', $language, $::form->{"translation_" . $language->id});
+ }
+
+ flash_later('info', $is_new ? $::locale->text('The payment term has been created.') : $::locale->text('The payment term has been saved.'));
+ $self->redirect_to(action => 'list');
+}
+
+sub load_payment_term {
+ my ($self) = @_;
+ $self->{payment_term} = SL::DB::PaymentTerm->new(id => $::form->{id})->load;
+}
+
+sub load_languages {
+ my ($self) = @_;
+ $self->{languages} = SL::DB::Manager::Language->get_all_sorted;
+}
+
+1;
--- /dev/null
+package SL::DB::Manager::PaymentTerm;
+
+use strict;
+
+use SL::DB::Helper::Manager;
+use base qw(SL::DB::Helper::Manager);
+
+use SL::DB::Helper::Sorted;
+
+sub object_class { 'SL::DB::PaymentTerm' }
+
+__PACKAGE__->make_manager_methods;
+
+sub _sort_spec {
+ return ( default => [ 'sortkey', 1 ],
+ columns => { SIMPLE => 'ALL',
+ map { ( $_ => "lower(payment_terms.${_})" ) } qw(description description_long),
+ });
+}
+
+1;
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
package SL::DB::PaymentTerm;
use strict;
use SL::DB::MetaSetup::PaymentTerm;
+use SL::DB::Manager::PaymentTerm;
+use SL::DB::Helper::ActsAsList;
+use SL::DB::Helper::TranslatedAttributes;
+
+sub validate {
+ my ($self) = @_;
+
+ my @errors;
+ push @errors, $::locale->text('The description is missing.') if !$self->description;
+ push @errors, $::locale->text('The long description is missing.') if !$self->description_long;
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
-__PACKAGE__->meta->make_manager_class;
+ return @errors;
+}
1;
if ($self->{"language_id"}) {
$query =
- qq|SELECT t.description_long, l.output_numberformat, l.output_dateformat, l.output_longdates | .
- qq|FROM translation_payment_terms t | .
+ qq|SELECT t.translation, l.output_numberformat, l.output_dateformat, l.output_longdates | .
+ qq|FROM generic_translations t | .
qq|LEFT JOIN language l ON t.language_id = l.id | .
- qq|WHERE (t.language_id = ?) AND (t.payment_terms_id = ?)|;
+ qq|WHERE (t.language_id = ?)
+ AND (t.translation_id = ?)
+ AND (t.translation_type = 'SL::DB::PaymentTerm/description_long')|;
my ($description_long, $output_numberformat, $output_dateformat,
$output_longdates) =
selectrow_query($self, $dbh, $query,
$main::lxdebug->leave_sub();
}
-sub add_payment {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
-
- $main::auth->assert('config');
-
- $form->{title} = "Add";
-
- $form->{callback} = "am.pl?action=add_payment" 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;
-
- $main::lxdebug->leave_sub();
-}
-
-sub edit_payment {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
-
- $main::auth->assert('config');
-
- $form->{title} = "Edit";
-
- AM->get_payment(\%myconfig, $form);
- $form->{percent_skonto} =
- $form->format_amount(\%myconfig, $form->{percent_skonto} * 100);
-
- &payment_header;
-
- $form->{orphaned} = 1;
- &form_footer;
-
- $main::lxdebug->leave_sub();
-}
-
-sub list_payment {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- AM->payment(\%myconfig, \%$form);
-
- $form->{callback} = build_std_url("action=list_payment");
-
- my $callback = $form->escape($form->{callback});
-
- $form->{title} = $locale->text('Payment Terms');
-
- my @column_index = qw(up down description description_long terms_netto
- terms_skonto percent_skonto);
- my %column_header;
- $column_header{up} =
- qq|<th class="listheading" align="center" valign="center" width="16">|
- . qq|<img src="image/up.png" alt="| . $locale->text("up") . qq|">|
- . qq|</th>|;
- $column_header{down} =
- qq|<th class="listheading" align="center" valign="center" width="16">|
- . qq|<img src="image/down.png" alt="| . $locale->text("down") . qq|">|
- . qq|</th>|;
- $column_header{description} =
- qq|<th class=listheading>|
- . $locale->text('Description')
- . qq|</th>|;
- $column_header{description_long} =
- qq|<th class=listheading>|
- . $locale->text('Long Description')
- . qq|</th>|;
- $column_header{terms_netto} =
- qq|<th class=listheading>|
- . $locale->text('Netto Terms')
- . qq|</th>|;
- $column_header{terms_skonto} =
- qq|<th class=listheading>|
- . $locale->text('Skonto Terms')
- . qq|</th>|;
- $column_header{percent_skonto} =
- qq|<th class=listheading>|
- . $locale->text('Skonto')
- . qq| %</th>|;
-
- $form->header;
-
- print qq|
-<body>
-
-<table width=100%>
- <tr>
- <th class=listtop>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <td>
- <table width=100%>
- <tr class=listheading>
-|;
-
- map { print "$column_header{$_}\n" } @column_index;
-
- print qq|
- </tr>
-|;
-
- my $swap_link = build_std_url("action=swap_payment_terms");
-
- my $row = 0;
- my ($i, %column_data);
- foreach my $ref (@{ $form->{ALL} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
- if ($row) {
- my $pref = $form->{ALL}->[$row - 1];
- $column_data{up} =
- qq|<td align="center" valign="center" width="16">| .
- qq|<a href="${swap_link}&id1=$ref->{id}&id2=$pref->{id}">| .
- qq|<img border="0" src="image/up.png" alt="| . $locale->text("up") . qq|">| .
- qq|</a></td>|;
- } else {
- $column_data{up} = qq|<td width="16"> </td>|;
- }
-
- if ($row == (scalar(@{ $form->{ALL} }) - 1)) {
- $column_data{down} = qq|<td width="16"> </td>|;
- } else {
- my $nref = $form->{ALL}->[$row + 1];
- $column_data{down} =
- qq|<td align="center" valign="center" width="16">| .
- qq|<a href="${swap_link}&id1=$ref->{id}&id2=$nref->{id}">| .
- qq|<img border="0" src="image/down.png" alt="| . $locale->text("down") . qq|">| .
- qq|</a></td>|;
- }
-
- $column_data{description} =
- qq|<td><a href="| .
- build_std_url("action=edit_payment", "id=$ref->{id}", "callback=$callback") .
- qq|">| . H($ref->{description}) . qq|</a></td>|;
- $column_data{description_long} =
- qq|<td>| . H($ref->{description_long}) . qq|</td>|;
- $column_data{terms_netto} =
- qq|<td align=right>$ref->{terms_netto}</td>|;
- $column_data{terms_skonto} =
- qq|<td align=right>$ref->{terms_skonto}</td>|;
- $column_data{percent_skonto} =
- qq|<td align=right>| .
- $form->format_amount(\%myconfig, $ref->{percent_skonto} * 100) .
- qq|%</td>|;
- map { print "$column_data{$_}\n" } @column_index;
-
- print qq|
- </tr>
-|;
- $row++;
- }
-
- print qq|
- </table>
- </td>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-
-<br>
-<form method=post action=am.pl>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=type value=payment>
-
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">
-
- </form>
-
- </body>
- </html>
-|;
-
- $main::lxdebug->leave_sub();
-}
-
-sub payment_header {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->{title} = $locale->text("$form->{title} Payment Terms");
-
- # $locale->text('Add Payment Terms')
- # $locale->text('Edit Payment Terms')
-
- $form->{description} =~ s/\"/"/g;
-
-
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=am.pl>
-
-<input type=hidden name=id value=$form->{id}>
-<input type=hidden name=type value=payment>
-
-<table width=100%>
- <tr>
- <th class=listtop colspan=2>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <th align=right>| . $locale->text('Description') . qq|</th>
- <td><input name=description size=30 value="$form->{description}"></td>
- <tr>
- <tr>
- <th align=right>| . $locale->text('Long Description') . qq|</th>
- <td><input name=description_long size=50 value="$form->{description_long}"></td>
- </tr>
-|;
-
- foreach my $language (@{ $form->{"TRANSLATION"} }) {
- print qq|
- <tr>
- <th align="right">| .
- sprintf($locale->text('Translation (%s)'),
- $language->{"language"})
- . qq|</th>
- <td><input name="description_long_$language->{language_id}" size="50"
- value="| . Q($language->{"description_long"}) . qq|"></td>
- </tr>
-|;
- }
-
- print qq|
- <tr>
- <th align=right>| . $locale->text('Netto Terms') . qq|</th>
- <td><input name=terms_netto size=10 value="$form->{terms_netto}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Skonto Terms') . qq|</th>
- <td><input name=terms_skonto size=10 value="$form->{terms_skonto}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Skonto') . qq| %</th>
- <td><input name=percent_skonto size=10 value="$form->{percent_skonto}"></td>
- </tr>
- <td colspan=2><hr size=3 noshade></td>
- </tr>
-</table>
-
-<p>| . $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|</p>
-
-<ul>
- <li>| . $locale->text("<%netto_date%> -- Date the payment is due in " .
- "full")
-. qq|</li>
- <li>| . $locale->text("<%skonto_date%> -- Date the payment is due " .
- "with discount")
-. qq|</li>
- <li>| . $locale->text("<%skonto_amount%> -- The deductible amount")
-. qq|</li>
- <li>| . $locale->text("<%skonto_in_percent%> -- The discount in percent")
-. qq|</li>
- <li>| . $locale->text("<%total%> -- Amount payable")
-. qq|</li>
- <li>| . $locale->text("<%total_wo_skonto%> -- Amount payable less discount")
-. qq|</li>
- <li>| . $locale->text("<%invtotal%> -- Invoice total")
-. qq|</li>
- <li>| . $locale->text("<%invtotal_wo_skonto%> -- Invoice total less discount")
-. qq|</li>
- <li>| . $locale->text("<%currency%> -- The selected currency")
-. qq|</li>
- <li>| . $locale->text("<%terms_netto%> -- The number of days for " .
- "full payment")
-. qq|</li>
- <li>| . $locale->text("<%account_number%> -- Your account number")
-. qq|</li>
- <li>| . $locale->text("<%bank%> -- Your bank")
-. qq|</li>
- <li>| . $locale->text("<%bank_code%> -- Your bank code")
-. qq|</li>
-</ul>|;
-
- $main::lxdebug->leave_sub();
-}
-
-sub save_payment {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $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!'));
-
- $main::lxdebug->leave_sub();
-}
-
-sub delete_payment {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- AM->delete_payment(\%myconfig, \%$form);
- $form->redirect($locale->text('Payment terms deleted!'));
-
- $main::lxdebug->leave_sub();
-}
-
-sub swap_payment_terms {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
-
- $main::auth->assert('config');
-
- AM->swap_sortkeys(\%myconfig, $form, "payment_terms");
- list_payment();
-
- $main::lxdebug->leave_sub();
-}
-
sub edit_defaults {
$main::lxdebug->enter_sub();
' Part Number missing!' => ' Artikelnummer fehlt!',
' missing!' => ' fehlt!',
'#1 prices were updated.' => '#1 Preise wurden aktualisiert.',
- '<%account_number%> -- Your account number' => '<%account_number%> -- Ihre Kontonummer',
- '<%bank%> -- Your bank' => '<%bank%> -- Der Name Ihrer Bank',
- '<%bank_code%> -- Your bank code' => '<%bank_code%> -- Die Bankleitzahl Ihrer Bank',
- '<%currency%> -- The selected currency' => '<%currency%> -- Die ausgewählte Währung',
- '<%invtotal%> -- Invoice total' => '<%invtotal%> -- Die Rechnungssumme',
- '<%invtotal_wo_skonto%> -- Invoice total less discount' => '<%invtotal_wo_skonto%> -- Rechnungssumme abzüglich Skonto',
- '<%netto_date%> -- Date the payment is due in full' => '<%netto_date%> -- Das Datum, bis die Rechnung in voller Höhe bezahlt werden muss',
- '<%skonto_amount%> -- The deductible amount' => '<%skonto_amount%> -- Der abziehbare Skontobetrag',
- '<%skonto_date%> -- Date the payment is due with discount' => '<%skonto_date%> -- Das Datum, bis die Rechnung unter Abzug von Skonto bezahlt werden kann',
- '<%skonto_in_percent%> -- The discount in percent' => '<%skonto_in_percent%> -- Der prozentuale Rabatt',
- '<%terms_netto%> -- The number of days for full payment' => '<%terms_netto%> -- Die Anzahl Tage, bis die Rechnung in voller Höhe bezahlt werden muss',
- '<%total%> -- Amount payable' => '<%total%> -- Noch zu bezahlender Betrag',
- '<%total_wo_skonto%> -- Amount payable less discount' => '<%total_wo_skonto%> -- Noch zu bezahlender Betrag abzüglich Skonto',
'*/' => '*/',
'---please select---' => '---bitte auswählen---',
'...after loggin in' => '...nach dem Anmelden',
'AR Transaction (abbreviation)' => 'D',
'AR Transactions' => 'Debitorenbuchungen',
'ASSETS' => 'AKTIVA',
+ 'Abort' => 'Abbrechen',
'Abrechnungsnummer' => 'Abrechnungsnummer',
'Abteilung' => 'Abteilung',
'Account' => 'Konto',
'Amount' => 'Betrag',
'Amount Due' => 'Betrag fällig',
'Amount has to be greater then zero! Wrong row number: ' => 'Leere Eingabe oder Werte kleiner, gleich null eingegeben. Fehler in Reihe Nummer: ',
+ 'Amount payable' => 'Noch zu bezahlender Betrag',
+ 'Amount payable less discount' => 'Noch zu bezahlender Betrag abzüglich Skonto',
'An invalid character was used (invalid characters: #1).' => 'Ein ungültiges Zeichen wurde benutzt (ungültige Zeichen: #1).',
'An invalid character was used (valid characters: #1).' => 'Ein ungültiges Zeichen wurde benutzt (gültige Zeichen: #1).',
'An upper-case character is required.' => 'Ein Großbuchstabe ist vorgeschrieben.',
'Are you sure you want to delete Order Number' => 'Soll der Auftrag mit folgender Nummer wirklich gelöscht werden:',
'Are you sure you want to delete Quotation Number' => 'Sind Sie sicher, dass Angebotnummer gelöscht werden soll?',
'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
+ 'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?',
'Are you sure you want to remove the marked entries from the queue?' => 'Sind Sie sicher, dass die markierten Einträge von der Warteschlange gelöscht werden sollen?',
'Are you sure you want to update the prices' => 'Sind Sie sicher, dass Sie die Preise aktualisieren wollen?',
'Article Code' => 'Artikelkürzel',
'Create Chart of Accounts' => 'Zu verwendender Kontenplan',
'Create Dataset' => 'Neue Datenbank anlegen',
'Create Date' => 'Erstelldatum',
+ 'Create a new payment term' => 'Neue Zahlungsbedingungen anlegen',
'Create a standard group' => 'Eine Standard-Benutzergruppe anlegen',
'Create and edit RFQs' => 'Lieferantenanfragen erfassen und bearbeiten',
'Create and edit customers and vendors' => 'Kunden und Lieferanten erfassen und bearbeiten',
'Create bank transfer via SEPA XML' => 'Überweisung via SEPA XML erzeugen',
'Create invoice?' => 'Rechnung erstellen?',
'Create new' => 'Neu erfassen',
+ 'Create new payment term' => 'Neue Zahlungsbedingung anlegen',
'Create tables' => 'Tabellen anlegen',
'Created by' => 'Erstellt von',
'Created for' => 'Erstellt für',
'Date Paid' => 'Zahlungsdatum',
'Date and timestamp variables: If the default value equals \'NOW\' then the current date/current timestamp will be used. Otherwise the default value is copied as-is.' => 'Datums- und Uhrzeitvariablen: Wenn der Standardwert \'NOW\' ist, so wird das aktuelle Datum/die aktuelle Uhrzeit eingefügt. Andernfalls wird der Standardwert so wie er ist benutzt.',
'Date missing!' => 'Datum fehlt!',
+ 'Date the payment is due in full' => 'Das Datum, bis die Rechnung in voller Höhe bezahlt werden muss',
+ 'Date the payment is due with discount' => 'Das Datum, bis die Rechnung unter Abzug von Skonto bezahlt werden kann',
'Datevautomatik' => 'Datevexport',
'Datum von' => 'Datum von',
'Debit' => 'Soll',
'Edit Language' => 'Sprache bearbeiten',
'Edit Lead' => 'Kundenquelle bearbeiten',
'Edit Part' => 'Ware bearbeiten',
- 'Edit Payment Terms' => 'Zahlungskonditionen bearbeiten',
'Edit Preferences for #1' => 'Einstellungen von #1 bearbeiten',
'Edit Price Factor' => 'Preisfaktor bearbeiten',
'Edit Pricegroup' => 'Preisgruppe bearbeiten',
'Edit groups' => 'Gruppen bearbeiten',
'Edit membership' => 'Mitgliedschaft bearbeiten',
'Edit note' => 'Notiz bearbeiten',
+ 'Edit payment term' => 'Zahlungsbedingungen bearbeiten',
'Edit rights' => 'Rechte bearbeiten',
'Edit templates' => 'Vorlagen bearbeiten',
'Edit the Delivery Order' => 'Lieferschein bearbeiten',
'Feb' => 'Feb',
'February' => 'Februar',
'Fee' => 'Gebühr',
+ 'Field' => 'Feld',
'File' => 'Datei',
'File name' => 'Dateiname',
'Files created by Lx-Office\'s "Backup Dataset" function are such files.' => 'Dateien, die von Lx-Office\' Funktion "Datenbank sichern" erstellt wurden, erfüllen diese Kriterien.',
'Invoice for fees' => 'Rechnung über Gebühren',
'Invoice has already been storno\'d!' => 'Diese Rechnung wurde bereits storniert.',
'Invoice number' => 'Rechnungsnummer',
+ 'Invoice total' => 'Die Rechnungssumme',
+ 'Invoice total less discount' => 'Rechnungssumme abzüglich Skonto',
'Invoice with Storno (abbreviation)' => 'R(S)',
'Invoices' => 'Rechnungen',
'Is Searchable' => 'Durchsuchbar',
'List Groups' => 'Warengruppen anzeigen',
'List Languages' => 'Sprachen anzeigen',
'List Lead' => 'Kundenquelle anzeigen',
- 'List Payment Terms' => 'Zahlungskonditionen anzeigen',
+ 'List Payment Terms' => 'Zahlungsbedingungen anzeigen',
'List Price' => 'Listenpreis',
'List Price Factors' => 'Preisfaktoren anzeigen',
'List Pricegroups' => 'Preisgruppen anzeigen',
'No licenses were found that match the search criteria.' => 'Es wurden keine Lizenzen gefunden, auf die die Suchkriterien zutreffen.',
'No or an unknown authenticantion module specified in "config/lx_office.conf".' => 'Es wurde kein oder ein unbekanntes Authentifizierungsmodul in "config/lx_office.conf" angegeben.',
'No part was found matching the search parameters.' => 'Es wurde kein Artikel gefunden, auf den die Suchparameter zutreffen.',
+ 'No payment term has been created yet.' => 'Es wurden noch keine Zahlungsbedingungen angelegt.',
'No prices will be updated because no prices have been entered.' => 'Es werden keine Preise aktualisiert, weil keine gültigen Preisänderungen eingegeben wurden.',
'No problems were recognized.' => 'Es wurden keine Probleme gefunden.',
'No transaction selected!' => 'Keine Transaktion ausgewählt',
'Payables' => 'Verbindlichkeiten',
'Payment' => 'Zahlungsausgang',
'Payment Reminder' => 'Zahlungserinnerung',
- 'Payment Terms' => 'Zahlungskonditionen',
+ 'Payment Terms' => 'Zahlungsbedingungen',
'Payment Terms missing in row ' => 'Zahlungsfrist fehlt in Zeile ',
- 'Payment Terms saved!' => 'Zahlungskonditionen gespeichert!',
'Payment date missing!' => 'Tag der Zahlung fehlt!',
'Payment list as PDF' => 'Zahlungsliste als PDF',
'Payment posted!' => 'Zahlung gebucht!',
- 'Payment terms deleted!' => 'Zahlungskonditionen gelöscht!',
+ 'Payment terms' => 'Zahlungsbedingungen',
'Payments' => 'Zahlungsausgänge',
'Per. Inv.' => 'Wied. Rech.',
'Period' => 'Zeitraum',
'The dataset backup has been sent via email to #1.' => 'Die Datenbanksicherung wurde per Email an #1 verschickt.',
'The dataset has to exist before a restoration can be started.' => 'Die Datenbank muss vor der Wiederherstellung bereits angelegt worden sein.',
'The dataset name is missing.' => 'Der Datenbankname fehlt.',
+ 'The deductible amount' => 'Der abziehbare Skontobetrag',
'The default value depends on the variable type:' => 'Die Bedeutung des Standardwertes hängt vom Variablentypen ab:',
'The delivery order has not been marked as delivered. The warehouse contents have not changed.' => 'Der Lieferschein wurde nicht als geliefert markiert. Der Lagerinhalt wurde nicht verändert.',
'The description is missing.' => 'Die Beschreibung fehlt.',
'The description is shown on the form. Chose something short and descriptive.' => 'Die Beschreibung wird in der jeweiligen Maske angezeigt. Sie sollte kurz und prägnant sein.',
'The directory "%s" could not be created:\n%s' => 'Das Verzeichnis "%s" konnte nicht erstellt werden:\n%s',
'The directory %s does not exist.' => 'Das Verzeichnis %s existiert nicht.',
+ 'The discount in percent' => 'Der prozentuale Rabatt',
'The dunning process started' => 'Der Mahnprozess ist gestartet.',
'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
'The email address is missing.' => 'Die Emailadresse fehlt.',
'The licensing module has been deactivated in the configuration.' => 'Das Lizenzverwaltungsmodul wurde in der Konfiguration deaktiviert.',
'The list has been printed.' => 'Die Liste wurde ausgedruckt.',
'The login is missing.' => 'Das Login fehlt.',
+ 'The long description is missing.' => 'Der Langtext fehlt.',
'The name in row %d has already been used before.' => 'Der Name in Zeile %d wurde vorher bereits benutzt.',
'The name is missing in row %d.' => 'Der Name fehlt in Zeile %d.',
'The name is missing.' => 'Der Name fehlt.',
'The name must only consist of letters, numbers and underscores and start with a letter.' => 'Der Name darf nur aus Buchstaben (keine Umlaute), Ziffern und Unterstrichen bestehen und muss mit einem Buchstaben beginnen.',
+ 'The number of days for full payment' => 'Die Anzahl Tage, bis die Rechnung in voller Höhe bezahlt werden muss',
'The old file containing the user information is still present ("#1"). Do you want to migrate these users into the database? If not then you will not be able to log in with any of the users present in the old file.' => 'Die alte Datei mit den Benutzerdaten existiert in dieser Installation noch immer ("#1"). Wollen Sie diese Benutzer in die neue Authentifizierungsdatenbank migrieren lassen? Falls nicht, so werden Sie sich nicht mehr mit den Benutzerdaten aus der alten Mitgliedsdatei anmelden können.',
'The option field is empty.' => 'Das Optionsfeld ist leer.',
'The parts for this delivery order have already been transferred in.' => 'Die Artikel dieses Lieferscheins wurden bereits eingelagert.',
'The password is too long (maximum length: #1).' => 'Das Passwort ist zu lang (maximale Länge: #1).',
'The password is too short (minimum length: #1).' => 'Das Password ist zu kurz (minimale Länge: #1).',
'The password is weak (e.g. it can be found in a dictionary).' => 'Das Passwort ist schwach (z.B. wenn es in einem Wörterbuch steht).',
+ 'The payment term has been created.' => 'Die Zahlungsbedingungen wurden angelegt.',
+ 'The payment term has been deleted.' => 'Die Zahlungsbedingungen wurden gelöscht.',
+ 'The payment term has been saved.' => 'Die Zahlungsbedingungen wurden gespeichert.',
+ 'The payment term is in use and cannot be deleted.' => 'Die Zahlungsbedingungen werden bereits benutzt und können nicht gelöscht werden.',
'The payments have been posted.' => 'Die Zahlungen wurden gebucht.',
'The pg_dump process could not be started.' => 'Der pg_dump-Prozess konnte nicht gestartet werden.',
'The pg_restore process could not be started.' => 'Der pg_restore-Prozess konnte nicht gestartet werden.',
'The selected PostgreSQL installation uses UTF-8 as its encoding. Therefore you have to configure Lx-Office to use UTF-8 as well.' => 'Die ausgewählte PostgreSQL-Installation benutzt UTF-8 als Zeichensatz. Deshalb müssen Sie Lx-Office so konfigurieren, dass es ebenfalls UTF-8 als Zeichensatz benutzt.',
'The selected bank account does not exist anymore.' => 'Das ausgewählte Bankkonto existiert nicht mehr.',
'The selected bin does not exist.' => 'Der ausgewählte Lagerplatz existiert nicht.',
+ 'The selected currency' => 'Die ausgewählte Währung',
'The selected exports have been closed.' => 'Die ausgewählten Exporte wurden abgeschlossen.',
'The selected warehouse does not exist.' => 'Das ausgewählte Lager existiert nicht.',
'The selected warehouse is empty, or no stocked items where found that match the filter settings.' => 'Das ausgewählte Lager ist leer, oder in ihm wurden keine zu den Sucheinstellungen passenden eingelagerten Artikel gefunden.',
'Transfer in' => 'Einlagern',
'Transfer out' => 'Auslagern',
'Transfer qty' => 'Umlagermenge',
- 'Translation (%s)' => 'Übersetzung (%s)',
+ 'Translation' => 'Übersetzung',
'Trial Balance' => 'Summen- und Saldenliste',
'Trial balance between %s and %s' => 'Summen- und Saldenlisten vom %s bis zum %s',
'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.',
'You\'ve already chosen the following limitations:' => 'Sie haben bereits die folgenden Einschränkungen vorgenommen:',
'Your PostgreSQL installationen uses UTF-8 as its encoding. Therefore you have to configure Lx-Office to use UTF-8 as well.' => 'Ihre PostgreSQL-Installation benutzt UTF-8 als Zeichensatz. Sie müssen deshalb Lx-Office so konfigurieren, dass es ebenfalls UTF-8 als Zeichensatz benutzt.',
'Your TODO list' => 'Ihre Aufgabenliste',
+ 'Your account number' => 'Ihre Kontonummer',
+ 'Your bank' => 'Der Name Ihrer Bank',
+ 'Your bank code' => 'Die Bankleitzahl Ihrer Bank',
'Your browser does not currently support Javascript.' => 'Ihr Browser unterstützt im Moment kein Javascript!',
'Your download does not exist anymore. Please re-run the DATEV export assistant.' => 'Ihr Download existiert nicht mehr. Bitte starten Sie den DATEV-Exportassistenten erneut.',
'Zeitpunkt' => 'Zeitpunkt',
submenu=1
[System--Payment Terms--Add Payment Terms]
-module=am.pl
-action=add_payment
+module=controller.pl
+action=PaymentTerm/new
[System--Payment Terms--List Payment Terms]
-module=am.pl
-action=list_payment
+module=controller.pl
+action=PaymentTerm/list
[System--Manage Custom Variables]
module=menu.pl
--- /dev/null
+-- @tag: payment_terms_translation2
+-- @description: Eingliederung von payment_terms_translation in generic_translations
+-- @depends: release_2_6_1
+-- @charset: utf-8
+INSERT INTO generic_translations (language_id, translation_type, translation_id, translation)
+ SELECT language_id, 'SL::DB::PaymentTerm/description_long', payment_terms_id, description_long
+ FROM translation_payment_terms;
+
+DROP TABLE translation_payment_terms;
ALTER TABLE tax_zones ADD PRIMARY KEY (id);
ALTER TABLE todo_user_config ADD COLUMN id SERIAL PRIMARY KEY;
ALTER TABLE translation ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE translation_payment_terms ADD COLUMN id SERIAL PRIMARY KEY;
ALTER TABLE units_language ADD COLUMN id SERIAL PRIMARY KEY;
ALTER TABLE vendortax ADD COLUMN id SERIAL PRIMARY KEY;
--- /dev/null
+[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
+<body>
+
+ <form method="post" action="controller.pl">
+ <div class="listtop">[% FORM.title %]</div>
+
+[%- INCLUDE 'common/flash.html' %]
+
+ <table>
+ <tr>
+ <td>[%- 'Description' | $T8 %]</td>
+ <td>
+ <input name="payment_term.description" value="[%- HTML.escape(SELF.payment_term.description) %]">
+ </td>
+ </tr>
+
+ <tr>
+ <td>[%- 'Long Description' | $T8 %]</td>
+ <td>
+ <input name="payment_term.description_long" value="[%- HTML.escape(SELF.payment_term.description_long) %]" size="60">
+ </td>
+ </tr>
+
+ [%- FOREACH language = SELF.languages %]
+ <tr>
+ <td>[%- HTML.escape(language.description) %] ([%- LxERP.t8('Translation') %])</td>
+ <td>
+ <input name="translation_[% language.id %]" value="[%- HTML.escape(SELF.payment_term.translated_attribute('description_long', language, 1)) %]" size="60">
+ </td>
+ </tr>
+ [%- END %]
+
+ <tr>
+ <td>[%- 'Netto Terms' | $T8 %]</td>
+ <td>
+ <input name="payment_term.terms_netto_as_number" value="[%- HTML.escape(SELF.payment_term.terms_netto_as_number) %]" size="6">
+ </td>
+ </tr>
+
+ <tr>
+ <td>[%- 'Skonto Terms' | $T8 %]</td>
+ <td>
+ <input name="payment_term.terms_skonto_as_number" value="[%- HTML.escape(SELF.payment_term.terms_skonto_as_number) %]" size="6">
+ </td>
+ </tr>
+
+ <tr>
+ <td>[%- 'Skonto' | $T8 %]</td>
+ <td>
+ <input name="payment_term.percent_skonto_as_number" value="[%- HTML.escape(SELF.payment_term.percent_skonto_as_number) %]" size="6">%
+ </td>
+ </tr>
+ </table>
+
+ <p>
+ <input type="hidden" name="id" value="[% SELF.payment_term.id %]">
+ <input type="hidden" name="action" value="PaymentTerm/dispatch">
+ <input type="submit" class="submit" name="action_[% IF SELF.payment_term.id %]update[% ELSE %]create[% END %]" value="[% 'Save' | $T8 %]">
+ [%- IF SELF.payment_term.id %]
+ <input type="submit" class="submit" name="action_destroy" value="[% 'Delete' | $T8 %]"
+ onclick="if (confirm('[% 'Are you sure you want to delete this payment term?' | $T8 %]')) return true; else return false;">
+ [%- END %]
+ <a href="[% SELF.url_for(action => 'list') %]">[%- 'Abort' | $T8 %]</a>
+ </p>
+
+ <hr size="3" noshade>
+
+ <p>[% LxERP.t8("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.") %]</p>
+
+ <table>
+ <tr class="listheading"><th>[%- LxERP.t8('Field') %]</th><th>[%- LxERP.t8('Description') %]</th></tr>
+ <tr><td><%netto_date%></td><td>[% LxERP.t8("Date the payment is due in full") %]</td></tr>
+ <tr><td><%skonto_date%></td><td>[% LxERP.t8("Date the payment is due with discount") %]</td></tr>
+ <tr><td><%skonto_amount%></td><td>[% LxERP.t8("The deductible amount") %]</td></tr>
+ <tr><td><%skonto_in_percent%></td><td>[% LxERP.t8("The discount in percent") %]</td></tr>
+ <tr><td><%total%></td><td>[% LxERP.t8("Amount payable") %]</td></tr>
+ <tr><td><%total_wo_skonto%></td><td>[% LxERP.t8("Amount payable less discount") %]</td></tr>
+ <tr><td><%invtotal%></td><td>[% LxERP.t8("Invoice total") %]</td></tr>
+ <tr><td><%invtotal_wo_skonto%></td><td>[% LxERP.t8("Invoice total less discount") %]</td></tr>
+ <tr><td><%currency%></td><td>[% LxERP.t8("The selected currency") %]</td></tr>
+ <tr><td><%terms_netto%></td><td>[% LxERP.t8("The number of days for full payment") %]</td></tr>
+ <tr><td><%account_number%></td><td>[% LxERP.t8("Your account number") %]</td></tr>
+ <tr><td><%bank%></td><td>[% LxERP.t8("Your bank") %]</td></tr>
+ <tr><td><%bank_code%></td><td>[% LxERP.t8("Your bank code") %]</td></tr>
+ </table>
+ </form>
+
+</body>
+</html>
--- /dev/null
+[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
+<body>
+ <div class="listtop">[% FORM.title %]</div>
+
+[%- INCLUDE 'common/flash.html' %]
+
+ <form method="post" action="controller.pl">
+ [% IF !PAYMENT_TERMS.size %]
+ <p>
+ [%- 'No payment term has been created yet.' | $T8 %]
+ </p>
+
+ [%- ELSE %]
+ <table>
+ <tr class="listheading">
+ <th align="center"><img src="image/up.png"></th>
+ <th align="center"><img src="image/down.png"></th>
+ <th>[%- 'Description' | $T8 %]</th>
+ <th>[%- 'Long Description' | $T8 %]</th>
+ <th align="right">[%- 'Netto Terms' | $T8 %]</th>
+ <th align="right">[%- 'Skonto Terms' | $T8 %]</th>
+ <th align="right">[%- 'Skonto' | $T8 %]</th>
+ </tr>
+
+ [%- FOREACH payment_term = PAYMENT_TERMS %]
+ <tr class="listrow[% loop.count % 2 %]">
+ <td align="center">
+ [%- UNLESS loop.first %]
+ <a href="[% SELF.url_for(action => 'move_up', id => payment_term.id) %]"><img src="image/up.png" border="0"></a>
+ [%- END %]
+ </td>
+ <td align="center">
+ [%- UNLESS loop.last %]
+ <a href="[% SELF.url_for(action => 'move_down', id => payment_term.id) %]"><img src="image/down.png" border="0"></a>
+ [%- END %]
+ </td>
+ <td>
+ <a href="[% SELF.url_for(action => 'edit', id => payment_term.id) %]">
+ [%- HTML.escape(payment_term.description) %]
+ </a>
+ </td>
+ <td>[%- HTML.escape(payment_term.description_long) %]</td>
+ <td align="right">[%- HTML.escape(payment_term.terms_netto_as_number) %]</td>
+ <td align="right">[%- HTML.escape(payment_term.terms_skonto_as_number) %]</td>
+ <td align="right">[%- HTML.escape(payment_term.percent_skonto_as_number) %] %</td>
+ </tr>
+ [%- END %]
+ </table>
+ [%- END %]
+
+ <p>
+ <a href="[% SELF.url_for(action => 'new') %]">[%- 'Create new payment term' | $T8 %]</a>
+ </p>
+ </form>
+
+</body>
+</html>