diff --git a/ChangeLog b/ChangeLog
index 7091a7010ba..e3a5ef0cbbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php
index b19303f7d38..2e39105eb21 100644
--- a/htdocs/accountancy/admin/accountmodel.php
+++ b/htdocs/accountancy/admin/accountmodel.php
@@ -509,7 +509,7 @@ if ($id)
print '';
// Line to enter new values
- print "
";
+ print '
';
$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 '
';
- 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('');
diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php
index 695d5363f78..88f8a7ca968 100644
--- a/htdocs/admin/system/dolibarr.php
+++ b/htdocs/admin/system/dolibarr.php
@@ -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 ' ('.$langs->trans("HashForPing").'='.md5('dolibarr'.$valuetoshow).')';
}
else
{
diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index 85d5de2e322..51cdb342dc3 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -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;
diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index a7de150edee..ac019de8088 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -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 ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '
';
print '';
- 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 '| '.$langs->trans("Ref").' | ';
print ''.$langs->trans("Document").' | ';
@@ -465,7 +465,7 @@ if (!empty($date_start) && !empty($date_stop))
print '
';
if ($result)
{
- $TData = dol_sort_array($filesarray, 'date', 'ASC');
+ $TData = dol_sort_array($filesarray, $sortfield, $sortorder);
if (empty($TData))
{
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 0c8da446df7..038cb82845e 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -9,7 +9,7 @@
* Copyright (C) 2013 Alexandre Spangaro
* Copyright (C) 2013 Juanjo Menent
* Copyright (C) 2015 Marcos García
- * Copyright (C) 2019 Nicolas ZABOURI
+ * Copyright (C) 2019 Nicolas ZABOURI
*
* 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
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 06cfe319c41..1d0c3839f4f 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -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
);
}
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 6680c81fa20..dfe8535b3bc 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -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)
diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php
index 5ff4c77ae2e..c06c4431562 100644
--- a/htdocs/core/lib/price.lib.php
+++ b/htdocs/core/lib/price.lib.php
@@ -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;
}
}
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 7799ac48690..253b745e25f 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -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);
}
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index 6d21093f971..05272aa2ff7 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -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),
);
diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
index aa66409f3ba..fda1a170212 100644
--- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
+++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
@@ -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'])
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 54aa70469e2..d153f8756c7 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -670,10 +670,9 @@ class CommandeFournisseur extends CommonOrder
2 => 'status3',
3 => 'status3',
4 => 'status3',
- 5 => 'status6',
+ 5 => 'status4',
6 => 'status5',
7 => 'status5',
-
9 => 'status5',
);
diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql
index 6a04816ca27..845b68e54a4 100644
--- a/htdocs/install/mysql/data/llx_accounting_abc.sql
+++ b/htdocs/install/mysql/data/llx_accounting_abc.sql
@@ -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
diff --git a/htdocs/install/mysql/data/llx_accounting_account_se.sql b/htdocs/install/mysql/data/llx_accounting_account_se.sql
new file mode 100644
index 00000000000..0a0c890bcf6
--- /dev/null
+++ b/htdocs/install/mysql/data/llx_accounting_account_se.sql
@@ -0,0 +1,60 @@
+-- Copyright (C) 2001-2004 Rodolphe Quiedeville
+-- Copyright (C) 2003 Jean-Louis Bergamo
+-- Copyright (C) 2004-2009 Laurent Destailleur
+-- Copyright (C) 2004 Benoit Mortier
+-- Copyright (C) 2004 Guillaume Delecourt
+-- Copyright (C) 2005-2009 Regis Houssin
+-- Copyright (C) 2007 Patrick Raguin
+-- Copyright (C) 2011-2017 Alexandre Spangaro
+-- Copyright (C) 2019 swedebugia
+--
+-- 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 .
+--
+
+--
+-- 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);
diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
index e35be192bd5..7f4cdb9c7bb 100644
--- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
+++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
@@ -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);
diff --git a/htdocs/install/mysql/tables/llx_mrp_mo.sql b/htdocs/install/mysql/tables/llx_mrp_mo.sql
index 19f48e27e8a..d3aa294104b 100644
--- a/htdocs/install/mysql/tables/llx_mrp_mo.sql
+++ b/htdocs/install/mysql/tables/llx_mrp_mo.sql
@@ -1,4 +1,4 @@
--- Copyright (C) ---Put here your own copyright and developer email---
+-- Copyright (C) 2019 Laurent Destailleur
--
-- 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,
diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php
index e433ec27f8c..78abde9caa1 100644
--- a/htdocs/install/repair.php
+++ b/htdocs/install/repair.php
@@ -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 '| Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module not enabled in entity '.$obj->entity.', we delete record |
';
+ print '| Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module '.$name.' not enabled in entity '.$obj->entity.', we delete record |
';
}
else
{
- print '| 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) |
';
+ print '| 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) |
';
}
}
else
@@ -415,6 +416,8 @@ if ($ok && GETPOST('standard', 'alpha'))
$db->commit();
}
+ } else {
+ dol_print_error($db);
}
}
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index b177abf75fd..fa9f48ee4c4 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -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:
diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang
index 4bed22df445..e5bcb1e5318 100644
--- a/htdocs/langs/en_US/mrp.lang
+++ b/htdocs/langs/en_US/mrp.lang
@@ -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
\ No newline at end of file
+ForAQuantityOf1=For a quantity to produce of 1
+ConfirmValidateMo=Are you sure you want to validate this Manufacturing Order?
\ No newline at end of file
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 3acc10fe9d7..7744e1ffd16 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -2555,17 +2555,17 @@ if (!function_exists("llxFooter"))
if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || GETPOST('forceping', 'alpha'))
{
//print '';
+ $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".''."\n";
print "\n\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);
?>