Move javascript to prepare to mutualize code.
This commit is contained in:
parent
c933b1f22d
commit
46ff6b1a25
@ -789,16 +789,6 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TVA
|
// TVA
|
||||||
if ($conf->use_javascript_ajax)
|
|
||||||
{
|
|
||||||
print "\n";
|
|
||||||
print '<script language="JavaScript" type="text/javascript">';
|
|
||||||
print "function CheckVAT(a) {\n";
|
|
||||||
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,260);\n";
|
|
||||||
print "}\n";
|
|
||||||
print '</script>';
|
|
||||||
print "\n";
|
|
||||||
}
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATIntra").'</td>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATIntra").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -810,6 +800,13 @@ else
|
|||||||
$s.=' ';
|
$s.=' ';
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
|
print "\n";
|
||||||
|
print '<script language="JavaScript" type="text/javascript">';
|
||||||
|
print "function CheckVAT(a) {\n";
|
||||||
|
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,285);\n";
|
||||||
|
print "}\n";
|
||||||
|
print '</script>';
|
||||||
|
print "\n";
|
||||||
$s.='<a href="#" onClick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
|
$s.='<a href="#" onClick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
|
||||||
print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
|
print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -886,6 +886,13 @@ else
|
|||||||
$s.=' ';
|
$s.=' ';
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
|
print "\n";
|
||||||
|
print '<script language="JavaScript" type="text/javascript">';
|
||||||
|
print "function CheckVAT(a) {\n";
|
||||||
|
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,230);\n";
|
||||||
|
print "}\n";
|
||||||
|
print '</script>';
|
||||||
|
print "\n";
|
||||||
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
|
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
|
||||||
print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
|
print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
|
||||||
}
|
}
|
||||||
@ -897,18 +904,6 @@ else
|
|||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Code TVA
|
|
||||||
if ($conf->use_javascript_ajax)
|
|
||||||
{
|
|
||||||
print "\n";
|
|
||||||
print '<script language="JavaScript" type="text/javascript">';
|
|
||||||
print "function CheckVAT(a) {\n";
|
|
||||||
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,230);\n";
|
|
||||||
print "}\n";
|
|
||||||
print '</script>';
|
|
||||||
print "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Local Taxes
|
// Local Taxes
|
||||||
if($mysoc->pays_code=='ES')
|
if($mysoc->pays_code=='ES')
|
||||||
{
|
{
|
||||||
@ -1253,22 +1248,19 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// VAT Code
|
// VAT Code
|
||||||
|
print '<td nowrap="nowrap">'.$langs->trans('VATIntra').'</td>';
|
||||||
|
print '<td nowrap="nowrap">';
|
||||||
|
$s ='<input type="text" class="flat" name="tva_intra" size="12" maxlength="20" value="'.$soc->tva_intra.'">';
|
||||||
|
$s.=' ';
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print "\n";
|
print "\n";
|
||||||
print '<script language="JavaScript" type="text/javascript">';
|
print '<script language="JavaScript" type="text/javascript">';
|
||||||
print "function CheckVAT(a) {\n";
|
print "function CheckVAT(a) {\n";
|
||||||
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,260);\n";
|
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,285);\n";
|
||||||
print "}\n";
|
print "}\n";
|
||||||
print '</script>';
|
print '</script>';
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
|
||||||
print '<td nowrap="nowrap">'.$langs->trans('VATIntra').'</td>';
|
|
||||||
print '<td nowrap="nowrap">';
|
|
||||||
$s ='<input type="text" class="flat" name="tva_intra" size="12" maxlength="20" value="'.$soc->tva_intra.'">';
|
|
||||||
$s.=' ';
|
|
||||||
if ($conf->use_javascript_ajax)
|
|
||||||
{
|
|
||||||
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
|
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
|
||||||
print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
|
print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
|
||||||
}
|
}
|
||||||
@ -1507,16 +1499,6 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// VAT Code
|
// VAT Code
|
||||||
if ($conf->use_javascript_ajax)
|
|
||||||
{
|
|
||||||
print "\n";
|
|
||||||
print '<script language="JavaScript" type="text/javascript">';
|
|
||||||
print "function CheckVAT(a) {\n";
|
|
||||||
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,260);\n";
|
|
||||||
print "}\n";
|
|
||||||
print '</script>';
|
|
||||||
print "\n";
|
|
||||||
}
|
|
||||||
print '<td nowrap="nowrpa">'.$langs->trans('VATIntra').'</td><td>';
|
print '<td nowrap="nowrpa">'.$langs->trans('VATIntra').'</td><td>';
|
||||||
if ($soc->tva_intra)
|
if ($soc->tva_intra)
|
||||||
{
|
{
|
||||||
@ -1526,6 +1508,13 @@ else
|
|||||||
$s.=' ';
|
$s.=' ';
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
|
print "\n";
|
||||||
|
print '<script language="JavaScript" type="text/javascript">';
|
||||||
|
print "function CheckVAT(a) {\n";
|
||||||
|
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,285);\n";
|
||||||
|
print "}\n";
|
||||||
|
print '</script>';
|
||||||
|
print "\n";
|
||||||
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
|
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
|
||||||
print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
|
print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user