VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: G0KSC2 on May 26, 2020, 08:34:13 AM

Title: Avatax plgVmOnUpdateOrderPayment error checking existing DocId: Unknown column '
Post by: G0KSC2 on May 26, 2020, 08:34:13 AM
After the recent virtuemart update, I am seeing this error, anyone know where this might be located and how to  fix?
Title: Re: Avatax plgVmOnUpdateOrderPayment error checking existing DocId: Unknown column '
Post by: Milbo on June 15, 2020, 10:27:16 AM
I wonder if this is a false positive


- Only create Avalara transaction if no existing DocId is stored
// in avalara_doc_id custom shopper field
$db = JFactory::getDBO();
$query = "SELECT avalara_doc_id" .
" FROM #__virtuemart_order_userinfos" .
" WHERE virtuemart_order_id = " . $data->virtuemart_order_id .
" AND address_type = 'BT'";
$db->setQuery($query);
$docId = null;
try {
$docId = $db->loadResult();
} catch (RuntimeException $ex) {
vmError('Avatax plgVmOnUpdateOrderPayment error checking existing DocId: ' . $ex->getMessage());
}

if (empty($docId)) {
$this->creditMemo($data);
}


The comment says - Only create Avalara transaction if no existing DocId is stored
and then it throws always an exception if it is not there? But below is a normal flow when it is not there. Does it work otherwise?
Title: Re: Avatax plgVmOnUpdateOrderPayment error checking existing DocId: Unknown column '
Post by: FX2LTD on January 21, 2022, 03:59:31 AM
Hi,
I have been working on my new online shop. I placed a test order and during its cancellation, I got this message: vmError: Avatax cancelOrder error checking existing DocId: Unknown column 'avalara_doc_id' in 'field list'
I only clicked on the order status and from pending I moved it to cancelled.
I have no idea of what this error implies...
Title: Re: Avatax plgVmOnUpdateOrderPayment error checking existing DocId: Unknown column '
Post by: GJC Web Design on January 21, 2022, 11:09:49 AM
are u using Avalara as a tax gateway/plugin?
If not unpublish the plugin
Title: Re: Avatax plgVmOnUpdateOrderPayment error checking existing DocId: Unknown column '
Post by: FX2LTD on January 21, 2022, 15:32:21 PM
Thanks for the info... I was using all the plugins in enable mode  ::)
Title: Re: Avatax plgVmOnUpdateOrderPayment error checking existing DocId: Unknown column '
Post by: GJC Web Design on January 21, 2022, 16:09:18 PM
especially unpublish any unused shipping and payment plugins .. they all take resources even if unused
Title: Re: Avatax plgVmOnUpdateOrderPayment error checking existing DocId: Unknown column '
Post by: ebrilz on April 08, 2022, 04:12:29 AM
Hi everyone! I'm the one responsible for this happening.  Max is correct that the line of code calling vmError should be commented out.  Sorry about that.
Until that happens, the first thing everyone should do (as suggested by GJC Web Design) is to disable the Avalara calculation plugin if you're not using it.  Only publish plugins you're using.
If you actually are using Avalara with your VM store, then you will want to create a shopper field called avalara_doc_id with type Text.  It should be published, but shouldn't be required and shouldn't show in any forms.  This will enable the Avalara plugin to work properly and will get rid of the error message.