[Vtigercrm-commits] [vtiger-commits] r6395 - in /vtigercrm/trunk: Smarty/templates/InventoryCreateView.tpl modules/Invoice/EditView.php modules/SalesOrder/EditView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed May 24 17:57:17 EDT 2006


Author: saraj
Date: Wed May 24 15:57:11 2006
New Revision: 6395

Log:
* Modified to display the product details of the related parent when we create new Invoice or salesorder from quotes or SO detailview and to get the products when select quote in new SO page

Modified:
    vtigercrm/trunk/Smarty/templates/InventoryCreateView.tpl
    vtigercrm/trunk/modules/Invoice/EditView.php
    vtigercrm/trunk/modules/SalesOrder/EditView.php

Modified: vtigercrm/trunk/Smarty/templates/InventoryCreateView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/InventoryCreateView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/InventoryCreateView.tpl Wed May 24 15:57:11 2006
@@ -137,7 +137,13 @@
 								   {if $divName eq 'basicTab'}
 								   {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'}
 								   	<!-- Added to display the product details -->
-									{include file="ProductDetails.tpl"}
+									<!-- This if is added when we want to populate product details from the related entity  for ex. populate product details in new SO page when select Quote -->
+									{if $AVAILABLE_PRODUCTS eq true}
+										{include file="ProductDetailsEditView.tpl"}
+									{else}
+										{include file="ProductDetails.tpl"}
+									{/if}
+
 								   {/if}
 								   {/if}
 

Modified: vtigercrm/trunk/modules/Invoice/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/EditView.php (original)
+++ vtigercrm/trunk/modules/Invoice/EditView.php Wed May 24 15:57:11 2006
@@ -46,7 +46,16 @@
 	$quote_focus->id = $quoteid;
 	$quote_focus->retrieve_entity_info($quoteid,"Quotes");
 	$focus = getConvertQuoteToInvoice($focus,$quote_focus,$quoteid);
-			
+
+	//Added to display the Quote's associated products -- when we create invoice from Quotes DetailView 
+	$associated_prod = getAssociatedProducts("Quotes",$quote_focus);
+	$smarty->assign("ASSOCIATEDPRODUCTS", $associated_prod);
+	$smarty->assign("MODE", $quote_focus->mode);
+	$smarty->assign("TAXVALUE", $quote_focus->column_fields['txtTax']);
+	$smarty->assign("ADJUSTMENTVALUE", $quote_focus->column_fields['txtAdjustment']);
+	$smarty->assign("SUBTOTAL", $quote_focus->column_fields['hdnSubTotal']);
+	$smarty->assign("GRANDTOTAL", $quote_focus->column_fields['hdnGrandTotal']);
+	$smarty->assign("AVAILABLE_PRODUCTS", 'true');
     }
     elseif(isset($_REQUEST['convertmode']) &&  $_REQUEST['convertmode'] == 'sotoinvoice')
     {
@@ -55,6 +64,16 @@
         $so_focus->id = $soid;
         $so_focus->retrieve_entity_info($soid,"SalesOrder");
         $focus = getConvertSoToInvoice($focus,$so_focus,$soid);
+
+	//Added to display the SalesOrder's associated products -- when we create invoice from SO DetailView
+	$associated_prod = getAssociatedProducts("SalesOrder",$so_focus);
+	$smarty->assign("ASSOCIATEDPRODUCTS", $associated_prod);
+	$smarty->assign("MODE", $so_focus->mode);
+	$smarty->assign("TAXVALUE", $so_focus->column_fields['txtTax']);
+	$smarty->assign("ADJUSTMENTVALUE", $so_focus->column_fields['txtAdjustment']);
+	$smarty->assign("SUBTOTAL", $so_focus->column_fields['hdnSubTotal']);
+	$smarty->assign("GRANDTOTAL", $so_focus->column_fields['hdnGrandTotal']);
+	$smarty->assign("AVAILABLE_PRODUCTS", 'true');
 
     }
     elseif(isset($_REQUEST['convertmode']) &&  $_REQUEST['convertmode'] == 'potentoinvoice')

Modified: vtigercrm/trunk/modules/SalesOrder/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/EditView.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/EditView.php Wed May 24 15:57:11 2006
@@ -47,6 +47,17 @@
 	$quote_focus->retrieve_entity_info($quoteid,"Quotes");
 	$focus = getConvertQuoteToSoObject($focus,$quote_focus,$quoteid);
 	$focus->id = $quoteid;
+
+	//Added to display the Quotes's associated products -- when we create SO from Quotes DetailView 
+	$associated_prod = getAssociatedProducts("Quotes",$quote_focus);
+	$smarty->assign("ASSOCIATEDPRODUCTS", $associated_prod);
+	$smarty->assign("MODE", $quote_focus->mode);
+	$smarty->assign("TAXVALUE", $quote_focus->column_fields['txtTax']);
+	$smarty->assign("ADJUSTMENTVALUE", $quote_focus->column_fields['txtAdjustment']);
+	$smarty->assign("SUBTOTAL", $quote_focus->column_fields['hdnSubTotal']);
+	$smarty->assign("GRANDTOTAL", $quote_focus->column_fields['hdnGrandTotal']);
+	$smarty->assign("AVAILABLE_PRODUCTS", 'true');
+
     }
     elseif(isset($_REQUEST['convertmode']) &&  $_REQUEST['convertmode'] == 'update_quote_val')
     {
@@ -111,6 +122,20 @@
 		$quote_focus->id = $quoteid;
 		$quote_focus->retrieve_entity_info($quoteid,"Quotes");
 		$focus = getConvertQuoteToSoObject($focus,$quote_focus,$quoteid);
+
+		//Added to display the Quotes's associated products -- when we select Quote in New SO page
+		if(isset($_REQUEST['quote_id']) && $_REQUEST['quote_id'] !='')
+		{
+			$associated_prod = getAssociatedProducts("Quotes",$quote_focus,$focus->column_fields['quote_id']);
+		}
+
+		$smarty->assign("ASSOCIATEDPRODUCTS", $associated_prod);
+		$smarty->assign("MODE", $quote_focus->mode);
+		$smarty->assign("TAXVALUE", $quote_focus->column_fields['txtTax']);
+		$smarty->assign("ADJUSTMENTVALUE", $quote_focus->column_fields['txtAdjustment']);
+		$smarty->assign("SUBTOTAL", $quote_focus->column_fields['hdnSubTotal']);
+		$smarty->assign("GRANDTOTAL", $quote_focus->column_fields['hdnGrandTotal']);
+		$smarty->assign("AVAILABLE_PRODUCTS", 'true');
 	}
 }
 





More information about the vtigercrm-commits mailing list