44 public $errors = array();
54 public $fk_pcg_version;
74 public $account_number;
79 public $account_parent;
99 public function fetch($rowid = 0, $ref =
'')
103 if ($rowid > 0 || $ref) {
104 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active";
105 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
108 $sql .=
" a.rowid = ".((int) $rowid);
110 $sql .=
" a.pcg_version = '".$this->db->escape($ref).
"'";
113 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
114 $result = $this->db->query(
$sql);
116 $obj = $this->db->fetch_object($result);
119 $this->
id = $obj->rowid;
120 $this->
rowid = $obj->rowid;
121 $this->pcg_version = $obj->pcg_version;
122 $this->
ref = $obj->pcg_version;
123 $this->label = $obj->label;
124 $this->active = $obj->active;
131 $this->error =
"Error ".$this->db->lasterror();
132 $this->errors[] =
"Error ".$this->db->lasterror();
149 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"accounting_system";
150 $sql .=
" (date_creation, fk_user_author, numero, label)";
151 $sql .=
" VALUES ('".$this->db->idate($now).
"',".((int) $user->id).
",'".$this->db->escape($this->numero).
"','".$this->db->escape($this->label).
"')";
153 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
154 $resql = $this->db->query(
$sql);
156 $id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"accounting_system");
160 $result = $this->rowid;
163 $this->error =
"AccountancySystem::Create Error $result";
168 $this->error =
"AccountancySystem::Create Error $result";
Class to manage accountancy systems.
fetch($rowid=0, $ref='')
Load record in memory.
create($user)
Insert accountancy system name into database.
__construct($db)
Constructor.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
print *****$script_file(".$version.") pid c cd cd cd description as p label as s rowid
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.