Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
authorBernd Blessmann <bibi@online.de>
Wed, 11 Jan 2012 10:39:24 +0000 (11:39 +0100)
committerBernd Blessmann <bibi@online.de>
Wed, 11 Jan 2012 10:39:24 +0000 (11:39 +0100)
SL/DATEV.pm
SL/WH.pm
bin/mozilla/wh.pl
config/lx_office.conf.default
locale/de/all
templates/webpages/ic/search.html
templates/webpages/wh/report_filter.html

index 7f38c88..cd04053 100644 (file)
@@ -426,10 +426,11 @@ sub _get_transactions {
         $ref->{is_tax} = 1;
       }
 
-      if (   !$ref->{invoice}
-          &&  $ref->{is_tax}
-          && !($prev_ref->{is_tax})
-          &&  (_sign($ref->{amount}) == _sign($prev_ref->{amount}))) {
+      if (   !$ref->{invoice}   # we have a non-invoice booking (=gl)
+          &&  $ref->{is_tax}    # that has "is_tax" set
+          && !($prev_ref->{is_tax})  # previous line wasn't is_tax
+          &&  (_sign($ref->{amount}) == _sign($prev_ref->{amount})))  # and sign same as previous sign
+          {
         $trans->[$i - 1]->{tax_amount} = $ref->{amount};
       }
     }
@@ -442,7 +443,10 @@ sub _get_transactions {
     }
 
     for my $j (0 .. (scalar(@{$trans}) - 1)) {
-      if (abs($trans->[$j]->{'amount'}) > abs($absumsatz)) {
+      # for gl-bookings no split is allowed and there is no AR/AP account, so we always use the maximum value as a reference
+      # for ap/ar bookings we can always search for AR/AP in link and use that
+      if ( ( not $trans->[$j]->{'invoice'} and abs($trans->[$j]->{'amount'}) > abs($absumsatz) )
+         or ($trans->[$j]->{'invoice'} and ($trans->[$j]->{'link'} eq 'AR' or $trans->[$j]->{'link'} eq 'AP'))) {
         $absumsatz     = $trans->[$j]->{'amount'};
         $notsplitindex = $j;
       }
index 352ca1a..f760f5e 100644 (file)
--- a/SL/WH.pm
+++ b/SL/WH.pm
@@ -620,6 +620,11 @@ sub get_warehouse_report {
     push @filter_vars, '%' . $filter{ean} . '%';
   }
 
+  if ($filter{date}) {
+    push @filter_ary, "i.itime <= ?";
+    push @filter_vars, $filter{date};
+  }
+
   # prepare qty comparison for later filtering
   my ($f_qty_op, $f_qty, $f_qty_base_unit);
 
index 2b49ba0..62be1d1 100644 (file)
@@ -824,7 +824,7 @@ sub generate_report {
   my @columns = qw(warehousedescription bindescription partnumber partdescription chargenumber bestbefore qty stock_value);
 
   # filter stuff
-  map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id partnumber description chargenumber bestbefore);
+  map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id partnumber description chargenumber bestbefore date);
 
   $filter{qty_op} = WH->convert_qty_op($form->{qty_op});
   if ($filter{qty_op}) {
index 5570baf..387eff2 100644 (file)
@@ -78,6 +78,14 @@ webdav = 0
 vertreter = 0
 
 # Show fields used for the best before date
+# ATTENTION! If you enabled this feature you can not simply turn it off again
+# without taking care that best_before fields are emptied in the database.
+# This can be done with the following query:
+#
+#  UPDATE inventory SET bestbefore = NULL;
+#
+# Any stock contents containing a best before date will be impossible to stock
+# out otherwise.
 show_best_before = 0
 
 ## Pictures for parts
index 6e5013b..9e3ba9e 100644 (file)
@@ -1407,7 +1407,7 @@ $self->{texts} = {
   'Proforma Invoice'            => 'Proformarechnung',
   'Program'                     => 'Programm',
   'Project'                     => 'Projekt',
-  'Project Description'         => '',
+  'Project Description'         => 'Projektbeschreibung',
   'Project Number'              => 'Projektnummer',
   'Project Number missing!'     => 'Projektnummer fehlt!',
   'Project Numbers'             => 'Projektnummern',
@@ -1655,6 +1655,7 @@ $self->{texts} = {
   'Step 3 of 3: Default units'  => 'Schritt 3 von 3: Standardeinheiten',
   'Steuersatz'                  => 'Steuersatz',
   'Stock'                       => 'Einlagern',
+  'Stock Qty for Date'          => 'Lagerbestand am',
   'Stock value'                 => 'Bestandswert',
   'Stocked Qty'                 => 'Lagermenge',
   'Storno'                      => 'Storno',
index ff9f0b7..c679f0f 100644 (file)
@@ -92,6 +92,8 @@
         <label for="itemstatus_obsolete">[% 'Obsolete' | $T8 %]</label>
         <input name="itemstatus" id="itemstatus_orphaned" class="radio" type="radio" value="orphaned">
         <label for="itemstatus_orphaned">[% 'Orphaned' | $T8 %]</label>
+        <input name="itemstatus" id="itemstatus_all" class="radio" type="radio" value="">
+        <label for="itemstatus_all">[% 'All' | $T8 %]</label>
        </td>
       </tr>
 
index affe4c2..a5cbe12 100644 (file)
@@ -1,4 +1,5 @@
 [%- USE T8 %]
+[%- USE L %]
 [% USE HTML %][% USE JavaScript %]<body onload="on_load();">
 
  <script type="text/javascript">
          </select>
         </td>
        </tr>
+        <th align="right" nowrap>[% 'Stock Qty for Date' | $T8 %]:</th>
+        <td>[% L.date_tag('date') %]</td>
+       <tr>
+       </tr>
       </table>
      </td>
     </tr>