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}) {
$h_item->finish();
$h_item_stock->finish();
- ($null, $form->{department_id}) = split(/--/, $form->{department});
# save DO record
$query =
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();
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";
$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();
- 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
+
[%- 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 %]