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


PHP CommandeFournisseur::DispatchProduct方法代码示例

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


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

示例1: setEventMessages

     $numline = $pos;
     $prod = "product_" . $reg[1] . '_' . $reg[2];
     $qty = "qty_" . $reg[1] . '_' . $reg[2];
     $ent = "entrepot_" . $reg[1] . '_' . $reg[2];
     $pu = "pu_" . $reg[1] . '_' . $reg[2];
     // This is unit price including discount
     $fk_commandefourndet = "fk_commandefourndet_" . $reg[1] . '_' . $reg[2];
     if (GETPOST($qty) > 0) {
         if (!(GETPOST($ent, 'int') > 0)) {
             dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed');
             $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . $numline;
             setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors');
             $error++;
         }
         if (!$error) {
             $result = $commande->DispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger);
             if ($result < 0) {
                 setEventMessages($commande->error, $commande->errors, 'errors');
                 $error++;
             }
         }
     }
 }
 if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
     $pos++;
     //eat-by date dispatch
     //$numline=$reg[2] + 1;	// line of product
     $numline = $pos;
     $prod = 'product_batch_' . $reg[1] . '_' . $reg[2];
     $qty = 'qty_' . $reg[1] . '_' . $reg[2];
     $ent = 'entrepot_' . $reg[1] . '_' . $reg[2];
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:dispatch.php

示例2: CommandeFournisseur

if ($_POST["action"] ==	'dispatch' && $user->rights->fournisseur->commande->receptionner)
{
	$commande = new CommandeFournisseur($db);
	$commande->fetch($_GET["id"]);

	foreach($_POST as $key => $value)
	{
		if ( preg_match('/^product_([0-9]+)$/i', $key, $reg) )
		{
			$prod = "product_".$reg[1];
			$qty = "qty_".$reg[1];
			$ent = "entrepot_".$reg[1];
			$pu = "pu_".$reg[1];
			if ($_POST[$ent] > 0)
			{
				$result = $commande->DispatchProduct($user, $_POST[$prod], $_POST[$qty], $_POST[$ent], $_POST[$pu], $_POST["comment"]);
			}
			else
			{
				dol_syslog('No dispatch for line '.$key.' as no warehouse choosed');
			}
		}
	}

	if ($result > 0)
	{
		Header("Location: dispatch.php?id=".$_GET["id"]);
		exit;
	}
	else
	{
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:dispatch.php

示例3: CommandeFournisseur

/*
 * Actions
 */
if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->receptionner) {
    $commande = new CommandeFournisseur($db);
    $commande->fetch($id);
    $db->begin();
    foreach ($_POST as $key => $value) {
        if (preg_match('/^product_([0-9]+)$/i', $key, $reg)) {
            $prod = "product_" . $reg[1];
            $qty = "qty_" . $reg[1];
            $ent = "entrepot_" . $reg[1];
            $pu = "pu_" . $reg[1];
            // This is unit price including discount
            if (GETPOST($ent, 'int') > 0) {
                $result = $commande->DispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST("comment"));
            } else {
                dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed');
                $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . '' . ($reg[1] - 1);
                setEventMessage($langs->trans('ErrorFieldRequired', $text), 'errors');
            }
        } else {
            if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
                //eat-by date dispatch
                $prod = "product_" . $reg[1] . "_" . $reg[2];
                $qty = "qty_" . $reg[1] . "_" . $reg[2];
                $ent = "entrepot_" . $reg[1] . "_" . $reg[2];
                $pu = "pu_" . $reg[1] . "_" . $reg[2];
                $lot = "lot_number_" . $reg[1] . "_" . $reg[2];
                $dDLUO = dol_mktime(12, 0, 0, $_POST['dluo_' . $reg[1] . "_" . $reg[2] . 'month'], $_POST['dluo_' . $reg[1] . "_" . $reg[2] . 'day'], $_POST['dluo_' . $reg[1] . "_" . $reg[2] . 'year']);
                $dDLC = dol_mktime(12, 0, 0, $_POST['dlc_' . $reg[1] . "_" . $reg[2] . 'month'], $_POST['dlc_' . $reg[1] . "_" . $reg[2] . 'day'], $_POST['dlc_' . $reg[1] . "_" . $reg[2] . 'year']);
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:dispatch.php


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