1. gnsbud
  2. RO CSVI
  3. Tuesday, 24 March 2015
  4.  Subscribe via email
Hi,

I'm trying to import product price with tax, but each import new product tax rule is being created (product is not assigned to tax rule, but each time CSVI is creating new tax rule, named "COM_CSVI_AUTO_TAX_RATE", with the same values, in this example +5% TAX). I'm guessing it's some kind of a bug.

product_sku;product_tax;price_with_tax
test;5%;39.90


What's more product_price is being calculated the correct way, in above example after import product_price = 38 (so it's calculated from 5% tax rule and it's ok), but tax rule still isn't applied/assigned to product, so my final price isn't correct. In CSVI Pro 5 I was using product_tax and price_with_tax the same way and it was working fine.

Best regards,
Chris
Accepted Answer Pending Moderation
Hello Chris,

Can you post me your debug log of the import? The product_tax should be correct for calculation since CSVI removes the %-symbol and will calculate with the 5.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi,

calculations are correct, as I described above, 39.90 and 5% tax rule gives product_price = 38, but when I'm looking at product details page (backend) there's no 5% tax rule assigned to the product, so final price is not correct and each import I'm getting another 5% rule created and named "COM_CSVI_AUTO_TAX_RATE" (even if it already exists), I have already created 5% tax rule but still it's not assigned to product while importing. In attachment logs.

Best regards,
Chris
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Chris,

I see that CSVI is looking for an existing calculation rule
SELECT `c`.`virtuemart_calc_id` FROM `km_virtuemart_calcs` AS `c` WHERE `calc_kind` = 'Tax' AND `calc_value_mathop` = '+%' AND `calc_value` BETWEEN '5' AND '5' AND publish_up = '0000-00-00 00:00:00' AND publish_down = '0000-00-00 00:00:00' GROUP BY `c`.`virtuemart_calc_id`
This returns no existing tax rule, so CSVI creates one. CSVI uses the Tax per product and the math operation of +%. Is your calculation rule set to that as well? If you use a different operation you can include the field calc_kind with your own operation.

created and named "COM_CSVI_AUTO_TAX_RATE" (even if it already exists),
That happens because the publish_up date is set. Attached patch file has this fixed.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi,

still no good. I'm getting "CSVI created tax rule" and product isn't assigned to any tax rule.

my already created rule (row copied from virtueamrt backend list of all rules):
VAT 5% 		0 	Tax 	+% 	5.0000 	PLN 				21-12-14 	-Brak- 				5 


csvi created tax rule (row copied from virtueamrt backend list of all rules)::
CSVI created tax rule 	CSVI created this tax rule on product import because no matching tax rate was found 	0 	Tax 	+% 	5.0000 	PLN 				-Brak- 	-Brak- 				1250


my already created rule (row from #__virtuemart_calcs table):
5 	1 	0 	VAT 5% 		Tax 	+% 	5.0000 	114 	0 	0 	2014-12-21 19:17:19 	0000-00-00 00:00:00 	0 		0 	0 	1 	2014-12-21 19:17:19 	386 	2015-03-24 21:17:36 	386 	0000-00-00 00:00:00 	0


csvi created tax rule (row from #__virtuemart_calcs table):
1250 	1 	0 	CSVI created tax rule 	CSVI created this tax rule on product import becau... 	Tax 	+% 	5.0000 	114 	1 	1 	0000-00-00 00:00:00 	0000-00-00 00:00:00 	0 		0 	0 	1 	2015-03-26 17:50:34 	386 	2015-03-26 17:50:34 	386 	0000-00-00 00:00:00 	0


as you can see rules are quite the same, but still rule isn't assigned to the product (no matter if it's csvi created rule or my already created rule). Please tell me what more can I send you to track this issue?

Best regards,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Chris,

Ok, that is telling me enough. Looking at your already created tax rule, you have a publish_up date set as 2014-12-21 19:17:19 where as CSVI is looking for 0000-00-00 00:00:00. Since it can't find it, it will create a new tax rule.

Either you set the publish_up date field in your import file or you need to change the Start date to Never in VirtueMart for your already created tax rule. This way CSVI can find it and won't create a new one.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hi,

if I remove publish up date in my tax rule using virtuemart backend, then in database publish_up becomes "1970-01-01 00:00:00". I changed publish_up in my db (not using backend, but phpmyadmin), as you said, to 0000-00-00 00:00:00, now during import "CSVI created tax rule" is not created, however still tax is not assigned to product.
I can see in #__virtuemart_product_prices newly imported product has product_tax_id = NULL.

We're close to solve this, I can feel it ;)

Best regards,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello Chris,

We are so close I believe it is fixed now with the attached patch. This takes into account the 1970-01-01 00:00:00 value.

Let me know how it goes.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hi,

patch applied using maintanance menu, while importing products "csvi created tax rule" is not created, but still tax rule is not assigned to product - still in #__virtuemart_product_prices newly imported product has product_tax_id = NULL.
Does your script handle situation when there're more than one tax rules available in virtuemart backend? For example +5% tax, +21% tax, +25% tax? I'm guessing you can't reproduce the issue, sorry for my lack of ideas what else can I send/tell you to track this issue.

Best regards,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello Chris,

while importing products "csvi created tax rule" is not created
That is 1 step forward :)

but still tax rule is not assigned to product
That I would need to see the debug log for.

Does your script handle situation when there're more than one tax rules available in virtuemart backend? For example +5% tax, +21% tax, +25% tax?
Those are not multiple tax rules, these are all one tax rule since the rates are different. If CSVI finds multiple tax rates, it takes the first one.

I'm guessing you can't reproduce the issue
I actually did find the issue with the date problem and that is fixed as you can see that no new tax rules are created.

I believe I found the reason, the attached patch should finally give you a calculation ID :)
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hi,

this patch fixed the issue. Tax rule applied and assigned to product, final price now is correct :woohoo: Well done!

Best regards,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Super :)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 11
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!