45 public $errors = array();
62 public $fk_pcg_version;
97 public $account_number;
102 public $account_parent;
122 public function fetch($rowid = 0, $ref =
'')
126 if ($rowid > 0 || $ref) {
127 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active";
128 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
131 $sql .=
" a.rowid = ".((int) $rowid);
133 $sql .=
" a.pcg_version = '".$this->db->escape($ref).
"'";
136 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
137 $result = $this->db->query(
$sql);
139 $obj = $this->db->fetch_object($result);
142 $this->
id = $obj->rowid;
143 $this->
rowid = $obj->rowid;
144 $this->pcg_version = $obj->pcg_version;
145 $this->
ref = $obj->pcg_version;
146 $this->label = $obj->label;
147 $this->active = $obj->active;
154 $this->error =
"Error ".$this->db->lasterror();
155 $this->errors[] =
"Error ".$this->db->lasterror();
172 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"accounting_system";
173 $sql .=
" (date_creation, fk_user_author, numero, label)";
174 $sql .=
" VALUES ('".$this->db->idate($now).
"',".((int) $user->id).
",'".$this->db->escape($this->numero).
"','".$this->db->escape($this->label).
"')";
176 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
177 $resql = $this->db->query(
$sql);
179 $id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"accounting_system");
184 $result = $this->rowid;
187 $this->error =
"AccountancySystem::Create Error $result";
192 $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('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('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') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('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.