本文整理汇总了PHP中CommandeFournisseur类的典型用法代码示例。如果您正苦于以下问题:PHP CommandeFournisseur类的具体用法?PHP CommandeFournisseur怎么用?PHP CommandeFournisseur使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommandeFournisseur类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadBox
/**
* Load data into info_box_contents array to show array later.
*
* @param int $max Maximum number of records to load
* @return void
*/
function loadBox($max = 5)
{
global $conf, $user, $langs, $db;
$langs->load("boxes");
$this->max = $max;
include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php';
$supplierorderstatic = new CommandeFournisseur($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLatestSupplierOrders", $max));
if ($user->rights->fournisseur->commande->lire) {
$sql = "SELECT s.nom, s.rowid as socid,";
$sql .= " c.ref, c.tms, c.rowid,";
$sql .= " c.fk_statut";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
$sql .= ", " . MAIN_DB_PREFIX . "commande_fournisseur as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity = " . $conf->entity;
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
}
if ($user->societe_id) {
$sql .= " AND s.rowid = " . $user->societe_id;
}
$sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
$sql .= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$datem = $db->jdate($objp->tms);
$urlo = DOL_URL_ROOT . "/fourn/commande/fiche.php?id=" . $objp->rowid;
$urls = DOL_URL_ROOT . "/fourn/fiche.php?socid=" . $objp->socid;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => $urlo);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->ref, 'url' => $urlo);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', 'logo' => 'company', 'url' => $urls);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', 'text' => $objp->nom, 'url' => $urls);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_print_date($datem, 'day'));
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $supplierorderstatic->LibStatut($objp->fk_statut, 3));
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoSupplierOrder"));
}
$db->free($result);
} else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql);
}
} else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed"));
}
}
示例2: selectSupplierOrderStatus
/**
* Return combo list of differents status of a orders
*
* @param string $selected Preselected value
* @param int $short Use short labels
* @param string $hmlname Name of HTML select element
* @return void
*/
function selectSupplierOrderStatus($selected = '', $short = 0, $hmlname = 'order_status')
{
$tmpsupplierorder = new CommandeFournisseur($db);
print '<select class="flat" name="' . $hmlname . '">';
print '<option value="-1"> </option>';
$statustohow = array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6,7', '9' => '9');
// 7 is same label than 6. 8 does not exists (billed is another field)
foreach ($statustohow as $key => $value) {
print '<option value="' . $value . '"' . ($selected == $key || $selected == $value ? ' selected' : '') . '>';
$tmpsupplierorder->statut = $key;
print $tmpsupplierorder->getLibStatut($short);
print '</option>';
}
print '</select>';
}
示例3: selectSupplierOrderStatus
/**
* Return combo list of differents status of a orders
*
* @param string $selected Preselected value
* @param int $short Use short labels
* @param string $hmlname Name of HTML select element
* @return void
*/
function selectSupplierOrderStatus($selected = '', $short = 0, $hmlname = 'order_status')
{
print '<select class="flat" name="' . $hmlname . '">';
print '<option value="-1"> </option>';
$statustohow = array(0, 1, 2, 3, 4, 5, 6, 9);
// 7 is same label than 6. 8 does not exist.
foreach ($statustohow as $key) {
print '<option value="' . $key . '"' . ($selected == $key ? ' selected="selected"' : '') . '>';
print CommandeFournisseur::LibStatut($key, $short);
print '</option>';
}
print '</select>';
}
示例4: selectSupplierOrderStatus
/**
* Return combo list of differents status of a orders
*
* @param array $selected Preselected values
* @param string $selected Preselected value
* @param int $short Use short labels
* @param string $hmlname Name of HTML select element
* @return void
*/
function selectSupplierOrderStatus($selected = array(), $short = 0, $hmlname = 'order_status')
{
/*print '<select class="flat" name="'.$hmlname.'">';
print '<option value="-1"> </option>';
$statustohow=array(0,1,2,3,4,5,6,9); // 7 is same label than 6. 8 does not exist.
foreach($statustohow as $key)
{
print '<option value="'.$key.'"'.($selected == $key?' selected="selected"':'').'>';
print CommandeFournisseur::LibStatut($key,$short);
print '</option>';
*/
$statustohow = array(0, 1, 2, 3, 4, 5, 6, 9);
// 7 is same label than 6. 8 does not exist.
foreach ($statustohow as $key) {
$stat = CommandeFournisseur::LibStatut($key, $short);
print '<input name="statuts[]" type="checkbox" value="' . $key . '"' . ($selected[$key] == $key ? ' selected="selected"' : '') . '> ' . $stat . ' - ';
print $key;
}
}
示例5: llxHeader
*/
llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur");
$html = new Form($db);
$warehouse_static = new Entrepot($db);
$now=dol_now();
$id = $_GET['id'];
$ref= $_GET['ref'];
if ($id > 0 || ! empty($ref))
{
//if ($mesg) print $mesg.'<br>';
$commande = new CommandeFournisseur($db);
$result=$commande->fetch($_GET['id'],$_GET['ref']);
if ($result >= 0)
{
$soc = new Societe($db);
$soc->fetch($commande->socid);
$author = new User($db);
$author->fetch($commande->user_author_id);
$head = ordersupplier_prepare_head($commande);
$title=$langs->trans("SupplierOrder");
dol_fiche_head($head, 'dispatch', $title, 0, 'order');
示例6: GETPOST
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
// Security check
$socid = '';
if (!empty($user->societe_id)) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
/*
* View
*/
$form = new Form($db);
$now = dol_now();
if ($id > 0 || !empty($ref)) {
$soc = new Societe($db);
$commande = new CommandeFournisseur($db);
$result = $commande->fetch($id, $ref);
if ($result >= 0) {
$soc->fetch($commande->socid);
$author = new User($db);
$author->fetch($commande->user_author_id);
llxHeader('', $langs->trans("History"), "CommandeFournisseur");
$head = ordersupplier_prepare_head($commande);
$title = $langs->trans("SupplierOrder");
dol_fiche_head($head, 'info', $title, 0, 'order');
/*
* Commande
*/
print '<table class="border" width="100%">';
$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/commande/list.php' . (!empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
示例7: GETPOST
$origin = GETPOST('origin', 'alpha');
$originid = GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int');
// For backward compatibility
//PDF
$hidedetails = GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
$hidedesc = GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
$hideref = GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
$datelivraison = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), GETPOST('liv_sec', 'int'), GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
// Security check
if ($user->societe_id) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('ordersuppliercard', 'globalcard'));
$object = new CommandeFournisseur($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref);
if ($ret < 0) {
dol_print_error($db, $object->error);
}
$ret = $object->fetch_thirdparty();
if ($ret < 0) {
dol_print_error($db, $object->error);
}
} else {
if (!empty($socid) && $socid > 0) {
示例8: dol_trunc
print '<td class="nowrap">';
print $productstatic->getNomUrl(1);
print '</td>';
print '<td align="center">';
print dol_trunc(dol_htmlentities($objp->label), 30);
print '</td>';
print '<td align="right" class="nowrap">' . dol_print_date($objp->tms) . '</td>';
print '</tr>';
}
}
print '</table>';
}
/*
* Last supplier orders
*/
$orderstatic = new CommandeFournisseur($db);
if ($user->rights->fournisseur->commande->lire) {
// TODO move to DAO class
// Check if there are supplier orders billable
$sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_supplier,';
$sql2 .= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut';
$sql2 .= ' FROM ' . MAIN_DB_PREFIX . 'societe as s';
$sql2 .= ', ' . MAIN_DB_PREFIX . 'commande_fournisseur as c';
$sql2 .= ' WHERE c.fk_soc = s.rowid';
$sql2 .= ' AND s.rowid = ' . $object->id;
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql2 .= " AND c.fk_statut IN (5)";
$sql2 .= " AND c.billed = 0";
// Find order that are not already invoiced
// just need to check received status because we have the billed status now
//$sql2 .= " AND c.rowid NOT IN (SELECT fk_source FROM " . MAIN_DB_PREFIX . "element_element WHERE targettype='invoice_supplier')";
示例9: CommandeFournisseur
// mode de reglement
if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) {
$object->fetch($id);
$result = $object->mode_reglement($_POST['mode_reglement_id']);
}
// Set project
if ($action == 'classin') {
$object->fetch($id);
$object->setProject($projectid);
}
if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) {
$object->fetch($id);
$result = $object->set_remise($user, $_POST['remise_percent']);
}
if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver) {
$order = new CommandeFournisseur($db);
$result = $order->fetch($id);
if ($order->statut == 5 || $order->statut == 6 || $order->statut == 7 || $order->statut == 9) {
if ($order->statut == 5) {
$newstatus = 4;
}
// Received->Received partially
if ($order->statut == 6) {
$newstatus = 2;
}
// Canceled->Approved
if ($order->statut == 7) {
$newstatus = 3;
}
// Canceled->Process running
if ($order->statut == 9) {
示例10: CommandeFournisseur
/*
* List of products
*/
if ($conf->product->enabled || $conf->service->enabled) {
$langs->load("products");
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("ProductsAndServices") . '</td><td align="right">';
print '<a href="' . DOL_URL_ROOT . '/fourn/product/liste.php?fourn_id=' . $object->id . '">' . $langs->trans("All") . ' (' . $object->nbOfProductRefs() . ')';
print '</a></td></tr></table>';
}
print '<br>';
/*
* Last orders
*/
$orderstatic = new CommandeFournisseur($db);
if ($user->rights->fournisseur->commande->lire) {
// TODO move to DAO class
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut";
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseur as p ";
$sql .= " WHERE p.fk_soc =" . $object->id;
$sql .= " ORDER BY p.date_commande DESC";
$sql .= " " . $db->plimit($MAXLIST);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
$num = $db->num_rows($resql);
if ($num > 0) {
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">';
示例11: load_board
/**
* 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;
}
}
示例12: GETPOST
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == -1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) {
$sortorder = "ASC";
}
if (!$sortfield) {
$sortfield = "name";
}
$object = new CommandeFournisseur($db);
if ($object->fetch($id, $ref) < 0) {
dol_print_error($db);
exit;
}
$upload_dir = $conf->fournisseur->dir_output . '/commande/' . dol_sanitizeFileName($object->ref);
$object->fetch_thirdparty();
/*
* Actions
*/
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
* View
*/
$form = new Form($db);
if ($object->id > 0) {
示例13: Fournisseur
$search_status = '';
}
if ($search_status == '') {
$search_status = -1;
}
/*
* View
*/
$title = $langs->trans("SuppliersOrders");
if ($socid > 0) {
$fourn = new Fournisseur($db);
$fourn->fetch($socid);
$title .= ' (' . $fourn->name . ')';
}
llxHeader('', $title);
$commandestatic = new CommandeFournisseur($db);
$formfile = new FormFile($db);
$formorder = new FormOrder($db);
if ($sortorder == "") {
$sortorder = "DESC";
}
if ($sortfield == "") {
$sortfield = "cf.date_creation";
}
$offset = $conf->liste_limit * $page;
/*
* Mode Liste
*/
$sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc,";
$sql .= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ttc, cf.fk_user_author,cf.date_livraison,";
$sql .= " u.login";
示例14: restrictedArea
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'societe', $socid, '');
/*
* View
*/
$commandestatic = new CommandeFournisseur($db);
$facturestatic = new FactureFournisseur($db);
$companystatic = new Societe($db);
llxHeader("", $langs->trans("SuppliersArea"));
print_fiche_titre($langs->trans("SuppliersArea"));
//print '<table border="0" width="100%" class="notopnoleftnoright">';
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
print '<div class="fichecenter"><div class="fichethirdleft">';
// Orders
$commande = new CommandeFournisseur($db);
$sql = "SELECT count(cf.rowid), cf.fk_statut";
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseur as cf,";
$sql .= " " . MAIN_DB_PREFIX . "societe as s";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON s.rowid = sc.fk_soc";
}
$sql .= " WHERE cf.fk_soc = s.rowid ";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND sc.fk_user = " . $user->id;
}
$sql .= " AND cf.entity = " . $conf->entity;
$sql .= " GROUP BY cf.fk_statut";
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
示例15: GETPOST
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
$langs->load("facture");
$langs->load("orders");
$langs->load("sendings");
$langs->load("companies");
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
// Security check
if ($user->societe_id) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
$object = new CommandeFournisseur($db);
/*
* Ajout d'un nouveau contact
*/
if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) {
$result = $object->fetch($id);
if ($result > 0 && $id > 0) {
$contactid = GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid');
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0) {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit;
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");