diff --git a/htdocs/societe/canvas/default/actions_card_default.class.php b/htdocs/societe/canvas/default/actions_card_default.class.php index 716d8d2f448..9404d4ef6e0 100644 --- a/htdocs/societe/canvas/default/actions_card_default.class.php +++ b/htdocs/societe/canvas/default/actions_card_default.class.php @@ -105,6 +105,17 @@ class ActionsCardDefault extends ActionsCardCommon $this->tpl['profid2'] = $this->object->siret; $this->tpl['profid3'] = $this->object->ape; $this->tpl['profid4'] = $this->object->idprof4; + + if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLEVATCHECK)) { + $js = "\n"; + $js.= ''; + $js.= "\n"; + $this->tpl['js_checkVatPopup'] = $js; + } if ($action == 'create' || $action == 'edit') { @@ -124,18 +135,25 @@ class ActionsCardDefault extends ActionsCardCommon $this->tpl['select_workforce'] = $form->selectarray("effectif_id",$formcompany->effectif_array(0), $this->object->effectif_id); // VAT intra - $s =''; - $s.=' '; - if ($conf->use_javascript_ajax) + $s=''; + if (empty($conf->global->MAIN_DISABLEVATCHECK)) { - $s.=''.$langs->trans("VATIntraCheck").''; - $this->tpl['tva_intra'] = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + $s.=' '; + + if ($conf->use_javascript_ajax) + { + $s.=''.$langs->trans("VATIntraCheck").''; + $this->tpl['tva_intra'] = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + } + else + { + $this->tpl['tva_intra'] = $s.'object->id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + } } else { - $this->tpl['tva_intra'] = $s.'object->id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + $this->tpl['tva_intra'] = $s; } - } if ($action == 'view') @@ -154,21 +172,29 @@ class ActionsCardDefault extends ActionsCardCommon } // TVA intra - if ($this->tva_intra) + if ($this->object->tva_intra) { - $s=''; - $s.=$this->object->tva_intra; + $s=$this->object->tva_intra; $s.=''; - $s.=' '; - if ($conf->use_javascript_ajax) + if (empty($conf->global->MAIN_DISABLEVATCHECK)) { - $s.=''.$langs->trans("VATIntraCheck").''; - $this->tpl['tva_intra'] = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + $s.=' '; + + if ($conf->use_javascript_ajax) + { + $s.=''.$langs->trans("VATIntraCheck").''; + $this->tpl['tva_intra'] = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + } + else + { + $this->tpl['tva_intra'] = $s.'object->id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + } } else { - $this->tpl['tva_intra'] = $s.'object->id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + $this->tpl['tva_intra'] = $s; } + } else { diff --git a/htdocs/societe/canvas/default/tpl/card_create.tpl.php b/htdocs/societe/canvas/default/tpl/card_create.tpl.php index a57e86495b0..978fc4df793 100644 --- a/htdocs/societe/canvas/default/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/default/tpl/card_create.tpl.php @@ -33,6 +33,8 @@ control->tpl['ajax_selectcountry']; ?> +control->tpl['js_checkVatPopup']) echo $this->control->tpl['js_checkVatPopup']; ?> +