New: Gestion des factures de remplacement et debut de gestion des avoirs
This commit is contained in:
parent
07949ce4c5
commit
aca42cb11c
@ -975,7 +975,20 @@ if ($_GET['action'] == 'create')
|
||||
// Ref
|
||||
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
||||
|
||||
// Societe
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">';
|
||||
print $soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socidp" value="'.$soc->id.'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Type de facture
|
||||
$facids=$facturestatic->list_replacable_invoices($soc->id);
|
||||
$options="";
|
||||
foreach ($facids as $key => $value)
|
||||
{
|
||||
$options.='<option value="'.$key.'">'.$value.'</option>';
|
||||
}
|
||||
print '<tr><td valign="top">'.$langs->trans('Type').'</td><td colspan="2">';
|
||||
print '<table class="nobordernopadding"><tr>';
|
||||
print '<td width="16px">';
|
||||
@ -985,18 +998,21 @@ if ($_GET['action'] == 'create')
|
||||
print $desc;
|
||||
print '</td></tr>';
|
||||
print '<tr><td>';
|
||||
print '<input type="radio" name="type" value="1"'.($_POST['type']==1?' checked=true':'').'>';
|
||||
print '<input type="radio" name="type" value="1"'.($_POST['type']==1?' checked=true':'');
|
||||
if (! $options) print ' disabled="true"';
|
||||
print '>';
|
||||
print '</td><td>';
|
||||
$facids=$facturestatic->list_replacable_invoices($soc->id);
|
||||
$options="";
|
||||
foreach ($facids as $key => $value)
|
||||
{
|
||||
$options.='<option value="'.$key.'">'.$value.'</option>';
|
||||
}
|
||||
$text=$langs->trans("InvoiceReplacementAsk").' ';
|
||||
$text.='<select name="replacement_ref">';
|
||||
$text.='<option value="-1"> </option>';
|
||||
$text.=$options;
|
||||
if ($options)
|
||||
{
|
||||
$text.='<option value="-1"> </option>';
|
||||
$text.=$options;
|
||||
}
|
||||
else
|
||||
{
|
||||
$text.='<option value="-1">'.$langs->trans("NoReplacableInvoice").'</option>';
|
||||
}
|
||||
$text.='</select>';
|
||||
$desc=$html->textwithhelp($text,$langs->transnoentities("InvoiceReplacementDesc"),1);
|
||||
print $desc;
|
||||
@ -1010,13 +1026,6 @@ if ($_GET['action'] == 'create')
|
||||
print '</table>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Societe
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">';
|
||||
print $soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socidp" value="'.$soc->id.'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="2">';
|
||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||
@ -1536,6 +1545,11 @@ else
|
||||
// Reference
|
||||
print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="5">'.$fac->ref.'</td></tr>';
|
||||
|
||||
// Société
|
||||
print '<tr><td>'.$langs->trans('Company').'</td>';
|
||||
print '<td colspan="5">'.$soc->getNomUrl(1,'compta').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td width="20%">'.$langs->trans('Type').'</td><td colspan="5">';
|
||||
print $fac->getLibType();
|
||||
@ -1554,11 +1568,6 @@ else
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Société
|
||||
print '<tr><td>'.$langs->trans('Company').'</td>';
|
||||
print '<td colspan="5">'.$soc->getNomUrl(1,'compta').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||
@ -1687,6 +1696,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Ref client
|
||||
/*
|
||||
\todo
|
||||
L'info "Reference commande client" est une carac de la commande et non de la facture.
|
||||
@ -1695,21 +1705,28 @@ else
|
||||
*/
|
||||
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('RefCustomerOrder').'</td>';
|
||||
|
||||
if ($fac->brouillon == 1 && $user->rights->facture->creer)
|
||||
{
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="set_ref_client">';
|
||||
print '<td colspan="3"><input type="text" name="ref_client" size="20" value="'.$fac->ref_client.'">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'"></td>';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="3">'.$fac->ref_client.'</td>';
|
||||
}
|
||||
}
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||
print '</td>';
|
||||
if ($_GET['action'] != 'RefCustomerOrder' && $fac->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=RefCustomerOrder&facid='.$fac->id.'">'.img_edit($langs->trans('Edit')).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($user->rights->facture->creer && $_GET['action'] == 'RefCustomerOrder')
|
||||
{
|
||||
print '<form action="facture.php?facid='.$id.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="set_ref_client">';
|
||||
print '<input type="text" class="flat" size="20" name="ref_client" value="'.$fac->ref_client.'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $fac->ref_client;
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Lit lignes de facture pour déterminer montant
|
||||
// On s'en sert pas mais ca sert pour debuggage
|
||||
|
||||
@ -12,13 +12,14 @@ InvoiceStandard=Standard invoice
|
||||
InvoiceStandardAsk=Standard invoice
|
||||
InvoiceStandardDesc=This kind of invoice is the common invoice.
|
||||
InvoiceReplacement=Replacement invoice. Must replace invoice with reference
|
||||
InvoiceReplacementAsk=Replacement invoice for following invoice
|
||||
InvoiceReplacementAsk=Replacement invoice for invoice
|
||||
InvoiceReplacementDesc=<b>Replacement invoice</b> is used to cancel and replace completely an invoice with no paiement already recevided.<br>Reference of canceled invoice is required.
|
||||
InvoiceAvoir=Avoir invoice
|
||||
InvoiceAvoirAsk=Avoir invoice
|
||||
InvoiceAvoirDesc=La <b>facture d'avoir</b> est une facture négative destinée à compenser une facture comportant un montant supérieur à ce qui a été ou sera réellement payé (toutes causes possibles).
|
||||
ReplaceInvoice=Replace invoice %s
|
||||
ReplacedByInvoice=Replaced by invoice %s
|
||||
NoReplacableInvoice=No replacable invoices
|
||||
CardBill=Invoice card
|
||||
Invoice=Invoice
|
||||
Invoices=Invoices
|
||||
|
||||
@ -12,13 +12,14 @@ InvoiceStandard=Facture standard
|
||||
InvoiceStandardAsk=Facture standard
|
||||
InvoiceStandardDesc=Ce type de facture est la facture traditionnelle. On l'appelle aussi <b>facture de doit</b>.
|
||||
InvoiceReplacement=Facture de remplacement
|
||||
InvoiceReplacementAsk=Facture de remplacement de la facture suivante
|
||||
InvoiceReplacementAsk=Facture de remplacement de la facture
|
||||
InvoiceReplacementDesc=La <b>facture de remplacement</b> sert à annuler et remplacer une facture existante sur laquelle aucun paiement n'a encore eu lieu.<br>La référence de la facture qui doit être annulée est obligatoire.
|
||||
InvoiceAvoir=Facture avoir
|
||||
InvoiceAvoirAsk=Facture avoir
|
||||
InvoiceAvoirDesc=La <b>facture d'avoir</b> est une facture négative destinée à compenser une facture comportant un montant supérieur à ce qui a été ou sera réellement payé (toutes causes possibles).
|
||||
ReplaceInvoice=Remplace la facture %s
|
||||
ReplacedByInvoice=Remplacée par la facture %s
|
||||
NoReplacableInvoice=Pas de factures remplacables
|
||||
CardBill=Fiche facture
|
||||
Invoice=Facture
|
||||
Invoices=Factures
|
||||
|
||||
Loading…
Reference in New Issue
Block a user