]> wagnertech.de Git - kivitendo-erp.git/commitdiff
"Vertreter"-Feature in Kunden-/Lieferantenstammdaten wieder eingebaut
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 3 Mar 2010 15:49:07 +0000 (16:49 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 3 Mar 2010 15:49:07 +0000 (16:49 +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 71538515474d9b80f7cd6fa9e55b6463d6bd9c27..7e5a443fec4a28815bae06b1863303b1195e5526 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 b0f72b43a9d9b876f925ebc25b3d4f12b0d02363..0130a464bbb6239ab1ef7f3207428779fd80a408 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 12b937f61fd56b80d5d976dfd6bf5770ee47ad85..6e59564004db9609b6a231608c6304cfe2ed92cb 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 7970a39fc8b68dc4986449ef64d0a4c2b6931acc..4faa7a487b0e1b29ac7cbbcfbcc4ff0ac08a29f1 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 528697cb4f8669ea540bd254ef0f28fc84d0ad9c..eef7703dfe6ea8e3a6fc18719c14d7dfb477c40d 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 e207cec17f0fc902403d0808600b435062551e11..4bfb78a07f4b719df365aa27631abdcabd8b9101 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 79e3991bc0f14d297cc97b584c1870543b13067e..32cba46985b09f9d46363e977f78ca0872c91c5b 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 b7b80b4c0943e51958f95e79aa8a7025fbd3d08b..3d0b94ab4eaabc25f64c75452c38e651c1e44d90 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 befc780f836769030ee747e1e7cda9af0ef6a640..f5ac0c76e7c24911dc5819704382f86e0a7c5284 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 782d0a8ba9386e6f9b5cc0922c67d86ec4531df1..ab13646c5b57a66590bd05bd3b5811a37a4e9d2f 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 003ffe00bd829114cf96c06b4275840c83cc8e18..8e37a069a64fdc4b29773ae891b42cdd37ccc47a 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 dc1299e91683c049c83e6fbccd06e3a75aafd76c..5a1ce5ad502039967feb20bae8cdceab9625cf40 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 a435449f869f4dd1ef65e248a824f69771c128cc..7ba33321c6ef0d66721cb967c759c9966401e505 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 43291e0b282736eb86d7778c76849fafcb3c15b5..ffe9c6976a181bdf94c78a052e2e51cf09343088 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