Menu

SuiteCRM Master Classes 2018

Welcome, Guest
Username: Password: Remember me

TOPIC: Setting VAT to 0%?

Setting VAT to 0%? 1 week 3 days ago #65768

  • DanBennett
  • DanBennett's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
I'm obviously setting this wrong, but I can't work out how to set it correct!

I'm trying to set an invoice to 0% VAT. So I add 0.0 to the dropdown with the label of 0% in the dropdown editor.

Choosing "0%" in the VAT list works on the invoice, but upon saving it fails.

Log shows
MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`tax_amount_usdollar`=0,`shipping_amount`=0,`shipping_amount_usdollar`=0,`shippi' at line 2

Looking at the error with the query that failed, my presumption is
`tax_amount`=,
is incorrect and should instead be 0? But I can't see why it's not adding it...

Any thoughts?
The administrator has disabled public write access.

Setting VAT to 0%? 1 week 2 days ago #65784

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 5865
  • Thank you received: 908
  • Karma: 216
Can you explain a bit better how to try and reproduce this?

1. Create a new invoice
2. Add a line item with Tax at 0
3. Save
4. what happens now?

Is this in SuiteCRM 7.10.4?
The administrator has disabled public write access.

Setting VAT to 0%? 1 week 14 hours ago #65884

  • DanBennett
  • DanBennett's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
Hi,

Just tried that, no luck.

In Dropdown Editor -> vat_list I've added the entry "0.0" the the name "None" (I've also tried 0 in both).

Error on trying to create quotation with Tax at 0:
Mon May 14 11:33:53 2018 [811][1][FATAL] Error inserting into table: aos_quotes: Query Failed: INSERT INTO aos_quotes (id,name,date_entered,date_modified,modified_user_id,created_by,deleted,assigned_user_id,approval_issue,billing_account_id,billing_contact_id,billing_address_street,billing_address_city,billing_address_state,billing_address_postalcode,billing_address_country,shipping_address_street,shipping_address_city,shipping_address_state,shipping_address_postalcode,shipping_address_country,expiration,number,opportunity_id,total_amt,total_amt_usdollar,subtotal_amount,subtotal_amount_usdollar,discount_amount,discount_amount_usdollar,tax_amount,tax_amount_usdollar,shipping_amount,shipping_amount_usdollar,shipping_tax,shipping_tax_amt,shipping_tax_amt_usdollar,total_amount,total_amount_usdollar,currency_id,stage,term,approval_status,invoice_status,subtotal_tax_amount_usdollar)
                                        VALUES ('c45f6380-f1f0-74fd-9b3f-5af974a6e693','test','2018-05-14 11:33:53','2018-05-14 11:33:53','1','1',0,'1','','','','','','','','','','','','','','2018-06-14',4,'',1,0,1,0,0,0,,0,0,0,'0.0',0,0,1,0,'-99','Draft','','Approved','Not Invoiced',0): MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '0,0,0,'0.0',0,0,1,0,'-99','Draft','','Approved','Not Invoiced',0)' at line 2
Mon May 14 11:33:53 2018 [811][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.

I'm on 7.8.8 I've noticed - so I'll try upgrading at some point... but I'm more convinced I'm messing something up!
The administrator has disabled public write access.

Setting VAT to 0%? 1 week 13 hours ago #65888

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 5865
  • Thank you received: 908
  • Karma: 216
There might be a bug when inserting "0" as a value for VAT in the dropdown. But my point is that i don't need to change any dropdown to use a '% tax. I can just put 0 in the line item.
The administrator has disabled public write access.

Setting VAT to 0%? 1 week 13 hours ago #65889

  • DanBennett
  • DanBennett's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
Interesting. Yeah I don't have the ability to put 0 in the line item. It's only a drop down...

I'll try updating see if that resolves.
The administrator has disabled public write access.

Setting VAT to 0%? 1 week 9 hours ago #65894

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 5865
  • Thank you received: 908
  • Karma: 216
This is how it looks on my 7.10.4. I didn't customize anything in this module, this is how it comes out-of-the-box.


The administrator has disabled public write access.

Setting VAT to 0%? 6 days 10 hours ago #65957

  • DanBennett
  • DanBennett's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
Can you confirm to me what your Dropdown Settings are for this?

Currently I have 20% and added 0% (prntscr.com/ji7pp7)

In Dropdown Editor - vat_list I have it set as such: prntscr.com/ji7pw4
The administrator has disabled public write access.

Setting VAT to 0%? 6 days 9 hours ago #65965

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 5865
  • Thank you received: 908
  • Karma: 216
The values in my Dropdown editor are the ones that are showing on the Dropdown, no mystery here...



The only difference I see is that the values are sorted ascending, but that shouldn't make a difference, I hope...
The administrator has disabled public write access.

Setting VAT to 0%? 6 days 9 hours ago #65967

  • DanBennett
  • DanBennett's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
Set mine to exactly that, all work except the 0%! I'm completely lost... I need to be able to set an invoice with no VAT on it! This is so weird.
WHERE  aos_quotes.id = 'd74f3252-b331-f3d9-1c3e-5aeb36ac9ecb' AND deleted=0: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`tax_amount_usdollar`=0,`shipping_amount`=0,`shipping_amount_usdollar`=0,`shippi' at line 2
The administrator has disabled public write access.

Setting VAT to 0%? 6 days 8 hours ago #65973

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 5865
  • Thank you received: 908
  • Karma: 216
Looking at your Query with a magnifying glass :-) I spot a double comma (,,) which tells me your field tax_amount isn't handling correctly an empty value. I think that is what is breaking the query.

So just try getting a 0 in there for tax_amount. If you can't, then maybe something in the code is buggy, or at least not ready for the changes you made in Dropdown editor, for some weird reason....
The administrator has disabled public write access.

Setting VAT to 0%? 5 days 10 hours ago #66020

  • DanBennett
  • DanBennett's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
Yeah that's what I couldn't get!

I've rebuilt relationships and JS Compressed files - and now it's working! Geezus...
The question is why I even needed to do that in the first place... but at least I've resolved it now.

That was an odd one!
The administrator has disabled public write access.

Setting VAT to 0%? 5 days 7 hours ago #66038

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 5865
  • Thank you received: 908
  • Karma: 216
Yes... this was strange. I'm glad you got it working now!
The administrator has disabled public write access.
Time to create page: 0.059 seconds
Powered by Kunena Forum