@@ -44,7 +44,13 @@ $action = GETPOST('action', 'alpha');
// Other parameters ACCOUNTING_*
$list = array (
- 'ACCOUNTING_SEPARATORCSV'
+ 'ACCOUNTING_EXPORT_SEPARATORCSV',
+ 'ACCOUNTING_EXPORT_DATE',
+ 'ACCOUNTING_EXPORT_PIECE',
+ 'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT',
+ 'ACCOUNTING_EXPORT_LABEL',
+ 'ACCOUNTING_EXPORT_AMOUNT',
+ 'ACCOUNTING_EXPORT_DEVISE'
);
/*
@@ -57,7 +63,7 @@ if ($action == 'update') {
if (! empty($modelcsv)) {
- if (! dolibarr_set_const($db, 'ACCOUNTING_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
+ if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
$error ++;
}
} else {
@@ -112,12 +118,12 @@ print "" . $langs->trans("Selectmodelcsv") . " ";
print "";
print '';
print 'global->ACCOUNTING_MODELCSV == 0) {
+if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 0) {
print ' selected="selected"';
}
print '>' . $langs->trans("Modelcsv_normal") . ' ';
print 'global->ACCOUNTING_MODELCSV == 1) {
+if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) {
print ' selected="selected"';
}
print '>' . $langs->trans("Modelcsv_CEGID") . ' ';
@@ -128,8 +134,7 @@ print "";
print " \n";
/*
- * Params
- *
+ * Parameters
*/
$num = count($list);
@@ -161,4 +166,4 @@ print '';
llxFooter();
-$db->close();
\ No newline at end of file
+$db->close();
diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php
index 120d08db09c..35e6c85ee4f 100644
--- a/htdocs/accountancy/bookkeeping/balancebymonth.php
+++ b/htdocs/accountancy/bookkeeping/balancebymonth.php
@@ -50,10 +50,10 @@ if ($year == 0) {
/*
* View
*/
-llxHeader('', $langs->trans("CustomersVentilation"));
+llxHeader('', $langs->trans("Bookkeeping"));
-$textprevyear = "
" . img_previous() . " ";
-$textnextyear = "
" . img_next() . " ";
+$textprevyear = '
' . img_previous() . ' ';
+$textnextyear = '
' . img_next() . ' ';
print_fiche_titre($langs->trans("AccountBalanceByMonth") . ' ' . $textprevyear . ' ' . $langs->trans("Year") . ' ' . $year_start . ' ' . $textnextyear);
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index b2acc60fb6a..f1dc892c10f 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -151,7 +151,7 @@ else {
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
- print '
';
+ print '
';
print '';
@@ -231,4 +231,4 @@ else {
}
llxFooter();
-$db->close();
+$db->close();
\ No newline at end of file
diff --git a/htdocs/accountancy/bookkeeping/listbyyear.php b/htdocs/accountancy/bookkeeping/listbyyear.php
index 0829f792130..26f0469c1a0 100644
--- a/htdocs/accountancy/bookkeeping/listbyyear.php
+++ b/htdocs/accountancy/bookkeeping/listbyyear.php
@@ -56,12 +56,11 @@ $offset = $conf->liste_limit * $page;
llxHeader('', $langs->trans("Bookkeeping"));
-$textprevyear = "
" . img_previous() . " ";
-$textnextyear = "
" . img_next() . " ";
+$textprevyear = '
' . img_previous() . ' ';
+$textnextyear = '
' . img_next() . ' ';
/*
- * Mode Liste
- *
+ * Mode List
*/
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens, bk.code_journal";
diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php
index 659bff072cf..bc9ed576645 100644
--- a/htdocs/accountancy/class/accountingaccount.class.php
+++ b/htdocs/accountancy/class/accountingaccount.class.php
@@ -53,7 +53,6 @@ class AccountingAccount extends CommonObject
* @param DoliDB $db Database handle
*/
function __construct($db)
-
{
$this->db = $db;
}
diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php
index 33bb33a2353..4e833862bd8 100644
--- a/htdocs/accountancy/class/html.formventilation.class.php
+++ b/htdocs/accountancy/class/html.formventilation.class.php
@@ -128,7 +128,7 @@ class FormVentilation extends Form
$label = $obj->account_number . ' - ' . $obj->label;
// Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number
- // Bacause same account_number can be share between different accounting_system and do have the same meaning
+ // Because same account_number can be share between different accounting_system and do have the same meaning
if (($selectid != '') && $selectid == $obj->rowid) {
// $out .= '
' . $label . ' ';
$out .= '
' . $label . ' ';
diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php
index 4249688fabe..0c653627be0 100644
--- a/htdocs/accountancy/customer/card.php
+++ b/htdocs/accountancy/customer/card.php
@@ -24,7 +24,7 @@
*/
require '../../main.inc.php';
-
+
// Class
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
@@ -40,19 +40,18 @@ $id = GETPOST('id');
// Security check
if ($user->societe_id > 0)
accessforbidden();
-
+
/*
* Actions
*/
-if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch)
-{
+if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
if (! GETPOST('cancel', 'alpha'))
{
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql .= " SET fk_code_ventilation = " . $codeventil;
$sql .= " WHERE rowid = " . $id;
-
+
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql) {
@@ -61,7 +60,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch)
} else {
header("Location: ./lines.php");
exit();
- }
+ }
}
llxHeader("", "", "FicheVentilation");
@@ -86,38 +85,38 @@ if (! empty($id)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
-
+
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
-
+
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
-
+
if ($result) {
$num_lines = $db->num_rows($result);
$i = 0;
-
+
if ($num_lines) {
-
+
$objp = $db->fetch_object($result);
-
+
print '
';
} else {
print "Error";
@@ -145,4 +144,4 @@ if (! empty($id)) {
}
llxFooter();
-$db->close();
\ No newline at end of file
+$db->close();
diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index 663e763a9d3..1760f8360a9 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -22,7 +22,7 @@
/**
* \file htdocs/accountancy/customer/index.php
* \ingroup Accounting Expert
- * \brief Page accueil clients ventilation comptable
+ * \brief Home customer ventilation
*/
require '../../main.inc.php';
@@ -75,6 +75,8 @@ if ($action == 'validatehistory') {
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
+
+ dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
@@ -93,7 +95,7 @@ if ($action == 'validatehistory') {
llxHeader('', $langs->trans("CustomersVentilation"));
$textprevyear = '
' . img_previous() . ' ';
-$textnextyear = '
' . img_next() . ' ';
+$textnextyear = '
' . img_next() . ' ';
print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
@@ -105,6 +107,7 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f";
$sql .= " WHERE fd.fk_code_ventilation = 0";
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
+dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$row = $db->fetch_row($result);
@@ -160,6 +163,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " GROUP BY fd.fk_code_ventilation";
+dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
@@ -194,7 +198,7 @@ print "\n";
print "
\n";
print '
';
-print '' . $langs->trans("Total") . ' ';
+print '' . $langs->trans("TotalVente") . ' ';
print '' . $langs->trans("JanuaryMin") . ' ';
print '' . $langs->trans("FebruaryMin") . ' ';
print '' . $langs->trans("MarchMin") . ' ';
@@ -232,6 +236,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
+dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
@@ -303,7 +308,8 @@ if (! empty($conf->margin->enabled)) {
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
-
+
+ dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php
index 9215d5a9d98..01806db8332 100644
--- a/htdocs/accountancy/customer/lines.php
+++ b/htdocs/accountancy/customer/lines.php
@@ -133,7 +133,7 @@ if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
}
$sql .= $db->plimit($limit + 1, $offset);
-dol_syslog("/accountancy/customer/linges.php sql=" . $sql, LOG_DEBUG);
+dol_syslog("/accountancy/customer/lines.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
@@ -220,5 +220,5 @@ if ($result) {
print "
";
-$db->close();
-llxFooter();
\ No newline at end of file
+llxFooter();
+$db->close();
\ No newline at end of file
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index 85ccdd3e619..3d4987bd94a 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -52,9 +52,25 @@ $formventilation = new FormVentilation($db);
llxHeader('', $langs->trans("Ventilation"));
+print '';
/*
* Action
-*/
+ */
if ($action == 'ventil') {
print '
' . $langs->trans("Processing") . '...
';
@@ -113,8 +129,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_fac
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
-$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
-$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
+$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
+$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
@@ -147,7 +163,7 @@ if ($result) {
print '
' . $langs->trans("Amount") . ' ';
print '
' . $langs->trans("AccountAccounting") . ' ';
print '
' . $langs->trans("IntoAccount") . ' ';
- print '
' . $langs->trans("Ventilate") . ' ';
+ print '
' . $langs->trans("Ventilate") . ''.$langs->trans('All').' /'.$langs->trans('None').' '.' ';
print '';
$facture_static = new Facture($db);
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 754b4408b16..0417a87fc70 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -450,14 +450,14 @@ if ($action == 'writeBookKeeping')
// export csv
if ($action == 'export_csv')
{
- $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
+ $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_banque.csv');
$companystatic = new Client($db);
- if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
+ if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{
foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
diff --git a/htdocs/accountancy/journal/cashjournal.php b/htdocs/accountancy/journal/cashjournal.php
index 261cdd036c3..52b50789fdb 100644
--- a/htdocs/accountancy/journal/cashjournal.php
+++ b/htdocs/accountancy/journal/cashjournal.php
@@ -367,12 +367,12 @@ if ($action == 'writeBookKeeping')
}
// export csv
if ($action == 'export_csv') {
- $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
+ $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv');
header('Content-Disposition:attachment;filename=journal_caisse.csv');
- if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
+ if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{
foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 0e0b7c4281f..e7727df7add 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -185,8 +185,8 @@ if ($action == 'writebookkeeping') {
foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) {
// get compte id and label
- $compte = new AccountingAccount($db);
- if ($compte->fetch(null, $k)) {
+ $accountingaccount = new AccountingAccount($db);
+ if ($accountingaccount->fetch(null, $k)) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"];
@@ -195,7 +195,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_facturefourndet"];
$bookkeeping->code_tiers = '';
- $bookkeeping->label_compte = dol_trunc($val["description"], 128);
+ $bookkeeping->label_compte = $accountingaccount->label;
$bookkeeping->numero_compte = $k;
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
@@ -213,7 +213,6 @@ if ($action == 'writebookkeeping') {
foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) {
// get compte id and label
-
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"];
@@ -246,12 +245,12 @@ $companystatic = new Fournisseur($db);
// export csv
if ($action == 'export_csv')
{
- $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
+ $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_achats.csv');
- if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
+ if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{
foreach ( $tabfac as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
@@ -314,11 +313,13 @@ if ($action == 'export_csv')
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
+ $accountingaccount = new AccountingAccount($db);
+ $accountingaccount->fetch(null, $k);
if ($mt) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
- print '"' . dol_trunc($val["description"], 32) . '"' . $sep;
+ print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n";
@@ -417,12 +418,15 @@ if ($action == 'export_csv')
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
+ $accountingaccount = new AccountingAccount($db);
+ $accountingaccount->fetch(null, $k);
+
if ($mt) {
print "
";
print "" . $date . " ";
print "" . $invoicestatic->getNomUrl(1) . " ";
print "" . length_accountg($k) . " ";
- print "" . $invoicestatic->description . " ";
+ print "" . $accountingaccount->label . " ";
print '' . ($mt >= 0 ? price($mt) : '') . " ";
print '' . ($mt < 0 ? price(- $mt) : '') . " ";
print " ";
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index 8a0318473c9..5737238ef07 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -151,7 +151,7 @@ if ($result) {
$tabfac[$obj->rowid]["date"] = $obj->df;
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
$tabfac[$obj->rowid]["type"] = $obj->type;
- $tabfac[$obj->rowid]["description"] = $obj->description;
+ $tabfac[$obj->rowid]["description"] = $obj->label_compte;
$tabfac[$obj->rowid]["fk_facturedet"] = $obj->fdid;
if (! isset($tabttc[$obj->rowid][$compta_soc]))
$tabttc[$obj->rowid][$compta_soc] = 0;
@@ -207,8 +207,8 @@ if ($action == 'writebookkeeping') {
foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) {
// get compte id and label
- $compte = new AccountingAccount($db);
- if ($compte->fetch(null, $k)) {
+ $accountingaccount = new AccountingAccount($db);
+ if ($accountingaccount->fetch(null, $k)) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"];
@@ -218,7 +218,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_docdet = $val["fk_facturedet"];
$bookkeeping->code_tiers = '';
$bookkeeping->numero_compte = $k;
- $bookkeeping->label_compte = dol_trunc($val["description"], 128);
+ $bookkeeping->label_compte = $accountingaccount->label;
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
@@ -258,14 +258,14 @@ if ($action == 'writebookkeeping') {
}
// export csv
if ($action == 'export_csv') {
- $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
+ $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_ventes.csv');
$companystatic = new Client($db);
- if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
+ if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{
foreach ( $tabfac as $key => $val ) {
$companystatic->id = $tabcompany[$key]['id'];
@@ -335,11 +335,14 @@ if ($action == 'export_csv') {
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
+ $accountingaccount = new AccountingAccount($db);
+ $accountingaccount->fetch(null, $k);
+
if ($mt) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
- print '"' . dol_trunc($val["description"], 32) . '"' . $sep;
+ print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
print "\n";
@@ -447,12 +450,15 @@ if ($action == 'export_csv') {
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
+ $accountingaccount = new AccountingAccount($db);
+ $accountingaccount->fetch(null, $k);
+
if ($mt) {
print "
";
print "" . $date . " ";
print "" . $invoicestatic->getNomUrl(1) . " ";
print "" . length_accountg($k) . " ";
- print "" . $invoicestatic->description . " ";
+ print "" . $accountingaccount->label . " ";
print "" . ($mt < 0 ? price(- $mt) : '') . " ";
print "" . ($mt >= 0 ? price($mt) : '') . " ";
print " ";
@@ -478,8 +484,8 @@ if ($action == 'export_csv') {
}
print "";
-
- // End of page
- llxFooter();
}
+
+llxFooter();
+
$db->close();
diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php
index 45c8de9b165..1acd5829c45 100644
--- a/htdocs/accountancy/supplier/card.php
+++ b/htdocs/accountancy/supplier/card.php
@@ -4,7 +4,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro
* Copyright (C) 2013-2014 Olivier Geffroy
* Copyright (C) 2013-2014 Florian Henry
- * Copyright (C) 2014 Juanjo Menent s
+ * Copyright (C) 2014 Juanjo Menent
*
* 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
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index edebcfd9d46..85d1c04cf53 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/supplier/index.php
* \ingroup Accounting Expert
- * \brief Page accueil ventilation
+ * \brief Home supplier ventilation
*/
require '../../main.inc.php';
@@ -93,9 +93,9 @@ if ($action == 'validatehistory') {
llxHeader('', $langs->trans("SuppliersVentilation"));
$textprevyear = '' . img_previous() . ' ';
-$textnextyear = ' ' . img_next() . ' ';
+$textnextyear = ' ' . img_next() . ' ';
-print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
+print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
print '' . $langs->trans("DescVentilSupplier") . ' ';
print '';
@@ -105,7 +105,7 @@ $y = $year_current;
$var = true;
print '';
-print '' . $langs->trans("Account") . ' ';
+print '' . $langs->trans("Account") . ' ';
print '' . $langs->trans("Label") . ' ';
print '' . $langs->trans("JanuaryMin") . ' ';
print '' . $langs->trans("FebruaryMin") . ' ';
diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php
index 8b2a870220d..5df5ee0c06f 100644
--- a/htdocs/accountancy/supplier/lines.php
+++ b/htdocs/accountancy/supplier/lines.php
@@ -1,7 +1,5 @@
- * Copyright (C) 2005 Simon TOSSER
- * Copyright (C) 2013-2014 Olivier Geffroy
+/* Copyright (C) 2013-2014 Olivier Geffroy
* Copyright (C) 2013-2014 Alexandre Spangaro
* Copyright (C) 2014 Ari Elbaz (elarifr)
* Copyright (C) 2013-2014 Florian Henry
@@ -48,6 +46,7 @@ if ($user->societe_id > 0)
if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden();
+
$formventilation = new FormVentilation($db);
$changeaccount = GETPOST('changeaccount');
@@ -107,7 +106,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
$sql .= " AND aa.rowid = l.fk_code_ventilation";
if (strlen(trim($_GET["search_facture"]))) {
- $sql .= " AND f.facnumber like '%" . $_GET["search_facture"] . "%'";
+ $sql .= " AND f.ref like '%" . $_GET["search_facture"] . "%'";
}
if (strlen(trim($_GET["search_ref"]))) {
$sql .= " AND p.ref like '%" . $_GET["search_ref"] . "%'";
@@ -218,7 +217,8 @@ if ($result) {
print $db->error();
}
+
print "
";
-$db->close();
-llxFooter();
\ No newline at end of file
+llxFooter();
+$db->close();
\ No newline at end of file
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index f932fbfc8af..a85dd7a17d4 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -22,7 +22,7 @@
/**
* \file htdocs/accountancy/supplier/list.php
* \ingroup Accounting Expert
- * \brief Page de ventilation des lignes de facture
+ * \brief Ventilation page from suppliers invoices
*/
require '../../main.inc.php';
@@ -53,6 +53,22 @@ $formventilation = new FormVentilation($db);
llxHeader('', $langs->trans("Ventilation"));
+print '';
/*
* Action
*/
@@ -115,8 +131,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
-$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
-$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
+$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
+$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
@@ -150,7 +166,7 @@ if ($result) {
print '' . $langs->trans("Amount") . ' ';
print '' . $langs->trans("Compte") . ' ';
print '' . $langs->trans("IntoAccount") . ' ';
- print '' . $langs->trans("Ventilate") . ' ';
+ print '' . $langs->trans("Ventilate") . ''.$langs->trans('All').' /'.$langs->trans('None').' '.' ';
print "\n";
$facturefourn_static = new FactureFournisseur($db);
@@ -161,6 +177,23 @@ if ($result) {
while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result);
$var = ! $var;
+
+ // product_type: 0 = service ? 1 = product
+ // if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
+ // issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
+ $code_buy_notset = '';
+
+ if (empty($objp->code_buy)) {
+ $code_buy_notset = 'color:red';
+ if ($objp->type == 1) {
+ $objp->code_buy = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
+ } else {
+ $objp->code_buy = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
+ }
+ }else {
+ $code_buy_notset = 'color:blue';
+ }
+
print "";
// Ref facture
@@ -191,7 +224,7 @@ if ($result) {
print price($objp->price);
print '';
- print '';
+ print ' ';
print $objp->code_buy;
print ' ';
@@ -216,4 +249,4 @@ if ($result) {
}
llxFooter();
-$db->close();
+$db->close();
\ No newline at end of file
diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php
index c5fb55cbce5..0fe8b933d1f 100644
--- a/htdocs/admin/menus.php
+++ b/htdocs/admin/menus.php
@@ -65,7 +65,7 @@ error_reporting($err);
if ($action == 'update' && empty($_POST["cancel"]))
{
$_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer
-
+
dolibarr_set_const($db, "MAIN_MENU_STANDARD", $_POST["MAIN_MENU_STANDARD"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", $_POST["MAIN_MENU_SMARTPHONE"],'chaine',0,'',$conf->entity);
@@ -89,11 +89,11 @@ if ($action == 'update' && empty($_POST["cancel"]))
$file='init_menu_'.$key.'.sql';
$fullpath=dol_buildpath($dirmenu.$file);
//print 'action='.$action.' Search menu into fullpath='.$fullpath.' ';exit;
-
+
if (file_exists($fullpath))
{
$db->begin();
-
+
$result=run_sql($fullpath,1,'',1,$key,'none');
if ($result > 0)
{
@@ -152,6 +152,10 @@ $head[$h][2] = 'misc';
$h++;
+print ' ';
print '';
-
- print '';
- print ' ';
- print ' ';
- print ' ';
- print '
';
-
- print '';
}
else
{
@@ -264,7 +256,21 @@ else
print '';
}
-print ' ';
+dol_fiche_end();
+
+
+if ($action == 'edit')
+{
+ print '
';
+ print ' ';
+ print ' ';
+ print ' ';
+ print '
';
+}
+
+print '';
+
+
if ($action != 'edit')
{
diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php
new file mode 100644
index 00000000000..3596fc50d72
--- /dev/null
+++ b/htdocs/admin/supplierinvoicedet_extrafields.php
@@ -0,0 +1,162 @@
+
+ * Copyright (C) 2003 Jean-Louis Bergamo
+ * Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2012 Regis Houssin
+ * Copyright (C) 2012 Florian Henry
+ * Copyright (C) 2013 Philippe Grand
+ * Copyright (C) 2013 Juanjo Menent
+ * Copyright (C) 2015 Claudio Aschieri
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/admin/supplierinvoicedet_extrafields.php
+ * \ingroup fourn
+ * \brief Page to setup extra fields of supplierinvoice line
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+
+
+if (!$user->admin)
+ accessforbidden();
+
+$langs->load("admin");
+$langs->load("other");
+$langs->load("bills");
+$langs->load("orders");
+$langs->load("suppliers");
+
+$extrafields = new ExtraFields($db);
+$form = new Form($db);
+
+// List of supported format
+$tmptype2label=ExtraFields::$type2label;
+$type2label=array('');
+foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
+
+$action=GETPOST('action', 'alpha');
+$attrname=GETPOST('attrname', 'alpha');
+$elementtype='facture_fourn_det'; //Must be the $table_element of the class that manage extrafield
+
+if (!$user->admin) accessforbidden();
+
+
+/*
+ * Actions
+ */
+
+require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
+
+
+
+/*
+ * View
+ */
+
+$textobject=$langs->transnoentitiesnoconv("BillsSuppliers");
+
+llxHeader('',$langs->trans("SuppliersSetup"));
+
+$linkback=''.$langs->trans("BackToModuleList").' ';
+print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
+print " \n";
+
+$head = supplierorder_admin_prepare_head();
+
+dol_fiche_head($head, 'supplierinvoicedet', $langs->trans("Suppliers"), 0, 'company');
+
+
+print $langs->trans("DefineHereComplementaryAttributes",$textobject).' '."\n";
+print ' ';
+
+// Load attribute_label
+$extrafields->fetch_name_optionals_label($elementtype);
+
+print "";
+
+print '';
+print ''.$langs->trans("Label").' ';
+print ''.$langs->trans("AttributeCode").' ';
+print ''.$langs->trans("Type").' ';
+print ''.$langs->trans("Size").' ';
+print ''.$langs->trans("Unique").' ';
+print ''.$langs->trans("Required").' ';
+print ' ';
+print " \n";
+
+$var=True;
+foreach($extrafields->attribute_type as $key => $value)
+{
+ $var=!$var;
+ print "";
+ print "".$extrafields->attribute_label[$key]." \n";
+ print "".$key." \n";
+ print "".$type2label[$extrafields->attribute_type[$key]]." \n";
+ print ''.$extrafields->attribute_size[$key]." \n";
+ print ''.yn($extrafields->attribute_unique[$key])." \n";
+ print ''.yn($extrafields->attribute_required[$key])." \n";
+ print ''.img_edit().' ';
+ print " ".img_delete()." \n";
+ print " ";
+}
+
+print "
";
+
+dol_fiche_end();
+
+
+// Buttons
+if ($action != 'create' && $action != 'edit')
+{
+ print '";
+}
+
+
+/* ************************************************************************** */
+/* */
+/* Creation d'un champ optionnel */
+/* */
+/* ************************************************************************** */
+
+if ($action == 'create')
+{
+ print " ";
+ print_titre($langs->trans('NewAttribute'));
+
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
+}
+
+/* ************************************************************************** */
+/* */
+/* Edition d'un champ optionnel */
+/* */
+/* ************************************************************************** */
+if ($action == 'edit' && ! empty($attrname))
+{
+ print " ";
+ print_titre($langs->trans("FieldEdition", $attrname));
+
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
+}
+
+llxFooter();
+
+$db->close();
diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php
new file mode 100644
index 00000000000..20066aafab1
--- /dev/null
+++ b/htdocs/admin/supplierorderdet_extrafields.php
@@ -0,0 +1,159 @@
+
+ * Copyright (C) 2003 Jean-Louis Bergamo
+ * Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2012 Regis Houssin
+ * Copyright (C) 2012 Florian Henry
+ * Copyright (C) 2013 Philippe Grand
+ * Copyright (C) 2015 Claudio Aschieri
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/admin/supplierorder_extrafields.php
+ * \ingroup fourn
+ * \brief Page to setup extra fields of supplierorder line
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+
+
+if (!$user->admin)
+ accessforbidden();
+
+$langs->load("admin");
+$langs->load("other");
+$langs->load("orders");
+
+$extrafields = new ExtraFields($db);
+$form = new Form($db);
+
+// List of supported format
+$tmptype2label=ExtraFields::$type2label;
+$type2label=array('');
+foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
+
+$action=GETPOST('action', 'alpha');
+$attrname=GETPOST('attrname', 'alpha');
+$elementtype='commande_fournisseurdet'; //Must be the $table_element of the class that manage extrafield
+
+if (!$user->admin) accessforbidden();
+
+
+/*
+ * Actions
+ */
+
+require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
+
+
+
+/*
+ * View
+ */
+
+$textobject=$langs->transnoentitiesnoconv("SuppliersOrders");
+
+llxHeader('',$langs->trans("SuppliersSetup"));
+
+$linkback=''.$langs->trans("BackToModuleList").' ';
+print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
+print " \n";
+
+$head = supplierorder_admin_prepare_head();
+
+dol_fiche_head($head, 'supplierorderdet', $langs->trans("Suppliers"), 0, 'company');
+
+
+print $langs->trans("DefineHereComplementaryAttributes",$textobject).' '."\n";
+print ' ';
+
+// Load attribute_label
+$extrafields->fetch_name_optionals_label($elementtype);
+
+print "";
+
+print '';
+print ''.$langs->trans("Label").' ';
+print ''.$langs->trans("AttributeCode").' ';
+print ''.$langs->trans("Type").' ';
+print ''.$langs->trans("Size").' ';
+print ''.$langs->trans("Unique").' ';
+print ''.$langs->trans("Required").' ';
+print ' ';
+print " \n";
+
+$var=True;
+foreach($extrafields->attribute_type as $key => $value)
+{
+ $var=!$var;
+ print "";
+ print "".$extrafields->attribute_label[$key]." \n";
+ print "".$key." \n";
+ print "".$type2label[$extrafields->attribute_type[$key]]." \n";
+ print ''.$extrafields->attribute_size[$key]." \n";
+ print ''.yn($extrafields->attribute_unique[$key])." \n";
+ print ''.yn($extrafields->attribute_required[$key])." \n";
+ print ''.img_edit().' ';
+ print " ".img_delete()." \n";
+ print " ";
+}
+
+print "
";
+
+dol_fiche_end();
+
+
+// Buttons
+if ($action != 'create' && $action != 'edit')
+{
+ print '";
+}
+
+
+/* ************************************************************************** */
+/* */
+/* Creation d'un champ optionnel */
+/* */
+/* ************************************************************************** */
+
+if ($action == 'create')
+{
+ print " ";
+ print_titre($langs->trans('NewAttribute'));
+
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
+}
+
+/* ************************************************************************** */
+/* */
+/* Edition d'un champ optionnel */
+/* */
+/* ************************************************************************** */
+if ($action == 'edit' && ! empty($attrname))
+{
+ print " ";
+ print_titre($langs->trans("FieldEdition", $attrname));
+
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
+}
+
+llxFooter();
+
+$db->close();
diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest
index e46443bb86b..617d40ed1e3 100644
--- a/htdocs/cache.manifest
+++ b/htdocs/cache.manifest
@@ -14,7 +14,6 @@ support/index.php
support/online.php
support/default.css
-support/dolibarr_logo2.png
support/headbg.jpg
support/helpcenter.png
support/internet.png
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php
index a77751fcb29..61ab169029f 100644
--- a/htdocs/categories/categorie.php
+++ b/htdocs/categories/categorie.php
@@ -289,7 +289,8 @@ if ($socid)
if ($soc->country)
{
print ''.$langs->trans('Country').' ';
- $img=picto_from_langcode($soc->country_code);
+ //$img=picto_from_langcode($soc->country_code);
+ $img='';
print ($img?$img.' ':'');
print $soc->country;
print ' ';
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index faa4109f736..8de7bebcd2b 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -881,15 +881,15 @@ if ($id > 0)
// Date start
print ''.$langs->trans("DateActionStart").' ';
- if (GETPOST("afaire") == 1) $form->select_date($object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
- else if (GETPOST("afaire") == 2) $form->select_date($object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
- else $form->select_date($object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
+ if (GETPOST("afaire") == 1) $form->select_date($datep?$datep:$object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
+ else if (GETPOST("afaire") == 2) $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
+ else $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
print ' ';
// Date end
print ''.$langs->trans("DateActionEnd").' ';
- if (GETPOST("afaire") == 1) $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
- else if (GETPOST("afaire") == 2) $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
- else $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+ if (GETPOST("afaire") == 1) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+ else if (GETPOST("afaire") == 2) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+ else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
print ' ';
// Status
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index a8ed1181bd9..5fa4995a623 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -339,7 +339,7 @@ dol_fiche_end();
$showextcals=$listofextcals;
// Legend
-if ($conf->use_javascript_ajax)
+if (! empty($conf->use_javascript_ajax))
{
$s='';
$s.='' . "\n";
- if (! empty($conf->use_javascript_ajax))
+
+ $s.=' ' . $langs->trans("LocalAgenda").'
';
+ if (is_array($showextcals) && count($showextcals) > 0)
{
- $s.=' ' . $langs->trans("LocalAgenda").'
';
- if (is_array($showextcals) && count($showextcals) > 0)
+ foreach ($showextcals as $val)
{
- foreach ($showextcals as $val)
- {
- $htmlname = dol_string_nospecial($val['name']);
- $s.='' . "\n";
- $s.=' ' . $val ['name'] . '
';
- }
+ $htmlname = dol_string_nospecial($val['name']);
+ $s.='' . "\n";
+ $s.=' ' . $val ['name'] . '
';
}
}
$s.=' '.$langs->trans("AgendaShowBirthdayEvents").'
';
@@ -1092,11 +1090,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
global $theme_datacolor;
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
- print ''."\n";
+ print "\n".'
';
// Line with title of day
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
- print '
';
+ print ''."\n";
+
print '';
print 'trans("NewAction"),'edit_add.png');
print ' ';
}
- print ' ';
+ print ''."\n";
// Line with td contains all div of each events
print '';
@@ -1171,11 +1170,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$numicals[dol_string_nospecial($event->icalname)]++;
}
$color=$event->icalcolor;
- $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable');
+ $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unmovable');
}
else if ($event->type_code == 'BIRTHDAY')
{
- $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
+ $numbirthday++; $colorindex=2; $cssclass='family_birthday unmovable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
}
else
{
@@ -1213,32 +1212,35 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
// Defined style to disable drag and drop feature
- if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
+ if ($event->type_code =='AC_OTH_AUTO')
+ {
+ $cssclass.= " unmovable";
+ }
+ else if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
{
$tmpyearend = date('Y',$event->date_end_in_calendar);
$tmpmonthend = date('m',$event->date_end_in_calendar);
$tmpdayend = date('d',$event->date_end_in_calendar);
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
{
- $cssclass.= " unsortable";
+ $cssclass.= " unmovable";
}
}
- if ($event->type_code =='AC_OTH_AUTO')
- {
- $cssclass.= " unsortable";
- }
+ else $cssclass.= " movable";
$h=''; $nowrapontd=1;
if ($action == 'show_day') { $h='height: 100%; '; $nowrapontd=0; }
if ($action == 'show_week') { $h='height: 100%; '; $nowrapontd=0; }
// Show rect of event
- print '';
- print '
';
+ print ''; // always 1 li per ul, 1 ul per event
+ print '';
print '';
- print ' '."\n";
+
+ print '
'."\n";
}
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index d84e45692f5..dc74935ce98 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -265,7 +265,8 @@ if ($id > 0)
print ''.$langs->trans("Country").' ';
if (! empty($object->country_code))
{
- $img=picto_from_langcode($object->country_code);
+ //$img=picto_from_langcode($object->country_code);
+ $img='';
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country;
}
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 50b3306e3f2..4ce9cfe9621 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -100,6 +100,7 @@ $hookmanager->initHooks(array('propalcard','globalcard'));
$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
+
/*
* Actions
*/
@@ -172,7 +173,10 @@ if (empty($reshook))
}
// Validation
- else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider)
+ else if ($action == 'confirm_validate' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate)))
+ )
{
$result = $object->valid($user);
if ($result >= 0)
@@ -1385,8 +1389,8 @@ if ($action == 'create')
print " ";
// Project
- if (! empty($conf->projet->enabled) && $socid > 0) {
-
+ if (! empty($conf->projet->enabled) && $socid > 0)
+ {
$formproject = new FormProjets($db);
$projectid = 0;
@@ -1394,9 +1398,9 @@ if ($action == 'create')
$projectid = ($originid ? $originid : 0);
print '';
- print '' . $langs->trans("Project") . ' ';
+ print ' ' . $langs->trans("Project") . ' ';
- $numprojet = $formproject->select_projects($soc->id, $projectid);
+ $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
if ($numprojet == 0) {
$langs->load("projects");
print ' ' . $langs->trans("AddProject") . ' ';
@@ -1680,7 +1684,7 @@ if ($action == 'create')
print ' ' . $langs->trans('Company') . ' ' . $soc->getNomUrl(1) . ' ';
print ' ';
- // Ligne info remises tiers
+ // Lin for thirdparty discounts
print '' . $langs->trans('Discounts') . ' ';
if ($soc->remise_percent)
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
@@ -1877,20 +1881,22 @@ if ($action == 'create')
print ' ';
// Project
- if (! empty($conf->projet->enabled)) {
+ if (! empty($conf->projet->enabled))
+ {
$langs->load("projects");
print '';
print '';
print ' ';
if ($action == 'classify') {
- $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid');
+ $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0);
} else {
- $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none');
+ $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0);
}
print ' ';
} else {
@@ -1899,7 +1905,7 @@ if ($action == 'create')
print '';
$proj = new Project($db);
$proj->fetch($object->fk_project);
- print '';
+ print ' ';
print $proj->ref;
print ' ';
print ' ';
@@ -2082,19 +2088,21 @@ if ($action == 'create')
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook
- if (empty($reshook)) {
- if ($action != 'statut' && $action != 'editline') {
+ if (empty($reshook))
+ {
+ if ($action != 'statut' && $action != 'editline')
+ {
// Validate
- if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) {
+ if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate)))
+ ) {
if (count($object->lines) > 0)
print '';
// else print ''.$langs->trans('Validate').' ';
}
// Create event
- if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a
- // "workflow" action so should appears somewhere
- // else on
- // page.
+ if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
{
print '' . $langs->trans("AddAction") . ' ';
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index f18f02b60d8..8fae698ba94 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1334,7 +1334,8 @@ class Propal extends CommonObject
$error=0;
$now=dol_now();
- if ($user->rights->propale->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate)))
{
$this->db->begin();
@@ -1443,7 +1444,7 @@ class Propal extends CommonObject
return -1;
}
- if ($user->rights->propale->creer)
+ if (! empty($user->rights->propal->creer))
{
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'";
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
@@ -1472,7 +1473,7 @@ class Propal extends CommonObject
*/
function set_echeance($user, $date_fin_validite)
{
- if ($user->rights->propale->creer)
+ if (! empty($user->rights->propal->creer))
{
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite!=''?"'".$this->db->idate($date_fin_validite)."'":'null');
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
@@ -1498,7 +1499,7 @@ class Propal extends CommonObject
*/
function set_date_livraison($user, $date_livraison)
{
- if ($user->rights->propale->creer)
+ if (! empty($user->rights->propal->creer))
{
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
$sql.= " SET date_livraison = ".($date_livraison!=''?"'".$this->db->idate($date_livraison)."'":'null');
@@ -1527,7 +1528,7 @@ class Propal extends CommonObject
*/
function set_availability($user, $id)
{
- if ($user->rights->propale->creer)
+ if (! empty($user->rights->propal->creer))
{
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
$sql.= " SET fk_availability = '".$id."'";
@@ -1556,7 +1557,7 @@ class Propal extends CommonObject
*/
function set_demand_reason($user, $id)
{
- if ($user->rights->propale->creer)
+ if (! empty($user->rights->propal->creer))
{
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
$sql.= " SET fk_input_reason = '".$id."'";
@@ -1585,7 +1586,7 @@ class Propal extends CommonObject
*/
function set_ref_client($user, $ref_client)
{
- if ($user->rights->propale->creer)
+ if (! empty($user->rights->propal->creer))
{
dol_syslog('Propale::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
@@ -1620,7 +1621,7 @@ class Propal extends CommonObject
{
$remise=trim($remise)?trim($remise):0;
- if ($user->rights->propale->creer)
+ if (! empty($user->rights->propal->creer))
{
$remise = price2num($remise);
@@ -1653,7 +1654,7 @@ class Propal extends CommonObject
{
$remise=trim($remise)?trim($remise):0;
- if ($user->rights->propale->creer)
+ if (! empty($user->rights->propal->creer))
{
$remise = price2num($remise);
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 3c74cf70789..1177a7d9a37 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -883,7 +883,11 @@ if (empty($reshook))
exit();
}
- else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->commande->valider) {
+ else if ($action == 'confirm_validate' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
+ )
+ {
$idwarehouse = GETPOST('idwarehouse');
$qualified_for_stock_change=0;
@@ -987,7 +991,11 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->commande->valider) {
+ else if ($action == 'confirm_cancel' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
+ )
+ {
$idwarehouse = GETPOST('idwarehouse');
$qualified_for_stock_change=0;
@@ -1413,11 +1421,12 @@ if ($action == 'create' && $user->rights->commande->creer) {
print '';
// Project
- if (! empty($conf->projet->enabled) && $socid > 0) {
+ if (! empty($conf->projet->enabled) && $socid > 0)
+ {
$formproject = new FormProjets($db);
print '' . $langs->trans('Project') . ' ';
- $numprojet = $formproject->select_projects($soc->id, $projectid);
+ $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
if ($numprojet == 0) {
print ' ' . $langs->trans("AddProject") . ' ';
}
@@ -1966,9 +1975,9 @@ if ($action == 'create' && $user->rights->commande->creer) {
print ' ';
// print "$object->id, $object->socid, $object->fk_project";
if ($action == 'classify') {
- $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid');
+ $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0);
} else {
- $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none');
+ $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0);
}
print ' ';
}
@@ -2121,7 +2130,11 @@ if ($action == 'create' && $user->rights->commande->creer) {
// modified by hook
if (empty($reshook)) {
// Valid
- if ($object->statut == 0 && $object->total_ttc >= 0 && $numlines > 0 && $user->rights->commande->valider) {
+ if ($object->statut == 0 && $object->total_ttc >= 0 && $numlines > 0 &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
+ )
+ {
print '';
}
// Edit
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 0f5bc805e32..27c320b3326 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -205,7 +205,8 @@ class Commande extends CommonOrder
return 0;
}
- if (! $user->rights->commande->valider)
+ if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))))
{
$this->error='Permission denied';
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
@@ -361,7 +362,8 @@ class Commande extends CommonOrder
return 0;
}
- if (! $user->rights->commande->valider)
+ if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))))
{
$this->error='Permission denied';
return -1;
@@ -494,7 +496,8 @@ class Commande extends CommonOrder
$error=0;
- if ($user->rights->commande->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
{
$this->db->begin();
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 10686920d39..865d7d95f9f 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -363,7 +363,10 @@ if (empty($reshook))
}
// Classify to validated
- else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->valider)
+ else if ($action == 'confirm_valid' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate)))
+ )
{
$idwarehouse = GETPOST('idwarehouse');
@@ -436,7 +439,10 @@ if (empty($reshook))
}
// Go back to draft status (unvalidate)
- else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate))
+ else if ($action == 'confirm_modif' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate)))
+ )
{
$idwarehouse = GETPOST('idwarehouse');
@@ -2097,7 +2103,7 @@ if ($action == 'create')
print $desc;
print '' . "\n";
}
-
+
// Replacement
print '';
print ' load('projects');
print ' ' . $langs->trans('Project') . ' ';
- $formproject->select_projects($soc->id, $projectid, 'projectid');
+ $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
print ' ';
}
@@ -3233,7 +3239,7 @@ if ($action == 'create')
// Situations
if (! empty($conf->global->INVOICE_US_SITUATION))
{
- if ($object->type == 5 && ($object->situation_counter > 1))
+ if ($object->type == 5 && ($object->situation_counter > 1))
{
$prevsits = $object->get_prev_sits();
print '';
@@ -3277,7 +3283,7 @@ if ($action == 'create')
}
}
}
-
+
// Amount
print ' ' . $langs->trans('AmountHT') . ' ';
print '' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . ' ';
@@ -3346,9 +3352,9 @@ if ($action == 'create')
print '';
if ($action == 'classify') {
- $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'projectid');
+ $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0);
} else {
- $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'none');
+ $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0);
}
print ' ';
print '';
@@ -3436,7 +3442,7 @@ if ($action == 'create')
print '';
}
}
-
+
// Show object lines
if (! empty($object->lines))
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
@@ -3480,7 +3486,9 @@ if ($action == 'create')
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) {
if (! $objectidnext && $object->is_last_in_cycle()) {
- if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate) {
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->invoice_advance->unvalidate)))
+ {
print '';
} else {
print '' . $langs->trans('Modify') . '
';
@@ -3510,7 +3518,9 @@ if ($action == 'create')
// Validate
if ($object->statut == 0 && count($object->lines) > 0 && ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) && (! empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) || ($object->type == Facture::TYPE_CREDIT_NOTE && $object->total_ttc <= 0))) {
- if ($user->rights->facture->valider) {
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate)))
+ {
print '';
}
}
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index d8357b15d14..1fc977ce807 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1691,7 +1691,8 @@ class Facture extends CommonInvoice
return 0;
}
- if (! $user->rights->facture->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate)))
{
$this->error='Permission denied';
dol_syslog(get_class($this)."::validate ".$this->error, LOG_ERR);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index aa1f79cfb11..a8bd15afe89 100755
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3145,10 +3145,11 @@ class Form
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id pre-selected project
* @param string $htmlname Name of select field
- * @param int $discard_closed Hide all closed projects
+ * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
+ * @param int $maxlength Max length
* @return void
*/
- function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0)
+ function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20)
{
global $langs;
@@ -3165,7 +3166,7 @@ class Form
print ' ';
print '';
print '';
- $formproject->select_projects($socid,$selected,$htmlname,20,0,1,$discard_closed);
+ $formproject->select_projects($socid,$selected,$htmlname,$maxlength,0,1,$discard_closed);
print ' ';
print ' ';
print '
';
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index c09b7237496..6fb331670ed 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -43,7 +43,7 @@ class FormProjets
}
/**
- * Show a combo list with projects qualified for a third party
+ * Output a combo list with projects qualified for a third party
*
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id project preselected
@@ -51,10 +51,10 @@ class FormProjets
* @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line
- * @param int $discard_closed Discard closed projects
+ * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @return int Nber of project if OK, <0 if KO
*/
- function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0)
+ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0)
{
global $user,$conf,$langs;
@@ -105,7 +105,7 @@ class FormProjets
}
else
{
- if ($discard_closed && $obj->fk_statut == 2)
+ if ($discard_closed == 1 && $obj->fk_statut == 2)
{
$i++;
continue;
@@ -114,30 +114,31 @@ class FormProjets
$labeltoshow=dol_trunc($obj->ref,18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
+ $labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
+
+ $disabled=0;
+ if ($obj->fk_statut == 0)
+ {
+ $disabled=1;
+ $labeltoshow.=' - '.$langs->trans("Draft");
+ }
+ else if ($obj->fk_statut == 2)
+ {
+ if ($discard_close == 2) $disabled=1;
+ $labeltoshow.=' - '.$langs->trans("Closed");
+ }
+ else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
+ {
+ $disabled=1;
+ $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
+ }
+
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0)
{
- $out.= ''.$labeltoshow.' '.dol_trunc($obj->title,$maxlength).' ';
+ $out.= ''.$labeltoshow.' ';
}
else
{
- $disabled=0;
- $labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
- if ($obj->fk_statut == 0)
- {
- $disabled=1;
- $labeltoshow.=' - '.$langs->trans("Draft");
- }
- else if ($obj->fk_statut == 2)
- {
- $disabled=1;
- $labeltoshow.=' - '.$langs->trans("Closed");
- }
- else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
- {
- $disabled=1;
- $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
- }
-
if ($hideunselectables && $disabled)
{
$resultat='';
@@ -163,6 +164,12 @@ class FormProjets
}
print $out;
+ // Use select2 selector
+ if (! empty($conf->use_javascript_ajax))
+ {
+
+ }
+
$this->db->free($resql);
return $num;
}
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 80e556378c0..72c3214610a 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -114,7 +114,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '';
print $langs->trans("Project").' ';
print ' ';
- $formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 64);
+ $formproject->select_projects($socid?$socid:-1, $pid, 'projectid');
print ' ';
}
diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php
index e4e7b04b057..cf1db634e88 100644
--- a/htdocs/core/lib/fourn.lib.php
+++ b/htdocs/core/lib/fourn.lib.php
@@ -186,10 +186,22 @@ function supplierorder_admin_prepare_head()
$head[$h][2] = 'supplierorder';
$h++;
+ $head[$h][0] = DOL_URL_ROOT.'/admin/supplierorderdet_extrafields.php';
+ $head[$h][1] = $langs->trans("ExtraFieldsLines");
+ $head[$h][2] = 'supplierorderdet';
+ $h++;
+
+
+
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoice_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoices");
$head[$h][2] = 'supplierinvoice';
$h++;
+
+ $head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoicedet_extrafields.php';
+ $head[$h][1] = $langs->trans("ExtraFieldsLines");
+ $head[$h][2] = 'supplierinvoicedet';
+ $h++;
complete_head_from_modules($conf,$langs,null,$head,$h,'supplierorder_admin','remove');
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index f8a43030dbc..278dd99eaad 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -488,13 +488,15 @@ function dolEscapeXML($string)
*
* @param string $stringtoescape String to escape
* @param string $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
+ * @param string $noescapebackslashn 0=Escape also \n. 1=Do not escape \n.
* @return string Escaped string. Both ' and " are escaped into ' if they are escaped.
*/
-function dol_escape_js($stringtoescape, $mode=0)
+function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
{
// escape quotes and backslashes, newlines, etc.
- $substitjs=array("'"=>"\\'",'\\'=>'\\\\',"\r"=>'\\r',"\n"=>'\\n');
+ $substitjs=array("'"=>"\\'","\r"=>'\\r');
//$substitjs['']='<\/'; // We removed this. Should be useless.
+ if (empty($noescapebackslashn)) { $substitjs["\n"]='\\n'; $substitjs['\\']='\\\\'; }
if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; }
else if ($mode == 1) $substitjs["'"]="\\'";
else if ($mode == 2) { $substitjs['"']='\\"'; }
@@ -1119,7 +1121,7 @@ function dol_getdate($timestamp,$fast=false)
* @param int $year Year
* @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ
* @param int $check 0=No check on parameters (Can use day 32, etc...)
- * @return timestamp|string Date as a timestamp, '' if error
+ * @return timestamp|string Date as a timestamp, '' or false if error
* @see dol_print_date, dol_stringtotime, dol_getdate
*/
function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
@@ -3515,7 +3517,7 @@ function get_default_tva($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
// we use the buyer VAT.
if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC))
{
- if (! $seller_in_cee && $buyer_in_cee && ! $thirdparty_buyer->isACompany())
+ if ($seller_in_cee && $buyer_in_cee && ! $thirdparty_buyer->isACompany())
{
//print 'VATRULE 0';
return get_product_vat_for_country($idprod,$thirdparty_buyer,$idprodfournprice);
diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php
index dd08c8b6c79..5ce30be59a0 100644
--- a/htdocs/core/lib/sendings.lib.php
+++ b/htdocs/core/lib/sendings.lib.php
@@ -64,8 +64,12 @@ function shipping_prepare_head($object)
$head[$h][2] = 'contact';
$h++;
+ $nbNote = 0;
+ if (!empty($object->note_private)) $nbNote++;
+ if (!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id;
$head[$h][1] = $langs->trans("Notes");
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.' ';
$head[$h][2] = 'note';
$h++;
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index b5818362591..417e02738b3 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -11,7 +11,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
-insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
+insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->fournisseur->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax|salaries', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read', '', 2, 50, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
@@ -53,8 +53,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 309__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 310__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __ENTITY__);
+-- Home - Module Tools
+-- Added by ???
-- Home - Menu users and groups
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 3, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?leftmenu=users&action=create', 'NewUser', 2, 'users', '$user->rights->user->user->creer || $user->admin', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 403__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/index.php?leftmenu=users', 'Groups', 1, 'users', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin', '', 2, 1, __ENTITY__);
diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index e0f1e1b05d9..cbc73b2767d 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/htdocs/core/menus/standard/auguria.lib.php
@@ -149,7 +149,7 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
if ($showmode == 1)
{
print '';
print '';
print '';
@@ -273,7 +273,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
else dol_print_error($db);
$db->free($resql);
}
-
+
if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account
{
$newmenu->add('/accountancy/journal/index.php?leftmenu=journal',$langs->trans("Journaux"),0,$user->rights->banque->lire);
diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
index 145eeafcdde..fefe2f591fe 100644
--- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
@@ -557,13 +557,18 @@ class pdf_merou extends ModelePdfExpedition
// Date Expedition
$Yoff = $Yoff+7;
- $pdf->SetXY($blSocX-80,$blSocY+20);
+ $pdf->SetXY($blSocX-80,$blSocY+17);
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');
+ $pdf->SetXY($blSocX-80,$blSocY+20);
+ $pdf->SetFont('','B', $default_font_size - 2);
+ $pdf->SetTextColor(0,0,0);
+ $pdf->MultiCell(50, 8, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, '', 'L');
+
// Deliverer
- $pdf->SetXY($blSocX-80,$blSocY+23);
+ $pdf->SetXY($blSocX-80,$blSocY+24);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);
@@ -577,13 +582,8 @@ class pdf_merou extends ModelePdfExpedition
// Get code using getLabelFromKey
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
$label=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
+ $pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
}
- else
- {
- $label=$outputlangs->transnoentities("Deliverer");
- }
-
- $pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
}
}
else
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index ea6601b8396..ef9db41254b 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -191,11 +191,17 @@ class pdf_rouget extends ModelePdfExpedition
$tab_height = 130;
$tab_height_newpage = 150;
- if (! empty($object->note_public) || (! empty($object->tracking_number) && ! empty($object->shipping_method_id)))
+ if (! empty($object->note_public) || ! empty($object->tracking_number))
{
$tab_top = 88;
$tab_top_alt = $tab_top;
+ $pdf->SetFont('','B', $default_font_size - 2);
+ $pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top-1, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, 0, 1, false, true, 'L');
+
+ $tab_top_alt = $pdf->GetY();
+ //$tab_top_alt += 1;
+
// Tracking number
if (! empty($object->tracking_number))
{
@@ -209,14 +215,14 @@ class pdf_rouget extends ModelePdfExpedition
$label=$outputlangs->trans("LinkToTrackYourPackage")." ";
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
$pdf->SetFont('','B', $default_font_size - 2);
- $pdf->writeHTMLCell(60, 7, $this->posxdesc-1, $tab_top-1, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
+ $pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top+6, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
- $tab_top_alt += 7;
+ $tab_top_alt = $pdf->GetY();
}
}
}
- // Affiche notes
+ // Notes
if (! empty($object->note_public))
{
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php
index e074bfe82f1..d683d4bb271 100644
--- a/htdocs/core/modules/modAccounting.class.php
+++ b/htdocs/core/modules/modAccounting.class.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2013-2014 Alexandre Spangaro
+ * Copyright (C) 2013-2015 Alexandre Spangaro
* Copyright (C) 2014 Ari Elbaz (elarifr)
* Copyright (C) 2014 Florian Henry
*
@@ -19,14 +19,14 @@
*/
/**
- * \file accountingex/core/modules/modAccounting.class.php
+ * \file htdocs/core/modules/modAccounting.class.php
* \ingroup Accounting Expert
* \brief Module to activate Accounting Expert module
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
- * \class modAccountingExpert
+ * \class modAccounting
* \brief Description and activation class for module accounting expert
*/
class modAccounting extends DolibarrModules
@@ -68,7 +68,7 @@ class modAccounting extends DolibarrModules
$this->depends = array("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module
- $this->phpmin = array(5, 2); // Minimum version of PHP required by module
+ $this->phpmin = array(5, 3); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3, 6); // Minimum version of Dolibarr required by module
$this->langfiles = array("accountancy");
@@ -87,7 +87,7 @@ class modAccounting extends DolibarrModules
"With this constants on, bank account number is always required"
);
$this->const[1] = array(
- "ACCOUNTING_SEPARATORCSV",
+ "ACCOUNTING_EXPORT_SEPARATORCSV",
"string",
","
);
@@ -112,60 +112,85 @@ class modAccounting extends DolibarrModules
"SOC"
);
$this->const[6] = array(
- "ACCOUNTING_CASH_JOURNAL",
- "chaine",
- "CAI"
- );
- $this->const[7] = array(
"ACCOUNTING_MISCELLANEOUS_JOURNAL",
"chaine",
"OD"
);
- $this->const[8] = array(
- "ACCOUNTING_BANK_JOURNAL",
- "chaine",
- "BQ"
- ); // Deprecated Move into llx_bank_account
- $this->const[9] = array(
+ $this->const[7] = array(
"ACCOUNTING_ACCOUNT_TRANSFER_CASH",
"chaine",
"58"
);
- $this->const[10] = array(
+ $this->const[8] = array(
"CHARTOFACCOUNTS",
"chaine",
"2"
);
- $this->const[11] = array(
- "ACCOUNTING_MODELCSV",
+ $this->const[9] = array(
+ "ACCOUNTING_EXPORT_MODELCSV",
"chaine",
"0"
);
- $this->const[12] = array(
+ $this->const[10] = array(
"ACCOUNTING_LENGTH_GACCOUNT",
"chaine",
""
);
- $this->const[13] = array(
+ $this->const[11] = array(
"ACCOUNTING_LENGTH_AACCOUNT",
"chaine",
""
);
- $this->const[14] = array(
+ $this->const[12] = array(
"ACCOUNTING_LIMIT_LIST_VENTILATION",
"chaine",
"50"
);
- $this->const[15] = array(
+ $this->const[13] = array(
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
"yesno",
"1"
);
- $this->const[16] = array(
+ $this->const[14] = array(
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
"yesno",
"1"
);
+ $this->const[15] = array (
+ "ACCOUNTING_GROUPBYACCOUNT",
+ "yesno",
+ "1"
+ );
+ $this->const[16] = array (
+ "ACCOUNTING_EXPORT_DATE",
+ "chaine",
+ "%d%m%Y"
+ );
+ $this->const[17] = array (
+ "ACCOUNTING_EXPORT_PIECE",
+ "yesno",
+ "1"
+ );
+ $this->const[18] = array (
+ "ACCOUNTING_EXPORT_GLOBAL_ACCOUNT",
+ "yesno",
+ "1"
+ );
+ $this->const[19] = array (
+ "ACCOUNTING_EXPORT_LABEL",
+ "yesno",
+ "1"
+ );
+ $this->const[20] = array (
+ "ACCOUNTING_EXPORT_AMOUNT",
+ "yesno",
+ "1"
+ );
+ $this->const[21] = array (
+ "ACCOUNTING_EXPORT_DEVISE",
+ "yesno",
+ "1"
+ );
// Tabs
$this->tabs = array();
diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php
index 8cec64f2d20..56037c9fb16 100644
--- a/htdocs/core/modules/modAdherent.class.php
+++ b/htdocs/core/modules/modAdherent.class.php
@@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules
$this->family = "hr";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
- $this->description = "Gestion des adhérents d'une association";
+ $this->description = "Management of members of a foundation or association";
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
@@ -137,7 +137,7 @@ class modAdherent extends DolibarrModules
$r++;
$this->rights[$r][0] = 75;
- $this->rights[$r][1] = 'Setup types and attributes of members';
+ $this->rights[$r][1] = 'Setup types of membership';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'configurer';
diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php
index 4a2f0bc20b4..d8cc5647817 100644
--- a/htdocs/core/modules/modCommande.class.php
+++ b/htdocs/core/modules/modCommande.class.php
@@ -128,7 +128,8 @@ class modCommande extends DolibarrModules
$this->rights[$r][1] = 'Valider les commandes clients';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
- $this->rights[$r][4] = 'valider';
+ $this->rights[$r][4] = 'order_advance';
+ $this->rights[$r][5] = 'validate';
$r++;
$this->rights[$r][0] = 86;
diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php
index 20c679556e7..e2c85c60352 100644
--- a/htdocs/core/modules/modExpedition.class.php
+++ b/htdocs/core/modules/modExpedition.class.php
@@ -151,7 +151,8 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Valider les expeditions';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
- $this->rights[$r][4] = 'valider';
+ $this->rights[$r][4] = 'shipping_advance';
+ $this->rights[$r][5] = 'validate';
$r++;
$this->rights[$r][0] = 105; // id de la permission
@@ -197,8 +198,8 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Valider les bons de livraison';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
- $this->rights[$r][4] = 'livraison';
- $this->rights[$r][5] = 'valider';
+ $this->rights[$r][4] = 'livraison_advance';
+ $this->rights[$r][5] = 'validate';
$r++;
$this->rights[$r][0] = 1109;
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index 5bb85dea7db..38a06576c9e 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -137,7 +137,8 @@ class modFacture extends DolibarrModules
$this->rights[$r][1] = 'Valider les factures';
$this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0;
- $this->rights[$r][4] = 'valider';
+ $this->rights[$r][4] = 'invoice_advance';
+ $this->rights[$r][5] = 'validate';
$r++;
$this->rights[$r][0] = 15;
diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php
index 1f1a8072e1e..656ef87c191 100644
--- a/htdocs/core/modules/modFournisseur.class.php
+++ b/htdocs/core/modules/modFournisseur.class.php
@@ -150,8 +150,8 @@ class modFournisseur extends DolibarrModules
$this->rights[$r][1] = 'Valider une commande fournisseur';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
- $this->rights[$r][4] = 'commande';
- $this->rights[$r][5] = 'valider';
+ $this->rights[$r][4] = 'supplier_order_advance';
+ $this->rights[$r][5] = 'validate';
$r++;
$this->rights[$r][0] = 1185;
@@ -206,8 +206,8 @@ class modFournisseur extends DolibarrModules
$this->rights[$r][1] = 'Valider une facture fournisseur';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
- $this->rights[$r][4] = 'facture';
- $this->rights[$r][5] = 'valider';
+ $this->rights[$r][4] = 'supplier_invoice_advance';
+ $this->rights[$r][5] = 'validate';
$r++;
$this->rights[$r][0] = 1234;
diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php
index 2a390118b72..de1566578fe 100644
--- a/htdocs/core/modules/modPropale.class.php
+++ b/htdocs/core/modules/modPropale.class.php
@@ -130,7 +130,8 @@ class modPropale extends DolibarrModules
$this->rights[$r][1] = 'Valider les propositions commerciales'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
- $this->rights[$r][4] = 'valider';
+ $this->rights[$r][4] = 'propal_advance';
+ $this->rights[$r][5] = 'validate';
$r++;
$this->rights[$r][0] = 25; // id de la permission
diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
index c0f89f51efa..7f74ce095c0 100644
--- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
+++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
@@ -28,9 +28,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_order/modules_commandefo
/**
- \class mod_commande_fournisseur_orchidee
- \brief Classe du modele de numerotation de reference de commande fournisseur Orchidee
-*/
+ * Classe du modele de numerotation de reference de commande fournisseur Orchidee
+ */
class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index c93ec795dec..7e7b3cf6e3b 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -256,7 +256,10 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->valider)
+ else if ($action == 'confirm_valid' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
+ )
{
$object->fetch_thirdparty();
@@ -304,7 +307,7 @@ if (empty($reshook))
}
}
- else if ($action == 'reopen' && $user->rights->expedition->valider)
+ else if ($action == 'reopen' && (! empty($user->rights->expedition->creer) || ! empty($user->rights->expedition->shipping_advance->validate)))
{
$result = $object->setStatut(0);
if ($result < 0)
@@ -1354,7 +1357,8 @@ else if ($id || $ref)
if ($object->statut == 0 && $num_prod > 0)
{
- if ($user->rights->expedition->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
{
print 'id.'&action=valid">'.$langs->trans("Validate").' ';
}
@@ -1365,7 +1369,7 @@ else if ($id || $ref)
}
// TODO add alternative status
- /* if ($object->statut == 1 && $user->rights->expedition->valider)
+ /* if ($object->statut == 1 && $user->rights->expedition->creer)
{
print 'id.'&action=reopen">'.$langs->trans("ReOpen").' ';
}*/
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 4dc14ea37b5..67426510da2 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -530,7 +530,8 @@ class Expedition extends CommonObject
return 0;
}
- if (! $user->rights->expedition->valider)
+ if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate))))
{
$this->error='Permission denied';
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
@@ -1524,7 +1525,7 @@ class Expedition extends CommonObject
}
/**
- * Get tracking url status
+ * Forge an set tracking url
*
* @param string $value Value
* @return void
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index 01a341d7ab5..652b09453f7 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -157,6 +157,7 @@ if ($id > 0 || ! empty($ref))
print ' ';
+ $colwidth=20;
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
dol_fiche_end();
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index af379d633e7..3f0636e324a 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -167,7 +167,8 @@ if ($object->id > 0)
// Country
print ''.$langs->trans("Country").' ';
- $img=picto_from_langcode($object->country_code);
+ //$img=picto_from_langcode($object->country_code);
+ $img='';
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country;
print ' ';
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 24aaa1952aa..7f2237859ea 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -334,7 +334,8 @@ class CommandeFournisseur extends CommonOrder
dol_syslog(get_class($this)."::valid");
$result = 0;
- if ($user->rights->fournisseur->commande->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate)))
{
$this->db->begin();
@@ -601,7 +602,6 @@ class CommandeFournisseur extends CommonOrder
else
{
$this->error = $obj->error;
- dol_print_error($db, get_class($this)."::getNextNumRef ".$obj->error);
return -1;
}
}
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 57696363289..a06998eaeed 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -130,13 +130,13 @@ if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer)
}
// mode de reglement
-else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
+if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
{
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
}
// bank account
-else if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer)
+if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer)
{
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
}
@@ -154,17 +154,17 @@ if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->cree
}
// Set project
-else if ($action == 'classin' && $user->rights->fournisseur->commande->creer)
+if ($action == 'classin' && $user->rights->fournisseur->commande->creer)
{
$object->setProject($projectid);
}
-else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer)
+if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer)
{
$result = $object->set_remise($user, $_POST['remise_percent']);
}
-else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
+if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
{
if (in_array($object->statut, array(1, 2, 5, 6, 7, 9)))
{
@@ -191,7 +191,7 @@ else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
/*
* Add a line into product
*/
-else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
+if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
{
$langs->load('errors');
$error = 0;
@@ -402,7 +402,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
/*
* Mise a jour d'une ligne dans la commande
*/
-else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel'))
+if ($action == 'update_line' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel'))
{
if ($_POST["elrowid"])
{
@@ -473,7 +473,7 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer
}
}
-else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
+if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
{
$result = $object->deleteline(GETPOST('lineid'));
@@ -506,7 +506,10 @@ else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->r
}
}
-else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->commande->valider)
+if ($action == 'confirm_valid' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate)))
+ )
{
$object->date_commande=dol_now();
$result = $object->valid($user);
@@ -542,7 +545,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourn
}
}
-else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
+if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
{
$idwarehouse=GETPOST('idwarehouse', 'int');
@@ -593,7 +596,7 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
}
}
-else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
+if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
{
$result = $object->refuse($user);
if ($result > 0)
@@ -607,7 +610,7 @@ else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->four
}
}
-else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
+if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
{
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
if ($result > 0)
@@ -625,7 +628,7 @@ else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fo
}
-else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer)
+if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer)
{
$result=$object->delete($user);
if ($result > 0)
@@ -640,7 +643,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->four
}
// Action clone object
-else if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
+if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
{
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
{
@@ -666,7 +669,7 @@ else if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fourn
}
// Receive
-else if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner)
+if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner)
{
if ($_POST["type"])
@@ -695,7 +698,7 @@ else if ($action == 'livraison' && $user->rights->fournisseur->commande->recepti
}
}
-else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
+if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
{
$result = $object->cancel($user);
if ($result > 0)
@@ -710,7 +713,7 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->four
}
// Line ordering
-else if ($action == 'up' && $user->rights->fournisseur->commande->creer)
+if ($action == 'up' && $user->rights->fournisseur->commande->creer)
{
$object->line_up($_GET['rowid']);
@@ -726,7 +729,7 @@ else if ($action == 'up' && $user->rights->fournisseur->commande->creer)
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
exit;
}
-else if ($action == 'down' && $user->rights->fournisseur->commande->creer)
+if ($action == 'down' && $user->rights->fournisseur->commande->creer)
{
$object->line_down($_GET['rowid']);
@@ -743,7 +746,7 @@ else if ($action == 'down' && $user->rights->fournisseur->commande->creer)
exit;
}
-else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) // En get ou en post
+if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) // En get ou en post
{
// Build document
@@ -765,7 +768,7 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) /
}
// Delete file in doc form
-else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisseur->commande->creer)
+if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisseur->commande->creer)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("other");
@@ -776,7 +779,7 @@ else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisse
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
}
-elseif ($action == 'update_extras')
+if ($action == 'update_extras')
{
// Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
@@ -818,7 +821,7 @@ elseif ($action == 'update_extras')
/*
* Create an order
*/
-else if ($action == 'add' && $user->rights->fournisseur->commande->creer)
+if ($action == 'add' && $user->rights->fournisseur->commande->creer)
{
$error=0;
@@ -1280,7 +1283,7 @@ if ($action=="create")
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
print '';
}
-
+
print ''.$langs->trans('NotePublic').' ';
print '';
$doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
@@ -1364,17 +1367,24 @@ elseif (! empty($object->id))
if (preg_match('/^[\(]?PROV/i',$object->ref)) $newref = $object->getNextNumRef($object->thirdparty);
else $newref = $object->ref;
- $text=$langs->trans('ConfirmValidateOrder',$newref);
- if (! empty($conf->notification->enabled))
+ if ($newref < 0)
{
- require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
- $notify=new Notify($db);
- $text.=' ';
- $text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
+ setEventMessages($object->error, $object->errors, 'errors');
+ $action='';
}
+ else
+ {
+ $text=$langs->trans('ConfirmValidateOrder',$newref);
+ if (! empty($conf->notification->enabled))
+ {
+ require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
+ $notify=new Notify($db);
+ $text.=' ';
+ $text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
+ }
- print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
-
+ print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
+ }
}
/*
@@ -1566,7 +1576,7 @@ elseif (! empty($object->id))
print ' ';
print ' ';
}
-
+
// Delivery date planed
print '';
print '';
@@ -1605,11 +1615,11 @@ elseif (! empty($object->id))
//print "$object->id, $object->socid, $object->fk_project";
if ($action == 'classify')
{
- $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid');
+ $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid', 0, 0);
}
else
{
- $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none');
+ $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0);
}
print ' ';
print ' ';
@@ -1993,7 +2003,7 @@ elseif (! empty($object->id))
$ws_key = $object->thirdparty->webservices_key;
$ws_user = GETPOST('ws_user','alpha');
$ws_password = GETPOST('ws_password','alpha');
-
+
// NS and Authentication parameters
$ws_ns = 'http://www.dolibarr.org/ns/';
$ws_authentication = array(
@@ -2012,11 +2022,11 @@ elseif (! empty($object->id))
$mode = "init";
$error_occurred = true; //Don't allow to set the user/pass if thirdparty fields are not filled
} else if ($mode != "init" && (empty($ws_user) || empty($ws_password))) {
- setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors');
+ setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors');
$mode = "init";
}
- if ($mode == "init")
+ if ($mode == "init")
{
//Table/form header
print '';
@@ -2124,7 +2134,7 @@ elseif (! empty($object->id))
}
}
-
+
// Ensure that price is equal and warn user if it's not
$supplier_price = price($result_product["product"]["price_net"]); //Price of client tab in supplier dolibarr
$local_price = NULL; //Price of supplier as stated in product suppliers tab on this dolibarr, NULL if not found
@@ -2212,7 +2222,8 @@ elseif (! empty($object->id))
// Validate
if ($object->statut == 0 && $num > 0)
{
- if ($user->rights->fournisseur->commande->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate)))
{
print 'id.'&action=valid"';
print '>'.$langs->trans('Validate').' ';
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 05e8590628f..fafadfafd82 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -120,7 +120,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
// }
}
-elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->facture->valider)
+elseif ($action == 'confirm_valid' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
+)
{
$idwarehouse=GETPOST('idwarehouse');
@@ -300,13 +303,13 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
$_GET['socid']=$_POST['socid'];
$error++;
}
-
+
// Fill array 'array_options' with data from add form
-
+
if (! $error)
{
$db->begin();
-
+
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) $error ++;
@@ -1183,7 +1186,7 @@ if ($action == 'create')
{
$facturestatic = new FactureFournisseur($db);
$extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element);
-
+
print_fiche_titre($langs->trans('NewBill'));
dol_htmloutput_events();
@@ -1393,12 +1396,13 @@ if ($action == 'create')
print '';
// Project
- if (! empty($conf->projet->enabled)) {
+ if (! empty($conf->projet->enabled))
+ {
$formproject = new FormProjets($db);
$langs->load('projects');
print '' . $langs->trans('Project') . ' ';
- $formproject->select_projects($soc->id, $projectid, 'projectid');
+ $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1'), $projectid, 'projectid', 0);
print ' ';
}
@@ -1424,7 +1428,7 @@ if ($action == 'create')
print '';
// print ' ';
print '';
-
+
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields, 'edit');
@@ -1540,7 +1544,7 @@ else
$societe = new Fournisseur($db);
$result=$societe->fetch($object->socid);
if ($result < 0) dol_print_error($db);
-
+
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@@ -1937,11 +1941,11 @@ else
print '';
if ($action == 'classify')
{
- $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid');
+ $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid', 0, 0);
}
else
{
- $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none');
+ $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0);
}
print ' ';
print '';
@@ -2255,7 +2259,8 @@ else
{
if (count($object->lines))
{
- if ($user->rights->fournisseur->facture->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
{
print 'id.'&action=valid"';
print '>'.$langs->trans('Validate').' ';
diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php
index 179e810d182..de070a2b3b0 100644
--- a/htdocs/fourn/paiement/card.php
+++ b/htdocs/fourn/paiement/card.php
@@ -83,7 +83,10 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse
}
}
-if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisseur->facture->valider)
+if ($action == 'confirm_valide' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
+)
{
$db->begin();
@@ -312,7 +315,8 @@ if ($result > 0)
{
if ($user->societe_id == 0 && $object->statut == 0 && $action == '')
{
- if ($user->rights->fournisseur->facture->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
{
print ''.$langs->trans('Valid').' ';
diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index f7f5ae4b960..4d10087e26f 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2014 Laurent Destailleur
+ * Copyright (C) 2004-2015 Laurent Destailleur
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2013-2014 Juanjo Menent
@@ -454,7 +454,7 @@ else
if ($allowupgrade)
{
// If it's not last updagre script, action = upgrade_tmp, if last action = upgrade
- $choice .= ''.$langs->trans("Start").' ';
+ $choice .= ''.$langs->trans("Start").' ';
}
else
{
@@ -523,6 +523,10 @@ $("div#AShowChoices a").click(function() {
});
+$(".runupgrade").click(function() {
+ return confirm("'.dol_escape_js($langs->transnoentitiesnoconv("WarningUpgrade"), 0, 1).'");
+});
+
';
pFooter(true); // Never display next button
diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
index 7dbdb7eb7dc..1b99d993ac3 100755
--- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
@@ -106,15 +106,20 @@ UPDATE llx_const SET name = 'ACCOUNTING_VAT_ACCOUNT' WHERE name = 'COMPTA_VAT_AC
UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT';
-- Compatibility with module Accounting Expert
-UPDATE llx_const SET name = 'ACCOUNTING_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV';
+UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV';
+UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV';
+UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DATE' WHERE name = 'ACCOUNTINGEX_EXP_DATE';
+UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_PIECE' WHERE name = 'ACCOUNTINGEX_EXP_PIECE';
+UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT' WHERE name = 'ACCOUNTINGEX_EXP_GLOBAL_ACCOUNT';
+UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_LABEL' WHERE name = 'ACCOUNTINGEX_EXP_LABEL';
+UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_AMOUNT' WHERE name = 'ACCOUNTINGEX_EXP_AMOUNT';
+UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DEVISE' WHERE name = 'ACCOUNTINGEX_EXP_DEVISE';
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUSPENSE' WHERE name = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE';
UPDATE llx_const SET name = 'ACCOUNTING_SELL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SELL_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_PURCHASE_JOURNAL' WHERE name = 'ACCOUNTINGEX_PURCHASE_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_SOCIAL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SOCIAL_JOURNAL';
-UPDATE llx_const SET name = 'ACCOUNTING_CASH_JOURNAL' WHERE name = 'ACCOUNTINGEX_CASH_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_MISCELLANEOUS_JOURNAL' WHERE name = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' WHERE name = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH';
-UPDATE llx_const SET name = 'ACCOUNTING_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV';
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_GACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_GACCOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_AACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_AACCOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_LIMIT_LIST_VENTILATION' WHERE name = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION';
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.key.sql
new file mode 100644
index 00000000000..81e177d4aa3
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.key.sql
@@ -0,0 +1,19 @@
+-- ============================================================================
+-- Copyright (C) 2015 Claudio Aschieri
+--
+-- 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 .
+--
+-- ============================================================================
+
+ALTER TABLE llx_commande_fournisseurdet_extrafields ADD INDEX idx_commande_fournisseurdet_extrafields (fk_object);
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.sql b/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.sql
new file mode 100644
index 00000000000..c1ef550b761
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.sql
@@ -0,0 +1,30 @@
+-- ===================================================================
+-- Copyright (C) 2004 Rodolphe Quiedeville
+-- Copyright (C) 2005-2012 Regis Houssin
+-- Copyright (C) 2007 Laurent Destailleur
+-- Copyright (C) 2010 Juanjo Menent
+-- Copyright (C) 2013 Florian HENRY
+-- Copyright (C) 2015 Claudio Aschieri
+--
+-- 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 .
+--
+-- ===================================================================
+
+create table llx_commande_fournisseurdet_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14)
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.key.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.key.sql
new file mode 100644
index 00000000000..2ba04f4b256
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.key.sql
@@ -0,0 +1,20 @@
+-- ===================================================================
+-- Copyright (C) 2015 Claudio Aschieri
+--
+-- 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 .
+--
+-- ===================================================================
+
+
+ALTER TABLE llx_facture_fourn_det_extrafields ADD INDEX idx_facture_fourn_det_extrafields (fk_object);
diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.sql
new file mode 100644
index 00000000000..4faca1a4865
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.sql
@@ -0,0 +1,26 @@
+-- ========================================================================
+-- Copyright (C) 2015 Claudio Aschieri
+--
+-- 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 .
+--
+-- ========================================================================
+
+create table llx_facture_fourn_det_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index bca163db8bd..0c1bf74a146 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -574,7 +574,7 @@ Permission67=Export interventions
Permission71=Read members
Permission72=Create/modify members
Permission74=Delete members
-Permission75=Setup types and attributes for members
+Permission75=Setup types of membership
Permission76=Export datas
Permission78=Read subscriptions
Permission79=Create/modify subscriptions
@@ -597,8 +597,8 @@ Permission106=Export sendings
Permission109=Delete sendings
Permission111=Read financial accounts
Permission112=Create/modify/delete and compare transactions
-Permission113=Setup financiel accounts (create, manage categories)
-Permission114=Consolidate transactions
+Permission113=Setup financial accounts (create, manage categories)
+Permission114=Reconciliate transactions
Permission115=Export transactions and account statements
Permission116=Transfers between accounts
Permission117=Manage cheques dispatching
@@ -1059,7 +1059,7 @@ BrowserIsOK=You are using the web browser %s. This browser is ok for security an
BrowserIsKO=You are using the web browser %s. This browser is known to be a bad choice for security, performance and reliability. We recommand you to use Firefox, Chrome, Opera or Safari.
XDebugInstalled=XDebug is loaded.
XCacheInstalled=XCache is loaded.
-AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink
+AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink. Third parties will appears with name "CC12345 - SC45678 - The big company coorp", instead of "The big company coorp".
FieldEdition=Edition of field %s
FixTZ=TimeZone fix
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)
@@ -1405,9 +1405,9 @@ FixedEmailTarget=Fixed email target
SendingsSetup=Sending module setup
SendingsReceiptModel=Sending receipt model
SendingsNumberingModules=Sendings numbering modules
-SendingsAbility=Support sendings sheets for customer deliveries
+SendingsAbility=Support shipment sheets for customer deliveries
NoNeedForDeliveryReceipts=In most cases, sendings receipts are used both as sheets for customer deliveries (list of products to send) and sheets that is recevied and signed by customer. So product deliveries receipts is a duplicated feature and is rarely activated.
-FreeLegalTextOnShippings=Free text on shippings
+FreeLegalTextOnShippings=Free text on shipments
##### Deliveries #####
DeliveryOrderNumberingModules=Products deliveries receipt numbering module
DeliveryOrderModel=Products deliveries receipt model
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 9ed2d79edd2..cd6d6fbf033 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -58,8 +58,8 @@ OrderSentByEMail=Customer order %s sent by EMail
InvoiceSentByEMail=Customer invoice %s sent by EMail
SupplierOrderSentByEMail=Supplier order %s sent by EMail
SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail
-ShippingSentByEMail=Shipping %s sent by EMail
-ShippingValidated= Shipping %s validated
+ShippingSentByEMail=Shipment %s sent by EMail
+ShippingValidated= Shipment %s validated
NewCompanyToDolibarr= Third party created
DateActionPlannedStart= Planned start date
DateActionPlannedEnd= Planned end date
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index ccf994aff95..98db518496c 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -1,16 +1,16 @@
# Dolibarr language file - Source file is en_US - bills
Bill=Invoice
Bills=Invoices
-BillsCustomers=Customer's invoices
-BillsCustomer=Customer's invoice
-BillsSuppliers=Supplier's invoices
-BillsCustomersUnpaid=Unpaid customer's invoices
+BillsCustomers=Customers invoices
+BillsCustomer=Customers invoice
+BillsSuppliers=Suppliers invoices
+BillsCustomersUnpaid=Unpaid customers invoices
BillsCustomersUnpaidForCompany=Unpaid customer's invoices for %s
BillsSuppliersUnpaid=Unpaid supplier's invoices
BillsSuppliersUnpaidForCompany=Unpaid supplier's invoices for %s
BillsLate=Late payments
-BillsStatistics=Customer's invoices statistics
-BillsStatisticsSuppliers=Supplier's invoices statistics
+BillsStatistics=Customers invoices statistics
+BillsStatisticsSuppliers=Suppliers invoices statistics
DisabledBecauseNotErasable=Disabled because can not be erased
InvoiceStandard=Standard invoice
InvoiceStandardAsk=Standard invoice
diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang
index c296bd788e8..ef5b7e20ca6 100644
--- a/htdocs/langs/en_US/install.lang
+++ b/htdocs/langs/en_US/install.lang
@@ -155,6 +155,7 @@ MigrationFinished=Migration finished
LastStepDesc=Last step : Define here login and password you plan to use to connect to software. Do not loose this as it is the account to administer all others.
ActivateModule=Activate module %s
ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode)
+WarningUpgrade=Warning:\nDid your run a database backup first ?\nThis is highly recommanded: for example, due to some bugs into databases systems (for example mysql version 5.5.40), some data or tables may be lost during this process, so it is highly recommanded to have a complete dump of your database before starting migration.\n\nClick OK to start migration process...
#########
# upgrade
diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang
index 3eab6893735..4127de804c6 100644
--- a/htdocs/langs/en_US/orders.lang
+++ b/htdocs/langs/en_US/orders.lang
@@ -16,13 +16,13 @@ SupplierOrder=Supplier order
SuppliersOrders=Suppliers orders
SuppliersOrdersRunning=Current suppliers orders
CustomerOrder=Customer order
-CustomersOrders=Customer's orders
+CustomersOrders=Customers orders
CustomersOrdersRunning=Current customer's orders
CustomersOrdersAndOrdersLines=Customer orders and order's lines
-OrdersToValid=Customer's orders to validate
-OrdersToBill=Customer's orders delivered
-OrdersInProcess=Customer's orders in process
-OrdersToProcess=Customer's orders to process
+OrdersToValid=Customers orders to validate
+OrdersToBill=Customers orders delivered
+OrdersInProcess=Customers orders in process
+OrdersToProcess=Customers orders to process
SuppliersOrdersToProcess=Supplier's orders to process
StatusOrderCanceledShort=Canceled
StatusOrderDraftShort=Draft
diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang
index f39fcc06574..61a216fe5b0 100644
--- a/htdocs/langs/en_US/sendings.lang
+++ b/htdocs/langs/en_US/sendings.lang
@@ -5,7 +5,7 @@ Sendings=Shipments
Shipment=Shipment
Shipments=Shipments
ShowSending=Show Sending
-Receivings=Receivings
+Receivings=Receipts
SendingsArea=Shipments area
ListOfSendings=List of shipments
SendingMethod=Shipping method
@@ -15,7 +15,7 @@ SearchASending=Search for shipment
StatisticsOfSendings=Statistics for shipments
NbOfSendings=Number of shipments
NumberOfShipmentsByMonth=Number of shipments by month
-SendingCard=Shipping card
+SendingCard=Shipment card
NewSending=New shipment
CreateASending=Create a shipment
CreateSending=Create shipment
@@ -38,7 +38,7 @@ StatusSendingCanceledShort=Canceled
StatusSendingDraftShort=Draft
StatusSendingValidatedShort=Validated
StatusSendingProcessedShort=Processed
-SendingSheet=Sending sheet
+SendingSheet=Shipment sheet
Carriers=Carriers
Carrier=Carrier
CarriersArea=Carriers area
@@ -59,7 +59,7 @@ SendShippingRef=Submission of shipment %s
ActionsOnShipping=Events on shipment
LinkToTrackYourPackage=Link to track your package
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
-RelatedShippings=Related shippings
+RelatedShippings=Related shipments
ShipmentLine=Shipment line
CarrierList=List of transporters
SendingRunning=Product from customer order already sent
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index 492cbbd7464..d77c65a9a13 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -116,7 +116,7 @@ MassMovement=Mass movement
MassStockMovement=Mass stock movement
SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s".
RecordMovement=Record transfert
-ReceivingForSameOrder=Receivings for this order
+ReceivingForSameOrder=Receipts for this order
StockMovementRecorded=Stock movements recorded
RuleForStockAvailability=Rules on stock requirements
StockMustBeEnoughForInvoice=Stock level must be enough to add product/service into invoice
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index 1a89a377fef..4ab76afe239 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -119,7 +119,10 @@ if ($action == 'add')
}
}
-else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->livraison->valider)
+else if ($action == 'confirm_valid' && $confirm == 'yes' &&
+ ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison_advance->validate)))
+)
{
$result = $object->valid($user);
diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php
index ccde9484b0d..e12781d5228 100644
--- a/htdocs/livraison/class/livraison.class.php
+++ b/htdocs/livraison/class/livraison.class.php
@@ -341,7 +341,8 @@ class Livraison extends CommonObject
$error = 0;
- if ($user->rights->expedition->livraison->valider)
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison_advance->validate)))
{
if (! empty($conf->global->LIVRAISON_ADDON_NUMBER))
{
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 435fca794de..7d900480bea 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -441,7 +441,16 @@ if ($id > 0 || $ref)
// Real stock
$product->load_stock();
- print ''.$langs->trans("PhysicalStock").' ';
+ $text_stock_options = '';
+ $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").' ':'');
+ $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").' ':'');
+ $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").' ':'');
+ $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").' ':'');
+ $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").' ':'');
+ $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").' ':'');
+ print '';
+ print $form->textwithtooltip($langs->trans("PhysicalStock"),$text_stock_options,2,1,img_picto('', 'info'),'',0);
+ print ' ';
print ''.$product->stock_reel;
if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit"));
print ' ';
@@ -457,14 +466,7 @@ if ($id > 0 || $ref)
print ' ';
print '';
- $text_stock_options = '';
- $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").' ':'');
- $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").' ':'');
- $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").' ':'');
- $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").' ':'');
- $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").' ':'');
- $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").' ':'');
- print $form->textwithtooltip($langs->trans("StockDiffPhysicTeoric"),$text_stock_options,2,1,img_picto('', 'info'),'',0);;
+ print $langs->trans("StockDiffPhysicTeoric");
print ' ';
print '';
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 9b5f70e4dce..5887bb6f1d8 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -398,6 +398,8 @@ if ($action == 'create' && $user->rights->projet->creer)
print ' ';
print ' ';
+ print dol_fiche_head();
+
print '';
- print '';
+ dol_fiche_end();
+
+ print '
';
print '
';
if (! empty($backtopage))
{
@@ -503,9 +507,6 @@ else
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
- $head=project_prepare_head($object);
- dol_fiche_head($head, 'project', $langs->trans("Project"),0,($object->public?'projectpub':'project'));
-
// Confirmation validation
if ($action == 'validate')
{
@@ -548,14 +549,20 @@ else
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240);
}
+
+
+ print '
';
}
else
{
@@ -679,6 +680,17 @@ else
dol_fiche_end();
+ if ($action == 'edit' && $userWrite > 0)
+ {
+ print '
';
+ print ' ';
+ print ' ';
+ print '
';
+ }
+
+ print '';
+
+
/*
* Boutons actions
*/
@@ -691,11 +703,11 @@ else
{
if ($userWrite > 0)
{
- print '
'.$langs->trans("Valid").' ';
+ print '
'.$langs->trans("Validate").' ';
}
else
{
- print '
'.$langs->trans('Valid').' ';
+ print '
'.$langs->trans('Validate').' ';
}
}
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index ac96ae6a75e..2e447e15568 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -47,6 +47,7 @@ if (! empty($conf->facture->enabled)) $langs->load("bills");
if (! empty($conf->commande->enabled)) $langs->load("orders");
if (! empty($conf->propal->enabled)) $langs->load("propal");
if (! empty($conf->ficheinter->enabled)) $langs->load("interventions");
+if (! empty($conf->deplacement->enabled)) $langs->load("trips");
$projectid=GETPOST('id','int');
$ref=GETPOST('ref','alpha');
@@ -164,21 +165,21 @@ dol_fiche_end();
$listofreferent=array(
'propal'=>array(
- 'name'=>"Proposalq",
+ 'name'=>"Proposals",
'title'=>"ListProposalsAssociatedProject",
'class'=>'Propal',
'table'=>'propal',
'datefieldname'=>'datep',
'test'=>$conf->propal->enabled && $user->rights->propale->lire),
'order'=>array(
- 'name'=>"CustomerOrderq",
+ 'name'=>"CustomersOrders",
'title'=>"ListOrdersAssociatedProject",
'class'=>'Commande',
'table'=>'commande',
'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire),
'invoice'=>array(
- 'name'=>"CustomerInvoiceq",
+ 'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject",
'class'=>'Facture',
'margin'=>'add',
@@ -193,7 +194,7 @@ $listofreferent=array(
'datefieldname'=>'datec',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'order_supplier'=>array(
- 'name'=>"SuplierOrders",
+ 'name'=>"SuppliersOrders",
'title'=>"ListSupplierOrdersAssociatedProject",
'class'=>'CommandeFournisseur',
'table'=>'commande_fournisseur',
@@ -223,7 +224,7 @@ $listofreferent=array(
'disableamount'=>1,
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
'trip'=>array(
- 'name'=>"TripAndExpenses",
+ 'name'=>"TripsAndExpenses",
'title'=>"ListTripAssociatedProject",
'class'=>'Deplacement',
'table'=>'deplacement',
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index 84a593d759a..8fec81c686c 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -395,6 +395,7 @@ print '
'.$langs->trans("Status").' ';
print '
'.$langs->trans("ShortInfo").' ';
print "
\n";
+$var=true;
foreach ($dirsociete as $dirroot)
{
$dir = dol_buildpath($dirroot,0);
@@ -488,6 +489,7 @@ print ''.$langs->trans("ShortInfo").' ';
print ''.$langs->trans("Preview").' ';
print "\n";
+$var=true;
foreach ($dirsociete as $dirroot)
{
$dir = dol_buildpath($dirroot.'doc/',0);
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index a6ba3d7b1cf..19d943798ce 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -121,7 +121,8 @@ if ($socid)
// Country
if ($object->country) {
print ''.$langs->trans('Country').' ';
- $img=picto_from_langcode($object->country_code);
+ //$img=picto_from_langcode($object->country_code);
+ $img='';
print ($img?$img.' ':'');
print $object->country;
print ' ';
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 35450a206ef..11ae1363ed6 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2671,7 +2671,7 @@ class Societe extends CommonObject
{
global $conf;
- // Define if third party is treated as company of not when nature is unknown
+ // Define if third party is treated as company (or not) when nature is unknown
$isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default
if (! empty($this->tva_intra)) $isacompany=1;
else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0;
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index a6d492aa9c4..e83964949b6 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -428,6 +428,9 @@ th .button {
background-color: #777;
border-radius: 10px;
}
+.movable {
+ cursor: move;
+}
.borderrightlight
{
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 70349b1db83..4a9e1f8514a 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -639,10 +639,8 @@ class User extends CommonObject
}
// For backward compatibility
- if (isset($this->rights->propale))
- {
- $this->rights->propal = $this->rights->propale;
- }
+ if (isset($this->rights->propale) && ! isset($this->rights->propal)) $this->rights->propal = $this->rights->propale;
+ if (isset($this->rights->propal) && ! isset($this->rights->propale)) $this->rights->propale = $this->rights->propal;
if (! $moduletag)
{
diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php
index 6036909cd23..9ce5d33f4a6 100755
--- a/test/phpunit/FunctionsLibTest.php
+++ b/test/phpunit/FunctionsLibTest.php
@@ -646,6 +646,7 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
$this->savlangs=$langs;
$this->savdb=$db;
+ // Sellers
$companyfrnovat=new Societe($db);
$companyfrnovat->country_code='FR';
$companyfrnovat->tva_assuj=0;
@@ -653,53 +654,88 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
$companyfr=new Societe($db);
$companyfr->country_code='FR';
$companyfr->tva_assuj=1;
+ $companyfr->tva_intra='FR9999';
+ // Buyers
$companymc=new Societe($db);
$companymc->country_code='MC';
$companymc->tva_assuj=1;
+ $companyfr->tva_intra='MC9999';
$companyit=new Societe($db);
$companyit->country_code='IT';
$companyit->tva_assuj=1;
$companyit->tva_intra='IT99999';
- $notcompanyit=new Societe($db);
- $notcompanyit->country_code='IT';
- $notcompanyit->tva_assuj=1;
- $notcompanyit->tva_intra='';
- $notcompanyit->typent_code='TE_PRIVATE';
+ $companyde=new Societe($db);
+ $companyde->country_code='DE';
+ $companyde->tva_assuj=1;
+ $companyde->tva_intra='DE99999';
+
+ $notcompanyde=new Societe($db);
+ $notcompanyde->country_code='DE';
+ $notcompanyde->tva_assuj=0;
+ $notcompanyde->tva_intra='';
+ $notcompanyde->typent_code='TE_PRIVATE';
$companyus=new Societe($db);
$companyus->country_code='US';
$companyus->tva_assuj=1;
$companyus->tva_intra='';
- // Test RULE 0 (FR-IT)
+
+ // Test RULE 0 (FR-DE)
// Not tested
// Test RULE 1
$vat=get_default_tva($companyfrnovat,$companymc,0);
- $this->assertEquals(0,$vat);
+ $this->assertEquals(0,$vat,'RULE 1');
// Test RULE 2 (FR-FR)
$vat=get_default_tva($companyfr,$companyfr,0);
- $this->assertEquals(20,$vat);
+ $this->assertEquals(20,$vat,'RULE 2');
// Test RULE 2 (FR-MC)
$vat=get_default_tva($companyfr,$companymc,0);
- $this->assertEquals(20,$vat);
+ $this->assertEquals(20,$vat,'RULE 2');
- // Test RULE 3 (FR-IT)
+ // Test RULE 3 (FR-DE company)
$vat=get_default_tva($companyfr,$companyit,0);
- $this->assertEquals(0,$vat);
+ $this->assertEquals(0,$vat,'RULE 3');
- // Test RULE 4 (FR-IT)
- $vat=get_default_tva($companyfr,$notcompanyit,0);
- $this->assertEquals(20,$vat);
+ // Test RULE 4 (FR-DE not a company)
+ $vat=get_default_tva($companyfr,$notcompanyde,0);
+ $this->assertEquals(20,$vat,'RULE 4');
// Test RULE 5 (FR-US)
$vat=get_default_tva($companyfr,$companyus,0);
- $this->assertEquals(0,$vat);
+ $this->assertEquals(0,$vat,'RULE 5');
+
+
+ // We do same tests but with option SERVICE_ARE_ECOMMERCE_200238EC on.
+ $conf->global->SERVICE_ARE_ECOMMERCE_200238EC = 1;
+
+
+ // Test RULE 1 (FR-US)
+ $vat=get_default_tva($companyfr,$companyus,0);
+ $this->assertEquals(0,$vat,'RULE 1 ECOMMERCE_200238EC');
+
+ // Test RULE 2 (FR-FR)
+ $vat=get_default_tva($companyfr,$companyfr,0);
+ $this->assertEquals(20,$vat,'RULE 2 ECOMMERCE_200238EC');
+
+ // Test RULE 3 (FR-DE company)
+ $vat=get_default_tva($companyfr,$companyde,0);
+ $this->assertEquals(0,$vat,'RULE 3 ECOMMERCE_200238EC');
+
+ // Test RULE 4 (FR-DE not a company)
+ $vat=get_default_tva($companyfr,$notcompanyde,0);
+ $this->assertEquals(19,$vat,'RULE 4 ECOMMERCE_200238EC');
+
+ // Test RULE 5 (FR-US)
+ $vat=get_default_tva($companyfr,$companyus,0);
+ $this->assertEquals(0,$vat,'RULE 5 ECOMMERCE_200238EC');
+
}
/**
@@ -836,7 +872,7 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
$this->assertEquals(1000, price2num('1 000.0'));
$this->assertEquals(1000, price2num('1 000','MT'));
$this->assertEquals(1000, price2num('1 000','MU'));
-
+
$this->assertEquals(1000.123456, price2num('1 000.123456'));
// Round down
@@ -850,8 +886,8 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
// Text can't be converted
$this->assertEquals('12.4$',price2num('12.4$'));
$this->assertEquals('12r.4$',price2num('12r.4$'));
-
- return true;
+
+ return true;
}
}