Commit 2353b847 authored by Nigel Kukard's avatar Nigel Kukard

Merge branch 'nkupdates3' into 'master'

Fixed up some issues with changing inventory code tax types

See merge request !34
parents eb9cb844 b23b34eb
Pipeline #2619 passed with stages
in 1 minute and 9 seconds
......@@ -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,
},
{
......
......@@ -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);
......
......@@ -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->{'TaxTypeId'}."' does not exist");
setError("Tax type '".$data->{'TaxTypeID'}."' does not exist");
return ERR_NOTFOUND;
}
# else err with result & set error
......
Markdown is supported
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