Commit b23b34eb authored by Nigel Kukard's avatar Nigel Kukard

Fixed up some issues with changing inventory code tax types

parent 4dac6b45
...@@ -59,7 +59,7 @@ our $pluginInfo = { ...@@ -59,7 +59,7 @@ our $pluginInfo = {
MenuItem => "Update", MenuItem => "Update",
Regex => "update", Regex => "update",
Desc => "Update inventory item", 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, Function => \&update,
}, },
{ {
......
...@@ -302,6 +302,7 @@ sub removeInventoryItem { ...@@ -302,6 +302,7 @@ sub removeInventoryItem {
# GLAssetAccountNumber - GL asset account # GLAssetAccountNumber - GL asset account
# GLExpenseAccountNumber - GL expense account # GLExpenseAccountNumber - GL expense account
# SellPrice - Selling price # SellPrice - Selling price
# TaxTypeID - Tax type ID
# Unit - Unit # Unit - Unit
# Discountable - Either service is discountable or not # Discountable - Either service is discountable or not
sub updateInventoryItem { sub updateInventoryItem {
...@@ -340,6 +341,7 @@ sub updateInventoryItem { ...@@ -340,6 +341,7 @@ sub updateInventoryItem {
$detail->{'GLAssetAccountNumber'} = $data->{'GLAssetAccountNumber'}; $detail->{'GLAssetAccountNumber'} = $data->{'GLAssetAccountNumber'};
$detail->{'GLExpenseAccountNumber'} = $data->{'GLExpenseAccountNumber'}; $detail->{'GLExpenseAccountNumber'} = $data->{'GLExpenseAccountNumber'};
$detail->{'SellPrice'} = $data->{'SellPrice'}; $detail->{'SellPrice'} = $data->{'SellPrice'};
$detail->{'TaxTypeID'} = $data->{'TaxTypeID'};
$detail->{'Unit'} = $data->{'Unit'}; $detail->{'Unit'} = $data->{'Unit'};
$detail->{'Discountable'} = $data->{'Discountable'}; $detail->{'Discountable'} = $data->{'Discountable'};
my $res = wiaflos::server::core::Inventory::updateInventoryItem($detail); my $res = wiaflos::server::core::Inventory::updateInventoryItem($detail);
......
...@@ -1303,7 +1303,7 @@ sub updateInventoryItem ...@@ -1303,7 +1303,7 @@ sub updateInventoryItem
if ((my $res = wiaflos::server::core::Tax::taxTypeIDExists($data->{'TaxTypeID'})) != 1) { if ((my $res = wiaflos::server::core::Tax::taxTypeIDExists($data->{'TaxTypeID'})) != 1) {
# If not exist, err # If not exist, err
if ($res == 0) { if ($res == 0) {
setError("Tax type '".$data->{'TaxTypeId'}."' does not exist"); setError("Tax type '".$data->{'TaxTypeID'}."' does not exist");
return ERR_NOTFOUND; return ERR_NOTFOUND;
} }
# else err with result & set error # 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