return;
};
+ my @trans_ids;
+
my $db = SL::DB::Inventory->new->db;
$db->do_transaction(sub{
while (my $transfer = shift @args) {
);
if ($unit) {
- $qty *= $unit->factor || 1;
- $qty /= $part->unit_obj->factor || 1 if $part->unit;
+ $qty = $unit->convert_to($qty, $part->unit_obj);
}
+ $params{chargenumber} ||= '';
+
if ($direction & 1) {
SL::DB::Inventory->new(
%params,
qty => $qty,
)->save;
}
+
+ push @trans_ids, $trans_id;
}
}) or do {
$::form->error("Warehouse transfer error: " . join("\n", (split(/\n/, $db->error))[0..2]));
};
$::lxdebug->leave_sub;
+
+ return @trans_ids;
}
sub transfer_assembly {
push @filter_vars, '%' . $filter{ean} . '%';
}
+ if ($filter{date}) {
+ push @filter_ary, "i.itime <= ?";
+ push @filter_vars, $filter{date};
+ }
+ if (!$filter{include_invalid_warehouses}){
+ push @filter_ary, "NOT (w.invalid)";
+ }
+
# prepare qty comparison for later filtering
my ($f_qty_op, $f_qty, $f_qty_base_unit);
=head1 BUGS
+None yet.
+
=head1 AUTHOR
=cut