Revision 577277a3
Von Kivitendo Admin vor mehr als 7 Jahren hinzugefügt
SL/Helper/ShippedQty.pm | ||
---|---|---|
346 | 346 |
|
347 | 347 |
=head1 MOTIVATION AND PROBLEMS |
348 | 348 |
|
349 |
The concept of shipped qty is sadly not as straight forward as it sounds on
|
|
349 |
The concept of shipped qty is sadly not as straight forward as it sounds at
|
|
350 | 350 |
first glance. Any correct implementation must in some way deal with the |
351 | 351 |
following problems. |
352 | 352 |
|
... | ... | |
363 | 363 |
How to find the correct matching elements. After the changes |
364 | 364 |
to record item links it's natural to assume that each position is linked, but |
365 | 365 |
for various reasons this might not be the case. Positions that are not linked |
366 |
in database need to be matched by marching. |
|
366 |
in the database need to be matched by marching.
|
|
367 | 367 |
|
368 | 368 |
=item * |
369 | 369 |
|
... | ... | |
384 | 384 |
|
385 | 385 |
=item * |
386 | 386 |
|
387 |
Certain delivery orders might not be eligable for qty calculations if delivery
|
|
387 |
Certain delivery orders might not be eligible for qty calculations if delivery
|
|
388 | 388 |
orders are used for other purposes. |
389 | 389 |
|
390 | 390 |
=item * |
... | ... | |
481 | 481 |
|
482 | 482 |
=item C<delivered> |
483 | 483 |
|
484 |
Valid after L</calculate>. Returns a hasref with delivered flag by order id.
|
|
484 |
Valid after L</calculate>. Returns a hashref with a delivered flag by order id.
|
|
485 | 485 |
|
486 | 486 |
=back |
487 | 487 |
|
... | ... | |
494 | 494 |
detailed information is needed. |
495 | 495 |
|
496 | 496 |
This is to be integrated into fast delivered check on the orders. The calling |
497 |
convention for the delivery_order is not scope of this module. |
|
497 |
convention for the delivery_order is not part of the scope of this module.
|
|
498 | 498 |
|
499 | 499 |
=head2 do_mode |
500 | 500 |
|
501 | 501 |
Originally used for printing delivery orders. Resolves for each position for |
502 |
much was originally ordered, and how much remains undelivered. |
|
502 |
how much was originally ordered, and how much remains undelivered.
|
|
503 | 503 |
|
504 |
This one is likely to be dropped. The information makes only sense without
|
|
504 |
This one is likely to be dropped. The information only makes sense without
|
|
505 | 505 |
combined merge/split deliveries and is very fragile with unaccounted delivery |
506 | 506 |
orders. |
507 | 507 |
|
508 | 508 |
=head2 oe mode |
509 | 509 |
|
510 |
Same from order perspective. Used for transitions to delivery orders, where |
|
510 |
Same from the order perspective. Used for transitions to delivery orders, where
|
|
511 | 511 |
delivered qtys should be removed from positions. Also used each time a record |
512 | 512 |
is rendered to show the shipped qtys. Also used to find orders that are not |
513 | 513 |
fully delivered. |
... | ... | |
670 | 670 |
|
671 | 671 |
=head1 COMPLEXITY OBSERVATIONS |
672 | 672 |
|
673 |
Perl ops except sort are expected to be constant (relative to the op overhead). |
|
673 |
Perl ops except for sort are expected to be constant (relative to the op overhead).
|
|
674 | 674 |
|
675 | 675 |
=head2 Record item links |
676 | 676 |
|
677 | 677 |
The query itself has indices available for all joins and filters and should |
678 |
scale with sublinear with number of affected orderitems. |
|
678 |
scale with sublinear with the number of affected orderitems.
|
|
679 | 679 |
|
680 |
The rest of the code iterates through the result and call C<AM::convert_unit>, |
|
680 |
The rest of the code iterates through the result and calls C<AM::convert_unit>,
|
|
681 | 681 |
which caches internally and is asymptotically constant. |
682 | 682 |
|
683 | 683 |
=head2 Fill up |
... | ... | |
694 | 694 |
elements in the multimap, and does not add additional complexity. |
695 | 695 |
|
696 | 696 |
The sort and parallel walk are O(nlogn) for the length of the subdivisions, |
697 |
whioch again makes square worst case, but much less than that in the general
|
|
697 |
which again makes square worst case, but much less than that in the general |
|
698 | 698 |
case. |
699 | 699 |
|
700 | 700 |
=head3 Space requirements |
Auch abrufbar als: Unified diff
ShippedQty - fixed some typos in documentation