diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 646d61da7a44872cfa7a2b404d347673918133cb..c035fd8158c947176a3f0a45f516423db158c405 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1672,8 +1672,8 @@ else } /* - * Confirmation du classement pay� - */ + * Confirmation du classement pay� + */ if ($_GET['action'] == 'payed' && $resteapayer <= 0) { $html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed'); @@ -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']; + } // Cr�e 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); diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index b66a37e13d42c57cb9157e61cbf274cd0eda77b8..202b7ec46a500af531d5b148345e8902445023de 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -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 r�cup�re 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 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�) 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 diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index b2bb6162917ed7547c9b12badbf065d7f46064a8..c3bac9acf000dae64ebd17aee2ea361821a0cbd8 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -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 ?