diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index 38d3484ec9f..76300c1596e 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; */ class StockTransfer extends CommonObject { - use CommonIncoterm; + use CommonIncoterm; /** * @var string ID to identify managed object. */ @@ -121,7 +121,7 @@ class StockTransfer extends CommonObject 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ChangedBy', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), - 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-2, 'position'=>220), + 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-2, 'position'=>220), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-2, 'position'=>225), 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '2'=>'StockStransferDecremented', '3'=>'StockStransferIncremented'),), ); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 1c8eccb2c4f..dd56c5ce6df 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -362,9 +362,8 @@ if (empty($reshook)) { setEventMessage('StockStransferIncrementedShortCancel', 'warnings'); } } - // Set incoterm - if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled) && $permissiontoadd) - { + // Set incoterm + if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled) && $permissiontoadd) { $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); } // Actions to send emails @@ -427,12 +426,11 @@ if ($action == 'create') { // Common attributes include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - if (!empty($conf->incoterm->enabled)) - { + if (!empty($conf->incoterm->enabled)) { print ''; print ''; print ''; - print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''),'','fk_incoterms'); + print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''), '', 'fk_incoterms'); print ''; } // Template to use by default @@ -639,9 +637,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $object->fields['fk_project']['visible']=0; // Already available in banner include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - // Incoterms - if (!empty($conf->incoterm->enabled)) - { + // Incoterms + if (!empty($conf->incoterm->enabled)) { print ''; print '
'; print $langs->trans('IncotermLabel'); @@ -651,12 +648,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print ''; print ''; - if ($action != 'editincoterm') - { + if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); - } - else - { + } else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print '';