Meilleur affichage liens factures de doit - remplacement sur PDF.

This commit is contained in:
Laurent Destailleur 2007-02-12 04:57:56 +00:00
parent 71682e3f33
commit 1fe933fa17
4 changed files with 42 additions and 9 deletions

View File

@ -2408,9 +2408,12 @@ else
}
// Récurrente
if (! $conf->global->FACTURE_DISABLE_RECUR)
if (! $conf->global->FACTURE_DISABLE_RECUR && $fac->type == 0)
{
print '<a class="butAction" href="facture/fiche-rec.php?facid='.$fac->id.'&amp;action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
if (! $facidnext)
{
print '<a class="butAction" href="facture/fiche-rec.php?facid='.$fac->id.'&amp;action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
}
}
// Valider
@ -2493,17 +2496,30 @@ else
}
else
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&amp;action=canceled">'.$langs->trans('ClassifyCanceled').'</a>';
// \todo
// Ajouter bouton "Annuler et Créer facture remplacement"
if ($facidnext)
{
print '<a class="butActionRefused">'.$langs->trans('ClassifyCanceled').'</span>';
}
else
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&amp;action=canceled">'.$langs->trans('ClassifyCanceled').'</a>';
// \todo
// Ajouter bouton "Annuler et Créer facture remplacement"
}
}
}
// Supprimer
if ($fac->is_erasable() && $user->rights->facture->supprimer && $_GET['action'] != 'delete')
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
if ($facidnext)
{
print '<span class="butActionDeleteRefused">'.$langs->trans('Delete').'</span>';
}
else
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
}
print '</div>';

View File

@ -875,6 +875,17 @@ class pdf_crabe extends ModelePDFFactures
$posy+=1;
$pdf->SetFont('Arial','',10);
$facidnext=$object->getIdReplacingInvoice('validated');
if ($object->type == 0 && $facidnext)
{
$objectreplacing=new Facture($this->db);
$objectreplacing->fetch($facidnext);
$posy+=5;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$objectreplacing->ref, '', 'R');
}
if ($object->type == 1)
{
$objectreplaced=new Facture($this->db);
@ -883,7 +894,7 @@ class pdf_crabe extends ModelePDFFactures
$posy+=5;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplaceInvoice", $objectreplaced->ref), '', 'R');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementInvoice").' : '.$objectreplaced->ref, '', 'R');
}
if ($object->type == 2)
{
@ -893,7 +904,7 @@ class pdf_crabe extends ModelePDFFactures
$posy+=5;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectInvoice", $objectreplaced->ref), '', 'R');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$objectreplaced->ref, '', 'R');
}
$posy+=5;

View File

@ -18,8 +18,11 @@ InvoiceAvoir=Credit note
InvoiceAvoirAsk=Credit note to correct invoice
InvoiceAvoirDesc=The <b>credit note</b> is a negative invoice used to solve fact that an invoice has an higher amount that should be (all possible reasons) or a product returned after invoice was payed.
ReplaceInvoice=Replace invoice %s
ReplacementInvoice=Replacement invoice
ReplacedByInvoice=Replaced by invoice %s
ReplacementByInvoice=Replaced by invoice
CorrectInvoice=Correct invoice %s
CorrectionInvoice=Correction invoice
NoReplacableInvoice=No replacable invoices
NoInvoiceToCorrect=No invoice to correct
InvoiceHasAvoir=Corrected by one or several invoices

View File

@ -18,8 +18,11 @@ InvoiceAvoir=Facture avoir
InvoiceAvoirAsk=Facture avoir pour correction de la facture
InvoiceAvoirDesc=La <b>facture d'avoir</b> est une facture négative destinée à compenser une facture comportant un montant supérieur à ce qui aurait du (toutes causes possibles) ou parce qu'un produit a été retourné après que la facture soit payée.
ReplaceInvoice=Remplace la facture %s
ReplacementInvoice=Remplacement facture
ReplacedByInvoice=Remplacée par la facture %s
ReplacementByInvoice=Remplacée par facture
CorrectInvoice=Corrige facture %s
CorrectionInvoice=Correction facture
NoReplacableInvoice=Pas de factures remplacables
NoInvoiceToCorrect=Pas de factures à corriger
InvoiceHasAvoir=Corrigée par un ou plusieurs avoirs