Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 003e290c

Von Sven Schöling vor etwa 4 Jahren hinzugefügt

  • ID 003e290ce67f1946ce9084a88b2e3380940d90c1
  • Vorgänger acf478a3
  • Nachfolger 15176cbb

Inventory: Doku update. Funktionen statt Klassenmthoden

Unterschiede anzeigen:

SL/Helper/Inventory.pm
429 429

  
430 430
  # See description for an intro to the concepts used here.
431 431

  
432
  use SL::Helper::Inventory;
432
  use SL::Helper::Inventory qw(:ALL);
433 433

  
434 434
  # stock, get "what's there" for a part with various conditions:
435
  my $qty = SL::Helper::Inventory->get_stock(part => $part);                              # how much is on stock?
436
  my $qty = SL::Helper::Inventory->get_stock(part => $part, date => $date);               # how much was on stock at a specific time?
437
  my $qty = SL::Helper::Inventory->get_stock(part => $part, bin => $bin);                 # how is on stock in a specific bin?
438
  my $qty = SL::Helper::Inventory->get_stock(part => $part, warehouse => $warehouse);     # how is on stock in a specific warehouse?
439
  my $qty = SL::Helper::Inventory->get_stock(part => $part, chargenumber => $chargenumber); # how is on stock of a specific chargenumber?
435
  my $qty = get_stock(part => $part);                              # how much is on stock?
436
  my $qty = get_stock(part => $part, date => $date);               # how much was on stock at a specific time?
437
  my $qty = get_stock(part => $part, bin => $bin);                 # how is on stock in a specific bin?
438
  my $qty = get_stock(part => $part, warehouse => $warehouse);     # how is on stock in a specific warehouse?
439
  my $qty = get_stock(part => $part, chargenumber => $chargenumber); # how is on stock of a specific chargenumber?
440 440

  
441 441
  # onhand, get "what's available" for a part with various conditions:
442
  my $qty = SL::Helper::Inventory->get_onhand(part => $part);                              # how much is available?
443
  my $qty = SL::Helper::Inventory->get_onhand(part => $part, date => $date);               # how much was available at a specific time?
444
  my $qty = SL::Helper::Inventory->get_onhand(part => $part, bin => $bin);                 # how much is available in a specific bin?
445
  my $qty = SL::Helper::Inventory->get_onhand(part => $part, warehouse => $warehouse);     # how much is available in a specific warehouse?
446
  my $qty = SL::Helper::Inventory->get_onhand(part => $part, chargenumber => $chargenumber); # how much is availbale of a specific chargenumber?
447
  my $qty = SL::Helper::Inventory->get_onhand(part => $part, reserve_for => $order);       # how much is available if you include this reservation?
442
  my $qty = get_onhand(part => $part);                              # how much is available?
443
  my $qty = get_onhand(part => $part, date => $date);               # how much was available at a specific time?
444
  my $qty = get_onhand(part => $part, bin => $bin);                 # how much is available in a specific bin?
445
  my $qty = get_onhand(part => $part, warehouse => $warehouse);     # how much is available in a specific warehouse?
446
  my $qty = get_onhand(part => $part, chargenumber => $chargenumber); # how much is availbale of a specific chargenumber?
447
  my $qty = get_onhand(part => $part, reserve_for => $order);       # how much is available if you include this reservation?
448 448

  
449 449
  # onhand batch mode:
450
  my $data = SL::Helper::Inventory->get_onhand(
450
  my $data = get_onhand(
451 451
    warehouse    => $warehouse,
452 452
    by           => [ qw(bin part chargenumber reserve_for) ],
453 453
    with_objects => [ qw(bin part) ],
454 454
  );
455 455

  
456 456
  # allocate:
457
  my @allocations, SL::Helper::Inventory->allocate(
457
  my @allocations, allocate(
458 458
    part         => $part,          # part_id works too
459 459
    qty          => $qty,           # must be positive
460 460
    chargenumber => $chargenumber,  # optional, may be arrayref. if provided these charges will be used first
......
464 464
  );
465 465

  
466 466
  # shortcut to allocate all that is needed for producing an assembly, will use chargenumbers as appropriate
467
  my @allocations, SL::Helper::Inventory->allocate_for_assembly(
467
  my @allocations, allocate_for_assembly(
468 468
    part         => $assembly,      # part_id works too
469 469
    qty          => $qty,           # must be positive
470 470
  );
......
483 483
  );
484 484

  
485 485
  # produce_assembly:
486
  SL::Helper::Inventory->produce_assembly(
486
  produce_assembly(
487 487
    part         => $part,           # target assembly
488 488
    qty          => $qty,            # qty
489 489
    allocations  => \@allocations,   # allocations to use. alternatively use "auto_allocate => 1,"

Auch abrufbar als: Unified diff