Skip to content

Commit

Permalink
Debug v18
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jun 8, 2023
1 parent 5fcbf14 commit d28fcda
Show file tree
Hide file tree
Showing 4 changed files with 657 additions and 648 deletions.
18 changes: 10 additions & 8 deletions htdocs/adherents/class/subscription.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ class Subscription extends CommonObject
public $amount;

/**
* @var int ID
* @var int ID of bank in llx_bank
*/
public $fk_bank;

/**
* @var array Array with all fields into database and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
Expand Down Expand Up @@ -128,7 +131,7 @@ public function __construct($db)


/**
* Function who permitted cretaion of the subscription
* Function who permitted creation of the subscription
*
* @param User $user User that create
* @param bool $notrigger false=launch triggers after, true=disable triggers
Expand All @@ -151,7 +154,6 @@ public function create($user, $notrigger = false)
$this->datec = $now;
}


$this->db->begin();

$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
Expand Down Expand Up @@ -217,7 +219,7 @@ public function fetch($rowid)
$sql .= " datef,";
$sql .= " subscription, note as note_public, fk_bank";
$sql .= " FROM ".MAIN_DB_PREFIX."subscription";
$sql .= " WHERE rowid=".((int) $rowid);
$sql .= " WHERE rowid = ".((int) $rowid);

dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
Expand Down Expand Up @@ -274,11 +276,11 @@ public function update($user, $notrigger = 0)
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
$sql .= " fk_type = ".((int) $this->fk_type).",";
$sql .= " fk_adherent = ".((int) $this->fk_adherent).",";
$sql .= " note=".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null').",";
$sql .= " note = ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null').",";
$sql .= " subscription = ".price2num($this->amount).",";
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
$sql .= " datef='".$this->db->idate($this->datef)."',";
$sql .= " datec='".$this->db->idate($this->datec)."',";
$sql .= " dateadh = '".$this->db->idate($this->dateh)."',";
$sql .= " datef = '".$this->db->idate($this->datef)."',";
$sql .= " datec = '".$this->db->idate($this->datec)."',";
$sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null');
$sql .= " WHERE rowid = ".((int) $this->id);

Expand Down
Loading

0 comments on commit d28fcda

Please sign in to comment.