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)
100 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active";
101 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
104 $sql .=
" a.rowid = ".((int) $rowid);
106 $sql .=
" a.pcg_version = '".$this->db->escape($ref).
"'";
109 dol_syslog(get_class($this).
"::fetch sql=".$sql, LOG_DEBUG);
110 $result = $this->
db->query($sql);
112 $obj = $this->
db->fetch_object($result);
115 $this->
id = $obj->rowid;
116 $this->
rowid = $obj->rowid;
117 $this->pcg_version = $obj->pcg_version;
118 $this->ref = $obj->pcg_version;
119 $this->label = $obj->label;
120 $this->active = $obj->active;
127 $this->error =
"Error ".$this->db->lasterror();
128 $this->errors[] =
"Error ".$this->db->lasterror();
145 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"accounting_system";
146 $sql .=
" (date_creation, fk_user_author, numero, label)";
147 $sql .=
" VALUES ('".$this->db->idate($now).
"',".$user->id.
",'".$this->
db->escape($this->numero).
"','".$this->
db->escape($this->label).
"')";
149 dol_syslog(get_class($this).
"::create sql=".$sql, LOG_DEBUG);
152 $id = $this->
db->last_insert_id(MAIN_DB_PREFIX.
"accounting_system");
156 $result = $this->rowid;
159 $this->error =
"AccountancySystem::Create Error $result";
164 $this->error =
"AccountancySystem::Create Error $result";
</td >< tdcolspan="3">< spanclass="opacitymedium"></span ></td ></tr >< trclass="liste_total"> CREANCES DETTES< tdcolspan="3"class="right"></td >< tdcolspan="3"class="right"></td ></tr > CREANCES DETTES RECETTES DEPENSES trips CREANCES DETTES Y m expensereport p date_valid Y m expensereport pe datep $db idate($date_start)."' AND $column < p rowid
dol_now($mode= 'auto')
Return date for now.
$conf db
API class for accounts.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
__construct($db)
Constructor.
Class to manage accountancy systems.
create($user)
Insert accountancy system name into database.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
fetch($rowid=0, $ref= '')
Load record in memory.