Revision 70edaa5f
Von Kivitendo Admin vor fast 8 Jahren hinzugefügt
SL/Controller/Inventory.pm | ||
---|---|---|
70 | 70 |
|
71 | 71 |
sub getnumcolumns { |
72 | 72 |
my ($self) = @_; |
73 |
return qw(stock incorrection found insum back outcorrection disposed
|
|
73 |
return qw(stock incorrection found insum back outcorrection disposed |
|
74 | 74 |
missing shipped used outsum consumed averconsumed); |
75 | 75 |
} |
76 | 76 |
|
... | ... | |
92 | 92 |
|
93 | 93 |
push @columns , qw(ptype unit) if $form->{report_generator_output_format} eq 'HTML'; |
94 | 94 |
|
95 |
my @numcolumns = qw(stock incorrection found insum back outcorrection disposed
|
|
95 |
my @numcolumns = qw(stock incorrection found insum back outcorrection disposed |
|
96 | 96 |
missing shipped used outsum consumed averconsumed); |
97 | 97 |
|
98 | 98 |
push @columns , $self->getnumcolumns(); |
99 | 99 |
|
100 |
my @hidden_variables = qw(reporttype year duetyp fromdate todate
|
|
100 |
my @hidden_variables = qw(reporttype year duetyp fromdate todate |
|
101 | 101 |
warehouse_id bin_id partnumber description bestbefore chargenumber partstypes_id); |
102 | 102 |
my %column_defs = ( |
103 | 103 |
'partnumber' => { 'text' => $locale->text('Part Number'), }, |
... | ... | |
126 | 126 |
my @custom_headers = (); |
127 | 127 |
# Zeile 1: |
128 | 128 |
push @custom_headers, [ |
129 |
{ 'text' => $locale->text('Part'),
|
|
129 |
{ 'text' => $locale->text('Part'), |
|
130 | 130 |
'colspan' => ($form->{report_generator_output_format} eq 'HTML'?4:2), 'align' => 'center'}, |
131 | 131 |
{ 'text' => $locale->text('Into bin'), 'colspan' => 4, 'align' => 'center'}, |
132 | 132 |
{ 'text' => $locale->text('From bin'), 'colspan' => 7, 'align' => 'center'}, |
... | ... | |
250 | 250 |
$end->set_second(59); |
251 | 251 |
$end->set_minute(59); |
252 | 252 |
$end->set_hour(23); |
253 |
if ( $end->epoch() > $actualepoch ) {
|
|
253 |
if ( $end->epoch() > $actualepoch ) { |
|
254 | 254 |
$end = DateTime->now_local; |
255 | 255 |
my $dur = $start->delta_md($end); |
256 | 256 |
$days = $dur->delta_months()*30 + $dur->delta_days() ; |
... | ... | |
317 | 317 |
$report->add_data($last_row); |
318 | 318 |
} |
319 | 319 |
$row_ind++ ; |
320 |
}
|
|
320 |
} |
|
321 | 321 |
$last_partid = $entry->parts_id; |
322 | 322 |
$last_row = { }; |
323 | 323 |
$last_row->{partnumber}->{data} = $entry->part->partnumber; |
... | ... | |
344 | 344 |
if ( $entry->trans_type->description eq 'correction' ) { |
345 | 345 |
$prefix = $entry->trans_type->direction; |
346 | 346 |
} |
347 |
$last_row->{$prefix.$entry->trans_type->description}->{data} +=
|
|
347 |
$last_row->{$prefix.$entry->trans_type->description}->{data} += |
|
348 | 348 |
( $entry->trans_type->direction eq 'out' ? -$entry->qty : $entry->qty ); |
349 | 349 |
} |
350 | 350 |
if ( $last_partid > 0 && ( $allrows || ($row_ind >= $first_nr && $row_ind < $last_nr ))) { |
351 | 351 |
$self->make_row_result($last_row,$days,$last_partid); |
352 | 352 |
$report->add_data($last_row); |
353 | 353 |
$row_ind++ ; |
354 |
}
|
|
354 |
} |
|
355 | 355 |
my $num_rows = @{ $report->{data} } ; |
356 | 356 |
#$main::lxdebug->message(LXDebug->DEBUG2(), "count=".$row_ind." rows=".$num_rows); |
357 | 357 |
|
... | ... | |
380 | 380 |
$row->{insum}->{data} = $row->{stock}->{data} + $row->{incorrection}->{data} + $row->{found}->{data}; |
381 | 381 |
$row->{outsum}->{data} = $row->{back}->{data} + $row->{outcorrection}->{data} + $row->{disposed}->{data} + |
382 | 382 |
$row->{missing}->{data} + $row->{shipped}->{data} + $row->{used}->{data}; |
383 |
$row->{consumed}->{data} = $row->{outsum}->{data} -
|
|
383 |
$row->{consumed}->{data} = $row->{outsum}->{data} - |
|
384 | 384 |
$row->{outcorrection}->{data} - $row->{incorrection}->{data}; |
385 | 385 |
$row->{averconsumed}->{data} = $row->{consumed}->{data}*30/$days ; |
386 | 386 |
map { $row->{$_}->{data} = $form->format_amount($myconfig,$row->{$_}->{data},2); } $self->getnumcolumns(); |
Auch abrufbar als: Unified diff
Inventory.pm - Whitespace entfernt