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


PHP CommandeFournisseur::addline方法代码示例

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


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

示例1: VALUES

 /////
 if ($idprod > 0) {
     if (!$optimizar) {
         $res = $productsupplier->fetch($idprod);
         $label = $productsupplier->libelle;
         $desc = $productsupplier->description;
         if (trim($product_desc) != trim($desc)) {
             $desc = dol_concatdesc($desc, $product_desc);
         }
         $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $idpfp);
         $type = $productsupplier->type;
         // Local Taxes
         $localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
         $localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty);
         $saltar = false;
         $result = $object->addline($desc, $productsupplier->fourn_pu, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $productsupplier->id, $idpfp, $productsupplier->fourn_ref, $remise_percent, 'HT', $type);
     } else {
         $total_ht = (double) $pfp_price;
         $total_tva = (double) $pfp_price * 16 / 100;
         $total_ttc = $total_ht + $total_tva;
         $sql = "INSERT INTO " . MAIN_DB_PREFIX . "commande_fournisseurdet";
         $sql .= " (fk_commande, label, description, date_start, date_end,";
         $sql .= " fk_product, product_type,";
         $sql .= " qty, tva_tx, remise_percent, subprice, ref,";
         $sql .= " total_ht, total_tva, total_ttc";
         $sql .= ")";
         $sql .= " VALUES (" . $object->id . ", '" . $p_label . "','" . $p_desc . "',";
         $sql .= " null,";
         $sql .= " null,";
         // Check:
         if ($idprod) {
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:fiche.php

示例2: 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

示例3: array

 $i = 0;
 $orders = array();
 $suppliersid = array_keys($suppliers);
 foreach ($suppliers as $supplier) {
     $order = new CommandeFournisseur($db);
     // Check if an order for the supplier exists
     $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "commande_fournisseur";
     $sql .= " WHERE fk_soc = " . $suppliersid[$i];
     $sql .= " AND source = 42 AND fk_statut = 0";
     $sql .= " ORDER BY date_creation DESC";
     $resql = $db->query($sql);
     if ($resql && $db->num_rows($resql) > 0) {
         $obj = $db->fetch_object($resql);
         $order->fetch($obj->rowid);
         foreach ($supplier['lines'] as $line) {
             $result = $order->addline($line->desc, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, 0, $line->ref_fourn, $line->remise_percent, 'HT', 0, $line->info_bits);
         }
         if ($result < 0) {
             $fail++;
             $msg = $langs->trans('OrderFail') . "&nbsp;:&nbsp;";
             $msg .= $order->error;
             setEventMessages($msg, null, 'errors');
         } else {
             $id = $result;
         }
     } else {
         $order->socid = $suppliersid[$i];
         $order->fetch_thirdparty();
         //trick to know which orders have been generated this way
         $order->source = 42;
         foreach ($supplier['lines'] as $line) {
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:replenish.php

示例4:

     		}*/
     if ($idprod > 0) {
         $res = $product->fetch($idprod);
         // cas special pour lequel on a les meme reference que le fournisseur
         // $label = '['.$nv_prod->ref.'] - '. $nv_prod->libelle;
         $label = $product->libelle;
         $desc = $product->description;
         $desc .= $product->description && $_POST['np_desc'] ? "\n" : "";
         $desc .= $_POST['np_desc'];
         $remise_percent = $_POST["remise_percent"] ? $_POST["remise_percent"] : $_POST["p_remise_percent"];
         $tva_tx = get_default_tva($object->thirdparty, $mysoc, $product->id);
         $type = $product->type;
         // Local Taxes
         $localtax1_tx = get_localtax($tva_tx, 1, $mysoc);
         $localtax2_tx = get_localtax($tva_tx, 2, $mysoc);
         $result = $object->addline($desc, $pu, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $product->id, $_POST['idprodfournprice'], $product->fourn_ref, $remise_percent, 'HT', $type);
     }
     if ($idprod == -1) {
         // Quantity too low
         $langs->load("errors");
         $mesg = '<div class="error">' . $langs->trans("ErrorQtyTooLowForThisSupplier") . '</div>';
     }
 } else {
     $type = $_POST["type"];
     $desc = $_POST['dp_desc'];
     $tva_tx = price2num($_POST['tva_tx']);
     // Local Taxes
     $localtax1_tx = get_localtax($tva_tx, 1, $object->client);
     $localtax2_tx = get_localtax($tva_tx, 2, $object->client);
     if (!$_POST['dp_desc']) {
         $mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")) . '</div>';
开发者ID:netors,项目名称:dolibarr,代码行数:31,代码来源:fiche.php

示例5: addCommandeFourn

 private function addCommandeFourn(&$PDOdb, $ofLigne, $resultatSQL)
 {
     global $db, $user;
     dol_include_once("fourn/class/fournisseur.commande.class.php");
     // On cherche s'il existe une commande pour ce fournisseur
     $sql = "SELECT rowid";
     $sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseur";
     $sql .= " WHERE fk_soc = " . $resultatSQL->fk_soc;
     $sql .= " AND fk_statut = 0";
     //uniquement brouillon
     $sql .= " ORDER BY rowid DESC";
     $sql .= " LIMIT 1";
     $resql = $db->query($sql);
     $res = $db->fetch_object($resql);
     if ($res) {
         // Il existe une commande, on la charge
         $com = new CommandeFournisseur($db);
         $com->fetch($res->rowid);
     } else {
         // Il n'existe aucune commande pour ce fournisseur donc on en crée une nouvelle
         $com = new CommandeFournisseur($db);
         $com->socid = $resultatSQL->fk_soc;
         $com->create($user);
     }
     // On cherche si ce produit existe déjà dans la commande, si oui, : "updateline"
     foreach ($com->lines as $line) {
         if ($line->fk_product == $resultatSQL->fk_product) {
             $com->updateline($line->id, $line->desc, $line->subprice, $line->qty + $ofLigne->qty, $line->remise_percent, $line->tva_tx);
             $done = true;
             break;
         }
     }
     if (!$done) {
         // Si le produit n'existe pas déjà dans la commande, on l'ajoute à cette commande
         $com->addline($desc, $resultatSQL->price / $resultatSQL->quantity, $ofLigne->qty, $txtva, 0, 0, $resultatSQL->fk_product, $resultatSQL->rowid);
     }
     //Création association element_element entre la commande fournisseur et l'OF
     $this->addElementElement($PDOdb, $com, $ofLigne);
 }
开发者ID:ATM-Consulting,项目名称:dolibarr_module_of,代码行数:39,代码来源:ordre_fabrication_asset.class.php


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