2006-08-12 17:32:57 +02:00
< ? php
2017-10-06 08:45:59 +02:00
/* Copyright ( C ) 2001 - 2007 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2018-05-15 11:50:42 +02:00
* Copyright ( C ) 2004 - 2018 Laurent Destailleur < eldy @ users . sourceforge . net >
2017-10-06 08:45:59 +02:00
* Copyright ( C ) 2005 - 2017 Regis Houssin < regis . houssin @ capnetworks . com >
2014-07-03 17:39:31 +02:00
* Copyright ( C ) 2010 - 2014 Juanjo Menent < jmenent @ 2 byte . es >
2017-04-24 16:36:58 +02:00
* Copyright ( C ) 2011 - 2017 Philippe Grand < philippe . grand @ atoo - net . com >
2017-10-06 08:45:59 +02:00
* Copyright ( C ) 2015 Alexandre Spangaro < aspangaro . dolibarr @ gmail . com >
2017-09-20 13:30:59 +02:00
* Copyright ( C ) 2017 Rui Strecht < rui . strecht @ aliartalentos . com >
2006-08-12 17:32:57 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2006-08-12 17:32:57 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2011-08-01 00:21:57 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2006-08-12 17:32:57 +02:00
*/
/**
2008-11-16 02:54:33 +01:00
* \file htdocs / admin / company . php
* \ingroup company
2010-07-14 17:59:38 +02:00
* \brief Setup page to configure company / foundation
2008-11-16 02:54:33 +01:00
*/
2006-08-12 17:32:57 +02:00
2012-08-22 23:24:21 +02:00
require '../main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php' ;
2017-03-31 11:39:12 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php' ;
2006-08-12 17:32:57 +02:00
2017-05-16 13:27:32 +02:00
$action = GETPOST ( 'action' , 'aZ09' );
2018-03-31 18:48:27 +02:00
$contextpage = GETPOST ( 'contextpage' , 'aZ' ) ? GETPOST ( 'contextpage' , 'aZ' ) : 'admincompany' ; // To manage different context of search
2012-03-23 00:51:38 +01:00
2018-05-26 18:41:16 +02:00
// Load translation files required by the page
$langs -> loadLangs ( array ( 'admin' , 'companies' ));
2006-08-12 17:32:57 +02:00
2012-07-09 12:54:27 +02:00
if ( ! $user -> admin ) accessforbidden ();
2013-08-14 12:48:00 +02:00
$error = 0 ;
2010-01-13 14:11:32 +01:00
2017-10-06 08:45:59 +02:00
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
2018-03-31 18:48:27 +02:00
$hookmanager -> initHooks ( array ( 'admincompany' , 'globaladmin' ));
2017-10-06 08:45:59 +02:00
2010-01-13 14:11:32 +01:00
/*
* Actions
*/
2008-04-05 16:18:13 +02:00
2017-10-06 08:45:59 +02:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'doActions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook < 0 ) setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
2017-09-06 11:39:30 +02:00
if ( ( $action == 'update' && ! GETPOST ( " cancel " , 'alpha' ))
2012-03-23 00:51:38 +01:00
|| ( $action == 'updateedit' ) )
2006-08-12 17:32:57 +02:00
{
2015-06-29 06:28:04 +02:00
$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 );
2017-12-08 16:15:41 +01:00
activateModulesRequiredByCountry ( $mysoc -> country_code );
2015-06-29 06:28:04 +02:00
}
2017-09-06 11:39:30 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_NOM " , GETPOST ( " nom " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
2018-05-21 19:35:12 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_ADDRESS " , GETPOST ( " MAIN_INFO_SOCIETE_ADDRESS " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_TOWN " , GETPOST ( " MAIN_INFO_SOCIETE_TOWN " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_ZIP " , GETPOST ( " MAIN_INFO_SOCIETE_ZIP " , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2017-09-06 11:39:30 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_STATE " , GETPOST ( " state_id " , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2018-02-06 13:01:54 +01:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_REGION " , GETPOST ( " region_code " , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " MAIN_MONNAIE " , GETPOST ( " currency " , 'aZ09' ), 'chaine' , 0 , '' , $conf -> entity );
2017-09-06 11:39:30 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_TEL " , GETPOST ( " tel " , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_FAX " , GETPOST ( " fax " , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_MAIL " , GETPOST ( " mail " , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_WEB " , GETPOST ( " web " , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_NOTE " , GETPOST ( " note " , 'none' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_GENCOD " , GETPOST ( " barcode " , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2017-03-31 11:39:12 +02:00
$varforimage = 'logo' ; $dirforimage = $conf -> mycompany -> dir_output . '/logos/' ;
if ( $_FILES [ $varforimage ][ " tmp_name " ])
2015-06-29 06:28:04 +02:00
{
2017-03-31 11:39:12 +02:00
if ( preg_match ( '/([^\\/:]+)$/i' , $_FILES [ $varforimage ][ " name " ], $reg ))
2015-06-29 06:28:04 +02:00
{
$original_file = $reg [ 1 ];
$isimage = image_format_supported ( $original_file );
if ( $isimage >= 0 )
{
2017-03-31 11:39:12 +02:00
dol_syslog ( " Move file " . $_FILES [ $varforimage ][ " tmp_name " ] . " to " . $dirforimage . $original_file );
if ( ! is_dir ( $dirforimage ))
2015-06-29 06:28:04 +02:00
{
2017-03-31 11:39:12 +02:00
dol_mkdir ( $dirforimage );
2015-06-29 06:28:04 +02:00
}
2017-03-31 11:39:12 +02:00
$result = dol_move_uploaded_file ( $_FILES [ $varforimage ][ " tmp_name " ], $dirforimage . $original_file , 1 , 0 , $_FILES [ $varforimage ][ 'error' ]);
2015-06-29 06:28:04 +02:00
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 )
{
2016-04-09 14:12:21 +02:00
// Create thumbs
2017-09-06 11:39:30 +02:00
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
2017-03-31 11:39:12 +02:00
// Create small thumb, Used on logon for example
$imgThumbSmall = vignette ( $dirforimage . $original_file , $maxwidthsmall , $maxheightsmall , '_small' , $quality );
2016-04-09 14:12:21 +02:00
if ( image_format_supported ( $imgThumbSmall ) >= 0 && preg_match ( '/([^\\/:]+)$/i' , $imgThumbSmall , $reg ))
2015-06-29 06:28:04 +02:00
{
2016-04-09 14:12:21 +02:00
$imgThumbSmall = $reg [ 1 ]; // Save only basename
2015-06-29 06:28:04 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_LOGO_SMALL " , $imgThumbSmall , 'chaine' , 0 , '' , $conf -> entity );
}
else dol_syslog ( $imgThumbSmall );
2017-03-31 11:39:12 +02:00
// Create mini thumb, Used on menu or for setup page for example
$imgThumbMini = vignette ( $dirforimage . $original_file , $maxwidthmini , $maxheightmini , '_mini' , $quality );
2016-04-09 14:12:21 +02:00
if ( image_format_supported ( $imgThumbMini ) >= 0 && preg_match ( '/([^\\/:]+)$/i' , $imgThumbMini , $reg ))
2015-06-29 06:28:04 +02:00
{
2016-04-09 14:12:21 +02:00
$imgThumbMini = $reg [ 1 ]; // Save only basename
2015-06-29 06:28:04 +02:00
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 );
2015-10-23 12:58:30 +02:00
setEventMessages ( $langs -> trans ( 'ErrorFileIsInfectedWithAVirus' , $tmparray [ 1 ]), null , 'errors' );
2015-06-29 06:28:04 +02:00
}
else
{
$error ++ ;
2015-10-23 12:58:30 +02:00
setEventMessages ( $langs -> trans ( " ErrorFailedToSaveFile " ), null , 'errors' );
2015-06-29 06:28:04 +02:00
}
}
else
2014-10-18 14:56:06 +02:00
{
2015-06-29 06:28:04 +02:00
$error ++ ;
2014-10-18 14:56:06 +02:00
$langs -> load ( " errors " );
2015-10-23 12:58:30 +02:00
setEventMessages ( $langs -> trans ( " ErrorBadImageFormat " ), null , 'errors' );
2015-06-29 06:28:04 +02:00
}
}
}
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_MANAGERS " , GETPOST ( " MAIN_INFO_SOCIETE_MANAGERS " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
2018-05-15 11:50:42 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_GDPR " , GETPOST ( " MAIN_INFO_GDPR " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_CAPITAL " , GETPOST ( " capital " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_FORME_JURIDIQUE " , GETPOST ( " forme_juridique_code " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SIREN " , GETPOST ( " siren " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_SIRET " , GETPOST ( " siret " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_APE " , GETPOST ( " ape " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_RCS " , GETPOST ( " rcs " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_PROFID5 " , GETPOST ( " MAIN_INFO_PROFID5 " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_PROFID6 " , GETPOST ( " MAIN_INFO_PROFID6 " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " MAIN_INFO_TVAINTRA " , GETPOST ( " tva " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
2017-09-06 11:39:30 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_OBJECT " , GETPOST ( " object " , 'nohtml' ), 'chaine' , 0 , '' , $conf -> entity );
2011-06-24 21:57:45 +02:00
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " SOCIETE_FISCAL_MONTH_START " , GETPOST ( " SOCIETE_FISCAL_MONTH_START " , 'int' ), 'chaine' , 0 , '' , $conf -> entity );
2015-06-29 06:28:04 +02:00
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " FACTURE_TVAOPTION " , GETPOST ( " optiontva " , 'aZ09' ), 'chaine' , 0 , '' , $conf -> entity );
2015-06-29 06:28:04 +02:00
// Local taxes
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " FACTURE_LOCAL_TAX1_OPTION " , GETPOST ( " optionlocaltax1 " , 'aZ09' ), 'chaine' , 0 , '' , $conf -> entity );
dolibarr_set_const ( $db , " FACTURE_LOCAL_TAX2_OPTION " , GETPOST ( " optionlocaltax2 " , 'aZ09' ), 'chaine' , 0 , '' , $conf -> entity );
2015-06-29 06:28:04 +02:00
if ( $_POST [ " optionlocaltax1 " ] == " localtax1on " )
{
if ( ! isset ( $_REQUEST [ 'lt1' ]))
{
dolibarr_set_const ( $db , " MAIN_INFO_VALUE_LOCALTAX1 " , 0 , 'chaine' , 0 , '' , $conf -> entity );
}
else
{
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_VALUE_LOCALTAX1 " , GETPOST ( 'lt1' , 'aZ09' ), 'chaine' , 0 , '' , $conf -> entity );
2015-06-29 06:28:04 +02:00
}
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_LOCALTAX_CALC1 " , GETPOST ( " clt1 " , 'aZ09' ), 'chaine' , 0 , '' , $conf -> entity );
2015-06-29 06:28:04 +02:00
}
if ( $_POST [ " optionlocaltax2 " ] == " localtax2on " )
{
if ( ! isset ( $_REQUEST [ 'lt2' ]))
{
dolibarr_set_const ( $db , " MAIN_INFO_VALUE_LOCALTAX2 " , 0 , 'chaine' , 0 , '' , $conf -> entity );
}
else
{
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_VALUE_LOCALTAX2 " , GETPOST ( 'lt2' , 'aZ09' ), 'chaine' , 0 , '' , $conf -> entity );
2015-06-29 06:28:04 +02:00
}
2018-04-06 19:12:13 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_LOCALTAX_CALC2 " , GETPOST ( " clt2 " , 'aZ09' ), 'chaine' , 0 , '' , $conf -> entity );
2015-06-29 06:28:04 +02:00
}
if ( $action != 'updateedit' && ! $error )
{
header ( " Location: " . $_SERVER [ " PHP_SELF " ]);
exit ;
}
2006-08-12 17:32:57 +02:00
}
2017-03-31 11:39:12 +02:00
if ( $action == 'addthumb' ) // Regenerate thumbs
2007-08-09 20:22:39 +02:00
{
2015-06-29 06:28:04 +02:00
if ( file_exists ( $conf -> mycompany -> dir_output . '/logos/' . $_GET [ " file " ]))
{
$isimage = image_format_supported ( $_GET [ " file " ]);
// Create thumbs of logo
if ( $isimage > 0 )
{
2016-04-09 14:12:21 +02:00
// Create thumbs
2017-09-06 11:39:30 +02:00
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
2016-04-09 14:12:21 +02:00
2017-03-31 11:39:12 +02:00
// Create small thumb. Used on logon for example
2015-06-29 06:28:04 +02:00
$imgThumbSmall = vignette ( $conf -> mycompany -> dir_output . '/logos/' . $_GET [ " file " ], $maxwidthsmall , $maxheightsmall , '_small' , $quality );
if ( image_format_supported ( $imgThumbSmall ) >= 0 && preg_match ( '/([^\\/:]+)$/i' , $imgThumbSmall , $reg ))
{
2016-04-09 14:12:21 +02:00
$imgThumbSmall = $reg [ 1 ]; // Save only basename
2015-06-29 06:28:04 +02:00
dolibarr_set_const ( $db , " MAIN_INFO_SOCIETE_LOGO_SMALL " , $imgThumbSmall , 'chaine' , 0 , '' , $conf -> entity );
}
else dol_syslog ( $imgThumbSmall );
2017-03-31 11:39:12 +02:00
// Create mini thumbs. Used on menu or for setup page for example
2015-06-29 06:28:04 +02:00
$imgThumbMini = vignette ( $conf -> mycompany -> dir_output . '/logos/' . $_GET [ " file " ], $maxwidthmini , $maxheightmini , '_mini' , $quality );
if ( image_format_supported ( $imgThumbSmall ) >= 0 && preg_match ( '/([^\\/:]+)$/i' , $imgThumbMini , $reg ))
{
2016-04-09 14:12:21 +02:00
$imgThumbMini = $reg [ 1 ]; // Save only basename
2015-06-29 06:28:04 +02:00
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 " );
2015-10-23 12:58:30 +02:00
setEventMessages ( $langs -> trans ( " ErrorBadImageFormat " ), null , 'errors' );
2015-06-29 06:28:04 +02:00
dol_syslog ( $langs -> transnoentities ( " ErrorBadImageFormat " ), LOG_WARNING );
}
}
else
{
$error ++ ;
$langs -> load ( " errors " );
2015-10-23 12:58:30 +02:00
setEventMessages ( $langs -> trans ( " ErrorFileDoesNotExists " , $_GET [ " file " ]), null , 'errors' );
2015-06-29 06:28:04 +02:00
dol_syslog ( $langs -> transnoentities ( " ErrorFileDoesNotExists " , $_GET [ " file " ]), LOG_WARNING );
}
2007-08-09 20:22:39 +02:00
}
2012-03-23 00:51:38 +01:00
if ( $action == 'removelogo' )
2006-08-12 17:32:57 +02:00
{
2015-06-29 06:28:04 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
$logofile = $conf -> mycompany -> dir_output . '/logos/' . $mysoc -> logo ;
2018-01-14 18:55:55 +01:00
if ( $mysoc -> logo != '' ) dol_delete_file ( $logofile );
2015-06-29 06:28:04 +02:00
dolibarr_del_const ( $db , " MAIN_INFO_SOCIETE_LOGO " , $conf -> entity );
$mysoc -> logo = '' ;
$logosmallfile = $conf -> mycompany -> dir_output . '/logos/thumbs/' . $mysoc -> logo_small ;
2018-01-14 18:55:55 +01:00
if ( $mysoc -> logo_small != '' ) dol_delete_file ( $logosmallfile );
2015-06-29 06:28:04 +02:00
dolibarr_del_const ( $db , " MAIN_INFO_SOCIETE_LOGO_SMALL " , $conf -> entity );
$mysoc -> logo_small = '' ;
$logominifile = $conf -> mycompany -> dir_output . '/logos/thumbs/' . $mysoc -> logo_mini ;
2018-01-14 18:55:55 +01:00
if ( $mysoc -> logo_mini != '' ) dol_delete_file ( $logominifile );
2015-06-29 06:28:04 +02:00
dolibarr_del_const ( $db , " MAIN_INFO_SOCIETE_LOGO_MINI " , $conf -> entity );
$mysoc -> logo_mini = '' ;
2006-08-12 17:32:57 +02:00
}
2010-08-21 17:30:17 +02:00
2006-08-12 17:32:57 +02:00
/*
2010-08-21 17:30:17 +02:00
* View
2006-08-12 17:32:57 +02:00
*/
2009-08-08 18:26:06 +02:00
$wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones' ;
2010-05-26 13:42:29 +02:00
llxHeader ( '' , $langs -> trans ( " Setup " ), $wikihelp );
2006-08-12 17:32:57 +02:00
2011-05-20 17:59:18 +02:00
$form = new Form ( $db );
$formother = new FormOther ( $db );
$formcompany = new FormCompany ( $db );
2008-11-16 02:54:33 +01:00
2006-08-12 17:32:57 +02:00
$countrynotdefined = '<font class="error">' . $langs -> trans ( " ErrorSetACountryFirst " ) . ' (' . $langs -> trans ( " SeeAbove " ) . ')</font>' ;
2015-09-24 18:33:48 +02:00
print load_fiche_titre ( $langs -> trans ( " CompanyFoundation " ), '' , 'title_setup' );
2006-08-12 17:32:57 +02:00
2018-03-18 06:09:50 +01:00
$head = company_admin_prepare_head ();
dol_fiche_head ( $head , 'company' , $langs -> trans ( " Company " ), - 1 , 'company' );
2018-06-05 16:30:16 +02:00
print '<span class="opacitymedium">' . $langs -> trans ( " CompanyFundationDesc " , $langs -> transnoentities ( " Modify " ), $langs -> transnoentities ( " Save " )) . " </span><br> \n " ;
2006-08-12 19:53:18 +02:00
print " <br> \n " ;
2006-08-12 17:32:57 +02:00
2012-03-23 00:51:38 +01:00
if ( $action == 'edit' || $action == 'updateedit' )
2006-08-12 17:32:57 +02:00
{
2015-06-29 06:28:04 +02:00
/**
* Edition des parametres
*/
print " \n " . '<script type="text/javascript" language="javascript">' ;
print ' $ ( document ) . ready ( function () {
$ ( " #selectcountry_id " ) . change ( function () {
document . form_index . action . value = " updateedit " ;
document . form_index . submit ();
});
}); ' ;
print '</script>' . " \n " ;
2017-03-31 11:39:12 +02:00
print '<form enctype="multipart/form-data" method="POST" action="' . $_SERVER [ " PHP_SELF " ] . '" name="form_index">' ;
2015-06-29 06:28:04 +02:00
print '<input type="hidden" name="token" value="' . $_SESSION [ 'newtoken' ] . '">' ;
print '<input type="hidden" name="action" value="update">' ;
print '<table class="noborder" width="100%">' ;
2018-03-06 11:54:05 +01:00
print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs -> trans ( " CompanyInfo " ) . '</th><th>' . $langs -> trans ( " Value " ) . '</th></tr>' . " \n " ;
2015-06-29 06:28:04 +02:00
2016-06-25 14:20:23 +02:00
// Name
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td class="fieldrequired"><label for="name">' . $langs -> trans ( " CompanyName " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="nom" id="name" class="minwidth200" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_NOM ? $conf -> global -> MAIN_INFO_SOCIETE_NOM : GETPOST ( " nom " , 'nohtml' )) . '" autofocus="autofocus"></td></tr>' . " \n " ;
2015-06-29 06:28:04 +02:00
2016-06-25 14:20:23 +02:00
// Addresse
2017-09-06 11:39:30 +02:00
2018-05-21 19:35:12 +02:00
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">' . $langs -> trans ( " CompanyAddress " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="' . ROWS_3 . '">' . ( $conf -> global -> MAIN_INFO_SOCIETE_ADDRESS ? $conf -> global -> MAIN_INFO_SOCIETE_ADDRESS : GETPOST ( " MAIN_INFO_SOCIETE_ADDRESS " , 'nohtml' )) . '</textarea></td></tr>' . " \n " ;
2017-09-06 11:39:30 +02:00
2015-06-29 06:28:04 +02:00
2018-05-21 19:35:12 +02:00
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">' . $langs -> trans ( " CompanyZip " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_ZIP ? $conf -> global -> MAIN_INFO_SOCIETE_ZIP : GETPOST ( " MAIN_INFO_SOCIETE_ZIP " , 'alpha' )) . '"></td></tr>' . " \n " ;
2017-09-06 11:39:30 +02:00
2015-06-29 06:28:04 +02:00
2018-05-21 19:35:12 +02:00
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">' . $langs -> trans ( " CompanyTown " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_TOWN ? $conf -> global -> MAIN_INFO_SOCIETE_TOWN : GETPOST ( " MAIN_INFO_SOCIETE_TOWN " , 'nohtml' )) . '"></td></tr>' . " \n " ;
2015-06-29 06:28:04 +02:00
// Country
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">' . $langs -> trans ( " Country " ) . '</label></td><td class="maxwidthonsmartphone">' ;
2015-06-29 06:28:04 +02:00
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization
2018-03-15 01:33:46 +01:00
print $form -> select_country ( $mysoc -> country_id , 'country_id' );
2015-06-29 06:28:04 +02:00
if ( $user -> admin ) print info_admin ( $langs -> trans ( " YouCanChangeValuesForThisListFromDictionarySetup " ), 1 );
print '</td></tr>' . " \n " ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="state_id">' . $langs -> trans ( " State " ) . '</label></td><td class="maxwidthonsmartphone">' ;
2018-03-15 01:33:46 +01:00
$formcompany -> select_departement ( $conf -> global -> MAIN_INFO_SOCIETE_STATE , $mysoc -> country_code , 'state_id' );
2015-06-29 06:28:04 +02:00
print '</td></tr>' . " \n " ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="currency">' . $langs -> trans ( " CompanyCurrency " ) . '</label></td><td>' ;
2018-03-15 01:33:46 +01:00
print $form -> selectCurrency ( $conf -> currency , " currency " );
2015-06-29 06:28:04 +02:00
print '</td></tr>' . " \n " ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="phone">' . $langs -> trans ( " Phone " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="tel" id="phone" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_TEL ) . '"></td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' . " \n " ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="fax">' . $langs -> trans ( " Fax " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="fax" id="fax" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_FAX ) . '"></td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' . " \n " ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="email">' . $langs -> trans ( " EMail " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="mail" id="email" class="minwidth200" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_MAIL ) . '"></td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' . " \n " ;
// Web
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="web">' . $langs -> trans ( " Web " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="web" id="web" class="minwidth300" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_WEB ) . '"></td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' . " \n " ;
// Barcode
if ( ! empty ( $conf -> barcode -> enabled )) {
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="barcode">' . $langs -> trans ( " Gencod " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="barcode" id="barcode" class="minwidth150" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_GENCOD ) . '"></td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
}
// Logo
2018-01-14 18:55:55 +01:00
print '<tr class="oddeven hideonsmartphone"><td><label for="logo">' . $langs -> trans ( " Logo " ) . ' (png,jpg)</label></td><td>' ;
2015-06-29 06:28:04 +02:00
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">' ;
2016-12-04 00:51:15 +01:00
print '<input type="file" class="flat class=minwidth200" name="logo" id="logo">' ;
2015-06-29 06:28:04 +02:00
print '</td><td class="nocellnopadd" valign="middle" align="right">' ;
if ( ! empty ( $mysoc -> logo_mini )) {
print '<a href="' . $_SERVER [ " PHP_SELF " ] . '?action=removelogo">' . img_delete ( $langs -> trans ( " Delete " )) . '</a>' ;
if ( file_exists ( $conf -> mycompany -> dir_output . '/logos/thumbs/' . $mysoc -> logo_mini )) {
print ' ' ;
2017-03-31 11:39:12 +02:00
print '<img src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&file=' . urlencode ( '/thumbs/' . $mysoc -> logo_mini ) . '">' ;
2015-06-29 06:28:04 +02:00
}
} else {
2015-10-08 23:50:17 +02:00
print '<img height="30" src="' . DOL_URL_ROOT . '/public/theme/common/nophoto.png">' ;
2015-06-29 06:28:04 +02:00
}
print '</td></tr></table>' ;
print '</td></tr>' ;
// Note
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td class="tdtop"><label for="note">' . $langs -> trans ( " Note " ) . '</label></td><td>' ;
2017-09-06 11:39:30 +02:00
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="' . ROWS_5 . '">' . ( GETPOST ( 'note' , 'none' ) ? GETPOST ( 'note' , 'none' ) : $conf -> global -> MAIN_INFO_SOCIETE_NOTE ) . '</textarea></td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
print '</table>' ;
print '<br>' ;
2016-06-21 17:00:52 +02:00
// IDs of the company (country-specific)
2015-06-29 06:28:04 +02:00
print '<table class="noborder" width="100%">' ;
2018-04-06 19:12:13 +02:00
print '<tr class="liste_titre"><td class="titlefield">' . $langs -> trans ( " CompanyIds " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
$langs -> load ( " companies " );
// Managing Director(s)
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="director">' . $langs -> trans ( " ManagingDirectors " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="director" class="minwidth200" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_SOCIETE_MANAGERS ) . '"></td></tr>' ;
2015-06-29 06:28:04 +02:00
2018-05-15 11:50:42 +02:00
// GDPR contact
print '<tr class="oddeven"><td>' ;
print $form -> textwithpicto ( $langs -> trans ( " GDPRContact " ), $langs -> trans ( " GDPRContactDesc " ));
print '</td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="MAIN_INFO_GDPR" id="director" class="minwidth500" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_GDPR ) . '"></td></tr>' ;
2018-05-15 11:50:42 +02:00
2015-06-29 06:28:04 +02:00
// Capital
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="capital">' . $langs -> trans ( " Capital " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="capital" id="capital" class="minwidth100" value="' . dol_escape_htmltag ( $conf -> global -> MAIN_INFO_CAPITAL ) . '"></td></tr>' ;
2015-06-29 06:28:04 +02:00
2016-06-21 17:00:52 +02:00
// Juridical Status
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="forme_juridique_code">' . $langs -> trans ( " JuridicalStatus " ) . '</label></td><td>' ;
2015-06-29 06:28:04 +02:00
if ( $mysoc -> country_code ) {
2015-09-25 08:50:00 +02:00
print $formcompany -> select_juridicalstatus ( $conf -> global -> MAIN_INFO_SOCIETE_FORME_JURIDIQUE , $mysoc -> country_code , '' , 'forme_juridique_code' );
2015-06-29 06:28:04 +02:00
} else {
print $countrynotdefined ;
}
print '</td></tr>' ;
// ProfID1
if ( $langs -> transcountry ( " ProfId1 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="profid1">' . $langs -> transcountry ( " ProfId1 " , $mysoc -> country_code ) . '</label></td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $mysoc -> country_code ))
{
2018-09-27 11:33:28 +02:00
print '<input name="siren" id="profid1" class="minwidth200" value="' . dol_escape_htmltag ( ! empty ( $conf -> global -> MAIN_INFO_SIREN ) ? $conf -> global -> MAIN_INFO_SIREN : '' ) . '">' ;
2015-06-29 06:28:04 +02:00
}
else
{
print $countrynotdefined ;
}
print '</td></tr>' ;
}
// ProfId2
if ( $langs -> transcountry ( " ProfId2 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="profid2">' . $langs -> transcountry ( " ProfId2 " , $mysoc -> country_code ) . '</label></td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $mysoc -> country_code ))
{
2018-09-27 11:33:28 +02:00
print '<input name="siret" id="profid2" class="minwidth200" value="' . dol_escape_htmltag ( ! empty ( $conf -> global -> MAIN_INFO_SIRET ) ? $conf -> global -> MAIN_INFO_SIRET : '' ) . '">' ;
2015-06-29 06:28:04 +02:00
}
else
{
print $countrynotdefined ;
}
print '</td></tr>' ;
}
// ProfId3
if ( $langs -> transcountry ( " ProfId3 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="profid3">' . $langs -> transcountry ( " ProfId3 " , $mysoc -> country_code ) . '</label></td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $mysoc -> country_code ))
{
2018-09-27 11:33:28 +02:00
print '<input name="ape" id="profid3" class="minwidth200" value="' . dol_escape_htmltag ( ! empty ( $conf -> global -> MAIN_INFO_APE ) ? $conf -> global -> MAIN_INFO_APE : '' ) . '">' ;
2015-06-29 06:28:04 +02:00
}
else
{
print $countrynotdefined ;
}
print '</td></tr>' ;
}
// ProfId4
if ( $langs -> transcountry ( " ProfId4 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="profid4">' . $langs -> transcountry ( " ProfId4 " , $mysoc -> country_code ) . '</label></td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $mysoc -> country_code ))
{
2018-09-27 11:33:28 +02:00
print '<input name="rcs" id="profid4" class="minwidth200" value="' . dol_escape_htmltag ( ! empty ( $conf -> global -> MAIN_INFO_RCS ) ? $conf -> global -> MAIN_INFO_RCS : '' ) . '">' ;
2015-06-29 06:28:04 +02:00
}
else
{
print $countrynotdefined ;
}
print '</td></tr>' ;
}
// ProfId5
if ( $langs -> transcountry ( " ProfId5 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="profid5">' . $langs -> transcountry ( " ProfId5 " , $mysoc -> country_code ) . '</label></td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $mysoc -> country_code ))
{
2018-09-27 11:33:28 +02:00
print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="' . dol_escape_htmltag ( ! empty ( $conf -> global -> MAIN_INFO_PROFID5 ) ? $conf -> global -> MAIN_INFO_PROFID5 : '' ) . '">' ;
2015-06-29 06:28:04 +02:00
}
else
{
print $countrynotdefined ;
}
print '</td></tr>' ;
}
// ProfId6
if ( $langs -> transcountry ( " ProfId6 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="profid6">' . $langs -> transcountry ( " ProfId6 " , $mysoc -> country_code ) . '</label></td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $mysoc -> country_code ))
{
2018-09-27 11:33:28 +02:00
print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="' . dol_escape_htmltag ( ! empty ( $conf -> global -> MAIN_INFO_PROFID6 ) ? $conf -> global -> MAIN_INFO_PROFID6 : '' ) . '">' ;
2015-06-29 06:28:04 +02:00
}
else
{
print $countrynotdefined ;
}
print '</td></tr>' ;
}
// TVA Intra
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="intra_vat">' . $langs -> trans ( " VATIntra " ) . '</label></td><td>' ;
2018-09-27 11:33:28 +02:00
print '<input name="tva" id="intra_vat" class="minwidth200" value="' . dol_escape_htmltag ( ! empty ( $conf -> global -> MAIN_INFO_TVAINTRA ) ? $conf -> global -> MAIN_INFO_TVAINTRA : '' ) . '">' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
2017-09-06 11:39:30 +02:00
2015-06-03 06:48:15 +02:00
// Object of the company
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td><label for="object">' . $langs -> trans ( " CompanyObject " ) . '</label></td><td>' ;
2016-06-25 14:20:23 +02:00
print '<textarea class="flat quatrevingtpercent" name="object" id="object" rows="' . ROWS_5 . '">' . ( ! empty ( $conf -> global -> MAIN_INFO_SOCIETE_OBJECT ) ? $conf -> global -> MAIN_INFO_SOCIETE_OBJECT : '' ) . '</textarea></td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
print '</table>' ;
// Fiscal year start
print '<br>' ;
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre">' ;
2016-12-04 00:51:15 +01:00
print '<td class="titlefield">' . $langs -> trans ( " FiscalYearInformation " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td>' ;
2015-06-29 06:28:04 +02:00
print " </tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-09-12 12:52:48 +02:00
print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">' . $langs -> trans ( " FiscalMonthStart " ) . '</label></td><td>' ;
print $formother -> select_month ( $conf -> global -> SOCIETE_FISCAL_MONTH_START , 'SOCIETE_FISCAL_MONTH_START' , 0 , 1 ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
print " </table> " ;
// Fiscal options
print '<br>' ;
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre">' ;
2018-04-06 19:12:13 +02:00
print '<td width="140">' . $langs -> trans ( " VATManagement " ) . '</td><td>' . $langs -> trans ( " Description " ) . '</td>' ;
2015-06-29 06:28:04 +02:00
print '<td align="right"> </td>' ;
print " </tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-04-24 16:36:58 +02:00
print " <tr class= \" oddeven \" ><td width= \" 140 \" ><label><input type= \" radio \" name= \" optiontva \" id= \" use_vat \" value= \" 1 \" " . ( empty ( $conf -> global -> FACTURE_TVAOPTION ) ? " " : " checked " ) . " > " . $langs -> trans ( " VATIsUsed " ) . " </label></td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label for= \" use_vat \" > " . $langs -> trans ( " VATIsUsedDesc " ) . " </label></td></tr> " ;
print " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> trans ( " VATIsUsedExampleFR " ) . " </i></td></tr> \n " ;
print " </table> " ;
print " </td></tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-04-24 16:36:58 +02:00
print " <tr class= \" oddeven \" ><td width= \" 140 \" ><label><input type= \" radio \" name= \" optiontva \" id= \" no_vat \" value= \" 0 \" " . ( empty ( $conf -> global -> FACTURE_TVAOPTION ) ? " checked " : " " ) . " > " . $langs -> trans ( " VATIsNotUsed " ) . " </label></td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label for= \" no_vat \" > " . $langs -> trans ( " VATIsNotUsedDesc " ) . " </label></td></tr> " ;
print " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> trans ( " VATIsNotUsedExampleFR " ) . " </i></td></tr> \n " ;
print " </table> " ;
print " </td></tr> \n " ;
print " </table> " ;
/*
* Local Taxes
*/
if ( $mysoc -> useLocalTax ( 1 ))
{
// Local Tax 1
print '<br>' ;
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre">' ;
2018-04-06 19:12:13 +02:00
print '<td width="140">' . $langs -> transcountry ( " LocalTax1Management " , $mysoc -> country_code ) . '</td><td>' . $langs -> trans ( " Description " ) . '</td>' ;
2015-06-29 06:28:04 +02:00
print '<td align="right"> </td>' ;
print " </tr> \n " ;
2017-09-06 11:39:30 +02:00
2015-06-29 06:28:04 +02:00
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
2017-04-24 16:36:58 +02:00
print " <tr class= \" oddeven \" ><td width= \" 140 \" ><input type= \" radio \" name= \" optionlocaltax1 \" id= \" lt1 \" value= \" localtax1on \" " . (( $conf -> global -> FACTURE_LOCAL_TAX1_OPTION == '1' || $conf -> global -> FACTURE_LOCAL_TAX1_OPTION == " localtax1on " ) ? " checked " : " " ) . " > " . $langs -> transcountry ( " LocalTax1IsUsed " , $mysoc -> country_code ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
2015-11-14 19:31:16 +01:00
print '<table class="nobordernopadding">' ;
2015-06-29 06:28:04 +02:00
print " <tr><td><label for= \" lt1 \" > " . $langs -> transcountry ( " LocalTax1IsUsedDesc " , $mysoc -> country_code ) . " </label></td></tr> " ;
$example = $langs -> transcountry ( " LocalTax1IsUsedExample " , $mysoc -> country_code );
print ( $example != " LocalTax1IsUsedExample " ? " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> transcountry ( " LocalTax1IsUsedExample " , $mysoc -> country_code ) . " </i></td></tr> \n " : " " );
if ( ! isOnlyOneLocalTax ( 1 ))
{
print '<tr><td align="left"><label for="lt1">' . $langs -> trans ( " LTRate " ) . '</label>: ' ;
$formcompany -> select_localtax ( 1 , $conf -> global -> MAIN_INFO_VALUE_LOCALTAX1 , " lt1 " );
2015-11-14 19:31:16 +01:00
print '</td></tr>' ;
2015-06-29 06:28:04 +02:00
}
$opcions = array ( $langs -> trans ( " CalcLocaltax1 " ) . ' ' . $langs -> trans ( " CalcLocaltax1Desc " ), $langs -> trans ( " CalcLocaltax2 " ) . ' - ' . $langs -> trans ( " CalcLocaltax2Desc " ), $langs -> trans ( " CalcLocaltax3 " ) . ' - ' . $langs -> trans ( " CalcLocaltax3Desc " ));
print '<tr><td align="left"></label for="clt1">' . $langs -> trans ( " CalcLocaltax " ) . '</label>: ' ;
2016-03-25 15:34:37 +01:00
print $form -> selectarray ( " clt1 " , $opcions , $conf -> global -> MAIN_INFO_LOCALTAX_CALC1 );
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
print " </table> " ;
print " </td></tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-04-24 16:36:58 +02:00
print " <tr class= \" oddeven \" ><td width= \" 140 \" ><input type= \" radio \" name= \" optionlocaltax1 \" id= \" nolt1 \" value= \" localtax1off \" " . (( empty ( $conf -> global -> FACTURE_LOCAL_TAX1_OPTION ) || $conf -> global -> FACTURE_LOCAL_TAX1_OPTION == " localtax1off " ) ? " checked " : " " ) . " > " . $langs -> transcountry ( " LocalTax1IsNotUsed " , $mysoc -> country_code ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label for= \" nolt1 \" > " . $langs -> transcountry ( " LocalTax1IsNotUsedDesc " , $mysoc -> country_code ) . " </label></td></tr> " ;
$example = $langs -> transcountry ( " LocalTax1IsNotUsedExample " , $mysoc -> country_code );
print ( $example != " LocalTax1IsNotUsedExample " ? " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> transcountry ( " LocalTax1IsNotUsedExample " , $mysoc -> country_code ) . " </i></td></tr> \n " : " " );
print " </table> " ;
print " </td></tr> \n " ;
print " </table> " ;
}
if ( $mysoc -> useLocalTax ( 2 ))
{
// Local Tax 2
print '<br>' ;
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> transcountry ( " LocalTax2Management " , $mysoc -> country_code ) . '</td><td>' . $langs -> trans ( " Description " ) . '</td>' ;
print '<td align="right"> </td>' ;
print " </tr> \n " ;
2017-09-06 11:39:30 +02:00
2015-06-29 06:28:04 +02:00
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
2017-04-24 16:36:58 +02:00
print " <tr class= \" oddeven \" ><td width= \" 140 \" ><input type= \" radio \" name= \" optionlocaltax2 \" id= \" lt2 \" value= \" localtax2on \" " . (( $conf -> global -> FACTURE_LOCAL_TAX2_OPTION == '1' || $conf -> global -> FACTURE_LOCAL_TAX2_OPTION == " localtax2on " ) ? " checked " : " " ) . " > " . $langs -> transcountry ( " LocalTax2IsUsed " , $mysoc -> country_code ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
2015-11-14 19:31:16 +01:00
print '<table class="nobordernopadding">' ;
2015-06-29 06:28:04 +02:00
print " <tr><td><label for= \" lt2 \" > " . $langs -> transcountry ( " LocalTax2IsUsedDesc " , $mysoc -> country_code ) . " </label></td></tr> " ;
$example = $langs -> transcountry ( " LocalTax2IsUsedExample " , $mysoc -> country_code );
print ( $example != " LocalTax2IsUsedExample " ? " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> transcountry ( " LocalTax2IsUsedExample " , $mysoc -> country_code ) . " </i></td></tr> \n " : " " );
if ( ! isOnlyOneLocalTax ( 2 ))
{
2015-11-14 19:31:16 +01:00
print '<tr><td align="left"><label for="lt2">' . $langs -> trans ( " LTRate " ) . '</label>: ' ;
$formcompany -> select_localtax ( 2 , $conf -> global -> MAIN_INFO_VALUE_LOCALTAX2 , " lt2 " );
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
}
print '<tr><td align="left"><label for="clt2">' . $langs -> trans ( " CalcLocaltax " ) . '</label>: ' ;
2016-03-25 15:34:37 +01:00
print $form -> selectarray ( " clt2 " , $opcions , $conf -> global -> MAIN_INFO_LOCALTAX_CALC2 );
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
print " </table> " ;
print " </td></tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-04-24 16:36:58 +02:00
print " <tr class= \" oddeven \" ><td width= \" 140 \" ><input type= \" radio \" name= \" optionlocaltax2 \" id= \" nolt2 \" value= \" localtax2off \" " . (( empty ( $conf -> global -> FACTURE_LOCAL_TAX2_OPTION ) || $conf -> global -> FACTURE_LOCAL_TAX2_OPTION == " localtax2off " ) ? " checked " : " " ) . " > " . $langs -> transcountry ( " LocalTax2IsNotUsed " , $mysoc -> country_code ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label for= \" nolt2 \" > " . $langs -> transcountry ( " LocalTax2IsNotUsedDesc " , $mysoc -> country_code ) . " </label></td></tr> " ;
$example = $langs -> transcountry ( " LocalTax2IsNotUsedExample " , $mysoc -> country_code );
print ( $example != " LocalTax2IsNotUsedExample " ? " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> transcountry ( " LocalTax2IsNotUsedExample " , $mysoc -> country_code ) . " </i></td></tr> \n " : " " );
print " </table> " ;
print " </td></tr> \n " ;
print " </table> " ;
2012-11-27 13:05:21 +01:00
}
2015-06-29 06:28:04 +02:00
print '<br><div class="center">' ;
print '<input type="submit" class="button" name="save" value="' . $langs -> trans ( " Save " ) . '">' ;
print ' ' ;
print '<input type="submit" class="button" name="cancel" value="' . $langs -> trans ( " Cancel " ) . '">' ;
print '</div>' ;
print '<br>' ;
print '</form>' ;
2006-08-12 17:32:57 +02:00
}
else
{
2015-06-29 06:28:04 +02:00
/*
* Show parameters
*/
// Actions buttons
//print '<div class="tabsAction">';
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
//print '</div><br>';
2018-03-06 11:54:05 +01:00
print '<div class="div-table-responsive-no-min">' ;
2015-06-29 06:28:04 +02:00
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre"><td>' . $langs -> trans ( " CompanyInfo " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td></tr>' ;
2017-09-06 11:39:30 +02:00
2018-03-06 11:54:05 +01:00
print '<tr class="oddeven"><td class="titlefield wordbreak">' . $langs -> trans ( " CompanyName " ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $conf -> global -> MAIN_INFO_SOCIETE_NOM )) print $conf -> global -> MAIN_INFO_SOCIETE_NOM ;
else print img_warning () . ' <font class="error">' . $langs -> trans ( " ErrorFieldRequired " , $langs -> transnoentitiesnoconv ( " CompanyName " )) . '</font>' ;
print '</td></tr>' ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CompanyAddress " ) . '</td><td>' . nl2br ( empty ( $conf -> global -> MAIN_INFO_SOCIETE_ADDRESS ) ? '' : $conf -> global -> MAIN_INFO_SOCIETE_ADDRESS ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CompanyZip " ) . '</td><td>' . ( empty ( $conf -> global -> MAIN_INFO_SOCIETE_ZIP ) ? '' : $conf -> global -> MAIN_INFO_SOCIETE_ZIP ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CompanyTown " ) . '</td><td>' . ( empty ( $conf -> global -> MAIN_INFO_SOCIETE_TOWN ) ? '' : $conf -> global -> MAIN_INFO_SOCIETE_TOWN ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CompanyCountry " ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
if ( $mysoc -> country_code )
{
$img = picto_from_langcode ( $mysoc -> country_code );
print $img ? $img . ' ' : '' ;
print getCountry ( $mysoc -> country_code , 1 );
}
else print img_warning () . ' <font class="error">' . $langs -> trans ( " ErrorFieldRequired " , $langs -> transnoentitiesnoconv ( " CompanyCountry " )) . '</font>' ;
print '</td></tr>' ;
2017-09-06 11:39:30 +02:00
2018-02-07 17:57:43 +01:00
if ( ! empty ( $conf -> global -> MAIN_SHOW_REGION_IN_STATE_SELECT )) print '<tr class="oddeven"><td>' . $langs -> trans ( " Region-State " ) . '</td><td>' ;
2018-02-07 17:54:21 +01:00
else print '<tr class="oddeven"><td>' . $langs -> trans ( " State " ) . '</td><td>' ;
2018-02-06 13:01:54 +01:00
if ( ! empty ( $conf -> global -> MAIN_INFO_SOCIETE_STATE )) print getState ( $conf -> global -> MAIN_INFO_SOCIETE_STATE , $conf -> global -> MAIN_SHOW_STATE_CODE , 0 , $conf -> global -> MAIN_SHOW_REGION_IN_STATE_SELECT );
2015-06-29 06:28:04 +02:00
else print ' ' ;
print '</td></tr>' ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CompanyCurrency " ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
print currency_name ( $conf -> currency , 1 );
2016-04-30 14:09:00 +02:00
print ' (' . $conf -> currency ;
print ( $conf -> currency != $langs -> getCurrencySymbol ( $conf -> currency ) ? ' - ' . $langs -> getCurrencySymbol ( $conf -> currency ) : '' );
print ')' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Phone " ) . '</td><td>' . dol_print_phone ( $conf -> global -> MAIN_INFO_SOCIETE_TEL , $mysoc -> country_code ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Fax " ) . '</td><td>' . dol_print_phone ( $conf -> global -> MAIN_INFO_SOCIETE_FAX , $mysoc -> country_code ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Mail " ) . '</td><td>' . dol_print_email ( $conf -> global -> MAIN_INFO_SOCIETE_MAIL , 0 , 0 , 0 , 80 ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
// Web
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Web " ) . '</td><td>' . dol_print_url ( $conf -> global -> MAIN_INFO_SOCIETE_WEB , '_blank' , 80 ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
// Barcode
if ( ! empty ( $conf -> barcode -> enabled ))
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Gencod " ) . '</td><td>' . $conf -> global -> MAIN_INFO_SOCIETE_GENCOD . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
}
// Logo
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Logo " ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
2016-12-04 01:12:52 +01:00
$tagtd = 'tagtd ' ;
if ( $conf -> browser -> layout == 'phone' ) $tagtd = '' ;
print '<div class="tagtable centpercent"><div class="tagtr inline-block centpercent valignmiddle"><div class="' . $tagtd . 'inline-block valignmiddle left">' ;
2015-06-29 06:28:04 +02:00
print $mysoc -> logo ;
2016-12-04 01:12:52 +01:00
print '</div><div class="' . $tagtd . 'inline-block valignmiddle left">' ;
2015-06-29 06:28:04 +02:00
2016-06-21 17:00:52 +02:00
// It offers the generation of the thumbnail if it does not exist
2015-06-29 06:28:04 +02:00
if ( ! is_file ( $conf -> mycompany -> dir_output . '/logos/thumbs/' . $mysoc -> logo_mini ) && preg_match ( '/(\.jpg|\.jpeg|\.png)$/i' , $mysoc -> logo ))
{
2016-12-04 01:12:52 +01:00
print '<a class="img_logo" href="' . $_SERVER [ " PHP_SELF " ] . '?action=addthumb&file=' . urlencode ( $mysoc -> logo ) . '">' . img_picto ( $langs -> trans ( 'GenerateThumb' ), 'refresh' ) . '</a> ' ;
2015-06-29 06:28:04 +02:00
}
else if ( $mysoc -> logo_mini && is_file ( $conf -> mycompany -> dir_output . '/logos/thumbs/' . $mysoc -> logo_mini ))
{
2017-03-31 11:39:12 +02:00
print '<img class="img_logo" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&file=' . urlencode ( '/thumbs/' . $mysoc -> logo_mini ) . '">' ;
2015-06-29 06:28:04 +02:00
}
else
{
2016-12-04 01:12:52 +01:00
print '<img class="img_logo" src="' . DOL_URL_ROOT . '/public/theme/common/nophoto.png">' ;
2015-06-29 06:28:04 +02:00
}
2016-12-04 01:12:52 +01:00
print '</div></div></div>' ;
2015-06-29 06:28:04 +02:00
print '</td></tr>' ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td class="tdtop">' . $langs -> trans ( " Note " ) . '</td><td>' . ( ! empty ( $conf -> global -> MAIN_INFO_SOCIETE_NOTE ) ? nl2br ( $conf -> global -> MAIN_INFO_SOCIETE_NOTE ) : '' ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</table>' ;
2018-03-06 11:54:05 +01:00
print " </div> " ;
2015-06-29 06:28:04 +02:00
print '<br>' ;
2016-06-21 17:00:52 +02:00
// IDs of the company (country-specific)
2015-06-29 06:28:04 +02:00
print '<form name="formsoc" method="post">' ;
print '<input type="hidden" name="token" value="' . $_SESSION [ 'newtoken' ] . '">' ;
2018-03-06 11:54:05 +01:00
print '<div class="div-table-responsive-no-min">' ;
2015-06-29 06:28:04 +02:00
print '<table class="noborder" width="100%">' ;
2018-03-06 11:54:05 +01:00
print '<tr class="liste_titre"><td class="titlefield wordbreak">' . $langs -> trans ( " CompanyIds " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
// Managing Director(s)
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " ManagingDirectors " ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
print $conf -> global -> MAIN_INFO_SOCIETE_MANAGERS . '</td></tr>' ;
2018-05-15 11:50:42 +02:00
// GDPR Contact
print '<tr class="oddeven"><td>' . $langs -> trans ( " GDPRContact " ) . '</td><td>' ;
print $conf -> global -> MAIN_INFO_GDPR . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
// Capital
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Capital " ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
print $conf -> global -> MAIN_INFO_CAPITAL . '</td></tr>' ;
2016-06-21 17:00:52 +02:00
// Juridical Status
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " JuridicalStatus " ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
print getFormeJuridiqueLabel ( $conf -> global -> MAIN_INFO_SOCIETE_FORME_JURIDIQUE );
print '</td></tr>' ;
// ProfId1
if ( $langs -> transcountry ( " ProfId1 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> transcountry ( " ProfId1 " , $mysoc -> country_code ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $conf -> global -> MAIN_INFO_SIREN ))
{
print $conf -> global -> MAIN_INFO_SIREN ;
2016-07-04 10:28:11 +02:00
$s = $mysoc -> id_prof_url ( 1 , $mysoc );
if ( $s ) print ' - ' . $s ;
2015-06-29 06:28:04 +02:00
} else {
print ' ' ;
}
print '</td></tr>' ;
}
// ProfId2
if ( $langs -> transcountry ( " ProfId2 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> transcountry ( " ProfId2 " , $mysoc -> country_code ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $conf -> global -> MAIN_INFO_SIRET ))
{
print $conf -> global -> MAIN_INFO_SIRET ;
2016-07-04 10:28:11 +02:00
$s = $mysoc -> id_prof_url ( 2 , $mysoc );
if ( $s ) print ' - ' . $s ;
2015-06-29 06:28:04 +02:00
} else {
print ' ' ;
}
print '</td></tr>' ;
}
// ProfId3
if ( $langs -> transcountry ( " ProfId3 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> transcountry ( " ProfId3 " , $mysoc -> country_code ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $conf -> global -> MAIN_INFO_APE ))
{
print $conf -> global -> MAIN_INFO_APE ;
2016-07-04 10:28:11 +02:00
$s = $mysoc -> id_prof_url ( 3 , $mysoc );
if ( $s ) print ' - ' . $s ;
2015-06-29 06:28:04 +02:00
} else {
print ' ' ;
}
print '</td></tr>' ;
}
// ProfId4
if ( $langs -> transcountry ( " ProfId4 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> transcountry ( " ProfId4 " , $mysoc -> country_code ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $conf -> global -> MAIN_INFO_RCS ))
{
print $conf -> global -> MAIN_INFO_RCS ;
2016-07-04 10:28:11 +02:00
$s = $mysoc -> id_prof_url ( 4 , $mysoc );
if ( $s ) print ' - ' . $s ;
2015-06-29 06:28:04 +02:00
} else {
print ' ' ;
}
print '</td></tr>' ;
}
// ProfId5
if ( $langs -> transcountry ( " ProfId5 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> transcountry ( " ProfId5 " , $mysoc -> country_code ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $conf -> global -> MAIN_INFO_PROFID5 ))
{
print $conf -> global -> MAIN_INFO_PROFID5 ;
2016-07-04 10:28:11 +02:00
$s = $mysoc -> id_prof_url ( 5 , $mysoc );
if ( $s ) print ' - ' . $s ;
2015-06-29 06:28:04 +02:00
} else {
print ' ' ;
}
print '</td></tr>' ;
}
// ProfId6
if ( $langs -> transcountry ( " ProfId6 " , $mysoc -> country_code ) != '-' )
{
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> transcountry ( " ProfId6 " , $mysoc -> country_code ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $conf -> global -> MAIN_INFO_PROFID6 ))
{
print $conf -> global -> MAIN_INFO_PROFID6 ;
2016-07-04 10:28:11 +02:00
$s = $mysoc -> id_prof_url ( 6 , $mysoc );
if ( $s ) print ' - ' . $s ;
2015-06-29 06:28:04 +02:00
} else {
print ' ' ;
}
print '</td></tr>' ;
}
2016-06-21 17:00:52 +02:00
// VAT
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " VATIntra " ) . '</td>' ;
2015-06-29 06:28:04 +02:00
print '<td>' ;
if ( ! empty ( $conf -> global -> MAIN_INFO_TVAINTRA ))
{
$s = '' ;
$s .= $conf -> global -> MAIN_INFO_TVAINTRA ;
$s .= '<input type="hidden" name="tva_intra" size="12" maxlength="20" value="' . $conf -> global -> MAIN_INFO_TVAINTRA . '">' ;
2016-07-04 10:28:11 +02:00
if ( empty ( $conf -> global -> MAIN_DISABLEVATCHECK ) && $mysoc -> isInEEC ())
2015-06-29 06:28:04 +02:00
{
2016-07-04 10:28:11 +02:00
$s .= ' - ' ;
2015-06-29 06:28:04 +02:00
if ( ! empty ( $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>' ;
2016-03-25 15:24:57 +01:00
$s = $form -> textwithpicto ( $s , $langs -> trans ( " VATIntraCheckDesc " , $langs -> trans ( " VATIntraCheck " )), 1 );
2015-06-29 06:28:04 +02:00
}
else
{
$s .= '<a href="' . $langs -> transcountry ( " VATIntraCheckURL " , $soc -> id_country ) . '" target="_blank">' . img_picto ( $langs -> trans ( " VATIntraCheckableOnEUSite " ), 'help' ) . '</a>' ;
}
}
print $s ;
}
else
{
print ' ' ;
}
print '</td>' ;
print '</tr>' ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td class="tdtop">' . $langs -> trans ( " CompanyObject " ) . '</td><td>' . ( ! empty ( $conf -> global -> MAIN_INFO_SOCIETE_OBJECT ) ? nl2br ( $conf -> global -> MAIN_INFO_SOCIETE_OBJECT ) : '' ) . '</td></tr>' ;
2015-06-29 06:28:04 +02:00
print '</table>' ;
2018-03-06 11:54:05 +01:00
print " </div> " ;
2015-06-29 06:28:04 +02:00
print '</form>' ;
/*
2016-06-21 17:00:52 +02:00
* fiscal year beginning
2015-06-29 06:28:04 +02:00
*/
print '<br>' ;
2018-03-06 11:54:05 +01:00
print '<div class="div-table-responsive-no-min">' ;
2015-06-29 06:28:04 +02:00
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre">' ;
2016-12-04 01:12:52 +01:00
print '<td class="titlefield">' . $langs -> trans ( " FiscalYearInformation " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td>' ;
2015-06-29 06:28:04 +02:00
print " </tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " FiscalMonthStart " ) . '</td><td>' ;
2015-06-29 06:28:04 +02:00
$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' ) . '</td></tr>' ;
print " </table> " ;
2018-03-06 11:54:05 +01:00
print " </div> " ;
2015-06-29 06:28:04 +02:00
/*
2016-06-21 17:00:52 +02:00
* tax options
2015-06-29 06:28:04 +02:00
*/
print '<br>' ;
2018-03-06 11:54:05 +01:00
print '<div class="div-table-responsive-no-min">' ;
2015-06-29 06:28:04 +02:00
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre">' ;
2017-12-10 15:24:47 +01:00
print '<td class="titlefield">' . $langs -> trans ( " VATManagement " ) . '</td><td>' . $langs -> trans ( " Description " ) . '</td>' ;
2015-06-29 06:28:04 +02:00
print '<td align="right"> </td>' ;
print " </tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-12-10 15:24:47 +01:00
print '<tr class="oddeven"><td class="titlefield">' ;
print " <input class= \" oddeven \" type= \" radio \" name= \" optiontva \" id= \" use_vat \" disabled value= \" 1 \" " . ( empty ( $conf -> global -> FACTURE_TVAOPTION ) ? " " : " checked " ) . " > " . $langs -> trans ( " VATIsUsed " ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label for= \" use_vat \" > " . $langs -> trans ( " VATIsUsedDesc " ) . " </label></td></tr> " ;
print " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> trans ( " VATIsUsedExampleFR " ) . " </i></td></tr> \n " ;
print " </table> " ;
print " </td></tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-12-10 15:24:47 +01:00
print '<tr class="oddeven"><td class="titlefield">' ;
print " <input class= \" oddeven \" type= \" radio \" name= \" optiontva \" id= \" no_vat \" disabled value= \" 0 \" " . ( empty ( $conf -> global -> FACTURE_TVAOPTION ) ? " checked " : " " ) . " > " . $langs -> trans ( " VATIsNotUsed " ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label= \" no_vat \" > " . $langs -> trans ( " VATIsNotUsedDesc " ) . " </label></td></tr> " ;
print " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> trans ( " VATIsNotUsedExampleFR " ) . " </i></td></tr> \n " ;
print " </table> " ;
print " </td></tr> \n " ;
print " </table> " ;
2018-03-06 11:54:05 +01:00
print " </div> " ;
2015-06-29 06:28:04 +02:00
/*
* Local Taxes
*/
2015-11-14 19:31:16 +01:00
if ( $mysoc -> useLocalTax ( 1 )) // True if we found at least on vat with a setup adding a localtax 1
2015-06-29 06:28:04 +02:00
{
// Local Tax 1
print '<br>' ;
2018-03-06 11:54:05 +01:00
print '<div class="div-table-responsive-no-min">' ;
2015-06-29 06:28:04 +02:00
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre">' ;
2017-12-10 15:24:47 +01:00
print '<td class="titlefield">' . $langs -> transcountry ( " LocalTax1Management " , $mysoc -> country_code ) . '</td><td>' . $langs -> trans ( " Description " ) . '</td>' ;
2015-06-29 06:28:04 +02:00
print '<td align="right"> </td>' ;
print " </tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-12-10 15:24:47 +01:00
print " <tr class= \" oddeven \" ><td> " ;
print " <input class= \" oddeven \" type= \" radio \" name= \" optionlocaltax1 \" id= \" lt1 \" disabled value= \" localtax1on \" " . (( $conf -> global -> FACTURE_LOCAL_TAX1_OPTION == '1' || $conf -> global -> FACTURE_LOCAL_TAX1_OPTION == " localtax1on " ) ? " checked " : " " ) . " > " . $langs -> transcountry ( " LocalTax1IsUsed " , $mysoc -> country_code ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td></label for= \" lt1 \" > " . $langs -> transcountry ( " LocalTax1IsUsedDesc " , $mysoc -> country_code ) . " </label></td></tr> " ;
$example = $langs -> transcountry ( " LocalTax1IsUsedExample " , $mysoc -> country_code );
print ( $example != " LocalTax1IsUsedExample " ? " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> transcountry ( " LocalTax1IsUsedExample " , $mysoc -> country_code ) . " </i></td></tr> \n " : " " );
if ( $conf -> global -> MAIN_INFO_VALUE_LOCALTAX1 != 0 )
{
print '<tr><td>' . $langs -> trans ( " LTRate " ) . ': ' . $conf -> global -> MAIN_INFO_VALUE_LOCALTAX1 . '</td></tr>' ;
}
print '<tr><td align="left">' . $langs -> trans ( " CalcLocaltax " ) . ': ' ;
if ( $conf -> global -> MAIN_INFO_LOCALTAX_CALC1 == 0 )
{
2016-02-19 04:05:08 +01:00
print $langs -> trans ( " CalcLocaltax1 " ) . ' - ' . $langs -> trans ( " CalcLocaltax1Desc " );
2015-06-29 06:28:04 +02:00
}
else if ( $conf -> global -> MAIN_INFO_LOCALTAX_CALC1 == 1 )
{
2016-02-19 04:05:08 +01:00
print $langs -> trans ( " CalcLocaltax2 " ) . ' - ' . $langs -> trans ( " CalcLocaltax2Desc " );
2015-06-29 06:28:04 +02:00
}
else if ( $conf -> global -> MAIN_INFO_LOCALTAX_CALC1 == 2 ){
2016-02-19 04:05:08 +01:00
print $langs -> trans ( " CalcLocaltax3 " ) . ' - ' . $langs -> trans ( " CalcLocaltax3Desc " );
2015-06-29 06:28:04 +02:00
}
print '</td></tr>' ;
print " </table> " ;
print " </td></tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-12-10 15:24:47 +01:00
print '<tr class="oddeven"><td>' ;
print " <input class= \" oddeven \" type= \" radio \" name= \" optionlocaltax1 \" id= \" nolt1 \" disabled value= \" localtax1off \" " . (( empty ( $conf -> global -> FACTURE_LOCAL_TAX1_OPTION ) || $conf -> global -> FACTURE_LOCAL_TAX1_OPTION == " localtax1off " ) ? " checked " : " " ) . " > " . $langs -> transcountry ( " LocalTax1IsNotUsed " , $mysoc -> country_code ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label for= \" no_lt1 \" > " . $langs -> transcountry ( " LocalTax1IsNotUsedDesc " , $mysoc -> country_code ) . " </label></td></tr> " ;
$example = $langs -> transcountry ( " LocalTax1IsNotUsedExample " , $mysoc -> country_code );
print ( $example != " LocalTax1IsNotUsedExample " ? " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> transcountry ( " LocalTax1IsNotUsedExample " , $mysoc -> country_code ) . " </i></td></tr> \n " : " " );
print " </table> " ;
print " </td></tr> \n " ;
print " </table> " ;
2018-03-06 11:54:05 +01:00
print " </div> " ;
2015-06-29 06:28:04 +02:00
}
2015-11-14 19:31:16 +01:00
if ( $mysoc -> useLocalTax ( 2 )) // True if we found at least on vat with a setup adding a localtax 1
2015-06-29 06:28:04 +02:00
{
// Local Tax 2
print '<br>' ;
2018-03-06 11:54:05 +01:00
print '<div class="div-table-responsive-no-min">' ;
2015-06-29 06:28:04 +02:00
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre">' ;
2017-12-10 15:24:47 +01:00
print '<td class="titlefield">' . $langs -> transcountry ( " LocalTax2Management " , $mysoc -> country_code ) . '</td><td>' . $langs -> trans ( " Description " ) . '</td>' ;
2015-06-29 06:28:04 +02:00
print '<td align="right"> </td>' ;
print " </tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-12-10 15:24:47 +01:00
print " <tr class= \" oddeven \" ><td> " ;
print " <input class= \" oddeven \" type= \" radio \" name= \" optionlocaltax2 \" id= \" lt2 \" disabled value= \" localtax2on \" " . (( $conf -> global -> FACTURE_LOCAL_TAX2_OPTION == '1' || $conf -> global -> FACTURE_LOCAL_TAX2_OPTION == " localtax2on " ) ? " checked " : " " ) . " > " . $langs -> transcountry ( " LocalTax2IsUsed " , $mysoc -> country_code ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label for= \" lt2 \" > " . $langs -> transcountry ( " LocalTax2IsUsedDesc " , $mysoc -> country_code ) . " </label></td></tr> " ;
$example = $langs -> transcountry ( " LocalTax2IsUsedExample " , $mysoc -> country_code );
print ( $example != " LocalTax2IsUsedExample " ? " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> transcountry ( " LocalTax2IsUsedExample " , $mysoc -> country_code ) . " </i></td></tr> \n " : " " );
if ( $conf -> global -> MAIN_INFO_VALUE_LOCALTAX2 != 0 )
{
print '<tr><td>' . $langs -> trans ( " LTRate " ) . ': ' . $conf -> global -> MAIN_INFO_VALUE_LOCALTAX2 . '</td></tr>' ;
}
print '<tr><td align="left">' . $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 '</td></tr>' ;
print " </table> " ;
print " </td></tr> \n " ;
2017-09-06 11:39:30 +02:00
2017-04-24 16:36:58 +02:00
print " <tr class= \" oddeven \" ><td width= \" 160 \" ><input class= \" oddeven \" type= \" radio \" name= \" optionlocaltax2 \" id= \" nolt2 \" disabled value= \" localtax2off \" " . (( empty ( $conf -> global -> FACTURE_LOCAL_TAX2_OPTION ) || $conf -> global -> FACTURE_LOCAL_TAX2_OPTION == " localtax2off " ) ? " checked " : " " ) . " > " . $langs -> transcountry ( " LocalTax2IsNotUsed " , $mysoc -> country_code ) . " </td> " ;
2015-06-29 06:28:04 +02:00
print '<td colspan="2">' ;
print " <table> " ;
print " <tr><td><label for= \" nolt2 \" > " . $langs -> transcountry ( " LocalTax2IsNotUsedDesc " , $mysoc -> country_code ) . " </label></td></tr> " ;
$example = $langs -> transcountry ( " LocalTax2IsNotUsedExample " , $mysoc -> country_code );
print ( $example != " LocalTax2IsNotUsedExample " ? " <tr><td><i> " . $langs -> trans ( " Example " ) . ': ' . $langs -> transcountry ( " LocalTax2IsNotUsedExample " , $mysoc -> country_code ) . " </i></td></tr> \n " : " " );
print " </table> " ;
print " </td></tr> \n " ;
print " </table> " ;
2018-03-06 11:54:05 +01:00
print " </div> " ;
2012-11-27 13:05:21 +01:00
}
2015-06-29 06:28:04 +02:00
// Actions buttons
print '<div class="tabsAction">' ;
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER [ " PHP_SELF " ] . '?action=edit">' . $langs -> trans ( " Modify " ) . '</a></div>' ;
print '</div>' ;
2006-08-12 17:32:57 +02:00
}
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-03-23 00:51:38 +01:00
$db -> close ();