Fix: Can delete a price when date is in future to fix corrupted data

This commit is contained in:
Laurent Destailleur 2021-08-20 21:11:20 +02:00
parent dd70d68b4c
commit 9d285ea232

View File

@ -1617,13 +1617,13 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
elseif ($i > 0) $candelete = 1;
print '<td class="right">';
if ($candelete)
{
if ($candelete || $db->jdate($objp->dp >= dol_now())) { // Test on date is to be able to delete a corrupted record
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&amp;id='.$object->id.'&amp;lineid='.$objp->rowid.'">';
print img_delete();
print '</a>';
} else
} else {
print '&nbsp;'; // Can not delete last price (it's current price)
}
print '</td>';
}