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


PHP Commande::generateDocument方法代码示例

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


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

示例1: validOrder

/**
 * Valid an order
 *
 * @param	array		$authentication		Array of authentication information
 * @param	int			$id					Id of order to validate
 * @return	array							Array result
 */
function validOrder($authentication, $id = '')
{
    global $db, $conf, $langs;
    dol_syslog("Function: validOrder login=" . $authentication['login'] . " id=" . $id . " ref=" . $ref . " ref_ext=" . $ref_ext);
    // Init and check authentication
    $objectresp = array();
    $errorcode = '';
    $errorlabel = '';
    $error = 0;
    if ($authentication['entity']) {
        $conf->entity = $authentication['entity'];
    }
    $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
    if (!$error) {
        $fuser->getrights();
        if ($fuser->rights->commande->lire) {
            $order = new Commande($db);
            $result = $order->fetch($id, $ref, $ref_ext);
            $order->fetch_thirdparty();
            $db->begin();
            if ($result > 0) {
                $result = $order->valid($fuser);
                if ($result >= 0) {
                    // Define output language
                    $outputlangs = $langs;
                    $order->generateDocument($order->modelpdf, $outputlangs);
                } else {
                    $db->rollback();
                    $error++;
                    $errorcode = 'KO';
                    $errorlabel = $newobject->error;
                }
            } else {
                $db->rollback();
                $error++;
                $errorcode = 'KO';
                $errorlabel = $newobject->error;
            }
        } else {
            $db->rollback();
            $error++;
            $errorcode = 'KO';
            $errorlabel = $newobject->error;
        }
    }
    if ($error) {
        $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
    } else {
        $db->commit();
        $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''));
    }
    return $objectresp;
}
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:60,代码来源:server_order.php

示例2: commande_pdf_create

/**
 *  Create a document onto disk accordign to template module.
 *
 *  @param	    DoliDB		$db  			Database handler
 *  @param	    Object		$object			Object order
 *  @param	    string		$modele			Force le modele a utiliser ('' to not force)
 *  @param		Translate	$outputlangs	objet lang a utiliser pour traduction
 *  @param      int			$hidedetails    Hide details of lines
 *  @param      int			$hidedesc       Hide description
 *  @param      int			$hideref        Hide ref
 *  @return     int         				0 if KO, 1 if OK
 * @deprecated Use the new function generateDocument of Commande class
 */
function commande_pdf_create(DoliDB $db, Commande $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
    return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:17,代码来源:modules_commande.php

示例3: commande_pdf_create

/**
 *  Create a document onto disk accordign to template module.
 *
 *  @param	    DoliDB		$db  			Database handler
 *  @param	    Commande		$object			Object order
 *  @param	    string		$modele			Force le modele a utiliser ('' to not force)
 *  @param		Translate	$outputlangs	objet lang a utiliser pour traduction
 *  @param      int			$hidedetails    Hide details of lines
 *  @param      int			$hidedesc       Hide description
 *  @param      int			$hideref        Hide ref
 *  @return     int         				0 if KO, 1 if OK
 *  @deprecated Use the new function generateDocument of Commande class
 *  @see Commande::generateDocument()
 */
function commande_pdf_create(DoliDB $db, Commande $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
    dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
    return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
开发者ID:Albertopf,项目名称:prueba,代码行数:19,代码来源:modules_commande.php

示例4: testCommandeBuild

 /**
  * testCommandeBuild
  *
  * @return int
  */
 public function testCommandeBuild()
 {
     global $conf, $user, $langs, $db;
     $conf = $this->savconf;
     $user = $this->savuser;
     $langs = $this->savlangs;
     $db = $this->savdb;
     $conf->commande->dir_output .= '/temp';
     $localobject = new Commande($this->savdb);
     $localobject->initAsSpecimen();
     // Einstein
     $localobject->modelpdf = 'einstein';
     $result = $localobject->generateDocument($localobject->modelpdf, $langs);
     $this->assertLessThan($result, 0);
     print __METHOD__ . " result=" . $result . "\n";
     return 0;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:22,代码来源:BuildDocTest.php


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