';
- // Ref/ID
- if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
- {
- print '| '.$langs->trans("ID").' | ';
- print $object->ref;
- print ' |
';
- }
+ // Ref
+ print "";
+ print '| '.$langs->trans("Ref").' | ';
+ print $object->id;
+ print ' |
';
// Name
- print '| '.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0, 'string', '', 1).' | ';
- print ' |
';
-
- // Alias names (commercial, trademark or alias names)
- print ' | ';
- print ' |
';
-
- // Prefix
- if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
- {
- print '| '.$form->editfieldkey('Prefix', 'prefix', '', $object, 0).' | ';
- // It does not change the prefix mode using the auto numbering prefix
- if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm)
- {
- print '';
- print $object->prefix_comm;
- }
- else
- {
- print '';
- }
- print ' | ';
- }
-
- // Prospect/Customer
- print '
| '.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).' | ';
- print '';
- print $formcompany->selectProspectCustomerType($object->client);
- print ' | ';
- print ''.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).' | ';
-
- print '';
-
+ print ' |
| '.$form->editfieldkey('Name', 'name', '', $object, 0, 'string', '', 1).' | ';
+ print '';
+ print ' |
';
+
+ // Parent
+ print '| '.$form->editfieldkey('Parent', 'entity', '', $object, 0, 'string', '', 1).' | ';
+ print '';
+ print $form->select_establishments($object->entity>0?$object->entity:$conf->entity, 'entity', 1);
print ' |
';
- // Supplier
- if ((! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
- || (! empty($conf->supplier_proposal->enabled) && ! empty($user->rights->supplier_proposal->lire)))
- {
- print '';
- print '| '.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).' | ';
- print $form->selectyesno("fournisseur", $object->fournisseur, 1);
- print ' | ';
- print '';
- if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
- {
- print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0);
- }
- print ' | ';
- if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
- {
- print '';
- }
- print ' |
';
- }
+ // Address
+ print '| '.$form->editfieldkey('Address', 'address', '', $object, 0).' | ';
+ print '';
+ print '';
+ print ' |
';
- // Barcode
- if (! empty($conf->barcode->enabled))
- {
- print '| '.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).' | ';
- print '';
- print ' |
';
- }
+ // Zipcode / Town
+ print '| '.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).' | ';
+ print $formcompany->select_ziptown($object->zip, 'zipcode', array (
+ 'town',
+ 'selectcountry_id'
+ ), 6) . ' |
';
+ print '| '.$form->editfieldkey('Town', 'town', '', $object, 0).' | ';
+ print $formcompany->select_ziptown($object->town, 'town', array (
+ 'zipcode',
+ 'selectcountry_id'
+ )) . ' |
';
- // Status
- print '| '.$form->editfieldkey('Status', 'status', '', $object, 0).' | ';
- print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->status);
- print ' |
';
+ // Country
+ print '| '.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).' | ';
+ print '';
+ print $form->select_country($object->fk_country, 'country_id');
+ if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
+ print ' | ';
+ print '
';
- // Address
- print '| '.$form->editfieldkey('Address', 'address', '', $object, 0).' | ';
- print ' |
';
-
- // Zip / Town
- print '| '.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).' | ';
- print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth50onsmartphone');
- print ' | '.$form->editfieldkey('Town', 'town', '', $object, 0).' | ';
- print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
- print ' |
';
-
- // Country
- print '| '.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).' | ';
- print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id), 'country_id');
- if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
- print ' |
';
-
- // State
- if (empty($conf->global->SOCIETE_DISABLE_STATE))
- {
- if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
- {
- print '| '.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).' | ';
- }
- else
- {
- print ' |
| '.$form->editfieldkey('State', 'state_id', '', $object, 0).' | ';
- }
-
- print $formcompany->select_state($object->state_id, $object->country_code);
- print ' |
';
- }
-
- // EMail / Web
- print '| '.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', (! empty($conf->global->SOCIETE_EMAIL_MANDATORY))).' | ';
- print ' |
';
- print '| '.$form->editfieldkey('Web', 'url', '', $object, 0).' | ';
- print ' |
';
-
- if (! empty($conf->socialnetworks->enabled))
- {
- // Skype
- if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
- {
- print '| '.$form->editfieldkey('Skype', 'skype', '', $object, 0).' | ';
- print ' |
';
- }
- // Twitter
- if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
- {
- print '| '.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).' | ';
- print ' |
';
- }
- // Facebook
- if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
- {
- print '| '.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).' | ';
- print ' |
';
- }
- }
-
- // Phone / Fax
- print '| '.$form->editfieldkey('Phone', 'phone', '', $object, 0).' | ';
- print ' | ';
- print ''.$form->editfieldkey('Fax', 'fax', '', $object, 0).' | ';
- print ' |
';
-
- // Prof ids
- $i=1; $j=0;
- while ($i <= 6)
- {
- $idprof=$langs->transcountry('ProfId'.$i, $object->country_code);
- if ($idprof!='-')
- {
- $key='idprof'.$i;
-
- if (($j % 2) == 0) print '';
-
- $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
- print '| '.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', ! (empty($conf->global->$idprof_mandatory) || ! $object->isACompany())).' | ';
- print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code);
- print ' | ';
- if (($j % 2) == 1) print '
';
- $j++;
- }
- $i++;
- }
- if ($j % 2 == 1) print ' | ';
-
- // VAT is used
- print '| '.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).' | ';
- print $form->selectyesno('assujtva_value', $object->tva_assuj, 1);
- print ' |
';
-
- // Local Taxes
- //TODO: Place into a function to control showing by country or study better option
- if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
- {
- print '| '.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).' | ';
- print $form->selectyesno('localtax1assuj_value', $object->localtax1_assuj, 1);
- if(! isOnlyOneLocalTax(1))
- {
- print ' '.$langs->transcountry("Type", $mysoc->country_code).': ';
- $formcompany->select_localtax(1, $object->localtax1_value, "lt1");
- print '';
- }
- print ' | ';
-
- print ''.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).' | ';
- print $form->selectyesno('localtax2assuj_value', $object->localtax2_assuj, 1);
- if (! isOnlyOneLocalTax(2))
- {
- print ' '.$langs->transcountry("Type", $mysoc->country_code).': ';
- $formcompany->select_localtax(2, $object->localtax2_value, "lt2");
- print '';
- }
- print ' |
';
- }
- elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
- {
- print '| '.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).' | ';
- print $form->selectyesno('localtax1assuj_value', $object->localtax1_assuj, 1);
- if(! isOnlyOneLocalTax(1))
- {
- print ' '.$langs->transcountry("Type", $mysoc->country_code).': ';
- $formcompany->select_localtax(1, $object->localtax1_value, "lt1");
- print '';
- }
- print ' |
';
- }
- elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
- {
- print '| '.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).' | ';
- print $form->selectyesno('localtax2assuj_value', $object->localtax2_assuj, 1);
- if(! isOnlyOneLocalTax(2))
- {
- print ' '.$langs->transcountry("Type", $mysoc->country_code).': ';
- $formcompany->select_localtax(2, $object->localtax2_value, "lt2");
- print '';
- }
- print ' |
';
- }
-
- // VAT Code
- print '| '.$form->editfieldkey('VATIntra', 'intra_vat', '', $object, 0).' | ';
- print '';
- $s ='';
-
- if (empty($conf->global->MAIN_DISABLEVATCHECK) && isInEEC($object))
- {
- $s.=' ';
-
- if ($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.='country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').'';
- }
- }
- print $s;
- print ' | ';
- print '
';
-
- // Type - Size
- print '| '.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).' | ';
- print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
- if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
- print ' | ';
- print ''.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).' | ';
- print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id);
- if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
- print ' |
';
-
- // Juridical type
- print '| '.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).' | ';
- print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code');
- print ' |
';
-
- // Capital
- print '| '.$form->editfieldkey('Capital', 'capital', '', $object, 0).' | ';
- print ' '.$langs->trans("Currency".$conf->currency).' |
';
-
- // Default language
- if (! empty($conf->global->MAIN_MULTILANGS))
- {
- print '| '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).' | '."\n";
- print $formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1);
- print ' | ';
- print '
';
- }
-
- // Incoterms
- if (!empty($conf->incoterm->enabled))
- {
- print '';
- print '| '.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).' | ';
- print '';
- print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''));
- print ' |
';
- }
-
- // Categories
- if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
- {
- // Customer
- print '| ' . $form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0) . ' | ';
- print '';
- $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, null, null, null, 1);
- $c = new Categorie($db);
- $cats = $c->containing($object->id, Categorie::TYPE_CUSTOMER);
- $arrayselected=array();
- foreach ($cats as $cat) {
- $arrayselected[] = $cat->id;
- }
- print $form->multiselectarray('custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
- print " |
";
-
- // Supplier
- print '| ' . $form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0) . ' | ';
- print '';
- $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1);
- $c = new Categorie($db);
- $cats = $c->containing($object->id, Categorie::TYPE_SUPPLIER);
- $arrayselected=array();
- foreach ($cats as $cat) {
- $arrayselected[] = $cat->id;
- }
- print $form->multiselectarray('suppcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
- print " |
";
- }
-
- // Multicurrency
- if (! empty($conf->multicurrency->enabled))
- {
- print '';
- print '| '.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' | ';
- print '';
- print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1);
- print ' |
';
- }
-
- // Other attributes
- $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
- $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- if (empty($reshook))
- {
- print $object->showOptionals($extrafields, 'edit');
- }
-
- // Webservices url/key
- if (!empty($conf->syncsupplierwebservices->enabled)) {
- print '| '.$form->editfieldkey('WebServiceURL', 'webservices_url', '', $object, 0).' | ';
- print ' | ';
- print ''.$form->editfieldkey('WebServiceKey', 'webservices_key', '', $object, 0).' | ';
- print ' |
';
- }
-
- // Logo
- print '';
- print '| '.$form->editfieldkey('Logo', 'photoinput', '', $object, 0).' | ';
- print '';
- if ($object->logo) print $form->showphoto('societe', $object);
- $caneditfield=1;
- if ($caneditfield)
- {
- if ($object->logo) print " \n";
- print '';
- }
- print ' | ';
- print '
';
-
- // Assign sale representative
- print '';
- print '| '.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).' | ';
- print '';
- $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1);
- $arrayselected = GETPOST('commercial', 'array');
- if (empty($arrayselected)) $arrayselected = $object->getSalesRepresentatives($user, 1);
- print $form->multiselectarray('commercial', $userlist, $arrayselected, null, null, null, null, "90%");
- print ' |
';
+ // Status
+ print '| '.$form->editfieldkey('Status', 'status', '', $object, 0, 'string', '', 1).' | ';
+ print $form->selectarray('status', $status2label, $object->status);
+ print ' |
';
print '