Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wiaflos
wiaflos
Commits
731f402c
Commit
731f402c
authored
May 09, 2019
by
Nigel Kukard
Browse files
Added GLTransactionID and GLTransactionReference to API for reporting
parent
afe3558f
Changes
2
Hide whitespace changes
Inline
Side-by-side
wiaflos/server/core/Inventory.pm
View file @
731f402c
...
...
@@ -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
;
}
...
...
wiaflos/server/core/Reporting.pm
View file @
731f402c
...
...
@@ -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
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment