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


PHP CommandeFournisseur::fetch_thirdparty方法代码示例

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


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

示例1: restrictedArea

    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('ordersuppliercard'));
$object = new CommandeFournisseur($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);
    if ($ret < 0) {
        dol_print_error($db, $object->error);
    }
    $ret = $object->fetch_thirdparty();
    if ($ret < 0) {
        dol_print_error($db, $object->error);
    }
} else {
    if (!empty($socid) && $socid > 0) {
        $fourn = new Fournisseur($db);
        $ret = $fourn->fetch($socid);
        if ($ret < 0) {
            dol_print_error($db, $object->error);
        }
        $object->socid = $fourn->id;
        $ret = $object->fetch_thirdparty();
        if ($ret < 0) {
            dol_print_error($db, $object->error);
        }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:fiche.php

示例2: CommandeFournisseur

$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) {
    $sortorder = "ASC";
}
if (!$sortfield) {
    $sortfield = "name";
}
$object = new CommandeFournisseur($db);
if ($object->fetch($id, $ref) < 0) {
    dol_print_error($db);
    exit;
}
$upload_dir = $conf->fournisseur->dir_output . '/commande/' . dol_sanitizeFileName($object->ref);
$object->fetch_thirdparty();
/*
 * Actions
 */
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
 * View
 */
$form = new Form($db);
if ($object->id > 0) {
    llxHeader();
    $author = new User($db);
    $author->fetch($object->user_author_id);
    $head = ordersupplier_prepare_head($object);
    dol_fiche_head($head, 'documents', $langs->trans('SupplierOrder'), 0, 'order');
    // Construit liste des fichiers
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:document.php

示例3: foreach

     $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) {
         $order->lines[] = $line;
     }
     $order->cond_reglement_id = $order->thirdparty->cond_reglement_supplier_id;
     $order->mode_reglement_id = $order->thirdparty->mode_reglement_supplier_id;
     $id = $order->create($user);
     if ($id < 0) {
         $fail++;
         $msg = $langs->trans('OrderFail') . "&nbsp;:&nbsp;";
         $msg .= $order->error;
         setEventMessages($msg, null, 'errors');
     }
     $i++;
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:replenish.php

示例4: HookManager

 /**
  *  Function to build pdf onto disk
  *
  *  @param		CommandeFournisseur	$object				Id of object to generate
  *  @param		Translate			$outputlangs		Lang output object
  *  @param		string				$srctemplatepath	Full path of source filename for generator using a template file
  *  @param		int					$hidedetails		Do not show line details
  *  @param		int					$hidedesc			Do not show desc
  *  @param		int					$hideref			Do not show ref
  *  @return		int										1=OK, 0=KO
  */
 function write_file($object, $outputlangs = '', $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
 {
     global $user, $langs, $conf, $hookmanager, $mysoc;
     if (!is_object($outputlangs)) {
         $outputlangs = $langs;
     }
     // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
     if (!empty($conf->global->MAIN_USE_FPDF)) {
         $outputlangs->charset_output = 'ISO-8859-1';
     }
     $outputlangs->load("main");
     $outputlangs->load("dict");
     $outputlangs->load("companies");
     $outputlangs->load("bills");
     $outputlangs->load("products");
     $outputlangs->load("orders");
     if ($conf->fournisseur->dir_output . '/commande') {
         $object->fetch_thirdparty();
         $deja_regle = "";
         $amount_credit_notes_included = 0;
         $amount_deposits_included = 0;
         //$amount_credit_notes_included = $object->getSumCreditNotesUsed();
         //$amount_deposits_included = $object->getSumDepositsUsed();
         // Definition of $dir and $file
         if ($object->specimen) {
             $dir = $conf->fournisseur->commande->dir_output;
             $file = $dir . "/SPECIMEN.pdf";
         } else {
             $objectref = dol_sanitizeFileName($object->ref);
             $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier);
             $dir = $conf->fournisseur->commande->dir_output . '/' . $objectref;
             $file = $dir . "/" . $objectref . ".pdf";
             if (!empty($conf->global->SUPPLIER_REF_IN_NAME)) {
                 $file = $dir . "/" . $objectref . ($objectrefsupplier ? "_" . $objectrefsupplier : "") . ".pdf";
             }
         }
         if (!file_exists($dir)) {
             if (dol_mkdir($dir) < 0) {
                 $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
                 return 0;
             }
         }
         if (file_exists($dir)) {
             // Add pdfgeneration hook
             if (!is_object($hookmanager)) {
                 include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
                 $hookmanager = new HookManager($this->db);
             }
             $hookmanager->initHooks(array('pdfgeneration'));
             $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
             global $action;
             $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $this, $action);
             // Note that $action and $object may have been modified by some hooks
             $nblignes = count($object->lines);
             $pdf = pdf_getInstance($this->format);
             $default_font_size = pdf_getPDFFontSize($outputlangs);
             // Must be after pdf_getInstance
             $heightforinfotot = 50;
             // Height reserved to output the info and total part
             $heightforfreetext = isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5;
             // Height reserved to output the free text on last page
             $heightforfooter = $this->marge_basse + 8;
             // Height reserved to output the footer (value include bottom margin)
             $pdf->SetAutoPageBreak(1, 0);
             if (class_exists('TCPDF')) {
                 $pdf->setPrintHeader(false);
                 $pdf->setPrintFooter(false);
             }
             $pdf->SetFont(pdf_getPDFFont($outputlangs));
             // Set path to the background PDF File
             if (empty($conf->global->MAIN_DISABLE_FPDI) && !empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
                 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output . '/' . $conf->global->MAIN_ADD_PDF_BACKGROUND);
                 $tplidx = $pdf->importPage(1);
             }
             $pdf->Open();
             $pagenb = 0;
             $pdf->SetDrawColor(128, 128, 128);
             $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
             $pdf->SetSubject($outputlangs->transnoentities("Order"));
             $pdf->SetCreator("Dolibarr " . DOL_VERSION);
             $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
             $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref) . " " . $outputlangs->transnoentities("Order"));
             if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) {
                 $pdf->SetCompression(false);
             }
             $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
             // Left, Top, Right
             // Positionne $this->atleastonediscount si on a au moins une remise
             for ($i = 0; $i < $nblignes; $i++) {
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:pdf_muscadet.modules.php

示例5: Header

         // Refused->Validated
         $result = $order->setStatus($user, $newstatus);
         if ($result > 0) {
             Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $_REQUEST['id']);
             exit;
         } else {
             $mesg = '<div class="error">' . $order->error . '</div>';
         }
     }
 } else {
     if ($action == 'addline' && $user->rights->fournisseur->commande->creer) {
         if (($_POST['qty'] || $_POST['pqty']) && ($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc']) || $_POST['idprodfournprice'])) {
             if ($object->fetch($id) < 0) {
                 dol_print_error($db, $object->error);
             }
             if ($object->fetch_thirdparty() < 0) {
                 dol_print_error($db, $object->error);
             }
             // Ecrase $pu par celui	du produit
             // Ecrase $desc	par	celui du produit
             // Ecrase $txtva  par celui du produit
             if ($_POST["idprodfournprice"]) {
                 $qty = $_POST['qty'] ? $_POST['qty'] : $_POST['pqty'];
                 $productsupplier = new ProductFournisseur($db);
                 $idprod = $productsupplier->get_buyprice($_POST['idprodfournprice'], $qty);
                 // Just to see if a price exists for the quantity. Not used to found vat
                 if ($idprod > 0) {
                     $res = $productsupplier->fetch($idprod);
                     // cas special pour lequel on a les meme reference que le fournisseur
                     // $label = '['.$nv_prod->ref.'] - '. $nv_prod->libelle;
                     $label = $productsupplier->libelle;
开发者ID:nrjacker4,项目名称:crm-php,代码行数:31,代码来源:fiche.php

示例6: Form

llxHeader('', $langs->trans("OrderCard"), $helpurl);
dol_include_once('/labelprint/class/utils.class.php');
$html = new Form($db);
$form = new Form($db);
$formcompany = new FormCompany($db);
$contactstatic = new Contact($db);
$userstatic = new User($db);
/* *************************************************************************** */
/*                                                                             */
/* Mode vue et edition                                                         */
/*                                                                             */
/* *************************************************************************** */
if ($id > 0) {
    $facture = new CommandeFournisseur($db);
    if ($facture->fetch($id, $user->societe_id) > 0) {
        $facture->fetch_thirdparty();
        $head = ordersupplier_prepare_head($facture);
        // Confirmation to delete invoice
        if ($action == 'truncate') {
            $text = $langs->trans('ConfirmTruncateList');
            $formconfirm = $html->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $id, $langs->trans('TruncateList'), $text, 'confirm_truncate', '', 0, 1);
        }
        print $formconfirm;
        dol_fiche_head($head, 'labelprint', $langs->trans("SupplierOrder"), 0, 'order');
        /*
         *   Facture synthese pour rappel
         */
        print '<table class="border" width="100%">';
        // Reference du facture
        print '<tr><td width="20%">' . $langs->trans("Ref") . '</td><td colspan="3">';
        print $facture->ref;
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:order_supplier.php


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