Fix credit note card apparence
This commit is contained in:
parent
ce24ca08ee
commit
e966d11356
@ -4586,6 +4586,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
// remove situation from cycle
|
||||
if ($object->statut == Facture::STATUS_VALIDATED
|
||||
&& $object->type == Facture::TYPE_SITUATION
|
||||
&& $user->rights->facture->creer
|
||||
&& !$objectidnext
|
||||
&& $object->situation_counter > 1
|
||||
|
||||
@ -1530,8 +1530,16 @@ class Facture extends CommonInvoice
|
||||
$invoice = new Facture($this->db);
|
||||
if ($invoice->fetch($objp->rowid) > 0)
|
||||
{
|
||||
if ($objp->situation_counter < $this->situation_counter) $this->tab_previous_situation_invoice[] = $invoice;
|
||||
else $this->tab_next_situation_invoice[] = $invoice;
|
||||
if ($objp->situation_counter < $this->situation_counter
|
||||
|| ($objp->situation_counter == $this->situation_counter && $objp->rowid < $this->id) // This case appear when there are credit notes
|
||||
)
|
||||
{
|
||||
$this->tab_previous_situation_invoice[] = $invoice;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->tab_next_situation_invoice[] = $invoice;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user