2
0
forked from Wavyzz/dolibarr

Merge remote-tracking branch 'origin/3.8' into 3.9

Conflicts:
	htdocs/fourn/facture/paiement.php
This commit is contained in:
Laurent Destailleur
2016-04-12 15:03:19 +02:00
15 changed files with 23 additions and 27 deletions

View File

@@ -214,7 +214,7 @@ if ($resql)
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="center">';
$form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 8);
$form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat" name="req_nb" value="'.GETPOST("req_nb").'" size="2"></td>';
print '<td class="liste_titre">';

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
*
* 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";

View File

@@ -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);

View File

@@ -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);

View File

@@ -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))

View File

@@ -399,18 +399,12 @@ if (! empty($usemargins) && $user->rights->margins->creer)
jQuery(document).ready(function() {
<?php
if (! empty($conf->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");
});
<?php
}
if (! empty($conf->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");
});

View File

@@ -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");

View File

@@ -680,7 +680,7 @@ class ProductFournisseur extends Product
{
global $langs;
$langs->load("suppliers");
$out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").' &nbsp; (':'').($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").' &nbsp; (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
return $out;
}

View File

@@ -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 '</td>';
print "</tr>\n";

View File

@@ -2227,7 +2227,11 @@ else
// Delete
if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
if ($object->getSommePaiement()) {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecausePayments") . '">' . $langs->trans('Delete') . '</a></div>';
} else {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
}
print '</div>';
print '<br>';

View File

@@ -283,7 +283,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<input type="hidden" name="socid" value="'.$obj->socid.'">';
print '<input type="hidden" name="societe" value="'.$obj->name.'">';
dol_fiche_head('');
dol_fiche_head(null);
print '<table class="border" width="100%">';
@@ -315,6 +315,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '</table>';
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 '<br>';
$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.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");

View File

@@ -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].')':''));
}
/**

View File

@@ -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))

View File

@@ -361,7 +361,7 @@ if ($id > 0 || ! empty($ref))
}
print '</td>';
$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 '<td align="right">';
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency));

View File

@@ -348,8 +348,7 @@ $langs->load("orders");
$langs->load("proposals");
$langs->load("margins");
//print load_fiche_titre($langs->trans("Profit"),'','title_accountancy');
print '<div class="center">'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'</div><br>';
print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';