[Vtigercrm-commits] [vtiger-commits] r10182 - in /vtigercrm/branches/5.0.3: Smarty/templates/Inventory/ProductDetailsEditView.tpl include/utils/EditViewUtils.php include/utils/InventoryUtils.php schema/DatabaseSchema.xml

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Feb 14 02:36:19 EST 2007


Author: saraj
Date: Wed Feb 14 00:36:09 2007
New Revision: 10182

Log:
fix for Product Description at Quotes, Sales and Purchase orders, Invoices not stored -- Minnie

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetailsEditView.tpl
    vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php
    vtigercrm/branches/5.0.3/include/utils/InventoryUtils.php
    vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml

Modified: vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetailsEditView.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetailsEditView.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetailsEditView.tpl Wed Feb 14 00:36:09 2007
@@ -132,6 +132,7 @@
 	{assign var="hdnProductId" value="hdnProductId"|cat:$row_no}
 	{assign var="productName" value="productName"|cat:$row_no}
 	{assign var="comment" value="comment"|cat:$row_no}
+	{assign var="productDescription" value="productDescription"|cat:$row_no}
 	{assign var="qtyInStock" value="qtyInStock"|cat:$row_no}
 	{assign var="qty" value="qty"|cat:$row_no}
 	{assign var="listPrice" value="listPrice"|cat:$row_no}
@@ -169,6 +170,7 @@
 			<td class="small" valign="top">
 				<input type="text" id="{$productName}" name="{$productName}" value="{$data.$productName}" class="small" readonly />
 				<input type="hidden" id="{$hdnProductId}" name="{$hdnProductId}" value="{$data.$hdnProductId}">
+				<input type="hidden" id="{$productDescription}" name="{$productDescription}" value="{$data.$productDescription}">
 				<img src="{$IMAGE_PATH}search.gif" style="cursor: pointer;" align="absmiddle" onclick="productPickList(this,'{$MODULE}','{$row_no}')" />
 			</td>
 		   </tr>

Modified: vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Wed Feb 14 00:36:09 2007
@@ -1350,19 +1350,19 @@
 	
 	if($module == 'Quotes')
 	{
-		$query="select vtiger_products.productname, vtiger_products.product_description, vtiger_products.unit_price, vtiger_products.qtyinstock, vtiger_inventoryproductrel.* from vtiger_inventoryproductrel inner join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid where id=".$focus->id." ORDER BY sequence_no";
+		$query="select vtiger_products.productname, vtiger_products.unit_price, vtiger_products.qtyinstock, vtiger_inventoryproductrel.listprice, vtiger_inventoryproductrel.description as product_description, vtiger_inventoryproductrel.productid, vtiger_inventoryproductrel.comment,vtiger_inventoryproductrel.quantity from vtiger_inventoryproductrel inner join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid where id=".$focus->id." ORDER BY sequence_no";
 	}
 	elseif($module == 'PurchaseOrder')
 	{
-		$query="select vtiger_products.productname, vtiger_products.product_description, vtiger_products.unit_price, vtiger_products.qtyinstock, vtiger_inventoryproductrel.* from vtiger_inventoryproductrel inner join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid where id=".$focus->id." ORDER BY sequence_no";
+		$query="select vtiger_products.productname, vtiger_products.unit_price, vtiger_products.qtyinstock, vtiger_inventoryproductrel.listprice, vtiger_inventoryproductrel.description as product_description, vtiger_inventoryproductrel.productid, vtiger_inventoryproductrel.comment,vtiger_inventoryproductrel.quantity from vtiger_inventoryproductrel inner join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid where id=".$focus->id." ORDER BY sequence_no";
 	}
 	elseif($module == 'SalesOrder')
 	{
-		$query="select vtiger_products.productname, vtiger_products.product_description, vtiger_products.unit_price, vtiger_products.qtyinstock, vtiger_inventoryproductrel.* from vtiger_inventoryproductrel inner join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid where id=".$focus->id." ORDER BY sequence_no";
+		$query="select vtiger_products.productname, vtiger_products.unit_price, vtiger_products.qtyinstock, vtiger_inventoryproductrel.listprice, vtiger_inventoryproductrel.description as product_description, vtiger_inventoryproductrel.productid, vtiger_inventoryproductrel.comment,vtiger_inventoryproductrel.quantity from vtiger_inventoryproductrel inner join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid where id=".$focus->id." ORDER BY sequence_no";
 	}
 	elseif($module == 'Invoice')
 	{
-		$query="select vtiger_products.productname, vtiger_products.product_description, vtiger_products.unit_price, vtiger_products.qtyinstock, vtiger_inventoryproductrel.* from vtiger_inventoryproductrel inner join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid where id=".$focus->id." ORDER BY sequence_no";
+		$query="select vtiger_products.productname, vtiger_products.unit_price, vtiger_products.qtyinstock, vtiger_inventoryproductrel.listprice, vtiger_inventoryproductrel.description as product_description, vtiger_inventoryproductrel.productid, vtiger_inventoryproductrel.comment,vtiger_inventoryproductrel.quantity from vtiger_inventoryproductrel inner join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid where id=".$focus->id." ORDER BY sequence_no";
 	}
 	elseif($module == 'Potentials')
 	{

Modified: vtigercrm/branches/5.0.3/include/utils/InventoryUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/InventoryUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/InventoryUtils.php Wed Feb 14 00:36:09 2007
@@ -497,6 +497,13 @@
 	for($i=1; $i<=$tot_no_prod; $i++)
 	{
 	        $prod_id = $_REQUEST['hdnProductId'.$i];
+		if(isset($_REQUEST['productDescription'.$i]))
+			$description = $_REQUEST['productDescription'.$i];
+		else{
+			$desc_duery = "select vtiger_products.product_description from vtiger_products where vtiger_products.productid=".$prod_id;
+			$desc_res = $adb->query($desc_duery);
+			$description = $adb->query_result($desc_res,0,"product_description");
+		}	
 	        $qty = $_REQUEST['qty'.$i];
 	        $listprice = $_REQUEST['listPrice'.$i];
 		$listprice = getConvertedPrice($listprice);//convert the listPrice into $
@@ -524,7 +531,7 @@
 			}
 		}
 
-		$query ="insert into vtiger_inventoryproductrel(id, productid, sequence_no, quantity, listprice, comment) values($focus->id, $prod_id , $prod_seq, $qty, $listprice, '$comment')";
+		$query ="insert into vtiger_inventoryproductrel(id, productid, sequence_no, quantity, listprice, comment, description) values($focus->id, $prod_id , $prod_seq, $qty, $listprice, '$comment','$description')";
 		$prod_seq++;
 		$adb->query($query);
 

Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml
==============================================================================
--- vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml (original)
+++ vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Wed Feb 14 00:36:09 2007
@@ -6052,6 +6052,7 @@
 		<field name="discount_percent" type="N" size="7.3" />
 		<field name="discount_amount" type="N" size="7.3" />
 		<field name="comment" type="C" size="100" />
+		<field name="description" type="X" />
 
 		<index name="inventoryproductrel_id_idx">
 			<col>id</col>





More information about the vtigercrm-commits mailing list