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).

This commit is contained in:
Laurent Destailleur 2007-03-24 18:03:26 +00:00
parent c5688e8665
commit 736e9c2b8b
3 changed files with 40 additions and 20 deletions

View File

@ -1682,21 +1682,28 @@ else
if ($_GET['action'] == 'payed' && $resteapayer > 0) if ($_GET['action'] == 'payed' && $resteapayer > 0)
{ {
// Code // Code
$close[0]['code']='discount_vat'; $i=0;
$close[1]['code']='badcustomer'; $close[$i]['code']='discount_vat';$i++;
$close[2]['code']='abandon'; $close[$i]['code']='badcustomer';$i++;
//$close[$i]['code']='product_returned';$i++;
$close[$i]['code']='abandon';$i++;
// Help // Help
$close[0]['label']=$langs->trans("HelpEscompte").'<br><br>'.$langs->trans("ConfirmClassifyPayedPartiallyReasonDiscountVatDesc"); $i=0;
$close[1]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonBadCustomerDesc"); $close[$i]['label']=$langs->trans("HelpEscompte").'<br><br>'.$langs->trans("ConfirmClassifyPayedPartiallyReasonDiscountVatDesc");$i++;
$close[2]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonOtherDesc"); $close[$i]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonBadCustomerDesc");$i++;
//$close[$i]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonProductReturned");$i++;
$close[$i]['label']=$langs->trans("ConfirmClassifyPayedPartiallyReasonOtherDesc");$i++;
// Texte // Texte
$close[0]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[0]['label'],1); $i=0;
$close[1]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[1]['label'],1); $close[$i]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
$close[2]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonOther",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[2]['label'],1); $close[$i]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
// arrayreasons //$close[$i]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonProductReturned",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
$arrayreasons[$close[0]['code']]=$close[0]['reason']; $close[$i]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonOther",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
$arrayreasons[$close[1]['code']]=$close[1]['reason']; // arrayreasons[code]=reason
$arrayreasons[$close[2]['code']]=$close[2]['reason']; foreach($close as $key => $val)
{
$arrayreasons[$close[$key]['code']]=$close[$key]['reason'];
}
// Crée un tableau formulaire // Crée un tableau formulaire
$formquestion=array( $formquestion=array(
@ -1916,8 +1923,9 @@ else
// Facturé // 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>'; 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; $resteapayeraffiche=$resteapayer;
// Payé partiellement 'escompte' // 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 '<tr><td colspan="2" align="right" nowrap="1">';
print $html->textwithhelp($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1); print $html->textwithhelp($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1);
@ -1925,15 +1933,23 @@ else
$resteapayeraffiche=0; $resteapayeraffiche=0;
} }
// Payé partiellement ou Abandon 'badcustomer' // 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 '<tr><td colspan="2" align="right" nowrap="1">';
print $html->textwithhelp($langs->trans("Abandoned").':',$langs->trans("HelpAbandonBadCustomer"),-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>'; 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; $resteapayeraffiche=0;
} }
// Abandon 'abandon' // Payé partiellement ou Abandon 'abandon'
if (($fac->fk_statut == 2 || $fac->fk_statut == 3) && $fac->close_code == 'abandon') if (($fac->statut == 2 || $fac->statut == 3) && $fac->close_code == 'abandon')
{ {
print '<tr><td colspan="2" align="right" nowrap="1">'; print '<tr><td colspan="2" align="right" nowrap="1">';
print $html->textwithhelp($langs->trans("Abandoned").':',$langs->trans("HelpAbandonOther"),-1); print $html->textwithhelp($langs->trans("Abandoned").':',$langs->trans("HelpAbandonOther"),-1);

View File

@ -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. 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 récupère la TVA sur cet escompte sans avoir. ConfirmClassifyPayedPartiallyReasonDiscountVat=Remainder to pay <b>(%s %s)</b> is a discount granted because payment was made before term. Je récupère la TVA sur cet escompte sans avoir.
ConfirmClassifyPayedPartiallyReasonBadCustomer=Bad customer ConfirmClassifyPayedPartiallyReasonBadCustomer=Bad customer
ConfirmClassifyPayedPartiallyReasonProductReturned=Products partially returned
ConfirmClassifyPayedPartiallyReasonOther=Debit irremediably not recoverable (other reason) ConfirmClassifyPayedPartiallyReasonOther=Debit irremediably not recoverable (other reason)
ConfirmClassifyPayedPartiallyReasonDiscountNoVatDesc=Ce choix est possible si votre facture était munie de la mention adéquate. (Exemple: « escompte net de taxe ») 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: «seule la taxe correspondant au prix effectivement payé ouvre droit à déduction») ConfirmClassifyPayedPartiallyReasonDiscountVatDesc=Ce choix est possible si votre facture était munie de la mention adéquate. (Exemple: «seule la taxe correspondant au prix effectivement payé ouvre droit à déduction»)
ConfirmClassifyPayedPartiallyReasonAvoirDesc=Use this choice if all other does not suit 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 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 ConfirmClassifyPayedPartiallyReasonOtherDesc=Use this choice if all other does not suit
ConfirmCustomerPayment=Do you confirm this paiement input for <b>%s</b> %s ? ConfirmCustomerPayment=Do you confirm this paiement input for <b>%s</b> %s ?
ValidateBill=Validate invoice ValidateBill=Validate invoice

View File

@ -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 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 ConfirmClassifyPayedPartiallyReasonDiscountVat=Le reste à payer <b>(%s %s)</b> est un escompte
ConfirmClassifyPayedPartiallyReasonBadCustomer=Mauvais payeur ConfirmClassifyPayedPartiallyReasonBadCustomer=Mauvais payeur
ConfirmClassifyPayedPartiallyReasonProductReturned=Produits en partie retournés
ConfirmClassifyPayedPartiallyReasonOther=Créance définitivement abandonnée (tout autre cas) 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») 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») 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 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 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 ConfirmClassifyAbandonReasonOther=Autre
ConfirmClassifyAbandonReasonOtherDesc=Ce choix sera celui dans tout autre cas. Par exemple suite à intention de créer une facture de remplacement. 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 ? ConfirmCustomerPayment=Confirmez-vous la saisie de ce réglement de <b>%s</b> %s ?