';
- // Call Hook tabContentEditThirdparty
- $parameters = array();
- // Note that $action and $object may be modified by hook
- $reshook = $hookmanager->executeHooks('tabContentEditThirdparty', $parameters, $object, $action);
- if (empty($reshook)) {
- print '
';
-
- // Ref/ID
- if (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID')) {
- print ''.$langs->trans("ID").' | ';
- print $object->ref;
- print ' |
';
- }
-
- // Name
- print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0, 'string', '', 1).' | ';
- print '';
- print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300');
- print ' |
';
-
- // Alias names (commercial, trademark or alias names)
- print ' | ';
- print ' |
';
-
- // Prefix
- if (getDolGlobalString('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 ' | ';
- if ($conf->browser->layout == 'phone') {
- print '
';
- }
- print ''.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).' | ';
-
- print '';
-
- print ' |
';
-
- // Supplier
- if (((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')))
- || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) {
- print '';
- print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).' | ';
- print '';
- print $form->selectyesno("fournisseur", $object->fournisseur, 1, false, 0, 1);
- print ' | ';
- if ($conf->browser->layout == 'phone') {
- print '
';
- }
- print '';
- if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
- print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0);
- }
- print ' | ';
- print '';
- print '';
- print ' |
';
- }
-
- // Barcode
- if (isModEnabled('barcode')) {
- print ''.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).' | ';
- print '';
- print img_picto('', 'barcode');
- print '';
- print ' |
';
- }
-
- // Status
- print ''.$form->editfieldkey('Status', 'status', '', $object, 0).' | ';
- print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1);
- print ' |
';
-
- // Address
- print ''.$form->editfieldkey('Address', 'address', '', $object, 0).' | ';
- print '';
- print $form->widgetForTranslation("address", $object, $permissiontoadd, 'textarea', 'alphanohtml', 'quatrevingtpercent');
- print ' |
';
-
- // Zip / Town
- print ''.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).' | browser->layout == 'phone' ? ' colspan="3"' : '').'>';
- print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100');
- print ' | ';
- if ($conf->browser->layout == 'phone') {
- print '
';
- }
- print ''.$form->editfieldkey('Town', 'town', '', $object, 0).' | browser->layout == 'phone' ? ' colspan="3"' : '').'>';
- print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
- print $form->widgetForTranslation("town", $object, $permissiontoadd, 'string', 'alphanohtml', 'maxwidth100 quatrevingtpercent');
- print ' |
';
-
- // Country
- print ''.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).' | ';
- print img_picto('', 'globe-americas', 'class="paddingrightonly"');
- print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx');
- if ($user->admin) {
- print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
- }
- print ' |
';
-
- // State
- if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) {
- if ((getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('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 img_picto('', 'state', 'class="pictofixedwidth"');
- print $formcompany->select_state($object->state_id, $object->country_code);
- print ' |
';
- }
-
- // Phone / Fax
- print ''.$form->editfieldkey('Phone', 'phone', GETPOST('phone', 'alpha'), $object, 0).' | ';
- print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' | ';
- if ($conf->browser->layout == 'phone') {
- print '
';
- }
- print ''.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).' | ';
- print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' | ';
- print '
';
-
- // Web
- print ''.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).' | ';
- print ''.img_picto('', 'globe', 'class="pictofixedwidth"').' |
';
-
- // EMail
- print ''.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (getDolGlobalString('SOCIETE_EMAIL_MANDATORY'))).' | ';
- print '';
- print img_picto('', 'object_email', 'class="pictofixedwidth"');
- print '';
- print ' |
';
-
- // Unsubscribe
- if (isModEnabled('mailing')) {
- if ($conf->use_javascript_ajax && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2) {
- print "\n".''."\n";
- }
- if (!GETPOSTISSET("no_email") && !empty($object->email)) {
- $result = $object->getNoEmail();
- if ($result < 0) {
- setEventMessages($object->error, $object->errors, 'errors');
- }
- }
- print '';
- print ' | ';
- print '';
- $useempty = (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2);
- print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty);
- print ' | ';
- print '
';
- }
-
- // Social network
- if (isModEnabled('socialnetworks')) {
- $object->showSocialNetwork($socialnetworks, ($conf->browser->layout == 'phone' ? 2 : 4));
- }
-
- // Prof ids
- $i = 1;
- $j = 0;
- $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2);
- while ($i <= 6) {
- $idprof = $langs->transcountry('ProfId'.$i, $object->country_code);
- if ($idprof != '-') {
- $key = 'idprof'.$i;
-
- if (($j % $NBCOLS) == 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 % $NBCOLS) == ($NBCOLS - 1)) {
- print '
';
- }
- $j++;
- }
- $i++;
- }
- if ($NBCOLS > 0 && $j % 2 == 1) {
- print ' | ';
- }
-
- // VAT is used
- print ''.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).' | ';
- print 'tva_assuj ? 'checked="checked"' : '') . ' value="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 'localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
- if (!isOnlyOneLocalTax(1)) {
- print ' '.$langs->transcountry("Type", $mysoc->country_code).': ';
- $formcompany->select_localtax(1, $object->localtax1_value, "lt1");
- print '';
- }
- print ' | ';
- print '
';
- print ''.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).' | ';
- print 'localtax2_assuj ? 'checked="checked"' : '') . ' value="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 'localtax1_assuj ? 'checked="checked"' : '') . ' value="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 'localtax2_assuj ? 'checked="checked"' : '') . ' value="1">';
- if (!isOnlyOneLocalTax(2)) {
- print ' '.$langs->transcountry("Type", $mysoc->country_code).': ';
- $formcompany->select_localtax(2, $object->localtax2_value, "lt2");
- print '';
- }
- print ' |
';
- }
-
- // VAT reverse charge by default
- if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
- print '' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . ' | ';
- print 'vat_reverse_charge == '1' ? ' checked' : '').'>';
- print ' |
';
- }
-
- // VAT Code
- print ''.$form->editfieldkey('VATIntra', 'intra_vat', '', $object, 0).' | ';
- print '';
- $s = '';
-
- if (!getDolGlobalString('MAIN_DISABLEVATCHECK') && isInEEC($object)) {
- $s .= ' ';
-
- if ($conf->use_javascript_ajax) {
- $widthpopup = 600;
- if (!empty($conf->dol_use_jmobile)) {
- $widthpopup = 350;
- }
- $heightpopup = 400;
- print "\n";
- print '';
- print "\n";
- $s .= ''.$langs->trans("VATIntraCheck").'';
- $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1);
- } else {
- $s .= 'country_id).'" class="hideonsmartphone" target="_blank" rel="noopener noreferrer">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').'';
- }
- }
- print $s;
- print ' | ';
- print '
';
-
- // Type - Workforce/Staff
- print ''.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).' | browser->layout == 'phone' || getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) ? ' colspan="3"' : '').'>';
- print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1);
- if ($user->admin) {
- print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
- }
- if (!getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) {
- print ' | ';
- if ($conf->browser->layout == 'phone') {
- print '
';
- }
- print ''.$form->editfieldkey('Workforce', 'effectif_id', '', $object, 0).' | ';
- print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id, 0, 0, 0, '', 0, 0, 0, '', '', 1);
- if ($user->admin) {
- print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
- }
- } else {
- print '';
- }
- 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".$object->multicurrency_code).' |
';
- } else {
- print '"> '.$langs->trans("Currency".$conf->currency).'';
- }
-
- // Default language
- if (getDolGlobalInt('MAIN_MULTILANGS')) {
- print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).' | '."\n";
- print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($object->default_lang, 'default_lang', 0, null, '1', 0, 0, 'maxwidth300 widthcentpercentminusx');
- print ' | ';
- print '
';
- }
-
- // Incoterms
- if (isModEnabled('incoterm')) {
- 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 (isModEnabled('categorie') && $user->hasRight('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 img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
- print " |
";
-
- // Supplier
- if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
- 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 img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('suppcats', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
- print " |
";
- }
- }
-
- // Multicurrency
- if (isModEnabled("multicurrency")) {
- print '';
- print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' | ';
- print '';
- print img_picto('', 'currency', 'class="pictofixedwidth"');
- print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1, '', false, 'maxwidth150 widthcentpercentminusx');
- print ' |
';
- }
-
- // Other attributes
- $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
-
- // Parent company
- if (!getDolGlobalString('SOCIETE_DISABLE_PARENTCOMPANY')) {
- print '';
- print ''.$langs->trans('ParentCompany').' | ';
- print '';
- print img_picto('', 'company', 'class="pictofixedwidth"');
- print $form->select_company(GETPOST('parent_company_id') ? GETPOST('parent_company_id') : $object->parent, 'parent_company_id', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
- print ' |
';
- }
-
- // 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
+ // Multicurrency
+ if (!empty($conf->multicurrency->enabled))
+ {
@@ -2529,431 +2191,3 @@
- print ''.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).' | ';
- print '';
- $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1);
- $arrayselected = GETPOST('commercial', 'array');
- if (empty($arrayselected)) {
- $arrayselected = $object->getSalesRepresentatives($user, 1);
- }
- print img_picto('', 'user', 'class="pictofixedwidth"').$form->multiselectarray('commercial', $userlist, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0, '', '', '', 1);
- print ' | ';
-
- print '
';
-
- if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {
- print '