From 6af007aef5ff57abc085bf61c6b2d228baac7b25 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 14 Jun 2013 12:30:45 +0200 Subject: [PATCH] Nummernkreise/Standardkonten in Mandantenkonfigurationsdialog verschoben --- SL/AM.pm | 205 ---------------- SL/Controller/ClientConfig.pm | 104 +++++++- bin/mozilla/am.pl | 54 ----- locale/de/all | 9 +- menu.ini | 4 - templates/webpages/am/edit_defaults.html | 224 ------------------ .../client_config/_default_accounts.html | 37 +++ .../client_config/_miscellaneous.html | 59 ++++- .../client_config/_ranges_of_numbers.html | 56 +++++ templates/webpages/client_config/form.html | 17 +- 10 files changed, 259 insertions(+), 510 deletions(-) delete mode 100644 templates/webpages/am/edit_defaults.html create mode 100644 templates/webpages/client_config/_default_accounts.html create mode 100644 templates/webpages/client_config/_ranges_of_numbers.html diff --git a/SL/AM.pm b/SL/AM.pm index 1805dac15..441a184de 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -1050,78 +1050,6 @@ sub save_template { return $error; } -sub save_defaults { - $main::lxdebug->enter_sub(); - - my $self = shift; - my %params = @_; - - my $myconfig = \%main::myconfig; - my $form = $main::form; - - my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); - - my %accnos; - map { ($accnos{$_}) = split(m/--/, $form->{$_}) } qw(inventory_accno income_accno expense_accno fxgain_accno fxloss_accno ar_paid_accno); - - # these defaults are database wide - - my $query = - qq|UPDATE defaults SET - inventory_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), - income_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), - expense_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), - fxgain_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), - fxloss_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), - ar_paid_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), - invnumber = ?, - cnnumber = ?, - sonumber = ?, - ponumber = ?, - sqnumber = ?, - rfqnumber = ?, - customernumber = ?, - vendornumber = ?, - articlenumber = ?, - servicenumber = ?, - assemblynumber = ?, - sdonumber = ?, - pdonumber = ?, - businessnumber = ?, - weightunit = ?, - language_id = ?|; - my @values = ($accnos{inventory_accno}, $accnos{income_accno}, $accnos{expense_accno}, - $accnos{fxgain_accno}, $accnos{fxloss_accno}, $accnos{ar_paid_accno}, - $form->{invnumber}, $form->{cnnumber}, - $form->{sonumber}, $form->{ponumber}, - $form->{sqnumber}, $form->{rfqnumber}, - $form->{customernumber}, $form->{vendornumber}, - $form->{articlenumber}, $form->{servicenumber}, - $form->{assemblynumber}, - $form->{sdonumber}, $form->{pdonumber}, - $form->{businessnumber}, $form->{weightunit}, - conv_i($form->{language_id})); - do_query($form, $dbh, $query, @values); - - $main::lxdebug->message(0, "es gibt rowcount: " . $form->{rowcount}); - - for my $i (1..$form->{rowcount}) { - if ($form->{"curr_$i"} ne $form->{"old_curr_$i"}) { - $query = qq|UPDATE currencies SET name = ? WHERE name = ?|; - do_query($form, $dbh, $query, $form->{"curr_$i"}, $form->{"old_curr_$i"}); - } - } - - if (length($form->{new_curr}) > 0) { - $query = qq|INSERT INTO currencies (name) VALUES (?)|; - do_query($form, $dbh, $query, $form->{new_curr}); - } - - $dbh->commit(); - - $main::lxdebug->leave_sub(); -} - sub save_preferences { $main::lxdebug->enter_sub(); @@ -1162,139 +1090,6 @@ sub get_defaults { return $defaults; } -sub defaultaccounts { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - # connect to database - my $dbh = $form->dbconnect($myconfig); - - # get defaults from defaults table - my $query = qq|SELECT * FROM defaults|; - my $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - - $form->{defaults} = $sth->fetchrow_hashref("NAME_lc"); - $form->{defaults}{IC} = $form->{defaults}{inventory_accno_id}; - $form->{defaults}{IC_income} = $form->{defaults}{income_accno_id}; - $form->{defaults}{IC_expense} = $form->{defaults}{expense_accno_id}; - $form->{defaults}{FX_gain} = $form->{defaults}{fxgain_accno_id}; - $form->{defaults}{FX_loss} = $form->{defaults}{fxloss_accno_id}; - $form->{defaults}{AR_paid} = $form->{defaults}{ar_paid_accno_id}; - - $form->{defaults}{weightunit} ||= 'kg'; - - $sth->finish; - - $query = qq|SELECT c.id, c.accno, c.description, c.link - FROM chart c - WHERE c.link LIKE '%IC%' - ORDER BY c.accno|; - $sth = $dbh->prepare($query); - $sth->execute || $self->dberror($query); - - while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { - foreach my $key (split(/:/, $ref->{link})) { - if ($key =~ /IC/) { - my $nkey = $key; - if ($key =~ /cogs/) { - $nkey = "IC_expense"; - } - if ($key =~ /sale/) { - $nkey = "IC_income"; - } - %{ $form->{IC}{$nkey}{ $ref->{accno} } } = ( - id => $ref->{id}, - description => $ref->{description} - ); - } - } - } - $sth->finish; - - $query = qq|SELECT c.id, c.accno, c.description - FROM chart c - WHERE c.category = 'I' - AND c.charttype = 'A' - ORDER BY c.accno|; - $sth = $dbh->prepare($query); - $sth->execute || $self->dberror($query); - - while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { - %{ $form->{IC}{FX_gain}{ $ref->{accno} } } = ( - id => $ref->{id}, - description => $ref->{description} - ); - } - $sth->finish; - - $query = qq|SELECT c.id, c.accno, c.description - FROM chart c - WHERE c.category = 'E' - AND c.charttype = 'A' - ORDER BY c.accno|; - $sth = $dbh->prepare($query); - $sth->execute || $self->dberror($query); - - while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { - %{ $form->{IC}{FX_loss}{ $ref->{accno} } } = ( - id => $ref->{id}, - description => $ref->{description} - ); - } - $sth->finish; - - # now get the tax rates and numbers - $query = qq|SELECT c.id, c.accno, c.description, - t.rate * 100 AS rate, t.taxnumber - FROM chart c, tax t - WHERE c.id = t.chart_id|; - - $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - - while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { - $form->{taxrates}{ $ref->{accno} }{id} = $ref->{id}; - $form->{taxrates}{ $ref->{accno} }{description} = $ref->{description}; - $form->{taxrates}{ $ref->{accno} }{taxnumber} = $ref->{taxnumber} - if $ref->{taxnumber}; - $form->{taxrates}{ $ref->{accno} }{rate} = $ref->{rate} if $ref->{rate}; - } - # Abfrage für Standard Umlaufvermögenskonto - $query = - qq|SELECT id, accno, description, link | . - qq|FROM chart | . - qq|WHERE link LIKE ? |. - qq|ORDER BY accno|; - $sth = prepare_execute_query($form, $dbh, $query, '%AR%'); - $sth->execute || $form->dberror($query);# - while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { - foreach my $item (split(/:/, $ref->{link})) { - if ($item eq "AR_paid") { - %{ $form->{IC}{AR_paid}{ $ref->{accno} } } = ( - id => $ref->{id}, - description => $ref->{description} - ); - } - } - } - - $sth->finish; - - #Get currencies: - $query = qq|SELECT name AS curr FROM currencies ORDER BY id|; - $form->{CURRENCIES} = selectall_hashref_query($form, $dbh, $query); - - #Which of them is the default currency? - $query = qq|SELECT name AS defaultcurrency FROM currencies WHERE id = (SELECT currency_id FROM defaults LIMIT 1);|; - ($form->{defaultcurrency}) = selectrow_query($form, $dbh, $query); - - $dbh->disconnect; - - $main::lxdebug->leave_sub(); -} - sub closedto { $main::lxdebug->enter_sub(); diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index 3585e6a8e..a3fdb9caf 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -3,14 +3,20 @@ package SL::Controller::ClientConfig; use strict; use parent qw(SL::Controller::Base); +use List::Util qw(first); + +use SL::DB::Chart; +use SL::DB::Currency; use SL::DB::Default; +use SL::DB::Language; +use SL::DB::Unit; use SL::Helper::Flash; use SL::Locale::String qw(t8); __PACKAGE__->run_before('check_auth'); use Rose::Object::MakeMethods::Generic ( - 'scalar --get_set_init' => [ qw(defaults all_warehouses posting_options payment_options accounting_options inventory_options profit_options) ], + 'scalar --get_set_init' => [ qw(defaults all_warehouses all_weightunits all_languages all_currencies posting_options payment_options accounting_options inventory_options profit_options accounts) ], ); sub action_edit { @@ -19,16 +25,73 @@ sub action_edit { } sub action_save { - my ($self, %params) = @_; + my ($self, %params) = @_; - my $defaults = delete($::form->{defaults}) || {}; + my $defaults = delete($::form->{defaults}) || {}; + my $entered_currencies = delete($::form->{currencies}) || []; + my $original_currency_id = $self->defaults->currency_id; # undef several fields if an empty value has been selected. foreach (qw(warehouse_id bin_id warehouse_id_ignore_onhand bin_id_ignore_onhand)) { undef $defaults->{$_} if !$defaults->{$_}; } - $self->defaults->update_attributes(%{ $defaults }); + $self->defaults->assign_attributes(%{ $defaults }); + + my %errors_idx; + + # Handle currencies + my (%new_currency_names); + foreach my $existing_currency (@{ $self->all_currencies }) { + my $new_name = $existing_currency->name; + my $new_currency = first { $_->{id} == $existing_currency->id } @{ $entered_currencies }; + $new_name = $new_currency->{name} if $new_currency; + + if (!$new_name) { + $errors_idx{0} = t8('Currency names must not be empty.'); + } elsif ($new_currency_names{$new_name}) { + $errors_idx{1} = t8('Currency names must be unique.'); + } + + if ($new_name) { + $new_currency_names{$new_name} = 1; + $existing_currency->name($new_name); + } + } + + if ($::form->{new_currency} && $new_currency_names{ $::form->{new_currency} }) { + $errors_idx{1} = t8('Currency names must be unique.'); + } + + my @errors = map { $errors_idx{$_} } sort keys %errors_idx; + + if (@errors) { + flash('error', @errors); + return $self->edit_form; + } + + # Save currencies. As the names must be unique we cannot simply save + # them as they are -- the user might want to swap to names. So make + # them unique first and assign the actual names in a second step. + my %currency_names_by_id = map { ($_->id => $_->name) } @{ $self->all_currencies }; + $_->update_attributes(name => '__039519735__' . $_->{id}) for @{ $self->all_currencies }; + $_->update_attributes(name => $currency_names_by_id{ $_->{id} }) for @{ $self->all_currencies }; + + # Create new currency if required + my $new_currency; + if ($::form->{new_currency}) { + $new_currency = SL::DB::Currency->new(name => $::form->{new_currency}); + $new_currency->save; + } + + # If the user wants the new currency to be the default then replace + # the ID placeholder with the proper value. However, if no new + # currency has been created then don't change the value at all. + if (-1 == $self->defaults->currency_id) { + $self->defaults->currency_id($new_currency ? $new_currency->id : $original_currency_id); + } + + $self->defaults->save; flash_later('info', t8('Client Configuration saved!')); @@ -39,8 +102,11 @@ sub action_save { # initializers # -sub init_defaults { SL::DB::Default->get } -sub init_all_warehouses { SL::DB::Manager::Warehouse->get_all_sorted } +sub init_defaults { SL::DB::Default->get } +sub init_all_warehouses { SL::DB::Manager::Warehouse->get_all_sorted } +sub init_all_languages { SL::DB::Manager::Language->get_all_sorted } +sub init_all_currencies { SL::DB::Manager::Currency->get_all_sorted } +sub init_all_weightunits { SL::DB::Manager::Unit->find_by(name => 'g')->convertible_units } sub init_posting_options { [ { title => t8("never"), value => 0 }, @@ -69,6 +135,29 @@ sub init_profit_options { { title => t8("income"), value => "income" }, ] } +sub init_accounts { + my %accounts; + + foreach my $chart (@{ SL::DB::Manager::Chart->get_all(where => [ link => { like => '%IC%' } ], sort_by => 'accno ASC') }) { + my %added; + + foreach my $link (split m/:/, $chart->link) { + my $key = lc($link =~ /cogs/ ? 'IC_expense' : $link =~ /sale/ ? 'IC_income' : $link); + next if $added{$key}; + + $added{$key} = 1; + $accounts{$key} ||= []; + push @{ $accounts{$key} }, $chart; + } + } + + $accounts{fx_gain} = SL::DB::Manager::Chart->get_all(where => [ category => 'I', charttype => 'A' ], sort_by => 'accno ASC'); + $accounts{fx_loss} = SL::DB::Manager::Chart->get_all(where => [ category => 'E', charttype => 'A' ], sort_by => 'accno ASC'); + $accounts{ar_paid} = SL::DB::Manager::Chart->get_all(where => [ link => { like => '%AR_paid%' } ], sort_by => 'accno ASC'); + + return \%accounts; +} + # # filters # @@ -83,7 +172,8 @@ sub check_auth { sub edit_form { my ($self) = @_; - $self->render('client_config/form', title => t8('Client Configuration')); + $self->render('client_config/form', title => t8('Client Configuration'), + make_chart_title => sub { $_[0]->accno . '--' . $_[0]->description }); } 1; diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 567764494..ad6248f3d 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -935,60 +935,6 @@ sub swap_buchungsgruppen { $main::lxdebug->leave_sub(); } -sub edit_defaults { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - # get defaults for account numbers and last numbers - AM->defaultaccounts(\%myconfig, \%$form); - $form->{ALL_UNITS} = AM->convertible_units(AM->retrieve_all_units(), 'g'); - - map { $form->{"defaults_${_}"} = $form->{defaults}->{$_} } keys %{ $form->{defaults} }; - - # default language - my $all_languages = SL::DB::Manager::Language->get_all; - -# cash = IST-Versteuerung, accrual = SOLL-Versteuerung - - foreach my $key (keys %{ $form->{IC} }) { - foreach my $accno (sort keys %{ $form->{IC}->{$key} }) { - my $array = "ACCNOS_" . uc($key); - $form->{$array} ||= []; - - my $value = "${accno}--" . $form->{IC}->{$key}->{$accno}->{description}; - push @{ $form->{$array} }, { - 'name' => $value, - 'value' => $value, - 'selected' => $form->{IC}->{$key}->{$accno}->{id} == $form->{defaults}->{$key}, - }; - } - } - - $form->{title} = $locale->text('Ranges of numbers and default accounts'); - - $form->header(); - print $form->parse_html_template('am/edit_defaults', - { ALL_LANGUAGES => $all_languages, }); - - $main::lxdebug->leave_sub(); -} - -sub save_defaults { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - AM->save_defaults(); - - $form->redirect($locale->text('Defaults saved.')); - - $main::lxdebug->leave_sub(); -} - sub _build_cfg_options { my $form = $main::form; my %myconfig = %main::myconfig; diff --git a/locale/de/all b/locale/de/all index 296908933..f073083af 100755 --- a/locale/de/all +++ b/locale/de/all @@ -166,6 +166,7 @@ $self->{texts} = { 'Add custom variable' => 'Benutzerdefinierte Variable erfassen', 'Add link: select records to link with' => 'Verknüpfungen hinzufügen: zu verknüpfende Belege auswählen', 'Add links' => 'Verknüpfungen hinzufügen', + 'Add new currency' => 'Neue Währung hinzufügen', 'Add note' => 'Notiz erfassen', 'Add printer' => 'Drucker hinzufügen', 'Add unit' => 'Einheit hinzufügen', @@ -462,7 +463,6 @@ $self->{texts} = { 'Company Name' => 'Firmenname', 'Company name' => 'Firmenname', 'Compare to' => 'Gegenüberstellen zu', - 'Configuration' => 'Einstellungen', 'Configuration of individual TODO items' => 'Konfiguration für die einzelnen Aufgabenlistenpunkte', 'Configure' => 'Konfigurieren', 'Confirm' => 'Bestätigen', @@ -552,6 +552,9 @@ $self->{texts} = { 'Currencies' => 'Währungen', 'Currency' => 'Währung', 'Currency (database ID)' => 'Währung (Datenbank-ID)', + 'Currency name' => 'Währungsname', + 'Currency names must be unique.' => 'Währungsnamen müssen eindeutig sein.', + 'Currency names must not be empty.' => 'Währungsnamen dürfen nicht leer sein.', 'Current / Next Level' => 'Aktuelles / Nächstes Mahnlevel', 'Current Earnings' => 'Gewinn', 'Current assets account' => 'Konto für Umlaufvermögen', @@ -651,7 +654,6 @@ $self->{texts} = { 'Default template format' => 'Standardvorlagenformat', 'Default unit' => 'Standardeinheit', 'Default value' => 'Standardwert', - 'Defaults saved.' => 'Die Standardeinstellungen wurden gespeichert.', 'Delete' => 'Löschen', 'Delete Account' => 'Konto löschen', 'Delete Contact' => 'Ansprechperson löschen', @@ -826,6 +828,7 @@ $self->{texts} = { 'Edit templates' => 'Vorlagen bearbeiten', 'Edit the Delivery Order' => 'Lieferschein bearbeiten', 'Edit the configuration for periodic invoices' => 'Konfiguration für wiederkehrende Rechnungen bearbeiten', + 'Edit the currency names in order to rename them.' => 'Bearbeiten Sie den Namen, um eine Währung umzubennen.', 'Edit the purchase_order' => 'Bearbeiten des Lieferantenauftrags', 'Edit the request_quotation' => 'Bearbeiten der Preisanfrage', 'Edit the sales_order' => 'Bearbeiten des Auftrags', @@ -1018,6 +1021,7 @@ $self->{texts} = { 'Hide by default' => 'Standardmäßig verstecken', 'Hide help text' => 'Hilfetext verbergen', 'Hide settings' => 'Einstellungen verbergen', + 'Hints' => 'Hinweise', 'History' => 'Historie', 'History Search' => 'Historien Suche', 'History Search Engine' => 'Historien Suchmaschine', @@ -1644,7 +1648,6 @@ $self->{texts} = { 'RFQs' => 'Preisanfragen', 'ROP' => 'Mindestlagerbestand', 'Ranges of numbers' => 'Nummernkreise', - 'Ranges of numbers and default accounts' => 'Nummernkreise und Standardkonten', 'Re-run analysis' => 'Analyse wiederholen', 'Receipt' => 'Zahlungseingang', 'Receipt posted!' => 'Beleg gebucht!', diff --git a/menu.ini b/menu.ini index 6ca43ef36..3f69ac71e 100644 --- a/menu.ini +++ b/menu.ini @@ -508,10 +508,6 @@ ACCESS=admin module=controller.pl action=ClientConfig/edit -[System--Ranges of numbers and default accounts] -module=am.pl -action=edit_defaults - [System--UStVa Einstellungen] module=ustva.pl action=config_step1 diff --git a/templates/webpages/am/edit_defaults.html b/templates/webpages/am/edit_defaults.html deleted file mode 100644 index c8c91f60a..000000000 --- a/templates/webpages/am/edit_defaults.html +++ /dev/null @@ -1,224 +0,0 @@ -[%- USE T8 %] -[%- USE HTML %] - -
[% title %]
- -
- - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[% 'Ranges of numbers' | $T8 %]
[% 'Last Invoice Number' | $T8 %][% 'Last Customer Number' | $T8 %]
[% 'Last Credit Note Number' | $T8 %][% 'Last Vendor Number' | $T8 %]
[% 'Last Sales Order Number' | $T8 %]
[% 'Last Purchase Order Number' | $T8 %][% 'Last Article Number' | $T8 %]
[% 'Last Sales Quotation Number' | $T8 %][% 'Last Service Number' | $T8 %]
[% 'Last RFQ Number' | $T8 %][% 'Last Assembly Number' | $T8 %]
[% 'Last Sales Delivery Order Number' | $T8 %]
[% 'Last Purchase Delivery Order Number' | $T8 %]
[% 'Default Accounts' | $T8 %]
[% 'Inventory Account' | $T8 %] - -
[% 'Revenue Account' | $T8 %] - -
[% 'Expense Account' | $T8 %] - -
[% 'Foreign Exchange Gain' | $T8 %] - -
[% 'Foreign Exchange Loss' | $T8 %] - -
[% 'Current assets account' | $T8 %] - -
[% 'Miscellaneous' | $T8 %]
[% 'Business Number' | $T8 %]
[% 'Default currency' | $T8 %][% HTML.escape(defaultcurrency) %]
[% 'Currencies' | $T8 %][% FOREACH row = CURRENCIES %] - - [% END %] - -
[% 'Weight unit' | $T8 %] - [%- INCLUDE 'generic/multibox.html' - name = 'weightunit', - default = defaults_weightunit, - style = 'size:20; maxength:5', - DATA = ALL_UNITS, - id_key = 'name', - label_key = 'name', - -%] -
[% 'Default Customer/Vendor Language' | $T8 %] - [%- INCLUDE 'generic/multibox.html' - name = 'language_id', - default = defaults_language_id, - style = 'size:20; maxength:5', - DATA = ALL_LANGUAGES, - id_key = 'id', - label_key = 'description', - show_empty = 1 - -%] -
[% 'Configuration' | $T8 %]
[% 'Accounting method' | $T8 %]
[% 'Inventory system' | $T8 %]
[% 'Profit determination' | $T8 %]
[% 'Chart of accounts' | $T8 %]
-

- -
- -

- -
- -

-
diff --git a/templates/webpages/client_config/_default_accounts.html b/templates/webpages/client_config/_default_accounts.html new file mode 100644 index 000000000..c73002b85 --- /dev/null +++ b/templates/webpages/client_config/_default_accounts.html @@ -0,0 +1,37 @@ +[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%] +[% SET style="width: 600px" %] +
+
[% LxERP.t8('Default Accounts') %]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[% LxERP.t8("Inventory Account") %][% L.select_tag('defaults.inventory_accno_id', SELF.accounts.ic, default=SELF.defaults.inventory_accno_id, title_sub=\make_chart_title, style=style) %]
[% LxERP.t8("Revenue Account") %][% L.select_tag('defaults.income_accno_id', SELF.accounts.ic_income, default=SELF.defaults.income_accno_id, title_sub=\make_chart_title, style=style) %]
[% LxERP.t8("Expense Account") %][% L.select_tag('defaults.expense_accno_id', SELF.accounts.ic_expense, default=SELF.defaults.expense_accno_id, title_sub=\make_chart_title, style=style) %]
[% LxERP.t8("Foreign Exchange Gain") %][% L.select_tag('defaults.fxgain_accno_id', SELF.accounts.fx_gain, default=SELF.defaults.fxgain_accno_id, title_sub=\make_chart_title, style=style) %]
[% LxERP.t8("Foreign Exchange Loss") %][% L.select_tag('defaults.fxloss_accno_id', SELF.accounts.fx_loss, default=SELF.defaults.fxloss_accno_id, title_sub=\make_chart_title, style=style) %]
[% LxERP.t8("Current assets account") %][% L.select_tag('defaults.ar_paid_accno_id', SELF.accounts.ar_paid, default=SELF.defaults.ar_paid_accno_id, title_sub=\make_chart_title, style=style) %]
+
diff --git a/templates/webpages/client_config/_miscellaneous.html b/templates/webpages/client_config/_miscellaneous.html index 9e257fe0e..c09fa761b 100644 --- a/templates/webpages/client_config/_miscellaneous.html +++ b/templates/webpages/client_config/_miscellaneous.html @@ -1,16 +1,63 @@ -[%- USE LxERP -%][%- USE L -%] +[%- USE LxERP -%][%- USE L -%][%- USE HTML -%] +[% SET style="width: 200px" %]
-
[% LxERP.t8('Weight') %]
+
[% LxERP.t8("Miscellaneous") %]
- - + + + + + + + +
[% LxERP.t8('Show weights') %] - [% L.yes_no_tag('defaults.show_weight', SELF.defaults.show_weight) %] + [% LxERP.t8("Business Number") %][% L.input_tag('defaults.businessnumber', SELF.defaults.businessnumber, style=style) %]
[% LxERP.t8('Default Customer/Vendor Language') %][% L.select_tag('defaults.language_id', SELF.all_languages, title_key='description', default=SELF.defaults.language_id, with_empty=1, style=style) %]
+ +
[% LxERP.t8("Currencies") %]
+ + + + + + + + + +[% FOREACH currency = SELF.all_currencies %] + + + + + +[% END %] + + + + + + +
[% LxERP.t8("Default currency") %][% LxERP.t8("Currency name") %][% LxERP.t8("Hints") %]
[% IF loop.count == 1 %][% LxERP.t8("Currencies") %][% END %] + [% L.hidden_tag("currencies[+].id", currency.id) %] + [% L.radio_button_tag('defaults.currency_id', value=currency.id, id='defaults.currency_id_' _ currency.id, checked=(SELF.defaults.currency_id == currency.id)) %] - [% LxERP.t8('Show the weights of articles and the total weight in orders, invoices and delivery notes?') %]
+ [% L.input_tag("currencies[].name", currency.name, style=style) %]
[% IF loop.count == 1 %][% LxERP.t8("Edit the currency names in order to rename them.") %][%- END %]
[% LxERP.t8("Add new currency") %][% L.radio_button_tag('defaults.currency_id', value=-1, id='defaults.currency_id__1', checked=(SELF.defaults.currency_id == -1)) %][% L.input_tag("new_currency", FORM.new_currency, style=style) %]
+ +
[% LxERP.t8("Weight") %]
+ + + + + + + + + + +
[% LxERP.t8("Weight unit") %][% L.select_tag('defaults.weightunit', SELF.all_weightunits, default=SELF.defaults.weightunit, value_key='name', title_key='name', style=style) %]
[% LxERP.t8('Show weights') %][% L.yes_no_tag('defaults.show_weight', SELF.defaults.show_weight, style=style) %][% LxERP.t8('Show the weights of articles and the total weight in orders, invoices and delivery notes?') %]
diff --git a/templates/webpages/client_config/_ranges_of_numbers.html b/templates/webpages/client_config/_ranges_of_numbers.html new file mode 100644 index 000000000..38a7e60e8 --- /dev/null +++ b/templates/webpages/client_config/_ranges_of_numbers.html @@ -0,0 +1,56 @@ +[%- USE LxERP -%][%- USE L -%][%- USE HTML -%] +
+
[% LxERP.t8('Ranges of numbers') %]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[% LxERP.t8('Last Invoice Number') %][% L.input_tag("defaults.invnumber", SELF.defaults.invnumber, size="15") %][% LxERP.t8('Last Customer Number') %][% L.input_tag("defaults.customernumber", SELF.defaults.customernumber, size="15") %]
[% LxERP.t8('Last Credit Note Number') %][% L.input_tag("defaults.cnnumber", SELF.defaults.cnnumber, size="15") %][% LxERP.t8('Last Vendor Number') %][% L.input_tag("defaults.vendornumber", SELF.defaults.vendornumber, size="15") %]
[% LxERP.t8('Last Sales Order Number') %][% L.input_tag("defaults.sonumber", SELF.defaults.sonumber, size="15") %]
[% LxERP.t8('Last Purchase Order Number') %][% L.input_tag("defaults.ponumber", SELF.defaults.ponumber, size="15") %][% LxERP.t8('Last Article Number') %][% L.input_tag("defaults.articlenumber", SELF.defaults.articlenumber, size="15") %]
[% LxERP.t8('Last Sales Quotation Number') %][% L.input_tag("defaults.sqnumber", SELF.defaults.sqnumber, size="15") %][% LxERP.t8('Last Service Number') %][% L.input_tag("defaults.servicenumber", SELF.defaults.servicenumber, size="15") %]
[% LxERP.t8('Last RFQ Number') %][% L.input_tag("defaults.rfqnumber", SELF.defaults.rfqnumber, size="15") %][% LxERP.t8('Last Assembly Number') %][% L.input_tag("defaults.assemblynumber", SELF.defaults.assemblynumber, size="15") %]
[% LxERP.t8('Last Sales Delivery Order Number') %][% L.input_tag("defaults.sdonumber", SELF.defaults.sdonumber, size="15") %]
[% LxERP.t8('Last Purchase Delivery Order Number') %][% L.input_tag("defaults.pdonumber", SELF.defaults.pdonumber, size="15") %]
+
diff --git a/templates/webpages/client_config/form.html b/templates/webpages/client_config/form.html index b137b7d5d..17b5a7fd6 100644 --- a/templates/webpages/client_config/form.html +++ b/templates/webpages/client_config/form.html @@ -1,5 +1,4 @@ -[%- USE T8 %][%- USE L %][% USE LxERP %][% USE HTML %] -[%- USE JavaScript -%] +[%- USE L %][% USE LxERP %][% USE HTML %][%- USE JavaScript -%]