Merge pull request #23362 from rycks/update_retainedwarranty_only_if_draft_invoice
avoid editretainedwarranty if invoice is not draft
This commit is contained in:
commit
fa3b4e92c5
@ -4517,13 +4517,13 @@ if ($action == 'create') {
|
||||
print '<table id="retained-warranty-table" class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('RetainedWarranty');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarranty' && $user->rights->facture->creer) {
|
||||
if ($action != 'editretainedwarranty' && $user->rights->facture->creer && $object->statut == Facture::STATUS_DRAFT) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarranty&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editretainedwarranty') {
|
||||
if ($action == 'editretainedwarranty' && $object->statut == Facture::STATUS_DRAFT) {
|
||||
print '<form id="retained-warranty-form" method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="setretainedwarranty">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -4540,7 +4540,7 @@ if ($action == 'create') {
|
||||
print '<table id="retained-warranty-cond-reglement-table" class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentConditionsShortRetainedWarranty');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer) {
|
||||
if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer && $object->statut == Facture::STATUS_DRAFT) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantypaymentterms&facid='.$object->id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
@ -4551,7 +4551,7 @@ if ($action == 'create') {
|
||||
$defaultDate = $object->date;
|
||||
}
|
||||
|
||||
if ($action == 'editretainedwarrantypaymentterms') {
|
||||
if ($action == 'editretainedwarrantypaymentterms' && $object->statut == Facture::STATUS_DRAFT) {
|
||||
//date('Y-m-d',$object->date_lim_reglement)
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="setretainedwarrantyconditions">';
|
||||
@ -4575,7 +4575,7 @@ if ($action == 'create') {
|
||||
print '<table id="retained-warranty-date-limit-table" class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('RetainedWarrantyDateLimit');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarrantydatelimit' && $user->rights->facture->creer) {
|
||||
if ($action != 'editretainedwarrantydatelimit' && $user->rights->facture->creer && $object->statut == Facture::STATUS_DRAFT) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantydatelimit&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
@ -4586,7 +4586,7 @@ if ($action == 'create') {
|
||||
$defaultDate = $object->date;
|
||||
}
|
||||
|
||||
if ($action == 'editretainedwarrantydatelimit') {
|
||||
if ($action == 'editretainedwarrantydatelimit' && $object->statut == Facture::STATUS_DRAFT) {
|
||||
//date('Y-m-d',$object->date_lim_reglement)
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="setretainedwarrantydatelimit">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user