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


PHP Commande::cloture方法代码示例

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


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

示例1: Commande

 * Actions
 */

// Categorisation dans projet
if ($_POST['action'] == 'classin')
{
	$commande = new Commande($db);
	$commande->fetch($_GET['id']);
	$commande->setProject($_POST['projectid']);
}

if ($_POST["action"] == 'confirm_cloture' && $_POST["confirm"] == 'yes')
{
	$commande = new Commande($db);
	$commande->fetch($_GET["id"]);
	$result = $commande->cloture($user);
}

// Positionne ref commande client
if ($_POST['action'] == 'setrefcustomer' && $user->rights->commande->creer)
{
	$commande = new Commande($db);
	$commande->fetch($_GET['id']);
	$commande->set_ref_client($user, $_POST['ref_customer']);
}

if ($_POST['action'] == 'setdatedelivery' && $user->rights->commande->creer)
{
	//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
	$datelivraison=dol_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
开发者ID:remyyounes,项目名称:dolibarr,代码行数:30,代码来源:shipment.php

示例2: updateOrder

/**
 * Update an order
 *
 * @param	array		$authentication		Array of authentication information
 * @param	array		$order				Order info
 * @return	array							Array result
 */
function updateOrder($authentication, $order)
{
    global $db, $conf, $langs;
    $now = dol_now();
    dol_syslog("Function: updateOrder login=" . $authentication['login']);
    if ($authentication['entity']) {
        $conf->entity = $authentication['entity'];
    }
    // Init and check authentication
    $objectresp = array();
    $errorcode = '';
    $errorlabel = '';
    $error = 0;
    $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
    // Check parameters
    if (empty($order['id']) && empty($order['ref']) && empty($order['ref_ext'])) {
        $error++;
        $errorcode = 'KO';
        $errorlabel = "Order id or ref or ref_ext is mandatory.";
    }
    if (!$error) {
        $objectfound = false;
        include_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
        $object = new Commande($db);
        $result = $object->fetch($order['id'], empty($order['id']) ? $order['ref'] : '', empty($order['id']) && empty($order['ref']) ? $order['ref_ext'] : '');
        if (!empty($object->id)) {
            $objectfound = true;
            $db->begin();
            if (isset($order['status'])) {
                if ($order['status'] == -1) {
                    $result = $object->cancel($fuser);
                }
                if ($order['status'] == 1) {
                    $result = $object->valid($fuser);
                }
                if ($order['status'] == 0) {
                    $result = $object->set_reopen($fuser);
                }
                if ($order['status'] == 3) {
                    $result = $object->cloture($fuser);
                }
            }
            if (isset($order['billed'])) {
                if ($order['billed']) {
                    $result = $object->classifyBilled($fuser);
                }
                if (!$order['billed']) {
                    $result = $object->classifyBilled($fuser);
                }
            }
            //Retreive all extrafield for object
            // fetch optionals attributes and labels
            $extrafields = new ExtraFields($db);
            $extralabels = $extrafields->fetch_name_optionals_label('commande', true);
            foreach ($extrafields->attribute_label as $key => $label) {
                $key = 'options_' . $key;
                if (isset($order[$key])) {
                    $result = $object->setValueFrom($key, $order[$key], 'commande_extrafields');
                }
            }
            if ($result <= 0) {
                $error++;
            }
        }
        if (!$error && $objectfound) {
            $db->commit();
            $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $object->id);
        } elseif ($objectfound) {
            $db->rollback();
            $error++;
            $errorcode = 'KO';
            $errorlabel = $object->error;
        } else {
            $error++;
            $errorcode = 'NOT_FOUND';
            $errorlabel = 'Order id=' . $order['id'] . ' ref=' . $order['ref'] . ' ref_ext=' . $order['ref_ext'] . ' cannot be found';
        }
    }
    if ($error) {
        $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
    }
    return $objectresp;
}
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:90,代码来源:server_order.php


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