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
wiaflos
wiaflos
Commits
8734d309
Commit
8734d309
authored
Mar 11, 2018
by
Nigel Kukard
Browse files
Add ability to change tax type ID
parent
de895105
Changes
2
Hide whitespace changes
Inline
Side-by-side
wiaflos/client/cmdline/Inventory.pm
View file @
8734d309
...
...
@@ -242,6 +242,7 @@ sub update
$detail
->
{'
GLAssetAccountNumber
'}
=
$parms
->
{'
assetaccount
'};
$detail
->
{'
GLExpenseAccountNumber
'}
=
$parms
->
{'
expenseaccount
'};
$detail
->
{'
SellPrice
'}
=
$parms
->
{'
sellprice
'};
$detail
->
{'
TaxTypeID
'}
=
$parms
->
{'
taxtype
'};
$detail
->
{'
Unit
'}
=
$parms
->
{'
unit
'};
$detail
->
{'
Discountable
'}
=
$parms
->
{'
discoutable
'};
my
$res
=
soapCall
(
$OUT
,"
wiaflos/server/api/Inventory
","
updateInventoryItem
",
$detail
);
...
...
wiaflos/server/core/Inventory.pm
View file @
8734d309
...
...
@@ -1209,6 +1209,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
...
...
@@ -1295,6 +1296,23 @@ sub updateInventoryItem
if
(
defined
(
$data
->
{'
SellPrice
'}))
{
push
(
@updates
,
sprintf
('
SellPrice = %s
',
DBQuote
(
$data
->
{'
SellPrice
'})));
}
# Check if TaxTypeID was specified
if
(
defined
(
$data
->
{'
TaxTypeID
'}))
{
# Check if tax type exists
if
((
my
$res
=
wiaflos::server::core::Tax::
taxTypeIDExists
(
$data
->
{'
TaxTypeID
'}))
!=
1
)
{
# If not exist, err
if
(
$res
==
0
)
{
setError
("
Tax type '
"
.
$data
->
{'
TaxTypeId
'}
.
"
' does not exist
");
return
ERR_NOTFOUND
;
}
# else err with result & set error
setError
(
wiaflos::server::core::Tax::
Error
());
return
$res
;
}
push
(
@updates
,
sprintf
('
TaxTypeID = %s
',
DBQuote
(
$data
->
{'
TaxTypeID
'})));
}
if
(
defined
(
$data
->
{'
Unit
'}))
{
push
(
@updates
,
sprintf
('
Unit = %s
',
DBQuote
(
$data
->
{'
Unit
'})));
}
...
...
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