* do not display delete button if payment is reconciled * add isReconciled() function * phpcs fix: replace spaces by tab * phpcs fix: Whitespace found at end of line * phpcs
This commit is contained in:
parent
2f340a1a77
commit
86bad02b9d
2 changed files with 17 additions and 1 deletions
|
|
@ -917,4 +917,17 @@ class PaiementFourn extends Paiement
|
|||
|
||||
return parent::fetch_thirdparty($force_thirdparty_id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return if payment is reconciled
|
||||
*
|
||||
* @return boolean True if payment is reconciled
|
||||
*/
|
||||
public function isReconciled()
|
||||
{
|
||||
$accountline = new AccountLine($this->db);
|
||||
$accountline->fetch($this->bank_line);
|
||||
return $accountline->rappro;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3551,7 +3551,10 @@ if ($action == 'create') {
|
|||
}
|
||||
print '<td class="right">'.price($sign * $objp->amount).'</td>';
|
||||
print '<td class="center">';
|
||||
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0) {
|
||||
|
||||
$paiementfourn = new PaiementFourn($db);
|
||||
$paiementfourn->fetch($objp->rowid);
|
||||
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0 && !$paiementfourn->isReconciled()) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepayment&token='.newToken().'&paiement_id='.$objp->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
|
|
|
|||
Loading…
Reference in a new issue