Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.4' into 3.4_backported
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 24, 2014
2 parents f373567 + 98805ac commit 7e76c6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions htdocs/fourn/class/paiementfourn.class.php
Expand Up @@ -305,8 +305,11 @@ function delete($notrigger=0)
if ($bank_line_id)
{
$accline = new AccountLine($this->db);
$accline->fetch($bank_line_id);
$result=$accline->delete();
$result=$accline->fetch($bank_line_id);
if ($result > 0) // If result = 0, record not found, we don't try to delete
{
$result=$accline->delete();
}
if ($result < 0)
{
$this->error=$accline->error;
Expand Down
12 changes: 6 additions & 6 deletions htdocs/fourn/facture/fiche.php
Expand Up @@ -234,14 +234,14 @@
}

// Delete payment
elseif ($action == 'deletepaiement')
elseif ($action == 'deletepaiement' && $user->rights->fournisseur->facture->creer)
{
$object->fetch($id);
if ($object->statut == 1 && $object->paye == 0 && $user->societe_id == 0)
if ($object->statut == 1 && $object->paye == 0)
{
$paiementfourn = new PaiementFourn($db);
$paiementfourn->fetch(GETPOST('paiement_id'));
$result=$paiementfourn->delete();
$paiementfourn = new PaiementFourn($db);
$result=$paiementfourn->fetch(GETPOST('paiement_id'));
if ($result > 0) $result=$paiementfourn->delete(); // If fetch ok and found
if ($result < 0) $mesg='<div class="error">'.$paiementfourn->error.'</div>';
}
}
Expand Down Expand Up @@ -1527,7 +1527,7 @@
$bankaccountstatic->ref=$objp->ref;
$bankaccountstatic->label=$objp->ref;
print '<td align="right">';
print $bankaccountstatic->getNomUrl(1,'transactions');
if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions');
print '</td>';
}
print '<td align="right">'.price($objp->amount).'</td>';
Expand Down

0 comments on commit 7e76c6f

Please sign in to comment.