[Vtigercrm-commits] [vtiger-commits] r11112 - /vtigercrm/branches/5.0.3/modules/Products/EditView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue May 29 03:25:37 EDT 2007


Author: richie
Date: Tue May 29 01:25:34 2007
New Revision: 11112

Log:
* Changes made the load the product associated taxes when we duplicate the product

Modified:
    vtigercrm/branches/5.0.3/modules/Products/EditView.php

Modified: vtigercrm/branches/5.0.3/modules/Products/EditView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Products/EditView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Products/EditView.php Tue May 29 01:25:34 2007
@@ -123,7 +123,17 @@
 
 //Tax handling (get the available taxes only) - starts
 if($focus->mode == 'edit')
-	$tax_details = getTaxDetailsForProduct($focus->id,'available_associated');
+{
+	$retrieve_taxes = true;
+	$productid = $focus->id;
+	$tax_details = getTaxDetailsForProduct($productid,'available_associated');
+}
+elseif($_REQUEST['isDuplicate'] == 'true')
+{
+	$retrieve_taxes = true;
+	$productid = $_REQUEST['record'];
+	$tax_details = getTaxDetailsForProduct($productid,'available_associated');
+}
 else
 	$tax_details = getAllTaxes('available');
 
@@ -133,11 +143,12 @@
 	$tax_details[$i]['check_value'] = 0;
 }
 
-if($focus->mode == 'edit')
+//For Edit and Duplicate we have to retrieve the product associated taxes and show them
+if($retrieve_taxes)
 {
 	for($i=0;$i<count($tax_details);$i++)
 	{
-		$tax_value = getProductTaxPercentage($tax_details[$i]['taxname'],$focus->id);
+		$tax_value = getProductTaxPercentage($tax_details[$i]['taxname'],$productid);
 		$tax_details[$i]['percentage'] = $tax_value;
 		$tax_details[$i]['check_value'] = 1;
 		//if the tax is not associated with the product then we should get the default value and unchecked





More information about the vtigercrm-commits mailing list