Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0

Conflicts:
	htdocs/compta/recap-compta.php
	htdocs/fourn/class/fournisseur.commande.class.php
This commit is contained in:
Laurent Destailleur 2018-05-30 11:09:53 +02:00
commit 3733169120
3 changed files with 19 additions and 12 deletions

View File

@ -61,6 +61,9 @@ $arrayfields=array(
//...
);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('supplierbalencelist','globalcard'));
/*
* Actions
*/
@ -100,7 +103,7 @@ if ($id > 0)
// Invoice list
print load_fiche_titre($langs->trans("CustomerPreview"));
print '<table class="noborder" width="100%">';
print '<table class="noborder tagtable liste" width="100%">';
print '<tr class="liste_titre">';
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'],$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
print '<td>'.$langs->trans("Element").'</td>';
@ -253,13 +256,18 @@ if ($id > 0)
if (!empty($data['fk_facture'])) print dol_print_date($data['date'],'day');
elseif (!empty($data['fk_paiement'])) print dol_print_date($data['date'],'dayhour');
print "</td>\n";
print '<td>'.$data['link']."</td>\n";
print '<td aling="left">'.$data['status'].'</td>';
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
print '<td align="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
// Balance
print '<td align="right">'.price($data['balance'])."</td>\n";

View File

@ -1478,15 +1478,12 @@ class CommandeFournisseur extends CommonOrder
// We use 'none' instead of $ref_supplier, because fourn_ref may not exists anymore. So we will take the first supplier price ok.
// If we want a dedicated supplier price, we must provide $fk_prod_fourn_price.
$result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc
if ($result > 0)
if ($result > 0 && $origin == 'commande') // If supplier order created from customer order, we take best supplier price
{
$pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice
$ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice
// is remise percent not keyed but present for the product we add it
if ($remise_percent == 0 && $prod->remise_percent !=0)
$remise_percent =$prod->remise_percent;
$pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice
$ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice
// is remise percent not keyed but present for the product we add it
if ($remise_percent == 0 && $prod->remise_percent !=0) $remise_percent =$prod->remise_percent;
}
if ($result == 0) // If result == 0, we failed to found the supplier reference price
{

View File

@ -38,6 +38,8 @@ if ($user->societe_id > 0)
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('supplierbalencelist','globalcard'));
/*
* View
@ -67,7 +69,7 @@ if ($socid > 0)
// Invoice list
print load_fiche_titre($langs->trans("SupplierPreview"));
print '<table class="noborder" width="100%">';
print '<table class="noborder tagtable liste" width="100%">';
$sql = "SELECT s.nom, s.rowid as socid, f.ref_supplier, f.amount, f.datef as df,";
$sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,";
@ -114,7 +116,7 @@ if ($socid > 0)
}
$totalpaye = $fac->getSommePaiement();
print '<tr class="oddeven">';
print "<td align=\"center\">".dol_print_date($fac->date)."</td>\n";
@ -182,7 +184,7 @@ if ($socid > 0)
{
dol_print_error($db);
}
print "</table>";
}
}