[Vtigercrm-commits] [vtiger-commits] r6168 - /vtigercrm/trunk/data/CRMEntity.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu May 18 17:15:57 EDT 2006


Author: saraj
Date: Thu May 18 15:15:53 2006
New Revision: 6168

Log:
* Added code to delete the existing tax entries from producttaxrel when edit and save the product

Modified:
    vtigercrm/trunk/data/CRMEntity.php

Modified: vtigercrm/trunk/data/CRMEntity.php
==============================================================================
--- vtigercrm/trunk/data/CRMEntity.php (original)
+++ vtigercrm/trunk/data/CRMEntity.php Thu May 18 15:15:53 2006
@@ -1394,6 +1394,17 @@
 
 		$tax_per = '';
 		//Save the Product - VAT tax relationship if VAT tax check box is enabled
+		//Delete the existing tax if any
+		if($this->mode == 'edit')
+		{
+			$tax_array = Array('VAT','Sales','Service');
+			foreach($tax_array as $tax_type)
+			{
+				$taxid = getTaxId($tax_type);
+				$sql = "delete from producttaxrel where productid=$this->id and taxid=$taxid";
+				$adb->query($sql);
+			}
+		}
 		if($_REQUEST['vat_check'] == 'on' || $_REQUEST['vat_check'] == 1)
 		{
 			$taxid = getTaxId('VAT');





More information about the vtigercrm-commits mailing list