mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Ajout fonctionnalite pour classer la facture comme facturee
This commit is contained in:
@@ -385,7 +385,7 @@ class Commande
|
||||
Function fetch ($id)
|
||||
{
|
||||
$sql = "SELECT c.rowid, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva";
|
||||
$sql .= ", ".$this->db->pdate("c.date_commande")." as date_commande, c.fk_projet, c.remise_percent, c.source";
|
||||
$sql .= ", ".$this->db->pdate("c.date_commande")." as date_commande, c.fk_projet, c.remise_percent, c.source, c.facture";
|
||||
$sql .= " FROM llx_commande as c";
|
||||
$sql .= " WHERE c.rowid = $id";
|
||||
|
||||
@@ -407,7 +407,7 @@ class Commande
|
||||
$this->remise_percent = $obj->remise_percent;
|
||||
|
||||
$this->source = $obj->source;
|
||||
|
||||
$this->facturee = $obj->facture;
|
||||
$this->projet_id = $obj->fk_projet;
|
||||
|
||||
$this->db->free();
|
||||
@@ -571,6 +571,25 @@ class Commande
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Classe la facture comme factur<75>e
|
||||
*
|
||||
*/
|
||||
Function classer_facturee()
|
||||
{
|
||||
$sql = "UPDATE llx_commande SET facture = 1";
|
||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut > 0 ;";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Mettre <20> jour le prix
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user