Merge pull request #13999 from OPEN-DSI/fix_erreur_facture

FIX: Fix link of the button to create a credit note and fix the awareness of a error happen when to create a credit note
This commit is contained in:
Laurent Destailleur 2020-05-30 17:24:31 +02:00 committed by GitHub
commit f191cec3ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1182,7 +1182,7 @@ 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();
@ -5130,7 +5130,7 @@ if ($action == 'create')
{
if (!$objectidnext)
{
print '<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>';
print '<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>';
}
}