diff --git a/htdocs/societe/canvas/default/tpl/view.tpl.php b/htdocs/societe/canvas/default/tpl/view.tpl.php index 4a17dcd09d3..3f9dea8ca20 100644 --- a/htdocs/societe/canvas/default/tpl/view.tpl.php +++ b/htdocs/societe/canvas/default/tpl/view.tpl.php @@ -21,5 +21,349 @@ + +
+ + +
+ + + + + + + + + + + + + +client) { ?> + + + + + + +fournisseur) { ?> + + + + + + +global->MAIN_MODULE_BARCODE) { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +transcountry('ProfId1',$soc->pays_code); ?> + + + + + + + + + + +transcountry('ProfId2',$soc->pays_code); ?> + + + + + + + + + + +transcountry('ProfId3',$soc->pays_code); ?> + + + + + + + + + + +transcountry('ProfId4',$soc->pays_code); ?> + + + + + + + + + + + + + + +use_javascript_ajax) { ?> + + + + + + + +pays_code=='ES') { + if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { ?> + + + + + + + localtax1_assuj=="1") { ?> + + + + + localtax2_assuj=="1") { ?> + + + + + + + + + + + + + + + + +typent_array(1); +$soc->typent= $arr[$soc->typent_code]; +?> + + + + + + + +global->MAIN_MULTILANGS) +{ + require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); + echo ''; +} +?> + + + + + + + + + + + + + + + + +adherent->enabled) { + $langs->load("members"); + echo ''; + echo ''; + echo "\n"; +} +?> + +
trans('Name'); ?>showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); ?>
trans('Prefix'); ?>prefix_comm; ?>
trans('CustomerCode'); ?>code_client; ?> + check_codeclient() <> 0) { ?> + (trans("WrongCustomerCode"); ?>) + +
trans('SupplierCode'); ?>code_fournisseur; ?> + check_codefournisseur() <> 0) { ?> + (trans("WrongSupplierCode"); ?>) + +
trans('Gencod'); ?>gencod; ?>
trans('Address'); ?>address); ?>
trans('Zip'); ?>cp; ?>trans('Town'); ?>ville; ?>
trans("Country"); ?> + pays_code); + if ($soc->isInEEC()) echo $form->textwithpicto(($img?$img.' ':'').$soc->pays,$langs->trans("CountryIsInEEC"),1,0); + else echo ($img?$img.' ':'').$soc->pays; + ?> +
trans('State'); ?>departement; ?>
trans('Phone'); ?>tel,$soc->pays_code,0,$soc->id,'AC_TEL'); ?>trans('Fax'); ?>fax,$soc->pays_code,0,$soc->id,'AC_FAX'); ?>
trans('EMail'); ?>email,0,$soc->id,'AC_EMAIL'); ?>trans('Web'); ?>url); ?>
siren; ?> + siren) { + if ($soc->id_prof_check(1,$soc) > 0) print '   '.$soc->id_prof_url(1,$soc); + else print ' ('.$langs->trans("ErrorWrongValue").')'; + } ?> +
  siret; ?> + siret) { + if ($soc->id_prof_check(2,$soc) > 0) print '   '.$soc->id_prof_url(2,$soc); + else print ' ('.$langs->trans("ErrorWrongValue").')'; + } ?> +
  
ape; ?> + ape) { + if ($soc->id_prof_check(3,$soc) > 0) print '   '.$soc->id_prof_url(3,$soc); + else print ' ('.$langs->trans("ErrorWrongValue").')'; + } ?> +
  idprof4; ?> + idprof4) { + if ($soc->id_prof_check(4,$soc) > 0) print '   '.$soc->id_prof_url(4,$soc); + else print ' ('.$langs->trans("ErrorWrongValue").')'; + } ?> +
  
trans('VATIsUsed'); ?>tva_assuj); ?>trans('VATIntra'); ?> + tva_intra) { + $s=''; + $s.=$soc->tva_intra; + $s.=''; + $s.='   '; + if ($conf->use_javascript_ajax) { + $s.=''.$langs->trans("VATIntraCheck").''; + echo $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + } else { + echo $s.'id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + } + } else { + echo ' '; + } ?> +
trans("LocalTax1IsUsedES"); ?>localtax1_assuj); ?>trans("LocalTax2IsUsedES"); ?>localtax2_assuj); ?>
trans("LocalTax1IsUsedES"); ?>localtax1_assuj); ?>
trans("LocalTax2IsUsedES"); ?>localtax2_assuj); ?>
trans('Capital'); ?> + capital) echo $soc->capital.' '.$langs->trans("Currency".$conf->monnaie); + else echo ' '; + ?> +
trans('JuridicalStatus'); ?>forme_juridique; ?>
trans("Type"); ?>typent; ?>trans("Staff"); ?>effectif; ?>
'.$langs->trans("DefaultLang").''; + //$s=picto_from_langcode($soc->default_lang); + //print ($s?$s.' ':''); + $langs->load("languages"); + $labellang = ($soc->default_lang?$langs->trans('Language_'.$soc->default_lang):''); + echo $labellang; + echo '
+ + + + + +
trans('RIB'); ?> + rights->societe->creer) { ?> + + +   + +
+
display_rib(); ?>
+ + + + + +
trans('ParentCompany'); ?> + rights->societe->creer) { ?> + + +   + +
+
+ parent) { + $socm = new Societe($db); + $socm->fetch($soc->parent); + echo $socm->getNomUrl(1).' '.($socm->code_client?"(".$socm->code_client.")":""); + echo $socm->ville?' - '.$socm->ville:''; + } else { + echo $langs->trans("NoParentCompany"); + } ?> +
+ + + + + +
trans('SalesRepresentatives'); ?> + rights->societe->creer) { ?> + + +   + +
+
+ id; + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + echo $obj->nb?($obj->nb):$langs->trans("NoSalesRepresentativeAffected"); + } else { + dol_print_error($db); + } + ?> +
'.$langs->trans("LinkedToDolibarrMember").''; + $adh=new Adherent($db); + $result=$adh->fetch('','',$soc->id); + if ($result > 0) { + $adh->ref=$adh->getFullName($langs); + echo $adh->getNomUrl(1); + } else { + echo $langs->trans("UserNotLinkedToMember"); + } + echo '
+
+ + \ No newline at end of file diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 94c3cde543c..4f0d20ad054 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1138,6 +1138,8 @@ else $head = societe_prepare_head($soc); dol_fiche_head($head, 'company', $langs->trans("ThirdParty"),0,'company'); + + $html = new Form($db); // Confirm delete third party @@ -1147,323 +1149,10 @@ else $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,2); if ($ret == 'html') print '
'; } - - if ($mesg) - { - print '
'; - print $mesg; - print '
'; - } - - print '
'; - print ''; - print ''; - - // Name - print ''; - print ''; - - print ''; - - if ($soc->client) - { - print ''; - } - - if ($soc->fournisseur) { - print ''; - } - - if ($conf->global->MAIN_MODULE_BARCODE) - { - print ''; - } - - print ""; - - print '"; - print '"; - - // Country - print ''; - - // Department - print ''; - - print ''; - print ''; - - // EMail - print ''; - - // Web - print ''; - - // ProfId1 (SIREN for France) - $profid=$langs->transcountry('ProfId1',$soc->pays_code); - if ($profid!='-') - { - print ''; - } - else print ''; - // ProfId2 (SIRET for France) - $profid=$langs->transcountry('ProfId2',$soc->pays_code); - if ($profid!='-') - { - print ''; - } - else print ''; - - // ProfId3 (APE for France) - $profid=$langs->transcountry('ProfId3',$soc->pays_code); - if ($profid!='-') - { - print ''; - } - else print ''; - // ProfId4 (NU for France) - $profid=$langs->transcountry('ProfId4',$soc->pays_code); - if ($profid!='-') - { - print ''; - } - else print ''; - - // VAT payers - $html = new Form($db); - print ''; - - // VAT Code - if ($conf->use_javascript_ajax) - { - print "\n"; - print ''; - print "\n"; - } - print ''; - - print ''; - - // Local Taxes - if($mysoc->pays_code=='ES') - { - if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") - { - print ''; - - } - elseif($mysoc->localtax1_assuj=="1") - { - print ''; - } - elseif($mysoc->localtax2_assuj=="1") - { - print ''; - } - } - - // Capital - print ''; - - // Legal - print ''; - - // Type + Staff - $arr = $formcompany->typent_array(1); - $soc->typent= $arr[$soc->typent_code]; - print ''; - - // Default language - if ($conf->global->MAIN_MULTILANGS) - { - require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); - print ''; - } - - // Ban - print ''; - print ''; - - // Parent company - print ''; - print ''; - - // Commercial - print ''; - print ''; - - // Module Adherent - if ($conf->adherent->enabled) - { - $langs->load("members"); - print ''; - print ''; - print "\n"; - } - - print '
'.$langs->trans('Name').''; - print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); - print '
'.$langs->trans('Prefix').''.$soc->prefix_comm.'
'; - print $langs->trans('CustomerCode').''; - print $soc->code_client; - if ($soc->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; - print '
'; - print $langs->trans('SupplierCode').''; - print $soc->code_fournisseur; - if ($soc->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; - print '
'.$langs->trans('Gencod').''.$soc->gencod.'
".$langs->trans('Address')."".nl2br($soc->address)."
'.$langs->trans('Zip').''.$soc->cp."'.$langs->trans('Town').''.$soc->ville."
'.$langs->trans("Country").''; - $img=picto_from_langcode($soc->pays_code); - if ($soc->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$soc->pays,$langs->trans("CountryIsInEEC"),1,0); - else print ($img?$img.' ':'').$soc->pays; - print '
'.$langs->trans('State').''.$soc->departement.'
'.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->pays_code,0,$soc->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->pays_code,0,$soc->id,'AC_FAX').'
'.$langs->trans('EMail').''; - print dol_print_email($soc->email,0,$soc->id,'AC_EMAIL'); - print ''.$langs->trans('Web').''; - print dol_print_url($soc->url); - print '
'.$profid.''; - print $soc->siren; - if ($soc->siren) - { - if ($soc->id_prof_check(1,$soc) > 0) print '   '.$soc->id_prof_url(1,$soc); - else print ' ('.$langs->trans("ErrorWrongValue").')'; - } - print '
  '.$profid.''; - print $soc->siret; - if ($soc->siret) - { - if ($soc->id_prof_check(2,$soc) > 0) print '   '.$soc->id_prof_url(2,$soc); - else print ' ('.$langs->trans("ErrorWrongValue").')'; - } - print '
  
'.$profid.''; - print $soc->ape; - if ($soc->ape) - { - if ($soc->id_prof_check(3,$soc) > 0) print '   '.$soc->id_prof_url(3,$soc); - else print ' ('.$langs->trans("ErrorWrongValue").')'; - } - print '
  '.$profid.''; - print $soc->idprof4; - if ($soc->idprof4) - { - if ($soc->id_prof_check(4,$soc) > 0) print '   '.$soc->id_prof_url(4,$soc); - else print ' ('.$langs->trans("ErrorWrongValue").')'; - } - print '
  
'; - print $langs->trans('VATIsUsed'); - print ''; - print yn($soc->tva_assuj); - print ''.$langs->trans('VATIntra').''; - if ($soc->tva_intra) - { - $s=''; - $s.=$soc->tva_intra; - $s.=''; - $s.='   '; - if ($conf->use_javascript_ajax) - { - $s.=''.$langs->trans("VATIntraCheck").''; - print $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); - } - else - { - print $s.'id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; - } - } - else - { - print ' '; - } - print '
'.$langs->trans("LocalTax1IsUsedES").''; - print yn($soc->localtax1_assuj); - print ''.$langs->trans("LocalTax2IsUsedES").''; - print yn($soc->localtax2_assuj); - print '
'.$langs->trans("LocalTax1IsUsedES").''; - print yn($soc->localtax1_assuj); - print '
'.$langs->trans("LocalTax2IsUsedES").''; - print yn($soc->localtax2_assuj); - print '
'.$langs->trans('Capital').''; - if ($soc->capital) print $soc->capital.' '.$langs->trans("Currency".$conf->monnaie); - else print ' '; - print '
'.$langs->trans('JuridicalStatus').''.$soc->forme_juridique.'
'.$langs->trans("Type").''.$soc->typent.''.$langs->trans("Staff").''.$soc->effectif.'
'.$langs->trans("DefaultLang").''; - //$s=picto_from_langcode($soc->default_lang); - //print ($s?$s.' ':''); - $langs->load("languages"); - $labellang = ($soc->default_lang?$langs->trans('Language_'.$soc->default_lang):''); - print $labellang; - print '
'; - print '
'; - print $langs->trans('RIB'); - print ''; - if ($user->rights->societe->creer) - print ''.img_edit().''; - else - print ' '; - print '
'; - print '
'; - print $soc->display_rib(); - print '
'; - print '
'; - print $langs->trans('ParentCompany'); - print ''; - if ($user->rights->societe->creer) - print ''.img_edit() .''; - else - print ' '; - print '
'; - print '
'; - if ($soc->parent) - { - $socm = new Societe($db); - $socm->fetch($soc->parent); - print $socm->getNomUrl(1).' '.($socm->code_client?"(".$socm->code_client.")":""); - print $socm->ville?' - '.$socm->ville:''; - } - else { - print $langs->trans("NoParentCompany"); - } - print '
'; - print '
'; - print $langs->trans('SalesRepresentatives'); - print ''; - if ($user->rights->societe->creer) - print ''.img_edit().''; - else - print ' '; - print '
'; - print '
'; - - $sql = "SELECT count(sc.rowid) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE sc.fk_soc =".$soc->id; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $obj = $db->fetch_object($resql); - print $obj->nb?($obj->nb):$langs->trans("NoSalesRepresentativeAffected"); - } - else { - dol_print_error($db); - } - print '
'.$langs->trans("LinkedToDolibarrMember").''; - $adh=new Adherent($db); - $result=$adh->fetch('','',$soc->id); - if ($result > 0) - { - $adh->ref=$adh->getFullName($langs); - print $adh->getNomUrl(1); - } - else - { - print $langs->trans("UserNotLinkedToMember"); - } - print '
'; - print '
'; - print "\n"; + + // Template + // TODO utiliser la classe canvas + include(DOL_DOCUMENT_ROOT."/societe/canvas/default/tpl/view.tpl.php"); /* * Actions