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

This commit is contained in:
Laurent Destailleur 2020-05-31 00:23:40 +02:00
commit bc1724a3aa
2 changed files with 9 additions and 7 deletions

View File

@ -1106,12 +1106,12 @@ if (empty($reshook))
}
// Add link between credit note and origin
if(! empty($object->fk_facture_source)) {
if(! empty($object->fk_facture_source) && $id>0) {
$facture_source->fetch($object->fk_facture_source);
$facture_source->fetchObjectLinked();
if(! empty($facture_source->linkedObjectsIds)) {
foreach($facture_source->linkedObjectsIds as $sourcetype => $TIds) {
if (!empty($facture_source->linkedObjectsIds)) {
foreach ($facture_source->linkedObjectsIds as $sourcetype => $TIds) {
$object->add_object_linked($sourcetype, current($TIds));
}
}
@ -4835,9 +4835,8 @@ elseif ($id > 0 || ! empty($ref))
// Create a credit note
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
{
if (! $objectidnext)
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?socid=' . $object->socid .'&amp;fac_avoir=' . $object->id . '&amp;action=create&amp;type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').'' . ($object->entity > 0 ? '&amp;originentity='.$object->entity : '').'">' . $langs->trans("CreateCreditNote") . '</a></div>';
if (! $objectidnext) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?socid=' . $object->socid . '&amp;fac_avoir=' . $object->id . '&amp;action=create&amp;type=2' . ($object->fk_project > 0 ? '&amp;projectid=' . $object->fk_project : '') . ($object->entity > 0 ? '&amp;originentity=' . $object->entity : '') . '">' . $langs->trans("CreateCreditNote") . '</a></div>';
}
}

View File

@ -36,7 +36,10 @@ $socid = GETPOST('socid', 'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
$urladd = '';
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
if ($limit != $conf->liste_limit) $urladd .= '&limit=' . $limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int');
@ -102,7 +105,7 @@ if ($result)
$num = $db->num_rows($result);
$i = 0;
$urladd= "&amp;statut=".$statut;
$urladd .= "&amp;statut=" . $statut;
$selectedfields='';