From 6d169764351ba6f5bbf2a90f9d7a260617ab4070 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 3 Mar 2010 16:49:07 +0100 Subject: [PATCH] "Vertreter"-Feature in Kunden-/Lieferantenstammdaten wieder eingebaut --- SL/Form.pm | 13 +++- bin/mozilla/ct.pl | 5 +- locale/de/all | 4 ++ locale/de/dn | 1 + locale/de/do | 1 + locale/de/ic | 1 + locale/de/io | 1 + locale/de/ir | 1 + locale/de/is | 1 + locale/de/login | 1 + locale/de/oe | 1 + locale/de/todo | 1 + templates/webpages/ct/form_header_de.html | 62 +++++++++++++++---- templates/webpages/ct/form_header_master.html | 62 +++++++++++++++---- 14 files changed, 126 insertions(+), 29 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 715385154..7e5a443fe 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -765,6 +765,7 @@ sub _prepare_html_template { $additional_params->{"conf_lizenzen"} = $main::lizenzen; $additional_params->{"conf_latex_templates"} = $main::latex; $additional_params->{"conf_opendocument_templates"} = $main::opendocument_templates; + $additional_params->{"conf_vertreter"} = $main::vertreter; if (%main::debug_options) { map { $additional_params->{'DEBUG_' . uc($_)} = $main::debug_options{$_} } keys %main::debug_options; @@ -2220,9 +2221,15 @@ sub _get_business_types { my ($self, $dbh, $key) = @_; - $key = "all_business_types" unless ($key); - $self->{$key} = - selectall_hashref_query($self, $dbh, qq|SELECT * FROM business|); + my $options = ref $key eq 'HASH' ? $key : { key => $key }; + $options->{key} ||= "all_business_types"; + my $where = ''; + + if (exists $options->{salesman}) { + $where = 'WHERE ' . ($options->{salesman} ? '' : 'NOT ') . 'COALESCE(salesman)'; + } + + $self->{ $options->{key} } = selectall_hashref_query($self, $dbh, qq|SELECT * FROM business $where ORDER BY lower(description)|); $main::lxdebug->leave_sub(); } diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index b0f72b43a..0130a464b 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -285,8 +285,9 @@ sub form_header { my %myconfig = %main::myconfig; my $locale = $main::locale; - $form->get_lists("employees" => "ALL_EMPLOYEES", - "taxzones" => "ALL_TAXZONES"); + $form->get_lists(employees => "ALL_EMPLOYEES", + taxzones => "ALL_TAXZONES", + business_types => { key => 'ALL_SALESMAN_BUSINESSES', salesman => 1 }); $form->get_pricegroup(\%myconfig, { all => 1 }); $form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES}; diff --git a/locale/de/all b/locale/de/all index 12b937f61..6e5956400 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1316,6 +1316,7 @@ $self->{texts} = { 'Report and misc. Preferences' => 'Sonstige Einstellungen', 'Report for' => 'Bericht für', 'Reports' => 'Berichte', + 'Representative' => 'Vertreter', 'Reqdate' => 'Lieferdatum', 'Request for Quotation' => 'Anfrage', 'Request for Quotations' => 'Anfragen', @@ -1716,6 +1717,8 @@ $self->{texts} = { 'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.', 'Type' => 'Typ', 'Type of Business' => 'Kunden-/Lieferantentyp', + 'Type of Customer' => 'Kundentyp', + 'Type of Vendor' => 'Lieferantentyp', 'USTVA' => 'USTVA', 'USTVA 2004' => 'USTVA 2004', 'USTVA 2005' => 'USTVA 2005', @@ -1760,6 +1763,7 @@ $self->{texts} = { 'User migration complete' => 'Benutzermigration abgeschlossen', 'User name' => 'Benutzername', 'User saved!' => 'Benutzer gespeichert!', + 'Username' => 'Benutzername', 'Users in
this group' => 'Benutzer in
dieser Gruppe', 'Users not in this group' => 'Benutzer nicht in dieser Gruppe', 'Ust-IDNr' => 'USt-IdNr.', diff --git a/locale/de/dn b/locale/de/dn index 7970a39fc..4faa7a487 100644 --- a/locale/de/dn +++ b/locale/de/dn @@ -341,6 +341,7 @@ $self->{subs} = { 'quotation' => 'quotation', 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', + 'remove_emptied_rows' => 'remove_emptied_rows', 'report_generator_back' => 'report_generator_back', 'report_generator_dispatcher' => 'report_generator_dispatcher', 'report_generator_do' => 'report_generator_do', diff --git a/locale/de/do b/locale/de/do index 528697cb4..eef7703df 100644 --- a/locale/de/do +++ b/locale/de/do @@ -382,6 +382,7 @@ $self->{subs} = { 'redo_stock_info' => 'redo_stock_info', 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', + 'remove_emptied_rows' => 'remove_emptied_rows', 'report_generator_back' => 'report_generator_back', 'report_generator_dispatcher' => 'report_generator_dispatcher', 'report_generator_do' => 'report_generator_do', diff --git a/locale/de/ic b/locale/de/ic index e207cec17..4bfb78a07 100644 --- a/locale/de/ic +++ b/locale/de/ic @@ -397,6 +397,7 @@ $self->{subs} = { 'quotation' => 'quotation', 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', + 'remove_emptied_rows' => 'remove_emptied_rows', 'report_generator_back' => 'report_generator_back', 'report_generator_dispatcher' => 'report_generator_dispatcher', 'report_generator_do' => 'report_generator_do', diff --git a/locale/de/io b/locale/de/io index 79e3991bc..32cba4698 100644 --- a/locale/de/io +++ b/locale/de/io @@ -299,6 +299,7 @@ $self->{subs} = { 'quotation' => 'quotation', 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', + 'remove_emptied_rows' => 'remove_emptied_rows', 'request_for_quotation' => 'request_for_quotation', 'retrieve_partunits' => 'retrieve_partunits', 'sales_invoice' => 'sales_invoice', diff --git a/locale/de/ir b/locale/de/ir index b7b80b4c0..3d0b94ab4 100644 --- a/locale/de/ir +++ b/locale/de/ir @@ -352,6 +352,7 @@ $self->{subs} = { 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', 'remove_draft' => 'remove_draft', + 'remove_emptied_rows' => 'remove_emptied_rows', 'request_for_quotation' => 'request_for_quotation', 'retrieve_partunits' => 'retrieve_partunits', 'sales_invoice' => 'sales_invoice', diff --git a/locale/de/is b/locale/de/is index befc780f8..f5ac0c76e 100644 --- a/locale/de/is +++ b/locale/de/is @@ -358,6 +358,7 @@ $self->{subs} = { 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', 'remove_draft' => 'remove_draft', + 'remove_emptied_rows' => 'remove_emptied_rows', 'request_for_quotation' => 'request_for_quotation', 'retrieve_partunits' => 'retrieve_partunits', 'sales_invoice' => 'sales_invoice', diff --git a/locale/de/login b/locale/de/login index 782d0a8ba..ab13646c5 100644 --- a/locale/de/login +++ b/locale/de/login @@ -487,6 +487,7 @@ $self->{subs} = { 'redo_stock_info' => 'redo_stock_info', 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', + 'remove_emptied_rows' => 'remove_emptied_rows', 'report' => 'report', 'report_for_todo_list' => 'report_for_todo_list', 'report_generator_back' => 'report_generator_back', diff --git a/locale/de/oe b/locale/de/oe index 003ffe00b..8e37a069a 100644 --- a/locale/de/oe +++ b/locale/de/oe @@ -447,6 +447,7 @@ $self->{subs} = { 'redo_stock_info' => 'redo_stock_info', 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', + 'remove_emptied_rows' => 'remove_emptied_rows', 'report_for_todo_list' => 'report_for_todo_list', 'report_generator_back' => 'report_generator_back', 'report_generator_dispatcher' => 'report_generator_dispatcher', diff --git a/locale/de/todo b/locale/de/todo index dc1299e91..5a1ce5ad5 100644 --- a/locale/de/todo +++ b/locale/de/todo @@ -476,6 +476,7 @@ $self->{subs} = { 'redo_stock_info' => 'redo_stock_info', 'reformat_numbers' => 'reformat_numbers', 'relink_accounts' => 'relink_accounts', + 'remove_emptied_rows' => 'remove_emptied_rows', 'report' => 'report', 'report_for_todo_list' => 'report_for_todo_list', 'report_generator_back' => 'report_generator_back', diff --git a/templates/webpages/ct/form_header_de.html b/templates/webpages/ct/form_header_de.html index a435449f8..7ba33321c 100644 --- a/templates/webpages/ct/form_header_de.html +++ b/templates/webpages/ct/form_header_de.html @@ -1,4 +1,5 @@ -[% USE HTML %][% USE LxERP %] +[% USE HTML %][% USE LxERP %] +
[% title %]
@@ -21,6 +22,32 @@ + [% IF conf_vertreter %] + + + + + + + + + [%- END %] [%- IF is_customer %] @@ -153,17 +180,28 @@ + [%- IF conf_vertreter %] + + + + + + + [%- END %] + - - + [% UNLESS conf_vertreter %] + + + [%- END %] - [%- IF is_customer %] + [%- IF is_customer && !use_vertreter %]
[% IF is_customer %]Kundentyp[%- ELSE %]Lieferantentyp[%- END %] + [%- INCLUDE generic/multibox.html + name = 'business', + DATA = all_business, + show_empty = 1, + id_key = 'id', + label_key = 'description', + -%] +
Vertreter + [%- INCLUDE generic/multibox.html + name = 'salesman_id', + DATA = ALL_SALESMAN_BUSINESSES, + show_empty = 1, + id_key = 'id', + label_key = 'description', + -%] +
Kundennummer
BenutzernamePasswort
Kunden-/Lieferantentyp - [%- INCLUDE generic/multibox.html - name = 'business', - DATA = all_business, - show_empty = 1, - id_key = 'id', - label_key = 'description', - -%] - [% IF is_customer %]Kundentyp[% ELSE %]Lieferantentyp[%- END %] + [%- INCLUDE generic/multibox.html + name = 'business', + DATA = all_business, + show_empty = 1, + id_key = 'id', + label_key = 'description', + -%] + Sprache [%- INCLUDE generic/multibox.html @@ -207,7 +245,7 @@ label_key = 'description', -%] Verkäufer/in [%- INCLUDE generic/multibox.html diff --git a/templates/webpages/ct/form_header_master.html b/templates/webpages/ct/form_header_master.html index 43291e0b2..ffe9c6976 100644 --- a/templates/webpages/ct/form_header_master.html +++ b/templates/webpages/ct/form_header_master.html @@ -1,4 +1,5 @@ -[% USE HTML %][% USE LxERP %] +[% USE HTML %][% USE LxERP %] +
[% title %]
@@ -21,6 +22,32 @@ + [% IF conf_vertreter %] + + + + + + + + + [%- END %] [%- IF is_customer %] @@ -153,17 +180,28 @@ + [%- IF conf_vertreter %] + + + + + + + [%- END %] + - - + [% UNLESS conf_vertreter %] + + + [%- END %] - [%- IF is_customer %] + [%- IF is_customer && !use_vertreter %]
[% IF is_customer %]Type of Customer[%- ELSE %]Type of Vendor[%- END %] + [%- INCLUDE generic/multibox.html + name = 'business', + DATA = all_business, + show_empty = 1, + id_key = 'id', + label_key = 'description', + -%] +
Representative + [%- INCLUDE generic/multibox.html + name = 'salesman_id', + DATA = ALL_SALESMAN_BUSINESSES, + show_empty = 1, + id_key = 'id', + label_key = 'description', + -%] +
Customer Number
UsernamePassword
Type of Business - [%- INCLUDE generic/multibox.html - name = 'business', - DATA = all_business, - show_empty = 1, - id_key = 'id', - label_key = 'description', - -%] - [% IF is_customer %]Type of Customer[% ELSE %]Type of Vendor[%- END %] + [%- INCLUDE generic/multibox.html + name = 'business', + DATA = all_business, + show_empty = 1, + id_key = 'id', + label_key = 'description', + -%] + Language [%- INCLUDE generic/multibox.html @@ -207,7 +245,7 @@ label_key = 'description', -%] Salesman [%- INCLUDE generic/multibox.html -- 2.20.1