diff --git a/ChangeLog b/ChangeLog
index 0978f65863b..442d632d6da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,6 +43,7 @@ Fix: [ bug #1280 ] service with not end of date was tagged as expired.
Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference
Fix: [ bug #1306 ] Fatal error when adding an external calendar
New: Added es_CL language
+Fix: Margin tabs bad data show
***** ChangeLog for 3.5 compared to 3.4.* *****
For users:
diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index 2d22e77619d..d67b810e536 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -538,7 +538,7 @@ if ($action == 'create')
// Busy
print '
'.$langs->trans("Busy").' ';
- print ' ';
+ print ' transparency?' checked="checked"':'').'>';
print ' ';
// Realised by
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index f3b4f5e1d5e..2727bca7164 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -19,9 +19,6 @@
* along with this program. If not, see .
*/
-error_reporting(E_ALL);
-ini_set('display_errors', true);
-ini_set('html_errors', false);
/**
* \file htdocs/comm/action/index.php
diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php
index d85d6ff3b27..2cdda511bdb 100644
--- a/htdocs/compta/bank/account.php
+++ b/htdocs/compta/bank/account.php
@@ -50,7 +50,7 @@ $confirm=GETPOST('confirm','alpha');
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
$fieldtype = (! empty($ref) ? 'ref' :'rowid');
if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtype);
+$result=restrictedArea($user,'banque',$fieldvalue,'bank_account&bank_account','','',$fieldtype);
$paiementtype=GETPOST('paiementtype','alpha',3);
$req_nb=GETPOST("req_nb",'',3);
diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php
index 6b5a4c2437b..d193ff83b59 100644
--- a/htdocs/compta/bank/bankid_fr.php
+++ b/htdocs/compta/bank/bankid_fr.php
@@ -43,7 +43,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"]))
}
$fieldid = isset($_GET["ref"])?'ref':'rowid';
if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
+$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
/*
diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php
index 806ca6fa5ad..47af3ca5086 100644
--- a/htdocs/compta/bank/fiche.php
+++ b/htdocs/compta/bank/fiche.php
@@ -44,7 +44,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"]))
}
$fieldid = isset($_GET["ref"])?'ref':'rowid';
if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
+$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
/*
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index 11367289e7a..734cdd8eb83 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -41,7 +41,7 @@ if (isset($_GET["account"]) || isset($_GET["ref"]))
}
$fieldid = isset($_GET["ref"])?'ref':'rowid';
if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
+$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
$account=$_GET["account"];
$mode='standard';
diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php
index af7078421a2..ffbf6be1ce9 100644
--- a/htdocs/compta/bank/treso.php
+++ b/htdocs/compta/bank/treso.php
@@ -42,7 +42,7 @@ if (isset($_GET["account"]) || isset($_GET["ref"]))
}
$fieldid = isset($_GET["ref"])?'ref':'rowid';
if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
+$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
$vline=isset($_GET["vline"])?$_GET["vline"]:$_POST["vline"];
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 76b54bbe613..e9bf109b9e7 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1252,6 +1252,16 @@ class Facture extends CommonInvoice
}
// Fin appel triggers
}
+
+ // Removed extrafields
+ if (! $error) {
+ $result=$this->deleteExtraFields();
+ if ($result < 0)
+ {
+ $error++;
+ dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR);
+ }
+ }
if (! $error)
{
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index d0300dad278..4d4c30b55a4 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -24,10 +24,6 @@
* \brief Note card expedition
*/
-error_reporting(E_ALL);
-ini_set('display_errors', true);
-ini_set('html_errors', false);
-
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 73a62207af1..5f3ef882fcf 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -240,7 +240,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
// Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit
// Ecrase $txtva par celui du produit
- if ((GETPOST('addline_predefined') || GETPOST('idprodfournprice')) && ( GETPOST('pu')!=='')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
+ if (GETPOST('addline_predefined') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
{
$idprod=0;
$productsupplier = new ProductFournisseur($db);
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index fd4a988cedf..5605ed2340f 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -28,9 +28,6 @@
* \brief Page for supplier invoice card (view, edit, validate)
*/
-error_reporting(E_ALL);
-ini_set('display_errors', true);
-ini_set('html_errors', false);
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php
index 5bfa61cc7b6..3640ae6dfbb 100644
--- a/htdocs/margin/agentMargins.php
+++ b/htdocs/margin/agentMargins.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2014 Ferran Marcet
*
* 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
@@ -130,11 +131,14 @@ if ($agentid > 0) {
else
$sql .= " AND sc.fk_user = ".$agentid;
}
-if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
-if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
+if (!empty($startdate))
+ $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
+if (!empty($enddate))
+ $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
$sql .= " AND d.buy_price_ht IS NOT NULL";
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
-$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname";
+if($agentid) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname";
+else $sql.= " GROUP BY u.rowid, u.login, u.lastname, u.firstname";
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
// TODO: calculate total to display then restore pagination
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php
index e9a0bbfe102..e5226040794 100644
--- a/htdocs/margin/customerMargins.php
+++ b/htdocs/margin/customerMargins.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2014 Ferran Marcet
*
* 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
@@ -172,13 +173,18 @@ $sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut > 0";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND d.fk_facture = f.rowid";
-if ($client) $sql.= " AND f.fk_soc = ".$socid;
-if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
-if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
+if ($client)
+ $sql.= " AND f.fk_soc = ".$socid;
+if (!empty($startdate))
+ $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
+if (!empty($enddate))
+ $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
$sql .= " AND d.buy_price_ht IS NOT NULL";
-if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
-$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
-$sql.= " ORDER BY ".$sortfield." ".$sortorder;
+if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
+ $sql .= " AND d.buy_price_ht <> 0";
+if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
+else $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client";
+$sql.= " ORDER BY $sortfield $sortorder ";
// TODO: calculate total to display then restore pagination
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php
index c4ba7b54c20..3152b8387b6 100644
--- a/htdocs/margin/productMargins.php
+++ b/htdocs/margin/productMargins.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2014 Ferran Marcet
*
* 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
@@ -178,12 +179,19 @@ $sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND d.fk_product = p.rowid";
$sql.= " AND f.fk_statut > 0";
$sql.= " AND d.fk_facture = f.rowid";
-if ($id > 0) $sql.= " AND d.fk_product =".$id;
-if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
-if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
+if ($id > 0)
+ $sql.= " AND d.fk_product =".$id;
+if (!empty($startdate))
+ $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
+if (!empty($enddate))
+ $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
$sql .= " AND d.buy_price_ht IS NOT NULL";
-if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
-$sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
+if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
+ $sql .= " AND d.buy_price_ht <> 0";
+if ($id > 0)
+ $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
+else
+ $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref";
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
// TODO: calculate total to display then restore pagination
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 5e2f20729cc..a7ab5446c92 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -23,9 +23,6 @@
* \brief Page of a project task
*/
-error_reporting(E_ALL);
-ini_set('display_errors', true);
-ini_set('html_errors', false);
require ("../../main.inc.php");
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';