Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nigel Kukard
wiaflos
Commits
b922d651
Commit
b922d651
authored
May 10, 2019
by
Nigel Kukard
Browse files
Change API to pass entire set of transactions in inventory stock
balances
parent
0ef6384e
Pipeline
#3683
passed with stages
in 1 minute and 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
wiaflos/server/core/Inventory.pm
View file @
b922d651
# Inventory functions
# Copyright (C) 2009-201
4
, AllWorldIT
# Copyright (C) 2009-201
9
, AllWorldIT
# Copyright (C) 2008, LinuxRulz
# Copyright (C) 2007 Nigel Kukard <nkukard@lbsd.net>
#
...
...
@@ -1600,6 +1600,7 @@ sub getInventoryStockBalance
inventory_tracking.GLTransactionID,
inventory_tracking.SerialNumber, inventory_tracking.QtyChange, inventory_tracking.Price,
gl_transactions.TransactionDate AS GLTransactionDate,
gl_transactions.Reference AS GLTransactionReference
FROM
...
...
@@ -1624,7 +1625,7 @@ sub getInventoryStockBalance
my
$stockBalances
=
{};
# Build result list
while
(
my
$row
=
hashifyLCtoMC
(
$sth
->
fetchrow_hashref
(),
qw( Code GLTransactionID GLTransactionReference SerialNumber QtyChange Price )
qw( Code GLTransactionID
GLTransactionDate
GLTransactionReference SerialNumber QtyChange Price )
))
{
my
$item
;
...
...
@@ -1643,8 +1644,6 @@ sub getInventoryStockBalance
$item
->
{'
Quantity
'}
=
Math::
BigFloat
->
new
(
0
);
$item
->
{'
Quantity
'}
->
precision
(
-
4
);
$item
->
{'
Value
'}
=
Math::
BigFloat
->
new
(
0
);
$item
->
{'
GLTransactionID
'}
=
[
];
$item
->
{'
GLTransactionReference
'}
=
[
];
}
# Add quantity
...
...
@@ -1652,8 +1651,12 @@ sub getInventoryStockBalance
# Add cost
$item
->
{'
Value
'}
->
badd
(
$row
->
{'
Price
'});
# Add GL transactions
push
(
@
{
$item
->
{'
GLTransactionID
'}},
$row
->
{'
GLTransactionID
'});
push
(
@
{
$item
->
{'
GLTransactionReference
'}},
$row
->
{'
GLTransactionReference
'});
$item
->
{'
GLTransactions
'}
->
{
$row
->
{'
GLTransactionID
'}}
=
{
'
GLTransactionDate
'
=>
$row
->
{'
GLTransactionDate
'},
'
GLTransactionReference
'
=>
$row
->
{'
GLTransactionReference
'},
'
Price
'
=>
$row
->
{'
Price
'},
'
QtyChange
'
=>
$row
->
{'
QtyChange
'},
};
# Save item
$stockBalances
->
{
$row
->
{'
Code
'}
}
->
{
$row
->
{'
SerialNumber
'}
}
=
$item
;
}
...
...
wiaflos/server/core/Reporting.pm
View file @
b922d651
# Reporting functions
# Copyright (C) 2009-201
8
, AllWorldIT
# Copyright (C) 2009-201
9
, AllWorldIT
# Copyright (C) 2008, LinuxRulz
# Copyright (C) 2007 Nigel Kukard <nkukard@lbsd.net>
#
...
...
@@ -626,8 +626,7 @@ 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
'};
$sentry
->
{'
GLTransactions
'}
=
$stockItem
->
{'
GLTransactions
'};
$resdata
->
{'
StockItemBalances
'}
->
{
$itemCode
}
->
{
$itemSerial
}
=
$sentry
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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