Commit 0ef6384e authored by Nigel Kukard's avatar Nigel Kukard

Added GLTransactionID and GLTransactionReference to API for reporting

parent 31382917
......@@ -1624,7 +1624,7 @@ sub getInventoryStockBalance
my $stockBalances = {};
# Build result list
while (my $row = hashifyLCtoMC($sth->fetchrow_hashref(),
qw( Code GLTransactionID SerialNumber QtyChange Price )
qw( Code GLTransactionID GLTransactionReference SerialNumber QtyChange Price )
)) {
my $item;
......@@ -1643,6 +1643,7 @@ sub getInventoryStockBalance
$item->{'Quantity'} = Math::BigFloat->new(0);
$item->{'Quantity'}->precision(-4);
$item->{'Value'} = Math::BigFloat->new(0);
$item->{'GLTransactionID'} = [ ];
$item->{'GLTransactionReference'} = [ ];
}
......@@ -1650,9 +1651,9 @@ sub getInventoryStockBalance
$item->{'Quantity'}->badd($row->{'QtyChange'});
# Add cost
$item->{'Value'}->badd($row->{'Price'});
# Add GL transaction reference
# Add GL transactions
push(@{$item->{'GLTransactionID'}},$row->{'GLTransactionID'});
push(@{$item->{'GLTransactionReference'}},$row->{'GLTransactionReference'});
# Save item
$stockBalances->{ $row->{'Code'} }->{ $row->{'SerialNumber'} } = $item;
}
......
......@@ -626,6 +626,8 @@ sub sendReport
my $sentry;
$sentry->{'TotalQuantity'} = sprintf('%.4f',$stockItem->{'Quantity'}->bstr());
$sentry->{'TotalValue'} = sprintf('%.4f',$stockItem->{'Value'}->bstr());
$sentry->{'GLTransactionID'} = $stockItem->{'GLTransactionID'};
$sentry->{'GLTransactionReference'} = $stockItem->{'GLTransactionReference'};
$resdata->{'StockItemBalances'}->{$itemCode}->{$itemSerial} = $sentry;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment