New: Dans la fonction payé partiellement on distingue le motif mauvais payeur du motif autre
This commit is contained in:
parent
3101e5278c
commit
659b9e7dfd
@ -261,34 +261,29 @@ if ($_POST['action'] == 'confirm_payed' && $_POST['confirm'] == 'yes' && $user->
|
|||||||
}
|
}
|
||||||
if ($_POST['action'] == 'confirm_payed_partially' && $_POST['confirm'] == 'yes' && $user->rights->facture->paiement)
|
if ($_POST['action'] == 'confirm_payed_partially' && $_POST['confirm'] == 'yes' && $user->rights->facture->paiement)
|
||||||
{
|
{
|
||||||
$fac = new Facture($db);
|
$fac = new Facture($db);
|
||||||
$fac->fetch($_GET['facid']);
|
$fac->fetch($_GET['facid']);
|
||||||
$close_code=$_POST["close_code"];
|
$close_code=$_POST["close_code"];
|
||||||
$close_note=$_POST["close_note"];
|
$close_note=$_POST["close_note"];
|
||||||
if ($close_code)
|
if ($close_code)
|
||||||
{
|
|
||||||
/*
|
|
||||||
if ($close_code == 'other' && ! $close_note)
|
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Comment")).'</div>';
|
if ($close_code == 'abandon')
|
||||||
|
{
|
||||||
|
$result = $fac->set_canceled($user,$close_code,$close_note);
|
||||||
|
}
|
||||||
|
elseif ($close_code == 'badcustomer')
|
||||||
|
{
|
||||||
|
$result = $fac->set_canceled($user,$close_code,$close_note);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$result = $fac->set_payed($user,$close_code,$close_note);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*/
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Reason")).'</div>';
|
||||||
if ($close_code == 'abandon')
|
|
||||||
{
|
|
||||||
$result = $fac->set_canceled($user,$close_code,$close_note);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$result = $fac->set_payed($user,$close_code,$close_note);
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Reason")).'</div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1684,27 +1679,35 @@ else
|
|||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed');
|
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed');
|
||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
if ($_GET['action'] == 'payed' && $resteapayer > 0)
|
if ($_GET['action'] == 'payed' && $resteapayer > 0)
|
||||||
{
|
{
|
||||||
// Crée un tableau formulaire
|
// Code
|
||||||
//$helpescompte_avoir=$langs->trans("ConfirmClassifyPayedPartiallyAvoir");
|
$close[0]['code']='discount_vat';
|
||||||
$helpescompte_vat =$langs->trans("HelpEscompte").'<br><br>'.$langs->trans("ConfirmClassifyPayedPartiallyVat");
|
$close[1]['code']='badcustomer';
|
||||||
$helpescompte_abandon=$langs->trans("ConfirmClassifyPayedPartiallyAbandon");
|
$close[2]['code']='abandon';
|
||||||
//$reason_avoir =$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonAvoir",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$helpescompte_avoir,1);
|
// Help
|
||||||
$reason_vat =$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$helpescompte_vat,1);
|
$close[0]['label']=$langs->trans("HelpEscompte").'<br><br>'.$langs->trans("ConfirmClassifyPayedPartiallyVat");
|
||||||
$reason_abandon=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonAbandon",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$helpescompte_abandon,1);
|
$close[1]['label']=$langs->trans("ConfirmClassifyPayedPartiallyBadCustomer");
|
||||||
//$arrayreasons['avoir'] =$reason_avoir;
|
$close[2]['label']=$langs->trans("ConfirmClassifyPayedPartiallyOther");
|
||||||
$arrayreasons['discount_vat']=$reason_vat;
|
// Texte
|
||||||
$arrayreasons['abandon'] =$reason_abandon;
|
$close[0]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[0]['label'],1);
|
||||||
$formquestion=array(
|
$close[1]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[1]['label'],1);
|
||||||
'text' => $langs->trans("ConfirmClassifyPayedPartiallyQuestion"),
|
$close[2]['reason']=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonOther",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[2]['label'],1);
|
||||||
array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons),
|
// arrayreasons
|
||||||
array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100')
|
$arrayreasons[$close[0]['code']]=$close[0]['reason'];
|
||||||
);
|
$arrayreasons[$close[1]['code']]=$close[1]['reason'];
|
||||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
$arrayreasons[$close[2]['code']]=$close[2]['reason'];
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedPartially',$fac->ref),'confirm_payed_partially',$formquestion);
|
|
||||||
print '<br />';
|
// Crée un tableau formulaire
|
||||||
}
|
$formquestion=array(
|
||||||
|
'text' => $langs->trans("ConfirmClassifyPayedPartiallyQuestion"),
|
||||||
|
array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons),
|
||||||
|
array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100')
|
||||||
|
);
|
||||||
|
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||||
|
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedPartially',$fac->ref),'confirm_payed_partially',$formquestion);
|
||||||
|
print '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation du classement abandonne
|
* Confirmation du classement abandonne
|
||||||
|
|||||||
@ -867,7 +867,6 @@ class Facture extends CommonObject
|
|||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET';
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET';
|
||||||
$sql.= ' paye=1';
|
$sql.= ' paye=1';
|
||||||
if ($close_code) $sql.= ", close_code='".addslashes($close_code)."'";
|
if ($close_code) $sql.= ", close_code='".addslashes($close_code)."'";
|
||||||
if ($close_note) $sql.= ", close_note='".addslashes($close_note)."'";
|
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@ -116,11 +116,13 @@ ConfirmClassifyPayedPartiallyQuestion=This invoice has not been payed completely
|
|||||||
ConfirmClassifyPayedPartiallyReasonAvoir=Remainder to pay <b>(%s %s)</b> is a discount granted because payment was made before term. Je régularise la TVA par un avoir.
|
ConfirmClassifyPayedPartiallyReasonAvoir=Remainder to pay <b>(%s %s)</b> is a discount granted because payment was made before term. Je régularise la TVA par un avoir.
|
||||||
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.
|
||||||
ConfirmClassifyPayedPartiallyReasonAbandon=Debit irremediably not recoverable (bad customer...)
|
ConfirmClassifyPayedPartiallyReasonBadCustomer=Bad customer
|
||||||
|
ConfirmClassifyPayedPartiallyReasonOther=Debit irremediably not recoverable (other reason)
|
||||||
ConfirmClassifyPayedPartiallyNoVat=Ce choix est possible si votre facture était munie de la mention adéquate. (Exemple: « escompte net de taxe »)
|
ConfirmClassifyPayedPartiallyNoVat=Ce choix est possible si votre facture était munie de la mention adéquate. (Exemple: « escompte net de taxe »)
|
||||||
ConfirmClassifyPayedPartiallyVat=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»)
|
ConfirmClassifyPayedPartiallyVat=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»)
|
||||||
ConfirmClassifyPayedPartiallyAvoir=Use this choice if all other does not suit
|
ConfirmClassifyPayedPartiallyAvoir=Use this choice if all other does not suit
|
||||||
ConfirmClassifyPayedPartiallyAbandon=Ce choix sera celui dans le cas d'un mauvais payeur sans aucun espoir de recouvrement
|
ConfirmClassifyPayedPartiallyBadCustomer=This choice will be use for bad customers with no hope to be paied
|
||||||
|
ConfirmClassifyPayedPartiallyOther=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
|
||||||
NumberOfBills=Nb of invoices
|
NumberOfBills=Nb of invoices
|
||||||
|
|||||||
@ -117,11 +117,13 @@ ConfirmClassifyPayedPartiallyQuestion=Cette facture n'a pas
|
|||||||
ConfirmClassifyPayedPartiallyReasonAvoir=Le reste à payer <b>(%s %s)</b> est un trop facturé (car article retourné, oubli, escompte non défini...) régularisé par un avoir
|
ConfirmClassifyPayedPartiallyReasonAvoir=Le reste à payer <b>(%s %s)</b> est un trop facturé (car article retourné, oubli, escompte non défini...) régularisé par un avoir
|
||||||
ConfirmClassifyPayedPartiallyReasonDiscountNoVat=Le rest à payer <b>(%s %s)</b> est un escompte accordé après facture. J'accepte de perdre la TVA sur cet escompte
|
ConfirmClassifyPayedPartiallyReasonDiscountNoVat=Le rest à 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
|
||||||
ConfirmClassifyPayedPartiallyReasonAbandon=Créance définitivement abandonnée (client irrécouvrable...)
|
ConfirmClassifyPayedPartiallyReasonBadCustomer=Mauvais payeur
|
||||||
|
ConfirmClassifyPayedPartiallyReasonOther=Créance définitivement abandonnée (tout autre cas)
|
||||||
ConfirmClassifyPayedPartiallyAvoir=Ce choix est le choix à prendre si les autres ne sont pas applicables
|
ConfirmClassifyPayedPartiallyAvoir=Ce choix est le choix à prendre si les autres ne sont pas applicables
|
||||||
ConfirmClassifyPayedPartiallyNoVat=Ce choix est possible si votre facture était munie de la mention adéquate. (Exemple: «escompte net de taxe»)
|
ConfirmClassifyPayedPartiallyNoVat=Ce choix est possible si votre facture était munie de la mention adéquate. (Exemple: «escompte net de taxe»)
|
||||||
ConfirmClassifyPayedPartiallyVat=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»)
|
ConfirmClassifyPayedPartiallyVat=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»)
|
||||||
ConfirmClassifyPayedPartiallyAbandon=Ce choix sera celui dans le cas d'un mauvais payeur sans aucun espoir de recouvrement
|
ConfirmClassifyPayedPartiallyBadCustomer=Ce choix sera celui dans le cas d'un mauvais payeur
|
||||||
|
ConfirmClassifyPayedPartiallyOther=Ce choix sera celui dans tout autre cas
|
||||||
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 ?
|
||||||
ValidateBill=Valider facture
|
ValidateBill=Valider facture
|
||||||
NumberOfBills=Nb de factures
|
NumberOfBills=Nb de factures
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user