\n";
+}
+
// Search contract
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{
diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index ca03e11bcba..eb10fce7768 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -93,9 +93,10 @@ if ($conf->salaries->enabled)
print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
- $sql = "SELECT s.rowid, s.amount, s.label, s.datev as dm";
- $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
- $sql.= " WHERE s.entity = ".$conf->entity;
+ $sql = "SELECT s.rowid, s.amount, s.label, s.datev as dm, s.salary, u.salary as current_salary";
+ $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
+ $sql.= " WHERE s.entity IN (".getEntity('user',1).")";
+ $sql.= " AND u.rowid = s.fk_user";
if ($year > 0)
{
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
@@ -132,11 +133,11 @@ if ($conf->salaries->enabled)
print "
";
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 509f237b0d6..d7fc398e082 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4949,7 +4949,7 @@ function dol_getmypid()
* Generate natural SQL search string
*
* @param string|string[] $fields String or array of strings, filled with the name of fields in the SQL query
- * @param string $value The value to look for.
+ * @param string $value The value to look for.
* If param $numeric is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2
* If param $numeric is 1, can contains an operator <>= like "<10" or ">=100.5 < 1000"
* @param string $number 0=value is list of keywords, 1=value is a numeric test
@@ -4958,10 +4958,10 @@ function dol_getmypid()
function natural_search($fields, $value, $numeric=0)
{
global $db,$langs;
-
+
if ($numeric)
{
- $value=preg_replace('/([<>=]+)\s([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
+ $value=preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
}
$crits = explode(' ', $value);
$res = '';
@@ -4970,19 +4970,19 @@ function natural_search($fields, $value, $numeric=0)
$nboffields = count($fields);
$end2 = count($crits);
$j = 0;
- foreach ($crits as $crit)
+ foreach ($crits as $crit)
{
$i = 0; $i2 = 0;
$newres = '';
- foreach ($fields as $field)
+ foreach ($fields as $field)
{
- if ($numeric)
+ if ($numeric)
{
$operator='=';
$newcrit = preg_replace('/([<>=]+)/','',trim($crit));
-
+
preg_match('/([<>=]+)/',trim($crit), $reg);
- if ($reg[1])
+ if ($reg[1])
{
$operator = $reg[1];
}
@@ -4992,7 +4992,7 @@ function natural_search($fields, $value, $numeric=0)
$i2++; // a criteria was added to string
}
}
- else
+ else
{
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " LIKE '%" . $db->escape(trim($crit)) . "%'";
$i2++; // a criteria was added to string
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 7e525a9d080..386caad8134 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -140,7 +140,7 @@ if ($search_ttc != '')
}
if ($sall)
{
- $sql .= natural_search(array('cf.ref', 'cf.note_public', 'cf.note_private'), $sall);
+ $sql .= natural_search(array('cf.ref', 'cf.ref_supplier', 'cf.note_public', 'cf.note_private'), $sall);
}
if ($socid) $sql.= " AND s.rowid = ".$socid;
diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
index 22890a149ce..03736b088fc 100755
--- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
+++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
@@ -21,6 +21,8 @@
ALTER TABLE llx_extrafields ADD COLUMN perms varchar(255) after fieldrequired;
+ALTER TABLE llx_payment_salary ADD COLUMN salary real after datev;
+
UPDATE llx_projet_task_time SET task_datehour = task_date where task_datehour IS NULL;
ALTER TABLE llx_projet_task_time ADD COLUMN task_date_withhour integer DEFAULT 0 after task_datehour;
diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql
index b82ff66ecc1..2498c771ba6 100644
--- a/htdocs/install/mysql/tables/llx_payment_salary.sql
+++ b/htdocs/install/mysql/tables/llx_payment_salary.sql
@@ -23,6 +23,7 @@ create table llx_payment_salary
fk_user integer NOT NULL,
datep date, -- date de paiement
datev date, -- date de valeur
+ salary real, -- salary of user when payment was done
amount real NOT NULL DEFAULT 0,
fk_typepayment integer NOT NULL,
num_payment varchar(50),
diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang
index ea3659b90de..602bd1bda59 100644
--- a/htdocs/langs/en_US/orders.lang
+++ b/htdocs/langs/en_US/orders.lang
@@ -59,6 +59,7 @@ MenuOrdersToBill=Orders delivered
MenuOrdersToBill2=Billable orders
SearchOrder=Search order
SearchACustomerOrder=Search a customer order
+SearchASupplierOrder=Search a supplier order
ShipProduct=Ship product
Discount=Discount
CreateOrder=Create Order
diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang
index 0087cbe83e6..0f5f636a3f3 100644
--- a/htdocs/langs/en_US/salaries.lang
+++ b/htdocs/langs/en_US/salaries.lang
@@ -10,3 +10,4 @@ SalariesPayments=Salaries payments
ShowSalaryPayment=Show salary payment
THM=Average hourly price
TJM=Average daily price
+CurrentSalary=Current salary
\ No newline at end of file