Mandatory VAT field in CBSubs invoice

9 years 5 months ago #252052 by crealiagroup
Mandatory VAT field in CBSubs invoice was created by crealiagroup
Hi,

is there a way to have the VAT field in invoice adress always mandatory even if Company field is empty?

I try to explain why.

In Italy we need to ask VAT number to Companies but also we need to ask for "Codice Fiscale" to private users. We could use the already existing VAT field (editing the language string in ("IVA and/or Codice Fiscale"; also companies here have a fiscal code that can be same as VAT number or another number).

So if the VAT field could be setted as mandatory even if a private user want to buy, that could solve the problem.

Any other solutions?

Please Log in to join the conversation.

9 years 5 months ago - 9 years 5 months ago #252098 by krileon
Replied by krileon on topic Mandatory VAT field in CBSubs invoice
There's no parameter to enable that. You'd need to modify the invoice address XML file found below.

components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/xml/edit.front.invoice.xml

You then need to remove the <if node around the VAT input. Example as follows.

FORM:
					<if name="payer_business_name" type="showhide" operator="!=" value="" valuetype="const:string">
						<param name="vat_number" type="text" size="" default="" label="VAT number" description="" />
						<else action="set" name="vat_number" value="" type="const:string" />
					</if>
TO:
					<param name="vat_number" type="text" size="" default="" label="VAT number" description="" validate="required" />


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

9 years 5 months ago #252106 by crealiagroup
Replied by crealiagroup on topic Mandatory VAT field in CBSubs invoice
Ok, but that's an hack and I'll lose it with upgrades.

So, would you consider to implement such necessary feature for future realeses?

The best way could be to create fileds in CB that can be assigned to invoice address according to other fields values.

For example, in this way I could create 2 CB fields: VAT and Codice Fiscale and make a condition that:

if country is Italy and company name is not empty than show both (VAT and Codice Fiscale)
if country is Italy and company name is empty then show only Codice Fiscale
if country is EU and company name is empty then show VAT (that's the case for italian seller to France private user for example)

What do you think about it?

Please Log in to join the conversation.

9 years 5 months ago #252189 by beat
Replied by beat on topic Mandatory VAT field in CBSubs invoice
I fully understand your use-case, but I also believe that this is a seldom use-case up to now, as it is the first time that we have received this request since the first release of CBSubs tax plugin. Maybe things changed and we will see more such requests from Italy and other EU countries ?

Also the equivalent US Social-Security Number or personal tax number in a number of countries is considered as a private number, sometimes even a secret one, like in the US, as it allows to impersonate someone. Thus I am unsure if we will make this a standard feature at this time.

However, Kyle's proposal can be implemented into a tiny specific (custom) CBSubs plugin that you install on your site and to which you give a higher ordering number than CBSubs Tax plugin. That plugin can have that same XML file (but with just that VAT and fiscal number field and the <if> statement to just override that VAT field, as XML files that may override invoice are auto-loaded from CBSubs plugins. That way it's not a hack, and survives upgrades. You would obviously also need to add the corresponding fiscalnumber database column to the cbsubs_paymentbaskets table.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

9 years 5 months ago #252201 by crealiagroup
Replied by crealiagroup on topic Mandatory VAT field in CBSubs invoice
Thanks Beat for your replay.

Could you please help me writing that plugin? Not sure about how adding the code to manage DB colums also.

Thanks in advice.

Please Log in to join the conversation.

9 years 5 months ago #252471 by crealiagroup
Replied by crealiagroup on topic Mandatory VAT field in CBSubs invoice
Hi, accoring to this topic of 2 years ago, I can confirm that this scenario is mandatory for Italy: www.joomlapolis.com/forum/256-cbsubs-support/195627-vat-field-required-invoice

Hope you'll consider this. :-)

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.219 seconds

Facebook Twitter LinkedIn