$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};
}
}
}
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;
}
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);
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}) {
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
'Proforma Invoice' => 'Proformarechnung',
'Program' => 'Programm',
'Project' => 'Projekt',
- 'Project Description' => '',
+ 'Project Description' => 'Projektbeschreibung',
'Project Number' => 'Projektnummer',
'Project Number missing!' => 'Projektnummer fehlt!',
'Project Numbers' => 'Projektnummern',
'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',
<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>
[%- 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>