Add create button on predefined invoice details

Check invoice creation right
This commit is contained in:
Cedric 2014-09-11 14:01:39 +02:00
parent dddafacad9
commit 86d8870939
2 changed files with 14 additions and 13 deletions

View File

@ -18,6 +18,7 @@ For users:
- Fix: Iban was used instead of Bic into SEPA file.
- Fix: Must unaccent strings into SEPA file.
- Fix: Extrafield feature select from table should try to translate multiple column when not needed
- New: Direct invoice creation from predefined invoice
***** ChangeLog for 3.6 compared to 3.5.* *****
For users:

View File

@ -507,9 +507,14 @@ else
*/
print '<div class="tabsAction">';
if ($object->statut == 0 && $user->rights->facture->creer)
{
echo '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$object->thirdparty->id.'&amp;fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
}
if ($object->statut == 0 && $user->rights->facture->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a></div>';
}
print '</div>';
@ -569,23 +574,18 @@ else
print '<td align="right">'.price($objp->total).'</td>'."\n";
if (! $objp->paye)
echo '<td align="center">';
if ($user->rights->facture->creer)
{
if ($objp->fk_statut == 0)
{
print '<td align="right">'.$langs->trans("Draft").'</td>';
}
else
{
print '<td align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/list.php?filtre=paye:0,fk_statut:1">'.$langs->trans("Validated").'</a></td>';
}
echo '<a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$objp->socid.'&amp;fac_rec='.$objp->facid.'">';
echo $langs->trans("CreateBill"),'</a>';
}
else
{
print '<td>&nbsp;</td>';
echo "&nbsp;";
}
print "</tr>\n";
echo "</td></tr>\n";
$i++;
}
}