diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index f904c7f6cf0..ea745e45df7 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -256,7 +256,7 @@ $tabfield[21]= "code,label";
$tabfield[22]= "code,label";
$tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[24]= "code,label";
-$tabfield[25]= "label,type_template,position,topic,content";
+$tabfield[25]= "label,type_template,private,position,topic,content";
$tabfield[26]= "code,label,short_label";
$tabfield[27]= "code,libelle";
$tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country";
@@ -293,7 +293,7 @@ $tabfieldvalue[21]= "code,label";
$tabfieldvalue[22]= "code,label";
$tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[24]= "code,label";
-$tabfieldvalue[25]= "label,type_template,position,topic,content";
+$tabfieldvalue[25]= "label,type_template,private,position,topic,content";
$tabfieldvalue[26]= "code,label,short_label";
$tabfieldvalue[27]= "code,libelle";
$tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country";
@@ -644,7 +644,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=0;
setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors');
}
-
+
// Clean some parameters
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
@@ -1409,7 +1409,7 @@ if ($id)
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; }
$canbemodified=$iserasable;
if ($obj->code == 'RECEP') $canbemodified=1;
-
+
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&id='.$id.'&';
// Favorite
diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index f86ac81aa76..f0c8a6bcdda 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.php
@@ -223,7 +223,7 @@ if ($resql)
print '
| ';
print ' | ';
print '';
- $form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 8);
+ $form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1);
print ' | ';
print ' | ';
print '';
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 4d5de55e384..0f513412a93 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -5,6 +5,7 @@
* Copyright (C) 2015 Juanjo Menent
* Copyright (C) 2015 Jean-François Ferry
* Copyright (C) 2015 Raphaël Doursenaud
+ * Copyright (C) 2016 Marcos García
*
* 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
@@ -214,7 +215,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
*/
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{
- $sql = "SELECT f.ref, f.rowid, f.total_ht, f.tva as total_tva, f.total_ttc, f.type";
+ $sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_fournisseur";
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index a23078a0e12..46b485d8a3c 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -334,7 +334,7 @@ class FormMail extends Form
$out.= ' ';
$out.= '';
}
-
+
$out.= ''."\n";
@@ -876,13 +876,13 @@ class FormMail extends Form
{
$ret=array();
- $sql = "SELECT rowid, label, topic, content, lang";
+ $sql = "SELECT rowid, label, topic, content, lang, position";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
$sql.= " WHERE type_template='".$this->db->escape($type_template)."'";
$sql.= " AND entity IN (".getEntity("c_email_templates").")";
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
- $sql.= $this->db->order("lang,label","ASC");
+ $sql.= $this->db->order("position,lang,label","ASC");
//print $sql;
$resql = $this->db->query($sql);
@@ -896,7 +896,7 @@ class FormMail extends Form
$line->id=$obj->rowid;
$line->label=$obj->label;
$line->topic=$obj->topic;
- $line->content=$obj->lacontentbel;
+ $line->content=$obj->content;
$line->lang=$obj->lang;
$this->lines_model[]=$line;
}
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index 8ecde98aaa4..c532fd799bd 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -188,7 +188,7 @@ class FormProjets
continue;
}
- $labeltoshow=dol_trunc($obj->ref,18).' - '.$obj->title;
+ $labeltoshow=dol_trunc($obj->ref,18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
$labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index d1df6fcb6e5..899635e403e 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1040,6 +1040,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("withdrawals");
$langs->load("banks");
$langs->load("bills");
+ $langs->load('categories');
// Bank-Caisse
if (! empty($conf->banque->enabled))
diff --git a/htdocs/core/modules/syslog/mod_syslog_sentry.php b/htdocs/core/modules/syslog/mod_syslog_sentry.php
index 4332c0b2e82..fa5b61744cf 100644
--- a/htdocs/core/modules/syslog/mod_syslog_sentry.php
+++ b/htdocs/core/modules/syslog/mod_syslog_sentry.php
@@ -145,6 +145,10 @@ class mod_syslog_sentry extends LogHandler implements LogHandlerInterface
*/
public function export($content)
{
+ if (! $this->isActive()) {
+ return;
+ }
+
global $conf;
$dsn = $conf->global->SYSLOG_SENTRY_DSN;
$client = new Raven_Client(
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index b7654746dc0..09309af1a8b 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -429,18 +429,12 @@ if (! empty($usemargins) && $user->rights->margins->creer)
jQuery(document).ready(function() {
global->DISPLAY_MARGIN_RATES)) { ?>
- $('#addline').click(function (e) {
- return checkFreeLine(e, "np_marginRate");
- });
$("input[name='np_marginRate']:first").blur(function(e) {
return checkFreeLine(e, "np_marginRate");
});
global->DISPLAY_MARK_RATES)) { ?>
- $('#addline').click(function (e) {
- return checkFreeLine(e, "np_markRate");
- });
$("input[name='np_markRate']:first").blur(function(e) {
return checkFreeLine(e, "np_markRate");
});
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 7541cd90938..6d39cfc836b 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -329,9 +329,6 @@ if (! empty($conf->margin->enabled))
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && !empty($conf->global->MARGIN_RESET_HT_FROM_MARGIN_FIELD))
{
?>
- $('#savelinebutton').click(function (e) {
- return checkEditLine(e, "np_marginRate");
- });
/* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'.
$("input[name='np_marginRate']:first").blur(function(e) {
return checkEditLine(e, "np_marginRate");
@@ -341,9 +338,6 @@ if (! empty($conf->margin->enabled))
if (! empty($conf->global->DISPLAY_MARK_RATES) && !empty($conf->global->MARGIN_RESET_HT_FROM_MARGIN_FIELD))
{
?>
- $('#savelinebutton').click(function (e) {
- return checkEditLine(e, "np_markRate");
- });
/* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'.
$("input[name='np_markRate']:first").blur(function(e) {
return checkEditLine(e, "np_markRate");
@@ -356,6 +350,7 @@ if (! empty($conf->margin->enabled))
/* If margin rate field empty, do nothing. */
/* Force content of price_ht to 0 or if a discount is set, recalculate it from margin rate */
+ /* TODO This function seems no more used */
function checkEditLine(e, npRate)
{
var buying_price = $("input[name='buying_price']:first");
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index 87c7ae259d2..03be7e77d36 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -707,7 +707,7 @@ class ProductFournisseur extends Product
{
global $langs;
$langs->load("suppliers");
- $out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").' (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
+ $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").' (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
return $out;
}
diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php
index 1bdec7b9a8d..a797bc19fdc 100644
--- a/htdocs/fourn/commande/index.php
+++ b/htdocs/fourn/commande/index.php
@@ -243,7 +243,7 @@ if (! empty($conf->fournisseur->enabled))
/*
* List of users allowed
*/
-$sql = "SELECT u.rowid, u.lastname, u.firstname";
+$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u,";
$sql.= " ".MAIN_DB_PREFIX."user_rights as ur";
$sql.= ", ".MAIN_DB_PREFIX."rights_def as rd";
@@ -276,6 +276,7 @@ if ($resql)
$userstatic->id=$obj->rowid;
$userstatic->lastname=$obj->lastname;
$userstatic->firstname=$obj->firstname;
+ $userstatic->email=$obj->email;
print $userstatic->getNomUrl(1);
print '';
print "\n";
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 08748bef416..64f459886ae 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2351,7 +2351,11 @@ else
// Delete
if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer)
{
- print 'id.'&action=delete">'.$langs->trans('Delete').'';
+ if ($object->getSommePaiement()) {
+ print '';
+ } else {
+ print 'id.'&action=delete">'.$langs->trans('Delete').'';
+ }
}
print '';
print ' ';
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index f82c8b62530..ad1ba8555a2 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -345,7 +345,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '';
print '';
- dol_fiche_head('');
+ dol_fiche_head(null);
print '';
@@ -377,6 +377,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print ' ';
dol_fiche_end();
+
$parameters=array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
$reshook=$hookmanager->executeHooks('paymentsupplierinvoices',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors;
@@ -527,10 +528,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$preselectedchoice=$addwarning?'no':'yes';
print ' ';
- if (!empty($totalpayment)) $text=$langs->trans('ConfirmSupplierPayment',$totalpayment,$langs->trans("Currency".$conf->currency));
+ if (!empty($totalpayment)) $text=$langs->trans('ConfirmSupplierPayment',price($totalpayment),$langs->trans("Currency".$conf->currency));
if (!empty($multicurrency_totalpayment))
{
- $text.=' '.$langs->trans('ConfirmSupplierPayment',$multicurrency_totalpayment,$langs->trans("paymentInInvoiceCurrency"));
+ $text.=' '.$langs->trans('ConfirmSupplierPayment',price($multicurrency_totalpayment),$langs->trans("paymentInInvoiceCurrency"));
}
if (GETPOST('closepaidinvoices'))
{
diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php
index 403d74b13e9..6defe0e6004 100644
--- a/htdocs/includes/nusoap/lib/nusoap.php
+++ b/htdocs/includes/nusoap/lib/nusoap.php
@@ -2217,7 +2217,7 @@ class soap_transport_http extends nusoap_base {
}
$this->use_curl = $use_curl;
preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
- if (isset($rev[1])) $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')');
+ $this->setHeader('User-Agent', $this->title.'/'.$this->version.(isset($rev[1])?' ('.$rev[1].')':''));
}
/**
diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php
index 6687b9fcf59..84d7945ec0d 100644
--- a/htdocs/margin/lib/margins.lib.php
+++ b/htdocs/margin/lib/margins.lib.php
@@ -118,7 +118,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
$marge_tx_ret='';
$marque_tx_ret='';
- if ($fk_pa > 0) {
+ if ($fk_pa > 0 && empty($paht)) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$product = new ProductFournisseur($db);
if ($product->fetch_product_fournisseur_price($fk_pa))
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 9686c4683ae..f4b3f575eba 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -361,7 +361,7 @@ if ($id > 0 || ! empty($ref))
}
print '';
- $totalline=price2num($value['nb'] * $product_fourn->fourn_unitprice, 'MT');
+ $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges - $product_fourn->fourn_remise), 'MT');
$total+=$totalline;
print '';
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency));
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 84c72afc7a0..0a12d87fc2d 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -407,8 +407,7 @@ $langs->load("orders");
$langs->load("proposals");
$langs->load("margins");
-//print load_fiche_titre($langs->trans("Profit"),'','title_accountancy');
-print ' '.img_picto("", "title_accountancy").' '.$langs->trans("Profit").' ';
+print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy');
print '';
print '';
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index 866e53bcd6b..eedcd449c0d 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -1903,7 +1903,7 @@ else
'name' => 'soc_origin',
'label' => $langs->trans('MergeOriginThirdparty'),
'type' => 'other',
- 'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 1, 0, 0, array(), 0, 'minwidth200')
+ 'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 'SelectThirdParty', 0, 0, array(), 0, 'minwidth200')
)
);
diff --git a/htdocs/user/index.php b/htdocs/user/index.php
index f4c77644f1f..f7927cee665 100644
--- a/htdocs/user/index.php
+++ b/htdocs/user/index.php
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2015 Alexandre Spangaro
+ * Copyright (C) 2016 Marcos García
*
* 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
@@ -201,7 +202,9 @@ if ($search_login != '') $sql.= natural_search("u.login", $search_login);
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
if ($search_gender != '' && $search_gender != '-1') $sql.= " AND u.gender = '".$search_gender."'";
-if ($search_employee >= 0) $sql.= natural_search("u.employee", $search_employee);
+if (is_numeric($search_employee) && $search_employee >= 0) {
+ $sql .= ' AND u.employee = '.(int) $search_employee;
+}
if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code);
if ($search_email != '') $sql.= natural_search("u.email", $search_email);
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")";
| |