Qual: uniformize code for propertie dateh (removed dateadh), for class
Cotisation.
This commit is contained in:
parent
63100c9c06
commit
33ac8cc5f3
@ -681,7 +681,7 @@ if ($rowid)
|
|||||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,";
|
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,";
|
||||||
$sql.= " c.rowid as crowid, c.cotisation,";
|
$sql.= " c.rowid as crowid, c.cotisation,";
|
||||||
$sql.= " c.datec,";
|
$sql.= " c.datec,";
|
||||||
$sql.= " c.dateadh,";
|
$sql.= " c.dateadh as dateh,";
|
||||||
$sql.= " c.datef,";
|
$sql.= " c.datef,";
|
||||||
$sql.= " c.fk_bank,";
|
$sql.= " c.fk_bank,";
|
||||||
$sql.= " b.rowid as bid,";
|
$sql.= " b.rowid as bid,";
|
||||||
@ -724,7 +724,7 @@ if ($rowid)
|
|||||||
$cotisationstatic->id=$objp->crowid;
|
$cotisationstatic->id=$objp->crowid;
|
||||||
print '<td>'.$cotisationstatic->getNomUrl(1).'</td>';
|
print '<td>'.$cotisationstatic->getNomUrl(1).'</td>';
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datec),'dayhour')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($objp->datec),'dayhour')."</td>\n";
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dateadh),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($objp->dateh),'day')."</td>\n";
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
|
||||||
print '<td align="right">'.price($objp->cotisation).'</td>';
|
print '<td align="right">'.price($objp->cotisation).'</td>';
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
|
|||||||
@ -1191,7 +1191,7 @@ class Adherent extends CommonObject
|
|||||||
$sql = "SELECT c.rowid, c.fk_adherent, c.cotisation, c.note, c.fk_bank,";
|
$sql = "SELECT c.rowid, c.fk_adherent, c.cotisation, c.note, c.fk_bank,";
|
||||||
$sql.= " c.tms as datem,";
|
$sql.= " c.tms as datem,";
|
||||||
$sql.= " c.datec as datec,";
|
$sql.= " c.datec as datec,";
|
||||||
$sql.= " c.dateadh as dateadh,";
|
$sql.= " c.dateadh as dateh,";
|
||||||
$sql.= " c.datef as datef";
|
$sql.= " c.datef as datef";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."cotisation as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."cotisation as c";
|
||||||
$sql.= " WHERE c.fk_adherent = ".$this->id;
|
$sql.= " WHERE c.fk_adherent = ".$this->id;
|
||||||
@ -1208,10 +1208,10 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($i==0)
|
if ($i==0)
|
||||||
{
|
{
|
||||||
$this->first_subscription_date=$obj->dateadh;
|
$this->first_subscription_date=$obj->dateh;
|
||||||
$this->first_subscription_amount=$obj->cotisation;
|
$this->first_subscription_amount=$obj->cotisation;
|
||||||
}
|
}
|
||||||
$this->last_subscription_date=$obj->dateadh;
|
$this->last_subscription_date=$obj->dateh;
|
||||||
$this->last_subscription_amount=$obj->cotisation;
|
$this->last_subscription_amount=$obj->cotisation;
|
||||||
|
|
||||||
$subscription=new Cotisation($this->db);
|
$subscription=new Cotisation($this->db);
|
||||||
@ -1222,7 +1222,7 @@ class Adherent extends CommonObject
|
|||||||
$subscription->fk_bank=$obj->fk_bank;
|
$subscription->fk_bank=$obj->fk_bank;
|
||||||
$subscription->datem=$this->db->jdate($obj->datem);
|
$subscription->datem=$this->db->jdate($obj->datem);
|
||||||
$subscription->datec=$this->db->jdate($obj->datec);
|
$subscription->datec=$this->db->jdate($obj->datec);
|
||||||
$subscription->dateadh=$this->db->jdate($obj->dateadh);
|
$subscription->dateh=$this->db->jdate($obj->dateh);
|
||||||
$subscription->datef=$this->db->jdate($obj->datef);
|
$subscription->datef=$this->db->jdate($obj->datef);
|
||||||
|
|
||||||
$this->subscriptions[]=$subscription;
|
$this->subscriptions[]=$subscription;
|
||||||
|
|||||||
@ -36,9 +36,9 @@ class Cotisation extends CommonObject
|
|||||||
var $id;
|
var $id;
|
||||||
var $ref;
|
var $ref;
|
||||||
|
|
||||||
var $datec;
|
var $datec; // Date creation
|
||||||
var $datem;
|
var $datem; // Date modification
|
||||||
var $dateh; // Subscription start date
|
var $dateh; // Subscription start date (date subscription)
|
||||||
var $datef; // Subscription end date
|
var $datef; // Subscription end date
|
||||||
var $fk_adherent;
|
var $fk_adherent;
|
||||||
var $amount;
|
var $amount;
|
||||||
@ -107,7 +107,7 @@ class Cotisation extends CommonObject
|
|||||||
{
|
{
|
||||||
$sql ="SELECT rowid, fk_adherent, datec,";
|
$sql ="SELECT rowid, fk_adherent, datec,";
|
||||||
$sql.=" tms,";
|
$sql.=" tms,";
|
||||||
$sql.=" dateadh,";
|
$sql.=" dateadh as dateh,";
|
||||||
$sql.=" datef,";
|
$sql.=" datef,";
|
||||||
$sql.=" cotisation, note, fk_bank";
|
$sql.=" cotisation, note, fk_bank";
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."cotisation";
|
$sql.=" FROM ".MAIN_DB_PREFIX."cotisation";
|
||||||
@ -127,7 +127,7 @@ class Cotisation extends CommonObject
|
|||||||
$this->fk_adherent = $obj->fk_adherent;
|
$this->fk_adherent = $obj->fk_adherent;
|
||||||
$this->datec = $this->db->jdate($obj->datec);
|
$this->datec = $this->db->jdate($obj->datec);
|
||||||
$this->datem = $this->db->jdate($obj->tms);
|
$this->datem = $this->db->jdate($obj->tms);
|
||||||
$this->dateh = $this->db->jdate($obj->dateadh);
|
$this->dateh = $this->db->jdate($obj->dateh);
|
||||||
$this->datef = $this->db->jdate($obj->datef);
|
$this->datef = $this->db->jdate($obj->datef);
|
||||||
$this->amount = $obj->cotisation;
|
$this->amount = $obj->cotisation;
|
||||||
$this->note = $obj->note;
|
$this->note = $obj->note;
|
||||||
|
|||||||
@ -63,7 +63,7 @@ llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Modu
|
|||||||
|
|
||||||
if ($msg) print $msg.'<br>';
|
if ($msg) print $msg.'<br>';
|
||||||
|
|
||||||
// Liste des cotisations
|
// List of subscriptions
|
||||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe,";
|
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe,";
|
||||||
$sql.= " c.rowid as crowid, c.cotisation,";
|
$sql.= " c.rowid as crowid, c.cotisation,";
|
||||||
$sql.= " c.dateadh,";
|
$sql.= " c.dateadh,";
|
||||||
@ -75,7 +75,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid";
|
|||||||
$sql.= " WHERE d.rowid = c.fk_adherent";
|
$sql.= " WHERE d.rowid = c.fk_adherent";
|
||||||
if (isset($date_select) && $date_select != '')
|
if (isset($date_select) && $date_select != '')
|
||||||
{
|
{
|
||||||
$sql.= " AND dateadh LIKE '$date_select%'";
|
$sql.= " AND c.dateadh LIKE '".$date_select."%'";
|
||||||
}
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|||||||
@ -367,13 +367,13 @@ $Number=array();
|
|||||||
$tot=0;
|
$tot=0;
|
||||||
$numb=0;
|
$numb=0;
|
||||||
|
|
||||||
$sql = "SELECT c.cotisation, c.dateadh";
|
$sql = "SELECT c.cotisation, c.dateadh as dateh";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
|
||||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||||
$sql.= " AND d.rowid = c.fk_adherent";
|
$sql.= " AND d.rowid = c.fk_adherent";
|
||||||
if(isset($date_select) && $date_select != '')
|
if(isset($date_select) && $date_select != '')
|
||||||
{
|
{
|
||||||
$sql .= " AND dateadh LIKE '$date_select%'";
|
$sql .= " AND c.dateadh LIKE '".$date_select."%'";
|
||||||
}
|
}
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -383,7 +383,7 @@ if ($result)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$year=dol_print_date($db->jdate($objp->dateadh),"%Y");
|
$year=dol_print_date($db->jdate($objp->dateh),"%Y");
|
||||||
$Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->cotisation;
|
$Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->cotisation;
|
||||||
$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
|
$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
|
||||||
$tot+=$objp->cotisation;
|
$tot+=$objp->cotisation;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user