diff --git a/ChangeLog b/ChangeLog
index bdd9278ebd4..2996e26f862 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -249,12 +249,12 @@ NEW: Add the admin info on combo of type of contact
NEW: Add the event BILL_PAYED to the list of supported events for module notification.
NEW: Add total weight and volume on PDF.
NEW: Add hidden option to hide column qty ordered on shipments.
-NEW: Add view of virtual stock into product list (when appropriate).
-NEW: Add warning on tasks when they are late (add also the warning tolerance parameter).
-NEW: Add weight/volume for one product into shipment export.
-NEW: Add width and height on product card
-NEW: allow a document to be linked to project of another customer by config setup.
-NEW: allow project to be shared across entities (for multicompany module).
+NEW: Add view of virtual stock into product list (when appropriate)
+NEW: Add warning on tasks when they are late (add also the warning tolerance parameter)
+NEW: Add weight/volume for one product into shipment export
+NEW: Add width and height on product table
+NEW: allow a document to be linked to project from another customer on config
+NEW: allow project to be shared across entities (for multicompany module)
NEW: All variant of ckeditor config can be tested into the setup page of module.
NEW: Can change dynamically number of records visible into lists.
NEW: Can change type of extrafields (for some combinations only).
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index 557f786b4b8..5e2894eb11f 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -192,7 +192,7 @@ else {
print "\n";
print '
';
@@ -378,9 +373,7 @@ if ($rowid > 0)
$sql.= " AND t.rowid = ".$object->id;
if ($sall)
{
- $sql.= " AND (d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
- $sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
- $sql.= " OR d.town LIKE '%".$sall."%' OR d.note_public LIKE '%".$sall."%' OR d.note_private LIKE '%".$sall."%')";
+ $sql.=natural_search(array("f.firstname","d.lastname","d.societe","d.email","d.login","d.address","d.town","d.note_public","d.note_private"), $sall);
}
if ($status != '')
{
@@ -388,22 +381,22 @@ if ($rowid > 0)
}
if ($action == 'search')
{
- if (isset($_POST['search']) && $_POST['search'] != '')
- {
- $sql.= " AND (d.firstname LIKE '%".$_POST['search']."%' OR d.lastname LIKE '%".$_POST['search']."%')";
- }
+ if (GETPOST('search'))
+ {
+ $sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search'));
+ }
}
if (! empty($search_lastname))
{
- $sql.= " AND (d.firstname LIKE '%".$search_lastname."%' OR d.lastname LIKE '%".$search_lastname."%')";
+ $sql.= natural_search(array("d.firstname","d.lastname"), $search_lastname);
}
if (! empty($search_login))
{
- $sql.= " AND d.login LIKE '%".$search_login."%'";
+ $sql.= natural_search("d.login", $search_login);
}
if (! empty($search_email))
{
- $sql.= " AND d.email LIKE '%".$search_email."%'";
+ $sql.= natural_search("d.email", $search_email);
}
if ($filter == 'uptodate')
{
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 4ef2a35e8a7..babbd3ee3cb 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -675,8 +675,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
}
// Clean some parameters
- if (! empty($_POST["localtax1_type"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
- if (! empty($_POST["localtax2_type"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
+ if ((! empty($_POST["localtax1_type"]) || ($_POST['localtax1_type'] == '0')) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
+ if ((! empty($_POST["localtax2_type"]) || ($_POST['localtax2_type'] == '0')) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index a7b3065658d..c9f2c57b8f2 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -500,8 +500,10 @@ if ($mode != 'marketplace')
else $text.='
\n";
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 8af3447734d..9a4b58a26c6 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -1,8 +1,8 @@
- * Copyright (C) 2004-2007 Laurent Destailleur
+ * Copyright (C) 2004-2016 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2013 Florian Henry
+ * Copyright (C) 2013 Florian Henry
*
* 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/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php
index 189fbaa188f..ce70e7ac938 100644
--- a/htdocs/compta/bank/bankentries.php
+++ b/htdocs/compta/bank/bankentries.php
@@ -832,7 +832,7 @@ if ($resql)
}
if (! empty($arrayfields['ba.ref']['checked']))
{
- print '
";
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
- print '
';
+ print '
';
print 'rappro?' disabled':'').' value="';
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
{
@@ -509,7 +504,7 @@ if ($result)
}
else
{
- print '
';
+ print '
';
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
{
// Label generique car entre parentheses. On l'affiche en le traduisant
@@ -527,19 +522,22 @@ if ($result)
print "
".$langs->trans("Amount")."
";
if ($user->rights->banque->modifier)
{
- print '
';
+
+ $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+
+ dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
-
+ print '
';
+
+$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+
+dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
+
+print '
';
+ $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
- // Ref customer
- print '
';
+
+ $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+
+ dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', '');
+
+ print '
';
-
- // We can also use bcadd to avoid pb with floating points
- // For example print 239.2 - 229.3 - 9.9; does not return 0.
- //$resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT);
- //$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT);
- $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits,'MT');
-
- print '
';
+
+ $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits,'MT');
+
+ // TODO Replace this by an include with same code to show already done payment visible in invoice card
+ print '
';
@@ -356,14 +348,12 @@ if ($id)
}
// Other attributes
- $parameters=array('colspan' => ' colspan="3"');
- $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ $reshook=$hookmanager->executeHooks('formObjectOptions','',$object,$action); // Note that $action and $object may have been modified by hook
print '
';
dol_fiche_end();
-
/*
* Action buttons
*/
diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php
index eb4ee3a2408..3c45ec77a89 100644
--- a/htdocs/compta/tva/class/tva.class.php
+++ b/htdocs/compta/tva/class/tva.class.php
@@ -671,4 +671,52 @@ class Tva extends CommonObject
return $result;
}
+ /**
+ * Informations of vat payment object
+ *
+ * @param int $id Id of vat payment
+ * @return int <0 if KO, >0 if OK
+ */
+ function info($id)
+ {
+ $sql = "SELECT t.rowid, t.tms as datec, t.fk_user_creat";
+ $sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
+ $sql.= " WHERE t.rowid = ".$id;
+
+ dol_syslog(get_class($this)."::info", LOG_DEBUG);
+ $result=$this->db->query($sql);
+ if ($result)
+ {
+ if ($this->db->num_rows($result))
+ {
+ $obj = $this->db->fetch_object($result);
+
+ $this->id = $obj->rowid;
+
+ if ($obj->fk_user_creat) {
+ $cuser = new User($this->db);
+ $cuser->fetch($obj->fk_user_creat);
+ $this->user_creation = $cuser;
+ }
+
+ if ($obj->fk_user_modif) {
+ $muser = new User($this->db);
+ $muser->fetch($obj->fk_user_modif);
+ $this->user_modification = $muser;
+ }
+
+ $this->date_creation = $this->db->jdate($obj->datec);
+ $this->date_modification = $this->db->jdate($obj->datec);
+ $this->import_key = $obj->import_key;
+ }
+
+ $this->db->free($result);
+
+ }
+ else
+ {
+ dol_print_error($this->db);
+ }
+ }
+
}
diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php
new file mode 100644
index 00000000000..f85ab9fc2b0
--- /dev/null
+++ b/htdocs/compta/tva/info.php
@@ -0,0 +1,64 @@
+
+ *
+ * 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/compta/tva/info.php
+ * \ingroup tax
+ * \brief Page with info about vat
+ */
+
+require '../../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+
+$langs->load("compta");
+$langs->load("bills");
+
+$id=GETPOST('id','int');
+$action=GETPOST("action");
+
+// Security check
+$socid = GETPOST('socid','int');
+if ($user->societe_id) $socid=$user->societe_id;
+$result = restrictedArea($user, 'tax', '', '', 'charges');
+
+
+/*
+ * View
+ */
+$title=$langs->trans("VAT") . " - " . $langs->trans("Info");
+$help_url='';
+llxHeader("",$title,$helpurl);
+
+$object = new Tva($db);
+$object->fetch($id);
+$object->info($id);
+
+$head = vat_prepare_head($object);
+
+dol_fiche_head($head, 'info', $langs->trans("VATPayment"), 0, 'payment');
+
+print '