Lines 2246-2252
sub GetLateOrders {
Link Here
|
2246 |
|
2246 |
|
2247 |
=head3 GetHistory |
2247 |
=head3 GetHistory |
2248 |
|
2248 |
|
2249 |
(\@order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( %params ); |
2249 |
\@order_loop = GetHistory( %params ); |
2250 |
|
2250 |
|
2251 |
Retreives some acquisition history information |
2251 |
Retreives some acquisition history information |
2252 |
|
2252 |
|
Lines 2286-2294
returns:
Link Here
|
2286 |
'quantityreceived' => undef, |
2286 |
'quantityreceived' => undef, |
2287 |
'title' => 'The Adventures of Huckleberry Finn' |
2287 |
'title' => 'The Adventures of Huckleberry Finn' |
2288 |
} |
2288 |
} |
2289 |
$total_qty is the sum of all of the quantities in $order_loop |
|
|
2290 |
$total_price is the cost of each in $order_loop times the quantity |
2291 |
$total_qtyreceived is the sum of all of the quantityreceived entries in $order_loop |
2292 |
|
2289 |
|
2293 |
=cut |
2290 |
=cut |
2294 |
|
2291 |
|
Lines 2457-2474
sub GetHistory {
Link Here
|
2457 |
} |
2454 |
} |
2458 |
} |
2455 |
} |
2459 |
$query .= " ORDER BY id"; |
2456 |
$query .= " ORDER BY id"; |
2460 |
my $sth = $dbh->prepare($query); |
2457 |
|
2461 |
$sth->execute( @query_params ); |
2458 |
return $dbh->selectall_arrayref( $query, { Slice => {} }, @query_params ); |
2462 |
my $cnt = 1; |
|
|
2463 |
while ( my $line = $sth->fetchrow_hashref ) { |
2464 |
$line->{count} = $cnt++; |
2465 |
$line->{toggle} = 1 if $cnt % 2; |
2466 |
push @order_loop, $line; |
2467 |
$total_qty += ( $line->{quantity} ) ? $line->{quantity} : 0; |
2468 |
$total_qtyreceived += ( $line->{quantityreceived} ) ? $line->{quantityreceived} : 0; |
2469 |
$total_price += ( $line->{quantity} and $line->{ecost} ) ? $line->{quantity} * $line->{ecost} : 0; |
2470 |
} |
2471 |
return \@order_loop, $total_qty, $total_price, $total_qtyreceived; |
2472 |
} |
2459 |
} |
2473 |
|
2460 |
|
2474 |
=head2 GetRecentAcqui |
2461 |
=head2 GetRecentAcqui |