[Vtigercrm-commits] [vtiger-commits] r9890 - in /vtigercrm/branches/5.0.3/modules: Invoice/Invoice.php PurchaseOrder/PurchaseOrder.php Quotes/Quotes.php Quotes/Save.php SalesOrder/SalesOrder.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Nov 22 02:15:30 EST 2006
Author: richie
Date: Wed Nov 22 00:15:22 2006
New Revision: 9890
Log:
* Added condition to avoid calling the function saveInventoryProductDetails in ajax save , Fixes #2632
Modified:
vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php
vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php
vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php
vtigercrm/branches/5.0.3/modules/Quotes/Save.php
vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php
Modified: vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php (original)
+++ vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php Wed Nov 22 00:15:22 2006
@@ -107,8 +107,13 @@
$query1 = "update vtiger_salesorder set sostatus='Approved' where salesorderid=".$so_id;
$this->db->query($query1);
}
- //Based on the total Number of rows we will save the product relationship with this entity
- saveInventoryProductDetails(&$this, 'Invoice');
+
+ //in ajax save we should not call this function, because this will delete all the existing product values
+ if($_REQUEST['action'] != 'InvoiceAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW')
+ {
+ //Based on the total Number of rows we will save the product relationship with this entity
+ saveInventoryProductDetails(&$this, 'Invoice');
+ }
}
Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php (original)
+++ vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php Wed Nov 22 00:15:22 2006
@@ -98,8 +98,12 @@
function save_module($module)
{
- //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 save we should not call this function, because this will delete all the existing product values
+ if($_REQUEST['action'] != 'PurchaseOrderAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW')
+ {
+ //Based on the total Number of rows we will save the product relationship with this entity
+ saveInventoryProductDetails(&$this, 'PurchaseOrder', $this->update_prod_stock);
+ }
}
Modified: vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php (original)
+++ vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Wed Nov 22 00:15:22 2006
@@ -109,6 +109,12 @@
function save_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')
+ {
+ //Based on the total Number of rows we will save the product relationship with this entity
+ saveInventoryProductDetails(&$this, 'Quotes');
+ }
}
/** Function used to get the sort order for Quote listview
Modified: vtigercrm/branches/5.0.3/modules/Quotes/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Quotes/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Quotes/Save.php Wed Nov 22 00:15:22 2006
@@ -28,23 +28,10 @@
$local_log =& LoggerManager::getLogger('index');
-global $log,$current_user;
-$currencyid=fetchCurrency($current_user->id);
-$rate_symbol = getCurrencySymbolandCRate($currencyid);
-$rate = $rate_symbol['rate'];
-$log->debug("Inside Quote Save");
-
$focus = new Quotes();
-
setObjectValuesFromRequest(&$focus);
-$log->debug("The Field Value Array -----> ".$focus->column_fields);
$focus->save("Quotes");
-
-
-//Based on the total Number of rows we will save the product relationship with this entity
-saveInventoryProductDetails(&$focus, 'Quotes');
-
$return_id = $focus->id;
Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php (original)
+++ vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php Wed Nov 22 00:15:22 2006
@@ -118,10 +118,12 @@
$this->db->query($query1);
}
- //Based on the total Number of rows we will save the product relationship with this entity
- saveInventoryProductDetails(&$this, 'SalesOrder');
-
-
+ //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')
+ {
+ //Based on the total Number of rows we will save the product relationship with this entity
+ saveInventoryProductDetails(&$this, 'SalesOrder');
+ }
}
/** Function used to get the sort order for Sales Order listview
More information about the vtigercrm-commits
mailing list