Commit 731f402c authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added GLTransactionID and GLTransactionReference to API for reporting

parent afe3558f
...@@ -1624,7 +1624,7 @@ sub getInventoryStockBalance ...@@ -1624,7 +1624,7 @@ sub getInventoryStockBalance
my $stockBalances = {}; my $stockBalances = {};
# Build result list # Build result list
while (my $row = hashifyLCtoMC($sth->fetchrow_hashref(), while (my $row = hashifyLCtoMC($sth->fetchrow_hashref(),
qw( Code GLTransactionID SerialNumber QtyChange Price ) qw( Code GLTransactionID GLTransactionReference SerialNumber QtyChange Price )
)) { )) {
my $item; my $item;
...@@ -1643,6 +1643,7 @@ sub getInventoryStockBalance ...@@ -1643,6 +1643,7 @@ sub getInventoryStockBalance
$item->{'Quantity'} = Math::BigFloat->new(0); $item->{'Quantity'} = Math::BigFloat->new(0);
$item->{'Quantity'}->precision(-4); $item->{'Quantity'}->precision(-4);
$item->{'Value'} = Math::BigFloat->new(0); $item->{'Value'} = Math::BigFloat->new(0);
$item->{'GLTransactionID'} = [ ];
$item->{'GLTransactionReference'} = [ ]; $item->{'GLTransactionReference'} = [ ];
} }
...@@ -1650,9 +1651,9 @@ sub getInventoryStockBalance ...@@ -1650,9 +1651,9 @@ sub getInventoryStockBalance
$item->{'Quantity'}->badd($row->{'QtyChange'}); $item->{'Quantity'}->badd($row->{'QtyChange'});
# Add cost # Add cost
$item->{'Value'}->badd($row->{'Price'}); $item->{'Value'}->badd($row->{'Price'});
# Add GL transaction reference # Add GL transactions
push(@{$item->{'GLTransactionID'}},$row->{'GLTransactionID'});
push(@{$item->{'GLTransactionReference'}},$row->{'GLTransactionReference'}); push(@{$item->{'GLTransactionReference'}},$row->{'GLTransactionReference'});
# Save item # Save item
$stockBalances->{ $row->{'Code'} }->{ $row->{'SerialNumber'} } = $item; $stockBalances->{ $row->{'Code'} }->{ $row->{'SerialNumber'} } = $item;
} }
......
...@@ -626,6 +626,8 @@ sub sendReport ...@@ -626,6 +626,8 @@ sub sendReport
my $sentry; my $sentry;
$sentry->{'TotalQuantity'} = sprintf('%.4f',$stockItem->{'Quantity'}->bstr()); $sentry->{'TotalQuantity'} = sprintf('%.4f',$stockItem->{'Quantity'}->bstr());
$sentry->{'TotalValue'} = sprintf('%.4f',$stockItem->{'Value'}->bstr()); $sentry->{'TotalValue'} = sprintf('%.4f',$stockItem->{'Value'}->bstr());
$sentry->{'GLTransactionID'} = $stockItem->{'GLTransactionID'};
$sentry->{'GLTransactionReference'} = $stockItem->{'GLTransactionReference'};
$resdata->{'StockItemBalances'}->{$itemCode}->{$itemSerial} = $sentry; $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