Skip to content
Snippets Groups Projects
Commit 736e9c2b authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Dans le cas de facture payé partiellement, mais classé malgré tout, le...

Fix: Dans le cas de facture payé partiellement, mais classé malgré tout, le reste à payé doit etre 0 sauf pour le cas mauvais payeur (ce dernier doit toujours pouvoir payé s'il le veut).
parent c5688e86
No related branches found
No related tags found
No related merge requests found
......@@ -1682,21 +1682,28 @@ else
if ($_GET['action'] == 'payed' && $resteapayer > 0)
{
// Code
$close[0]['code']='discount_vat';
$close[1]['code']='badcustomer';
$close[2]['code']='abandon';
$i=0;
$close[$i]['code']='discount_vat';$i++;
$close[$i]['code']='badcustomer';$i++;
//$close[$i]['code']='product_returned';$i++;
$close[$i]['code']='abandon';$i++;
// Help
$close[0]['label']=$langs->trans("HelpEscompte").'<br><br>'.$langs->trans("ConfirmClassifyPayedPartiallyReasonDiscountVatDesc");
$close[1]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonBadCustomerDesc");
$close[2]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonOtherDesc");
$i=0;
$close[$i]['label']=$langs->trans("HelpEscompte").'<br><br>'.$langs->trans("ConfirmClassifyPayedPartiallyReasonDiscountVatDesc");$i++;
$close[$i]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonBadCustomerDesc");$i++;
//$close[$i]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonProductReturned");$i++;
$close[$i]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonOtherDesc");$i++;
// Texte
$close[0]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[0]['label'],1);
$close[1]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[1]['label'],1);
$close[2]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonOther",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[2]['label'],1);
// arrayreasons
$arrayreasons[$close[0]['code']]=$close[0]['reason'];
$arrayreasons[$close[1]['code']]=$close[1]['reason'];
$arrayreasons[$close[2]['code']]=$close[2]['reason'];
$i=0;
$close[$i]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
$close[$i]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
//$close[$i]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonProductReturned",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
$close[$i]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonOther",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
// arrayreasons[code]=reason
foreach($close as $key => $val)
{
$arrayreasons[$close[$key]['code']]=$close[$key]['reason'];
}
// Cre un tableau formulaire
$formquestion=array(
......@@ -1916,8 +1923,9 @@ else
// Factur
print '<tr><td colspan="2" align="right">'.$langs->trans("Billed").' :</td><td align="right" style="border: 1px solid;">'.price($fac->total_ttc).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
$resteapayeraffiche=$resteapayer;
// Pay partiellement 'escompte'
if ($fac->close_code == 'escompte')
if (($fac->statut == 2 || $fac->statut == 3) && $fac->close_code == 'escompte')
{
print '<tr><td colspan="2" align="right" nowrap="1">';
print $html->textwithhelp($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1);
......@@ -1925,15 +1933,23 @@ else
$resteapayeraffiche=0;
}
// Pay partiellement ou Abandon 'badcustomer'
if (($fac->fk_statut == 2 || $fac->fk_statut == 3) && $fac->close_code == 'badcustomer')
if (($fac->statut == 2 || $fac->statut == 3) && $fac->close_code == 'badcustomer')
{
print '<tr><td colspan="2" align="right" nowrap="1">';
print $html->textwithhelp($langs->trans("Abandoned").':',$langs->trans("HelpAbandonBadCustomer"),-1);
print '</td><td align="right">'.price($fac->total_ttc - $totalpaye).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
//$resteapayeraffiche=0;
}
// Pay partiellement ou Abandon 'product_returned'
if (($fac->statut == 2 || $fac->statut == 3) && $fac->close_code == 'product_returned')
{
print '<tr><td colspan="2" align="right" nowrap="1">';
print $html->textwithhelp($langs->trans("ProductReturned").':',$langs->trans("HelpAbandonProductReturned"),-1);
print '</td><td align="right">'.price($fac->total_ttc - $totalpaye).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
$resteapayeraffiche=0;
}
// Abandon 'abandon'
if (($fac->fk_statut == 2 || $fac->fk_statut == 3) && $fac->close_code == 'abandon')
// Pay partiellement ou Abandon 'abandon'
if (($fac->statut == 2 || $fac->statut == 3) && $fac->close_code == 'abandon')
{
print '<tr><td colspan="2" align="right" nowrap="1">';
print $html->textwithhelp($langs->trans("Abandoned").':',$langs->trans("HelpAbandonOther"),-1);
......
......@@ -125,11 +125,13 @@ ConfirmClassifyPayedPartiallyReasonAvoir=Remainder to pay <b>(%s %s)</b> is a di
ConfirmClassifyPayedPartiallyReasonDiscountNoVat=Remainder to pay <b>(%s %s)</b> is a discount granted because payment was made before term. J'accepte de perdre la TVA sur cet escompte.
ConfirmClassifyPayedPartiallyReasonDiscountVat=Remainder to pay <b>(%s %s)</b> is a discount granted because payment was made before term. Je rcupre la TVA sur cet escompte sans avoir.
ConfirmClassifyPayedPartiallyReasonBadCustomer=Bad customer
ConfirmClassifyPayedPartiallyReasonProductReturned=Products partially returned
ConfirmClassifyPayedPartiallyReasonOther=Debit irremediably not recoverable (other reason)
ConfirmClassifyPayedPartiallyReasonDiscountNoVatDesc=Ce choix est possible si votre facture tait munie de la mention adquate. (Exemple: escompte net de taxe )
ConfirmClassifyPayedPartiallyReasonDiscountVatDesc=Ce choix est possible si votre facture tait munie de la mention adquate. (Exemple: seule la taxe correspondant au prix effectivement pay ouvre droit dduction)
ConfirmClassifyPayedPartiallyReasonAvoirDesc=Use this choice if all other does not suit
ConfirmClassifyPayedPartiallyReasonBadCustomerDesc=This choice will be use for bad customers with no hope to be paied
ConfirmClassifyPayedPartiallyReasonProductReturnedDesc=This choice is used when apyment is not complete because some of products were returned
ConfirmClassifyPayedPartiallyReasonOtherDesc=Use this choice if all other does not suit
ConfirmCustomerPayment=Do you confirm this paiement input for <b>%s</b> %s ?
ValidateBill=Validate invoice
......
......@@ -125,12 +125,14 @@ ConfirmClassifyPayedPartiallyReasonAvoir=Le reste
ConfirmClassifyPayedPartiallyReasonDiscountNoVat=Le reste à payer <b>(%s %s)</b> est un escompte accordé après facture. J'accepte de perdre la TVA sur cet escompte
ConfirmClassifyPayedPartiallyReasonDiscountVat=Le reste à payer <b>(%s %s)</b> est un escompte
ConfirmClassifyPayedPartiallyReasonBadCustomer=Mauvais payeur
ConfirmClassifyPayedPartiallyReasonProductReturned=Produits en partie retournés
ConfirmClassifyPayedPartiallyReasonOther=Créance définitivement abandonnée (tout autre cas)
ConfirmClassifyPayedPartiallyReasonDiscountNoVatDesc=Ce choix est possible si votre facture était munie de la mention adéquate. (Exemple: «escompte net de taxe»)
ConfirmClassifyPayedPartiallyReasonDiscountVatDesc=Ce choix est possible si votre facture était munie de la mention adéquate. (Exemple: mention définissant l'escompte ou du genre «seule la taxe correspondant au prix effectivement payé ouvre droit à déduction»)
ConfirmClassifyPayedPartiallyReasonAvoirDesc=Ce choix est le choix à prendre si les autres ne sont pas applicables
ConfirmClassifyPayedPartiallyReasonBadCustomerDesc=Ce choix sera celui dans le cas d'un mauvais payeur
ConfirmClassifyPayedPartiallyReasonOtherDesc=Ce choix sera celui dans tout autre cas
ConfirmClassifyPayedPartiallyReasonProductReturnedDesc=Ce choix sera celui dans le cas paiement incomplet suite à retour d'une partie des produits
ConfirmClassifyPayedPartiallyReasonOtherDesc=Ce choix sera celui dans tout autre cas.<br>Par exemple, dans le cas d'un paiement partiel car une partie des produits a été retourné.
ConfirmClassifyAbandonReasonOther=Autre
ConfirmClassifyAbandonReasonOtherDesc=Ce choix sera celui dans tout autre cas. Par exemple suite à intention de créer une facture de remplacement.
ConfirmCustomerPayment=Confirmez-vous la saisie de ce réglement de <b>%s</b> %s ?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment