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


PHP Commande::fetch_lines方法代码示例

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


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

示例1: sizeof

		print "<td>".$langs->trans("Author")."</td><td>".$author->getFullName($langs)."</td>\n";

		if ($commande->note)
		{
			print '<tr><td colspan="3">Note : '.nl2br($commande->note)."</td></tr>";
		}
		print "</table>";

		/*
		 * Lignes de commandes
		 *
		 */
		print '<br><table class="noborder" width="100%">';

		$lines = $commande->fetch_lines(1);

		// Lecture des livraisons deja effectuees
		$commande->livraison_array();

		$num = sizeof($commande->lines);
		$i = 0;

		if ($num)
		{
			print '<tr class="liste_titre">';
			print '<td width="54%">'.$langs->trans("Description").'</td>';
			print '<td align="center">Quan. commandee</td>';
			print '<td align="center">Quan. livree</td>';
			print '<td align="center">Quan. a livrer</td>';
			if ($conf->stock->enabled)
开发者ID:remyyounes,项目名称:dolibarr,代码行数:30,代码来源:fiche.php

示例2: create

 /**
  *  Create delivery receipt in database
  *
  *  @param 	User	$user       Objet du user qui cree
  *  @return int         		<0 si erreur, id livraison cree si ok
  */
 function create($user)
 {
     global $conf;
     dol_syslog("Livraison::create");
     if (empty($this->model_pdf)) {
         $this->model_pdf = $conf->global->LIVRAISON_ADDON_PDF;
     }
     $error = 0;
     $now = dol_now();
     /* On positionne en mode brouillon le bon de livraison */
     $this->brouillon = 1;
     $this->user = $user;
     $this->db->begin();
     $sql = "INSERT INTO " . MAIN_DB_PREFIX . "livraison (";
     $sql .= "ref";
     $sql .= ", entity";
     $sql .= ", fk_soc";
     $sql .= ", ref_customer";
     $sql .= ", date_creation";
     $sql .= ", fk_user_author";
     $sql .= ", date_delivery";
     $sql .= ", fk_address";
     $sql .= ", note_private";
     $sql .= ", note_public";
     $sql .= ", model_pdf";
     $sql .= ") VALUES (";
     $sql .= "'(PROV)'";
     $sql .= ", " . $conf->entity;
     $sql .= ", " . $this->socid;
     $sql .= ", '" . $this->db->escape($this->ref_customer) . "'";
     $sql .= ", '" . $this->db->idate($now) . "'";
     $sql .= ", " . $user->id;
     $sql .= ", " . ($this->date_delivery ? "'" . $this->db->idate($this->date_delivery) . "'" : "null");
     $sql .= ", " . ($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
     $sql .= ", " . (!empty($this->note_private) ? "'" . $this->db->escape($this->note_private) . "'" : "null");
     $sql .= ", " . (!empty($this->note_public) ? "'" . $this->db->escape($this->note_public) . "'" : "null");
     $sql .= ", " . (!empty($this->model_pdf) ? "'" . $this->db->escape($this->model_pdf) . "'" : "null");
     $sql .= ")";
     dol_syslog("Livraison::create sql=" . $sql, LOG_DEBUG);
     $resql = $this->db->query($sql);
     if ($resql) {
         $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "livraison");
         $numref = "(PROV" . $this->id . ")";
         $sql = "UPDATE " . MAIN_DB_PREFIX . "livraison ";
         $sql .= "SET ref = '" . $this->db->escape($numref) . "'";
         $sql .= " WHERE rowid = " . $this->id;
         dol_syslog("Livraison::create sql=" . $sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
         if ($resql) {
             if (!$conf->expedition_bon->enabled) {
                 $commande = new Commande($this->db);
                 $commande->id = $this->commande_id;
                 $commande->fetch_lines();
             }
             /*
              *  Insertion des produits dans la base
              */
             $num = count($this->lines);
             for ($i = 0; $i < $num; $i++) {
                 $origin_id = $this->lines[$i]->origin_line_id;
                 if (!$origin_id) {
                     $origin_id = $this->lines[$i]->commande_ligne_id;
                 }
                 // For backward compatibility
                 if (!$this->create_line($origin_id, $this->lines[$i]->qty, $this->lines[$i]->fk_product, $this->lines[$i]->description)) {
                     $error++;
                 }
             }
             if (!$error && $this->id && $this->origin_id) {
                 $ret = $this->add_object_linked();
                 if (!$ret) {
                     $error++;
                 }
                 if (!$conf->expedition_bon->enabled) {
                     // TODO uniformiser les statuts
                     $ret = $this->setStatut(2, $this->origin_id, $this->origin);
                     if (!$ret) {
                         $error++;
                     }
                 }
             }
             if (!$error) {
                 $this->db->commit();
                 return $this->id;
             } else {
                 $error++;
                 $this->error = $this->db->lasterror() . " - sql=" . $this->db->lastqueryerror;
                 dol_syslog("Livraison::create Error -3 " . $this->error, LOG_ERR);
                 $this->db->rollback();
                 return -3;
             }
         } else {
             $error++;
             $this->error = $this->db->lasterror() . " - sql=" . $this->db->lastqueryerror;
//.........这里部分代码省略.........
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:101,代码来源:livraison.class.php


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