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
|
// Ref
|
||||||
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
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
|
// 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 '<tr><td valign="top">'.$langs->trans('Type').'</td><td colspan="2">';
|
||||||
print '<table class="nobordernopadding"><tr>';
|
print '<table class="nobordernopadding"><tr>';
|
||||||
print '<td width="16px">';
|
print '<td width="16px">';
|
||||||
@ -985,18 +998,21 @@ if ($_GET['action'] == 'create')
|
|||||||
print $desc;
|
print $desc;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td>';
|
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>';
|
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=$langs->trans("InvoiceReplacementAsk").' ';
|
||||||
$text.='<select name="replacement_ref">';
|
$text.='<select name="replacement_ref">';
|
||||||
$text.='<option value="-1"> </option>';
|
if ($options)
|
||||||
$text.=$options;
|
{
|
||||||
|
$text.='<option value="-1"> </option>';
|
||||||
|
$text.=$options;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$text.='<option value="-1">'.$langs->trans("NoReplacableInvoice").'</option>';
|
||||||
|
}
|
||||||
$text.='</select>';
|
$text.='</select>';
|
||||||
$desc=$html->textwithhelp($text,$langs->transnoentities("InvoiceReplacementDesc"),1);
|
$desc=$html->textwithhelp($text,$langs->transnoentities("InvoiceReplacementDesc"),1);
|
||||||
print $desc;
|
print $desc;
|
||||||
@ -1010,13 +1026,6 @@ if ($_GET['action'] == 'create')
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</td></tr>';
|
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
|
// Ligne info remises tiers
|
||||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="2">';
|
||||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||||
@ -1536,6 +1545,11 @@ else
|
|||||||
// Reference
|
// Reference
|
||||||
print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="5">'.$fac->ref.'</td></tr>';
|
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
|
// Type
|
||||||
print '<tr><td width="20%">'.$langs->trans('Type').'</td><td colspan="5">';
|
print '<tr><td width="20%">'.$langs->trans('Type').'</td><td colspan="5">';
|
||||||
print $fac->getLibType();
|
print $fac->getLibType();
|
||||||
@ -1554,11 +1568,6 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
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
|
// Ligne info remises tiers
|
||||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
||||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||||
@ -1687,6 +1696,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
|
// Ref client
|
||||||
/*
|
/*
|
||||||
\todo
|
\todo
|
||||||
L'info "Reference commande client" est une carac de la commande et non de la facture.
|
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)
|
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans('RefCustomerOrder').'</td>';
|
print '<tr><td>';
|
||||||
|
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||||
if ($fac->brouillon == 1 && $user->rights->facture->creer)
|
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||||
{
|
print '</td>';
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'" method="post">';
|
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 '<input type="hidden" name="action" value="set_ref_client">';
|
print '</tr></table>';
|
||||||
print '<td colspan="3"><input type="text" name="ref_client" size="20" value="'.$fac->ref_client.'">';
|
print '</td><td colspan="3">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'"></td>';
|
if ($user->rights->facture->creer && $_GET['action'] == 'RefCustomerOrder')
|
||||||
print '</form>';
|
{
|
||||||
}
|
print '<form action="facture.php?facid='.$id.'" method="post">';
|
||||||
else
|
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 '<td colspan="3">'.$fac->ref_client.'</td>';
|
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
|
// Lit lignes de facture pour déterminer montant
|
||||||
// On s'en sert pas mais ca sert pour debuggage
|
// On s'en sert pas mais ca sert pour debuggage
|
||||||
|
|||||||
@ -12,13 +12,14 @@ InvoiceStandard=Standard invoice
|
|||||||
InvoiceStandardAsk=Standard invoice
|
InvoiceStandardAsk=Standard invoice
|
||||||
InvoiceStandardDesc=This kind of invoice is the common invoice.
|
InvoiceStandardDesc=This kind of invoice is the common invoice.
|
||||||
InvoiceReplacement=Replacement invoice. Must replace invoice with reference
|
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.
|
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
|
InvoiceAvoir=Avoir invoice
|
||||||
InvoiceAvoirAsk=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).
|
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
|
ReplaceInvoice=Replace invoice %s
|
||||||
ReplacedByInvoice=Replaced by invoice %s
|
ReplacedByInvoice=Replaced by invoice %s
|
||||||
|
NoReplacableInvoice=No replacable invoices
|
||||||
CardBill=Invoice card
|
CardBill=Invoice card
|
||||||
Invoice=Invoice
|
Invoice=Invoice
|
||||||
Invoices=Invoices
|
Invoices=Invoices
|
||||||
|
|||||||
@ -12,13 +12,14 @@ InvoiceStandard=Facture standard
|
|||||||
InvoiceStandardAsk=Facture standard
|
InvoiceStandardAsk=Facture standard
|
||||||
InvoiceStandardDesc=Ce type de facture est la facture traditionnelle. On l'appelle aussi <b>facture de doit</b>.
|
InvoiceStandardDesc=Ce type de facture est la facture traditionnelle. On l'appelle aussi <b>facture de doit</b>.
|
||||||
InvoiceReplacement=Facture de remplacement
|
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.
|
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
|
InvoiceAvoir=Facture avoir
|
||||||
InvoiceAvoirAsk=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).
|
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
|
ReplaceInvoice=Remplace la facture %s
|
||||||
ReplacedByInvoice=Remplacée par la facture %s
|
ReplacedByInvoice=Remplacée par la facture %s
|
||||||
|
NoReplacableInvoice=Pas de factures remplacables
|
||||||
CardBill=Fiche facture
|
CardBill=Fiche facture
|
||||||
Invoice=Facture
|
Invoice=Facture
|
||||||
Invoices=Factures
|
Invoices=Factures
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user