Merge branch 'master' of ssh://git-mbunkus@lx-office.linet-services.de/~/lx-office-erp
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 3 Mar 2010 16:11:55 +0000 (17:11 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 3 Mar 2010 16:11:55 +0000 (17:11 +0100)
14 files changed:
SL/Form.pm
bin/mozilla/ct.pl
locale/de/all
locale/de/dn
locale/de/do
locale/de/ic
locale/de/io
locale/de/ir
locale/de/is
locale/de/login
locale/de/oe
locale/de/todo
templates/webpages/ct/form_header_de.html
templates/webpages/ct/form_header_master.html

index f32802c..e020724 100644 (file)
@@ -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();
 }
index b0f72b4..0130a46 100644 (file)
@@ -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};
index 12b937f..6e59564 100644 (file)
@@ -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<br>this group'      => 'Benutzer in<br>dieser Gruppe',
   'Users not in this group'     => 'Benutzer nicht in dieser Gruppe',
   'Ust-IDNr'                    => 'USt-IdNr.',
index 7970a39..4faa7a4 100644 (file)
@@ -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',
index 528697c..eef7703 100644 (file)
@@ -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',
index e207cec..4bfb78a 100644 (file)
@@ -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',
index 79e3991..32cba46 100644 (file)
@@ -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',
index b7b80b4..3d0b94a 100644 (file)
@@ -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',
index befc780..f5ac0c7 100644 (file)
@@ -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',
index 782d0a8..ab13646 100644 (file)
@@ -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',
index 003ffe0..8e37a06 100644 (file)
@@ -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',
index dc1299e..5a1ce5a 100644 (file)
@@ -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',
index a435449..7ba3332 100644 (file)
@@ -1,4 +1,5 @@
-[% USE HTML %][% USE LxERP %]<body onLoad="fokus()">
+[% USE HTML %][% USE LxERP %]
+<body onLoad="fokus()">
 
  <div class="listtop">[% title %]</div>
 
 
     <table width="100%">
      <tr height="5"></tr>
+     [% IF conf_vertreter %]
+      <tr>
+       <th align="right">[% IF is_customer %]Kundentyp[%- ELSE %]Lieferantentyp[%- END %]</th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name       = 'business',
+              DATA       = all_business,
+              show_empty = 1,
+              id_key     = 'id',
+              label_key  = 'description',
+        -%]
+       </td>
+      </tr>
+      <tr>
+       <th align="right">Vertreter</th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name       = 'salesman_id',
+              DATA       = ALL_SALESMAN_BUSINESSES,
+              show_empty = 1,
+              id_key     = 'id',
+              label_key  = 'description',
+        -%]
+       </td>
+      </tr>
+     [%- END %]
      <tr>
       [%- IF is_customer %]
       <th align="right" nowrap>Kundennummer</th>
       <td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
      </tr>
 
+     [%- IF conf_vertreter %]
+      <tr>
+            <th align="right">Benutzername</th>
+            <td><input name="username" maxlength="50" value="[% HTML.escape(username) %]"></td>
+            <th align="right">Passwort</th>
+            <td><input name="user_password" value="[% HTML.escape(user_password) %]"></td>
+      </tr>
+     [%- END %]
+
      <tr>
-      <th align="right">Kunden-/Lieferantentyp</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'business',
-             DATA       = all_business,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
+      [% UNLESS conf_vertreter %]
+       <th align="right">[% IF is_customer %]Kundentyp[% ELSE %]Lieferantentyp[%- END %]</th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name       = 'business',
+              DATA       = all_business,
+              show_empty = 1,
+              id_key     = 'id',
+              label_key  = 'description',
+        -%]
+       </td>
+      [%- END %]
       <th align="right">Sprache</th>
       <td>
        [%- INCLUDE generic/multibox.html
              label_key  = 'description',
        -%]
       </td>
-      [%- IF is_customer %]
+      [%- IF is_customer && !use_vertreter %]
       <th align="right">Verkäufer/in</th>
       <td>
        [%- INCLUDE generic/multibox.html
index 43291e0..ffe9c69 100644 (file)
@@ -1,4 +1,5 @@
-[% USE HTML %][% USE LxERP %]<body onLoad="fokus()">
+[% USE HTML %][% USE LxERP %]
+<body onLoad="fokus()">
 
  <div class="listtop">[% title %]</div>
 
 
     <table width="100%">
      <tr height="5"></tr>
+     [% IF conf_vertreter %]
+      <tr>
+       <th align="right">[% IF is_customer %]<translate>Type of Customer</translate>[%- ELSE %]<translate>Type of Vendor</translate>[%- END %]</th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name       = 'business',
+              DATA       = all_business,
+              show_empty = 1,
+              id_key     = 'id',
+              label_key  = 'description',
+        -%]
+       </td>
+      </tr>
+      <tr>
+       <th align="right"><translate>Representative</translate></th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name       = 'salesman_id',
+              DATA       = ALL_SALESMAN_BUSINESSES,
+              show_empty = 1,
+              id_key     = 'id',
+              label_key  = 'description',
+        -%]
+       </td>
+      </tr>
+     [%- END %]
      <tr>
       [%- IF is_customer %]
       <th align="right" nowrap><translate>Customer Number</translate></th>
       <td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
      </tr>
 
+     [%- IF conf_vertreter %]
+      <tr>
+            <th align="right"><translate>Username</translate></th>
+            <td><input name="username" maxlength="50" value="[% HTML.escape(username) %]"></td>
+            <th align="right"><translate>Password</translate></th>
+            <td><input name="user_password" value="[% HTML.escape(user_password) %]"></td>
+      </tr>
+     [%- END %]
+
      <tr>
-      <th align="right"><translate>Type of Business</translate></th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'business',
-             DATA       = all_business,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
+      [% UNLESS conf_vertreter %]
+       <th align="right">[% IF is_customer %]<translate>Type of Customer</translate>[% ELSE %]<translate>Type of Vendor</translate>[%- END %]</th>
+       <td>
+        [%- INCLUDE generic/multibox.html
+              name       = 'business',
+              DATA       = all_business,
+              show_empty = 1,
+              id_key     = 'id',
+              label_key  = 'description',
+        -%]
+       </td>
+      [%- END %]
       <th align="right"><translate>Language</translate></th>
       <td>
        [%- INCLUDE generic/multibox.html
              label_key  = 'description',
        -%]
       </td>
-      [%- IF is_customer %]
+      [%- IF is_customer && !use_vertreter %]
       <th align="right"><translate>Salesman</translate></th>
       <td>
        [%- INCLUDE generic/multibox.html