209 |
209 |
bestbefore => $chunk->{bestbefore},
|
210 |
210 |
reserve_for_id => $chunk->{reserve_for_id},
|
211 |
211 |
reserve_for_table => $chunk->{reserve_for_table},
|
212 |
|
oe_id => undef,
|
|
212 |
for_object_id => undef,
|
213 |
213 |
);
|
214 |
214 |
$rest_qty -= _round_qty($qty);
|
215 |
215 |
}
|
... | ... | |
323 |
323 |
my $bin = $params{bin} or Carp::croak("need target bin");
|
324 |
324 |
my $chargenumber = $params{chargenumber};
|
325 |
325 |
my $bestbefore = $params{bestbefore};
|
326 |
|
my $oe_id = $params{oe_id};
|
|
326 |
my $for_object_id = $params{for_object_id};
|
327 |
327 |
my $comment = $params{comment} // '';
|
328 |
328 |
|
329 |
329 |
my $production_order_item = $params{production_order_item};
|
... | ... | |
354 |
354 |
|
355 |
355 |
my @transfers;
|
356 |
356 |
for my $allocation (@$allocations) {
|
|
357 |
my $oe_id = delete $allocation->{for_object_id};
|
357 |
358 |
push @transfers, SL::DB::Inventory->new(
|
358 |
359 |
trans_id => $trans_id,
|
359 |
360 |
%$allocation,
|
... | ... | |
361 |
362 |
trans_type => $trans_type_out,
|
362 |
363 |
shippingdate => $shippingdate,
|
363 |
364 |
employee => SL::DB::Manager::Employee->current,
|
364 |
|
oe_id => $allocation->oe_id,
|
|
365 |
oe_id => $allocation->for_object_id,
|
365 |
366 |
);
|
366 |
367 |
}
|
367 |
368 |
|
... | ... | |
382 |
383 |
comment => $comment,
|
383 |
384 |
prod => $production_order_item,
|
384 |
385 |
employee => SL::DB::Manager::Employee->current,
|
385 |
|
oe_id => $oe_id,
|
|
386 |
oe_id => $for_object_id,
|
386 |
387 |
);
|
387 |
388 |
|
388 |
389 |
SL::DB->client->with_transaction(sub {
|
... | ... | |
396 |
397 |
}
|
397 |
398 |
|
398 |
399 |
package SL::Helper::Inventory::Allocation {
|
399 |
|
my @attributes = qw(parts_id qty bin_id warehouse_id chargenumber bestbefore comment reserve_for_id reserve_for_table oe_id);
|
|
400 |
my @attributes = qw(parts_id qty bin_id warehouse_id chargenumber bestbefore comment reserve_for_id reserve_for_table for_object_id);
|
400 |
401 |
my %attributes = map { $_ => 1 } @attributes;
|
401 |
402 |
|
402 |
403 |
for my $name (@attributes) {
|
... | ... | |
478 |
479 |
bestbefore => undef,
|
479 |
480 |
reserve_for_id => undef,
|
480 |
481 |
reserve_for_table => undef,
|
481 |
|
oe_id => $my_document,
|
|
482 |
for_object_id => $order->id,
|
482 |
483 |
);
|
483 |
484 |
|
484 |
485 |
# produce_assembly:
|
... | ... | |
766 |
767 |
|
767 |
768 |
=item * reserve_for_table
|
768 |
769 |
|
769 |
|
=item * oe_id
|
|
770 |
=item * for_object_id
|
770 |
771 |
|
771 |
|
Must be explicit set if the allocation needs also an (other) document.
|
|
772 |
If set the allocations will be marked as allocated for the given object.
|
|
773 |
If these allocations are later used to produce an assembly, the resulting
|
|
774 |
consuming transactions will be marked as belonging to the given object.
|
|
775 |
The object may be an order, productionorder or other objects
|
772 |
776 |
|
773 |
777 |
=back
|
774 |
778 |
|
775 |
|
C<chargenumber>, C<bestbefore>, C<reserve_for_id>, C<reserve_for_table> and oe_id may
|
776 |
|
be C<undef> (but must still be present at creation time). Instances are
|
777 |
|
considered immutable.
|
|
779 |
C<chargenumber>, C<bestbefore>, C<reserve_for_id>, C<reserve_for_table> and
|
|
780 |
C<for_object_id> may be C<undef> (but must still be present at creation time).
|
|
781 |
Instances are considered immutable.
|
778 |
782 |
|
779 |
783 |
|
780 |
784 |
=head1 CONSTRAINTS
|
Inventory: Parameter oe_id in for_object_id umbenannt und besser dokumentiert