diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index db4c1dff209..53f5962f017 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -51,216 +51,216 @@ $error=0; if ( ($action == 'update' && empty($_POST["cancel"])) || ($action == 'updateedit') ) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0); - if (! empty($tmparray['id'])) - { - $mysoc->country_id =$tmparray['id']; - $mysoc->country_code =$tmparray['code']; - $mysoc->country_label=$tmparray['label']; + $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0); + if (! empty($tmparray['id'])) + { + $mysoc->country_id =$tmparray['id']; + $mysoc->country_code =$tmparray['code']; + $mysoc->country_label=$tmparray['label']; - $s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity); - } + $s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label; + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity); + } - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS",$_POST["address"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN",$_POST["town"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP",$_POST["zipcode"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE",$_POST["state_id"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL",$_POST["mail"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB",$_POST["web"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE",$_POST["note"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["barcode"],'chaine',0,'',$conf->entity); - if ($_FILES["logo"]["tmp_name"]) - { - if (preg_match('/([^\\/:]+)$/i',$_FILES["logo"]["name"],$reg)) - { - $original_file=$reg[1]; + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS",$_POST["address"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN",$_POST["town"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP",$_POST["zipcode"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE",$_POST["state_id"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL",$_POST["mail"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB",$_POST["web"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE",$_POST["note"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["barcode"],'chaine',0,'',$conf->entity); + if ($_FILES["logo"]["tmp_name"]) + { + if (preg_match('/([^\\/:]+)$/i',$_FILES["logo"]["name"],$reg)) + { + $original_file=$reg[1]; - $isimage=image_format_supported($original_file); - if ($isimage >= 0) - { - dol_syslog("Move file ".$_FILES["logo"]["tmp_name"]." to ".$conf->mycompany->dir_output.'/logos/'.$original_file); - if (! is_dir($conf->mycompany->dir_output.'/logos/')) - { - dol_mkdir($conf->mycompany->dir_output.'/logos/'); - } - $result=dol_move_uploaded_file($_FILES["logo"]["tmp_name"],$conf->mycompany->dir_output.'/logos/'.$original_file,1,0,$_FILES['logo']['error']); - if ($result > 0) - { - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file,'chaine',0,'',$conf->entity); - - // Create thumbs of logo (Note that PDF use original file and not thumbs) - if ($isimage > 0) - { - // Create small thumbs for company (Ratio is near 16/9) - // Used on logon for example - $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); - if (preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) - { - $imgThumbSmall = $reg[1]; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); - } - else dol_syslog($imgThumbSmall); - - // Create mini thumbs for company (Ratio is near 16/9) - // Used on menu or for setup page for example - $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); - if (preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) - { - $imgThumbMini = $reg[1]; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); - } - else dol_syslog($imgThumbMini); - } - else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING); - } - else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) - { - $error++; - $langs->load("errors"); - $tmparray=explode(':',$result); - setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors'); - } - else - { - $error++; - setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors'); - } - } - else + $isimage=image_format_supported($original_file); + if ($isimage >= 0) { - $error++; - $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); - } - } - } - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS",$_POST["MAIN_INFO_SOCIETE_MANAGERS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_PROFID5",$_POST["MAIN_INFO_PROFID5"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_PROFID6",$_POST["MAIN_INFO_PROFID6"],'chaine',0,'',$conf->entity); + dol_syslog("Move file ".$_FILES["logo"]["tmp_name"]." to ".$conf->mycompany->dir_output.'/logos/'.$original_file); + if (! is_dir($conf->mycompany->dir_output.'/logos/')) + { + dol_mkdir($conf->mycompany->dir_output.'/logos/'); + } + $result=dol_move_uploaded_file($_FILES["logo"]["tmp_name"],$conf->mycompany->dir_output.'/logos/'.$original_file,1,0,$_FILES['logo']['error']); + if ($result > 0) + { + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file,'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"],'chaine',0,'',$conf->entity); + // Create thumbs of logo (Note that PDF use original file and not thumbs) + if ($isimage > 0) + { + // Create small thumbs for company (Ratio is near 16/9) + // Used on logon for example + $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); + if (preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) + { + $imgThumbSmall = $reg[1]; + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); + } + else dol_syslog($imgThumbSmall); + + // Create mini thumbs for company (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); + if (preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) + { + $imgThumbMini = $reg[1]; + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); + } + else dol_syslog($imgThumbMini); + } + else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING); + } + else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) + { + $error++; + $langs->load("errors"); + $tmparray=explode(':',$result); + setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors'); + } + else + { + $error++; + setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors'); + } + } + else + { + $error++; + $langs->load("errors"); + setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + } + } + } + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS",$_POST["MAIN_INFO_SOCIETE_MANAGERS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_PROFID5",$_POST["MAIN_INFO_PROFID5"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_PROFID6",$_POST["MAIN_INFO_PROFID6"],'chaine',0,'',$conf->entity); + + dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT",$_POST["object"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START",$_POST["fiscalmonthstart"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START",$_POST["fiscalmonthstart"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "FACTURE_TVAOPTION",$_POST["optiontva"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FACTURE_TVAOPTION",$_POST["optiontva"],'chaine',0,'',$conf->entity); - // Local taxes - dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity); + // Local taxes + dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity); - if($_POST["optionlocaltax1"]=="localtax1on") - { - if(!isset($_REQUEST['lt1'])) - { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0,'chaine',0,'',$conf->entity); - } - else - { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1'),'chaine',0,'',$conf->entity); - } - dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", $_POST["clt1"],'chaine',0,'',$conf->entity); - } - if($_POST["optionlocaltax2"]=="localtax2on") - { - if(!isset($_REQUEST['lt2'])) - { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0,'chaine',0,'',$conf->entity); - } - else - { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2'),'chaine',0,'',$conf->entity); - } - dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", $_POST["clt2"],'chaine',0,'',$conf->entity); - } + if($_POST["optionlocaltax1"]=="localtax1on") + { + if(!isset($_REQUEST['lt1'])) + { + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0,'chaine',0,'',$conf->entity); + } + else + { + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1'),'chaine',0,'',$conf->entity); + } + dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", $_POST["clt1"],'chaine',0,'',$conf->entity); + } + if($_POST["optionlocaltax2"]=="localtax2on") + { + if(!isset($_REQUEST['lt2'])) + { + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0,'chaine',0,'',$conf->entity); + } + else + { + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2'),'chaine',0,'',$conf->entity); + } + dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", $_POST["clt2"],'chaine',0,'',$conf->entity); + } - if ($action != 'updateedit' && ! $error) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } + if ($action != 'updateedit' && ! $error) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } } if ($action == 'addthumb') { - if (file_exists($conf->mycompany->dir_output.'/logos/'.$_GET["file"])) - { - $isimage=image_format_supported($_GET["file"]); + if (file_exists($conf->mycompany->dir_output.'/logos/'.$_GET["file"])) + { + $isimage=image_format_supported($_GET["file"]); - // Create thumbs of logo - if ($isimage > 0) - { - // Create small thumbs for company (Ratio is near 16/9) - // Used on logon for example - $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) - { - $imgThumbSmall = $reg[1]; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); - } - else dol_syslog($imgThumbSmall); + // Create thumbs of logo + if ($isimage > 0) + { + // Create small thumbs for company (Ratio is near 16/9) + // Used on logon for example + $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) + { + $imgThumbSmall = $reg[1]; + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); + } + else dol_syslog($imgThumbSmall); - // Create mini thumbs for company (Ratio is near 16/9) - // Used on menu or for setup page for example - $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini',$quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) - { - $imgThumbMini = $reg[1]; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); - } - else dol_syslog($imgThumbMini); + // Create mini thumbs for company (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini',$quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) + { + $imgThumbMini = $reg[1]; + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); + } + else dol_syslog($imgThumbMini); - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - $error++; - $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); - dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); - } - } - else - { - $error++; - $langs->load("errors"); - setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors'); - dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); - } + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + $error++; + $langs->load("errors"); + setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); + } + } + else + { + $error++; + $langs->load("errors"); + setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors'); + dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); + } } if ($action == 'removelogo') { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; - dol_delete_file($logofile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO",$conf->entity); - $mysoc->logo=''; + $logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; + dol_delete_file($logofile); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO",$conf->entity); + $mysoc->logo=''; - $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; - dol_delete_file($logosmallfile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity); - $mysoc->logo_small=''; + $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; + dol_delete_file($logosmallfile); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity); + $mysoc->logo_small=''; - $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; - dol_delete_file($logominifile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity); - $mysoc->logo_mini=''; + $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; + dol_delete_file($logominifile); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity); + $mysoc->logo_mini=''; } @@ -284,829 +284,821 @@ print "
\n"; if ($action == 'edit' || $action == 'updateedit') { - /** - * Edition des parametres - */ - print "\n".''."\n"; + /** + * Edition des parametres + */ + print "\n".''."\n"; - print '
'; - print ''; - print ''; - $var=true; + print ''; + print ''; + print ''; + $var=true; - print ''; - print ''."\n"; + print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; + print ''."\n"; - $var=!$var; - print ''."\n"; + $var=!$var; + print ''."\n"; - $var=!$var; - print ''."\n"; + $var=!$var; + print ''."\n"; - $var=!$var; - print ''."\n"; + $var=!$var; + print ''."\n"; - $var=!$var; - print ''."\n"; + $var=!$var; + print ''."\n"; - // Country - $var=!$var; - print ''."\n"; + // Country + $var=!$var; + print ''."\n"; - $var=!$var; - print ''."\n"; + $var=!$var; + print ''."\n"; - $var=!$var; - print ''."\n"; + $var=!$var; + print ''."\n"; - $var=!$var; - print ''; - print ''."\n"; + $var=!$var; + print ''; + print ''."\n"; - $var=!$var; - print ''; - print ''."\n"; + $var=!$var; + print ''; + print ''."\n"; - $var=!$var; - print ''; - print ''."\n"; + $var=!$var; + print ''; + print ''."\n"; - // Web - $var=!$var; - print ''; - print ''."\n"; + // Web + $var=!$var; + print ''; + print ''."\n"; - // Barcode - if (! empty($conf->barcode->enabled)) - { - $var=!$var; - print ''; - print ''; - } + // Barcode + if (! empty($conf->barcode->enabled)) { + $var=!$var; + print ''; + print ''; + } - // Logo - $var=!$var; - print ''; + // Logo + $var=!$var; + print ''; - // Note - $var=!$var; - print ''; - print ''; + // Note + $var=!$var; + print ''; + print ''; - print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; + print '
'; - //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization - print $form->select_country($mysoc->country_id,'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - print '
'; + //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization + print $form->select_country($mysoc->country_id,'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print '
'; - $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); - print '
'; + $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); + print '
'; - print $form->selectCurrency($conf->currency,"currency"); - print '
'; + print $form->selectCurrency($conf->currency,"currency"); + print '
'; - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; - print ''; - print ''; - if (! empty($mysoc->logo_mini)) - { - print ''.img_delete($langs->trans("Delete")).''; - if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) - { - print '   '; - print ''; - } - } - else - { - print ''; - } - print '
'; - print '
'; + print '
'; + print ''; + print ''; + if (! empty($mysoc->logo_mini)) { + print ''.img_delete($langs->trans("Delete")).''; + if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { + print '   '; + print ''; + } + } else { + print ''; + } + print '
'; + print '
'; - print '
'; + print '
'; + print ''; - print '
'; + print '
'; - // Identifiants de la societe (country-specific) - print ''; - print ''; - $var=true; + // Identifiants de la societe (country-specific) + print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; + print ''; + $var=true; - $langs->load("companies"); + $langs->load("companies"); - // Managing Director(s) - $var=!$var; - print ''; + // Managing Director(s) + $var=!$var; + print ''; - // Capital - $var=!$var; - print ''; + // Capital + $var=!$var; + print ''; - // Forme juridique - $var=!$var; - print ''; + // Forme juridique + $var=!$var; + print ''; - // ProfID1 - if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfID1 + if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId2 - if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId2 + if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId3 - if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId3 + if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId4 - if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId4 + if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId5 - if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId5 + if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId6 - if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId6 + if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // TVA Intra - $var=!$var; - print ''; + // TVA Intra + $var=!$var; + print ''; // Object of the company - $var=!$var; - print ''; - print ''; + $var=!$var; + print ''; + print ''; - print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; - print '
'; + print '
'; - print '
'; + print '
'; - if ($mysoc->country_code) - { - print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'legal_form'); - } - else - { - print $countrynotdefined; - } - print '
'; + if ($mysoc->country_code) { + print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'legal_form'); + } else { + print $countrynotdefined; + } + print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; - print ''; - print '
'; + print ''; + print '
'; - print '
'; + print '
'; + print ''; - // Fiscal year start - print '
'; - print ''; - print ''; - print ''; - print "\n"; - $var=true; + // Fiscal year start + print '
'; + print '
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
'; + print ''; + print ''; + print "\n"; + $var=true; - $var=!$var; - print ''; + $var=!$var; + print ''; - print "
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
'; - print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '
'; + print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '
"; + print ""; - // Fiscal options - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - $var=true; + // Fiscal options + print '
'; + print '
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; + print ''; + print ''; + print ''; + print "\n"; + $var=true; - $var=!$var; - print ""; - print '\n"; + $var=!$var; + print ""; + print '\n"; - $var=!$var; - print ""; - print '\n"; + $var=!$var; + print ""; + print '\n"; - print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; - print ""; - print ""; - print "\n"; - print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; - print "
'; + print ""; + print ""; + print "\n"; + print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; + print "
'; - print ""; - print ""; - print "\n"; - print "
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; - print "
'; + print ""; + print ""; + print "\n"; + print "
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; + print "
"; + print ""; - /* - * Local Taxes - */ - if ($mysoc->useLocalTax(1)) - { - // Local Tax 1 - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - $var=true; - $var=!$var; - // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; - print '\n"; - $var=!$var; - print ""; - print '\n"; - print "
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsUsedExample"?"\n":""); - if(! isOnlyOneLocalTax(1)) - { - print ''; + /* + * Local Taxes + */ + if ($mysoc->useLocalTax(1)) + { + // Local Tax 1 + print '
'; + print '
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
: '; - $formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); - } - print '
'; + print ''; + print ''; + print ''; + print "\n"; + $var=true; + $var=!$var; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option + print ""; + print '\n"; + print ''; + print "
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; + print ""; + print ""; + $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); + print ($example!="LocalTax1IsUsedExample"?"\n":""); + if(! isOnlyOneLocalTax(1)) + { + print ''; - $opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc")); + $opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc")); - print ''; - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
: '; + $formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); + } + print '
'.$langs->trans("CalcLocaltax").': '; - print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); - print '
"; - print "
'.$langs->trans("CalcLocaltax").': '; + print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); + print '
"; + print "
global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsNotUsedExample"?"\n":""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
"; - print "
"; + $var=!$var; + print "global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code).""; + print ''; + print ""; + print ""; + $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); + print ($example!="LocalTax1IsNotUsedExample"?"\n":""); + print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
"; + print "\n"; + print ""; } - if ($mysoc->useLocalTax(2)) - { - // Local Tax 2 - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - $var=true; + if ($mysoc->useLocalTax(2)) + { + // Local Tax 2 + print '
'; + print '
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").' 
'; + print ''; + print ''; + print ''; + print "\n"; + $var=true; - $var=!$var; - // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; - print '\n"; + $var=!$var; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option + print ""; + print '\n"; - $var=!$var; - print ""; - print '\n"; - print "
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsUsedExample"?"\n":""); - print ''; - } - print ''; - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
: '; - if(! isOnlyOneLocalTax(2)) - { - $formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); - print '
: '; - print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); - print '
"; - print "
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; + print ""; + print ""; + $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); + print ($example!="LocalTax2IsUsedExample"?"\n":""); + print ''; + } + print ''; + print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
: '; + if(! isOnlyOneLocalTax(2)) + { + $formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); + print '
: '; + print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); + print '
"; + print "
global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsNotUsedExample"?"\n":""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
"; - print "
"; - } + $var=!$var; + print "global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code).""; + print ''; + print ""; + print ""; + $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); + print ($example!="LocalTax2IsNotUsedExample"?"\n":""); + print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
"; + print "\n"; + print ""; + } - print '
'; - print ''; - print '     '; - print ''; - print '
'; - print '
'; + print '
'; + print ''; + print '     '; + print ''; + print '
'; + print '
'; - print '
'; + print ''; } else { - /* - * Show parameters - */ + /* + * Show parameters + */ - // Actions buttons - //print '
'; - //print ''.$langs->trans("Modify").''; - //print '

'; + // Actions buttons + //print '
'; + //print ''.$langs->trans("Modify").''; + //print '

'; - print ''; - print ''; - $var=true; + print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; + print ''; + $var=true; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - // Web - $var=!$var; - print ''; + // Web + $var=!$var; + print ''; - // Barcode - if (! empty($conf->barcode->enabled)) - { - $var=!$var; - print ''; - } + // Barcode + if (! empty($conf->barcode->enabled)) + { + $var=!$var; + print ''; + } - // Logo - $var=!$var; - print ''; + print ''; - $var=!$var; - print ''; + $var=!$var; + print ''; - print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").''; - if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; - else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).''; - print '
'.$langs->trans("CompanyName").''; + if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; + else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).''; + print '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '
'.$langs->trans("CompanyCountry").''; - if ($mysoc->country_code) - { - $img=picto_from_langcode($mysoc->country_code); - print $img?$img.' ':''; - print getCountry($mysoc->country_code,1); - } - else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - print '
'.$langs->trans("CompanyCountry").''; + if ($mysoc->country_code) + { + $img=picto_from_langcode($mysoc->country_code); + print $img?$img.' ':''; + print getCountry($mysoc->country_code,1); + } + else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; + print '
'.$langs->trans("State").''; - if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE); - else print ' '; - print '
'.$langs->trans("State").''; + if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE); + else print ' '; + print '
'.$langs->trans("CompanyCurrency").''; - print currency_name($conf->currency,1); - print ' ('.$langs->getCurrencySymbol($conf->currency).')'; - print '
'.$langs->trans("CompanyCurrency").''; + print currency_name($conf->currency,1); + print ' ('.$langs->getCurrencySymbol($conf->currency).')'; + print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '
'.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '
'.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '
'.$langs->trans("Logo").''; + // Logo + $var=!$var; + print '
'.$langs->trans("Logo").''; - print '
'; - print $mysoc->logo; - print ''; + print '
'; + print $mysoc->logo; + print ''; - // On propose la generation de la vignette si elle n'existe pas - if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i',$mysoc->logo)) - { - print 'logo).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; - } - else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) - { - print ''; - } - else - { - print ''; - } - print '
'; + // On propose la generation de la vignette si elle n'existe pas + if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i',$mysoc->logo)) + { + print 'logo).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; + } + else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + { + print ''; + } + else + { + print ''; + } + print '
'; - print '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '
'; + print ''; - print '
'; + print '
'; - // Identifiants de la societe (country-specific) - print '
'; - print ''; - print ''; - print ''; - $var=true; + // Identifiants de la societe (country-specific) + print ''; + print ''; + print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; + print ''; + $var=true; - // Managing Director(s) - $var=!$var; - print ''; + // Managing Director(s) + $var=!$var; + print ''; - // Capital - $var=!$var; - print ''; + // Capital + $var=!$var; + print ''; - // Forme juridique - $var=!$var; - print ''; + // Forme juridique + $var=!$var; + print ''; - // ProfId1 - if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId1 + if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId2 - if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId2 + if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId3 - if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId3 + if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId4 - if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId4 + if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId5 - if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId5 + if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // ProfId6 - if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') - { - $var=!$var; - print ''; - } + // ProfId6 + if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') + { + $var=!$var; + print ''; + } - // TVA - $var=!$var; - print ''; - print ''; - print ''; + // TVA + $var=!$var; + print ''; + print ''; + print ''; $var=!$var; - print ''; + print ''; - print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->trans("ManagingDirectors").''; - print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '
'.$langs->trans("ManagingDirectors").''; + print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '
'.$langs->trans("Capital").''; - print $conf->global->MAIN_INFO_CAPITAL . '
'.$langs->trans("Capital").''; + print $conf->global->MAIN_INFO_CAPITAL . '
'.$langs->trans("JuridicalStatus").''; - print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); - print '
'.$langs->trans("JuridicalStatus").''; + print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); + print '
'.$langs->transcountry("ProfId1",$mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_SIREN)) - { - print $conf->global->MAIN_INFO_SIREN; - if ($mysoc->country_code == 'FR') print '   '.$langs->trans("Check").''; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId1",$mysoc->country_code).''; + if (! empty($conf->global->MAIN_INFO_SIREN)) + { + print $conf->global->MAIN_INFO_SIREN; + if ($mysoc->country_code == 'FR') print '   '.$langs->trans("Check").''; + } else { + print ' '; + } + print '
'.$langs->transcountry("ProfId2",$mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_SIRET)) - { - print $conf->global->MAIN_INFO_SIRET; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId2",$mysoc->country_code).''; + if (! empty($conf->global->MAIN_INFO_SIRET)) + { + print $conf->global->MAIN_INFO_SIRET; + } else { + print ' '; + } + print '
'.$langs->transcountry("ProfId3",$mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_APE)) - { - print $conf->global->MAIN_INFO_APE; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId3",$mysoc->country_code).''; + if (! empty($conf->global->MAIN_INFO_APE)) + { + print $conf->global->MAIN_INFO_APE; + } else { + print ' '; + } + print '
'.$langs->transcountry("ProfId4",$mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_RCS)) - { - print $conf->global->MAIN_INFO_RCS; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId4",$mysoc->country_code).''; + if (! empty($conf->global->MAIN_INFO_RCS)) + { + print $conf->global->MAIN_INFO_RCS; + } else { + print ' '; + } + print '
'.$langs->transcountry("ProfId5",$mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_PROFID5)) - { - print $conf->global->MAIN_INFO_PROFID5; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId5",$mysoc->country_code).''; + if (! empty($conf->global->MAIN_INFO_PROFID5)) + { + print $conf->global->MAIN_INFO_PROFID5; + } else { + print ' '; + } + print '
'.$langs->transcountry("ProfId6",$mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_PROFID6)) - { - print $conf->global->MAIN_INFO_PROFID6; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId6",$mysoc->country_code).''; + if (! empty($conf->global->MAIN_INFO_PROFID6)) + { + print $conf->global->MAIN_INFO_PROFID6; + } else { + print ' '; + } + print '
'.$langs->trans("VATIntra").''; - if (! empty($conf->global->MAIN_INFO_TVAINTRA)) - { - $s=''; - $s.=$conf->global->MAIN_INFO_TVAINTRA; - $s.=''; - if (empty($conf->global->MAIN_DISABLEVATCHECK)) - { - $s.='   '; - if (! empty($conf->use_javascript_ajax)) - { - print "\n"; - print ''; - print "\n"; - $s.=''.$langs->trans("VATIntraCheck").''; - $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); - } - else - { - $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; - } - } - print $s; - } - else - { - print ' '; - } - print '
'.$langs->trans("VATIntra").''; + if (! empty($conf->global->MAIN_INFO_TVAINTRA)) + { + $s=''; + $s.=$conf->global->MAIN_INFO_TVAINTRA; + $s.=''; + if (empty($conf->global->MAIN_DISABLEVATCHECK)) + { + $s.='   '; + if (! empty($conf->use_javascript_ajax)) + { + print "\n"; + print ''; + print "\n"; + $s.=''.$langs->trans("VATIntraCheck").''; + $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + } + else + { + $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + } + } + print $s; + } + else + { + print ' '; + } + print '
'.$langs->trans("CompanyObject").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '
'.$langs->trans("CompanyObject").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '
'; - print '
'; + print ''; + print ''; - /* - * Debut d'annee fiscale - */ - print '
'; - print ''; - print ''; - print ''; - print "\n"; - $var=true; + /* + * Debut d'annee fiscale + */ + print '
'; + print '
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
'; + print ''; + print ''; + print "\n"; + $var=true; - $var=!$var; - print ''; + $var=!$var; + print ''; - print "
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
'.$langs->trans("FiscalMonthStart").''; - $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; - print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . '
'.$langs->trans("FiscalMonthStart").''; + $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; + print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . '
"; + print ""; - /* - * Options fiscale - */ - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - $var=true; + /* + * Options fiscale + */ + print '
'; + print '
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; + print ''; + print ''; + print ''; + print "\n"; + $var=true; - $var=!$var; - print ""; - print '\n"; + $var=!$var; + print ""; + print '\n"; - $var=!$var; - print ""; - print '\n"; + $var=!$var; + print ""; + print '\n"; - print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."'; - print ""; - print ""; - print "\n"; - print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; - print "
global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."'; + print ""; + print ""; + print "\n"; + print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; + print "
global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."'; - print ""; - print ""; - print "\n"; - print "
".$langs->trans("VATIsNotUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; - print "
global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."'; + print ""; + print ""; + print "\n"; + print "
".$langs->trans("VATIsNotUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; + print "
"; + print ""; - /* - * Local Taxes - */ - if ($mysoc->useLocalTax(1)) - { - // Local Tax 1 - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - $var=true; + /* + * Local Taxes + */ + if ($mysoc->useLocalTax(1)) + { + // Local Tax 1 + print '
'; + print '
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").' 
'; + print ''; + print ''; + print ''; + print "\n"; + $var=true; - $var=!$var; - print ""; - print '\n"; - $var=!$var; - print ""; - print '\n"; + $var=!$var; + print ""; + print '\n"; - print "
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsUsedExample"?"\n":""); - if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0) - { - print ''; - } - print '"; + print '\n"; + print ''; + print "
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .'
'.$langs->trans("CalcLocaltax").': '; - if($conf->global->MAIN_INFO_LOCALTAX_CALC1==0) - { - print $langs->transcountry("CalcLocaltax1",$mysoc->country_code); - } - else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==1) - { - print $langs->transcountry("CalcLocaltax2",$mysoc->country_code); - } - else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){ - print $langs->transcountry("CalcLocaltax3",$mysoc->country_code); - } + $var=!$var; + print "
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; + print ""; + print ""; + $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); + print ($example!="LocalTax1IsUsedExample"?"\n":""); + if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0) + { + print ''; + } + print ''; - print "
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .'
'.$langs->trans("CalcLocaltax").': '; + if($conf->global->MAIN_INFO_LOCALTAX_CALC1==0) + { + print $langs->transcountry("CalcLocaltax1",$mysoc->country_code); + } + else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==1) + { + print $langs->transcountry("CalcLocaltax2",$mysoc->country_code); + } + else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){ + print $langs->transcountry("CalcLocaltax3",$mysoc->country_code); + } - print '
"; - print "
"; + print "
global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsNotUsedExample"?"\n":""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
"; - print "
global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; + print ""; + print ""; + $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); + print ($example!="LocalTax1IsNotUsedExample"?"\n":""); + print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
"; + print "
"; + print ""; } - if ($mysoc->useLocalTax(2)) - { - // Local Tax 2 - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - $var=true; + if ($mysoc->useLocalTax(2)) + { + // Local Tax 2 + print '
'; + print '
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").' 
'; + print ''; + print ''; + print ''; + print "\n"; + $var=true; - $var=!$var; - print ""; - print '\n"; - $var=!$var; - print ""; - print '\n"; + $var=!$var; + print ""; + print '\n"; - print "
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsUsedExample"?"\n":""); - if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0) - { - print ''; - } - print '"; + print '\n"; + print ''; + print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .'
'.$langs->trans("CalcLocaltax").': '; - if($conf->global->MAIN_INFO_LOCALTAX_CALC2==0) - { - print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc"); - } - else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1) - { - print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"); - } - else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2) - { - print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"); - } + $var=!$var; + print "
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; + print ""; + print ""; + $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); + print ($example!="LocalTax2IsUsedExample"?"\n":""); + if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0) + { + print ''; + } + print ''; - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .'
'.$langs->trans("CalcLocaltax").': '; + if($conf->global->MAIN_INFO_LOCALTAX_CALC2==0) + { + print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc"); + } + else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1) + { + print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"); + } + else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2) + { + print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"); + } - print '
"; - print "
"; + print "
global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsNotUsedExample"?"\n":""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
"; - print "
global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; + print ""; + print ""; + $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); + print ($example!="LocalTax2IsNotUsedExample"?"\n":""); + print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
"; + print "
"; - } + print ""; + } - // Actions buttons - print '
'; - print '
'.$langs->trans("Modify").'
'; - print '
'; + // Actions buttons + print '
'; + print '
'.$langs->trans("Modify").'
'; + print '
'; - print '
'; + print '
'; } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index e0a863a4f28..85752367334 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -21,7 +21,7 @@ /** * \file htdocs/compta/tva/clients.php - * \ingroup tax + * \ingroup tax * \brief Page des societes */ @@ -51,53 +51,53 @@ $date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startd $date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); // Quarter if (empty($date_start) || empty($date_end)) {// We define date_start and date_end - $q=GETPOST("q"); - if (empty($q)) { + $q=GETPOST("q"); + if (empty($q)) { if (isset($_REQUEST["month"])) { - $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); - $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); - } else { - $month_current = strftime("%m",dol_now()); - if ($month_current >= 10) $q=4; - elseif ($month_current >= 7) $q=3; - elseif ($month_current >= 4) $q=2; - else $q=1; + $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); + $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); + } else { + $month_current = strftime("%m",dol_now()); + if ($month_current >= 10) $q=4; + elseif ($month_current >= 7) $q=3; + elseif ($month_current >= 4) $q=2; + else $q=1; } } if ($q==1) { - $date_start=dol_get_first_day($year_start,1,false); - $date_end=dol_get_last_day($year_start,3,false); - } + $date_start=dol_get_first_day($year_start,1,false); + $date_end=dol_get_last_day($year_start,3,false); + } if ($q==2) { - $date_start=dol_get_first_day($year_start,4,false); - $date_end=dol_get_last_day($year_start,6,false); - } + $date_start=dol_get_first_day($year_start,4,false); + $date_end=dol_get_last_day($year_start,6,false); + } if ($q==3) { - $date_start=dol_get_first_day($year_start,7,false); - $date_end=dol_get_last_day($year_start,9,false); - } + $date_start=dol_get_first_day($year_start,7,false); + $date_end=dol_get_last_day($year_start,9,false); + } if ($q==4) { - $date_start=dol_get_first_day($year_start,10,false); - $date_end=dol_get_last_day($year_start,12,false); - } + $date_start=dol_get_first_day($year_start,10,false); + $date_end=dol_get_last_day($year_start,12,false); + } } $min = GETPOST("min"); if (empty($min)) { - $min = 0; + $min = 0; } // Define modetax (0 or 1) // 0=normal, 1=option vat for services is on debit $modetax = $conf->global->TAX_MODE; if (isset($_REQUEST["modetax"])) { - $modetax=$_REQUEST["modetax"]; + $modetax=$_REQUEST["modetax"]; } // Security check $socid = GETPOST('socid','int'); if ($user->societe_id) { - $socid=$user->societe_id; + $socid=$user->societe_id; } $result = restrictedArea($user, 'tax', '', '', 'charges'); @@ -113,14 +113,14 @@ $company_static=new Societe($db); $morequerystring=''; $listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday'); foreach($listofparams as $param) { - if (GETPOST($param)!='') { - $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); - } + if (GETPOST($param)!='') { + $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); + } } $special_report = false; if (isset($_REQUEST['extra_report']) && $_REQUEST['extra_report'] == 1) { - $special_report = true; + $special_report = true; } llxHeader('','','','',0,0,'','',$morequerystring); @@ -133,91 +133,91 @@ $fsearch.=' '; // Affiche en-tete du rapport if ($modetax==1) { // Calculate on invoice for goods and services - $name=$langs->trans("VATReportByCustomersInDueDebtMode"); + $name=$langs->trans("VATReportByCustomersInDueDebtMode"); $calcmode=$langs->trans("CalcModeVATDebt"); - $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; - //$name.='
('.$langs->trans("SeeVATReportInInputOutputMode",'','').')'; - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); - $description=$langs->trans("RulesVATDueServices"); - $description.='
'; - $description.=$langs->trans("RulesVATDueProducts"); - //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $description.='
'.$langs->trans("DepositsAreNotIncluded"); - } else { - $description.='
'.$langs->trans("DepositsAreIncluded"); - } + $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; + //$name.='
('.$langs->trans("SeeVATReportInInputOutputMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $description=$langs->trans("RulesVATDueServices"); + $description.='
'; + $description.=$langs->trans("RulesVATDueProducts"); + //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description.='
'.$langs->trans("DepositsAreNotIncluded"); + } else { + $description.='
'.$langs->trans("DepositsAreIncluded"); + } $description.=$fsearch; - $description.='
' - . ' ' - . $langs->trans('SimpleReport') - . '' - . '
' - . ' ' - . $langs->trans('AddExtraReport') - . '' - . '
'; + $description.='
' + . ' ' + . $langs->trans('SimpleReport') + . '' + . '
' + . ' ' + . $langs->trans('AddExtraReport') + . '' + . '
'; $builddate=time(); - //$exportlink=$langs->trans("NotYetAvailable"); + //$exportlink=$langs->trans("NotYetAvailable"); $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("Description"); $amountcust=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; - } + $vatcust.=' ('.$langs->trans("ToPay").')'; + } $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("Description"); $amountsup=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { - $vatsup.=' ('.$langs->trans("ToGetBack").')'; - } + $vatsup.=' ('.$langs->trans("ToGetBack").')'; + } } if ($modetax==0) { // Invoice for goods, payment for services - $name=$langs->trans("VATReportByCustomersInInputOutputMode"); - $calcmode=$langs->trans("CalcModeVATEngagement"); - $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; - //$name.='
('.$langs->trans("SeeVATReportInDueDebtMode",'','').')'; - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); - $description=$langs->trans("RulesVATInServices"); - $description.=' '.$langs->trans("DepositsAreIncluded"); - $description.='
'; - $description.=$langs->trans("RulesVATInProducts"); - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $description .= ' ' . $langs->trans("DepositsAreNotIncluded"); - } else { - $description .= ' ' . $langs->trans("DepositsAreIncluded"); - } - //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); - $description.=$fsearch; - $description.='
' - . ' ' - . $langs->trans('SimpleReport') - . '' - . '
' - . ' ' - . $langs->trans('AddExtraReport') - . '' - . '
'; - $builddate=time(); - //$exportlink=$langs->trans("NotYetAvailable"); + $name=$langs->trans("VATReportByCustomersInInputOutputMode"); + $calcmode=$langs->trans("CalcModeVATEngagement"); + $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; + //$name.='
('.$langs->trans("SeeVATReportInDueDebtMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $description=$langs->trans("RulesVATInServices"); + $description.=' '.$langs->trans("DepositsAreIncluded"); + $description.='
'; + $description.=$langs->trans("RulesVATInProducts"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= ' ' . $langs->trans("DepositsAreNotIncluded"); + } else { + $description .= ' ' . $langs->trans("DepositsAreIncluded"); + } + //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + $description.=$fsearch; + $description.='
' + . ' ' + . $langs->trans('SimpleReport') + . '' + . '
' + . ' ' + . $langs->trans('AddExtraReport') + . '' + . '
'; + $builddate=time(); + //$exportlink=$langs->trans("NotYetAvailable"); $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("Description"); $amountcust=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; - } + $vatcust.=' ('.$langs->trans("ToPay").')'; + } $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("Description"); $amountsup=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { - $vatsup.=' ('.$langs->trans("ToGetBack").')'; - } + $vatsup.=' ('.$langs->trans("ToGetBack").')'; + } } report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); @@ -278,27 +278,27 @@ if (is_array($coll_list)) { print ''.$intra.""; print "".price($coll->amount).""; print "".price($coll->tva).""; - $totalamount = $totalamount + $coll->amount; + $totalamount = $totalamount + $coll->amount; $total = $total + $coll->tva; print "\n"; $i++; } } - $x_coll_sum = $total; + $x_coll_sum = $total; print ''.$langs->trans("Total").':'; - print ''.price($totalamount).''; + print ''.price($totalamount).''; print ''.price($total).''; print ''; } else { $langs->load("errors"); if ($coll_list == -1) { - print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; - } else if ($coll_list == -2) { - print '' . $langs->trans("FeatureNotYetAvailable") . ''; - } else { - print '' . $langs->trans("Error") . ''; - } + print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + } else if ($coll_list == -2) { + print '' . $langs->trans("FeatureNotYetAvailable") . ''; + } else { + print '' . $langs->trans("Error") . ''; + } } //print ''; @@ -351,199 +351,196 @@ if (is_array($coll_list)) { print ''.$intra.""; print "".price($coll->amount).""; print "".price($coll->tva).""; - $totalamount = $totalamount + $coll->amount; + $totalamount = $totalamount + $coll->amount; $total = $total + $coll->tva; print "\n"; $i++; } } - $x_paye_sum = $total; + $x_paye_sum = $total; print ''.$langs->trans("Total").':'; - print ''.price($totalamount).''; + print ''.price($totalamount).''; print ''.price($total).''; print ''; print ''; - // Total to pay - print '

'; - print ''; - $diff = $x_coll_sum - $x_paye_sum; - print ''; - print ''; - print '\n"; - print "\n"; + // Total to pay + print '

'; + print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."
'; + $diff = $x_coll_sum - $x_paye_sum; + print ''; + print ''; + print '\n"; + print "\n"; } else { $langs->load("errors"); if ($coll_list == -1) { - print ''; - } else if ($coll_list == -2) { - print ''; - } else { - print ''; - } + print ''; + } else if ($coll_list == -2) { + print ''; + } else { + print ''; + } } print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
'; if ($special_report) { - // Get country 2-letters code - global $mysoc; - $country_id = $mysoc->country_id; - $country = new Ccountry($db); - $country->fetch($country_id); + // Get country 2-letters code + global $mysoc; + $country_id = $mysoc->country_id; + $country = new Ccountry($db); + $country->fetch($country_id); - // Print listing of other-country customers as additional report - // This matches tax requirements to list all same-country customers (only) - print '

'.$langs->trans('OtherCountriesCustomersReport').'

'; - print $langs->trans('BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry'); - $coll_list = vat_by_thirdparty($db, 0, $date_start, $date_end, $modetax, - 'sell'); + // Print listing of other-country customers as additional report + // This matches tax requirements to list all same-country customers (only) + print '

'.$langs->trans('OtherCountriesCustomersReport').'

'; + print $langs->trans('BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry'); + $coll_list = vat_by_thirdparty($db, 0, $date_start, $date_end, $modetax, 'sell'); - print ""; - print ""; - print '"; - print '"; - print ""; - print ""; - print ""; - print "\n"; + print "
' . $langs->trans("Num") . "' . $langs->trans("Customer") . "" . $langs->trans("VATIntra") . "" . $langs->trans("AmountHTVATRealReceived") . "" . $vatcust . "
"; + print ""; + print '"; + print '"; + print ""; + print ""; + print ""; + print "\n"; - if (is_array($coll_list)) { - $var = true; - $total = 0; - $totalamount = 0; - $i = 1; - foreach ($coll_list as $coll) { - if (substr($coll->tva_intra, 0, 2) == $country->code) { - // Only use different-country VAT codes - continue; - } - if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - $var = !$var; - $intra = str_replace($find, $replace, $coll->tva_intra); - if (empty($intra)) { - if ($coll->assuj == '1') { - $intra = $langs->trans('Unknown'); - } else { - //$intra = $langs->trans('NotRegistered'); - $intra = ''; - } - } - print ""; - print '"; - $company_static->id = $coll->socid; - $company_static->name = $coll->name; - $company_static->client = 1; - print ''; - $find = array(' ', '.'); - $replace = array('', ''); - print '"; - print ""; - print ""; - $totalamount = $totalamount + $coll->amount; - $total = $total + $coll->tva; - print "\n"; - $i++; - } - } - $x_coll_sum = $total; + if (is_array($coll_list)) { + $var = true; + $total = 0; + $totalamount = 0; + $i = 1; + foreach ($coll_list as $coll) { + if (substr($coll->tva_intra, 0, 2) == $country->code) { + // Only use different-country VAT codes + continue; + } + if ($min == 0 or ($min > 0 && $coll->amount > $min)) { + $var = !$var; + $intra = str_replace($find, $replace, $coll->tva_intra); + if (empty($intra)) { + if ($coll->assuj == '1') { + $intra = $langs->trans('Unknown'); + } else { + //$intra = $langs->trans('NotRegistered'); + $intra = ''; + } + } + print ""; + print '"; + $company_static->id = $coll->socid; + $company_static->name = $coll->name; + $company_static->client = 1; + print ''; + $find = array(' ', '.'); + $replace = array('', ''); + print '"; + print ""; + print ""; + $totalamount = $totalamount + $coll->amount; + $total = $total + $coll->tva; + print "\n"; + $i++; + } + } + $x_coll_sum = $total; - print ''; - print ''; - print ''; - print ''; - } else { - $langs->load("errors"); - if ($coll_list == -1) { - print ''; - } else { - if ($coll_list == -2) { - print ''; - } else { - print ''; - } - } - } - print '
' . $langs->trans("Num") . "' . $langs->trans("Customer") . "" . $langs->trans("VATIntra") . "" . $langs->trans("AmountHTVATRealReceived") . "" . $vatcust . "
' . $i . "' . $company_static->getNomUrl(1, - 'customer') . '' . $intra . "" . price($coll->amount) . "" . price($coll->tva) . "
' . $i . "' . $company_static->getNomUrl(1, + 'customer') . '' . $intra . "" . price($coll->amount) . "" . price($coll->tva) . "
' . $langs->trans("Total") . ':' . price($totalamount) . '' . price($total) . '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
'; + print '' . $langs->trans("Total") . ':'; + print '' . price($totalamount) . ''; + print '' . price($total) . ''; + print ''; + } else { + $langs->load("errors"); + if ($coll_list == -1) { + print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + } else { + if ($coll_list == -2) { + print '' . $langs->trans("FeatureNotYetAvailable") . ''; + } else { + print '' . $langs->trans("Error") . ''; + } + } + } + print ''; - // Print listing of same-country customers as additional report - // This matches tax requirements to list all same-country customers (only) - print '

'.$langs->trans('SameCountryCustomersWithVAT').'

'; - print $langs->trans('BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry'); - $coll_list = vat_by_thirdparty($db, 0, $date_start, $date_end, $modetax, - 'sell'); + // Print listing of same-country customers as additional report + // This matches tax requirements to list all same-country customers (only) + print '

'.$langs->trans('SameCountryCustomersWithVAT').'

'; + print $langs->trans('BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry'); + $coll_list = vat_by_thirdparty($db, 0, $date_start, $date_end, $modetax, 'sell'); - print ""; - print ""; - print '"; - print '"; - print ""; - print ""; - print ""; - print "\n"; + print "
' . $langs->trans("Num") . "' . $langs->trans("Customer") . "" . $langs->trans("VATIntra") . "" . $langs->trans("AmountHTVATRealReceived") . "" . $vatcust . "
"; + print ""; + print '"; + print '"; + print ""; + print ""; + print ""; + print "\n"; - if (is_array($coll_list)) { - $var = true; - $total = 0; - $totalamount = 0; - $i = 1; - foreach ($coll_list as $coll) { - if (substr($coll->tva_intra, 0, 2) != $country->code) { - // Only use same-country VAT codes - continue; - } - if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - $var = !$var; - $intra = str_replace($find, $replace, $coll->tva_intra); - if (empty($intra)) { - if ($coll->assuj == '1') { - $intra = $langs->trans('Unknown'); - } else { - //$intra = $langs->trans('NotRegistered'); - $intra = ''; - } - } - print ""; - print '"; - $company_static->id = $coll->socid; - $company_static->name = $coll->name; - $company_static->client = 1; - print ''; - $find = array(' ', '.'); - $replace = array('', ''); - print '"; - print ""; - print ""; - $totalamount = $totalamount + $coll->amount; - $total = $total + $coll->tva; - print "\n"; - $i++; - } - } - $x_coll_sum = $total; + if (is_array($coll_list)) { + $var = true; + $total = 0; + $totalamount = 0; + $i = 1; + foreach ($coll_list as $coll) { + if (substr($coll->tva_intra, 0, 2) != $country->code) { + // Only use same-country VAT codes + continue; + } + if ($min == 0 or ($min > 0 && $coll->amount > $min)) { + $var = !$var; + $intra = str_replace($find, $replace, $coll->tva_intra); + if (empty($intra)) { + if ($coll->assuj == '1') { + $intra = $langs->trans('Unknown'); + } else { + //$intra = $langs->trans('NotRegistered'); + $intra = ''; + } + } + print ""; + print '"; + $company_static->id = $coll->socid; + $company_static->name = $coll->name; + $company_static->client = 1; + print ''; + $find = array(' ', '.'); + $replace = array('', ''); + print '"; + print ""; + print ""; + $totalamount = $totalamount + $coll->amount; + $total = $total + $coll->tva; + print "\n"; + $i++; + } + } + $x_coll_sum = $total; - print ''; - print ''; - print ''; - print ''; - } else { - $langs->load("errors"); - if ($coll_list == -1) { - print ''; - } else { - if ($coll_list == -2) { - print ''; - } else { - print ''; - } - } - } - print '
' . $langs->trans("Num") . "' . $langs->trans("Customer") . "" . $langs->trans("VATIntra") . "" . $langs->trans("AmountHTVATRealReceived") . "" . $vatcust . "
' . $i . "' . $company_static->getNomUrl(1, - 'customer') . '' . $intra . "" . price($coll->amount) . "" . price($coll->tva) . "
' . $i . "' . $company_static->getNomUrl(1, 'customer') . '' . $intra . "" . price($coll->amount) . "" . price($coll->tva) . "
' . $langs->trans("Total") . ':' . price($totalamount) . '' . price($total) . '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
'; + print '' . $langs->trans("Total") . ':'; + print '' . price($totalamount) . ''; + print '' . price($total) . ''; + print ''; + } else { + $langs->load("errors"); + if ($coll_list == -1) { + print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + } else { + if ($coll_list == -2) { + print '' . $langs->trans("FeatureNotYetAvailable") . ''; + } else { + print '' . $langs->trans("Error") . ''; + } + } + } + print ''; } llxFooter(); diff --git a/htdocs/compta/tva/quarter_report.php b/htdocs/compta/tva/quarter_report.php index 479a18620cb..5861dcdaff4 100644 --- a/htdocs/compta/tva/quarter_report.php +++ b/htdocs/compta/tva/quarter_report.php @@ -286,7 +286,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $invoice_customer->id=$x_coll[$my_coll_rate]['facid'][$id]; $invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id]; $invoice_customer->type=$x_coll[$my_coll_rate]['type'][$id]; - $company_static->fetch($x_coll[$my_coll_rate]['company_id'][$id]); + $company_static->fetch($x_coll[$my_coll_rate]['company_id'][$id]); $x_both[$my_coll_rate]['coll']['detail'][] = array( 'id' =>$x_coll[$my_coll_rate]['facid'][$id], 'descr' =>$x_coll[$my_coll_rate]['descr'][$id], @@ -323,7 +323,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; $invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; $invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; - $company_static->fetch($x_paye[$my_paye_rate]['company_id'][$id]); + $company_static->fetch($x_paye[$my_paye_rate]['company_id'][$id]); $x_both[$my_paye_rate]['paye']['detail'][] = array( 'id' =>$x_paye[$my_paye_rate]['facid'][$id], 'descr' =>$x_paye[$my_paye_rate]['descr'][$id], @@ -336,7 +336,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { 'dtotal_ttc'=>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], 'datef' =>$x_paye[$my_paye_rate]['datef'][$id], - 'company_link'=>$company_static->getNomUrl(1,'',20), + 'company_link'=>$company_static->getNomUrl(1,'',20), 'ddate_start'=>$x_paye[$my_paye_rate]['ddate_start'][$id], 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), @@ -414,8 +414,8 @@ if (!is_array($x_coll) || !is_array($x_paye)) { // Invoice date print '' . $fields['datef'] . ''; - // Company name - print '' . $fields['company_link'] . ''; + // Company name + print '' . $fields['company_link'] . ''; // Description print ''; @@ -524,7 +524,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { if (count($x_coll) == 0) { // Show a total ine if nothing shown print ''; - print ''; + print ''; print ''.$langs->trans("Total").':'; if ($modetax == 0) { print ' '; @@ -582,8 +582,8 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print ''.$fields['link'].''; // Invoice date print '' . $fields['datef'] . ''; - // Company name - print '' . $fields['company_link'] . ''; + // Company name + print '' . $fields['company_link'] . ''; // Description print ''; @@ -669,7 +669,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { } // Total suppliers for this vat rate print ''; - print ''; + print ''; print ''.$langs->trans("Total").':'; if ($modetax == 0) { print ' '; @@ -682,7 +682,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { if (count($x_paye) == 0) { // Show a total ine if nothing shown print ''; - print ''; + print ''; print ''.$langs->trans("Total").':'; if ($modetax == 0) { print ' '; diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 681f6e7a913..79ab5fe0ead 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -24,18 +24,18 @@ /** -* Show header of a VAT report +* Show header of a VAT report * -* @param string $nom Name of report -* @param string $variante Link for alternate report -* @param string $period Period of report -* @param string $periodlink Link to switch period -* @param string $description Description -* @param timestamp|integer $builddate Date generation -* @param string $exportlink Link for export or '' -* @param array $moreparam Array with list of params to add into form -* @param string $calcmode Calculation mode -* @return void +* @param string $nom Name of report +* @param string $variante Link for alternate report +* @param string $period Period of report +* @param string $periodlink Link to switch period +* @param string $description Description +* @param timestamp|integer $builddate Date generation +* @param string $exportlink Link for export or '' +* @param array $moreparam Array with list of params to add into form +* @param string $calcmode Calculation mode +* @return void */ function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='') { @@ -55,7 +55,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat print '
'; foreach($moreparam as $key => $value) { - print ''; + print ''; } print '';