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


PHP Commande::initAsSpecimen方法代码示例

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


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

示例1: Commande

     print $langs->trans($tmp);
 } else {
     print $tmp;
 }
 print '</td>' . "\n";
 print '<td align="center">';
 if ($conf->global->COMMANDE_ADDON == $file) {
     print img_picto($langs->trans("Activated"), 'switch_on');
 } else {
     print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setmod&amp;value=' . $file . '">';
     print img_picto($langs->trans("Disabled"), 'switch_off');
     print '</a>';
 }
 print '</td>';
 $commande = new Commande($db);
 $commande->initAsSpecimen();
 // Info
 $htmltooltip = '';
 $htmltooltip .= '' . $langs->trans("Version") . ': <b>' . $module->getVersion() . '</b><br>';
 $commande->type = 0;
 $nextval = $module->getNextValue($mysoc, $commande);
 if ("{$nextval}" != $langs->trans("NotAvailable")) {
     $htmltooltip .= '' . $langs->trans("NextValue") . ': ';
     if ($nextval) {
         $htmltooltip .= $nextval . '<br>';
     } else {
         $htmltooltip .= $langs->trans($module->error) . '<br>';
     }
 }
 print '<td align="center">';
 print $form->textwithpicto('', $htmltooltip, 1, 0);
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:commande.php

示例2: initAsSpecimen

 /**
  *  Initialise an instance with random values.
  *  Used to build previews or test instances.
  *	id must be 0 if object instance is a specimen.
  *
  *  @return	void
  */
 function initAsSpecimen()
 {
     global $user, $langs, $conf;
     $now = dol_now();
     dol_syslog(get_class($this) . "::initAsSpecimen");
     // Charge tableau des produits prodids
     $prodids = array();
     $sql = "SELECT rowid";
     $sql .= " FROM " . MAIN_DB_PREFIX . "product";
     $sql .= " WHERE entity IN (" . getEntity('product', 1) . ")";
     $resql = $this->db->query($sql);
     if ($resql) {
         $num_prods = $this->db->num_rows($resql);
         $i = 0;
         while ($i < $num_prods) {
             $i++;
             $row = $this->db->fetch_row($resql);
             $prodids[$i] = $row[0];
         }
     }
     $order = new Commande($this->db);
     $order->initAsSpecimen();
     // Initialise parametres
     $this->id = 0;
     $this->ref = 'SPECIMEN';
     $this->specimen = 1;
     $this->statut = 1;
     $this->livraison_id = 0;
     $this->date = $now;
     $this->date_creation = $now;
     $this->date_valid = $now;
     $this->date_delivery = $now;
     $this->date_expedition = $now + 24 * 3600;
     $this->entrepot_id = 0;
     $this->fk_delivery_address = 0;
     $this->socid = 1;
     $this->commande_id = 0;
     $this->commande = $order;
     $this->origin_id = 1;
     $this->origin = 'commande';
     $this->note_private = 'Private note';
     $this->note_public = 'Public note';
     $nbp = 5;
     $xnbp = 0;
     while ($xnbp < $nbp) {
         $line = new ExpeditionLigne($this->db);
         $line->desc = $langs->trans("Description") . " " . $xnbp;
         $line->libelle = $langs->trans("Description") . " " . $xnbp;
         $line->qty = 10;
         $line->qty_asked = 5;
         $line->qty_shipped = 4;
         $line->fk_product = $this->commande->lines[$xnbp]->fk_product;
         $this->lines[] = $line;
         $xnbp++;
     }
 }
开发者ID:Albertopf,项目名称:prueba,代码行数:63,代码来源:expedition.class.php

示例3: initAsSpecimen

	/**
	 *		\brief		Initialise la facture avec valeurs fictives aleatoire
	 *					Sert a generer une facture pour l'aperu des modeles ou dem
	 */
	function initAsSpecimen()
	{
		global $user,$langs,$conf;

		dol_syslog("Expedition::initAsSpecimen");

		// Charge tableau des produits prodids
		$prodids = array();
		$sql = "SELECT rowid";
		$sql.= " FROM ".MAIN_DB_PREFIX."product";
		$sql.= " WHERE entity = ".$conf->entity;
		$resql = $this->db->query($sql);
		if ($resql)
		{
			$num_prods = $this->db->num_rows($resql);
			$i = 0;
			while ($i < $num_prods)
			{
				$i++;
				$row = $this->db->fetch_row($resql);
				$prodids[$i] = $row[0];
			}
		}

		$order=new Commande($this->db);
		$order->initAsSpecimen();

		// Initialise parametres
		$this->id=0;
		$this->ref = 'SPECIMEN';
		$this->specimen=1;
		$this->statut               = 1;
		if ($conf->livraison_bon->enabled)
		{
			$this->livraison_id     = 0;
		}
		$this->date                 = time();
		$this->entrepot_id          = 0;
		$this->fk_delivery_address  = 0;
		$this->socid                = 1;

		$this->commande_id          = 0;
		$this->commande             = $order;

        $this->origin_id            = 1;
        $this->origin               = 'commande';

		$nbp = 5;
		$xnbp = 0;
		while ($xnbp < $nbp)
		{
			$line=new ExpeditionLigne($this->db);
			$line->desc=$langs->trans("Description")." ".$xnbp;
			$line->libelle=$langs->trans("Description")." ".$xnbp;
			$line->qty=10;
			$line->qty_asked=5;
			$line->qty_shipped=4;
			$line->fk_product=$this->commande->lines[$xnbp]->fk_product;

			$this->lines[]=$line;
			$xnbp++;
		}

	}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:68,代码来源:expedition.class.php

示例4: testCommandeCreate

 /**
  * testCommandeCreate
  *
  * @return  void
  */
 public function testCommandeCreate()
 {
     global $conf, $user, $langs, $db;
     $conf = $this->savconf;
     $user = $this->savuser;
     $langs = $this->savlangs;
     $db = $this->savdb;
     $localobject = new Commande($this->savdb);
     $localobject->initAsSpecimen();
     $result = $localobject->create($user);
     $this->assertLessThan($result, 0);
     print __METHOD__ . " result=" . $result . "\n";
     return $result;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:19,代码来源:CommandeTest.php

示例5: 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=commande_pdf_create($db, $localobject, $localobject->modelpdf, $langs);

        $this->assertLessThan($result, 0);
        print __METHOD__." result=".$result."\n";

        // Edison
        $localobject->modelpdf='edison';
        $result=commande_pdf_create($db, $localobject, $localobject->modelpdf, $langs);

        $this->assertLessThan($result, 0);
        print __METHOD__." result=".$result."\n";

        return 0;
    }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:33,代码来源:BuildDocTest.php


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