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
b23b34eb
Commit
b23b34eb
authored
Mar 28, 2018
by
Nigel Kukard
Browse files
Fixed up some issues with changing inventory code tax types
parent
4dac6b45
Pipeline
#2620
passed with stages
in 1 minute and 11 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
wiaflos/client/cmdline/Inventory.pm
View file @
b23b34eb
...
...
@@ -59,7 +59,7 @@ our $pluginInfo = {
MenuItem
=>
"
Update
",
Regex
=>
"
update
",
Desc
=>
"
Update inventory item
",
Help
=>
'
update item="<product code>" [description="<description>"] [sellprice="<sell price>"] [discountable="<yes or no>"] [unit="<unit>"] [incomeaccount="<income account>"] [assetaccount="<asset account>"] [expenseaccount="<expense account>"]
',
Help
=>
'
update item="<product code>" [description="<description>"] [sellprice="<sell price>"] [discountable="<yes or no>"] [unit="<unit>"] [incomeaccount="<income account>"] [assetaccount="<asset account>"] [expenseaccount="<expense account>"]
[taxtype="<tax type id>"]
',
Function
=>
\
&update
,
},
{
...
...
wiaflos/server/api/Inventory.pm
View file @
b23b34eb
...
...
@@ -302,6 +302,7 @@ sub removeInventoryItem {
# GLAssetAccountNumber - GL asset account
# GLExpenseAccountNumber - GL expense account
# SellPrice - Selling price
# TaxTypeID - Tax type ID
# Unit - Unit
# Discountable - Either service is discountable or not
sub
updateInventoryItem
{
...
...
@@ -340,6 +341,7 @@ sub updateInventoryItem {
$detail
->
{'
GLAssetAccountNumber
'}
=
$data
->
{'
GLAssetAccountNumber
'};
$detail
->
{'
GLExpenseAccountNumber
'}
=
$data
->
{'
GLExpenseAccountNumber
'};
$detail
->
{'
SellPrice
'}
=
$data
->
{'
SellPrice
'};
$detail
->
{'
TaxTypeID
'}
=
$data
->
{'
TaxTypeID
'};
$detail
->
{'
Unit
'}
=
$data
->
{'
Unit
'};
$detail
->
{'
Discountable
'}
=
$data
->
{'
Discountable
'};
my
$res
=
wiaflos::server::core::Inventory::
updateInventoryItem
(
$detail
);
...
...
wiaflos/server/core/Inventory.pm
View file @
b23b34eb
...
...
@@ -1303,7 +1303,7 @@ sub updateInventoryItem
if
((
my
$res
=
wiaflos::server::core::Tax::
taxTypeIDExists
(
$data
->
{'
TaxTypeID
'}))
!=
1
)
{
# If not exist, err
if
(
$res
==
0
)
{
setError
("
Tax type '
"
.
$data
->
{'
TaxTypeI
d
'}
.
"
' does not exist
");
setError
("
Tax type '
"
.
$data
->
{'
TaxTypeI
D
'}
.
"
' does not exist
");
return
ERR_NOTFOUND
;
}
# else err with result & set error
...
...
Write
Preview
Supports
Markdown
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