";
+
// Other attributes
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
diff --git a/htdocs/index.php b/htdocs/index.php
index 8c37688c0f8..7462b05b3e7 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -158,7 +158,8 @@ if (empty($user->societe_id))
! empty($conf->facture->enabled) && $user->rights->facture->lire,
! empty($conf->contrat->enabled) && $user->rights->contrat->activer,
! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire,
- ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire);
+ ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire,
+ ! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire);
// Class file containing the method load_state_board for each line
$includes=array(DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
@@ -171,7 +172,8 @@ if (empty($user->societe_id))
DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php",
DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php",
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php",
- DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php");
+ DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php",
+ DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php");
// Name class containing the method load_state_board for each line
$classes=array('Client',
'Client',
@@ -184,7 +186,8 @@ if (empty($user->societe_id))
'Facture',
'Contrat',
'CommandeFournisseur',
- 'FactureFournisseur');
+ 'FactureFournisseur',
+ 'ExpenseReport');
// Cle array returned by the method load_state_board for each line
$keys=array('customers',
'prospects',
@@ -197,7 +200,8 @@ if (empty($user->societe_id))
'invoices',
'Contracts',
'supplier_orders',
- 'supplier_invoices');
+ 'supplier_invoices',
+ 'expensereports');
// Dashboard Icon lines
$icons=array('company',
'company',
@@ -210,7 +214,8 @@ if (empty($user->societe_id))
'bill',
'order',
'order',
- 'bill');
+ 'bill',
+ 'trip');
// Translation keyword
$titres=array("ThirdPartyCustomersStats",
"ThirdPartyProspectsStats",
@@ -223,7 +228,8 @@ if (empty($user->societe_id))
"BillsCustomers",
"Contracts",
"SuppliersOrders",
- "SuppliersInvoices");
+ "SuppliersInvoices",
+ "ExpenseReports");
// Dashboard Link lines
$links=array(DOL_URL_ROOT.'/comm/list.php',
DOL_URL_ROOT.'/comm/prospect/list.php',
@@ -236,7 +242,8 @@ if (empty($user->societe_id))
DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy',
DOL_URL_ROOT.'/contrat/list.php',
DOL_URL_ROOT.'/fourn/commande/list.php',
- DOL_URL_ROOT.'/fourn/facture/list.php');
+ DOL_URL_ROOT.'/fourn/facture/list.php',
+ DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm');
// Translation lang files
$langfile=array("companies",
"prospects",
@@ -247,7 +254,8 @@ if (empty($user->societe_id))
"propal",
"orders",
"bills",
- "contracts");
+ "contracts",
+ "trips");
// Loop and displays each line of table
@@ -402,6 +410,15 @@ if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire && ! $use
$dashboardlines[] = $board->load_board($user);
}
+// Number of expense reports to pay
+if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire)
+{
+ include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
+ $board=new ExpenseReport($db);
+
+ $dashboardlines[] = $board->load_board($user);
+}
+
// Calculate total nb of late
$totallate=0;
$var=true;
diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql
index 3b627f3d99b..13604638f01 100644
--- a/htdocs/install/mysql/data/llx_const.sql
+++ b/htdocs/install/mysql/data/llx_const.sql
@@ -75,6 +75,7 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_NOT
insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_RUNNING_SERVICES','0','chaine','Tolérance de retard avant alerte (en jours) sur services expirés',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_MEMBERS','31','chaine','Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE','62','chaine','Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire',0);
+insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXPENSEREPORTS_TO_PAY','31','chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0);
--
diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
new file mode 100644
index 00000000000..8b64acf2ce8
--- /dev/null
+++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
@@ -0,0 +1,25 @@
+--
+-- Be carefull to requests order.
+-- This file must be loaded by calling /install/index.php page
+-- when current version is 3.9.0 or higher.
+--
+-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
+-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
+-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
+-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
+-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
+-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
+-- To restrict request to Mysql version x.y use -- VMYSQLx.y
+-- To restrict request to Pgsql version x.y use -- VPGSQLx.y
+-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
+-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
+-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
+-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
+-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
+-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
+
+
+INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXPENSEREPORTS_TO_PAY','31','chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0);
+
+ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
+ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);
diff --git a/htdocs/install/mysql/tables/llx_accounting_system.sql b/htdocs/install/mysql/tables/llx_accounting_system.sql
index 50a9c66b054..b0be95c7666 100644
--- a/htdocs/install/mysql/tables/llx_accounting_system.sql
+++ b/htdocs/install/mysql/tables/llx_accounting_system.sql
@@ -21,7 +21,7 @@
create table llx_accounting_system
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- pcg_version varchar(12) NOT NULL,
+ pcg_version varchar(32) NOT NULL,
fk_pays integer NOT NULL,
label varchar(128) NOT NULL,
active smallint DEFAULT 0
diff --git a/htdocs/install/mysql/tables/llx_accountingaccount.sql b/htdocs/install/mysql/tables/llx_accountingaccount.sql
index f4e4d694471..3847ce91811 100644
--- a/htdocs/install/mysql/tables/llx_accountingaccount.sql
+++ b/htdocs/install/mysql/tables/llx_accountingaccount.sql
@@ -24,7 +24,7 @@ create table llx_accountingaccount
entity integer DEFAULT 1 NOT NULL,
datec datetime,
tms timestamp,
- fk_pcg_version varchar(12) NOT NULL,
+ fk_pcg_version varchar(32) NOT NULL,
pcg_type varchar(20) NOT NULL,
pcg_subtype varchar(20) NOT NULL,
account_number varchar(32) NOT NULL,
diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang
index 3b54b6d9714..c6f4f316a04 100644
--- a/htdocs/langs/en_US/trips.lang
+++ b/htdocs/langs/en_US/trips.lang
@@ -102,3 +102,5 @@ ConfirmSaveTrip=Are you sure you want to validate this expense report ?
NoTripsToExportCSV=No expense report to export for this period.
ExpenseReportPayment=Expense report payment
+
+ExpenseReportsToPay=Expense reports to pay
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 9e8cd7acef3..96e4c955cd6 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -204,7 +204,7 @@ if ($id > 0 || ! empty($ref))
print '';
// Label
- print '