Qual: uniformize code for propertie dateh (removed dateadh), for class
Cotisation.
This commit is contained in:
parent
63100c9c06
commit
33ac8cc5f3
@ -337,7 +337,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
{
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
@ -349,7 +349,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Create draft invoice
|
||||
@ -367,7 +367,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
}
|
||||
$invoice->socid=$object->fk_soc;
|
||||
$invoice->date=$datecotisation;
|
||||
|
||||
|
||||
$result=$invoice->create($user);
|
||||
if ($result <= 0)
|
||||
{
|
||||
@ -375,7 +375,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Add line to draft invoice
|
||||
@ -392,11 +392,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
$errmsg=$invoice->error;
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Validate invoice
|
||||
$result=$invoice->validate($user);
|
||||
}
|
||||
|
||||
|
||||
// Add payment onto invoice
|
||||
if ($option == 'bankviainvoice' && $accountid)
|
||||
{
|
||||
@ -681,7 +681,7 @@ if ($rowid)
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.cotisation,";
|
||||
$sql.= " c.datec,";
|
||||
$sql.= " c.dateadh,";
|
||||
$sql.= " c.dateadh as dateh,";
|
||||
$sql.= " c.datef,";
|
||||
$sql.= " c.fk_bank,";
|
||||
$sql.= " b.rowid as bid,";
|
||||
@ -724,7 +724,7 @@ if ($rowid)
|
||||
$cotisationstatic->id=$objp->crowid;
|
||||
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->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="right">'.price($objp->cotisation).'</td>';
|
||||
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.= " c.tms as datem,";
|
||||
$sql.= " c.datec as datec,";
|
||||
$sql.= " c.dateadh as dateadh,";
|
||||
$sql.= " c.dateadh as dateh,";
|
||||
$sql.= " c.datef as datef";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."cotisation as c";
|
||||
$sql.= " WHERE c.fk_adherent = ".$this->id;
|
||||
@ -1208,10 +1208,10 @@ class Adherent extends CommonObject
|
||||
{
|
||||
if ($i==0)
|
||||
{
|
||||
$this->first_subscription_date=$obj->dateadh;
|
||||
$this->first_subscription_date=$obj->dateh;
|
||||
$this->first_subscription_amount=$obj->cotisation;
|
||||
}
|
||||
$this->last_subscription_date=$obj->dateadh;
|
||||
$this->last_subscription_date=$obj->dateh;
|
||||
$this->last_subscription_amount=$obj->cotisation;
|
||||
|
||||
$subscription=new Cotisation($this->db);
|
||||
@ -1222,7 +1222,7 @@ class Adherent extends CommonObject
|
||||
$subscription->fk_bank=$obj->fk_bank;
|
||||
$subscription->datem=$this->db->jdate($obj->datem);
|
||||
$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);
|
||||
|
||||
$this->subscriptions[]=$subscription;
|
||||
|
||||
@ -36,9 +36,9 @@ class Cotisation extends CommonObject
|
||||
var $id;
|
||||
var $ref;
|
||||
|
||||
var $datec;
|
||||
var $datem;
|
||||
var $dateh; // Subscription start date
|
||||
var $datec; // Date creation
|
||||
var $datem; // Date modification
|
||||
var $dateh; // Subscription start date (date subscription)
|
||||
var $datef; // Subscription end date
|
||||
var $fk_adherent;
|
||||
var $amount;
|
||||
@ -107,7 +107,7 @@ class Cotisation extends CommonObject
|
||||
{
|
||||
$sql ="SELECT rowid, fk_adherent, datec,";
|
||||
$sql.=" tms,";
|
||||
$sql.=" dateadh,";
|
||||
$sql.=" dateadh as dateh,";
|
||||
$sql.=" datef,";
|
||||
$sql.=" cotisation, note, fk_bank";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."cotisation";
|
||||
@ -127,7 +127,7 @@ class Cotisation extends CommonObject
|
||||
$this->fk_adherent = $obj->fk_adherent;
|
||||
$this->datec = $this->db->jdate($obj->datec);
|
||||
$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->amount = $obj->cotisation;
|
||||
$this->note = $obj->note;
|
||||
|
||||
@ -63,7 +63,7 @@ llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Modu
|
||||
|
||||
if ($msg) print $msg.'<br>';
|
||||
|
||||
// Liste des cotisations
|
||||
// List of subscriptions
|
||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.cotisation,";
|
||||
$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";
|
||||
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->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
@ -367,13 +367,13 @@ $Number=array();
|
||||
$tot=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.= " WHERE d.entity IN (".getEntity().")";
|
||||
$sql.= " AND d.rowid = c.fk_adherent";
|
||||
if(isset($date_select) && $date_select != '')
|
||||
{
|
||||
$sql .= " AND dateadh LIKE '$date_select%'";
|
||||
$sql .= " AND c.dateadh LIKE '".$date_select."%'";
|
||||
}
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
@ -383,7 +383,7 @@ if ($result)
|
||||
while ($i < $num)
|
||||
{
|
||||
$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;
|
||||
$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
|
||||
$tot+=$objp->cotisation;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user