Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/install/repair.php
This commit is contained in:
commit
ad039ff968
@ -11,7 +11,8 @@ NEW: Can set the Address/Contact by default on third parties.
|
||||
NEW: Add a dictionary for list of Social networks
|
||||
NEW: A nicer dashboard for open elements on Home page.
|
||||
NEW: Add task widget and add task progress bar
|
||||
NEW: Support of deployement of metapackages
|
||||
NEW: Support of deployment of metapackages
|
||||
NEW: Menu "Export accounting document" to generate a zip with all documents requested by a bookkeeper is now stable.
|
||||
NEW: Add button "Save and Stay" in website editor of pages.
|
||||
NEW: Accountancy - Can add specific widget in this accountancy area.
|
||||
NEW: Accountancy - Add export model LDCompta V9 & higher
|
||||
|
||||
@ -509,7 +509,7 @@ if ($id)
|
||||
print '</tr>';
|
||||
|
||||
// Line to enter new values
|
||||
print "<tr ".$bcnd[$var].">";
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
@ -597,44 +597,9 @@ if ($id)
|
||||
|
||||
// Title of lines
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
$showfield=1; // By defaut
|
||||
$class="left";
|
||||
$sortable=1;
|
||||
$valuetoshow='';
|
||||
/*
|
||||
$tmparray=getLabelOfField($fieldlist[$field]);
|
||||
$showfield=$tmp['showfield'];
|
||||
$valuetoshow=$tmp['valuetoshow'];
|
||||
$align=$tmp['align'];
|
||||
$sortable=$tmp['sortable'];
|
||||
*/
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // By defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field]=='code') {
|
||||
$valuetoshow=$langs->trans("Code");
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') {
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
}
|
||||
if ($fieldlist[$field]=='country') {
|
||||
$valuetoshow=$langs->trans("Country");
|
||||
}
|
||||
if ($fieldlist[$field]=='country_id') {
|
||||
$showfield=0;
|
||||
}
|
||||
if ($fieldlist[$field]=='fk_pcg_version') {
|
||||
$valuetoshow=$langs->trans("Pcg_version");
|
||||
}
|
||||
|
||||
// Affiche nom du champ
|
||||
if ($showfield) {
|
||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "", $sortfield, $sortorder, $class.' ');
|
||||
}
|
||||
}
|
||||
print getTitleFieldOfList($langs->trans("Pcg_version"), 0, $_SERVER["PHP_SELF"], "pcg_version", ($page?'page='.$page.'&':''), $param, '', $sortfield, $sortorder, '');
|
||||
print getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], "label", ($page?'page='.$page.'&':''), $param, '', $sortfield, $sortorder, '');
|
||||
print getTitleFieldOfList($langs->trans("Country"), 0, $_SERVER["PHP_SELF"], "country_code", ($page?'page='.$page.'&':''), $param, '', $sortfield, $sortorder, '');
|
||||
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, '', $sortfield, $sortorder, 'center ');
|
||||
print getTitleFieldOfList('');
|
||||
print getTitleFieldOfList('');
|
||||
|
||||
@ -396,11 +396,12 @@ foreach ($configfileparameters as $key => $value)
|
||||
{
|
||||
//print $conf->file->instance_unique_id;
|
||||
global $dolibarr_main_cookie_cryptkey;
|
||||
$valuetoshow = ${$newkey} ? ${$newkey} : $dolibarr_main_cookie_cryptkey;
|
||||
$valuetoshow = ${$newkey} ? ${$newkey} : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey
|
||||
print $valuetoshow;
|
||||
if (empty($valuetoshow)) {
|
||||
print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id');
|
||||
}
|
||||
print ' <span class="opacitymedium">('.$langs->trans("HashForPing").'='.md5('dolibarr'.$valuetoshow).')</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -532,7 +532,7 @@ class BOM extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// Protection
|
||||
if ($this->statut == self::STATUS_VALIDATED)
|
||||
if ($this->status == self::STATUS_VALIDATED)
|
||||
{
|
||||
dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING);
|
||||
return 0;
|
||||
|
||||
@ -136,7 +136,7 @@ if (($action == "searchfiles" || $action == "dl")) {
|
||||
$sql .= " AND t.fk_statut <> ".Don::STATUS_DRAFT;
|
||||
$sql .= " UNION ALL";
|
||||
// Paiements of salaries
|
||||
$sql .= " SELECT t.rowid as id, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, datep as date, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum";
|
||||
$sql .= " SELECT t.rowid as id, t.ref as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, datep as date, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
|
||||
$sql .= " WHERE datep between ".$wheretail;
|
||||
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
|
||||
@ -450,7 +450,7 @@ if (!empty($date_start) && !empty($date_stop))
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'nowrap ');
|
||||
print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "item", "", $param, '', $sortfield, $sortorder, 'nowrap ');
|
||||
print_liste_field_titre($arrayfields['date']['label'], $_SERVER["PHP_SELF"], "date", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
print '<td>'.$langs->trans("Document").'</td>';
|
||||
@ -465,7 +465,7 @@ if (!empty($date_start) && !empty($date_stop))
|
||||
print '</tr>';
|
||||
if ($result)
|
||||
{
|
||||
$TData = dol_sort_array($filesarray, 'date', 'ASC');
|
||||
$TData = dol_sort_array($filesarray, $sortfield, $sortorder);
|
||||
|
||||
if (empty($TData))
|
||||
{
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -64,20 +64,40 @@ class Contact extends CommonObject
|
||||
/**
|
||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'lastname' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
|
||||
'firstname' =>array('type'=>'varchar(128)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>11, 'searchall'=>1),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>60),
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>61),
|
||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
|
||||
public $fields=array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>15),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
|
||||
'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30, 'index'=>1),
|
||||
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35),
|
||||
'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
|
||||
'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
|
||||
'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
|
||||
'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
|
||||
'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
|
||||
'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
|
||||
'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
|
||||
'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
|
||||
'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
|
||||
'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
|
||||
'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
||||
'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'Phone perso', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
|
||||
'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'Phone mobile', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
|
||||
'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
|
||||
'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
||||
'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||
'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||
'priv' =>array('type'=>'smallint(6)', 'label'=>'Priv', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>175),
|
||||
'no_email' =>array('type'=>'smallint(6)', 'label'=>'No email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>195),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>200),
|
||||
'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=>205),
|
||||
'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>-1, 'position'=>210),
|
||||
'statut' =>array('type'=>'tinyint(4)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000),
|
||||
);
|
||||
|
||||
public $civility_id; // In fact we store civility_code
|
||||
@ -193,8 +213,38 @@ class Contact extends CommonObject
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
|
||||
if (empty($conf->mailing->enabled)) $this->fields['no_email']['enabled'] = 0;
|
||||
if (!empty($conf->global->SOCIETE_DISABLE_CONTACTS)) $this->fields['thirdparty']['enabled'] = 0;
|
||||
$this->statut = 1; // By default, status is enabled
|
||||
|
||||
// Unset fields that are disabled
|
||||
foreach ($this->fields as $key => $val)
|
||||
{
|
||||
if (isset($val['enabled']) && empty($val['enabled']))
|
||||
{
|
||||
unset($this->fields[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Translate some data of arrayofkeyval
|
||||
/*if (is_object($langs))
|
||||
{
|
||||
foreach($this->fields as $key => $val)
|
||||
{
|
||||
if (is_array($val['arrayofkeyval']))
|
||||
{
|
||||
foreach($val['arrayofkeyval'] as $key2 => $val2)
|
||||
{
|
||||
$this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@ -160,20 +160,20 @@ $fieldstosearchall = array(
|
||||
|
||||
// Definition of fields for list
|
||||
$arrayfields = array(
|
||||
'p.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)),
|
||||
'p.lastname'=>array('label'=>"Lastname", 'checked'=>1),
|
||||
'p.firstname'=>array('label'=>"Firstname", 'checked'=>1),
|
||||
'p.poste'=>array('label'=>"PostOrFunction", 'checked'=>1),
|
||||
'p.town'=>array('label'=>"Town", 'checked'=>0),
|
||||
'p.zip'=>array('label'=>"Zip", 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||
'p.phone'=>array('label'=>"Phone", 'checked'=>1),
|
||||
'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0),
|
||||
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
|
||||
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
|
||||
'p.email'=>array('label'=>"EMail", 'checked'=>1),
|
||||
'p.no_email'=>array('label'=>"No_Email", 'checked'=>0, 'enabled'=>(!empty($conf->mailing->enabled))),
|
||||
'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
|
||||
'p.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)),
|
||||
'p.lastname'=>array('label'=>"Lastname", 'position'=>2, 'checked'=>1),
|
||||
'p.firstname'=>array('label'=>"Firstname", 'position'=>3, 'checked'=>1),
|
||||
'p.poste'=>array('label'=>"PostOrFunction", 'position'=>10, 'checked'=>1),
|
||||
'p.town'=>array('label'=>"Town", 'position'=>20, 'checked'=>0),
|
||||
'p.zip'=>array('label'=>"Zip", 'position'=>21, 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'position'=>22, 'checked'=>0),
|
||||
'p.phone'=>array('label'=>"Phone", 'position'=>30, 'checked'=>1),
|
||||
'p.phone_perso'=>array('label'=>"PhonePerso", 'position'=>31, 'checked'=>0),
|
||||
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'position'=>32, 'checked'=>1),
|
||||
'p.fax'=>array('label'=>"Fax", 'position'=>33, 'checked'=>0),
|
||||
'p.email'=>array('label'=>"EMail", 'position'=>40, 'checked'=>1),
|
||||
'p.no_email'=>array('label'=>"No_Email", 'position'=>41, 'checked'=>0, 'enabled'=>(!empty($conf->mailing->enabled))),
|
||||
'p.thirdparty'=>array('label'=>"ThirdParty", 'position'=>50, 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
|
||||
'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200),
|
||||
'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500),
|
||||
'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||
@ -186,6 +186,7 @@ if (!empty($conf->socialnetworks->enabled)) {
|
||||
$arrayfields['p.'.$key] = array(
|
||||
'label' => $value['label'],
|
||||
'checked' => 0,
|
||||
'position' => 300
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7960,7 +7960,7 @@ abstract class CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Set draft status
|
||||
* Set to a status
|
||||
*
|
||||
* @param User $user Object user that modify
|
||||
* @param int $status New status to set (often a constant like self::STATUS_XXX)
|
||||
|
||||
@ -378,9 +378,9 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
$keyforforeignMAIN_MAX_DECIMALS_TOT = 'MAIN_MAX_DECIMALS_TOT_'.$multicurrency_code;
|
||||
$keyforforeignMAIN_ROUNDING_RULE_TOT = 'MAIN_ROUNDING_RULE_TOT_'.$multicurrency_code;
|
||||
if (!empty($conf->global->$keyforforeignMAIN_ROUNDING_RULE_TOT)) {
|
||||
$conf->global->MAIN_MAX_DECIMALS_UNIT = $keyforforeignMAIN_MAX_DECIMALS_UNIT;
|
||||
$conf->global->MAIN_MAX_DECIMALS_TOT = $keyforforeignMAIN_MAX_DECIMALS_TOT;
|
||||
$conf->global->MAIN_ROUNDING_RULE_TOT = $keyforforeignMAIN_ROUNDING_RULE_TOT;
|
||||
$conf->global->MAIN_MAX_DECIMALS_UNIT = $conf->global->$keyforforeignMAIN_MAX_DECIMALS_UNIT;
|
||||
$conf->global->MAIN_MAX_DECIMALS_TOT = $conf->global->$keyforforeignMAIN_MAX_DECIMALS_TOT;
|
||||
$conf->global->MAIN_ROUNDING_RULE_TOT = $conf->global->$keyforforeignMAIN_ROUNDING_RULE_TOT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1318,7 +1318,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
}
|
||||
|
||||
// Files
|
||||
if ((!empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 1) || !empty($conf->global->ACCOUNTANCY_SHOW_EXPORT_FILES_MENU))
|
||||
if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU))
|
||||
{
|
||||
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire);
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ class ExpenseReport extends CommonObject
|
||||
'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>220),
|
||||
'date_create' =>array('type'=>'datetime', 'label'=>'Date create', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>300),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>305),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportKey', 'enabled'=>1, 'visible'=>-1, 'position'=>1000),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>1000),
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010),
|
||||
'fk_statut' =>array('type'=>'integer', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
);
|
||||
|
||||
@ -99,17 +99,19 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES))
|
||||
$checked='';
|
||||
//var_dump(GETPOST($file['relativename'])); var_dump($file['relativename']); var_dump($_FILES['userfile']['name']);
|
||||
// If a file was just uploaded, we check to preselect it
|
||||
foreach($_FILES['userfile']['name'] as $tmpfile)
|
||||
{
|
||||
if ($file['relativename'] == (GETPOST('savingdocmask', 'alpha') ? dol_sanitizeFileName($object->ref.'-') : '').$tmpfile)
|
||||
{
|
||||
$checked=' checked';
|
||||
break;
|
||||
}
|
||||
elseif ($file['relativename'] && in_array($file['relativename'], GETPOST('attachfile', 'array'))) {
|
||||
$checked=' checked';
|
||||
break;
|
||||
}
|
||||
if (is_array($_FILES['userfile']['name'])) {
|
||||
foreach($_FILES['userfile']['name'] as $tmpfile)
|
||||
{
|
||||
if ($file['relativename'] == (GETPOST('savingdocmask', 'alpha') ? dol_sanitizeFileName($object->ref.'-') : '').$tmpfile)
|
||||
{
|
||||
$checked=' checked';
|
||||
break;
|
||||
}
|
||||
elseif ($file['relativename'] && in_array($file['relativename'], GETPOST('attachfile', 'array'))) {
|
||||
$checked=' checked';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If we edit a line already linked, then $filenamelinked is defined to the filename (without path) of linked file
|
||||
if (! empty($filenamelinked) && $filenamelinked == $file['relativename'])
|
||||
|
||||
@ -670,10 +670,9 @@ class CommandeFournisseur extends CommonOrder
|
||||
2 => 'status3',
|
||||
3 => 'status3',
|
||||
4 => 'status3',
|
||||
5 => 'status6',
|
||||
5 => 'status4',
|
||||
6 => 'status5',
|
||||
7 => 'status5',
|
||||
|
||||
9 => 'status5',
|
||||
);
|
||||
|
||||
|
||||
@ -77,6 +77,10 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
|
||||
-- Description of chart of account MA PCG
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 12, 'PCG', 'The Moroccan chart of accounts', 1);
|
||||
|
||||
-- Description of chart of account SE BAS-K1-MINI
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 20, 'BAS-K1-MINI', 'The Swedish mini chart of accounts', 1);
|
||||
|
||||
|
||||
--DELETE FROM llx_accounting_system WHERE pcg_version = 'SYSCOHADA';
|
||||
|
||||
-- Description of chart of account BJ SYSCOHADA
|
||||
|
||||
60
htdocs/install/mysql/data/llx_accounting_account_se.sql
Normal file
60
htdocs/install/mysql/data/llx_accounting_account_se.sql
Normal file
@ -0,0 +1,60 @@
|
||||
-- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
-- Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
|
||||
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
-- Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
-- Copyright (C) 2019 swedebugia <swedebugia@riseup.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
|
||||
--
|
||||
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
|
||||
-- de l'install et tous les sigles '--' sont supprimés.
|
||||
--
|
||||
|
||||
-- Description of the accounts in BAS-K1-MINI
|
||||
-- ADD 2000000 to rowid # Do no remove this comment --
|
||||
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1, 'BAS-K1-MINI', 'IMMO', '', '1000', '0', 'Immateriella anläggningstillgångar', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 2, 'BAS-K1-MINI', 'IMMO', '', '1110', '0', 'Byggnader och markanläggningar', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 3, 'BAS-K1-MINI', 'IMMO', '', '1130', '0', 'Mark och andra tillgångar som inte får skrivas av', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 4, 'BAS-K1-MINI', 'IMMO', '', '1220', '0', 'Maskiner och inventarier', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 5, 'BAS-K1-MINI', 'IMMO', '', '1300', '0', 'Övriga anläggningstillgångar', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 6, 'BAS-K1-MINI', 'CAPIT', '', '1400', '0', 'Varulager', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 7, 'BAS-K1-MINI', 'CAPIT', '', '1500', '0', 'Kundfordringar', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8, 'BAS-K1-MINI', 'CAPIT', '', '1600', '0', 'Övriga fordringar', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9, 'BAS-K1-MINI', 'CAPIT', '', '1920', '0', 'Kassa och bank', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 10, 'BAS-K1-MINI', 'FINAN', '', '2010', '0', 'Eget kapital', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 11, 'BAS-K1-MINI', 'FINAN', '', '2330', '0', 'Låneskulder', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 12, 'BAS-K1-MINI', 'FINAN', '', '2610', '0', 'Skatteskulder', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 13, 'BAS-K1-MINI', 'FINAN', '', '2440', '0', 'Leverantörsskulder', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 14, 'BAS-K1-MINI', 'FINAN', '', '2900', '0', 'Övriga skulder', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 15, 'BAS-K1-MINI', 'INCOME', '', '3000', '0', 'Försäljning och utfört arbete samt övriga momspliktiga intäkter', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 16, 'BAS-K1-MINI', 'INCOME', '', '3100', '0', 'Momsfria intäkter', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 17, 'BAS-K1-MINI', 'INCOME', '', '3200', '0', 'Bil- och bostadsförmån m.m.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 18, 'BAS-K1-MINI', 'INCOME', '', '8310', '0', 'Ränteintäkter', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 19, 'BAS-K1-MINI', 'EXPENSE', '', '4000', '0', 'Varor, material och tjänster', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 20, 'BAS-K1-MINI', 'EXPENSE', '', '6900', '0', 'Övriga externa kostnader', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 21, 'BAS-K1-MINI', 'EXPENSE', '', '7000', '0', 'Anställd personal', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 22, 'BAS-K1-MINI', 'EXPENSE', '', '8410', '0', 'Räntekostnader m.m.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 23, 'BAS-K1-MINI', 'OTHER', '', '7820', '0', 'Avskrivningar och nedskrivningar av byggnader och markanläggningar', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 24, 'BAS-K1-MINI', 'OTHER', '', '7810', '0', 'Avskrivningar och nedskrivningar av maskiner och inventarier och immateriella tillgångar', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 25, 'BAS-K1-MINI', 'OTHER', '', '2080', '0', 'Periodiseringsfonder', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 26, 'BAS-K1-MINI', 'OTHER', '', '2050', '0', 'Expansionsfond', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 27, 'BAS-K1-MINI', 'OTHER', '', '2060', '0', 'Ersättningsfonder', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 28, 'BAS-K1-MINI', 'OTHER', '', '2070', '0', 'Insatsemissioner, skogskonto, upphovsmannakonto, avbetalningsplan på skog o.d.', 1);
|
||||
@ -59,6 +59,8 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD COLUMN position integer
|
||||
|
||||
-- For v11
|
||||
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 20, 'BAS-K1-MINI', 'The Swedish mini chart of accounts', 1);
|
||||
|
||||
ALTER TABLE llx_c_action_trigger MODIFY COLUMN elementtype varchar(64) NOT NULL;
|
||||
|
||||
ALTER TABLE llx_societe_account ADD COLUMN site_account varchar(128);
|
||||
@ -464,9 +466,11 @@ CREATE TABLE llx_mrp_mo(
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
date_valid datetime NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_user_valid integer,
|
||||
model_pdf varchar(255),
|
||||
import_key varchar(14),
|
||||
status integer NOT NULL,
|
||||
@ -478,6 +482,9 @@ CREATE TABLE llx_mrp_mo(
|
||||
-- END MODULEBUILDER FIELDS
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_mrp_mo ADD COLUMN date_valid datetime NULL;
|
||||
ALTER TABLE llx_mrp_mo ADD COLUMN fk_user_valid integer;
|
||||
|
||||
ALTER TABLE llx_bom_bom ADD COLUMN model_pdf varchar(255);
|
||||
ALTER TABLE llx_mrp_mo ADD COLUMN model_pdf varchar(255);
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
-- Copyright (C) ---Put here your own copyright and developer email---
|
||||
-- Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
@ -26,9 +26,11 @@ CREATE TABLE llx_mrp_mo(
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
date_valid datetime NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_user_modif integer,
|
||||
fk_user_valid integer,
|
||||
import_key varchar(14),
|
||||
model_pdf varchar(255),
|
||||
status integer NOT NULL,
|
||||
|
||||
@ -357,6 +357,7 @@ if ($ok && GETPOST('standard', 'alpha'))
|
||||
$sql.=" WHERE name LIKE 'MAIN_MODULE_%_TPL' OR name LIKE 'MAIN_MODULE_%_CSS' OR name LIKE 'MAIN_MODULE_%_JS' OR name LIKE 'MAIN_MODULE_%_HOOKS'";
|
||||
$sql.=" OR name LIKE 'MAIN_MODULE_%_TRIGGERS' OR name LIKE 'MAIN_MODULE_%_THEME' OR name LIKE 'MAIN_MODULE_%_SUBSTITUTIONS' OR name LIKE 'MAIN_MODULE_%_MODELS'";
|
||||
$sql.=" OR name LIKE 'MAIN_MODULE_%_MENUS' OR name LIKE 'MAIN_MODULE_%_LOGIN' OR name LIKE 'MAIN_MODULE_%_BARCODE' OR name LIKE 'MAIN_MODULE_%_TABS_%'";
|
||||
$sql.=" OR name LIKE 'MAIN_MODULE_%_MODULEFOREXTERNAL'";
|
||||
$sql.=" ORDER BY name, entity";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@ -374,7 +375,7 @@ if ($ok && GETPOST('standard', 'alpha'))
|
||||
$obj=$db->fetch_object($resql);
|
||||
|
||||
$reg = array();
|
||||
if (preg_match('/MAIN_MODULE_(.*)_(.*)/i', $obj->name, $reg))
|
||||
if (preg_match('/MAIN_MODULE_([^_]+)_(.+)/i', $obj->name, $reg))
|
||||
{
|
||||
$name=$reg[1];
|
||||
$type=$reg[2];
|
||||
@ -396,11 +397,11 @@ if ($ok && GETPOST('standard', 'alpha'))
|
||||
{
|
||||
$db->query($sqldelete);
|
||||
|
||||
print '<tr><td>Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module not enabled in entity '.$obj->entity.', we delete record</td></tr>';
|
||||
print '<tr><td>Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module '.$name.' not enabled in entity '.$obj->entity.', we delete record</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td>Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module not enabled in entity '.$obj->entity.', we should delete record (not done, mode test)</td></tr>';
|
||||
print '<tr><td>Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module '.$name.' not enabled in entity '.$obj->entity.', we should delete record (not done, mode test)</td></tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -415,6 +416,8 @@ if ($ok && GETPOST('standard', 'alpha'))
|
||||
|
||||
$db->commit();
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -171,6 +171,7 @@ NotValidated=Not validated
|
||||
Save=Save
|
||||
SaveAs=Save As
|
||||
SaveAndStay=Save and stay
|
||||
SaveAndNew=Save and new
|
||||
TestConnection=Test connection
|
||||
ToClone=Clone
|
||||
ConfirmClone=Choose data you want to clone:
|
||||
|
||||
@ -50,7 +50,12 @@ BomAndBomLines=Bills Of Material and lines
|
||||
BOMLine=Line of BOM
|
||||
WarehouseForProduction=Warehouse for production
|
||||
CreateMO=Create MO
|
||||
ToConsume=A consommer
|
||||
Manufactured=Fabriqué
|
||||
ToConsume=To consume
|
||||
ToProduce=To produce
|
||||
QtyAlreadyConsumed=Qty already consumed
|
||||
QtyAlreadyProduced=Qty already produced
|
||||
ConsumeAndProduceAll=Consume and Produce All
|
||||
Manufactured=Manufactured
|
||||
TheProductXIsAlreadyTheProductToProduce=The product to add is already the product to produce.
|
||||
ForAQuantityOf1=For a quantity to produce of 1
|
||||
ForAQuantityOf1=For a quantity to produce of 1
|
||||
ConfirmValidateMo=Are you sure you want to validate this Manufacturing Order?
|
||||
@ -2555,17 +2555,17 @@ if (!function_exists("llxFooter"))
|
||||
if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || GETPOST('forceping', 'alpha'))
|
||||
{
|
||||
//print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->';
|
||||
$hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id);
|
||||
if (empty($conf->global->MAIN_FIRST_PING_OK_DATE)
|
||||
|| (!empty($conf->file->instance_unique_id) && (md5($conf->file->instance_unique_id) != $conf->global->MAIN_FIRST_PING_OK_ID) && ($conf->global->MAIN_FIRST_PING_OK_ID != 'disabled'))
|
||||
|| (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && ($conf->global->MAIN_FIRST_PING_OK_ID != 'disabled'))
|
||||
|| GETPOST('forceping', 'alpha'))
|
||||
{
|
||||
if (empty($_COOKIE['DOLINSTALLNOPING_'.md5($conf->file->instance_unique_id)]))
|
||||
if (empty($_COOKIE['DOLINSTALLNOPING_'.$hash_unique_id]))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
print "\n".'<!-- Includes JS for Ping of Dolibarr MAIN_FIRST_PING_OK_DATE = '.$conf->global->MAIN_FIRST_PING_OK_DATE.' MAIN_FIRST_PING_OK_ID = '.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'."\n";
|
||||
print "\n<!-- JS CODE TO ENABLE the anonymous Ontime Ping -->\n";
|
||||
$hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id);
|
||||
$url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING);
|
||||
?>
|
||||
<script>
|
||||
|
||||
@ -718,14 +718,28 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
||||
if ($type == 'int(11)') $type='integer';
|
||||
// notnull
|
||||
$notnull = ($obj->Null == 'YES'?0:1);
|
||||
if ($fieldname == 'fk_user_modif') $notnull = -1;
|
||||
// label
|
||||
$label = preg_replace('/_/', ' ', ucfirst($fieldname));
|
||||
if ($fieldname == 'rowid') $label='ID';
|
||||
if ($fieldname == 'import_key') $label='ImportKey';
|
||||
if ($fieldname == 'rowid') $label='TechnicalID';
|
||||
if ($fieldname == 'import_key') $label='ImportId';
|
||||
if ($fieldname == 'fk_soc') $label='ThirdParty';
|
||||
if ($fieldname == 'tms') $label='DateModification';
|
||||
if ($fieldname == 'datec') $label='DateCreation';
|
||||
if ($fieldname == 'date_valid') $label='DateValidation';
|
||||
if ($fieldname == 'datev') $label='DateValidation';
|
||||
if ($fieldname == 'note_private') $label='NotePublic';
|
||||
if ($fieldname == 'note_public') $label='NotePrivate';
|
||||
if ($fieldname == 'fk_user_creat') $label='UserAuthor';
|
||||
if ($fieldname == 'fk_user_modif') $label='UserModif';
|
||||
if ($fieldname == 'fk_user_valid') $label='UserValidation';
|
||||
// visible
|
||||
$visible = -1;
|
||||
if ($fieldname == 'entity') $visible = -2;
|
||||
if (in_array($fieldname, array('model_pdf', 'note_public', 'note_private'))) $visible = 0;
|
||||
if ($fieldname == 'import_key') $visible = -2;
|
||||
if ($fieldname == 'fk_user_creat') $visible = -2;
|
||||
if ($fieldname == 'fk_user_modif') $visible = -2;
|
||||
if (in_array($fieldname, array('ref_ext', 'model_pdf', 'note_public', 'note_private'))) $visible = 0;
|
||||
// enabled
|
||||
$enabled = 1;
|
||||
// default
|
||||
@ -734,6 +748,9 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
||||
// position
|
||||
$position = $i;
|
||||
if (in_array($fieldname, array('status', 'statut', 'fk_status', 'fk_statut'))) $position = 500;
|
||||
// index
|
||||
$index = 0;
|
||||
if ($fieldname == 'entity') $index=1;
|
||||
|
||||
$string.= "'".$obj->Field."' =>array('type'=>'".$type."', 'label'=>'".$label."',";
|
||||
if ($default != '') $string.= " 'default'=>".$default.",";
|
||||
@ -741,7 +758,9 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
||||
$string.= " 'visible'=>".$visible;
|
||||
if ($notnull) $string.= ", 'notnull'=>".$notnull;
|
||||
if ($fieldname == 'ref') $string.= ", 'showoncombobox'=>1";
|
||||
$string.= ", 'position'=>".$position."),\n";
|
||||
$string.= ", 'position'=>".$position;
|
||||
if ($index) $string.= ", 'index'=>".$index;
|
||||
$string.= "),\n";
|
||||
$string.="<br>";
|
||||
$i+=5;
|
||||
}
|
||||
|
||||
@ -514,7 +514,7 @@ class MyObject extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// Protection
|
||||
if ($this->statut == self::STATUS_VALIDATED)
|
||||
if ($this->status == self::STATUS_VALIDATED)
|
||||
{
|
||||
dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING);
|
||||
return 0;
|
||||
@ -803,7 +803,8 @@ class MyObject extends CommonObject
|
||||
}
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
if ($status == self::STATUS_VALIDATED) $statusType = 'status4';
|
||||
//if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
|
||||
if ($status == self::STATUS_CANCELED) $statusType = 'status6';
|
||||
|
||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||
}
|
||||
|
||||
@ -499,13 +499,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
/*
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
if ($object->status == 1)
|
||||
if ($object->status == $object::STATUS_ENABLED)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable">'.$langs->trans("Disable").'</a>'."\n";
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable">'.$langs->trans("Disable").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
if ($object->status == $object::STATUS_VALIDATED)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("Cancel").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Re-Open").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@ -92,11 +92,11 @@ class Mo extends CommonObject
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1,),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>'1',),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>'1', 'noteditable'=>1),
|
||||
'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM",),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce",),
|
||||
'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce",),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce"),
|
||||
'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75'),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1),
|
||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'enabled'=>1, 'visible'=>-1, 'position'=>52),
|
||||
@ -235,57 +235,28 @@ class Mo extends CommonObject
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
* @return int <=0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error = 0;
|
||||
$idcreated = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$result = $this->createCommon($user, $notrigger);
|
||||
if ($result <= 0) {
|
||||
$error++;
|
||||
if (!$error) {
|
||||
$idcreated = $this->createCommon($user, $notrigger);
|
||||
if ($idcreated <= 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Insert lines in mrp_production table
|
||||
if (!$error && $this->fk_bom > 0)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
$bom = new Bom($this->db);
|
||||
$bom->fetch($this->fk_bom);
|
||||
if ($bom->id > 0)
|
||||
{
|
||||
foreach ($bom->lines as $line)
|
||||
{
|
||||
$moline = new MoLine($this->db);
|
||||
|
||||
$moline->fk_mo = $this->id;
|
||||
$moline->qty = $line->qty * $this->qty * $bom->efficiency;
|
||||
if ($moline->qty <= 0) {
|
||||
$error++;
|
||||
$this->error = "BadValueForquantityToConsume";
|
||||
break;
|
||||
}
|
||||
else {
|
||||
$moline->fk_product = $line->fk_product;
|
||||
$moline->role = 'toconsume';
|
||||
$moline->position = $line->position;
|
||||
$moline->qty_frozen = $line->qty_frozen;
|
||||
$moline->disable_stock_change = $line->disable_stock_change;
|
||||
|
||||
$resultline = $moline->create($user);
|
||||
if ($resultline <= 0) {
|
||||
$error++;
|
||||
$this->error = $moline->error;
|
||||
$this->errors = $moline->errors;
|
||||
dol_print_error($this->db, $moline->error, $moline->errors);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$error) {
|
||||
$result = $this->updateProduction($user, $notrigger);
|
||||
if ($result <= 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -295,7 +266,7 @@ class Mo extends CommonObject
|
||||
$this->db->rollback();
|
||||
}
|
||||
|
||||
return $result;
|
||||
return $idcreated;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -505,9 +476,124 @@ class Mo extends CommonObject
|
||||
*/
|
||||
public function update(User $user, $notrigger = false)
|
||||
{
|
||||
return $this->updateCommon($user, $notrigger);
|
||||
global $langs;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$result = $this->updateCommon($user, $notrigger);
|
||||
if ($result <= 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$result = $this->updateProduction($user, $notrigger);
|
||||
if ($result <= 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
setEventMessages($this->error, $this->errors, 'errors');
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Erase and update the line to produce
|
||||
*
|
||||
* @param User $user User that modifies
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function updateProduction(User $user)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
if ($this->status != self::STATUS_DRAFT) {
|
||||
$this->error = 'BadStatus';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Insert lines in mrp_production table from BOM data
|
||||
if (!$error && $this->fk_bom > 0)
|
||||
{
|
||||
// TODO Check that production has not started. If yes, we stop here.
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'mrp_production WHERE fk_mo = '.$this->id;
|
||||
$this->db->query($sql);
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
$bom = new Bom($this->db);
|
||||
$bom->fetch($this->fk_bom);
|
||||
if ($bom->id > 0)
|
||||
{
|
||||
$moline = new MoLine($this->db);
|
||||
|
||||
// Line to produce
|
||||
$moline->fk_mo = $this->id;
|
||||
$moline->qty = $this->qty;
|
||||
$moline->fk_product = $this->fk_product;
|
||||
$moline->role = 'toproduce';
|
||||
$moline->position = 1;
|
||||
|
||||
$resultline = $moline->create($user);
|
||||
if ($resultline <= 0) {
|
||||
$error++;
|
||||
$this->error = $moline->error;
|
||||
$this->errors = $moline->errors;
|
||||
dol_print_error($this->db, $moline->error, $moline->errors);
|
||||
}
|
||||
|
||||
// Lines to consume
|
||||
if (! $error) {
|
||||
foreach ($bom->lines as $line)
|
||||
{
|
||||
$moline = new MoLine($this->db);
|
||||
|
||||
$moline->fk_mo = $this->id;
|
||||
$moline->qty = round($line->qty * $this->qty / $bom->efficiency, 2);
|
||||
if ($moline->qty <= 0) {
|
||||
$error++;
|
||||
$this->error = "BadValueForquantityToConsume";
|
||||
break;
|
||||
}
|
||||
else {
|
||||
$moline->fk_product = $line->fk_product;
|
||||
$moline->role = 'toconsume';
|
||||
$moline->position = $line->position;
|
||||
$moline->qty_frozen = $line->qty_frozen;
|
||||
$moline->disable_stock_change = $line->disable_stock_change;
|
||||
|
||||
$resultline = $moline->create($user);
|
||||
if ($resultline <= 0) {
|
||||
$error++;
|
||||
$this->error = $moline->error;
|
||||
$this->errors = $moline->errors;
|
||||
dol_print_error($this->db, $moline->error, $moline->errors);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
@ -540,6 +626,268 @@ class Mo extends CommonObject
|
||||
return $this->deleteLineCommon($user, $idline, $notrigger);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the reference to the following non used MO depending on the active numbering module
|
||||
* defined into MRP_MO_ADDON
|
||||
*
|
||||
* @param Product $prod Object product
|
||||
* @return string MO free reference
|
||||
*/
|
||||
public function getNextNumRef($prod)
|
||||
{
|
||||
global $langs, $conf;
|
||||
$langs->load("mrp");
|
||||
|
||||
if (!empty($conf->global->MRP_MO_ADDON))
|
||||
{
|
||||
$mybool = false;
|
||||
|
||||
$file = $conf->global->MRP_MO_ADDON.".php";
|
||||
$classname = $conf->global->MRP_MO_ADDON;
|
||||
|
||||
// Include file with class
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = dol_buildpath($reldir."core/modules/mrp/");
|
||||
|
||||
// Load file with numbering class (if found)
|
||||
$mybool |= @include_once $dir.$file;
|
||||
}
|
||||
|
||||
if ($mybool === false)
|
||||
{
|
||||
dol_print_error('', "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
$obj = new $classname();
|
||||
$numref = $obj->getNextValue($prod, $this);
|
||||
|
||||
if ($numref != "")
|
||||
{
|
||||
return $numref;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error = $obj->error;
|
||||
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("Error")." ".$langs->trans("Error_MRP_MO_ADDON_NotDefined");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Mo
|
||||
*
|
||||
* @param User $user User making status change
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <=0 if OK, 0=Nothing done, >0 if KO
|
||||
*/
|
||||
public function validate($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Protection
|
||||
if ($this->status == self::STATUS_VALIDATED)
|
||||
{
|
||||
dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mrp->create))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mrp->mrp_advance->validate))))
|
||||
{
|
||||
$this->error='NotEnoughPermissions';
|
||||
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Define new ref
|
||||
if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
|
||||
{
|
||||
$this->fetch_product();
|
||||
$num = $this->getNextNumRef($this->product);
|
||||
}
|
||||
else
|
||||
{
|
||||
$num = $this->ref;
|
||||
}
|
||||
$this->newref = $num;
|
||||
|
||||
// Validate
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " SET ref = '".$this->db->escape($num)."',";
|
||||
$sql .= " status = ".self::STATUS_VALIDATED.",";
|
||||
$sql .= " date_valid='".$this->db->idate($now)."',";
|
||||
$sql .= " fk_user_valid = ".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql)
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('MRP_MO_VALIDATE', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$this->oldref = $this->ref;
|
||||
|
||||
// Rename directory if dir was a temporary ref
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||
{
|
||||
// Now we rename also files into index
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'mrp/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'mrp/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->error = $this->db->lasterror(); }
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
$newref = dol_sanitizeFileName($num);
|
||||
$dirsource = $conf->mrp->dir_output.'/'.$oldref;
|
||||
$dirdest = $conf->mrp->dir_output.'/'.$newref;
|
||||
if (!$error && file_exists($dirsource))
|
||||
{
|
||||
dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest);
|
||||
|
||||
if (@rename($dirsource, $dirdest))
|
||||
{
|
||||
dol_syslog("Rename ok");
|
||||
// Rename docs starting with $oldref with $newref
|
||||
$listoffiles = dol_dir_list($conf->mrp->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
|
||||
foreach ($listoffiles as $fileentry)
|
||||
{
|
||||
$dirsource = $fileentry['name'];
|
||||
$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
|
||||
$dirsource = $fileentry['path'].'/'.$dirsource;
|
||||
$dirdest = $fileentry['path'].'/'.$dirdest;
|
||||
@rename($dirsource, $dirdest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set new ref and current status
|
||||
if (!$error)
|
||||
{
|
||||
$this->ref = $num;
|
||||
$this->status = self::STATUS_VALIDATED;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set draft status
|
||||
*
|
||||
* @param User $user Object user that modify
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function setDraft($user, $notrigger = 0)
|
||||
{
|
||||
// Protection
|
||||
if ($this->status <= self::STATUS_DRAFT)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate))))
|
||||
{
|
||||
$this->error='Permission denied';
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'MO_UNVALIDATE');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cancel status
|
||||
*
|
||||
* @param User $user Object user that modify
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @return int <0 if KO, 0=Nothing done, >0 if OK
|
||||
*/
|
||||
public function cancel($user, $notrigger = 0)
|
||||
{
|
||||
// Protection
|
||||
if ($this->status != self::STATUS_VALIDATED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate))))
|
||||
{
|
||||
$this->error='Permission denied';
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'MO_CLOSE');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set back to validated status
|
||||
*
|
||||
* @param User $user Object user that modify
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @return int <0 if KO, 0=Nothing done, >0 if OK
|
||||
*/
|
||||
public function reopen($user, $notrigger = 0)
|
||||
{
|
||||
// Protection
|
||||
if ($this->status != self::STATUS_CANCELED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate))))
|
||||
{
|
||||
$this->error='Permission denied';
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'MO_REOPEN');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a link to the object card (with optionaly the picto)
|
||||
*
|
||||
@ -639,7 +987,10 @@ class Mo extends CommonObject
|
||||
}
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
//if ($status == self::STATUS_VALIDATED) $statusType = 'status4';
|
||||
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';
|
||||
|
||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatus[$status], '', $statusType, $mode);
|
||||
}
|
||||
@ -751,7 +1102,8 @@ class Mo extends CommonObject
|
||||
$langs->load("mrp");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'standard';
|
||||
//$modele = 'standard';
|
||||
$modele = ''; // Remove this once a pdf_standard.php exists.
|
||||
|
||||
if ($this->modelpdf) {
|
||||
$modele = $this->modelpdf;
|
||||
@ -762,6 +1114,8 @@ class Mo extends CommonObject
|
||||
|
||||
$modelpath = "core/modules/mrp/doc/";
|
||||
|
||||
if (empty($modele)) return 1; // Remove this once a pdf_standard.php exists.
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
}
|
||||
|
||||
@ -824,19 +1178,19 @@ class Mo extends CommonObject
|
||||
{
|
||||
foreach ($this->lines as $line)
|
||||
{
|
||||
if (is_object($hookmanager))
|
||||
/*if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line)))
|
||||
{
|
||||
if (empty($line->fk_parent_line))
|
||||
{
|
||||
$parameters = array('line'=>$line, 'i'=>$i);
|
||||
$action = '';
|
||||
$hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$result = $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{*/
|
||||
$this->printOriginLine($line, '', $restrictlist, '/core/tpl', $selectedLines);
|
||||
}
|
||||
//}
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -873,7 +1227,7 @@ class Mo extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
// If origin BOM line is not a product, but another BOM
|
||||
// If origin MRP line is not a product, but another MRP
|
||||
// TODO
|
||||
}
|
||||
|
||||
@ -929,7 +1283,7 @@ class MoLine extends CommonObjectLine
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>165),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'Fk user creat', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>170),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'Fk user modif', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportKey', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
||||
);
|
||||
|
||||
public $rowid;
|
||||
|
||||
@ -139,7 +139,7 @@ if (empty($reshook))
|
||||
}
|
||||
$triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
// Actions cancel, add, update, delete or clone
|
||||
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
// Actions when linking object each other
|
||||
@ -361,7 +361,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$ref = substr($object->ref, 1, 4);
|
||||
if ($ref == 'PROV') {
|
||||
$object->fetch_product();
|
||||
$numref = $object->getNextNumRef($object->thirdparty);
|
||||
$numref = $object->getNextNumRef($object->fk_product);
|
||||
} else {
|
||||
$numref = $object->ref;
|
||||
}
|
||||
@ -487,7 +487,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (!empty($object->table_element_line))
|
||||
{
|
||||
// Show object lines
|
||||
$result = $object->getLinesArray();
|
||||
//$result = $object->getLinesArray();
|
||||
$object->fetchLines();
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
||||
@ -496,42 +497,61 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
<input type="hidden" name="id" value="' . $object->id.'">
|
||||
';
|
||||
|
||||
if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
|
||||
/*if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
|
||||
}
|
||||
}*/
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
|
||||
if (!empty($object->lines))
|
||||
{
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
|
||||
print '<tr><td>TODO...</td></tr>';
|
||||
}
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">'.$langs->trans("Summary").'</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
/*if (!empty($object->lines))
|
||||
{
|
||||
$object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/mrp/tpl');
|
||||
}
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ToConsume").'</td>';
|
||||
print '<td>';
|
||||
if (!empty($object->lines))
|
||||
{
|
||||
$i = 0;
|
||||
foreach($object->lines as $line) {
|
||||
if ($line->role == 'toconsume') {
|
||||
if ($i) print ', ';
|
||||
$tmpproduct = new Product($db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Form to add new line
|
||||
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines')
|
||||
{
|
||||
if ($action != 'editline')
|
||||
{
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc, '/mrp/tpl');
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ToProduce").'</td>';
|
||||
print '<td>';
|
||||
if (!empty($object->lines))
|
||||
{
|
||||
$i = 0;
|
||||
foreach($object->lines as $line) {
|
||||
if ($line->role == 'toproduce') {
|
||||
if ($i) print ', ';
|
||||
$tmpproduct = new Product($db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
}
|
||||
} */
|
||||
|
||||
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
|
||||
{
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
@ -555,18 +575,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft">'.$langs->trans("SetToDraft").'</a>';
|
||||
// TODO Add test that production has not started
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Modify
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||
if ($object->status == $object::STATUS_DRAFT) {
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Validate
|
||||
@ -591,10 +614,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->fk_soc.'&action=clone&object=mo">'.$langs->trans("ToClone").'</a>';
|
||||
}
|
||||
|
||||
// Cancel
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
if ($object->status == $object::STATUS_VALIDATED)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_close&confirm=yes">'.$langs->trans("Cancel").'</a>'."\n";
|
||||
}
|
||||
|
||||
if ($object->status == $object::STATUS_CANCELED)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_reopen&confirm=yes">'.$langs->trans("Re-Open").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||
if ($permissiontodelete)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -99,6 +99,7 @@ $permissiontoadd = $user->rights->mrp->write; // Used by the include of actions_
|
||||
$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||
$upload_dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||
|
||||
$permissiontoproduce = $permissiontoadd;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -305,6 +306,49 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
$parameters = array();
|
||||
// Note that $action and $object may be modified by hook
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
// Consume
|
||||
|
||||
if ($object->status == Mo::STATUS_VALIDATED || $object->status == Mo::STATUS_INPROGRESS) {
|
||||
if ($permissiontoproduce) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=consume">'.$langs->trans('Consume').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('Consume').'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ValidateFirst").'">'.$langs->trans('Consume').'</a>';
|
||||
}
|
||||
|
||||
// Produce
|
||||
if ($object->status == Mo::STATUS_VALIDATED || $object->status == Mo::STATUS_INPROGRESS) {
|
||||
if ($permissiontoproduce) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=produce">'.$langs->trans('Produce').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('Produce').'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ValidateFirst").'">'.$langs->trans('Produce').'</a>';
|
||||
}
|
||||
|
||||
// ConsumeAndProduceAll
|
||||
if ($object->status == Mo::STATUS_VALIDATED || $object->status == Mo::STATUS_INPROGRESS) {
|
||||
if ($permissiontoproduce) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=consumeandproduceall">'.$langs->trans('ConsumeAndProduceAll').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('ConsumeAndProduceAll').'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ValidateFirst").'">'.$langs->trans('ConsumeAndProduceAll').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
* Lines
|
||||
@ -313,7 +357,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (!empty($object->table_element_line))
|
||||
{
|
||||
// Show object lines
|
||||
$result = $object->getLinesArray();
|
||||
//$result = $object->getLinesArray();
|
||||
$object->fetchLines();
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
||||
@ -326,16 +371,44 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
|
||||
}
|
||||
|
||||
$object->fetchLines();
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print load_fiche_titre($langs->trans('Consumption'), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Product").'</td>';
|
||||
print '<td>'.$langs->trans("Qty").'</td>';
|
||||
print '<td>'.$langs->trans("QtyAlreadyConsumed").'</td>';
|
||||
/*print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Batch").'</td>';*/
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($object->lines))
|
||||
{
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
foreach($object->lines as $line) {
|
||||
if ($line->role == 'toconsume') {
|
||||
print '<tr>';
|
||||
$tmpproduct = new Product($db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
print '<td>'.$tmpproduct->getNomUrl(1).'</td>';
|
||||
print '<td>'.$line->qty.'</td>';
|
||||
$alreadyconsumed = 0;
|
||||
print '<td>'.$alreadyconsumed.'</td>';
|
||||
/*print '<td>'.'</td>';
|
||||
print '<td>'.'</td>';*/
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>TODO...</td></tr>';
|
||||
// Show detailed of already consumed
|
||||
//$arrayoflines = $line->fetchLinesLinked('consumed');
|
||||
|
||||
//var_dump($object->lines);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*if (!empty($object->lines))
|
||||
@ -356,10 +429,53 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
}*/
|
||||
|
||||
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print load_fiche_titre($langs->trans('Production'), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Product").'</td>';
|
||||
print '<td>'.$langs->trans("Qty").'</td>';
|
||||
print '<td>'.$langs->trans("QtyAlreadyProduced").'</td>';
|
||||
/*print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Batch").'</td>';*/
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($object->lines))
|
||||
{
|
||||
print '</table>';
|
||||
foreach($object->lines as $line) {
|
||||
if ($line->role == 'toproduce') {
|
||||
print '<tr>';
|
||||
$tmpproduct = new Product($db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
print '<td>'.$tmpproduct->getNomUrl(1).'</td>';
|
||||
print '<td>'.$line->qty.'</td>';
|
||||
$alreadyconsumed = 0;
|
||||
print '<td>'.$alreadyconsumed.'</td>';
|
||||
/*print '<td>'.'</td>';
|
||||
print '<td>'.'</td>';*/
|
||||
print '</tr>';
|
||||
|
||||
// Show detailed of already consumed
|
||||
//$arrayoflines = $line->fetchLinesLinked('consumed');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
@ -117,7 +117,7 @@ class Entrepot extends CommonObject
|
||||
//'fk_user_author' =>array('type'=>'integer', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-2, 'position'=>82),
|
||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
|
||||
//'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportKey', 'enabled'=>1, 'visible'=>-2, 'position'=>1000),
|
||||
//'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000),
|
||||
//'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>1010),
|
||||
'statut' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-2, 'position'=>200),
|
||||
);
|
||||
|
||||
@ -96,7 +96,7 @@ $arrayfields = array(
|
||||
't.fk_product'=>array('label'=>$langs->trans("Product"), 'checked'=>1),
|
||||
't.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>1),
|
||||
't.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>1),
|
||||
//'t.import_key'=>array('label'=>$langs->trans("ImportKey"), 'checked'=>1),
|
||||
//'t.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>1),
|
||||
//'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))),
|
||||
//'t.fk_user_creat'=>array('label'=>$langs->trans("UserCreationShort"), 'checked'=>0, 'position'=>500),
|
||||
//'t.fk_user_modif'=>array('label'=>$langs->trans("UserModificationShort"), 'checked'=>0, 'position'=>500),
|
||||
|
||||
@ -180,14 +180,14 @@ class Project extends CommonObject
|
||||
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'fk_opp_status' =>array('type'=>'integer', 'label'=>'Fk opp status', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
|
||||
'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'Opp percent', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
|
||||
'note_private' =>array('type'=>'text', 'label'=>'Note private', 'enabled'=>1, 'visible'=>0, 'position'=>85),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'Note public', 'enabled'=>1, 'visible'=>0, 'position'=>90),
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>85),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>90),
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>95),
|
||||
'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget amount', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
|
||||
'date_close' =>array('type'=>'datetime', 'label'=>'Date close', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
|
||||
'fk_user_close' =>array('type'=>'integer', 'label'=>'Fk user close', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
||||
'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'Opp amount', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportKey', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'Fk user modif', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
|
||||
'usage_bill_time' =>array('type'=>'integer', 'label'=>'Usage bill time', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
|
||||
'usage_opportunity' =>array('type'=>'integer', 'label'=>'Usage opportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
|
||||
|
||||
@ -41,11 +41,17 @@ if (! empty($conf->projet->enabled))
|
||||
$langs->loadLangs(array("compta","banks","bills","users","salaries","hrm"));
|
||||
if (! empty($conf->projet->enabled)) $langs->load("projects");
|
||||
|
||||
$id=GETPOST("id", 'int');
|
||||
$action=GETPOST('action', 'aZ09');
|
||||
$cancel= GETPOST('cancel', 'aZ09');
|
||||
$id = GETPOST("id", 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$accountid = GETPOST("accountid", 'int');
|
||||
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
|
||||
|
||||
$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int'));
|
||||
$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int'));
|
||||
$datesp = dol_mktime(12, 0, 0, GETPOST("datespmonth", 'int'), GETPOST("datespday", 'int'), GETPOST("datespyear", 'int'));
|
||||
$dateep = dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday", 'int'), GETPOST("dateepyear", 'int'));
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid", "int");
|
||||
if ($user->socid) $socid=$user->socid;
|
||||
@ -60,6 +66,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('salarycard', 'globalcard'));
|
||||
|
||||
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
@ -74,34 +81,30 @@ if ($cancel)
|
||||
if ($action == 'classin' && $user->rights->banque->modifier)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->setProject(GETPOST('projectid'));
|
||||
$object->setProject($projectid);
|
||||
}
|
||||
|
||||
if ($action == 'add' && empty($cancel))
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int'));
|
||||
$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int'));
|
||||
$datesp = dol_mktime(12, 0, 0, GETPOST("datespmonth", 'int'), GETPOST("datespday", 'int'), GETPOST("datespyear", 'int'));
|
||||
$dateep = dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday", 'int'), GETPOST("dateepyear", 'int'));
|
||||
if (empty($datev)) $datev = $datep;
|
||||
|
||||
$type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1);
|
||||
|
||||
$object->accountid = GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0;
|
||||
$object->fk_user = GETPOST("fk_user") > 0 ? GETPOST("fk_user", "int") : 0;
|
||||
$object->accountid = GETPOST("accountid", 'int') > 0 ? GETPOST("accountid", "int") : 0;
|
||||
$object->fk_user = GETPOST("fk_user", 'int') > 0 ? GETPOST("fk_user", "int") : 0;
|
||||
$object->datev = $datev;
|
||||
$object->datep = $datep;
|
||||
$object->amount = price2num(GETPOST("amount"));
|
||||
$object->label = GETPOST("label");
|
||||
$object->amount = price2num(GETPOST("amount", 'alpha'));
|
||||
$object->label = GETPOST("label", 'alphanohtml');
|
||||
$object->datesp = $datesp;
|
||||
$object->dateep = $dateep;
|
||||
$object->note = GETPOST("note");
|
||||
$object->note = GETPOST("note", 'none');
|
||||
$object->type_payment = ($type_payment > 0 ? $type_payment : 0);
|
||||
$object->num_payment = GETPOST("num_payment");
|
||||
$object->num_payment = GETPOST("num_payment", 'alphanohtml');
|
||||
$object->fk_user_author = $user->id;
|
||||
$object->fk_project = GETPOST('fk_project', 'int');
|
||||
$object->fk_project = $projectid;
|
||||
|
||||
// Set user current salary as ref salary for the payment
|
||||
$fuser = new User($db);
|
||||
@ -146,8 +149,15 @@ if ($action == 'add' && empty($cancel))
|
||||
if ($ret > 0)
|
||||
{
|
||||
$db->commit();
|
||||
header("Location: list.php");
|
||||
exit;
|
||||
|
||||
if (GETPOST('saveandnew', 'alpha')) {
|
||||
setEventMessages($langs->trans("RecordSaved"), '', 'mesgs');
|
||||
header("Location: card.php?action=create&fk_project=".urlencode($projectid)."&accountid=".urlencode($accountid).'&paymenttype='.urlencode(GETPOST('paymenttype', 'az09')).'&datepday='.GETPOST("datepday", 'int').'&datepmonth='.GETPOST("datepmonth", 'int').'&datepyear='.GETPOST("datepyear", 'int'));
|
||||
exit;
|
||||
} else {
|
||||
header("Location: list.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -272,13 +282,6 @@ if ($action == 'create')
|
||||
print $form->selectDate((empty($datev) ?-1 : $datev), "datev", '', '', '', 'add', 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Employee
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('Employee', 'fk_user', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$noactive = 0; // We keep active and unactive users
|
||||
print $form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive);
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('Label', 'label', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
@ -297,6 +300,13 @@ if ($action == 'create')
|
||||
print $form->selectDate($dateep, "dateep", '', '', '', 'add');
|
||||
print '</td></tr>';
|
||||
|
||||
// Employee
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('Employee', 'fk_user', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$noactive = 0; // We keep active and unactive users
|
||||
print $form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive);
|
||||
print '</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
@ -309,9 +319,7 @@ if ($action == 'create')
|
||||
$formproject = new FormProjets($db);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
|
||||
$numproject = $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
|
||||
|
||||
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -320,14 +328,14 @@ if ($action == 'create')
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$form->select_comptes($_POST["accountid"], "accountid", 0, '', 1); // Affiche liste des comptes courant
|
||||
$form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Type payment
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$form->select_types_paiements(GETPOST("paymenttype"), "paymenttype", '', 2);
|
||||
$form->select_types_paiements(GETPOST("paymenttype", 'aZ09'), "paymenttype", '', 2);
|
||||
print '</td></tr>';
|
||||
|
||||
// Number
|
||||
@ -354,8 +362,10 @@ if ($action == 'create')
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="saveandnew" value="'.$langs->trans("SaveAndNew").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -80,6 +80,7 @@ else
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref = "";
|
||||
$search_user = "";
|
||||
$search_label = "";
|
||||
$search_amount = "";
|
||||
$search_account = '';
|
||||
|
||||
@ -174,36 +174,36 @@ $checkedprofid6 = 0;
|
||||
$checkprospectlevel = (in_array($contextpage, array('prospectlist')) ? 1 : 0);
|
||||
$checkstcomm = (in_array($contextpage, array('prospectlist')) ? 1 : 0);
|
||||
$arrayfields = array(
|
||||
's.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)),
|
||||
's.nom'=>array('label'=>"ThirdPartyName", 'checked'=>1),
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1),
|
||||
's.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))),
|
||||
's.code_client'=>array('label'=>"CustomerCodeShort", 'checked'=>$checkedcustomercode),
|
||||
's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'checked'=>$checkedsuppliercode, 'enabled'=>(!empty($conf->fournisseur->enabled))),
|
||||
's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'checked'=>$checkedcustomeraccountcode),
|
||||
's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(!empty($conf->fournisseur->enabled))),
|
||||
's.town'=>array('label'=>"Town", 'checked'=>1),
|
||||
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
||||
'state.nom'=>array('label'=>"State", 'checked'=>0),
|
||||
'region.nom'=>array('label'=>"Region", 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||
's.email'=>array('label'=>"Email", 'checked'=>0),
|
||||
's.url'=>array('label'=>"Url", 'checked'=>0),
|
||||
's.phone'=>array('label'=>"Phone", 'checked'=>1),
|
||||
's.fax'=>array('label'=>"Fax", 'checked'=>0),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
||||
'staff.code'=>array('label'=>"Staff", 'checked'=>0),
|
||||
's.siren'=>array('label'=>"ProfId1Short", 'checked'=>$checkedprofid1),
|
||||
's.siret'=>array('label'=>"ProfId2Short", 'checked'=>$checkedprofid2),
|
||||
's.ape'=>array('label'=>"ProfId3Short", 'checked'=>$checkedprofid3),
|
||||
's.idprof4'=>array('label'=>"ProfId4Short", 'checked'=>$checkedprofid4),
|
||||
's.idprof5'=>array('label'=>"ProfId5Short", 'checked'=>$checkedprofid5),
|
||||
's.idprof6'=>array('label'=>"ProfId6Short", 'checked'=>$checkedprofid6),
|
||||
's.tva_intra'=>array('label'=>"VATIntraShort", 'checked'=>0),
|
||||
'customerorsupplier'=>array('label'=>'NatureOfThirdParty', 'checked'=>1),
|
||||
's.fk_prospectlevel'=>array('label'=>"ProspectLevelShort", 'checked'=>$checkprospectlevel),
|
||||
's.fk_stcomm'=>array('label'=>"StatusProsp", 'checked'=>$checkstcomm),
|
||||
's2.nom'=>array('label'=>'ParentCompany', 'checked'=>0),
|
||||
's.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)),
|
||||
's.nom'=>array('label'=>"ThirdPartyName", 'position'=>2, 'checked'=>1),
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>3, 'checked'=>1),
|
||||
's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))),
|
||||
's.code_client'=>array('label'=>"CustomerCodeShort", 'position'=>10, 'checked'=>$checkedcustomercode),
|
||||
's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>(!empty($conf->fournisseur->enabled))),
|
||||
's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'position'=>13, 'checked'=>$checkedcustomeraccountcode),
|
||||
's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(!empty($conf->fournisseur->enabled))),
|
||||
's.town'=>array('label'=>"Town", 'position'=>20, 'checked'=>1),
|
||||
's.zip'=>array('label'=>"Zip", 'position'=>21, 'checked'=>1),
|
||||
'state.nom'=>array('label'=>"State", 'position'=>22, 'checked'=>0),
|
||||
'region.nom'=>array('label'=>"Region", 'position'=>23, 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'position'=>24, 'checked'=>0),
|
||||
's.email'=>array('label'=>"Email", 'position'=>25, 'checked'=>0),
|
||||
's.url'=>array('label'=>"Url", 'position'=>26, 'checked'=>0),
|
||||
's.phone'=>array('label'=>"Phone", 'position'=>27, 'checked'=>1),
|
||||
's.fax'=>array('label'=>"Fax", 'position'=>28, 'checked'=>0),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'position'=>29, 'checked'=>$checkedtypetiers),
|
||||
'staff.code'=>array('label'=>"Staff", 'position'=>30, 'checked'=>0),
|
||||
's.siren'=>array('label'=>"ProfId1Short", 'position'=>40, 'checked'=>$checkedprofid1),
|
||||
's.siret'=>array('label'=>"ProfId2Short", 'position'=>41, 'checked'=>$checkedprofid2),
|
||||
's.ape'=>array('label'=>"ProfId3Short", 'position'=>42, 'checked'=>$checkedprofid3),
|
||||
's.idprof4'=>array('label'=>"ProfId4Short", 'position'=>43, 'checked'=>$checkedprofid4),
|
||||
's.idprof5'=>array('label'=>"ProfId5Short", 'position'=>44, 'checked'=>$checkedprofid5),
|
||||
's.idprof6'=>array('label'=>"ProfId6Short", 'position'=>45, 'checked'=>$checkedprofid6),
|
||||
's.tva_intra'=>array('label'=>"VATIntraShort", 'position'=>50, 'checked'=>0),
|
||||
'customerorsupplier'=>array('label'=>'NatureOfThirdParty', 'position'=>61, 'checked'=>1),
|
||||
's.fk_prospectlevel'=>array('label'=>"ProspectLevelShort", 'position'=>62, 'checked'=>$checkprospectlevel),
|
||||
's.fk_stcomm'=>array('label'=>"StatusProsp", 'position'=>63, 'checked'=>$checkstcomm),
|
||||
's2.nom'=>array('label'=>'ParentCompany', 'position'=>64, 'checked'=>0),
|
||||
's.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||
's.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||
's.status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
|
||||
@ -970,7 +970,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
||||
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="border centpercent margintable">';
|
||||
print '<table class="noborder centpercent margintable">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
print $langs->trans('Properties');
|
||||
|
||||
@ -192,7 +192,7 @@ class ActionsTicket
|
||||
// Initial message
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="border centpercent margintable">';
|
||||
print '<table class="noborder centpercent margintable">';
|
||||
print '<tr class="liste_titre"><td class="nowrap titlefield">';
|
||||
print $langs->trans("InitialMessage");
|
||||
print '</td><td>';
|
||||
@ -381,9 +381,6 @@ class ActionsTicket
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<div class="tagtable centpercent">';
|
||||
print '<div class="tagtr liste_titre">';
|
||||
print '<div class="tagtd">';
|
||||
print '<strong>' . $langs->trans('TicketChangeStatus') . '</strong>';
|
||||
print '</div>';
|
||||
// Exclude status which requires specific method
|
||||
$exclude_status = array(Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED);
|
||||
// Exclude actual status
|
||||
@ -394,7 +391,7 @@ class ActionsTicket
|
||||
|
||||
foreach ($object->statuts_short as $status => $status_label) {
|
||||
if (!in_array($status, $exclude_status)) {
|
||||
print '<div class="tagtd">';
|
||||
print '<div class="tagtd center">';
|
||||
|
||||
if ($status == 1)
|
||||
{
|
||||
|
||||
@ -2436,7 +2436,7 @@ class User extends CommonObject
|
||||
}
|
||||
if ($withpictoimg > -2 && $withpictoimg != 2)
|
||||
{
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '<span class=" nopadding valignmiddle usertext'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled').($morecss ? ' '.$morecss : '').'">';
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '<span class=" nopadding usertext'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled').($morecss ? ' '.$morecss : '').'">';
|
||||
if ($mode == 'login') $result .= dol_trunc($this->login, $maxlen);
|
||||
else $result .= $this->getFullName($langs, '', ($mode == 'firstelselast' ? 3 : ($mode == 'firstname' ? 2 : -1)), $maxlen);
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '</span>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user