New: Ajout confirmation sur action Classer 'Abandonne'.
New: Le terme 'annul' des factures a t remplac par 'abandonne'. New: Quelques termes supplmentaires traduits.
This commit is contained in:
parent
0bd9bab4de
commit
5c4e98f2f7
@ -27,6 +27,8 @@ $user->getrights('facture');
|
||||
if (!$user->rights->facture->lire)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
require("../facture.class.php");
|
||||
require("../lib/CMailFile.class.php");
|
||||
require("../paiement.class.php");
|
||||
@ -214,12 +216,6 @@ if ($_GET["action"] == 'payed' && $user->rights->facture->paiement)
|
||||
$result = $fac->set_payed($_GET["facid"]);
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'canceled' && $user->rights->facture->paiement)
|
||||
{
|
||||
$fac = new Facture($db);
|
||||
$result = $fac->set_canceled($_GET["facid"]);
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'setremise' && $user->rights->facture->creer)
|
||||
{
|
||||
$fac = new Facture($db);
|
||||
@ -297,6 +293,18 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes)
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'confirm_canceled' && $_POST["confirm"] == yes)
|
||||
{
|
||||
if ($user->rights->facture->supprimer )
|
||||
{
|
||||
$fac = new Facture($db);
|
||||
$result = $fac->set_canceled($_GET["facid"]);
|
||||
$_GET["facid"] = 0 ;
|
||||
Header("Location: facture.php");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
@ -754,6 +762,15 @@ else
|
||||
{
|
||||
$html->form_confirm($_SERVER["PHP_SELF"]."?facid=$fac->id","Supprimer la facture","Etes-vous sûr de vouloir supprimer cette facture ?","confirm_delete");
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation du classement abandonné
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == 'canceled')
|
||||
{
|
||||
$html->form_confirm($_SERVER["PHP_SELF"]."?facid=$fac->id","Classer la facture à l'état 'Abandonnée'","La totalité du paiement de cette facture n'a pas été réalisée. Etes-vous sûr de vouloir abandonner définitivement cette facture ?","confirm_canceled");
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation de la validation
|
||||
@ -1052,7 +1069,7 @@ else
|
||||
{
|
||||
if ($user->rights->facture->valider)
|
||||
{
|
||||
print '<a class="tabAction" href="facture.php?facid='.$fac->id.'&action=valid">Valider</a>';
|
||||
print '<a class="tabAction" href="facture.php?facid='.$fac->id.'&action=valid">'.$langs->trans("Valid").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1062,11 +1079,11 @@ else
|
||||
{
|
||||
if ($fac->paye == 0)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"facture.php?facid=$fac->id&action=pdf\">Générer le PDF</a>";
|
||||
print "<a class=\"tabAction\" href=\"facture.php?facid=$fac->id&action=pdf\">".$langs->trans("BuildPDF")."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"facture.php?facid=$fac->id&action=pdf\">Regénérer le PDF</a>";
|
||||
print "<a class=\"tabAction\" href=\"facture.php?facid=$fac->id&action=pdf\">".$langs->trans("RebuildPDF")."</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1074,38 +1091,38 @@ else
|
||||
// Supprimer
|
||||
if ($fac->statut == 0 && $user->rights->facture->supprimer)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"facture.php?facid=$fac->id&action=delete\">Supprimer</a>";
|
||||
print "<a class=\"tabAction\" href=\"facture.php?facid=$fac->id&action=delete\">".$langs->trans("Delete")."</a>";
|
||||
}
|
||||
|
||||
// Envoyer
|
||||
if ($fac->statut == 1 && $user->rights->facture->envoyer)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"".$_SERVER["PHP_SELF"]."?facid=$fac->id&action=presend\">Envoyer</a>";
|
||||
print "<a class=\"tabAction\" href=\"".$_SERVER["PHP_SELF"]."?facid=$fac->id&action=presend\">".$langs->trans("Send")."</a>";
|
||||
}
|
||||
|
||||
// Envoyer une relance
|
||||
if ($fac->statut == 1 && price($resteapayer) > 0 && $user->rights->facture->envoyer)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"".$_SERVER["PHP_SELF"]."?facid=$fac->id&action=prerelance\">Envoyer relance</a>";
|
||||
print "<a class=\"tabAction\" href=\"".$_SERVER["PHP_SELF"]."?facid=$fac->id&action=prerelance\">".$langs->trans("SendRemind")."</a>";
|
||||
}
|
||||
|
||||
// Emettre paiement
|
||||
if ($fac->statut == 1 && price($resteapayer) > 0 && $user->rights->facture->paiement)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"paiement.php?facid=".$fac->id."&action=create\">Emettre paiement</a>";
|
||||
print "<a class=\"tabAction\" href=\"paiement.php?facid=".$fac->id."&action=create\">".$langs->trans("DoPaiement")."</a>";
|
||||
}
|
||||
|
||||
// Classer 'payé'
|
||||
if ($fac->statut == 1 && price($resteapayer) <= 0
|
||||
&& $fac->paye == 0 && $user->rights->facture->paiement)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"".$_SERVER["PHP_SELF"]."?facid=$fac->id&action=payed\">Classer 'Payée'</a>";
|
||||
print "<a class=\"tabAction\" href=\"".$_SERVER["PHP_SELF"]."?facid=$fac->id&action=payed\">".$langs->trans("ClassifyPayed")."</a>";
|
||||
}
|
||||
|
||||
// Classer 'annulée' (possible si validée et aucun paiement n'a encore eu lieu)
|
||||
if ($fac->statut == 1 && $fac->paye == 0 && $totalpaye == 0 && $user->rights->facture->paiement)
|
||||
// Classer 'abandonnée' (possible si validée et pas encore classer payée)
|
||||
if ($fac->statut == 1 && $fac->paye == 0 && $user->rights->facture->paiement)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"".$_SERVER["PHP_SELF"]."?facid=$fac->id&action=canceled\">Classer 'Annulée'</a>";
|
||||
print "<a class=\"tabAction\" href=\"".$_SERVER["PHP_SELF"]."?facid=$fac->id&action=canceled\">".$langs->trans("ClassifyCanceled")."</a>";
|
||||
}
|
||||
|
||||
// Récurrente
|
||||
@ -1494,7 +1511,7 @@ else
|
||||
}
|
||||
elseif ($objp->fk_statut == 3)
|
||||
{
|
||||
print '<td align="center">annulée</td>';
|
||||
print '<td align="center">abandonnée</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -432,7 +432,7 @@ class Facture
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le libellé du statut d'une facture (brouillon, validée, annulée, payée)
|
||||
* Retourne le libellé du statut d'une facture (brouillon, validée, abandonnée, payée)
|
||||
*
|
||||
*/
|
||||
Function get_libstatut()
|
||||
@ -459,7 +459,7 @@ class Facture
|
||||
$return = $this->db->query( $sql);
|
||||
}
|
||||
/**
|
||||
* Tag la facture comme annulée
|
||||
* Tag la facture comme abandonnée
|
||||
*
|
||||
*/
|
||||
Function set_canceled($rowid)
|
||||
@ -913,7 +913,7 @@ class Facture
|
||||
if (! $paye)
|
||||
{
|
||||
if ($statut == 0) return 'Brouillon (à valider)';
|
||||
if ($statut == 3) return 'Annulée';
|
||||
if ($statut == 3) return 'Abandonnée';
|
||||
return 'Validée (à payer)';
|
||||
}
|
||||
else
|
||||
|
||||
@ -289,6 +289,8 @@ class Form
|
||||
*/
|
||||
Function form_confirm($page, $title, $question, $action)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
print '<form method="post" action="'.$page.'">';
|
||||
print '<input type="hidden" name="action" value="'.$action.'">';
|
||||
print '<table cellspacing="0" class="border" width="100%" cellpadding="3">';
|
||||
@ -299,7 +301,7 @@ class Form
|
||||
$this->selectyesno("confirm","no");
|
||||
|
||||
print "</td>\n";
|
||||
print '<td class="valid" align="center"><input type="submit" value="Confirmer"</td></tr>';
|
||||
print '<td class="valid" align="center"><input type="submit" value="'.$langs->trans("Confirm").'"</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
@ -1,3 +1,12 @@
|
||||
# Dolibarr language file - en_US - bills
|
||||
Bill=Bill
|
||||
Bills=Bills
|
||||
Bills=Bills
|
||||
ClassifyPayed=Classify 'Payed'
|
||||
ClassifyCanceled=Classify 'Abandonned'
|
||||
Send=Send
|
||||
SendRemind=Send remind
|
||||
DoPaiement=Do paiement
|
||||
BuildPDF=Build PDF
|
||||
RebuildPDF=Rebuild PDF
|
||||
VAT=VAT
|
||||
Amount=Amount
|
||||
@ -1,3 +1,12 @@
|
||||
# Dolibarr language file - fr_FR - bills
|
||||
Bill=Facture
|
||||
Bills=Factures
|
||||
Bills=Factures
|
||||
ClassifyPayed=Classer 'Payée'
|
||||
ClassifyCanceled=Classer 'Abandonnée'
|
||||
Send=Envoyer
|
||||
SendRemind=Envoyer rappel
|
||||
DoPaiement=Emettre paiement
|
||||
BuildPDF=Générer le PDF
|
||||
RebuildPDF=Regénérer le PDF
|
||||
VAT=TVA
|
||||
Amount=Montant
|
||||
Loading…
Reference in New Issue
Block a user