FIX Trad and creation date in subscription create
This commit is contained in:
parent
14d7ffa53b
commit
7c95233e3c
@ -77,15 +77,17 @@ class Subscription extends CommonObject
|
|||||||
$this->error=$langs->trans("ErrorBadValueForDate");
|
$this->error=$langs->trans("ErrorBadValueForDate");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (empty($this->datec)) $this->datec = $now;
|
||||||
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, datec, dateadh, datef, subscription, note)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, datec, dateadh, datef, subscription, note)";
|
||||||
$sql.= " VALUES (".$this->fk_adherent.", '".$this->db->idate($now)."',";
|
$sql.= " VALUES (".$this->fk_adherent.", '".$this->db->idate($this->datec)."',";
|
||||||
$sql.= " '".$this->db->idate($this->dateh)."',";
|
$sql.= " '".$this->db->idate($this->dateh)."',";
|
||||||
$sql.= " '".$this->db->idate($this->datef)."',";
|
$sql.= " '".$this->db->idate($this->datef)."',";
|
||||||
$sql.= " ".$this->amount.",";
|
$sql.= " ".$this->amount.",";
|
||||||
$sql.= " '".$this->db->escape($this->note)."')";
|
$sql.= " '".$this->db->escape($this->note_public?$this->note_public:$this->note)."')";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
@ -324,6 +326,8 @@ class Subscription extends CommonObject
|
|||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
|
$langs->load("members");
|
||||||
$label=$langs->trans("ShowSubscription").': '.$this->ref;
|
$label=$langs->trans("ShowSubscription").': '.$this->ref;
|
||||||
|
|
||||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
$linkstart = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user