本文整理汇总了PHP中Societe::verif_rib方法的典型用法代码示例。如果您正苦于以下问题:PHP Societe::verif_rib方法的具体用法?PHP Societe::verif_rib怎么用?PHP Societe::verif_rib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Societe
的用法示例。
在下文中一共展示了Societe::verif_rib方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Create
/**
* Create a withdraw
* @param banque code of bank
* @param guichet code of banck office
* @param mode real=do action, simu=test only
* @return int <0 if KO, nbre of invoice withdrawed if OK
*/
function Create($banque=0, $guichet=0, $mode='real')
{
global $conf,$langs;
dol_syslog("BonPrelevement::Create banque=$banque guichet=$guichet");
require_once (DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once (DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
$error = 0;
$datetimeprev = time();
$month = strftime("%m", $datetimeprev);
$year = strftime("%Y", $datetimeprev);
$puser = new User($this->db, $conf->global->PRELEVEMENT_USER);
/*
* Read invoices
*/
$factures = array();
$factures_prev = array();
$factures_result = array();
if (! $error)
{
$sql = "SELECT f.rowid, pfd.rowid as pfdrowid, f.fk_soc";
$sql.= ", pfd.code_banque, pfd.code_guichet, pfd.number, pfd.cle_rib";
$sql.= ", pfd.amount";
$sql.= ", s.nom";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
if ($banque == 1 || $agence ==1) $sql.= ", ".MAIN_DB_PREFIX."societe_rib as sr";
$sql.= " WHERE f.rowid = pfd.fk_facture";
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " AND s.rowid = f.fk_soc";
if ($banque == 1 || $agence ==1) $sql.= " AND s.rowid = sr.fk_soc";
$sql.= " AND f.fk_statut = 1";
$sql.= " AND f.paye = 0";
$sql.= " AND pfd.traite = 0";
$sql.= " AND f.total_ttc > 0";
if ($banque == 1) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
if ($agence == 1) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'";
dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $this->db->fetch_row($resql);
$factures[$i] = $row;
$i++;
}
$this->db->free($resql);
dol_syslog($i." invoices to withdraw");
}
else
{
$error = 1;
dol_syslog("Erreur -1");
dol_syslog($this->db->error());
}
}
if (! $error)
{
// Check RIB
$i = 0;
dol_syslog("Start RIB check");
if (sizeof($factures) > 0)
{
foreach ($factures as $fac)
{
$fact = new Facture($this->db);
if ($fact->fetch($fac[0]) >= 0)
{
$soc = new Societe($this->db);
if ($soc->fetch($fact->socid) >= 0)
{
if ($soc->verif_rib() == 1)
{
$factures_prev[$i] = $fac;
/* second tableau necessaire pour bon-prelevement */
$factures_prev_id[$i] = $fac[0];
$i++;
//.........这里部分代码省略.........