Enhance donation module
This commit is contained in:
parent
4425166996
commit
f139eb83b1
@ -20,6 +20,7 @@ For users:
|
|||||||
- When creating a contract, sales representative are preset to user. This save
|
- When creating a contract, sales representative are preset to user. This save
|
||||||
4 clicks.
|
4 clicks.
|
||||||
- Can edit several fields in bank transaction line page into one update.
|
- Can edit several fields in bank transaction line page into one update.
|
||||||
|
- New: Enhance donation module. Add a status "canceled".
|
||||||
- New: Usage of Jquery Notify to show result or error messages on action.
|
- New: Usage of Jquery Notify to show result or error messages on action.
|
||||||
- New: If a service contains subproducts, subrpoducts are decrease when service
|
- New: If a service contains subproducts, subrpoducts are decrease when service
|
||||||
is decrease.
|
is decrease.
|
||||||
|
|||||||
@ -223,19 +223,6 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Print list of errors
|
|
||||||
*/
|
|
||||||
function print_error_list()
|
|
||||||
{
|
|
||||||
$num = sizeof($this->error);
|
|
||||||
for ($i = 0 ; $i < $num ; $i++)
|
|
||||||
{
|
|
||||||
print "<li>" . $this->error[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie le libelle traduit de la nature d'un adherent (physique ou morale)
|
* Renvoie le libelle traduit de la nature d'un adherent (physique ou morale)
|
||||||
* @param morphy Nature physique ou morale de l'adherent
|
* @param morphy Nature physique ou morale de l'adherent
|
||||||
|
|||||||
@ -64,18 +64,6 @@ class AdherentOptions
|
|||||||
$this->attribute_size = array();
|
$this->attribute_size = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief fonction qui imprime un liste d'erreurs
|
|
||||||
*/
|
|
||||||
function print_error_list()
|
|
||||||
{
|
|
||||||
$num = sizeof($this->error);
|
|
||||||
for ($i = 0 ; $i < $num ; $i++)
|
|
||||||
{
|
|
||||||
print "<li>" . $this->error[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new optionnal attribute
|
* Add a new optionnal attribute
|
||||||
* @param attrname code of attribute
|
* @param attrname code of attribute
|
||||||
|
|||||||
@ -61,19 +61,6 @@ class AdherentType extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief print_error_list
|
|
||||||
*/
|
|
||||||
function print_error_list()
|
|
||||||
{
|
|
||||||
$num = sizeof($this->error);
|
|
||||||
for ($i = 0 ; $i < $num ; $i++)
|
|
||||||
{
|
|
||||||
print "<li>" . $this->error[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Fonction qui permet de creer le status de l'adherent
|
* \brief Fonction qui permet de creer le status de l'adherent
|
||||||
* \param userid userid de l'adherent
|
* \param userid userid de l'adherent
|
||||||
|
|||||||
@ -120,7 +120,6 @@ if ($resql)
|
|||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</td></tr>'."\n";
|
||||||
$var=true;
|
|
||||||
$listofstatus=array(0,1,2,3,3,-1);
|
$listofstatus=array(0,1,2,3,3,-1);
|
||||||
$bool=false;
|
$bool=false;
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
@ -136,6 +135,7 @@ if ($resql)
|
|||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
$var=true;
|
||||||
$bool=false;
|
$bool=false;
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -71,9 +71,11 @@ class Don extends CommonObject
|
|||||||
$this->modepaiementid = 0;
|
$this->modepaiementid = 0;
|
||||||
|
|
||||||
$langs->load("donations");
|
$langs->load("donations");
|
||||||
|
$this->labelstatut[-1]=$langs->trans("Canceled");
|
||||||
$this->labelstatut[0]=$langs->trans("DonationStatusPromiseNotValidated");
|
$this->labelstatut[0]=$langs->trans("DonationStatusPromiseNotValidated");
|
||||||
$this->labelstatut[1]=$langs->trans("DonationStatusPromiseValidated");
|
$this->labelstatut[1]=$langs->trans("DonationStatusPromiseValidated");
|
||||||
$this->labelstatut[2]=$langs->trans("DonationStatusPaid");
|
$this->labelstatut[2]=$langs->trans("DonationStatusPaid");
|
||||||
|
$this->labelstatutshort[-1]=$langs->trans("Canceled");
|
||||||
$this->labelstatutshort[0]=$langs->trans("DonationStatusPromiseNotValidatedShort");
|
$this->labelstatutshort[0]=$langs->trans("DonationStatusPromiseNotValidatedShort");
|
||||||
$this->labelstatutshort[1]=$langs->trans("DonationStatusPromiseValidatedShort");
|
$this->labelstatutshort[1]=$langs->trans("DonationStatusPromiseValidatedShort");
|
||||||
$this->labelstatutshort[2]=$langs->trans("DonationStatusPaidShort");
|
$this->labelstatutshort[2]=$langs->trans("DonationStatusPaidShort");
|
||||||
@ -110,6 +112,7 @@ class Don extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($mode == 2)
|
if ($mode == 2)
|
||||||
{
|
{
|
||||||
|
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5').' '.$this->labelstatutshort[$statut];
|
||||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatutshort[$statut];
|
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatutshort[$statut];
|
||||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatutshort[$statut];
|
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatutshort[$statut];
|
||||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatutshort[$statut];
|
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatutshort[$statut];
|
||||||
@ -117,12 +120,14 @@ class Don extends CommonObject
|
|||||||
if ($mode == 3)
|
if ($mode == 3)
|
||||||
{
|
{
|
||||||
$prefix='Short';
|
$prefix='Short';
|
||||||
|
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5');
|
||||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0');
|
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0');
|
||||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1');
|
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1');
|
||||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6');
|
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
|
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5').' '.$this->labelstatut[$statut];
|
||||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatut[$statut];
|
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatut[$statut];
|
||||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
|
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
|
||||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
||||||
@ -130,6 +135,7 @@ class Don extends CommonObject
|
|||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
$prefix='Short';
|
$prefix='Short';
|
||||||
|
if ($statut == -1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut5');
|
||||||
if ($statut == 0) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut0');
|
if ($statut == 0) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut0');
|
||||||
if ($statut == 1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
if ($statut == 1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
||||||
if ($statut == 2) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
if ($statut == 2) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
||||||
@ -189,19 +195,7 @@ class Don extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
|
||||||
*/
|
|
||||||
function print_error_list()
|
|
||||||
{
|
|
||||||
$num = sizeof($this->error);
|
|
||||||
for ($i = 0 ; $i < $num ; $i++)
|
|
||||||
{
|
|
||||||
print "<li>" . $this->error[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -295,7 +289,7 @@ class Don extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->date = $this->db->idate($this->date);
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."don (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."don (";
|
||||||
$sql.= "datec";
|
$sql.= "datec";
|
||||||
@ -317,10 +311,10 @@ class Don extends CommonObject
|
|||||||
$sql.= ", datedon";
|
$sql.= ", datedon";
|
||||||
$sql.= ", email";
|
$sql.= ", email";
|
||||||
$sql.= ") VALUES (";
|
$sql.= ") VALUES (";
|
||||||
$sql.= $this->db->idate(mktime());
|
$sql.= " '".$this->db->idate($now)."'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ", ".price2num($this->amount);
|
$sql.= ", ".price2num($this->amount);
|
||||||
$sql.= ", ".$this->modepaiementid;
|
$sql.= ", ".($this->modepaiementid?$this->modepaiementid:"null");
|
||||||
$sql.= ", '".$this->db->escape($this->prenom)."'";
|
$sql.= ", '".$this->db->escape($this->prenom)."'";
|
||||||
$sql.= ", '".$this->db->escape($this->nom)."'";
|
$sql.= ", '".$this->db->escape($this->nom)."'";
|
||||||
$sql.= ", '".$this->db->escape($this->societe)."'";
|
$sql.= ", '".$this->db->escape($this->societe)."'";
|
||||||
@ -333,7 +327,7 @@ class Don extends CommonObject
|
|||||||
$sql.= ", '".$this->db->escape($this->note)."'";
|
$sql.= ", '".$this->db->escape($this->note)."'";
|
||||||
$sql.= ", ".$user->id;
|
$sql.= ", ".$user->id;
|
||||||
$sql.= ", null";
|
$sql.= ", null";
|
||||||
$sql.= ", '".$this->date."'";
|
$sql.= ", '".$this->db->idate($this->date)."'";
|
||||||
$sql.= ", '".$this->email."'";
|
$sql.= ", '".$this->email."'";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
@ -353,16 +347,14 @@ class Don extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Update a donation record
|
* Update a donation record
|
||||||
* @param user Objet utilisateur qui met a jour le don
|
* @param user Objet utilisateur qui met a jour le don
|
||||||
* @return int >0 si ok, <0 si ko
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function update($user)
|
function update($user)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->date = $this->db->idate($this->date);
|
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET ";
|
||||||
$sql .= "amount = " . price2num($this->amount);
|
$sql .= "amount = " . price2num($this->amount);
|
||||||
$sql .= ",fk_paiement = ".$this->modepaiementid;
|
$sql .= ",fk_paiement = ".($this->modepaiementid?$this->modepaiementid:"null");
|
||||||
$sql .= ",prenom = '".$this->db->escape($this->prenom)."'";
|
$sql .= ",prenom = '".$this->db->escape($this->prenom)."'";
|
||||||
$sql .= ",nom='".$this->db->escape($this->nom)."'";
|
$sql .= ",nom='".$this->db->escape($this->nom)."'";
|
||||||
$sql .= ",societe='".$this->db->escape($this->societe)."'";
|
$sql .= ",societe='".$this->db->escape($this->societe)."'";
|
||||||
@ -373,10 +365,9 @@ class Don extends CommonObject
|
|||||||
$sql .= ",public=".$this->public;
|
$sql .= ",public=".$this->public;
|
||||||
$sql .= ",fk_don_projet=".($this->fk_project>0?$this->fk_project:'null');
|
$sql .= ",fk_don_projet=".($this->fk_project>0?$this->fk_project:'null');
|
||||||
$sql .= ",note='".$this->db->escape($this->note)."'";
|
$sql .= ",note='".$this->db->escape($this->note)."'";
|
||||||
$sql .= ",datedon='".$this->date."'";
|
$sql .= ",datedon='".$this->db->idate($this->date)."'";
|
||||||
$sql .= ",email='".$this->email."'";
|
$sql .= ",email='".$this->email."'";
|
||||||
$sql .= ",fk_statut=".$this->statut;
|
$sql .= ",fk_statut=".$this->statut;
|
||||||
|
|
||||||
$sql .= " WHERE rowid = $this->id";
|
$sql .= " WHERE rowid = $this->id";
|
||||||
|
|
||||||
dol_syslog("Don::update sql=".$sql);
|
dol_syslog("Don::update sql=".$sql);
|
||||||
@ -393,8 +384,8 @@ class Don extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Suppression du don de la base
|
* Suppression du don de la base
|
||||||
* \param rowid id du don a supprimer
|
* @param rowid id du don a supprimer
|
||||||
*/
|
*/
|
||||||
function delete($rowid)
|
function delete($rowid)
|
||||||
{
|
{
|
||||||
@ -420,21 +411,22 @@ class Don extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Charge l'objet don en memoire depuis la base de donnee
|
* Load donation from database
|
||||||
* \param rowid Id du don a charger
|
* @param rowid Id of donation toload
|
||||||
* \return int <0 si ko, >0 si ok
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($rowid)
|
function fetch($rowid,$ref='')
|
||||||
{
|
{
|
||||||
$sql = "SELECT d.rowid, d.datec,";
|
global $conf;
|
||||||
$sql.= " d.datedon,";
|
|
||||||
|
$sql = "SELECT d.rowid, d.datec, d.tms as datem, d.datedon,";
|
||||||
$sql.= " d.prenom, d.nom, d.societe, d.amount, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet,";
|
$sql.= " d.prenom, d.nom, d.societe, d.amount, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet,";
|
||||||
$sql.= " p.title as project_label";
|
$sql.= " p.title as project_label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."don as d";
|
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = d.fk_don_projet";
|
||||||
$sql.= " ON p.rowid = d.fk_don_projet";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON cp.id = d.fk_paiement";
|
||||||
$sql.= " WHERE cp.id = d.fk_paiement AND d.rowid = ".$rowid;
|
$sql.= " WHERE d.rowid = ".$rowid." AND d.entity = ".$conf->entity;
|
||||||
|
|
||||||
dol_syslog("Don::fetch sql=".$sql);
|
dol_syslog("Don::fetch sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@ -447,6 +439,7 @@ class Don extends CommonObject
|
|||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
$this->ref = $obj->rowid;
|
$this->ref = $obj->rowid;
|
||||||
$this->datec = $this->db->jdate($obj->datec);
|
$this->datec = $this->db->jdate($obj->datec);
|
||||||
|
$this->datem = $this->db->jdate($obj->datem);
|
||||||
$this->date = $this->db->jdate($obj->datedon);
|
$this->date = $this->db->jdate($obj->datedon);
|
||||||
$this->prenom = $obj->prenom;
|
$this->prenom = $obj->prenom;
|
||||||
$this->nom = $obj->nom;
|
$this->nom = $obj->nom;
|
||||||
@ -455,6 +448,8 @@ class Don extends CommonObject
|
|||||||
$this->adresse = $obj->adresse;
|
$this->adresse = $obj->adresse;
|
||||||
$this->cp = $obj->cp;
|
$this->cp = $obj->cp;
|
||||||
$this->ville = $obj->ville;
|
$this->ville = $obj->ville;
|
||||||
|
$this->zip = $obj->cp;
|
||||||
|
$this->town = $obj->ville;
|
||||||
$this->email = $obj->email;
|
$this->email = $obj->email;
|
||||||
$this->pays = $obj->pays;
|
$this->pays = $obj->pays;
|
||||||
$this->projet = $obj->project_label;
|
$this->projet = $obj->project_label;
|
||||||
@ -476,17 +471,18 @@ class Don extends CommonObject
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Valide une promesse de don
|
* Valide une promesse de don
|
||||||
* \param rowid id du don a modifier
|
* @param rowid id du don a modifier
|
||||||
* \param userid utilisateur qui valide la promesse
|
* @param userid utilisateur qui valide la promesse
|
||||||
*
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function valid_promesse($rowid, $userid)
|
function valid_promesse($rowid, $userid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 1, fk_user_valid = $userid WHERE rowid = $rowid AND fk_statut = 0;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 1, fk_user_valid = $userid WHERE rowid = $rowid AND fk_statut = 0";
|
||||||
|
|
||||||
|
dol_syslog("sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -502,25 +498,26 @@ class Don extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Classe le don comme paye, le don a ete recu
|
* Classe le don comme paye, le don a ete recu
|
||||||
* \param rowid id du don a modifier
|
* @param rowid id du don a modifier
|
||||||
* \param modepaiementd mode de paiement
|
* @param modepaiementd mode de paiement
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_paye($rowid, $modepaiement='')
|
function set_paye($rowid, $modepaiement='')
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2";
|
||||||
|
|
||||||
if ($modepaiement)
|
if ($modepaiement)
|
||||||
{
|
{
|
||||||
$sql .= ", fk_paiement=$modepaiement";
|
$sql .= ", fk_paiement=$modepaiement";
|
||||||
}
|
}
|
||||||
$sql .= " WHERE rowid = $rowid AND fk_statut = 1;";
|
$sql .= " WHERE rowid = $rowid AND fk_statut = 1";
|
||||||
|
|
||||||
|
dol_syslog("sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -536,21 +533,22 @@ class Don extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Classe le don comme encaisse
|
* Classe le don comme encaisse
|
||||||
* \param rowid id du don a modifier
|
* @param rowid id du don a modifier
|
||||||
*
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_encaisse($rowid)
|
function set_encaisse($rowid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 3 WHERE rowid = $rowid AND fk_statut = 2;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 3 WHERE rowid = $rowid AND fk_statut = 2";
|
||||||
|
|
||||||
|
dol_syslog("sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -566,9 +564,38 @@ class Don extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set donation sto status canceled
|
||||||
|
* @param rowid id du don a modifier
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
function set_cancel($rowid)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = -1 WHERE rowid = ".$rowid;
|
||||||
|
|
||||||
|
dol_syslog("sql=".$sql);
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
if ( $this->db->affected_rows($resql) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Somme des dons
|
* \brief Somme des dons
|
||||||
@ -619,5 +646,42 @@ class Don extends CommonObject
|
|||||||
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return full name (civility+' '+name+' '+lastname)
|
||||||
|
* @param langs Language object for translation of civility
|
||||||
|
* @param option 0=No option, 1=Add civility
|
||||||
|
* @param nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname
|
||||||
|
* @return string String with full name
|
||||||
|
*/
|
||||||
|
function getFullName($langs,$option=0,$nameorder=-1)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$ret='';
|
||||||
|
if ($option && $this->civilite_id)
|
||||||
|
{
|
||||||
|
if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' ';
|
||||||
|
else $ret.=$this->civilite_id.' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If order not defined, we use the setup
|
||||||
|
if ($nameorder < 0) $nameorder=(! $conf->global->MAIN_FIRSTNAME_NAME_POSITION);
|
||||||
|
|
||||||
|
if ($nameorder)
|
||||||
|
{
|
||||||
|
if ($this->prenom) $ret.=$this->prenom;
|
||||||
|
if ($this->prenom && $this->nom) $ret.=' ';
|
||||||
|
if ($this->nom) $ret.=$this->nom;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($this->nom) $ret.=$this->nom;
|
||||||
|
if ($this->prenom && $this->nom) $ret.=' ';
|
||||||
|
if ($this->prenom) $ret.=$this->prenom;
|
||||||
|
}
|
||||||
|
|
||||||
|
return trim($ret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -20,13 +20,14 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/compta/dons/fiche.php
|
* \file htdocs/compta/dons/fiche.php
|
||||||
* \ingroup don
|
* \ingroup don
|
||||||
* \brief Page de fiche de don
|
* \brief Page of donation card
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/dons/modules_don.php");
|
require_once(DOL_DOCUMENT_ROOT."/includes/modules/dons/modules_don.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php");
|
||||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
|
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
|
||||||
@ -36,6 +37,7 @@ $langs->load("donations");
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$mesg="";
|
$mesg="";
|
||||||
|
$mesgs=array();
|
||||||
|
|
||||||
$don = new Don($db);
|
$don = new Don($db);
|
||||||
$donation_date=dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
$donation_date=dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||||
@ -55,18 +57,18 @@ if ($_POST["action"] == 'update')
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
if (! $_POST["amount"] > 0)
|
|
||||||
{
|
|
||||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
|
|
||||||
$_GET["action"] = "create";
|
|
||||||
$error=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($donation_date))
|
if (empty($donation_date))
|
||||||
{
|
{
|
||||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
|
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
|
||||||
$_GET["action"] = "create";
|
$_GET["action"] = "create";
|
||||||
$error=1;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $_POST["amount"] > 0)
|
||||||
|
{
|
||||||
|
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
|
||||||
|
$_GET["action"] = "create";
|
||||||
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -79,8 +81,10 @@ if ($_POST["action"] == 'update')
|
|||||||
$don->societe = $_POST["societe"];
|
$don->societe = $_POST["societe"];
|
||||||
$don->adresse = $_POST["adresse"];
|
$don->adresse = $_POST["adresse"];
|
||||||
$don->amount = price2num($_POST["amount"]);
|
$don->amount = price2num($_POST["amount"]);
|
||||||
$don->cp = $_POST["cp"];
|
$don->cp = $_POST["zipcode"];
|
||||||
$don->ville = $_POST["ville"];
|
$don->ville = $_POST["town"];
|
||||||
|
$don->zip = $_POST["zipcode"];
|
||||||
|
$don->town = $_POST["town"];
|
||||||
$don->email = $_POST["email"];
|
$don->email = $_POST["email"];
|
||||||
$don->date = $donation_date;
|
$don->date = $donation_date;
|
||||||
$don->note = $_POST["note"];
|
$don->note = $_POST["note"];
|
||||||
@ -108,18 +112,18 @@ if ($_POST["action"] == 'add')
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
if (! $_POST["amount"] > 0)
|
|
||||||
{
|
|
||||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
|
|
||||||
$_GET["action"] = "create";
|
|
||||||
$error=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($donation_date))
|
if (empty($donation_date))
|
||||||
{
|
{
|
||||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
|
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
|
||||||
$_GET["action"] = "create";
|
$_GET["action"] = "create";
|
||||||
$error=1;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $_POST["amount"] > 0)
|
||||||
|
{
|
||||||
|
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
|
||||||
|
$_GET["action"] = "create";
|
||||||
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -129,8 +133,10 @@ if ($_POST["action"] == 'add')
|
|||||||
$don->societe = $_POST["societe"];
|
$don->societe = $_POST["societe"];
|
||||||
$don->adresse = $_POST["adresse"];
|
$don->adresse = $_POST["adresse"];
|
||||||
$don->amount = price2num($_POST["amount"]);
|
$don->amount = price2num($_POST["amount"]);
|
||||||
$don->cp = $_POST["cp"];
|
$don->cp = $_POST["zipcode"];
|
||||||
$don->ville = $_POST["ville"];
|
$don->ville = $_POST["town"];
|
||||||
|
$don->zip = $_POST["zipcode"];
|
||||||
|
$don->town = $_POST["town"];
|
||||||
$don->email = $_POST["email"];
|
$don->email = $_POST["email"];
|
||||||
$don->date = $donation_date;
|
$don->date = $donation_date;
|
||||||
$don->note = $_POST["note"];
|
$don->note = $_POST["note"];
|
||||||
@ -162,27 +168,39 @@ if ($_POST["action"] == 'commentaire')
|
|||||||
}
|
}
|
||||||
if ($_GET["action"] == 'valid_promesse')
|
if ($_GET["action"] == 'valid_promesse')
|
||||||
{
|
{
|
||||||
if ($don->valid_promesse($_GET["rowid"], $user->id))
|
if ($don->valid_promesse($_GET["rowid"], $user->id) >= 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?rowid=".$_GET["rowid"]);
|
Header("Location: fiche.php?rowid=".$_GET["rowid"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
else $mesg=$don->error;
|
||||||
|
}
|
||||||
|
if ($_GET["action"] == 'set_cancel')
|
||||||
|
{
|
||||||
|
if ($don->set_cancel($_GET["rowid"]) >= 0)
|
||||||
|
{
|
||||||
|
Header("Location: fiche.php?rowid=".$_GET["rowid"]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else $mesg=$don->error;
|
||||||
}
|
}
|
||||||
if ($_GET["action"] == 'set_paid')
|
if ($_GET["action"] == 'set_paid')
|
||||||
{
|
{
|
||||||
if ($don->set_paye($_GET["rowid"], $modepaiement))
|
if ($don->set_paye($_GET["rowid"], $modepaiement) >= 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?rowid=".$_GET["rowid"]);
|
Header("Location: fiche.php?rowid=".$_GET["rowid"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
else $mesg=$don->error;
|
||||||
}
|
}
|
||||||
if ($_GET["action"] == 'set_encaisse')
|
if ($_GET["action"] == 'set_encaisse')
|
||||||
{
|
{
|
||||||
if ($don->set_encaisse($_GET["rowid"]))
|
if ($don->set_encaisse($_GET["rowid"]) >= 0)
|
||||||
{
|
{
|
||||||
Header("Location: liste.php");
|
Header("Location: fiche.php?rowid=".$_GET["rowid"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
else $mesg=$don->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -230,6 +248,7 @@ llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M
|
|||||||
|
|
||||||
$html=new Form($db);
|
$html=new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
$htmlcompany = new FormCompany($db);
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -242,7 +261,7 @@ if ($_GET["action"] == 'create')
|
|||||||
{
|
{
|
||||||
print_fiche_titre($langs->trans("AddDonation"));
|
print_fiche_titre($langs->trans("AddDonation"));
|
||||||
|
|
||||||
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
dol_htmloutput_errors($mesg,$mesgs);
|
||||||
|
|
||||||
print '<form name="add" action="fiche.php" method="post">';
|
print '<form name="add" action="fiche.php" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -250,28 +269,20 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
|
$nbrows=11;
|
||||||
|
if ($conf->projet->enabled) $nbrows++;
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||||
$html->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
|
$html->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
$nbrows=11;
|
|
||||||
if ($conf->projet->enabled) $nbrows++;
|
|
||||||
|
|
||||||
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
||||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\">".$_POST["comment"]."</textarea></td></tr>";
|
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\">".$_POST["comment"]."</textarea></td>";
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
// Amount
|
||||||
$html->select_types_paiements('', 'modepaiement', 'CRDT', 0);
|
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.$_POST["amount"].'" size="10"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||||
print "</td></tr>\n";
|
|
||||||
|
|
||||||
if ($conf->projet->enabled)
|
|
||||||
{
|
|
||||||
// Si module projet actif
|
|
||||||
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
|
||||||
select_projects('',$_POST["projectid"],"projectid");
|
|
||||||
print "</td></tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
|
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
|
||||||
print $html->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
|
print $html->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
|
||||||
@ -282,10 +293,29 @@ if ($_GET["action"] == 'create')
|
|||||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" value="'.$_POST["nom"].'" size="40"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" value="'.$_POST["nom"].'" size="40"></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
||||||
print '<textarea name="adresse" wrap="soft" cols="40" rows="3">'.$_POST["adresse"].'</textarea></td></tr>';
|
print '<textarea name="adresse" wrap="soft" cols="40" rows="3">'.$_POST["adresse"].'</textarea></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td><input type="text" name="cp" value="'.$_POST["cp"].'" size="8"> <input type="text" name="ville" value="'.$_POST["ville"].'" size="40"></td></tr>';
|
|
||||||
|
// Zip / Town
|
||||||
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
||||||
|
print $htmlcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectpays_id','departement_id'),6);
|
||||||
|
print ' ';
|
||||||
|
print $htmlcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectpays_id','departement_id'));
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="pays" value="'.$_POST["pays"].'" size="40"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="pays" value="'.$_POST["pays"].'" size="40"></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.$_POST["email"].'" size="40"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.$_POST["email"].'" size="40"></td></tr>';
|
||||||
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.$_POST["amount"].'" size="10"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
|
||||||
|
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
||||||
|
$html->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
if ($conf->projet->enabled)
|
||||||
|
{
|
||||||
|
// Si module projet actif
|
||||||
|
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
||||||
|
select_projects('',$_POST["projectid"],"projectid");
|
||||||
|
print "</td></tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
@ -324,25 +354,20 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date
|
|
||||||
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
|
||||||
$html->select_date($don->date,'','','','',"update");
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
$nbrows=12;
|
$nbrows=12;
|
||||||
if ($conf->projet->enabled) $nbrows++;
|
if ($conf->projet->enabled) $nbrows++;
|
||||||
|
|
||||||
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
// Date
|
||||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\">".$don->note."</textarea></td></tr>";
|
print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||||
|
$html->select_date($don->date,'','','','',"update");
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Project
|
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
||||||
if ($conf->projet->enabled)
|
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\">".$don->note."</textarea></td>";
|
||||||
{
|
print "</tr>";
|
||||||
$langs->load('projects');
|
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
// Amount
|
||||||
select_projects($soc->id, isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project, 'projectid');
|
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.$don->amount.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
|
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
|
||||||
print $html->selectyesno("public",1,1);
|
print $html->selectyesno("public",1,1);
|
||||||
@ -355,17 +380,32 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
|||||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.$don->nom.'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.$don->nom.'"></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
||||||
print '<textarea name="adresse" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->adresse.'</textarea></td></tr>';
|
print '<textarea name="adresse" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->adresse.'</textarea></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td><input type="text" name="cp" size="8" value="'.$don->cp.'"> <input type="text" name="ville" size="40" value="'.$don->ville.'"></td></tr>';
|
|
||||||
|
// Zip / Town
|
||||||
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
||||||
|
print $htmlcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectpays_id','departement_id'),6);
|
||||||
|
print ' ';
|
||||||
|
print $htmlcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectpays_id','departement_id'));
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="pays" size="40" value="'.$don->pays.'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="pays" size="40" value="'.$don->pays.'"></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
|
||||||
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.$don->amount.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
|
||||||
|
|
||||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
||||||
$html->select_types_paiements('', 'modepaiement', 'CRDT', 0);
|
$html->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
|
// Project
|
||||||
|
if ($conf->projet->enabled)
|
||||||
|
{
|
||||||
|
$langs->load('projects');
|
||||||
|
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
||||||
|
select_projects($soc->id, isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project, 'projectid');
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||||
@ -385,7 +425,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
|||||||
if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
||||||
{
|
{
|
||||||
$don->id = $_GET["rowid"];
|
$don->id = $_GET["rowid"];
|
||||||
$don->fetch($_GET["rowid"]);
|
$result=$don->fetch($_GET["rowid"]);
|
||||||
|
|
||||||
|
|
||||||
$h=0;
|
$h=0;
|
||||||
@ -400,6 +440,9 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
$nbrows=12;
|
||||||
|
if ($conf->projet->enabled) $nbrows++;
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
|
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||||
print $html->showrefnav($don,'rowid','',1,'rowid','ref','');
|
print $html->showrefnav($don,'rowid','',1,'rowid','ref','');
|
||||||
@ -407,21 +450,14 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print "<tr><td>".$langs->trans("Date")."</td><td>";
|
print '<tr><td width="25%">'.$langs->trans("Date").'</td><td>';
|
||||||
print dol_print_date($don->date,"day");
|
print dol_print_date($don->date,"day");
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
$nbrows=12;
|
|
||||||
if ($conf->projet->enabled) $nbrows++;
|
|
||||||
|
|
||||||
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
|
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
|
||||||
print nl2br($don->note).'</td></tr>';
|
print nl2br($don->note).'</td></tr>';
|
||||||
|
|
||||||
// Project
|
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount).' '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||||
if ($conf->projet->enabled)
|
|
||||||
{
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
||||||
print yn($don->public);
|
print yn($don->public);
|
||||||
@ -430,17 +466,30 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td>'.$don->societe.'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Company").'</td><td>'.$don->societe.'</td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td>'.$don->prenom.'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td>'.$don->prenom.'</td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->nom.'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->nom.'</td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'.nl2br($don->adresse).'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'.dol_nl2br($don->adresse).'</td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'.$don->cp.' '.$don->ville.'</td></tr>';
|
|
||||||
|
// Zip / Town
|
||||||
|
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'.$don->cp.($don->cp && $don->ville?' / ':'').$don->ville.'</td></tr>';
|
||||||
|
|
||||||
|
// Country
|
||||||
print "<tr>".'<td>'.$langs->trans("Country").'</td><td>'.$don->pays.'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Country").'</td><td>'.$don->pays.'</td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td>'.$don->email.'</td></tr>';
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount).' '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
// EMail
|
||||||
|
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($don->email).'</td></tr>';
|
||||||
|
|
||||||
|
// Payment mode
|
||||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
|
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
|
||||||
print $don->modepaiement;
|
print $don->modepaiement;
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
|
// Project
|
||||||
|
if ($conf->projet->enabled)
|
||||||
|
{
|
||||||
|
print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
@ -462,6 +511,11 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
print '<a class="butAction" href="fiche.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a>';
|
print '<a class="butAction" href="fiche.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (($don->statut == 0 || $don->statut == 1) && $resteapayer == 0 && $don->paye == 0)
|
||||||
|
{
|
||||||
|
print "<a class=\"butAction\" href=\"fiche.php?rowid=$don->id&action=set_cancel\">".$langs->trans("ClassifyCanceled")."</a>";
|
||||||
|
}
|
||||||
|
|
||||||
// TODO Gerer action emettre paiement
|
// TODO Gerer action emettre paiement
|
||||||
if ($don->statut == 1 && $resteapayer > 0)
|
if ($don->statut == 1 && $resteapayer > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,6 +29,15 @@ require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php");
|
|||||||
|
|
||||||
$langs->load("donations");
|
$langs->load("donations");
|
||||||
|
|
||||||
|
$donation_static=new Don($db);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -67,29 +76,47 @@ print_fiche_titre($langs->trans("DonationsArea"));
|
|||||||
|
|
||||||
print '<table width="100%" class="notopnoleftnoright">';
|
print '<table width="100%" class="notopnoleftnoright">';
|
||||||
|
|
||||||
print '<tr><td class="notopnoleft">';
|
// Left area
|
||||||
|
print '<tr><td class="notopnoleft" width="30%" valign="top">';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="noborder" width="50%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td colspan="4">'.$langs->trans("Statistics").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$listofstatus=array(0,1,-1,2);
|
||||||
|
foreach ($listofstatus as $status)
|
||||||
|
{
|
||||||
|
$dataseries[]=array('label'=>$donstatic->LibStatut($status,1),'values'=>array(0=>(isset($nb[$status])?$nb[$status]:0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print '<tr><td align="center" colspan="4">';
|
||||||
|
$data=array('series'=>$dataseries);
|
||||||
|
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Status").'</td>';
|
print '<td>'.$langs->trans("Status").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Number").'</td>';
|
print '<td align="right">'.$langs->trans("Number").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
|
print '<td align="right">'.$langs->trans("Total").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Average").'</td>';
|
print '<td align="right">'.$langs->trans("Average").'</td>';
|
||||||
print "</tr>\n";
|
print '</tr>';
|
||||||
|
|
||||||
$var=True;
|
$var=true;
|
||||||
|
foreach ($listofstatus as $status)
|
||||||
for ($i = 0 ; $i < 3 ; $i++)
|
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td><a href="liste.php?statut='.$i.'">'.$donstatic->LibStatut($i,4).'</a></td>';
|
print '<td><a href="liste.php?statut='.$status.'">'.$donstatic->LibStatut($status,4).'</a></td>';
|
||||||
print '<td align="right">'.$nb[$i].'</td>';
|
print '<td align="right">'.$nb[$status].'</td>';
|
||||||
print '<td align="right">'.($nb[$i]?price($somme[$i],'MT'):' ').'</td>';
|
print '<td align="right">'.($nb[$status]?price($somme[$status],'MT'):' ').'</td>';
|
||||||
print '<td align="right">'.($nb[$i]?price(price2num($somme[$i]/$nb[$i],'MT')):' ').'</td>';
|
print '<td align="right">'.($nb[$status]?price(price2num($somme[$status]/$nb[$status],'MT')):' ').'</td>';
|
||||||
$totalnb += $nb[$i];
|
$totalnb += $nb[$status];
|
||||||
$total += $somme[$i];
|
$total += $somme[$status];
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +129,75 @@ print '</tr>';
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|
||||||
|
// Right area
|
||||||
|
print '</td><td valign="top">';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$max=5;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Last modified proposals
|
||||||
|
*/
|
||||||
|
|
||||||
|
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.societe, c.nom,";
|
||||||
|
$sql.= " tms as datem, amount";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."don as c";
|
||||||
|
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||||
|
//$sql.= " AND c.fk_statut > 2";
|
||||||
|
$sql.= " ORDER BY c.tms DESC";
|
||||||
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td colspan="5">'.$langs->trans("LastModifiedDonations",$max).'</td></tr>';
|
||||||
|
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
$var = True;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
|
$donation_static->id=$obj->rowid;
|
||||||
|
$donation_static->ref=$obj->ref?$obj->ref:$obj->rowid;
|
||||||
|
|
||||||
|
print '<td width="94" class="nobordernopadding" nowrap="nowrap">';
|
||||||
|
print $donation_static->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="nobordernopadding">';
|
||||||
|
print $obj->societe;
|
||||||
|
print ($obj->societe && $obj->nom?' / ':'');
|
||||||
|
print $obj->nom;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
|
print price($obj->amount);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Date
|
||||||
|
print '<td>'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
|
||||||
|
|
||||||
|
print '<td align="right">'.$donation_static->LibStatut($obj->fk_statut,5).'</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</table><br>";
|
||||||
|
}
|
||||||
|
else dol_print_error($db);
|
||||||
|
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -74,31 +74,33 @@ if ($result)
|
|||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
$param="&statut=$statut&sortorder=$sortorder&sortfield=$sortfield";
|
||||||
|
|
||||||
if ($statut >= 0)
|
if ($statut >= 0)
|
||||||
{
|
{
|
||||||
$donationstatic->statut=$statut;
|
$donationstatic->statut=$statut;
|
||||||
$label=$donationstatic->getLibStatut(0);
|
$label=$donationstatic->getLibStatut(0);
|
||||||
print_barre_liste($label, $page, "liste.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
print_barre_liste($label, $page, $_SERVER["PHP_SELF"], $param, '', '', '', $num);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_barre_liste($langs->trans("Donations"), $page, "liste.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, '', '', '', $num);
|
||||||
}
|
}
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
|
||||||
|
|
||||||
|
|
||||||
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","d.rowid","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Firstname"),"liste.php","d.prenom","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"d.societe","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Name"),"liste.php","d.nom","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.nom","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Company"),"liste.php","d.societe","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.datedon","&page=$page&statut=$statut","",'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Date"),"liste.php","d.datedon","&page=$page&statut=$statut","",'align="center"',$sortfield,$sortorder);
|
|
||||||
if ($conf->projet->enabled)
|
if ($conf->projet->enabled)
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
print_liste_field_titre($langs->trans("Project"),"liste.php","projet","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"fk_don_projet","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
||||||
}
|
}
|
||||||
print_liste_field_titre($langs->trans("Amount"),"liste.php","d.amount","&page=$page&statut=$statut","",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"d.amount","&page=$page&statut=$statut","",'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),"liste.php","d.statut","&page=$page&statut=$statut","",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.fk_statut","&page=$page&statut=$statut","",'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -109,11 +111,12 @@ if ($result)
|
|||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
$donationstatic->id=$objp->rowid;
|
$donationstatic->id=$objp->rowid;
|
||||||
$donationstatic->ref=$objp->rowid;
|
$donationstatic->ref=$objp->rowid;
|
||||||
|
$donationstatic->nom=$objp->nom;
|
||||||
|
$donationstatic->prenom=$objp->prenom;
|
||||||
print "<td>".$donationstatic->getNomUrl(1)."</td>\n";
|
print "<td>".$donationstatic->getNomUrl(1)."</td>\n";
|
||||||
print "<td>".$objp->prenom."</td>\n";
|
|
||||||
print "<td>".$objp->nom."</td>\n";
|
|
||||||
print "<td>".$objp->societe."</td>\n";
|
print "<td>".$objp->societe."</td>\n";
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datedon)).'</td>';
|
print "<td>".$donationstatic->getFullName($langs)."</td>\n";
|
||||||
|
print '<td align="center">'.dol_print_date($db->jdate($objp->datedon),'day').'</td>';
|
||||||
if ($conf->projet->enabled)
|
if ($conf->projet->enabled)
|
||||||
{
|
{
|
||||||
print "<td>";
|
print "<td>";
|
||||||
|
|||||||
@ -23,3 +23,4 @@ DonationStatusPaidShort=Received
|
|||||||
ValidPromess=Validate promise
|
ValidPromess=Validate promise
|
||||||
BuildDonationReceipt=Build receipt
|
BuildDonationReceipt=Build receipt
|
||||||
DonationsModels=Documents models for donation receipts
|
DonationsModels=Documents models for donation receipts
|
||||||
|
LastModifiedDonations=Last %s modified donations
|
||||||
@ -23,3 +23,4 @@ DonationStatusPaidShort=Payé
|
|||||||
ValidPromess=Valider promesse
|
ValidPromess=Valider promesse
|
||||||
BuildDonationReceipt=Créer reçu
|
BuildDonationReceipt=Créer reçu
|
||||||
DonationsModels=Modèle de document de bon de réception de dons
|
DonationsModels=Modèle de document de bon de réception de dons
|
||||||
|
LastModifiedDonations=Les %s derniers dons modifiés
|
||||||
Loading…
Reference in New Issue
Block a user