Remove VAT Number field from front office
This commit is contained in:
@@ -26,10 +26,6 @@
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="label"}
|
||||
{if $input.name == 'vat_number'}
|
||||
<div id="vat_area" style="display: visible">
|
||||
{/if}
|
||||
|
||||
{if $input.type == 'text_customer' && !isset($customer)}
|
||||
<label class="control-label col-lg-3 required" for="email">{l s='Customer email'}</label>
|
||||
{else}
|
||||
@@ -92,7 +88,4 @@
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{if $input.name == 'vat_number'}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
@@ -781,7 +781,6 @@ abstract class PaymentModuleCore extends Module
|
||||
'{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile,
|
||||
'{delivery_other}' => $delivery->other,
|
||||
'{invoice_company}' => $invoice->company,
|
||||
'{invoice_vat_number}' => $invoice->vat_number,
|
||||
'{invoice_firstname}' => $invoice->firstname,
|
||||
'{invoice_lastname}' => $invoice->lastname,
|
||||
'{invoice_address2}' => $invoice->address2,
|
||||
|
||||
@@ -36,7 +36,7 @@ class AdminAddressesControllerCore extends AdminController
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->required_database = true;
|
||||
$this->required_fields = array('company','address2', 'postcode', 'other', 'phone', 'phone_mobile', 'vat_number', 'dni');
|
||||
$this->required_fields = array('company', 'address2', 'postcode', 'other', 'phone', 'phone_mobile', 'dni');
|
||||
$this->table = 'address';
|
||||
$this->className = 'Address';
|
||||
$this->lang = false;
|
||||
@@ -217,13 +217,6 @@ class AdminAddressesControllerCore extends AdminController
|
||||
'col' => '4',
|
||||
'hint' => $this->l('Invalid characters:').' <>;=#{}'
|
||||
);
|
||||
$temp_fields[] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('VAT number'),
|
||||
'col' => '2',
|
||||
'name' => 'vat_number',
|
||||
'required' => in_array('vat_number', $required_fields)
|
||||
);
|
||||
} elseif ($addr_field_item == 'lastname') {
|
||||
if (isset($customer) &&
|
||||
!Tools::isSubmit('submit'.strtoupper($this->table)) &&
|
||||
|
||||
@@ -45,7 +45,6 @@ class AddressControllerCore extends FrontController
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'tools/vatManagement.js',
|
||||
_THEME_JS_DIR_.'tools/statesManagement.js',
|
||||
_PS_JS_DIR_.'validate.js'
|
||||
));
|
||||
|
||||
@@ -85,7 +85,6 @@ class AddressesControllerCore extends FrontController
|
||||
|
||||
$addresses_style = array(
|
||||
'company' => 'address_company',
|
||||
'vat_number' => 'address_company',
|
||||
'firstname' => 'address_name',
|
||||
'lastname' => 'address_name',
|
||||
'address1' => 'address_address1',
|
||||
|
||||
@@ -66,7 +66,6 @@ class AuthControllerCore extends FrontController
|
||||
|
||||
$this->addJqueryPlugin('typewatch');
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'tools/vatManagement.js',
|
||||
_THEME_JS_DIR_.'tools/statesManagement.js',
|
||||
_THEME_JS_DIR_.'authentication.js',
|
||||
_PS_JS_DIR_.'validate.js'
|
||||
|
||||
@@ -345,7 +345,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
}
|
||||
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'tools/vatManagement.js',
|
||||
_THEME_JS_DIR_.'tools/statesManagement.js',
|
||||
_THEME_JS_DIR_.'order-carrier.js',
|
||||
_PS_JS_DIR_.'validate.js'
|
||||
@@ -597,7 +596,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'company' => Tools::htmlentitiesUTF8($address_delivery->company),
|
||||
'lastname' => Tools::htmlentitiesUTF8($address_delivery->lastname),
|
||||
'firstname' => Tools::htmlentitiesUTF8($address_delivery->firstname),
|
||||
'vat_number' => Tools::htmlentitiesUTF8($address_delivery->vat_number),
|
||||
'dni' => Tools::htmlentitiesUTF8($address_delivery->dni),
|
||||
'address1' => Tools::htmlentitiesUTF8($address_delivery->address1),
|
||||
'postcode' => Tools::htmlentitiesUTF8($address_delivery->postcode),
|
||||
@@ -613,7 +611,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'company_invoice' => Tools::htmlentitiesUTF8($address_invoice->company),
|
||||
'lastname_invoice' => Tools::htmlentitiesUTF8($address_invoice->lastname),
|
||||
'firstname_invoice' => Tools::htmlentitiesUTF8($address_invoice->firstname),
|
||||
'vat_number_invoice' => Tools::htmlentitiesUTF8($address_invoice->vat_number),
|
||||
'dni_invoice' => Tools::htmlentitiesUTF8($address_invoice->dni),
|
||||
'address1_invoice' => Tools::htmlentitiesUTF8($address_invoice->address1),
|
||||
'address2_invoice' => Tools::htmlentitiesUTF8($address_invoice->address2),
|
||||
@@ -627,7 +624,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'invoice_company' => Tools::htmlentitiesUTF8($address_invoice->company),
|
||||
'invoice_lastname' => Tools::htmlentitiesUTF8($address_invoice->lastname),
|
||||
'invoice_firstname' => Tools::htmlentitiesUTF8($address_invoice->firstname),
|
||||
'invoice_vat_number' => Tools::htmlentitiesUTF8($address_invoice->vat_number),
|
||||
'invoice_dni' => Tools::htmlentitiesUTF8($address_invoice->dni),
|
||||
'invoice_address' => $this->context->cart->id_address_invoice !== $this->context->cart->id_address_delivery,
|
||||
'invoice_address1' => Tools::htmlentitiesUTF8($address_invoice->address1),
|
||||
|
||||
@@ -28,19 +28,11 @@
|
||||
<th class="header small" valign="middle">{l s='Invoice Date' pdf='true'}</th>
|
||||
<th class="header small" valign="middle">{l s='Order Reference' pdf='true'}</th>
|
||||
<th class="header small" valign="middle">{l s='Order date' pdf='true'}</th>
|
||||
{if $addresses.invoice->vat_number}
|
||||
<th class="header small" valign="middle">{l s='VAT Number' pdf='true'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="center small white">{$title|escape:'html':'UTF-8'}</td>
|
||||
<td class="center small white">{dateFormat date=$order->invoice_date full=0}</td>
|
||||
<td class="center small white">{$order->getUniqReference()}</td>
|
||||
<td class="center small white">{dateFormat date=$order->date_add full=0}</td>
|
||||
{if $addresses.invoice->vat_number}
|
||||
<td class="center small white">
|
||||
{$addresses.invoice->vat_number}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -27,17 +27,9 @@
|
||||
<tr>
|
||||
<th class="header small" valign="middle">{l s='Order Reference' pdf='true'}</th>
|
||||
<th class="header small" valign="middle">{l s='Order Date' pdf='true'}</th>
|
||||
{if $addresses.invoice->vat_number}
|
||||
<th class="header small" valign="middle">{l s='VAT Number' pdf='true'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="center small white">{$order->getUniqReference()}</td>
|
||||
<td class="center small white">{dateFormat date=$order->date_add full=0}</td>
|
||||
{if $addresses.invoice->vat_number}
|
||||
<td class="center small white">
|
||||
{$addresses.invoice->vat_number}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -54,16 +54,6 @@
|
||||
<input class="form-control validate" data-validate="{$address_validation.$field_name.validate}" type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{if isset($address->company)}{$address->company|escape:'html':'UTF-8'}{/if}{/if}" />
|
||||
</div>
|
||||
{/if}
|
||||
{if $field_name eq 'vat_number'}
|
||||
<div id="vat_area">
|
||||
<div id="vat_number">
|
||||
<div class="form-group">
|
||||
<label for="vat-number">{l s='VAT number'}{if isset($required_fields) && in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="form-control validate" data-validate="{$address_validation.$field_name.validate}" id="vat-number" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{else}{if isset($address->vat_number)}{$address->vat_number|escape:'html':'UTF-8'}{/if}{/if}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $field_name eq 'dni'}
|
||||
{assign var="dniExist" value=true}
|
||||
<div class="required form-group dni">
|
||||
|
||||
@@ -192,14 +192,7 @@
|
||||
<label for="company">{l s='Company'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="form-control" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
|
||||
</div>
|
||||
{elseif $field_name eq "vat_number"}
|
||||
<div id="vat_number" style="display:none;">
|
||||
<div class="form-group">
|
||||
<label for="vat-number">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input id="vat-number" type="text" class="form-control" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{/if}" />
|
||||
</div>
|
||||
</div>
|
||||
{elseif $field_name eq "dni"}
|
||||
{elseif $field_name eq "dni"}
|
||||
{assign var='dniExist' value=true}
|
||||
<div class="required dni form-group">
|
||||
<label for="dni">{l s='Identification number'} <sup>*</sup></label>
|
||||
@@ -290,13 +283,6 @@
|
||||
<label for="company_invoice">{l s='Company'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="text form-control" id="company_invoice" name="company_invoice" value="{if isset($smarty.post.company_invoice) && $smarty.post.company_invoice}{$smarty.post.company_invoice}{/if}" />
|
||||
</div>
|
||||
{elseif $field_name eq "vat_number"}
|
||||
<div id="vat_number_block_invoice" style="display:none;">
|
||||
<div class="form-group">
|
||||
<label for="vat_number_invoice">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="form-control" id="vat_number_invoice" name="vat_number_invoice" value="{if isset($smarty.post.vat_number_invoice) && $smarty.post.vat_number_invoice}{$smarty.post.vat_number_invoice}{/if}" />
|
||||
</div>
|
||||
</div>
|
||||
{elseif $field_name eq "dni"}
|
||||
{assign var=dniExist value=true}
|
||||
<div class="required form-group dni_invoice">
|
||||
@@ -551,13 +537,6 @@
|
||||
<input type="text" class="form-control" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
|
||||
</p>
|
||||
{/if}
|
||||
{elseif $field_name eq "vat_number"}
|
||||
<div id="vat_number" style="display:none;">
|
||||
<p class="form-group">
|
||||
<label for="vat_number">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="form-control" id="vat_number" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{/if}" />
|
||||
</p>
|
||||
</div>
|
||||
{elseif $field_name eq "firstname"}
|
||||
<p class="required form-group">
|
||||
<label for="firstname">{l s='First name'} <sup>*</sup></label>
|
||||
|
||||
@@ -839,8 +839,6 @@ function saveAddress(type)
|
||||
var params = 'firstname=' + encodeURIComponent($('#firstname' + (type == 'invoice' ? '_invoice' : '')).val()) + '&lastname=' + encodeURIComponent($('#lastname' + (type == 'invoice' ? '_invoice' : '')).val()) + '&';
|
||||
if ($('#company' + (type == 'invoice' ? '_invoice' : '')).length)
|
||||
params += 'company=' + encodeURIComponent($('#company' + (type == 'invoice' ? '_invoice' : '')).val()) + '&';
|
||||
if ($('#vat_number' + (type == 'invoice' ? '_invoice' : '')).length)
|
||||
params += 'vat_number='+encodeURIComponent($('#vat_number' + (type == 'invoice' ? '_invoice' : '')).val()) + '&';
|
||||
if ($('#dni' + (type == 'invoice' ? '_invoice' : '')).length)
|
||||
params += 'dni=' + encodeURIComponent($('#dni' + (type == 'invoice' ? '_invoice' : '')).val())+'&';
|
||||
if ($('#address1' + (type == 'invoice' ? '_invoice' : '')).length)
|
||||
|
||||
@@ -68,8 +68,6 @@ function bindCheckbox()
|
||||
if ($('#invoice_address:checked').length > 0)
|
||||
{
|
||||
$('#opc_invoice_address').slideDown('slow');
|
||||
if ($('#company_invoice').val() == '')
|
||||
$('#vat_number_block_invoice').hide();
|
||||
if (typeof bindUniform !=='undefined')
|
||||
bindUniform();
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
vat_number();
|
||||
$(document).on('input', '#company, #company_invoice', function(){
|
||||
vat_number();
|
||||
});
|
||||
});
|
||||
|
||||
function vat_number() {
|
||||
if ($('#company').length && ($('#company').val() != '')) {
|
||||
$('#vat_number, #vat_number_block').show();
|
||||
} else {
|
||||
$('#vat_number, #vat_number_block').hide();
|
||||
}
|
||||
|
||||
if ($('#company_invoice').length && ($('#company_invoice').val() != '')) {
|
||||
$('#vat_number_block_invoice').show();
|
||||
} else {
|
||||
$('#vat_number_block_invoice').hide();
|
||||
}
|
||||
}
|
||||
@@ -157,13 +157,6 @@
|
||||
<label for="company">{l s='Company'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="text form-control validate" id="company" name="company" data-validate="isGenericName" value="{if isset($guestInformations) && isset($guestInformations.company) && $guestInformations.company}{$guestInformations.company}{/if}" />
|
||||
</div>
|
||||
{elseif $field_name eq "vat_number"}
|
||||
<div id="vat_number_block" style="display:none;">
|
||||
<div class="form-group">
|
||||
<label for="vat_number">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="text form-control" name="vat_number" id="vat_number" value="{if isset($guestInformations) && isset($guestInformations.vat_number) && $guestInformations.vat_number}{$guestInformations.vat_number}{/if}" />
|
||||
</div>
|
||||
</div>
|
||||
{elseif $field_name eq "dni"}
|
||||
{assign var='dniExist' value=true}
|
||||
<div class="required dni form-group">
|
||||
@@ -276,13 +269,6 @@
|
||||
<label for="company_invoice">{l s='Company'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="text form-control validate" id="company_invoice" name="company_invoice" data-validate="isName" value="{if isset($guestInformations) && isset($guestInformations.company_invoice) && $guestInformations.company_invoice}{$guestInformations.company_invoice}{/if}" />
|
||||
</div>
|
||||
{elseif $field_name eq "vat_number"}
|
||||
<div id="vat_number_block_invoice" class="is_customer_param" style="display:none;">
|
||||
<div class="form-group">
|
||||
<label for="vat_number_invoice">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="form-control" id="vat_number_invoice" name="vat_number_invoice" value="{if isset($guestInformations) && isset($guestInformations.vat_number_invoice) && $guestInformations.vat_number_invoice}{$guestInformations.vat_number_invoice}{/if}" />
|
||||
</div>
|
||||
</div>
|
||||
{elseif $field_name eq "dni"}
|
||||
{assign var='dniExist' value=true}
|
||||
<div class="required form-group dni_invoice">
|
||||
|
||||
@@ -189,13 +189,6 @@
|
||||
<label for="company">{l s='Company'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="text form-control validate" id="company" name="company" data-validate="isGenericName" value="{if isset($guestInformations) && isset($guestInformations.company) && $guestInformations.company}{$guestInformations.company}{/if}" />
|
||||
</div>
|
||||
{elseif $field_name eq "vat_number"}
|
||||
<div id="vat_number_block" style="display:none;">
|
||||
<div class="form-group col-sm-6">
|
||||
<label for="vat_number">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="text form-control" name="vat_number" id="vat_number" value="{if isset($guestInformations) && isset($guestInformations.vat_number) && $guestInformations.vat_number}{$guestInformations.vat_number}{/if}" />
|
||||
</div>
|
||||
</div>
|
||||
{elseif $field_name eq "dni"}
|
||||
{assign var='dniExist' value=true}
|
||||
<div class="required dni form-group col-sm-6">
|
||||
@@ -286,13 +279,6 @@
|
||||
<label for="company_invoice">{l s='Company'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="text form-control validate" id="company_invoice" name="company_invoice" data-validate="isName" value="{if isset($guestInformations) && isset($guestInformations.company_invoice) && $guestInformations.company_invoice}{$guestInformations.company_invoice}{/if}" />
|
||||
</div>
|
||||
{elseif $field_name eq "vat_number"}
|
||||
<div id="vat_number_block_invoice" class="is_customer_param" style="display:none;">
|
||||
<div class="form-group">
|
||||
<label for="vat_number_invoice">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
|
||||
<input type="text" class="form-control" id="vat_number_invoice" name="vat_number_invoice" value="{if isset($guestInformations) && isset($guestInformations.vat_number_invoice) && $guestInformations.vat_number_invoice}{$guestInformations.vat_number_invoice}{/if}" />
|
||||
</div>
|
||||
</div>
|
||||
{elseif $field_name eq "dni"}
|
||||
{assign var='dniExist' value=true}
|
||||
<div class="required form-group dni_invoice">
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
*}
|
||||
{if !isset($addresses_style)}
|
||||
{$addresses_style.company = 'address_company'}
|
||||
{$addresses_style.vat_number = 'address_company'}
|
||||
{$addresses_style.firstname = 'address_name'}
|
||||
{$addresses_style.lastname = 'address_name'}
|
||||
{$addresses_style.address1 = 'address_address1'}
|
||||
|
||||
@@ -229,7 +229,6 @@
|
||||
{* Will be deleted for 1.5 version and more *}
|
||||
{if !isset($addresses_style)}
|
||||
{$addresses_style.company = 'address_company'}
|
||||
{$addresses_style.vat_number = 'address_company'}
|
||||
{$addresses_style.firstname = 'address_name'}
|
||||
{$addresses_style.lastname = 'address_name'}
|
||||
{$addresses_style.address1 = 'address_address1'}
|
||||
|
||||
Reference in New Issue
Block a user