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
inventory.Code,
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
inventory,
......@@ -1641,12 +1643,15 @@ sub getInventoryStockBalance
$item->{'Quantity'} = Math::BigFloat->new(0);
$item->{'Quantity'}->precision(-4);
$item->{'Value'} = Math::BigFloat->new(0);
$item->{'GLTransactionReference'} = [ ];
}
# Add quantity
$item->{'Quantity'}->badd($row->{'QtyChange'});
# Add cost
$item->{'Value'}->badd($row->{'Price'});
# Add GL transaction reference
push(@{$item->{'GLTransactionReference'}},$row->{'GLTransactionReference'});
# Save 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