当前位置: 首页>>代码示例>>PHP>>正文


PHP CommandeFournisseur::fetch方法代码示例

本文整理汇总了PHP中CommandeFournisseur::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP CommandeFournisseur::fetch方法的具体用法?PHP CommandeFournisseur::fetch怎么用?PHP CommandeFournisseur::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommandeFournisseur的用法示例。


在下文中一共展示了CommandeFournisseur::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ProductCommande

	function ProductCommande($user, $fk_product)
	{
		include_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php");
		include_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");

		$commf = new CommandeFournisseur($this->db);

		$nbc = $this->nb_open_commande();

		dol_syslog("Fournisseur::ProductCommande : nbc = ".$nbc);

		if ($nbc == 0)
		{
			if ( $this->create_commande($user) == 0 )
			{
				$idc = $this->single_open_commande;
			}
		}
		elseif ($nbc == 1)
		{

			$idc = $this->single_open_commande;
		}

		if ($idc > 0)
		{
			$prod = new ProductFournisseur($this->db);
			$prod->fetch($fk_product);
			$prod->fetch_fourn_data($this->id);

			$commf->fetch($idc);
			$commf->addline("Toto",120,1,$prod->tva, $prod->id, 0, $prod->ref_fourn);
		}
	}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:34,代码来源:fournisseur.class.php

示例2: supplier_order_delete_preview

/**
 * Delete preview files, pour le cas de regeneration de commande
 * @param   $db		   data base object
 * @param   $comfournid  id de la commande a effacer
 * @param   $comfournref reference de la commande si besoin
 * @return  int
 */
function supplier_order_delete_preview($db, $comfournid, $comfournref='')
{
	global $langs,$conf;
    require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");

	if (!$comfournref)
	{
		$comfourn = new CommandeFournisseur($db,"",$comfournid);
		$comfourn->fetch($comfournid);
		$comfournref = $comfourn->ref;
		$soc = new Societe($db);
		$soc->fetch($comfourn->socid);
	}
	
	

	if ($conf->fournisseur->dir_output.'/commande')
	{
		$suppordref = dol_sanitizeFileName($comfournref);
		$dir = $conf->fournisseur->dir_output . "/" . $suppordref ;
		$file = $dir . "/" . $suppordref . ".pdf.png";
		$multiple = $file . ".";

		if ( file_exists( $file ) && is_writable( $file ) )
		{
			if ( ! dol_delete_file($file,1) )
			{
				$this->error=$langs->trans("ErrorFailedToOpenFile",$file);
				return 0;
			}
		}
		else
		{
			for ($i = 0; $i < 20; $i++)
			{
				$preview = $multiple.$i;

				if ( file_exists( $preview ) && is_writable( $preview ) )
				{
					if ( ! dol_delete_file($preview,1) )
					{
						$this->error=$langs->trans("ErrorFailedToOpenFile",$preview);
						return 0;
					}
				}
			}
		}
	}

	return 1;
}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:58,代码来源:modules_commandefournisseur.php

示例3: GETPOST

$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");
            setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
        } else {
            setEventMessage($object->error, 'errors');
        }
    }
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:contact.php

示例4: GETPOST

$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) {
    llxHeader();
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:document.php

示例5: _loadDetail

dol_include_once('/product/stock/class/entrepot.class.php');
dol_include_once('/core/lib/product.lib.php');
dol_include_once('/core/lib/fourn.lib.php');
dol_include_once('/asset/class/asset.class.php');
$PDOdb = new TPDOdb();
$langs->load('companies');
$langs->load('suppliers');
$langs->load('products');
$langs->load('bills');
$langs->load('orders');
$langs->load('commercial');
$langs->load('dispatch@dispatch');
$id = GETPOST('id');
$hookmanager->initHooks(array('receptionstockcard'));
$commandefourn = new CommandeFournisseur($db);
$commandefourn->fetch($id);
$action = GETPOST('action');
$TImport = _loadDetail($PDOdb, $commandefourn);
$parameters = array();
$hookmanager->executeHooks('doAction', $parameters, $commandefourn, $action);
//var_dump($TImport);exit;
function _loadDetail(&$PDOdb, &$commandefourn)
{
    $TImport = array();
    foreach ($commandefourn->lines as $line) {
        $sql = "SELECT ca.rowid as idline,ca.serial_number,p.ref,p.rowid, ca.fk_commandedet, ca.fk_warehouse, ca.imei, ca.firmware,ca.lot_number,ca.weight_reel,ca.weight_reel_unit, ca.dluo\n\t\t\t\t\tFROM " . MAIN_DB_PREFIX . "commande_fournisseurdet_asset as ca\n\t\t\t\t\t\tLEFT JOIN " . MAIN_DB_PREFIX . "product as p ON (p.rowid = ca.fk_product)\n\t\t\t\t\tWHERE ca.fk_commandedet = " . $line->id . "\n\t\t\t\t\t\tORDER BY ca.rang ASC";
        $PDOdb->Execute($sql);
        while ($PDOdb->Get_line()) {
            $TImport[] = array('ref' => $PDOdb->Get_field('ref'), 'numserie' => $PDOdb->Get_field('serial_number'), 'lot_number' => $PDOdb->Get_field('lot_number'), 'quantity' => $PDOdb->Get_field('weight_reel'), 'quantity_unit' => $PDOdb->Get_field('weight_reel_unit'), 'imei' => $PDOdb->Get_field('imei'), 'firmware' => $PDOdb->Get_field('firmware'), 'fk_product' => $PDOdb->Get_field('rowid'), 'fk_warehouse' => $PDOdb->Get_field('fk_warehouse'), 'dluo' => $PDOdb->Get_field('dluo'), 'commande_fournisseurdet_asset' => $PDOdb->Get_field('idline'));
        }
    }
开发者ID:ATM-Consulting,项目名称:dolibarr_module_dispatch,代码行数:31,代码来源:reception.php

示例6: CommandeFournisseur

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) {
            $newstatus = 1;
开发者ID:netors,项目名称:dolibarr,代码行数:31,代码来源:fiche.php

示例7: getProducts

/**
 * getProducts
 *
 * @param 	int		$order_id		Order id
 * @return	void
 */
function getProducts($order_id)
{
    global $db;
    $order = new CommandeFournisseur($db);
    $f = $order->fetch($order_id);
    $products = array();
    if ($f) {
        foreach ($order->lines as $line) {
            if (!in_array($line->fk_product, $products)) {
                $products[] = $line->fk_product;
            }
        }
    }
    return $products;
}
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:21,代码来源:replenishment.lib.php

示例8: Form

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');

		/*
		 *	Commande
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:dispatch.php

示例9: Societe

/*
 * View
 */

$html =	new	Form($db);

$now=gmmktime();

$ref= $_GET['ref'];

if ($id > 0 || ! empty($ref))
{
	$soc = new Societe($db);
	$commande = new CommandeFournisseur($db);

	$result=$commande->fetch($_GET["id"],$_GET['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');

开发者ID:remyyounes,项目名称:dolibarr,代码行数:29,代码来源:history.php

示例10: FormProjets

 // Payment mode
 print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
 $html->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id');
 print '</td></tr>';
 // Project
 if (!empty($conf->projet->enabled)) {
     $formproject = new FormProjets($db);
     $langs->load('projects');
     print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
     $formproject->select_projects($soc->id, $projectid, 'projectid');
     print '</td></tr>';
 }
 $objectsrc = new CommandeFournisseur($db);
 $listoforders = array();
 foreach ($selected as $sel) {
     $result = $objectsrc->fetch($sel);
     if ($result > 0) {
         $listoforders[] = $objectsrc->ref;
     }
 }
 // Other attributes
 $parameters = array('objectsrc' => $objectsrc, 'idsrc' => $listoforders, 'colspan' => ' colspan="3"');
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
 // Modele PDF
 print '<tr><td>' . $langs->trans('Model') . '</td>';
 print '<td>';
 $liste = ModelePDFSuppliersInvoices::liste_modeles($db);
 print $html->selectarray('model', $liste, $conf->global->INVOICE_SUPPLIER_ADDON_PDF);
 print "</td></tr>";
 // Public note
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:orderstoinvoice.php

示例11: GETPOST

$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$line = GETPOST('lineid', 'int');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
//$result=restrictedArea($user,'produit');
$mesg = '';
/*
 *	Actions
 */
// Add product to list
if ($action == 'add') {
    $fac = new CommandeFournisseur($db);
    $fac->fetch($id);
    $error = 0;
    for ($i = 0; $i < sizeof($fac->lines); $i++) {
        $object = new Labelprint($db);
        $object->fk_product = $fac->lines[$i]->fk_product;
        $object->qty = $fac->lines[$i]->qty;
        $result = $object->create($user);
        if (!$result) {
            $error++;
        }
    }
    if ($error) {
        $mesg = '<div class="error">' . $object->error . '</div>';
    } else {
        $mesg = '<font class="ok">' . $langs->trans("LinesAdded") . '</font>';
    }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:order_supplier.php

示例12: testCommandeFournisseurDelete

    /**
     * @depends	testCommandeFournisseurOther
     * The depends says test is run only if previous is ok
     */
    public function testCommandeFournisseurDelete($id)
    {
    	global $conf,$user,$langs,$db;
		$conf=$this->savconf;
		$user=$this->savuser;
		$langs=$this->savlangs;
		$db=$this->savdb;

		$localobject=new CommandeFournisseur($this->savdb);
    	$result=$localobject->fetch($id);
		$result=$localobject->delete($user);

		print __METHOD__." id=".$id." result=".$result."\n";
    	$this->assertLessThan($result, 0);
    	return $result;
    }
开发者ID:remyyounes,项目名称:dolibarr,代码行数:20,代码来源:CommandeFournisseurTest.php

示例13: _fiche

function _fiche(&$PDOdb, &$assetOf, $mode = 'edit', $fk_product_to_add = 0, $fk_nomenclature = 0)
{
    global $langs, $db, $conf, $user, $hookmanager;
    /***************************************************
     * PAGE
     *
     * Put here all code to build page
     ****************************************************/
    $parameters = array('id' => $assetOf->getId());
    $reshook = $hookmanager->executeHooks('doActions', $parameters, $assetOf, $mode);
    // Note that $action and $object may have been modified by hook
    //pre($assetOf,true);
    llxHeader('', $langs->trans('OFAsset'), '', '');
    print dol_get_fiche_head(ofPrepareHead($assetOf, 'assetOF'), 'fiche', $langs->trans('OFAsset'));
    ?>
<style type="text/css">
		#assetChildContener .OFMaster {
			
			background:#fff;
			-webkit-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			-moz-box-shadow:    4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			box-shadow:         4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			
			margin-bottom:20px;
		}
		
	</style>
		<div class="OFContent" rel="<?php 
    echo $assetOf->getId();
    ?>
">	<?php 
    $TPrixFournisseurs = array();
    //$form=new TFormCore($_SERVER['PHP_SELF'],'formeq'.$assetOf->getId(),'POST');
    //Affichage des erreurs
    if (!empty($assetOf->errors)) {
        ?>
		<br><div class="error">
		<?php 
        foreach ($assetOf->errors as $error) {
            echo $error . "<br>";
            setEventMessage($error, 'errors');
        }
        $assetOf->errors = array();
        ?>
		</div><br>
		<?php 
    }
    $form = new TFormCore();
    $form->Set_typeaff($mode);
    $doliform = new Form($db);
    if (!empty($_REQUEST['fk_product'])) {
        echo $form->hidden('fk_product', $_REQUEST['fk_product']);
    }
    $TBS = new TTemplateTBS();
    $liste = new TListviewTBS('asset');
    $TBS->TBS->protect = false;
    $TBS->TBS->noerr = true;
    $PDOdb = new TPDOdb();
    $TNeeded = array();
    $TToMake = array();
    $TNeeded = _fiche_ligne($form, $assetOf, "NEEDED");
    $TToMake = _fiche_ligne($form, $assetOf, "TO_MAKE");
    $TIdCommandeFourn = $assetOf->getElementElement($PDOdb);
    $HtmlCmdFourn = '';
    if (count($TIdCommandeFourn)) {
        foreach ($TIdCommandeFourn as $idcommandeFourn) {
            $cmd = new CommandeFournisseur($db);
            $cmd->fetch($idcommandeFourn);
            $HtmlCmdFourn .= $cmd->getNomUrl(1) . " - " . $cmd->getLibStatut(0);
        }
    }
    ob_start();
    $doliform->select_produits('', 'fk_product', '', $conf->product->limit_size, 0, -1, 2, '', 3, array());
    $select_product = ob_get_clean();
    $Tid = array();
    //$Tid[] = $assetOf->rowid;
    if ($assetOf->getId() > 0) {
        $assetOf->getListeOFEnfants($PDOdb, $Tid);
    }
    $TWorkstation = array();
    foreach ($assetOf->TAssetWorkstationOF as $k => &$TAssetWorkstationOF) {
        $ws =& $TAssetWorkstationOF->ws;
        $TWorkstation[] = array('libelle' => '<a href="' . dol_buildpath('workstation/workstation.php?id=' . $ws->rowid . '&action=view', 2) . '">' . $ws->name . '</a>', 'fk_user' => visu_checkbox_user($PDOdb, $form, $ws->fk_usergroup, $TAssetWorkstationOF->users, 'TAssetWorkstationOF[' . $k . '][fk_user][]', $assetOf->status), 'fk_project_task' => visu_project_task($db, $TAssetWorkstationOF->fk_project_task, $form->type_aff, 'TAssetWorkstationOF[' . $k . '][progress]'), 'fk_task' => visu_checkbox_task($PDOdb, $form, $TAssetWorkstationOF->fk_asset_workstation, $TAssetWorkstationOF->tasks, 'TAssetWorkstationOF[' . $k . '][fk_task][]', $assetOf->status), 'nb_hour' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_hour]', $TAssetWorkstationOF->nb_hour, 3, 10) : ($conf->global->ASSET_USE_CONVERT_TO_TIME ? convertSecondToTime($TAssetWorkstationOF->nb_hour * 3600) : price($TAssetWorkstationOF->nb_hour)), 'nb_hour_real' => $assetOf->status == 'OPEN' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_hour_real]', $TAssetWorkstationOF->nb_hour_real, 3, 10) : ($conf->global->ASSET_USE_CONVERT_TO_TIME ? convertSecondToTime($TAssetWorkstationOF->nb_hour_real * 3600) : price($TAssetWorkstationOF->nb_hour_real)), 'nb_days_before_beginning' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_days_before_beginning]', $TAssetWorkstationOF->nb_days_before_beginning, 3, 10) : $TAssetWorkstationOF->nb_days_before_beginning, 'delete' => $mode == 'edit' && $assetOf->status == 'DRAFT' ? '<a href="javascript:deleteWS(' . $assetOf->getId() . ',' . $TAssetWorkstationOF->getId() . ');">' . img_picto('Supprimer', 'delete.png') . '</a>' : '', 'note_private' => $assetOf->status == 'DRAFT' && $mode == 'edit' ? $form->zonetexte('', 'TAssetWorkstationOF[' . $k . '][note_private]', $TAssetWorkstationOF->note_private, 50, 1) : $TAssetWorkstationOF->note_private, 'rang' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][rang]', $TAssetWorkstationOF->rang, 3, 10) : $TAssetWorkstationOF->rang, 'id' => $ws->getId());
    }
    $client = new Societe($db);
    if ($assetOf->fk_soc > 0) {
        $client->fetch($assetOf->fk_soc);
    }
    $commande = new Commande($db);
    if ($assetOf->fk_commande > 0) {
        $commande->fetch($assetOf->fk_commande);
    }
    $TOFParent = array_merge(array(0 => ''), $assetOf->getCanBeParent($PDOdb));
    $hasParent = false;
    if (!empty($assetOf->fk_assetOf_parent)) {
        $TAssetOFParent = new TAssetOF();
        $TAssetOFParent->load($PDOdb, $assetOf->fk_assetOf_parent);
        $hasParent = true;
    }
    $parameters = array('id' => $assetOf->getId());
//.........这里部分代码省略.........
开发者ID:ATM-Consulting,项目名称:dolibarr_module_of,代码行数:101,代码来源:fiche_of.php

示例14: GETPOST

$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);
// 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'));
$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) {
        $fourn = new Fournisseur($db);
        $ret = $fourn->fetch($socid);
        if ($ret < 0) {
            dol_print_error($db, $object->error);
        }
        $object->socid = $fourn->id;
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:fiche.php

示例15: GETPOST

$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) {
        $fourn = new Fournisseur($db);
        $ret = $fourn->fetch($socid);
        if ($ret < 0) {
            dol_print_error($db, $object->error);
        }
        $object->socid = $fourn->id;
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:card.php


注:本文中的CommandeFournisseur::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。