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


PHP Commande::getIdcontact方法代码示例

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


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

示例1: create


//.........这里部分代码省略.........
     $sql .= ", '" . $this->db->idate($datelim) . "', '" . $this->db->escape($this->modelpdf) . "'";
     $sql .= ", " . ($this->situation_cycle_ref ? "'" . $this->db->escape($this->situation_cycle_ref) . "'" : "null");
     $sql .= ", " . ($this->situation_counter ? "'" . $this->db->escape($this->situation_counter) . "'" : "null");
     $sql .= ", " . ($this->situation_final ? $this->situation_final : 0);
     $sql .= ", " . (int) $this->fk_incoterms;
     $sql .= ", '" . $this->db->escape($this->location_incoterms) . "'";
     $sql .= ")";
     dol_syslog(get_class($this) . "::create", LOG_DEBUG);
     $resql = $this->db->query($sql);
     if ($resql) {
         $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . 'facture');
         // Update ref with new one
         $this->ref = '(PROV' . $this->id . ')';
         $sql = 'UPDATE ' . MAIN_DB_PREFIX . "facture SET facnumber='" . $this->ref . "' WHERE rowid=" . $this->id;
         dol_syslog(get_class($this) . "::create", LOG_DEBUG);
         $resql = $this->db->query($sql);
         if (!$resql) {
             $error++;
         }
         // Add object linked
         if (!$error && $this->id && is_array($this->linked_objects) && !empty($this->linked_objects)) {
             foreach ($this->linked_objects as $origin => $origin_id) {
                 $ret = $this->add_object_linked($origin, $origin_id);
                 if (!$ret) {
                     dol_print_error($this->db);
                     $error++;
                 }
                 // TODO mutualiser
                 if ($origin == 'commande') {
                     // On recupere les differents contact interne et externe
                     $order = new Commande($this->db);
                     $order->id = $origin_id;
                     // On recupere le commercial suivi propale
                     $this->userid = $order->getIdcontact('internal', 'SALESREPFOLL');
                     if ($this->userid) {
                         //On passe le commercial suivi commande en commercial suivi paiement
                         $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
                     }
                     // On recupere le contact client facturation commande
                     $this->contactid = $order->getIdcontact('external', 'BILLING');
                     if ($this->contactid) {
                         //On passe le contact client facturation commande en contact client facturation
                         $this->add_contact($this->contactid[0], 'BILLING', 'external');
                     }
                 }
             }
         }
         /*
          *  Insert lines of invoices into database
          */
         if (count($this->lines) && is_object($this->lines[0])) {
             $fk_parent_line = 0;
             dol_syslog("There is " . count($this->lines) . " lines that are invoice lines objects");
             foreach ($this->lines as $i => $val) {
                 $newinvoiceline = $this->lines[$i];
                 $newinvoiceline->fk_facture = $this->id;
                 $newinvoiceline->origin = $this->element;
                 $newinvoiceline->origin_id = $this->lines[$i]->id;
                 if ($result >= 0 && ($newinvoiceline->info_bits & 0x1) == 0) {
                     // Reset fk_parent_line for no child products and special product
                     if ($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line) || $newinvoiceline->product_type == 9) {
                         $fk_parent_line = 0;
                     }
                     $newinvoiceline->fk_parent_line = $fk_parent_line;
                     $result = $newinvoiceline->insert();
                     // Defined the new fk_parent_line
开发者ID:Samara94,项目名称:dolibarr,代码行数:67,代码来源:facture.class.php

示例2: create


//.........这里部分代码省略.........
     $sql .= "," . ($this->ref_client ? "'" . $this->db->escape($this->ref_client) . "'" : "null");
     $sql .= "," . ($this->ref_int ? "'" . $this->db->escape($this->ref_int) . "'" : "null");
     $sql .= "," . ($this->fk_facture_source ? "'" . $this->db->escape($this->fk_facture_source) . "'" : "null");
     $sql .= "," . ($user->id > 0 ? "'" . $user->id . "'" : "null");
     $sql .= "," . ($this->fk_project ? $this->fk_project : "null");
     $sql .= ',' . $this->cond_reglement_id;
     $sql .= "," . $this->mode_reglement_id;
     $sql .= ", '" . $this->db->idate($datelim) . "', '" . $this->modelpdf . "')";
     dol_syslog("Facture::Create sql=" . $sql);
     $resql = $this->db->query($sql);
     if ($resql) {
         $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . 'facture');
         // Update ref with new one
         $this->ref = '(PROV' . $this->id . ')';
         $sql = 'UPDATE ' . MAIN_DB_PREFIX . "facture SET facnumber='" . $this->ref . "' WHERE rowid=" . $this->id;
         dol_syslog("Facture::create sql=" . $sql);
         $resql = $this->db->query($sql);
         if (!$resql) {
             $error++;
         }
         // Add object linked
         if (!$error && $this->id && $this->origin && $this->origin_id) {
             $ret = $this->add_object_linked();
             if (!$ret) {
                 dol_print_error($this->db);
                 $error++;
             }
             // TODO mutualiser
             if ($this->origin == 'commande') {
                 // On recupere les differents contact interne et externe
                 $order = new Commande($this->db);
                 $order->id = $this->origin_id;
                 // On recupere le commercial suivi propale
                 $this->userid = $order->getIdcontact('internal', 'SALESREPFOLL');
                 if ($this->userid) {
                     //On passe le commercial suivi commande en commercial suivi paiement
                     $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
                 }
                 // On recupere le contact client facturation commande
                 $this->contactid = $order->getIdcontact('external', 'BILLING');
                 if ($this->contactid) {
                     //On passe le contact client facturation commande en contact client facturation
                     $this->add_contact($this->contactid[0], 'BILLING', 'external');
                 }
             }
         }
         /*
          *  Insert lines of invoices into database
          */
         if (sizeof($this->lines) && is_object($this->lines[0])) {
             $fk_parent_line = 0;
             dol_syslog("There is " . sizeof($this->lines) . " lines that are invoice lines objects");
             foreach ($this->lines as $i => $val) {
                 $newinvoiceline = new FactureLigne($this->db);
                 $newinvoiceline = $this->lines[$i];
                 $newinvoiceline->fk_facture = $this->id;
                 if ($result >= 0 && ($newinvoiceline->info_bits & 0x1) == 0) {
                     // Reset fk_parent_line for no child products and special product
                     if ($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line) || $newinvoiceline->product_type == 9) {
                         $fk_parent_line = 0;
                     }
                     $newinvoiceline->fk_parent_line = $fk_parent_line;
                     $result = $newinvoiceline->insert();
                     // Defined the new fk_parent_line
                     if ($result > 0 && $newinvoiceline->product_type == 9) {
                         $fk_parent_line = $result;
开发者ID:ripasch,项目名称:dolibarr,代码行数:67,代码来源:facture.class.php


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