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 = {
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