Commit afe3558f authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added GL transaction references to stock balances

parent 1918f97f
...@@ -1598,7 +1598,9 @@ sub getInventoryStockBalance ...@@ -1598,7 +1598,9 @@ sub getInventoryStockBalance
inventory.Code, inventory.Code,
inventory_tracking.GLTransactionID, inventory_tracking.GLTransactionID,
inventory_tracking.SerialNumber, inventory_tracking.QtyChange, inventory_tracking.Price inventory_tracking.SerialNumber, inventory_tracking.QtyChange, inventory_tracking.Price,
gl_transactions.Reference AS GLTransactionReference
FROM FROM
inventory, inventory,
...@@ -1641,12 +1643,15 @@ sub getInventoryStockBalance ...@@ -1641,12 +1643,15 @@ 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->{'GLTransactionReference'} = [ ];
} }
# Add quantity # Add quantity
$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
push(@{$item->{'GLTransactionReference'}},$row->{'GLTransactionReference'});
# Save item # Save item
$stockBalances->{ $row->{'Code'} }->{ $row->{'SerialNumber'} } = $item; $stockBalances->{ $row->{'Code'} }->{ $row->{'SerialNumber'} } = $item;
......
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