Fix button create template must be visible only if amount is != 0
This commit is contained in:
parent
1d5bd7208e
commit
518080468e
@ -3313,7 +3313,9 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
print ' ';
|
print ' ';
|
||||||
|
|
||||||
print $prevsits[0]->situation_counter;
|
print $prevsits[0]->situation_counter;
|
||||||
for ($i = 1; $i < count($prevsits); $i++) {
|
$cprevsits = count($prevsits);
|
||||||
|
|
||||||
|
for ($i = 1; $i < $cprevsits; $i++) {
|
||||||
print ' + ';
|
print ' + ';
|
||||||
print $prevsits[$i]->situation_counter;
|
print $prevsits[$i]->situation_counter;
|
||||||
}
|
}
|
||||||
@ -3334,7 +3336,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
print '<td>' . $langs->trans('Currency' . $conf->currency) . '</td></tr>';
|
print '<td>' . $langs->trans('Currency' . $conf->currency) . '</td></tr>';
|
||||||
|
|
||||||
// Previous situation(s) deduction(s)
|
// Previous situation(s) deduction(s)
|
||||||
for ($i = 0; $i < count($prevsits); $i++) {
|
for ($i = 0; $i < $cprevsits; $i++) {
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?facid=' . $prevsits[$i]->id . '">';
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?facid=' . $prevsits[$i]->id . '">';
|
||||||
print $langs->trans('SituationDeduction');
|
print $langs->trans('SituationDeduction');
|
||||||
@ -3629,6 +3631,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deprecated. Useless because now we can use templates
|
||||||
if (! empty($conf->global->FACTURE_SHOW_SEND_REMINDER)) // For backward compatibility
|
if (! empty($conf->global->FACTURE_SHOW_SEND_REMINDER)) // For backward compatibility
|
||||||
{
|
{
|
||||||
if (($object->statut == 1 || $object->statut == 2) && $resteapayer > 0) {
|
if (($object->statut == 1 || $object->statut == 2) && $resteapayer > 0) {
|
||||||
@ -3684,7 +3687,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Classify paid
|
// Classify paid
|
||||||
if ($object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))
|
if ($object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))
|
||||||
|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $resteapayer == 0 && $user->rights->facture->paiement && empty($discount->id))
|
|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $user->rights->facture->paiement && empty($discount->id))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a></div>';
|
||||||
@ -3714,10 +3717,10 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=clone&object=invoice">' . $langs->trans("ToClone") . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=clone&object=invoice">' . $langs->trans("ToClone") . '</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone as predefined
|
// Clone as predefined / Create template
|
||||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $user->rights->facture->creer)
|
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
if (! $objectidnext)
|
if (! $objectidnext && count($object->lines) > 0)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="facture/fiche-rec.php?facid=' . $object->id . '&action=create">' . $langs->trans("ChangeIntoRepeatableInvoice") . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="facture/fiche-rec.php?facid=' . $object->id . '&action=create">' . $langs->trans("ChangeIntoRepeatableInvoice") . '</a></div>';
|
||||||
}
|
}
|
||||||
@ -3732,7 +3735,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Create next situation invoice
|
// Create next situation invoice
|
||||||
if ($user->rights->facture->creer && ($object->type == 5) && ($object->statut == 1 || $object->statut == 2)) {
|
if ($user->rights->facture->creer && ($object->type == 5) && ($object->statut == 1 || $object->statut == 2)) {
|
||||||
if ($object->is_last_in_cycle() && $object->situation_final != 1) {
|
if ($object->is_last_in_cycle() && $object->situation_final != 1) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=create&type=5&origin=facture&originid=' . $object->id . '&socid=' . $object->socid . '" >' . $langs->trans('CreateNextSituationInvoice') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=create&type=5&origin=facture&originid=' . $object->id . '&socid=' . $object->socid . '" >' . $langs->trans('CreateNextSituationInvoice') . '</a></div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user