diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index b1983a302ae..318abd6554a 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.php
@@ -214,7 +214,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 c39b585d7b1..ea154303d20 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 f8f6afcf1ff..c330edc9bf5 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -874,13 +874,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);
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index 977b792568b..01b22d3b514 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 eff98bba3a6..fafebe3ca18 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1034,6 +1034,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/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 31ad9716155..fa1e369ab0b 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -399,18 +399,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 7723123bc0e..1e9a13069ae 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -307,9 +307,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");
@@ -319,9 +316,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");
@@ -334,6 +328,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 e13528c0382..9c889a97d97 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -680,7 +680,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 725d1f28d39..9801c168be3 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2227,7 +2227,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 c107639e786..2a551812e31 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -283,7 +283,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '';
print '';
- dol_fiche_head('');
+ dol_fiche_head(null);
print '';
@@ -315,6 +315,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;
@@ -434,7 +435,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$preselectedchoice=$addwarning?'no':'yes';
print '
';
- $text=$langs->trans('ConfirmSupplierPayment',$totalpayment,$langs->trans("Currency".$conf->currency));
+ $text=$langs->trans('ConfirmSupplierPayment', price($totalpayment),$langs->trans("Currency".$conf->currency));
if (GETPOST('closepaidinvoices'))
{
$text.='
'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
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 ce100d49390..4e5367dff39 100644
--- a/htdocs/margin/lib/margins.lib.php
+++ b/htdocs/margin/lib/margins.lib.php
@@ -109,7 +109,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 3839a9b0b06..d71b3aa6ebe 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -348,8 +348,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 ' |