49 public $fk_pcg_version;
69 public $account_number;
74 public $account_parent;
94 public function fetch($rowid = 0, $ref =
'')
98 if ($rowid > 0 || $ref) {
99 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active";
100 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
103 $sql .=
" a.rowid = ".((int) $rowid);
105 $sql .=
" a.pcg_version = '".$this->db->escape($ref).
"'";
108 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
109 $result = $this->
db->query($sql);
111 $obj = $this->
db->fetch_object($result);
114 $this->
id = $obj->rowid;
115 $this->
rowid = $obj->rowid;
116 $this->pcg_version = $obj->pcg_version;
117 $this->
ref = $obj->pcg_version;
118 $this->label = $obj->label;
119 $this->active = $obj->active;
126 $this->error =
"Error ".$this->db->lasterror();
127 $this->errors[] =
"Error ".$this->db->lasterror();
144 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"accounting_system";
145 $sql .=
" (date_creation, fk_user_author, numero, label)";
146 $sql .=
" VALUES ('".$this->db->idate($now).
"',".((int) $user->id).
",'".$this->
db->escape($this->numero).
"','".$this->
db->escape($this->label).
"')";
148 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
151 $id = $this->
db->last_insert_id(MAIN_DB_PREFIX.
"accounting_system");
155 $result = $this->rowid;
158 $this->error =
"AccountancySystem::Create Error $result";
163 $this->error =
"AccountancySystem::Create Error $result";
$conf db
API class for accounts.
dol_now($mode= 'auto')
Return date for now.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
__construct($db)
Constructor.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->supplier_invoice->lire)) if(isModEnabled('don')&&!empty($user->rights->don->lire)) if(isModEnabled('tax')&&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture')&&isModEnabled('commande')&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Class to manage accountancy systems.
create($user)
Insert accountancy system name into database.
fetch($rowid=0, $ref= '')
Load record in memory.
print *****$script_file(".$version.") pid c cd cd cd description as p label as s rowid