Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 10 Jan 2012 15:25:08 +0000 (16:25 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 10 Jan 2012 15:25:08 +0000 (16:25 +0100)
SL/DO.pm
SL/Form.pm
bin/mozilla/do.pl
doc/changelog
templates/webpages/do/form_header.html

index 8e41361..8d61b0f 100644 (file)
--- a/SL/DO.pm
+++ b/SL/DO.pm
@@ -76,10 +76,9 @@ sub transactions {
 
   push @where, ($form->{type} eq 'sales_delivery_order' ? '' : 'NOT ') . qq|COALESCE(dord.is_sales, FALSE)|;
 
-  my $department_id = (split /--/, $form->{department})[1];
-  if ($department_id) {
+  if ($form->{department_id}) {
     push @where,  qq|dord.department_id = ?|;
-    push @values, conv_i($department_id);
+    push @values, conv_i($form->{department_id});
   }
 
   if ($form->{project_id}) {
@@ -327,7 +326,6 @@ sub save {
   $h_item->finish();
   $h_item_stock->finish();
 
-  ($null, $form->{department_id}) = split(/--/, $form->{department});
 
   # save DO record
   $query =
index 529426e..d537d28 100644 (file)
@@ -2512,7 +2512,7 @@ sub get_name {
   return scalar(@{ $self->{name_list} });
 }
 
-# the selection sub is used in the AR, AP, IS, IR and OE module
+# the selection sub is used in the AR, AP, IS, IR, DO and OE module
 #
 sub all_vc {
   $main::lxdebug->enter_sub();
index 9e70935..17b9fcc 100644 (file)
@@ -40,7 +40,6 @@ use SL::IR;
 use SL::IS;
 use SL::ReportGenerator;
 use SL::WH;
-
 require "bin/mozilla/arap.pl";
 require "bin/mozilla/common.pl";
 require "bin/mozilla/invoice_io.pl";
@@ -302,8 +301,17 @@ sub form_header {
 
   $form->header();
   # Fix für Bug 1082 Erwartet wird: 'abteilungsNAME--abteilungsID'
-  $form->{department} .= '--' . $form->{department_id};
-
+  # und Erweiterung für Bug 1760:
+  # Das war leider nur ein Teil-Fix, da das Verhalten den 'Erneuern'-Knopf
+  # nicht überlebt. Konsequent jetzt auf L umgestellt 
+  #   $ perldoc SL::Template::Plugin::L
+  # Daher entsprechend nur die Anpassung in form_header
+  # und in DO.pm gemacht. 4 Testfälle:
+  # department_id speichern                 | i.O.
+  # department_id lesen                     | i.O.
+  # department leer überlebt erneuern       | i.O.
+  # department nicht leer überlebt erneuern | i.O.
+  # $main::lxdebug->message(0, 'ABTEILUNGS ID in form?' . $form->{department_id});
   print $form->parse_html_template('do/form_header');
 
   $main::lxdebug->leave_sub();
index 479c59e..4c2d8d2 100644 (file)
@@ -83,6 +83,8 @@
   - Bugfix 1566: Variablen für Verkäufer und USTID in Mahnungsdruck hinzugefügt
   - Bugfix 1588: Einzelteile eines Erzeugnisses von Verkaufsbericht ausnehmen
   - Bugfix 1756: Ertrag in Bruttorechnungen korrekt berechnen
+  - Bugfix 1760 - 1760: Bei einem Lieferschein wird die Abteilung nicht mitgespeichert
+
 
 
 
index a83a2b9..b41ea72 100644 (file)
@@ -1,5 +1,8 @@
 [%- USE T8 %]
-[% USE HTML %][% USE LxERP %]<body onload="on_load()">
+[%- USE HTML %]
+[%- USE LxERP %]
+[%- USE L %]
+<body onload="on_load()">
 
  <script type="text/javascript" src="js/show_form_details.js"></script>
  <script type="text/javascript" src="js/show_history.js"></script>
        <tr>
         <th align="right" nowrap>[% 'Department' | $T8 %]</th>
         <td colspan="3">
-         [%- IF delivered %]
-         <input type="hidden" name="department" value="[% HTML.escape(department) %]">
-         [%- FOREACH row = ALL_DEPARTMENTS %]
-         [% IF department == row.value %][% HTML.escape(row.description) %]--[% HTML.escape(row.id) %][% END %]
-         [%- END %]
-         [%- ELSE %]
-         <select name="department" class="fixed_width">
-          <option></option>
-          [%- FOREACH row = ALL_DEPARTMENTS %]
-          <option[% IF department == row.value %] selected[% END %]>[% HTML.escape(row.description) %]--[% HTML.escape(row.id) %]</option>
-          [%- END %]
-         </select>
-         [%- END %]
-        </td>
+         [% L.select_tag('department_id', L.options_for_select(ALL_DEPARTMENTS, default=department_id, title="description", with_empty=1), style='width: 250px', disabled => delivered )%]
+       </td>
        </tr>
        [%- END %]