Revision 662df9d7
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/DB/DeliveryOrder.pm | ||
---|---|---|
194 | 194 |
# - merge same descriptions |
195 | 195 |
# |
196 | 196 |
|
197 |
my $default_part_id = $params{default_part_id} ? $params{default_part_id} |
|
198 |
: $params{default_partnumber} ? SL::DB::Manager::Part->find_by(partnumber => $params{default_partnumber})->id |
|
199 |
: undef; |
|
197 |
my $default_part_id = $params{default_part_id} ? $params{default_part_id} |
|
198 |
: $params{default_partnumber} ? SL::DB::Manager::Part->find_by(partnumber => $params{default_partnumber})->id |
|
199 |
: undef; |
|
200 |
my $override_part_id = $params{override_part_id} ? $params{override_part_id} |
|
201 |
: $params{override_partnumber} ? SL::DB::Manager::Part->find_by(partnumber => $params{override_partnumber})->id |
|
202 |
: undef; |
|
200 | 203 |
|
201 | 204 |
# check parts and collect entries |
202 | 205 |
my %part_by_part_id; |
... | ... | |
204 | 207 |
foreach my $source (@$sources) { |
205 | 208 |
next if !$source->duration; |
206 | 209 |
|
207 |
my $part_id = $source->part_id ? $source->part_id
|
|
208 |
: $default_part_id ? $default_part_id
|
|
209 |
: undef;
|
|
210 |
my $part_id = $override_part_id;
|
|
211 |
$part_id ||= $source->part_id;
|
|
212 |
$part_id ||= $default_part_id;
|
|
210 | 213 |
|
211 | 214 |
die 'article not found for entry "' . $source->displayable_times . '"' if !$part_id; |
212 | 215 |
|
... | ... | |
434 | 437 |
given as C<$sources>. All time recording entries must belong to the same |
435 | 438 |
customer. Time recordings are sorted by article and date. For each article |
436 | 439 |
a new delivery order item is created. If no article is associated with an |
437 |
entry, a default article will be used. |
|
440 |
entry, a default article will be used. The article given in the time |
|
441 |
recording entry can be overriden. |
|
438 | 442 |
Entries of the same date (for each article) are summed together and form a |
439 | 443 |
list entry in the long description of the item. |
440 | 444 |
|
... | ... | |
451 | 455 |
An optional hash reference. If it exists then it is used to set |
452 | 456 |
attributes of the newly created delivery order object. |
453 | 457 |
|
458 |
=item C<default_part_id> |
|
459 |
|
|
460 |
An optional part id which is used as default value if no part is set |
|
461 |
in the time recording entry. |
|
462 |
|
|
463 |
=item C<default_partnumber> |
|
464 |
|
|
465 |
Like C<default_part_id> but given as partnumber, not as id. |
|
466 |
|
|
467 |
=item C<override_part_id> |
|
468 |
|
|
469 |
An optional part id which is used instead of a value set in the time |
|
470 |
recording entry. |
|
471 |
|
|
472 |
=item C<override_partnumber> |
|
473 |
|
|
474 |
Like C<overrride_part_id> but given as partnumber, not as id. |
|
475 |
|
|
454 | 476 |
=item C<related_order> |
455 | 477 |
|
456 | 478 |
An optional C<SL::DB::Order> object. If it exists then it is used to |
Auch abrufbar als: Unified diff
Zeiterfassung: Konvertierung: Artikel/Projekt: override- und default-Parameter