Nur Erzeugnisse anzeigen beim Klick auf das Fragezeichen bei Erzeugnis fertigen ...
[kivitendo-erp.git] / bin / mozilla / io.pl
index a0f9288..c2f789a 100644 (file)
@@ -4,7 +4,10 @@
 # Based on SQL-Ledger Version 2.1.9
 # Web http://www.lx-office.org
 #############################################################################
-# Veraendert 2005-01-05 - Marco Welter <mawe@linux-studio.de> - Neue Optik  #
+# Changelog: Wann - Wer - Was
+# Veraendert 2005-01-05 - Marco Welter <mawe@linux-studio.de> - Neue Optik                     
+# 08.11.2008 - information@richardson-bueren.de jb  - Backport von Revision 7339 xplace - E-Mail-Vorlage automatisch auswählen  
+# 02.02.2009 - information@richardson-bueren.de jb - Backport von Revision 8535 xplace - Erweiterung der Waren bei Lieferantenauftrag um den Eintrag Mindestlagerbestand. Offen: Auswahlliste auf Lieferantenaufträge einschränken -> Erledigt 2.2.09 Prüfung wie das Skript heisst (oe.pl) -> das ist nur die halbe Miete, nochmal mb fragen -> mb gefragt und es gibt die variable is_purchase
 #############################################################################
 # SQL-Ledger, Accounting
 # Copyright (c) 1998-2002
@@ -287,7 +290,12 @@ sub display_row {
     $column_data{bin}         = $form->{"bin_$i"};
 
     if ($is_delivery_order) {
-      $column_data{stock_in_out} = (!$form->{"assembly_$i"} && $form->{"inventory_accno_$i"}) ? calculate_stock_in_out($i) : '&nbsp;';
+      # $column_data{stock_in_out} =  $form->{"inventory_accno_$i"} ? calculate_stock_in_out($i) : '&nbsp;';
+      # $main::lxdebug->dump(0, "debug", $form->{"inventory_accno_$i"});
+      # meine debug-analyse war negativ (s.o.) - die variable war weder bei dienstleistung, erzeugnis noch ware gefüllt.
+      # bitte korrigieren, falls ich hier falsch liege. jb 19.3.2009
+
+      $column_data{stock_in_out} =  calculate_stock_in_out($i);
     }
 
     my @ROW1 = map { value => $column_data{$_}, align => $align{$_}, nowrap => $nowrap{$_} }, @column_index;
@@ -395,10 +403,11 @@ sub set_pricegroup {
 
 sub select_item {
   $lxdebug->enter_sub();
-
+# diese variable kommt schon in der methode display_row vor, kann man die besser wiederverwenden? @mb fragen.  ich check das jetzt erstmal so ein
+  my $is_purchase        = (first { $_ eq $form->{type} } qw(request_quotation purchase_order purchase_delivery_order)) || ($form->{script} eq 'ir.pl');
   _check_io_auth();
 
-  @column_index = qw(ndx partnumber description onhand unit sellprice);
+  @column_index = qw(ndx partnumber description rop onhand unit sellprice);
 
   $column_data{ndx}        = qq|<th>&nbsp;</th>|;
   $column_data{partnumber} =
@@ -407,6 +416,10 @@ sub select_item {
     qq|<th class="listheading">| . $locale->text('Part Description') . qq|</th>|;
   $column_data{sellprice} =
     qq|<th class="listheading">| . $locale->text('Price') . qq|</th>|;
+    if ($is_purchase){ 
+      $column_data{rop} =
+      qq|<th class="listheading">| . $locale->text('ROP') . qq|</th>|;
+    }# ende if $is_purchase -> Überschrift Mindestlagerbestand - ähnliche Prüfung weiter unten
   $column_data{onhand} =
     qq|<th class="listheading">| . $locale->text('Qty') . qq|</th>|;
   $column_data{unit} =
@@ -469,6 +482,12 @@ sub select_item {
       qq|<td align="right"><input name="new_onhand_$i" type="hidden" value="$ref->{onhand}">|
       . $form->format_amount(\%myconfig, $ref->{onhand}, '', "&nbsp;")
       . qq|</td>|;
+    if ($is_purchase){ 
+    $column_data{rop} =
+      qq|<td align="right"><input name="new_rop$i" type="hidden" value="$ref->{rop}">|
+      . $form->format_amount(\%myconfig, $ref->{rop}, '', "&nbsp;")
+      . qq|</td>|;
+    }# ende if $is_purchase -> Falls der Aufruf über eine Einkaufsmaske kam, handelt es sich um einen Lieferantenauftrag und uns interessiert auch die Mindestbestandsmenge
     $column_data{unit} =
       qq|<td>$ref->{unit}</td>|;
     $j++;
@@ -1486,10 +1505,8 @@ sub print_form {
   delete $form->{OUT};
 
   if ($form->{media} eq 'printer') {
-    print (STDERR "io--------------------------------------");
-    print (STDERR  $form->{printer_command});
-    #$form->{OUT} = "| $form->{printer_command} ";
-    $form->{OUT} = "| $form->{printer_command} &>/dev/null";
+    #$form->{OUT} = "| $form->{printer_command} &>/dev/null";
+    $form->{OUT} = "| $form->{printer_command} ";
     $form->{printed} .= " $form->{formname}";
     $form->{printed} =~ s/^ //;
   }