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

Fix: Statut facture d'une propale non gr

parent 07321930
No related branches found
No related tags found
No related merge requests found
...@@ -431,7 +431,7 @@ if ($_GET["propalid"]) ...@@ -431,7 +431,7 @@ if ($_GET["propalid"])
print '<a class="butAction" href="facture.php?propalid='.$propal->id."&action=create\">".$langs->trans("BuildBill")."</a>"; print '<a class="butAction" href="facture.php?propalid='.$propal->id."&action=create\">".$langs->trans("BuildBill")."</a>";
} }
if ($obj->statut == 2 && $num_fac_asso) if ($obj->statut == 2 && sizeof($propal->facture_liste_array()))
{ {
print '<a class="butAction" href="propal.php?propalid='.$propal->id."&action=setstatut&statut=4\">".$langs->trans("ClassifyBilled")."</a>"; print '<a class="butAction" href="propal.php?propalid='.$propal->id."&action=setstatut&statut=4\">".$langs->trans("ClassifyBilled")."</a>";
} }
......
# Dolibarr language file - en_US - compta # Dolibarr language file - en_US - compta
Accountancy=Accountancy Accountancy=Accountancy
AccountancyCard=Accountancy card
Treasury=Treasury Treasury=Treasury
OptionMode=Option for accountancy OptionMode=Option for accountancy
OptionModeTrue=Option Recettes-Dépenses OptionModeTrue=Option Recettes-Dépenses
......
...@@ -9,3 +9,4 @@ ConfirmDeleteAProject=Are you sure you want to delete this project ? ...@@ -9,3 +9,4 @@ ConfirmDeleteAProject=Are you sure you want to delete this project ?
LastProjects=Last %s projects LastProjects=Last %s projects
AllProjects=All projects AllProjects=All projects
ShowProject=Show project ShowProject=Show project
NoProject=No project defined
\ No newline at end of file
...@@ -27,6 +27,15 @@ PropalsOpened=Opened ...@@ -27,6 +27,15 @@ PropalsOpened=Opened
PropalStatusDraft=Draft (need to be validated) PropalStatusDraft=Draft (need to be validated)
PropalStatusValidated=Validated (proposal is opened) PropalStatusValidated=Validated (proposal is opened)
PropalStatusClosed=Closed PropalStatusClosed=Closed
PropalStatusSigned=Signed (need to be billed)
PropalStatusNotSigned=Not signed (closed)
PropalStatusBilled=Billed
PropalStatusDraftShort=Draft
PropalStatusValidatedShort=Validated
PropalStatusClosedShort=Closed
PropalStatusSignedShort=Signed
PropalStatusClosedShort=Not signed
PropalStatusBilledShort=Billed
ListOfProposals=List of commercial proposals ListOfProposals=List of commercial proposals
ActionsOnPropal=Tasks on proposal ActionsOnPropal=Tasks on proposal
NoOpenedPropals=No opened commercial proposals NoOpenedPropals=No opened commercial proposals
...@@ -38,5 +47,11 @@ FileNotUploaded=The file was not uploaded ...@@ -38,5 +47,11 @@ FileNotUploaded=The file was not uploaded
FileUploaded=The file was successfully uploaded FileUploaded=The file was successfully uploaded
AssociatedDocuments=Documents associated with the proposal: AssociatedDocuments=Documents associated with the proposal:
ErrorCantOpenDir=Can't open directory ErrorCantOpenDir=Can't open directory
DateEndPropal=Date fin validit DateEndPropal=Date end validity
DateEndPropalShort=Date fin DateEndPropalShort=Date end
ValidityDuration=Validity duration
CloseAs=Close with status
ClassifyBilled=Classify billed
BuildBill=Build bill
RelatedBill=Related bill
RelatedBills=Related bills
\ No newline at end of file
# Dolibarr language file - fr_FR - compta # Dolibarr language file - fr_FR - compta
Accountancy=Compta Accountancy=Compta
AccountancyCard=Fiche Compta
Treasury=Tréso Treasury=Tréso
OptionMode=Option de tenue de comptabilité OptionMode=Option de tenue de comptabilité
OptionModeTrue=Option Recettes-Dépenses OptionModeTrue=Option Recettes-Dépenses
......
...@@ -9,3 +9,4 @@ ConfirmDeleteAProject= ...@@ -9,3 +9,4 @@ ConfirmDeleteAProject=
LastProjects=Les %s derniers projets LastProjects=Les %s derniers projets
AllProjects=Tous les projets AllProjects=Tous les projets
ShowProject=Afficher projet ShowProject=Afficher projet
NoProject=Aucun projet dfini
\ No newline at end of file
...@@ -26,7 +26,16 @@ PropalsDraft=Brouillons ...@@ -26,7 +26,16 @@ PropalsDraft=Brouillons
PropalsOpened=Ouvertes PropalsOpened=Ouvertes
PropalStatusDraft=Brouillon (à valider) PropalStatusDraft=Brouillon (à valider)
PropalStatusValidated=Validée (propale ouverte) PropalStatusValidated=Validée (propale ouverte)
PropalStatusClosed=Fermé PropalStatusClosed=Fermée
PropalStatusSigned=Signée (à facturer)
PropalStatusNotSigned=Non signée (fermée)
PropalStatusBilled=Facturée
PropalStatusDraftShort=Brouillon
PropalStatusValidatedShort=Validée
PropalStatusClosedShort=Fermée
PropalStatusSignedShort=Signée
PropalStatusClosedShort=Non signée
PropalStatusBilledShort=Facturée
ListOfProposals=Liste des devis/propositions commerciales ListOfProposals=Liste des devis/propositions commerciales
ActionsOnPropal=Actions sur la proposition ActionsOnPropal=Actions sur la proposition
NoOpenedPropals=Pas de proposition ouverte NoOpenedPropals=Pas de proposition ouverte
...@@ -40,3 +49,9 @@ AssociatedDocuments=Documents associ ...@@ -40,3 +49,9 @@ AssociatedDocuments=Documents associ
ErrorCantOpenDir=Impossible d'ouvrir le répertoire ErrorCantOpenDir=Impossible d'ouvrir le répertoire
DateEndPropal=Date fin validité DateEndPropal=Date fin validité
DateEndPropalShort=Date fin DateEndPropalShort=Date fin
ValidityDuration=Durée de validité
CloseAs=Clôturer au statut
ClassifyBilled=Classer facturée
BuildBill=Créer facture
RelatedBill=Facture associée
RelatedBills=Factures associées
\ No newline at end of file
...@@ -79,10 +79,14 @@ class Propal ...@@ -79,10 +79,14 @@ class Propal
$langs->load("propals"); $langs->load("propals");
$this->labelstatut[0]=$langs->trans("PropalStatusDraft"); $this->labelstatut[0]=$langs->trans("PropalStatusDraft");
$this->labelstatut[1]=$langs->trans("PropalStatusValidated"); $this->labelstatut[1]=$langs->trans("PropalStatusValidated");
$this->labelstatut[2]=$langs->trans("PropalStatusClosed"); $this->labelstatut[2]=$langs->trans("PropalStatusSigned");
$this->labelstatut_short[0]=$langs->trans("PropalStatusDraft"); $this->labelstatut[3]=$langs->trans("PropalStatusNotSigned");
$this->labelstatut[4]=$langs->trans("PropalStatusBilled");
$this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort");
$this->labelstatut_short[1]=$langs->trans("Opened"); $this->labelstatut_short[1]=$langs->trans("Opened");
$this->labelstatut_short[2]=$langs->trans("PropalStatusClosed"); $this->labelstatut_short[2]=$langs->trans("PropalStatusSignedShort");
$this->labelstatut_short[3]=$langs->trans("PropalStatusNotSignedShort");
$this->labelstatut_short[4]=$langs->trans("PropalStatusBilledShort");
} }
...@@ -788,9 +792,9 @@ class Propal ...@@ -788,9 +792,9 @@ class Propal
/** /**
* \brief Renvoie un tableau contenant les numros de commandes associes * \brief Renvoie un tableau contenant les numros de commandes associes
* * \remarks Fonction plus light que associated_orders
* \seealso associated_orders
*/ */
function commande_liste_array () function commande_liste_array ()
{ {
$ga = array(); $ga = array();
...@@ -822,9 +826,9 @@ class Propal ...@@ -822,9 +826,9 @@ class Propal
/** /**
* \brief Renvoie un tableau contenant les commandes associes * \brief Renvoie un tableau contenant les commandes associes
* * \remarks Fonction plus lourde que commande_liste_array
* \seealso commande_liste_array
*/ */
function associated_orders () function associated_orders ()
{ {
$ga = array(); $ga = array();
...@@ -855,11 +859,42 @@ class Propal ...@@ -855,11 +859,42 @@ class Propal
} }
} }
/* /**
* * \brief Renvoie un tableau contenant les numros de factures associes
*
*/ */
function facture_liste_array ()
{
$ga = array();
$sql = "SELECT fk_facture FROM ".MAIN_DB_PREFIX."fa_pr as fp";
$sql .= " WHERE fk_propal = " . $this->id;
if ($this->db->query($sql) )
{
$nump = $this->db->num_rows();
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object();
$ga[$i] = $obj->fk_facture;
$i++;
}
}
return $ga;
}
else
{
dolibarr_print_error($this->db);
}
}
/**
* \brief Efface propal
* \param user Objet du user qui efface
*/
function delete($user) function delete($user)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = $this->id ;"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = $this->id ;";
...@@ -904,15 +939,15 @@ class Propal ...@@ -904,15 +939,15 @@ class Propal
} }
/* /**
* \brief Information sur l'objet * \brief Information sur l'objet propal
* * \param id id de la propale
*/ */
function info($id) function info($id)
{ {
$sql = "SELECT c.rowid, ".$this->db->pdate("datec")." as datec"; $sql = "SELECT c.rowid, ";
$sql .= ", fk_user_valid, fk_user_cloture, fk_user_author"; $sql.= $this->db->pdate("datec")." as datec, ".$this->db->pdate("date_valid")." as datev, ".$this->db->pdate("date_cloture")." as dateo";
$sql.= ", fk_user_author, fk_user_valid, fk_user_cloture";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as c";
$sql.= " WHERE c.rowid = $id"; $sql.= " WHERE c.rowid = $id";
...@@ -925,6 +960,8 @@ class Propal ...@@ -925,6 +960,8 @@ class Propal
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->date_creation = $obj->datec; $this->date_creation = $obj->datec;
$this->date_validation = $obj->datev;
$this->date_cloture = $obj->dateo;
$cuser = new User($this->db, $obj->fk_user_author); $cuser = new User($this->db, $obj->fk_user_author);
$cuser->fetch(); $cuser->fetch();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment