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

Merge branch 'nkserials' into 'master'

Added GL transaction references to stock balances

See merge request !41
parents b902313c 31382917
Pipeline #3680 passed with stages
in 1 minute and 12 seconds
...@@ -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;
......
Supports Markdown
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