本文整理汇总了PHP中Commande::fetch_thirdparty方法的典型用法代码示例。如果您正苦于以下问题:PHP Commande::fetch_thirdparty方法的具体用法?PHP Commande::fetch_thirdparty怎么用?PHP Commande::fetch_thirdparty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Commande
的用法示例。
在下文中一共展示了Commande::fetch_thirdparty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Commande
print '</td></tr>' . "\n";
// We do not add fields shipToName, shipToStreet, shipToCity, shipToState, shipToCountryCode, shipToZip, shipToStreet2, phoneNum
// as they don't exists (buyer is unknown, tag is free).
}
// Payment on customer order
if (GETPOST("source") == 'order' && $valid) {
$found = true;
$langs->load("orders");
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
$order = new Commande($db);
$result = $order->fetch('', $ref);
if ($result < 0) {
$mesg = $order->error;
$error++;
} else {
$result = $order->fetch_thirdparty($order->socid);
}
$amount = $order->total_ttc;
if (GETPOST("amount", 'int')) {
$amount = GETPOST("amount", 'int');
}
$amount = price2num($amount);
$fulltag = 'ORD=' . $order->ref . '.CUS=' . $order->thirdparty->id;
//$fulltag.='.NAM='.strtr($order->thirdparty->name,"-"," ");
if (!empty($TAG)) {
$tag = $TAG;
$fulltag .= '.TAG=' . $TAG;
}
$fulltag = dol_string_unaccent($fulltag);
// Creditor
$var = !$var;
示例2: while
print '<td width="12%" align="center">' . $langs->trans("Stock") . '</td>';
}
print "</tr>\n";
}
$var = true;
while ($i < $num) {
$product = new Product($db);
$line = $commande->lines[$i];
$var = !$var;
print "<tr " . $bc[$var] . ">\n";
if ($line->fk_product > 0) {
$product->fetch($line->fk_product);
$product->load_stock();
// Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$commande->fetch_thirdparty();
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && !empty($_REQUEST['lang_id'])) {
$newlang = $_REQUEST['lang_id'];
}
if (empty($newlang)) {
$newlang = $commande->client->default_lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$label = !empty($product->multilangs[$outputlangs->defaultlang]["label"]) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $product->label;
} else {
$label = !empty($line->label) ? $line->label : $product->label;
示例3: Commande
if (! $sortfield) $sortfield="name";
$object = new Commande($db);
/*
* Actions
*/
// Envoi fichier
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($object->fetch($id))
{
$object->fetch_thirdparty();
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
if (create_exdir($upload_dir) >= 0)
{
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0,0,$_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0)
{
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
}
else
{
$langs->load("errors");
if ($resupload < 0) // Unknown error
{
示例4: GETPOST
$hidedetails = GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
$hidedesc = GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
$hideref = GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
// Security check
if (!empty($user->societe_id)) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'commande', $id);
$object = new Commande($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref);
$ret = $object->fetch_thirdparty();
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('ordercard'));
$permissionnote = $user->rights->commande->creer;
// Used by the include of actions_setnotes.inc.php
/*
* Actions
*/
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
// Note that $action and $object may have been modified by some hooks
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not includ_once
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->commande->creer) {
示例5: validOrder
/**
* Valid an order
*
* @param array $authentication Array of authentication information
* @param int $id Id of order to validate
* @return array Array result
*/
function validOrder($authentication, $id = '')
{
global $db, $conf, $langs;
dol_syslog("Function: validOrder login=" . $authentication['login'] . " id=" . $id . " ref=" . $ref . " ref_ext=" . $ref_ext);
// Init and check authentication
$objectresp = array();
$errorcode = '';
$errorlabel = '';
$error = 0;
if ($authentication['entity']) {
$conf->entity = $authentication['entity'];
}
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
if (!$error) {
$fuser->getrights();
if ($fuser->rights->commande->lire) {
$order = new Commande($db);
$result = $order->fetch($id, $ref, $ref_ext);
$order->fetch_thirdparty();
$db->begin();
if ($result > 0) {
$result = $order->valid($fuser);
if ($result >= 0) {
// Define output language
$outputlangs = $langs;
$order->generateDocument($order->modelpdf, $outputlangs);
} else {
$db->rollback();
$error++;
$errorcode = 'KO';
$errorlabel = $newobject->error;
}
} else {
$db->rollback();
$error++;
$errorcode = 'KO';
$errorlabel = $newobject->error;
}
} else {
$db->rollback();
$error++;
$errorcode = 'KO';
$errorlabel = $newobject->error;
}
}
if ($error) {
$objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
} else {
$db->commit();
$objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''));
}
return $objectresp;
}
示例6: testFetchThirdParty
/**
* testFetchThirdParty
*
* @return void
*/
public function testFetchThirdParty()
{
global $conf, $user, $langs, $db;
$conf = $this->savconf;
$user = $this->savuser;
$langs = $this->savlangs;
$db = $this->savdb;
$localobject = new Commande($this->savdb);
$localobject->fetch(1);
$result = $localobject->fetch_thirdparty();
print __METHOD__ . " result=" . $result . "\n";
$this->assertLessThanOrEqual($result, 0);
return $result;
}