diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 62f41ce825f..b1aadd56ed8 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -64,6 +64,10 @@ $sqls=array( "DELETE FROM ".MAIN_DB_PREFIX."paiement_facture where fk_facture IN (select rowid FROM ".MAIN_DB_PREFIX."facture where datec < '__DATE__')", "DELETE FROM ".MAIN_DB_PREFIX."paiement where rowid NOT IN (SELECT fk_paiement FROM ".MAIN_DB_PREFIX."paiement_facture)", ), + 'supplier_payment'=>array( + "DELETE FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn where fk_facturefourn IN (select rowid FROM ".MAIN_DB_PREFIX."facture_fourn where datec < '__DATE__')", + "DELETE FROM ".MAIN_DB_PREFIX."paiementfourn where rowid NOT IN (SELECT fk_paiementfourn FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn)", + ), 'bank'=>array( "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid IN (SELECT rowid FROM ".MAIN_DB_PREFIX."bank WHERE datec < '__DATE__')", "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank IN (SELECT rowid FROM ".MAIN_DB_PREFIX."bank WHERE datec < '__DATE__')", @@ -103,6 +107,7 @@ $sqls=array( "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseur where date_creation < '__DATE__'", ), 'supplier_invoice'=>array( + '@supplier_payment', "DELETE FROM ".MAIN_DB_PREFIX."facture_fourn_det WHERE fk_facture_fourn IN (select rowid FROM ".MAIN_DB_PREFIX."facture_fourn where datec < '__DATE__')", "DELETE FROM ".MAIN_DB_PREFIX."facture_fourn where datec < '__DATE__'", ), diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 9a530262b6e..5ee4741709c 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -127,6 +127,18 @@ if (GETPOST('target') == 'local') { if (dol_is_file($xmlfile)) { + // If file is a zip file (.../filelist-x.y.z.xml.zip), we uncompress it before + if (preg_match('/\.zip$/i', $xmlfile)) { + dol_mkdir($conf->admin->dir_temp); + $xmlfilenew = preg_replace('/\.zip$/i', '', $xmlfile); + $result = dol_uncompress($xmlfile, $conf->admin->dir_temp); + if (empty($result['error'])) { + $xmlfile = $conf->admin->dir_temp.'/'.basename($xmlfilenew); + } else { + print $langs->trans('FailedToUncompressFile').': '.$xmlfile; + $error++; + } + } $xml = simplexml_load_file($xmlfile); } else diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index d19e5d6fe92..56602502715 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -297,10 +297,7 @@ foreach ($dirmodels as $reldir) } $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); - $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 270d7dd6653..43910bedb56 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -34,7 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "members", "users")); - if (!$user->admin) accessforbidden(); $extrafields = new ExtraFields($db); @@ -244,10 +243,7 @@ foreach ($dirmodels as $reldir) } $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); - $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index f7a9495c244..118ab6ededf 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1461,6 +1461,7 @@ if ($id > 0) print ''.$langs->trans("Priority").''; print ''; print ''; + // Object linked if (!empty($object->fk_element) && !empty($object->elementtype)) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c249a6a7b5f..b3dab6d5703 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1800,7 +1800,7 @@ class Propal extends CommonObject $this->newref = $num; $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET ref = '".$num."',"; + $sql .= " SET ref = '".$this->db->escape($num)."',"; $sql .= " fk_statut = ".self::STATUS_VALIDATED.", date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id; $sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6b0950b4f8d..887a8fc8ec6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4129,6 +4129,7 @@ class Form } // Now add questions + $moreonecolumn = ''; $more .= '
'."\n"; foreach ($formquestion as $key => $input) { @@ -4202,13 +4203,14 @@ class Form elseif ($input['type'] == 'onecolumn') { - $more .= '
'; - $more .= $input['value']; - $more .= '
'."\n"; + $moreonecolumn .= '
'; + $moreonecolumn .= $input['value']; + $moreonecolumn .= '
'."\n"; } } } $more .= '
'."\n"; + $more .= $moreonecolumn; } // JQUI method dialog is broken with jmobile, we use standard HTML. diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1316bb0db73..f108c5cc04f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1705,13 +1705,13 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin // Date $out .= ''; - $out .= dol_print_date($histo[$key]['datestart'], 'dayhour'); + $out .= dol_print_date($histo[$key]['datestart'], 'dayhour', 'tzuserrel'); if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart']) { $tmpa = dol_getdate($histo[$key]['datestart'], true); $tmpb = dol_getdate($histo[$key]['dateend'], true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out .= '-'.dol_print_date($histo[$key]['dateend'], 'hour'); - else $out .= '-'.dol_print_date($histo[$key]['dateend'], 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out .= '-'.dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel'); + else $out .= '-'.dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel'); } $late = 0; if ($histo[$key]['percent'] == 0 && $histo[$key]['datestart'] && $histo[$key]['datestart'] < ($now - $delay_warning)) $late = 1; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e1603fce57d..2eebf38ad56 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1888,6 +1888,11 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') $module='stock'; $myobject='inventory'; } + elseif ($objecttype == 'mo') { + $classpath = 'mrp/class'; + $module='mrp'; + $myobject='mo'; + } // Generic case for $classfile and $classname $classfile = strtolower($myobject); $classname = ucfirst($myobject); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index b593a4bc0a0..b050b560197 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1072,7 +1072,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr if ($projectstatic->title) { print ' - '; - print $projectstatic->title; + print ''.$projectstatic->title.''; } /* $colspan=5+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2); @@ -1451,7 +1451,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ if ($projectstatic->title) { print ' - '; - print $projectstatic->title; + print ''.$projectstatic->title.''; } /*$colspan=5+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2); diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index aa9f358bb92..c26e2b7e26b 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; class InterfaceActionsBlockedLog extends DolibarrTriggers { public $family = 'system'; - public $description = "Triggers of this module add action for BlockedLog module."; + public $description = "Triggers of this module add action for BlockedLog module (Module of unalterable logs)."; /** * Version of the trigger @@ -45,7 +45,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers public $picto = 'technic'; /** - * Function called on Dolibarrr payment or invoice event. + * Function called on Dolibarr payment or invoice event. * * @param string $action Event action code * @param Object $object Object diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 75343c84f3f..55fe4d34d4c 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -46,7 +46,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $this->name = preg_replace('/^Interface/i', '', get_class($this)); $this->family = "ticket"; - $this->description = "Triggers of the module ticket"; + $this->description = "Triggers of the module ticket to send notifications to internal users and to third-parties"; $this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version $this->picto = 'ticket'; } diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 50014e2da05..24c62c040e4 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -537,7 +537,7 @@ CREATE TABLE llx_mrp_production( position integer NOT NULL DEFAULT 0, fk_product integer NOT NULL, fk_warehouse integer, - qty integer NOT NULL DEFAULT 1, + qty real NOT NULL DEFAULT 1, qty_frozen smallint DEFAULT 0, disable_stock_change smallint DEFAULT 0, batch varchar(30), @@ -550,6 +550,7 @@ CREATE TABLE llx_mrp_production( fk_user_modif integer, import_key varchar(14) ) ENGINE=innodb; +ALTER TABLE llx_mrp_production MODIFY COLUMN qty real NOT NULL DEFAULT 1; ALTER TABLE llx_mrp_production ADD COLUMN qty_frozen smallint DEFAULT 0; ALTER TABLE llx_mrp_production ADD COLUMN disable_stock_change smallint DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_mrp_production.sql b/htdocs/install/mysql/tables/llx_mrp_production.sql index b05e261c65b..78b8847d9de 100644 --- a/htdocs/install/mysql/tables/llx_mrp_production.sql +++ b/htdocs/install/mysql/tables/llx_mrp_production.sql @@ -20,7 +20,7 @@ CREATE TABLE llx_mrp_production( position integer NOT NULL DEFAULT 0, fk_product integer NOT NULL, fk_warehouse integer, - qty integer NOT NULL DEFAULT 1, + qty real NOT NULL DEFAULT 1, qty_frozen smallint DEFAULT 0, disable_stock_change smallint DEFAULT 0, batch varchar(30), diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index db7fa8330bf..dc63f12511a 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -224,6 +224,7 @@ ErrorObjectMustHaveStatusActiveToBeDisabled=Objects must have status 'Active' to ErrorObjectMustHaveStatusDraftOrDisabledToBeActivated=Objects must have status 'Draft' or 'Disabled' to be enabled ErrorNoFieldWithAttributeShowoncombobox=No fields has property 'showoncombobox' into definition of object '%s'. No way to show the combolist. ErrorFieldRequiredForProduct=Field '%s' is required for product %s +ProblemIsInSetupOfTerminal=Problem is in setup of terminal %s. # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index ac411f56f3e..942d7eac20f 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1013,3 +1013,4 @@ ContactDefault_supplier_proposal=Supplier Proposal ContactDefault_ticketsup=Ticket ContactAddedAutomatically=Contact added from contact thirdparty roles More=More +ShowDetails=Show details diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index e336dd2552d..6bec44d66e6 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -60,6 +60,6 @@ TheProductXIsAlreadyTheProductToProduce=The product to add is already the produc ForAQuantityOf1=For a quantity to produce of 1 ConfirmValidateMo=Are you sure you want to validate this Manufacturing Order? ConfirmProductionDesc=By clicking on '%s', you will validate the consumption and/or production for the quantities set. This will also update the stock and record stock movements. -ProductionForRefAndDate=Production %s - %s +ProductionForRef=Production of %s AutoCloseMO=Close automatically the Manufacturing Order if quantities to consume and to produce are reached NoStockChangeOnServices=No stock change on services \ No newline at end of file diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 0f22e00de3c..be784dbf5ad 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -467,6 +467,55 @@ class Mo extends CommonObject } } + /** + * Get list of lines linked to current line for a defined role. + * + * @param string $role Get lines linked to current line with the selected role ('consumed', 'produced', ...) + * @param int $lineid Id of production line to filter childs + * @return array Array of lines + */ + public function fetchLinesLinked($role, $lineid = 0) + { + $resarray = array(); + $mostatic = new MoLine($this->db); + + $sql = 'SELECT '; + $sql .= $mostatic->getFieldList(); + $sql .= ' FROM '.MAIN_DB_PREFIX.$mostatic->table_element.' as t'; + $sql .= " WHERE t.role = '".$this->db->escape($role)."'"; + if ($lineid > 0) $sql .= ' AND t.fk_mrp_production = '.$lineid; + else $sql .= 'AND t.fk_mo = '.$this->id; + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + + $i=0; + while ($i < $num) { + $obj = $this->db->fetch_object($resql); + if ($obj) { + $resarray[] = array( + 'rowid'=> $obj->rowid, + 'qty' => $obj->qty, + 'role' => $obj->role, + 'fk_product' => $obj->fk_product, + 'fk_warehouse' => $obj->fk_warehouse, + 'batch' => $obj->batch, + 'fk_stock_movement' => $obj->fk_stock_movement + ); + } + + $i++; + } + + return $resarray; + } else { + $this->error = $this->db->lasterror(); + var_dump($this->error); + return array(); + } + } + /** * Update object into database * @@ -999,8 +1048,8 @@ class Mo extends CommonObject $statusType = 'status'.$status; if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; if ($status == self::STATUS_INPROGRESS) $statusType = 'status3'; - if ($status == self::STATUS_PRODUCED) $statusType = 'status5'; - if ($status == self::STATUS_CANCELED) $statusType = 'status6'; + if ($status == self::STATUS_PRODUCED) $statusType = 'status6'; + if ($status == self::STATUS_CANCELED) $statusType = 'status5'; return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } @@ -1282,7 +1331,7 @@ class MoLine extends CommonObjectLine 'position' =>array('type'=>'integer', 'label'=>'Position', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), 'fk_product' =>array('type'=>'integer', 'label'=>'Fk product', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), 'fk_warehouse' =>array('type'=>'integer', 'label'=>'Fk warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'qty' =>array('type'=>'integer', 'label'=>'Qty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35), + 'qty' =>array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35), 'qty_frozen' => array('type'=>'smallint', 'label'=>'QuantityFrozen', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>105, 'css'=>'maxwidth50imp', 'help'=>'QuantityConsumedInvariable'), 'disable_stock_change' => array('type'=>'smallint', 'label'=>'DisableStockChange', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>108, 'css'=>'maxwidth50imp', 'help'=>'DisableStockChangeHelp'), 'batch' =>array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>-1, 'position'=>140), @@ -1458,25 +1507,6 @@ class MoLine extends CommonObjectLine } } - /** - * Get list of lines linked to current line for a defined role - * - * @param string $role Get lines linked to current line with the selected role ('consumed', 'produced', ...) - * @return array Array of lines - */ - public function fetchLinesLinked($role) - { - $array = array(); - - $sql = 'SELECT rowid, qty '; - $sql .= $this->getFieldList(); - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; - else $sql .= ' WHERE 1 = 1'; - - return $array; - } - /** * Update object into database * diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index ee2c9840a0d..203408ea79e 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -242,7 +242,7 @@ if ($object->id > 0) $filters['search_agenda_label'] = $search_agenda_label; // TODO Replace this with same code than into list.php - //show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); } } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 840e46c9c1c..037fe3270b1 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -104,6 +104,7 @@ $upload_dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->enti $permissiontoproduce = $permissiontoadd; + /* * Actions */ @@ -152,7 +153,11 @@ if (empty($reshook)) $object->setProject(GETPOST('projectid', 'int')); } - if ($action == 'confirm_consumeandproduceall') { + if ($action == 'confirm_reopen') { + $result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_REOPEN'); + } + + if (in_array($action, array('confirm_consume', 'confirm_produce', 'confirm_consumeandproduceall'))) { $stockmove = new MouvementStock($db); $labelmovement = GETPOST('inventorylabel', 'alphanohtml'); @@ -168,54 +173,59 @@ if (empty($reshook)) $i=1; while (GETPOSTISSET('qty-'.$line->id.'-'.$i)) { - // Check warehouse is set if we should have to - if (GETPOST('idwarehouse-'.$line->id.'-'.$i)) { - if (! (GETPOST('idwarehouse-'.$line->id.'-'.$i) > 0)) { - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors'); - $error++; - } - if ($tmpproduct->status_batch && (! GETPOST('batch-'.$line->id.'-'.$i))) { - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors'); - $error++; - } - } + $qtytoprocess = price2num(GETPOST('qty-'.$line->id.'-'.$i)); - $idstockmove = 0; - if (! $error && GETPOST('idwarehouse-'.$line->id.'-'.$i) > 0) { - // Record stock movement - $id_product_batch = 0; - $idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), GETPOST('qty-'.$line->id.'-'.$i), 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); - if ($idstockmove < 0) { - $error++; - setEventMessages($stockmove->error, $stockmove->errors, 'errors'); - } - } + if ($qtytoprocess != 0) { + // Check warehouse is set if we should have to + if (GETPOSTISSET('idwarehouse-'.$line->id.'-'.$i)) { // If there is a warehouse to set + if (! (GETPOST('idwarehouse-'.$line->id.'-'.$i) > 0)) { // If there is no warehouse set. + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors'); + $error++; + } + if ($tmpproduct->status_batch && (! GETPOST('batch-'.$line->id.'-'.$i))) { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors'); + $error++; + } + } - if (! $error) { - $pos = 0; - // Record consumption - $moline = new MoLine($db); - $moline->fk_mo = $object->id; - $moline->position = $pos; - $moline->fk_product = $line->fk_product; - $moline->fk_warehouse = GETPOST('idwarehouse-'.$line->id.'-'.$i); - $moline->qty = GETPOST('qty-'.$line->id.'-'.$i); - $moline->batch = GETPOST('batch-'.$line->id.'-'.$i); - $moline->role = 'consumed'; - $moline->fk_mrp_production = $line->id; - $moline->fk_stock_movement = $idstockmove; - $moline->fk_user_creat = $user->id; + $idstockmove = 0; + if (! $error && GETPOST('idwarehouse-'.$line->id.'-'.$i) > 0) { + // Record stock movement + $id_product_batch = 0; + $stockmove->origin = $object; + $idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); + if ($idstockmove < 0) { + $error++; + setEventMessages($stockmove->error, $stockmove->errors, 'errors'); + } + } - $resultmoline = $moline->create($user); - if ($resultmoline <= 0) { - $error++; - setEventMessages($moline->error, $moline->errors, 'errors'); - } + if (! $error) { + $pos = 0; + // Record consumption + $moline = new MoLine($db); + $moline->fk_mo = $object->id; + $moline->position = $pos; + $moline->fk_product = $line->fk_product; + $moline->fk_warehouse = GETPOST('idwarehouse-'.$line->id.'-'.$i); + $moline->qty = $qtytoprocess; + $moline->batch = GETPOST('batch-'.$line->id.'-'.$i); + $moline->role = 'consumed'; + $moline->fk_mrp_production = $line->id; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = $user->id; - $pos++; - } + $resultmoline = $moline->create($user); + if ($resultmoline <= 0) { + $error++; + setEventMessages($moline->error, $moline->errors, 'errors'); + } + + $pos++; + } + } $i++; } @@ -230,53 +240,58 @@ if (empty($reshook)) $i=1; while (GETPOSTISSET('qtytoproduce-'.$line->id.'-'.$i)) { - // Check warehouse is set if we should have to - if (GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i)) { - if (! (GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) > 0)) { - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors'); - $error++; - } - if ($tmpproduct->status_batch && (! GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors'); - $error++; - } - } + $qtytoprocess = price2num(GETPOST('qtytoproduce-'.$line->id.'-'.$i)); - $idstockmove = 0; - if (! $error && GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) > 0) { - // Record stock movement - $id_product_batch = 0; - $idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i), GETPOST('qtytoproduce-'.$line->id.'-'.$i), 0, $labelmovement, dol_now(), '', '', GETPOST('batchtoproduce-'.$line->id.'-'.$i), $id_product_batch, $codemovement); - if ($idstockmove < 0) { - $error++; - setEventMessages($stockmove->error, $stockmove->errors, 'errors'); - } - } + if ($qtytoprocess != 0) { + // Check warehouse is set if we should have to + if (GETPOSTISSET('idwarehousetoproduce-'.$line->id.'-'.$i)) { // If there is a warehouse to set + if (! (GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) > 0)) { // If there is no warehouse set. + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors'); + $error++; + } + if ($tmpproduct->status_batch && (! GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors'); + $error++; + } + } - if (! $error) { - $pos = 0; - // Record production - $moline = new MoLine($db); - $moline->fk_mo = $object->id; - $moline->position = $pos; - $moline->fk_product = $line->fk_product; - $moline->fk_warehouse = GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i); - $moline->qty = GETPOST('qtytoproduce-'.$line->id.'-'.$i); - $moline->batch = GETPOST('batchtoproduce-'.$line->id.'-'.$i); - $moline->role = 'produced'; - $moline->fk_mrp_production = $line->id; - $moline->fk_stock_movement = $idstockmove; - $moline->fk_user_creat = $user->id; + $idstockmove = 0; + if (! $error && GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) > 0) { + // Record stock movement + $id_product_batch = 0; + $stockmove->origin = $object; + $idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batchtoproduce-'.$line->id.'-'.$i), $id_product_batch, $codemovement); + if ($idstockmove < 0) { + $error++; + setEventMessages($stockmove->error, $stockmove->errors, 'errors'); + } + } - $resultmoline = $moline->create($user); - if ($resultmoline <= 0) { - $error++; - setEventMessages($moline->error, $moline->errors, 'errors'); - } + if (! $error) { + $pos = 0; + // Record production + $moline = new MoLine($db); + $moline->fk_mo = $object->id; + $moline->position = $pos; + $moline->fk_product = $line->fk_product; + $moline->fk_warehouse = GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i); + $moline->qty = $qtytoprocess; + $moline->batch = GETPOST('batchtoproduce-'.$line->id.'-'.$i); + $moline->role = 'produced'; + $moline->fk_mrp_production = $line->id; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = $user->id; - $pos++; + $resultmoline = $moline->create($user); + if ($resultmoline <= 0) { + $error++; + setEventMessages($moline->error, $moline->errors, 'errors'); + } + + $pos++; + } } $i++; @@ -285,13 +300,47 @@ if (empty($reshook)) } if (! $error) { + $consumptioncomplete = true; + $productioncomplete = true; + + if (GETPOST('autoclose', 'int')) { + foreach($object->lines as $line) { + if ($line->role == 'toconsume') { + $arrayoflines = $object->fetchLinesLinked('consumed', $line->id); + $alreadyconsumed = 0; + foreach($arrayoflines as $line2) { + $alreadyconsumed += $line2['qty']; + } + + if ($alreadyconsumed < $line->qty) { + $consumptioncomplete = false; + } + } + if ($line->role == 'toproduce') { + $arrayoflines = $object->fetchLinesLinked('produced', $line->id); + $alreadyproduced = 0; + foreach($arrayoflines as $line2) { + $alreadyproduced += $line2['qty']; + } + + if ($alreadyproduced < $line->qty) { + $productioncomplete = false; + } + } + } + } + else { + $consumptioncomplete = false; + $productioncomplete = false; + } + // Update status of MO - $qtyremaintoconsume = 0; - $qtyremaintoproduce = 0; - if ($qtyremaintoconsume == 0 && $qtyremaintoproduce == 0) { - $result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_MO_PRODUCED'); - } else { + dol_syslog("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); + //var_dump("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); + if ($consumptioncomplete && $productioncomplete) { $result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); + } else { + $result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_MO_PRODUCED'); } if ($result <= 0) { $error++; @@ -304,6 +353,10 @@ if (empty($reshook)) $db->rollback(); } else { $db->commit(); + + // Redirect to avoid to action done a second time if we make a back from browser + header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; } } } @@ -479,7 +532,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { print ''.$langs->trans('Consume').''; } - } else { + } elseif ($object->status == Mo::STATUS_DRAFT) { print ''.$langs->trans('Consume').''; } @@ -490,7 +543,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { print ''.$langs->trans('Produce').''; } - } else { + } elseif ($object->status == Mo::STATUS_DRAFT) { print ''.$langs->trans('Produce').''; } @@ -501,9 +554,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { print ''.$langs->trans('ConsumeAndProduceAll').''; } - } else { + } elseif ($object->status == Mo::STATUS_DRAFT) { print ''.$langs->trans('ConsumeAndProduceAll').''; } + + // Reopen + if ($object->status == Mo::STATUS_PRODUCED) { + if ($permissiontoproduce) { + print ''.$langs->trans('ReOpen').''; + } else { + print ''.$langs->trans('ReOpen').''; + } + } } print ''; @@ -517,31 +579,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; - if ($action == 'consume') - { - print $langs->trans("FeatureNotYetAvailable"); - } - if ($action == 'produce') - { - print $langs->trans("FeatureNotYetAvailable"); - } - if ($action == 'consumeandproduceall') - { - $defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRefAndDate", $object->ref, dol_print_date(dol_now(), 'standard')); - //$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog'); - $defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref; + $defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref); + //$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog'); + $defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref); - print '
'; - print ''.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'
'; - print $langs->trans("MovementLabel").':   '; - print $langs->trans("InventoryCode").':

'; - print ' '.$langs->trans("AutoCloseMO").'
'; - print ''; - print '   '; - print ''; - print '
'; - print '
'; - } + print '
'; + print ''.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'
'; + print $langs->trans("MovementLabel").':   '; + print $langs->trans("InventoryCode").':

'; + print '
'; + print ''; + print '   '; + print ''; + print '
'; + print '
'; } @@ -569,11 +620,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans("Qty").''; print ''.$langs->trans("QtyAlreadyConsumed").''; print ''; - if ($action == 'consumeandproduceall') print $langs->trans("Warehouse"); + if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) print $langs->trans("Warehouse"); print ''; if ($conf->productbatch->enabled) { print ''; - if ($action == 'consumeandproduceall') print $langs->trans("Batch"); + if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) print $langs->trans("Batch"); print ''; } print ''; @@ -585,10 +636,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $tmpproduct = new Product($db); $tmpproduct->fetch($line->fk_product); - $arrayoflines = $line->fetchLinesLinked('consumed'); + $arrayoflines = $object->fetchLinesLinked('consumed', $line->id); $alreadyconsumed = 0; foreach($arrayoflines as $line2) { - $alreadyconsumed += $line2->qty; + $alreadyconsumed += $line2['qty']; } print ''; @@ -604,21 +655,36 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; print ''.$alreadyconsumed.''; - print ''; - print ''; // Warehouse + print ''; // Warehouse + if ($alreadyconsumed) { + print ''; + if (empty($conf->use_javascript_ajax)) print 'id.'">'; + print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"'); + if (empty($conf->use_javascript_ajax)) print ''; + } + print ''; if ($conf->productbatch->enabled) { print ''; // Lot } print ''; // Show detailed of already consumed with js code to collapse - //$arrayoflines = $line->fetchLinesLinked('consumed'); + //$arrayoflines = $object->fetchLinesLinked('consumed', $line->id); - if ($action == 'consumeandproduceall') { + if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) { $i = 1; print ''; print ''.$langs->trans("ToConsume").''; - print ''; + $preselected = (GETPOSTISSET('qty-'.$line->id.'-'.$i) ? GETPOST('qty-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyconsumed)); + if ($action == 'produce') $preselected = 0; + print ''; print ''; print ''; if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { @@ -681,11 +747,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans("Qty").''; print ''.$langs->trans("QtyAlreadyProduced").''; print ''; - if ($action == 'consumeandproduceall') print $langs->trans("Warehouse"); + if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) print $langs->trans("Warehouse"); print ''; if ($conf->productbatch->enabled) { print ''; - if ($action == 'consumeandproduceall') print $langs->trans("Batch"); + if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) print $langs->trans("Batch"); print ''; } print ''; @@ -697,31 +763,49 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $tmpproduct = new Product($db); $tmpproduct->fetch($line->fk_product); - $arrayoflines = $line->fetchLinesLinked('produced'); + $arrayoflines = $object->fetchLinesLinked('produced', $line->id); $alreadyproduced = 0; foreach($arrayoflines as $line2) { - $alreadyproduced += $line2->qty; + $alreadyproduced += $line2['qty']; } print ''; print ''.$tmpproduct->getNomUrl(1).''; print ''.$line->qty.''; print ''.$alreadyproduced.''; - print ''; // Warehouse + print ''; // Warehouse + if ($alreadyproduced) { + print ''; + if (empty($conf->use_javascript_ajax)) print 'id.'">'; + print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expand'.$line->id.'"'); + if (empty($conf->use_javascript_ajax)) print ''; + } + print ''; if ($conf->productbatch->enabled) { print ''; // Lot } print ''; - if ($action == 'consumeandproduceall') { + if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) { print ''; print ''.$langs->trans("ToProduce").''; - print ''; + $preselected = (GETPOSTISSET('qtytoproduce-'.$line->id.'-'.$i) ? GETPOST('qtytoproduce-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyproduced)); + if ($action == 'consume') $preselected = 0; + print ''; print ''; print ''; if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $preselected = (GETPOSTISSET('idwarehousetoproduce-'.$line->id.'-'.$i) ? GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) : ($object->fk_warehouse > 0 ? $object->fk_warehouse : 'ifone')); print $formproduct->selectWarehouses($preselected, 'idwarehousetoproduce-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1); + } else { + print ''.$langs->trans("NoStockChangeOnServices").''; } print ''; if ($conf->productbatch->enabled) { diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 5f567050422..1eca39463d5 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -942,6 +942,10 @@ class MouvementStock extends CommonObject require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $origin = new Project($this->db); break; + case 'mo': + require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; + $origin = new Mo($this->db); + break; default: if ($origintype) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index cfb0d6d0b9c..1c7862f10f0 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -674,9 +674,9 @@ if ($resql) } $param = ''; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; - if ($id > 0) $param .= '&id='.$id; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($id > 0) $param .= '&id='.urlencode($id); if ($search_movement) $param .= '&search_movement='.urlencode($search_movement); if ($search_inventorycode) $param .= '&search_inventorycode='.urlencode($search_inventorycode); if ($search_type_mouvement) $param .= '&search_type_mouvement='.urlencode($search_type_mouvement); @@ -684,10 +684,8 @@ if ($resql) if ($search_product) $param .= '&search_product='.urlencode($search_product); if ($search_batch) $param .= '&search_batch='.urlencode($search_batch); if ($search_warehouse > 0) $param .= '&search_warehouse='.urlencode($search_warehouse); - if (!empty($sref)) $param .= '&sref='.urlencode($sref); // FIXME $sref is not defined - if (!empty($snom)) $param .= '&snom='.urlencode($snom); // FIXME $snom is not defined if ($search_user) $param .= '&search_user='.urlencode($search_user); - if ($idproduct > 0) $param .= '&idproduct='.$idproduct; + if ($idproduct > 0) $param .= '&idproduct='.urlencode($idproduct); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -752,6 +750,7 @@ if ($resql) } if (!empty($arrayfields['m.datem']['checked'])) { + // Date print ''; print ''; if (empty($conf->productbatch->enabled)) print ' '; @@ -1008,7 +1007,7 @@ if ($resql) if (!empty($arrayfields['m.datem']['checked'])) { // Date - print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; + print ''.dol_print_date($db->jdate($objp->datem), 'dayhour', 'tzuserrel').''; } if (!empty($arrayfields['p.ref']['checked'])) { diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index d4fbd628a4d..4488342ab73 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -693,7 +693,7 @@ if ($conf->use_javascript_ajax) print ''; print ''; print $langs->trans("Total"); - print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; for ($idw = 0; $idw < 7; $idw++) @@ -810,7 +810,7 @@ if (count($tasksarray) > 0) print ' '; print $langs->trans("Total"); - print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; for ($idw = 0; $idw < 7; $idw++) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 7d9fa12223a..cd2d7d66df1 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -688,7 +688,7 @@ if ($resql) { if (empty($paiementsModes)) { $langs->load('errors'); setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors'); - setEventMessages($langs->trans("ProblemIsInSetupOfTerminal").' '.$_SESSION["takeposterminal"], null, 'errors'); + setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); } if (count($maincategories) == 0) { setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors'); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 609aa11abb9..a438dfea8de 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2581,7 +2581,7 @@ else if ($conf->accounting->enabled) { print ""; - print ''.$langs->trans("AccountancyCode").''; + print ''.$langs->trans("AccountancyCode").''; print ''; if ($caneditfield) { @@ -2647,7 +2647,7 @@ else // Company / Contact if (!empty($conf->societe->enabled)) { - print ''.$langs->trans("LinkToCompanyContact").''; + print ''.$langs->trans("LinkToCompanyContact").''; print ''; if ($object->socid > 0) { @@ -2674,7 +2674,7 @@ else if (!empty($conf->adherent->enabled)) { $langs->load("members"); - print ''.$langs->trans("LinkedToDolibarrMember").''; + print ''.$langs->trans("LinkedToDolibarrMember").''; print ''; if ($object->fk_member) {