本文整理汇总了PHP中CommandeFournisseur::hasDelay方法的典型用法代码示例。如果您正苦于以下问题:PHP CommandeFournisseur::hasDelay方法的具体用法?PHP CommandeFournisseur::hasDelay怎么用?PHP CommandeFournisseur::hasDelay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandeFournisseur
的用法示例。
在下文中一共展示了CommandeFournisseur::hasDelay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AND
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user)
{
global $conf, $langs;
$clause = " WHERE";
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.fk_statut, c.date_livraison as delivery_date";
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseur as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON c.fk_soc = sc.fk_soc";
$sql .= " WHERE sc.fk_user = " . $user->id;
$clause = " AND";
}
$sql .= $clause . " c.entity = " . $conf->entity;
$sql .= " AND (c.fk_statut BETWEEN 1 AND 2)";
if ($user->societe_id) {
$sql .= " AND c.fk_soc = " . $user->societe_id;
}
$resql = $this->db->query($sql);
if ($resql) {
$commandestatic = new CommandeFournisseur($this->db);
$response = new WorkboardResponse();
$response->warning_delay = $conf->commande->fournisseur->warning_delay / 60 / 60 / 24;
$response->label = $langs->trans("SuppliersOrdersToProcess");
$response->url = DOL_URL_ROOT . '/fourn/commande/list.php?statut=1,2,3';
$response->img = img_object($langs->trans("Orders"), "order");
while ($obj = $this->db->fetch_object($resql)) {
$response->nbtodo++;
$commandestatic->date_livraison = $this->db->jdate($obj->delivery_date);
$commandestatic->date_commande = $this->db->jdate($obj->date_commande);
$commandestatic->statut = $obj->fk_statut;
if ($commandestatic->hasDelay()) {
$response->nbtodolate++;
}
}
return $response;
} else {
$this->error = $this->db->error();
return -1;
}
}