本文整理匯總了PHP中Societe::load_ban方法的典型用法代碼示例。如果您正苦於以下問題:PHP Societe::load_ban方法的具體用法?PHP Societe::load_ban怎麽用?PHP Societe::load_ban使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Societe
的用法示例。
在下文中一共展示了Societe::load_ban方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Societe
/**
* Create a withdrawal request for a standing order
*
* @param User $user User asking standing order
* @return int <0 if KO, >0 if OK
*/
function demande_prelevement($user)
{
dol_syslog(get_class($this) . "::demande_prelevement", LOG_DEBUG);
$soc = new Societe($this->db);
$soc->id = $this->socid;
$soc->load_ban();
if ($this->statut > 0 && $this->paye == 0) {
$sql = 'SELECT count(*)';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'prelevement_facture_demande';
$sql .= ' WHERE fk_facture = ' . $this->id;
$sql .= ' AND traite = 0';
$resql = $this->db->query($sql);
if ($resql) {
$row = $this->db->fetch_row($resql);
if ($row[0] == 0) {
$now = dol_now();
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . 'prelevement_facture_demande';
$sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)';
$sql .= ' VALUES (' . $this->id;
$sql .= ",'" . price2num($this->total_ttc) . "'";
$sql .= "," . $this->db->idate($now) . "," . $user->id;
$sql .= ",'" . $soc->bank_account->code_banque . "'";
$sql .= ",'" . $soc->bank_account->code_guichet . "'";
$sql .= ",'" . $soc->bank_account->number . "'";
$sql .= ",'" . $soc->bank_account->cle_rib . "')";
if ($this->db->query($sql)) {
return 1;
} else {
$this->error = $this->db->error();
dol_syslog(get_class($this) . '::demandeprelevement Erreur');
return -1;
}
} else {
$this->error = "A request already exists";
dol_syslog(get_class($this) . '::demandeprelevement Impossible de creer une demande, demande deja en cours');
}
} else {
$this->error = $this->db->error();
dol_syslog(get_class($this) . '::demandeprelevement Erreur -2');
return -2;
}
} else {
$this->error = "Status of invoice does not allow this";
dol_syslog(get_class($this) . "::demandeprelevement " . $this->error . " {$this->statut}, {$this->paye}, {$this->mode_reglement_id}");
return -3;
}
}