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


PHP saveInventoryProductDetails函数代码示例

本文整理汇总了PHP中saveInventoryProductDetails函数的典型用法代码示例。如果您正苦于以下问题:PHP saveInventoryProductDetails函数的具体用法?PHP saveInventoryProductDetails怎么用?PHP saveInventoryProductDetails使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: save_module

 /** Function to handle the module specific save operations
  */
 function save_module($module)
 {
     //in ajax save we should not call this function, because this will delete all the existing product values
     if (isset($_REQUEST)) {
         //SalesPlatform.ru begin fix empty updating line items from handlers
         if ($_REQUEST['action'] != 'ConsignmentAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' && $this->isLineItemUpdate != false) {
             //if($_REQUEST['action'] != 'ConsignmentAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW'
             //		&& $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates')
             //{
             //SalesPlatform.ru end
             //Based on the total Number of rows we will save the product relationship with this entity
             saveInventoryProductDetails($this, 'Consignment');
         }
     }
     // Update the currency id and the conversion rate for the Consignment
     $update_query = "update vtiger_sp_consignment set currency_id=?, conversion_rate=? where consignmentid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $this->db->pquery($update_query, $update_params);
     // Auto-generation for goods consignment no
     if ($this->column_fields['has_goods_consignment'] == 'on' && (empty($this->column_fields['goods_consignment_no']) || $this->column_fields['goods_consignment_no'] == 0)) {
         $res = $this->db->query('select max(goods_consignment_no) as max_no from vtiger_sp_consignment
     join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_sp_consignment.consignmentid
     where vtiger_crmentity.deleted=0');
         if ($this->db->num_rows($res) > 0) {
             $this->column_fields['goods_consignment_no'] = $this->db->query_result($res, 0, 'max_no') + 1;
             $update_query = "update vtiger_sp_consignment set goods_consignment_no=? where consignmentid=?";
             $update_params = array($this->db->query_result($res, 0, 'max_no') + 1, $this->id);
         } else {
             $this->column_fields['goods_consignment_no'] = 1;
             $update_query = "update vtiger_sp_consignment set goods_consignment_no=? where consignmentid=?";
             $update_params = array($this->column_fields['goods_consignment_no'] = 1, $this->id);
         }
         $this->db->pquery($update_query, $update_params);
     }
 }
开发者ID:DeliveryPLANET,项目名称:vTiger,代码行数:37,代码来源:Consignment.php

示例2: save_module

 /** Function to handle the module specific save operations
  */
 function save_module($module)
 {
     global $updateInventoryProductRel_deduct_stock;
     $updateInventoryProductRel_deduct_stock = true;
     //in ajax save we should not call this function, because this will delete all the existing product values
     if (isset($this->_recurring_mode) && $this->_recurring_mode == 'recurringinvoice_from_so' && isset($this->_salesorderid) && $this->_salesorderid != '') {
         // We are getting called from the RecurringInvoice cron service!
         $this->createRecurringInvoiceFromSO();
     } else {
         if (isset($_REQUEST)) {
             if ($_REQUEST['action'] != 'InvoiceAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' && $_REQUEST['action'] != 'SaveAjax' && $this->isLineItemUpdate != false && $_REQUEST['action'] != 'FROM_WS') {
                 //Based on the total Number of rows we will save the product relationship with this entity
                 saveInventoryProductDetails($this, 'Invoice');
             } else {
                 if ($_REQUEST['action'] == 'InvoiceAjax' || $_REQUEST['action'] == 'MassEditSave' || $_REQUEST['action'] == 'FROM_WS') {
                     $updateInventoryProductRel_deduct_stock = false;
                 }
             }
         }
     }
     // Update the currency id and the conversion rate for the invoice
     $update_query = "update vtiger_invoice set currency_id=?, conversion_rate=? where invoiceid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $this->db->pquery($update_query, $update_params);
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:27,代码来源:Invoice.php

示例3: save_module

 function save_module()
 {
     global $adb;
     //in ajax save we should not call this function, because this will delete all the existing product values
     if ($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' && $_REQUEST['action'] != 'SaveAjax' && $this->isLineItemUpdate != false) {
         //Based on the total Number of rows we will save the product relationship with this entity
         saveInventoryProductDetails($this, 'Quotes');
     }
     // Update the currency id and the conversion rate for the quotes
     $update_query = "update vtiger_quotes set currency_id=?, conversion_rate=? where quoteid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $adb->pquery($update_query, $update_params);
     $tot_no_prod = $_REQUEST['totalProductCount'];
     $calculationList = array();
     for ($i = 1; $i <= $tot_no_prod; $i++) {
         $calculationsid = vtlib_purify($_REQUEST['calculationId' . $i]);
         $calculationsid_old = vtlib_purify($_REQUEST['old_calculationId' . $i]);
         if ($calculationsid_old != '' && !in_array($calculationsid_old, $calculationList) && $calculationsid != $calculationsid_old) {
             $this->delete_related_module('Quotes', $this->id, 'Calculations', $calculationsid_old);
         }
         if ($calculationsid != '') {
             $calculationList[] = $calculationsid;
             $this->save_related_module('Quotes', $this->id, 'Calculations', $calculationsid);
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:26,代码来源:Quotes.php

示例4: save_module

 function save_module($module)
 {
     global $adb;
     //in ajax save we should not call this function, because this will delete all the existing product values
     if ($_REQUEST['action'] != 'PurchaseOrderAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates') {
         //Based on the total Number of rows we will save the product relationship with this entity
         saveInventoryProductDetails($this, 'PurchaseOrder', $this->update_prod_stock);
     }
     //In Ajax edit, if the status changed to Received Shipment then we have to update the product stock
     if ($_REQUEST['action'] == 'PurchaseOrderAjax' && $this->update_prod_stock == 'true') {
         $inventory_res = $this->db->pquery("select productid, quantity from vtiger_inventoryproductrel where id=?", array($this->id));
         $noofproducts = $this->db->num_rows($inventory_res);
         //We have to update the stock for all the products in this PO
         for ($prod_count = 0; $prod_count < $noofproducts; $prod_count++) {
             $productid = $this->db->query_result($inventory_res, $prod_count, 'productid');
             $quantity = $this->db->query_result($inventory_res, $prod_count, 'quantity');
             $this->db->println("Stock is going to be updated for the productid - {$productid} with quantity - {$quantity}");
             addToProductStock($productid, $quantity);
         }
     }
     // Update the currency id and the conversion rate for the purchase order
     $update_query = "update vtiger_purchaseorder set currency_id=?, conversion_rate=? where purchaseorderid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $adb->pquery($update_query, $update_params);
 }
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:25,代码来源:PurchaseOrder.php

示例5: save_module

 function save_module($module)
 {
     global $updateInventoryProductRel_deduct_stock;
     if ($this->HasDirectImageField) {
         $this->insertIntoAttachment($this->id, $module);
     }
     $updateInventoryProductRel_deduct_stock = true;
     //Checking if quote_id is present and updating the quote status
     if ($this->column_fields['quote_id'] != '') {
         $newStatus = GlobalVariable::getVariable('QuoteStatusOnSalesOrderSave', 'Accepted');
         if ($newStatus != 'DoNotChange') {
             $qt_id = $this->column_fields['quote_id'];
             $query1 = 'update vtiger_quotes set quotestage=? where quoteid=?';
             $this->db->pquery($query1, array($newStatus, $qt_id));
         }
     }
     //in ajax save we should not call this function, because this will delete all the existing product values
     if ($_REQUEST['action'] != 'SalesOrderAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates') {
         //Based on the total Number of rows we will save the product relationship with this entity
         saveInventoryProductDetails($this, 'SalesOrder');
         if (vtlib_isModuleActive("InventoryDetails")) {
             InventoryDetails::createInventoryDetails($this, 'SalesOrder');
         }
     } else {
         if ($_REQUEST['action'] == 'SalesOrderAjax' || $_REQUEST['action'] == 'MassEditSave') {
             $updateInventoryProductRel_deduct_stock = false;
         }
     }
     // Update the currency id and the conversion rate for the sales order
     $update_query = "update vtiger_salesorder set currency_id=?, conversion_rate=? where salesorderid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $this->db->pquery($update_query, $update_params);
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:33,代码来源:SalesOrder.php

示例6: save_module

 function save_module()
 {
     global $adb;
     //in ajax save we should not call this function, because this will delete all the existing product values
     if ($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave') {
         //Based on the total Number of rows we will save the product relationship with this entity
         saveInventoryProductDetails($this, 'Quotes');
     }
     // Update the currency id and the conversion rate for the quotes
     $update_query = "update vtiger_quotes set currency_id=?, conversion_rate=? where quoteid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $adb->pquery($update_query, $update_params);
 }
开发者ID:hardikk,项目名称:HNH,代码行数:13,代码来源:Quotes.php

示例7: save_module

 function save_module($module)
 {
     //Checking if quote_id is present and updating the quote status
     if ($this->column_fields["quote_id"] != '') {
         $qt_id = $this->column_fields["quote_id"];
         $query1 = "update vtiger_quotes set quotestage='Accepted' where quoteid=?";
         $this->db->pquery($query1, array($qt_id));
     }
     //in ajax save we should not call this function, because this will delete all the existing product values
     if ($_REQUEST['action'] != 'SalesOrderAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates') {
         //Based on the total Number of rows we will save the product relationship with this entity
         saveInventoryProductDetails($this, 'SalesOrder');
     }
     // Update the currency id and the conversion rate for the sales order
     $update_query = "update vtiger_salesorder set currency_id=?, conversion_rate=? where salesorderid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $this->db->pquery($update_query, $update_params);
 }
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:18,代码来源:SalesOrder.php

示例8: save_module

 function save_module($module)
 {
     global $adb;
     if ($this->HasDirectImageField) {
         $this->insertIntoAttachment($this->id, $module);
     }
     //in ajax save we should not call this function, because this will delete all the existing product values
     if (inventoryCanSaveProductLines($_REQUEST)) {
         //Based on the total Number of rows we will save the product relationship with this entity
         saveInventoryProductDetails($this, 'PurchaseOrder');
         if (vtlib_isModuleActive("InventoryDetails")) {
             InventoryDetails::createInventoryDetails($this, 'PurchaseOrder');
         }
     }
     // Update the currency id and the conversion rate for the purchase order
     $update_query = "update vtiger_purchaseorder set currency_id=?, conversion_rate=? where purchaseorderid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $adb->pquery($update_query, $update_params);
 }
开发者ID:kikojover,项目名称:corebos,代码行数:19,代码来源:PurchaseOrder.php

示例9: save_module

 function save_module($module)
 {
     global $adb;
     if ($this->HasDirectImageField) {
         $this->insertIntoAttachment($this->id, $module);
     }
     //in ajax save we should not call this function, because this will delete all the existing product values
     if ($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates') {
         //Based on the total Number of rows we will save the product relationship with this entity
         saveInventoryProductDetails($this, 'Quotes');
         if (vtlib_isModuleActive("InventoryDetails")) {
             InventoryDetails::createInventoryDetails($this, 'Quotes');
         }
     }
     // Update the currency id and the conversion rate for the quotes
     $update_query = "update vtiger_quotes set currency_id=?, conversion_rate=? where quoteid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $adb->pquery($update_query, $update_params);
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:19,代码来源:Quotes.php

示例10: save_module

 /** Function to handle the module specific save operations
  */
 function save_module($module)
 {
     //in ajax save we should not call this function, because this will delete all the existing product values
     if (isset($_REQUEST)) {
         //SalesPlatform.ru begin
         if ($_REQUEST['action'] != 'SaveAjax' && $_REQUEST['action'] != 'ActAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates') {
             //if($_REQUEST['action'] != 'ActAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW'
             //		&& $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates')
             //{
             //SalesPlatform.ru end
             //Based on the total Number of rows we will save the product relationship with this entity
             saveInventoryProductDetails($this, 'Act');
         }
     }
     // Update the currency id and the conversion rate for the act
     $update_query = "update vtiger_sp_act set currency_id=?, conversion_rate=? where actid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $this->db->pquery($update_query, $update_params);
     // Update Invoice Act id field
     if ($_REQUEST['sourceModule'] == 'Invoice' && $_REQUEST['sourceRecord'] != null) {
         $this->db->pquery("update vtiger_invoice set sp_act_id = ? where invoiceid = ?", array($this->id, $_REQUEST['sourceRecord']));
     }
 }
开发者ID:DeliveryPLANET,项目名称:vTiger,代码行数:25,代码来源:Act.php

示例11: save_module

 function save_module($module)
 {
     global $adb, $updateInventoryProductRel_deduct_stock;
     $updateInventoryProductRel_deduct_stock = false;
     //in ajax save we should not call this function, because this will delete all the existing product values
     if ($_REQUEST['action'] != $module . 'Ajax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' && $_REQUEST['action'] != 'SaveAjax' && $this->isLineItemUpdate != false) {
         $requestProductIdsList = $requestQuantitiesList = array();
         $totalNoOfProducts = $_REQUEST['totalProductCount'];
         for ($i = 1; $i <= $totalNoOfProducts; $i++) {
             $productId = $_REQUEST['hdnProductId' . $i];
             $requestProductIdsList[$productId] = $productId;
             $requestQuantitiesList[$productId] = $_REQUEST['qty' . $i];
         }
         saveInventoryProductDetails($this, $module, $this->update_prod_stock);
         if ($this->mode != '') {
             $updateInventoryProductRel_deduct_stock = true;
         }
         // Update the currency id and the conversion rate for the invoice
         $update_query = "update vtiger_osscosts set currency_id=?,conversion_rate=? where osscostsid=?";
         $update_params = array($_REQUEST['currency_id'], $_REQUEST['conversion_rate'], $this->id);
         $this->db->pquery($update_query, $update_params);
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:23,代码来源:OSSCosts.php

示例12: save_module

 /** Function to handle the module specific save operations
  */
 function save_module($module)
 {
     //Checking if vtiger_salesorderid is present and updating the quote status
     if ($this->column_fields["salesorder_id"] != '') {
         $so_id = $this->column_fields["salesorder_id"];
         $query1 = "update vtiger_salesorder set sostatus='Approved' where salesorderid=?";
         $this->db->pquery($query1, array($so_id));
     }
     //in ajax save we should not call this function, because this will delete all the existing product values
     if (isset($_REQUEST)) {
         if ($_REQUEST['action'] != 'InvoiceAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave') {
             //Based on the total Number of rows we will save the product relationship with this entity
             saveInventoryProductDetails(&$this, 'Invoice');
         }
     }
     if (isset($this->_recurring_mode) && $this->_recurring_mode == 'recurringinvoice_from_so' && isset($this->_salesorderid) && $this->_salesorderid != '') {
         $this->createRecurringInvoiceFromSO();
     }
     // Update the currency id and the conversion rate for the invoice
     $update_query = "update vtiger_invoice set currency_id=?, conversion_rate=? where invoiceid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $this->db->pquery($update_query, $update_params);
 }
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:25,代码来源:Invoice.php

示例13: save_module

 function save_module($module)
 {
     global $updateInventoryProductRel_deduct_stock;
     if ($this->HasDirectImageField) {
         $this->insertIntoAttachment($this->id, $module);
     }
     $updateInventoryProductRel_deduct_stock = true;
     //in ajax save we should not call this function, because this will delete all the existing product values
     if (inventoryCanSaveProductLines($_REQUEST, 'Issuecards')) {
         //Based on the total Number of rows we will save the product relationship with this entity
         saveInventoryProductDetails($this, 'Issuecards');
         if (vtlib_isModuleActive("InventoryDetails")) {
             InventoryDetails::createInventoryDetails($this, 'Issuecards');
         }
     } else {
         if ($_REQUEST['action'] == 'IssuecardsAjax' || $_REQUEST['action'] == 'MassEditSave') {
             $updateInventoryProductRel_deduct_stock = false;
         }
     }
     // Update the currency id and the conversion rate for the invoice
     $update_query = "update vtiger_issuecards set currency_id=?, conversion_rate=? where issuecardid=?";
     $update_params = array($this->column_fields['currency_id'], $this->column_fields['conversion_rate'], $this->id);
     $this->db->pquery($update_query, $update_params);
 }
开发者ID:tsolucio,项目名称:coreBOSPackingSlip,代码行数:24,代码来源:Issuecards.php

示例14: save


//.........这里部分代码省略.........
             $_REQUEST["hdnProductId" . $counter] = $product["productid"];
             $_REQUEST["productDescription" . $counter] = $product["description"];
             $_REQUEST["qty" . $counter] = $product["quantity"];
             $_REQUEST["listPrice" . $counter] = $product["unitprice"];
             $_REQUEST["comment" . $counter] = $product["comment"];
             if (!empty($product["discount_percent"])) {
                 $_REQUEST["discount_type" . $counter] = "percentage";
                 $product["discount_amount"] = 0;
             } elseif (!empty($product["discount_amount"])) {
                 $_REQUEST["discount_type" . $counter] = "amount";
                 $product["discount_percent"] = 0;
             }
             $_REQUEST["discount_percentage" . $counter] = $product["discount_percent"];
             $_REQUEST["discount_amount" . $counter] = $product["discount_amount"];
             $productTotal = 0;
             $taxValue = 0;
             $productTotal += $_REQUEST["qty" . $counter] * $_REQUEST["listPrice" . $counter] - $_REQUEST["discount_amount" . $counter];
             if ($product["discount_percent"] > 0) {
                 $productTotal = $productTotal * (1 - $product["discount_percent"] / 100);
             }
             foreach ($availTaxes as $tax) {
                 if (isset($product["tax" . $tax["taxid"]]) && !empty($product["tax" . $tax["taxid"]])) {
                     if ($taxtype == "group") {
                         #                        $tax_name = $tax['taxname'];
                         #                        $request_tax_name = $tax_name."_group_percentage";
                         #                        $_REQUEST[$request_tax_name] = $product["tax".$tax["taxid"]];
                     } else {
                         $tax_name = $tax['taxname'];
                         $request_tax_name = $tax_name . "_percentage" . $counter;
                         $_REQUEST[$request_tax_name] = $product["tax" . $tax["taxid"]];
                         $tmpTaxValue = $productTotal * ($product["tax" . $tax["taxid"]] / 100);
                         $taxValue += $tmpTaxValue;
                         $productTotal += $tmpTaxValue;
                     }
                 } else {
                     $tax_name = $tax['taxname'];
                     $request_tax_name = $tax_name . "_percentage" . $counter;
                     $_REQUEST[$request_tax_name] = 0;
                 }
             }
             $_REQUEST['subtotal'] += $productTotal;
             $counter++;
         }
         $_REQUEST['discount_percentage_final'] = $this->get("hdnDiscountPercent");
         $_REQUEST['discount_percentage_final'] = floatval($_REQUEST['discount_percentage_final']);
         $_REQUEST['discount_amount_final'] = $this->get("hdnDiscountAmount");
         $_REQUEST['discount_amount_final'] = floatval($_REQUEST['discount_amount_final']);
         $_REQUEST['discount_type_final'] = !empty($_REQUEST['discount_percentage_final']) ? 'percentage' : 'amount';
         $_REQUEST['total'] = $_REQUEST['subtotal'];
         if ($_REQUEST['discount_type_final'] == "amount") {
             $_REQUEST['total'] -= $_REQUEST['discount_amount_final'];
         } elseif ($_REQUEST['discount_type_final'] == "percentage") {
             $_REQUEST['total'] -= $_REQUEST['total'] * ($_REQUEST['discount_percentage_final'] / 100);
         }
         $globalTaxValue = 0;
         if ($taxtype == "group") {
             foreach ($availTaxes as $tax) {
                 $tax_name = $tax['taxname'];
                 $request_tax_name = $tax_name . "_group_percentage";
                 $_REQUEST[$request_tax_name] = isset($this->_groupTax[$request_tax_name]) ? $this->_groupTax[$request_tax_name] : 0;
                 $tmpTaxValue = $_REQUEST['total'] * ($_REQUEST[$request_tax_name] / 100);
                 $globalTaxValue += $tmpTaxValue;
             }
             $_REQUEST['total'] += $globalTaxValue;
         }
         $_REQUEST['shipping_handling_charge'] = $this->_shippingCost;
         $shipTaxValue = 0;
         foreach ($availTaxes as $tax) {
             $tax_name = $tax['taxname'];
             $request_tax_name = $tax_name . "_sh_percent";
             $_REQUEST["sh" . $request_tax_name] = isset($this->_shipTaxes[$request_tax_name]) ? $this->_shipTaxes[$request_tax_name] : 0;
             $tmpTaxValue = $_REQUEST['shipping_handling_charge'] * ($_REQUEST["sh" . $request_tax_name] / 100);
             $shipTaxValue += $tmpTaxValue;
         }
         $_REQUEST['total'] += $shipTaxValue + $_REQUEST['shipping_handling_charge'];
         $_REQUEST['adjustment'] = floatval($this->get("txtAdjustment"));
         $_REQUEST['total'] += $_REQUEST['adjustment'];
         $intObject = $this->getInternalObject();
         $intObject->mode = "edit";
         ob_start();
         saveInventoryProductDetails($intObject, $this->getModuleName());
         ob_end_clean();
     }
     if (!empty($currency_id)) {
         if (strpos($currency_id, "x") !== false) {
             $parts = explode("x", $currency_id);
             $currency_id = $parts[1];
         } else {
             $currency_id = $currency_id;
         }
         $cur_sym_rate = getCurrencySymbolandCRate($currency_id);
         $conversion_rate = $cur_sym_rate['rate'];
         $intObject = $this->getInternalObject();
         $update_query = "update " . $intObject->table_name . " set currency_id = ?, conversion_rate = ? WHERE " . $intObject->table_index . " = ?";
         $update_params = array($currency_id, $conversion_rate, $this->_id);
         #var_dump($update_query, $update_params);
         $adb->pquery($update_query, $update_params);
     }
     // Update the currency id and the conversion rate for the sales order
 }
开发者ID:Neodracir,项目名称:VtigerCRM-Tools,代码行数:101,代码来源:VTInventoryEntity.php

示例15: save


//.........这里部分代码省略.........
             $oplkjyxi = "availTaxes";
             foreach (${$oplkjyxi} as ${${"GLOBALS"}["wfuwxbmiwytq"]}) {
                 $psuluqnb = "request_tax_name";
                 $enefpgduf = "tax";
                 ${"GLOBALS"}["wxlvsgkcw"] = "request_tax_name";
                 ${${"GLOBALS"}["hvjpdk"]} = ${$enefpgduf}["taxname"];
                 ${${"GLOBALS"}["wxlvsgkcw"]} = ${${"GLOBALS"}["hvjpdk"]} . "_group_percentage";
                 $lifliipv = "request_tax_name";
                 $_REQUEST[${${"GLOBALS"}["hwivgkl"]}] = isset($this->_groupTax[${${"GLOBALS"}["hwivgkl"]}]) ? $this->_groupTax[${$psuluqnb}] : 0;
                 $bltbxkcxbjyp = "tmpTaxValue";
                 ${${"GLOBALS"}["fvbuscvwjf"]} = $_REQUEST["total"] * ($_REQUEST[${$lifliipv}] / 100);
                 ${${"GLOBALS"}["zjswudci"]} += ${$bltbxkcxbjyp};
             }
             $_REQUEST["total"] += ${${"GLOBALS"}["yirabwmnwgyp"]};
         }
         $_REQUEST["shipping_handling_charge"] = $this->_shippingCost;
         ${${"GLOBALS"}["cxnjuagap"]} = 0;
         $bbluqvmmcrl = "tax";
         foreach (${$mdwcbjhvim} as ${$bbluqvmmcrl}) {
             $rbwcrso = "request_tax_name";
             ${"GLOBALS"}["woxvppdlct"] = "tmpTaxValue";
             $xeqhidsvg = "shipTaxValue";
             ${"GLOBALS"}["rihoezbjibn"] = "tax_name";
             ${${"GLOBALS"}["rihoezbjibn"]} = ${${"GLOBALS"}["wfuwxbmiwytq"]}["taxname"];
             ${$rbwcrso} = ${${"GLOBALS"}["hvjpdk"]} . "_sh_percent";
             $uaabpfjmwc = "request_tax_name";
             $_REQUEST["sh" . ${${"GLOBALS"}["hwivgkl"]}] = isset($this->_shipTaxes[${${"GLOBALS"}["hwivgkl"]}]) ? $this->_shipTaxes[${${"GLOBALS"}["hwivgkl"]}] : 0;
             ${${"GLOBALS"}["fvbuscvwjf"]} = $_REQUEST["shipping_handling_charge"] * ($_REQUEST["sh" . ${$uaabpfjmwc}] / 100);
             ${$xeqhidsvg} += ${${"GLOBALS"}["woxvppdlct"]};
         }
         $_REQUEST["total"] += ${${"GLOBALS"}["ouawiowlgku"]} + $_REQUEST["shipping_handling_charge"];
         $_REQUEST["adjustment"] = floatval($this->get("txtAdjustment"));
         $_REQUEST["total"] += $_REQUEST["adjustment"];
         ${$nxxrnbh} = $this->getInternalObject();
         $intObject->mode = "edit";
         $intObject->isLineItemUpdate = true;
         @saveInventoryProductDetails(${$klivirms}, $this->getModuleName());
         for (${${"GLOBALS"}["jsntgvnqkf"]} = 1; ${${"GLOBALS"}["jsntgvnqkf"]} <= count($this->_listitems); ${$qwpblm}++) {
             ${"GLOBALS"}["xzgznik"] = "values";
             ${${"GLOBALS"}["xzgznik"]} = array();
             $dqnotemwlbq = "params";
             ${$dqnotemwlbq} = array();
             foreach (${${"GLOBALS"}["ogvkpmc"]} as ${${"GLOBALS"}["nctgtuliixp"]}) {
                 ${"GLOBALS"}["fjordnwx"] = "values";
                 ${${"GLOBALS"}["fjordnwx"]}[] = "`" . ${${"GLOBALS"}["nctgtuliixp"]} . "` = ?";
                 ${${"GLOBALS"}["tjyzhfdvth"]}[] = $this->_listitems[${${"GLOBALS"}["jsntgvnqkf"]} - 1][${${"GLOBALS"}["nctgtuliixp"]}];
             }
             if (count(${${"GLOBALS"}["ibmlnecaubpt"]}) > 0) {
                 $nvtwyqcc = "params";
                 $wbzhsv = "i";
                 $glpeqaibe = "params";
                 ${${"GLOBALS"}["tjyzhfdvth"]}[] = $this->getId();
                 $mjhhtobppu = "sql";
                 ${$nvtwyqcc}[] = ${$wbzhsv};
                 ${${"GLOBALS"}["hdblop"]} = "UPDATE vtiger_inventoryproductrel SET " . implode(",", ${${"GLOBALS"}["ibmlnecaubpt"]}) . " WHERE id = ? AND sequence_no = ?";
                 $adb->pquery(${$mjhhtobppu}, ${$glpeqaibe});
             }
         }
     }
     if (!empty(${${"GLOBALS"}["xkutivbm"]})) {
         $wrqjvjvs = "update_query";
         ${"GLOBALS"}["ryhoienvnsn"] = "cur_sym_rate";
         $xepbzcbhw = "update_params";
         ${"GLOBALS"}["ohiigcodbwo"] = "conversion_rate";
         $pcrolhc = "currency_id";
         ${"GLOBALS"}["udferc"] = "conversion_rate";
         $fkgwwhoop = "intObject";
         ${"GLOBALS"}["nglnmk"] = "update_query";
         ${"GLOBALS"}["nvezfxsotm"] = "currency_id";
         if (strpos(${${"GLOBALS"}["nvezfxsotm"]}, "x") !== false) {
             ${"GLOBALS"}["twtpeleg"] = "parts";
             ${${"GLOBALS"}["bbeqpsqwehf"]} = explode("x", ${${"GLOBALS"}["xkutivbm"]});
             ${${"GLOBALS"}["xkutivbm"]} = ${${"GLOBALS"}["twtpeleg"]}[1];
         } else {
             ${"GLOBALS"}["kuscdvfpt"] = "currency_id";
             ${${"GLOBALS"}["kuscdvfpt"]} = ${${"GLOBALS"}["xkutivbm"]};
         }
         $ksoimju = "cur_sym_rate";
         ${$ksoimju} = getCurrencySymbolandCRate(${${"GLOBALS"}["xkutivbm"]});
         ${${"GLOBALS"}["ohiigcodbwo"]} = ${${"GLOBALS"}["ryhoienvnsn"]}["rate"];
         ${"GLOBALS"}["epcnplti"] = "update_params";
         ${$fkgwwhoop} = $this->getInternalObject();
         ${$wrqjvjvs} = "update " . $intObject->table_name . " set currency_id = ?, conversion_rate = ? WHERE " . $intObject->table_index . " = ?";
         ${$xepbzcbhw} = array(${$pcrolhc}, ${${"GLOBALS"}["udferc"]}, $this->_id);
         $adb->pquery(${${"GLOBALS"}["nglnmk"]}, ${${"GLOBALS"}["epcnplti"]});
     }
     if (file_exists(vglobal("root_directory") . DIRECTORY_SEPARATOR . "modules" . DIRECTORY_SEPARATOR . "Invoice" . DIRECTORY_SEPARATOR . "InvoiceHandler.php")) {
         ${"GLOBALS"}["hebripdxg"] = "entityData";
         ${"GLOBALS"}["llplslhg"] = "adb";
         require_once "modules/Invoice/InvoiceHandler.php";
         require_once "include/events/VTEventHandler.inc";
         require_once "data/VTEntityDelta.php";
         ${${"GLOBALS"}["hebripdxg"]} = \VTEntityData::fromEntityId(${${"GLOBALS"}["llplslhg"]}, $this->getId(), $this->getModuleName());
         $omsgxnkjeni = "handler";
         ${$omsgxnkjeni} = new \InvoiceHandler();
         $handler->handleEvent("vtiger.entity.aftersave", ${${"GLOBALS"}["xxguhqgid"]});
     }
     $this->afterTransfer();
     $this->_data = false;
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:101,代码来源:VTInventoryEntity.php


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