[Vtigercrm-commits] [vtiger-commits] r6721 - in /vtigercrm/trunk: Smarty/templates/Inventory/ include/js/ include/utils/ modules/Invoice/ modules/Migration/ModifyDatabase/ modules/PurchaseOrder/ modules/Quotes/ modules/SalesOrder/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon May 29 18:25:47 EDT 2006


Author: saraj
Date: Mon May 29 16:25:34 2006
New Revision: 6721

Log:
* Modified to handle the inventory add products

Modified:
    vtigercrm/trunk/Smarty/templates/Inventory/ProductDetails.tpl
    vtigercrm/trunk/Smarty/templates/Inventory/ProductDetailsEditView.tpl
    vtigercrm/trunk/include/js/Inventory.js
    vtigercrm/trunk/include/utils/DetailViewUtils.php
    vtigercrm/trunk/include/utils/EditViewUtils.php
    vtigercrm/trunk/modules/Invoice/Save.php
    vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php
    vtigercrm/trunk/modules/PurchaseOrder/Save.php
    vtigercrm/trunk/modules/Quotes/Save.php
    vtigercrm/trunk/modules/SalesOrder/Save.php

Modified: vtigercrm/trunk/Smarty/templates/Inventory/ProductDetails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/ProductDetails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/ProductDetails.tpl Mon May 29 16:25:34 2006
@@ -67,17 +67,17 @@
 				<!-- This div is added to display the tax informations -->
 				<div id="tax_Lay1" style="width:93%;position:relative;border:1px dotted #CCCCCC;display:none;background-color:#FFFFCC;top:5px;padding:5px;" align="center">
 					<table width="100%" border="0" cellpadding="0" cellspacing="0" class="small">
-					   <tr id="row1">
+					   <tr id="vatrow1">
 						<td align="left" width="40%" style="border:0px solid red;"><input type="text" id="txtVATTax1" name="txtVATTax1" class="txtBox" onBlur="ValidateTax('txtVATTax1'); calcTotal(this);"/>%&nbsp;</td>
 						<td width="20%" align="right" style="border:0px solid red;">&nbsp;{$APP.LBL_VAT}</td>
 						<td align="left" width="40%" style="border:0px solid red;"><input type="text" id="txtVATTaxTotal1" name="txtVATTaxTotal1" class="txtBox" onBlur="ValidateTax('txtVATTaxTotal1'); calcTotal(this);"/></td>
 					   </tr>
-					   <tr id="row1">
+					   <tr id="salesrow1">
 						<td align="left" style="border:0px solid red;"><input type="text" id="txtSalesTax1" name="txtSalesTax1" class="txtBox" onBlur="ValidateTax('txtSalesTax1'); calcTotal(this);"/>%&nbsp;</td>
 						<td align="right" style="border:0px solid red;">&nbsp;{$APP.LBL_SALES}</td>
 						<td align="left" style="border:0px solid red;"><input type="text" id="txtSalesTaxTotal1" name="txtSalesTaxTotal1" class="txtBox" onBlur="ValidateTax('txtSalesTaxTotal1'); calcTotal(this);"/></td>
 					   </tr>
-					   <tr id="row1">
+					   <tr id="servicerow1">
 						<td align="left" style="border:0px solid red;"><input type="text" id="txtServiceTax1" name="txtServiceTax1" class="txtBox" onBlur="ValidateTax('txtServiceTax1'); calcTotal(this);"/>%&nbsp;</td>
 						<td align="right" style="border:0px solid red;">&nbsp;{$APP.LBL_SERVICE}</td>
 						<td align="left" style="border:0px solid red;"><input type="text" id="txtServiceTaxTotal1" name="txtServiceTaxTotal1" class="txtBox" onBlur="ValidateTax('txtServiceTaxTotal1'); calcTotal(this);"/></td>

Modified: vtigercrm/trunk/Smarty/templates/Inventory/ProductDetailsEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/ProductDetailsEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/ProductDetailsEditView.tpl Mon May 29 16:25:34 2006
@@ -1,170 +1,175 @@
-{*<!--
-
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is:  vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
-*
- ********************************************************************************/
-
--->*}
-
-<script type="text/javascript" src="include/js/Inventory.js"></script>
-<script type="text/javascript" src="include/js/general.js"></script>
-<!-- Added to display the Product Details -->
-		<table class="prdTab small"  border="0" cellspacing="0" cellpadding="2" id="proTab">
-		   <tr>
-			<th colspan="8" class="detailedViewHeader">
-				<b>{$APP.LBL_PRODUCT_DETAILS}</b>
-			</th>
-		   </tr>
-		   <tr>
-			<th width="20%"><font color='red'>*</font>{$APP.LBL_PRODUCT}</th>
-
-			{if $MODULE eq 'Quotes' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
-			   <th width="8%" nowrap>{$APP.LBL_QTY_IN_STOCK}</th>
-			{/if}
-
-			<th width="8%"><font color='red'>*</font>{$APP.LBL_QTY}</th>
-			<th width="10%">{$APP.LBL_UNIT_PRICE}</th>
-			<th width="15%"><font color='red'>*</font>{$APP.LBL_LIST_PRICE}</th>
-			<th width="24%">{$APP.LBL_TAX_CALCULATION}</th>
-			<th width="10%">{$APP.LBL_TOTAL}</th>
-
-			<th width="5%">&nbsp;</th>
-		   </tr>
-
-		   {foreach key=row_no item=data from=$ASSOCIATEDPRODUCTS}
-			{assign var="txtProduct" value="txtProduct"|cat:$row_no}
-			{assign var="qtyInStock" value="qtyInStock"|cat:$row_no}
-			{assign var="txtQty" value="txtQty"|cat:$row_no}
-			{assign var="unitPrice" value="unitPrice"|cat:$row_no}
-			{assign var="txtListPrice" value="txtListPrice"|cat:$row_no}
-			{assign var="total" value="total"|cat:$row_no}
-			{assign var="hdnProductId" value="hdnProductId"|cat:$row_no}
-			{assign var="hdnRowStatus" value="hdnRowStatus"|cat:$row_no}
-			{assign var="hdnTotal" value="hdnTotal"|cat:$row_no}
-
-			{assign var="txtVATTax" value="txtVATTax"|cat:$row_no}
-			{assign var="txtSalesTax" value="txtSalesTax"|cat:$row_no}
-			{assign var="txtServiceTax" value="txtServiceTax"|cat:$row_no}
-
-		   <tr id="row{$row_no}" class="dvtCellLabel">
-			<td nowrap valign="top">
-				<input type="text" name="{$txtProduct}" value="{$data.$txtProduct}" class="detailedViewProdTextBox" readonly />&nbsp;<img src="themes/blue/images/search.gif" style="cursor: pointer;" align="absmiddle" onclick="productPickList(this,'{$MODULE}')" />
-			</td>
-
-			{if $MODULE eq 'Quotes' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
-			   <td style="padding:3px;" valign="top"><div id="{$qtyInStock}">{$data.$qtyInStock}</div>&nbsp;</td>
-			{/if}
-
-			<td valign="top">
-				<input type="text" name="{$txtQty}" value="{$data.$txtQty}" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onBlur="FindDuplicate(); settotalnoofrows(); calcTotal(this)" />
-			</td>
-			<td style="padding:3px;" valign="top">
-				<div id="{$unitPrice}">{$data.$unitPrice}</div>&nbsp;
-			</td>
-			<td nowrap valign="top">
-				<input type="text" name="{$txtListPrice}" value="{$data.$txtListPrice}" class="detailedViewProdTextBox" readonly onBlur="FindDuplicate(); settotalnoofrows(); calcTotal(this)"/>&nbsp;
-				<img src="themes/blue/images/pricebook.gif" onclick="priceBookPickList(this)" style="cursor: pointer;" title="Price Book" align="absmiddle" />
-			</td>
-			<!-- Added for Tax calculation-->
-			<td valign="top" style="padding-bottom:5px;">
-				<input type="text" id="txtTaxTotal{$row_no}" name="txtTaxTotal{$row_no}" value="" class="detailedViewTextBox" style="width:65%;">
-				<input type="hidden" id="hdnTaxTotal{$row_no}" name="hdnTaxTotal{$row_no}">
-				&nbsp;<input type="button" name="showTax" value=" ... "  class="classBtnSmall"  onclick="fnshow_Hide('tax_Lay{$row_no}');">
-
-				<!-- This div is added to display the tax informations -->
-				<div id="tax_Lay{$row_no}" style="width:93%;position:relative;border:1px dotted #CCCCCC;display:none;background-color:#FFFFCC;top:5px;padding:5px;" align="center">
-					<table width="100%" border="0" cellpadding="2" cellspacing="0" class="small">
-					   <tr id="row{$row_no}">
-						<td align="left" width="40%" style="border:0px solid red;"><input type="text" id="txtVATTax{$row_no}" name="txtVATTax{$row_no}" class="txtBox" value="{$data.$txtVATTax}" onBlur="ValidateTax('txtVATTax{$row_no}'); calcTotal(this);"/>%&nbsp;</td>
-						<td width="20%" align="right" style="border:0px solid red;">{$APP.LBL_VAT}</td>
-						<td align="left" width="40%" style="border:0px solid red;"><input type="text" id="txtVATTaxTotal{$row_no}" name="txtVATTaxTotal{$row_no}" class="txtBox" value="" onBlur="ValidateTax('txtVATTaxTotal{$row_no}'); calcTotal(this);"/></td>
-					   </tr>
-					   <tr id="row{$row_no}">
-						<td align="left" style="border:0px solid red;"><input type="text" id="txtSalesTax{$row_no}" name="txtSalesTax{$row_no}" class="txtBox" value="{$data.$txtSalesTax}" onBlur="ValidateTax('txtSalesTax{$row_no}'); calcTotal(this);"/>%&nbsp;</td>
-						<td  align="right" style="border:0px solid red;">{$APP.LBL_SALES}</td>
-						<td align="left" style="border:0px solid red;"><input type="text" id="txtSalesTaxTotal{$row_no}" name="txtSalesTaxTotal{$row_no}" class="txtBox" value="" onBlur="ValidateTax('txtSalesTaxTotal{$row_no}'); calcTotal(this);"/></td>
-					   </tr>
-					   <tr id="row{$row_no}">
-						<td align="left" style="border:0px solid red;"><input type="text" id="txtServiceTax{$row_no}" name="txtServiceTax{$row_no}" class="txtBox" value="{$data.$txtServiceTax}" onBlur="ValidateTax('txtServiceTax{$row_no}'); calcTotal(this);"/>%&nbsp;</td>
-						<td align="right" style="border:0px solid red;">{$APP.LBL_SERVICE}</td>
-						<td align="left" style="border:0px solid red;"><input type="text" id="txtServiceTaxTotal{$row_no}" name="txtServiceTaxTotal{$row_no}" class="txtBox" value="" onBlur="ValidateTax('txtServiceTaxTotal{$row_no}'); calcTotal(this);"/></td>
-					   </tr>
-					</table>
-				</div>
-				<!-- This above div is added to display the tax informations --> 
-
-
-			<td style="padding:3px;" valign="top">
-				<div id="{$total}" align="right">{$data.$total}</div>&nbsp;
-			</td>
-			<td valign="top">
-				<input type="hidden" id="{$hdnProductId}" name="{$hdnProductId}" value="{$data.$hdnProductId}">
-				<input type="hidden" id="{$hdnRowStatus}" name="{$hdnRowStatus}">
-				<input type="hidden" id="{$hdnTotal}" name="{$hdnTotal}" value="{$data.$hdnTotal}">&nbsp;
-			</td>
-		   </tr>
-		   {/foreach}
-		</table>
-	</td>
-   </tr>
-   <tr>
-	<td colspan=4>
-		<table width="100%" border="0" cellspacing="0" cellpadding="0">
-		   <tr>
-
-		      {if $MODULE eq 'Quotes' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
-			<td>
-				<input type="button" name="Button" class="small" value="{$APP.LBL_ADD_PRODUCT}" onclick="fnAddRow('{$MODULE}');"/>
-			</td>
-		      {else}
-			<td>
-				<input type="button" name="Button" class="small" value="{$APP.LBL_ADD_PRODUCT}" onclick="fnAddRowForPO('{$MODULE}');" />
-			</td>
-		      {/if}
-
-			<td width="35%">&nbsp;</td>
-			<td style="text-align:right;padding:5px;"><b>{$APP.LBL_SUB_TOTAL}</b></td>
-			<td style="text-align:left;padding:5px;">
-				<input type="text" name="subTotal" value="{$SUBTOTAL}" class="detailedViewTextBox" readonly/>
-			</td>
-			<td width="5%">&nbsp;</td>
-		   </tr>
-		   <tr>
-			<td>&nbsp;</td>
-			<td>&nbsp;</td>
-			<td style="text-align:right;padding:5px;"><b>{$APP.LBL_TAX}</b></td>
-			<td style="text-align:left;padding:5px;"><input type="text" name="txtTax" id="txtTax" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBox'" value="{$TAXVALUE}" onblur="calcGrandTotal()" /></td>
-		        <td>&nbsp;</td>
-		   </tr>
-		   <tr>
-			<td>&nbsp;</td>
-			<td>&nbsp;</td>
-			<td style="text-align:right;padding:5px;"><b>{$APP.LBL_ADJUSTMENT}</b></td>
-			<td style="text-align:left;padding:5px;"><input type="text" name="txtAdjustment" id="txtAdjustment" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBox'" value="{$ADJUSTMENTVALUE}" onblur="calcGrandTotal()" /></td>
-			<td>&nbsp;</td>
-		   </tr>
-		   <tr>
-			<td>&nbsp;</td>
-			<td>&nbsp;</td>
-			<td style="text-align:right;padding:5px;"><b>{$APP.LBL_GRAND_TOTAL}</b></td>
-			<td style="text-align:left;padding:5px;"><input type="text" name="grandTotal"  value="{$GRANDTOTAL}" class="detailedViewTextBox"  readonly /></td>
-			<td>&nbsp;</td>
-		   </tr>
-		</table>
-		<script>
-			rowCnt = {$row_no};
-			//rowCnt = document.getElementById('proTab').rows.length -2;
-		</script>
-		<input type="hidden" name="hdnSubTotal" id="hdnSubTotal" value="{$SUBTOTAL}">
-		<input type="hidden" name="hdnGrandTotal" id="hdnGrandTotal" value="{$GRANDTOTAL}">
-		<input type="hidden" name="totalProductCount" id="totalProductCount" value="{$row_no}">
-<!-- Upto this Added to display the Product Details -->
-
-
-
+{*<!--
+
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is:  vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+
+-->*}
+
+<script type="text/javascript" src="include/js/Inventory.js"></script>
+<script type="text/javascript" src="include/js/general.js"></script>
+<!-- Added to display the Product Details -->
+		<table class="prdTab small"  border="0" cellspacing="0" cellpadding="2">
+		 <tr>
+			<th colspan="8" class="detailedViewHeader">
+				<b>{$APP.LBL_PRODUCT_DETAILS}</b>
+			</th>
+		   </tr>
+		   <tr>
+		</table>
+		<table class="prdTab small"  border="0" cellspacing="0" cellpadding="5" id="proTab">
+		   <tr>
+			<th width="22%"><font color='red'>*</font>{$APP.LBL_PRODUCT}</th>
+
+			{if $MODULE eq 'Quotes' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
+			   <th width="8%" nowrap>{$APP.LBL_QTY_IN_STOCK}</th>
+			{/if}
+
+			<th width="8%"><font color='red'>*</font>{$APP.LBL_QTY}</th>
+			<th width="10%">{$APP.LBL_UNIT_PRICE}</th>
+			<th width="17%"><font color='red'>*</font>{$APP.LBL_LIST_PRICE}</th>
+			<th width="22%">{$APP.LBL_TAX_CALCULATION}</th>
+			<th width="8%">{$APP.LBL_TOTAL}</th>
+
+			<th width="5%">&nbsp;</th>
+		   </tr>
+
+		   {foreach key=row_no item=data from=$ASSOCIATEDPRODUCTS}
+			{assign var="txtProduct" value="txtProduct"|cat:$row_no}
+			{assign var="qtyInStock" value="qtyInStock"|cat:$row_no}
+			{assign var="txtQty" value="txtQty"|cat:$row_no}
+			{assign var="unitPrice" value="unitPrice"|cat:$row_no}
+			{assign var="txtListPrice" value="txtListPrice"|cat:$row_no}
+			{assign var="total" value="total"|cat:$row_no}
+			{assign var="hdnProductId" value="hdnProductId"|cat:$row_no}
+			{assign var="hdnRowStatus" value="hdnRowStatus"|cat:$row_no}
+			{assign var="hdnTotal" value="hdnTotal"|cat:$row_no}
+
+			{assign var="txtVATTax" value="txtVATTax"|cat:$row_no}
+			{assign var="txtSalesTax" value="txtSalesTax"|cat:$row_no}
+			{assign var="txtServiceTax" value="txtServiceTax"|cat:$row_no}
+
+		   <tr id="row{$row_no}" class="dvtCellLabel">
+			<td nowrap valign="top">
+				<input type="text" name="{$txtProduct}" value="{$data.$txtProduct}" class="txtBox" readonly />&nbsp;<img src="themes/blue/images/search.gif" style="cursor: pointer;" align="absmiddle" onclick="productPickList(this,'{$MODULE}')" />
+			</td>
+
+			{if $MODULE eq 'Quotes' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
+			   <td style="padding:3px;" id="{$qtyInStock}" valign="top">{$data.$qtyInStock}&nbsp;</td>
+			{/if}
+
+			<td valign="top">
+				<input type="text" name="{$txtQty}" value="{$data.$txtQty}" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onBlur="FindDuplicate(); settotalnoofrows(); calcTotal(this)" />
+			</td>
+			<td style="padding:3px;" id="{$unitPrice}" valign="top">
+				{$data.$unitPrice}&nbsp;
+			</td>
+			<td nowrap valign="top">
+				<input type="text" name="{$txtListPrice}" value="{$data.$txtListPrice}" class="txtBox" readonly onBlur="FindDuplicate(); settotalnoofrows(); calcTotal(this)"/>&nbsp;
+				<img src="themes/blue/images/pricebook.gif" onclick="priceBookPickList(this)" style="cursor: pointer;" title="Price Book" align="absmiddle" />
+			</td>
+			<!-- Added for Tax calculation-->
+			<td valign="top" style="padding-bottom:5px;">
+				<input type="text" id="txtTaxTotal{$row_no}" name="txtTaxTotal{$row_no}" value="" class="detailedViewTextBox" style="width:65%;">
+				<input type="hidden" id="hdnTaxTotal{$row_no}" name="hdnTaxTotal{$row_no}">
+				&nbsp;<input type="button" name="showTax" value=" ... "  class="classBtnSmall"  onclick="fnshow_Hide('tax_Lay{$row_no}');">
+
+				<!-- This div is added to display the tax informations -->
+				<div id="tax_Lay{$row_no}" style="width:93%;position:relative;border:1px dotted #CCCCCC;display:none;background-color:#FFFFCC;top:5px;padding:5px;" align="center">
+					<table width="100%" border="0" cellpadding="2" cellspacing="0" class="small">
+					   <tr id="vatrow{$row_no}">
+						<td align="left" width="40%" style="border:0px solid red;"><input type="text" id="txtVATTax{$row_no}" name="txtVATTax{$row_no}" class="txtBox" value="{$data.$txtVATTax}" onBlur="ValidateTax('txtVATTax{$row_no}'); calcTotal(this);"/>%&nbsp;</td>
+						<td width="20%" align="right" style="border:0px solid red;">{$APP.LBL_VAT}</td>
+						<td align="left" width="40%" style="border:0px solid red;"><input type="text" id="txtVATTaxTotal{$row_no}" name="txtVATTaxTotal{$row_no}" class="txtBox" value="" onBlur="ValidateTax('txtVATTaxTotal{$row_no}'); calcTotal(this);"/></td>
+					   </tr>
+					   <tr id="salesrow{$row_no}">
+						<td align="left" style="border:0px solid red;"><input type="text" id="txtSalesTax{$row_no}" name="txtSalesTax{$row_no}" class="txtBox" value="{$data.$txtSalesTax}" onBlur="ValidateTax('txtSalesTax{$row_no}'); calcTotal(this);"/>%&nbsp;</td>
+						<td  align="right" style="border:0px solid red;">{$APP.LBL_SALES}</td>
+						<td align="left" style="border:0px solid red;"><input type="text" id="txtSalesTaxTotal{$row_no}" name="txtSalesTaxTotal{$row_no}" class="txtBox" value="" onBlur="ValidateTax('txtSalesTaxTotal{$row_no}'); calcTotal(this);"/></td>
+					   </tr>
+					   <tr id="servicerow{$row_no}">
+						<td align="left" style="border:0px solid red;"><input type="text" id="txtServiceTax{$row_no}" name="txtServiceTax{$row_no}" class="txtBox" value="{$data.$txtServiceTax}" onBlur="ValidateTax('txtServiceTax{$row_no}'); calcTotal(this);"/>%&nbsp;</td>
+						<td align="right" style="border:0px solid red;">{$APP.LBL_SERVICE}</td>
+						<td align="left" style="border:0px solid red;"><input type="text" id="txtServiceTaxTotal{$row_no}" name="txtServiceTaxTotal{$row_no}" class="txtBox" value="" onBlur="ValidateTax('txtServiceTaxTotal{$row_no}'); calcTotal(this);"/></td>
+					   </tr>
+					</table>
+				</div>
+				<!-- Added to calculate the tax and total values when page loads -->
+				<script>calcTotal(getObj("txtVATTax{$row_no}"));</script>
+				<!-- This above div is added to display the tax informations --> 
+
+
+			<td style="padding:3px;" valign="top">
+				<div id="{$total}" align="right">{$data.$total}</div>&nbsp;
+			</td>
+			<td valign="top">
+				<input type="hidden" id="{$hdnProductId}" name="{$hdnProductId}" value="{$data.$hdnProductId}">
+				<input type="hidden" id="{$hdnRowStatus}" name="{$hdnRowStatus}">
+				<input type="hidden" id="{$hdnTotal}" name="{$hdnTotal}" value="{$data.$hdnTotal}">&nbsp;
+			</td>
+		   </tr>
+		   {/foreach}
+		</table>
+	</td>
+   </tr>
+   <tr>
+	<td colspan=4>
+		<table width="100%" border="0" cellspacing="0" cellpadding="0">
+		   <tr>
+
+		      {if $MODULE eq 'Quotes' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
+			<td>
+				<input type="button" name="Button" class="small" value="{$APP.LBL_ADD_PRODUCT}" onclick="fnAddRow('{$MODULE}');"/>
+			</td>
+		      {else}
+			<td>
+				<input type="button" name="Button" class="small" value="{$APP.LBL_ADD_PRODUCT}" onclick="fnAddRowForPO('{$MODULE}');" />
+			</td>
+		      {/if}
+
+			<td width="35%">&nbsp;</td>
+			<td style="text-align:right;padding:5px;"><b>{$APP.LBL_SUB_TOTAL}</b></td>
+			<td style="text-align:left;padding:5px;">
+				<input type="text" name="subTotal" value="{$SUBTOTAL}" class="detailedViewTextBox" readonly/>
+			</td>
+			<td width="5%">&nbsp;</td>
+		   </tr>
+		   <tr>
+			<td>&nbsp;</td>
+			<td>&nbsp;</td>
+			<td style="text-align:right;padding:5px;"><b>{$APP.LBL_TAX}</b></td>
+			<td style="text-align:left;padding:5px;"><input type="text" name="txtTax" id="txtTax" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBox'" value="{$TAXVALUE}" onblur="calcGrandTotal()" /></td>
+		        <td>&nbsp;</td>
+		   </tr>
+		   <tr>
+			<td>&nbsp;</td>
+			<td>&nbsp;</td>
+			<td style="text-align:right;padding:5px;"><b>{$APP.LBL_ADJUSTMENT}</b></td>
+			<td style="text-align:left;padding:5px;"><input type="text" name="txtAdjustment" id="txtAdjustment" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBox'" value="{$ADJUSTMENTVALUE}" onblur="calcGrandTotal()" /></td>
+			<td>&nbsp;</td>
+		   </tr>
+		   <tr>
+			<td>&nbsp;</td>
+			<td>&nbsp;</td>
+			<td style="text-align:right;padding:5px;"><b>{$APP.LBL_GRAND_TOTAL}</b></td>
+			<td style="text-align:left;padding:5px;"><input type="text" name="grandTotal"  value="{$GRANDTOTAL}" class="detailedViewTextBox"  readonly /></td>
+			<td>&nbsp;</td>
+		   </tr>
+		</table>
+		<script>
+			rowCnt = {$row_no};
+			//rowCnt = document.getElementById('proTab').rows.length -2;
+		</script>
+		<input type="hidden" name="hdnSubTotal" id="hdnSubTotal" value="{$SUBTOTAL}">
+		<input type="hidden" name="hdnGrandTotal" id="hdnGrandTotal" value="{$GRANDTOTAL}">
+		<input type="hidden" name="totalProductCount" id="totalProductCount" value="{$row_no}">
+<!-- Upto this Added to display the Product Details -->
+
+
+

Modified: vtigercrm/trunk/include/js/Inventory.js
==============================================================================
--- vtigercrm/trunk/include/js/Inventory.js (original)
+++ vtigercrm/trunk/include/js/Inventory.js Mon May 29 16:25:34 2006
@@ -79,7 +79,7 @@
 	return prodListBody;
 }
 
-function delRow(rowId) {
+/*function delRow(rowId) {
    var rowId=parseInt(rowId.substr(rowId.indexOf("w")+1,rowId.length))
       //removing the corresponding row
    var prodListBody=getProdListBody()
@@ -160,7 +160,111 @@
    }
 
    calcGrandTotal()
-}
+}*/
+
+/*  New Delete Function */
+
+//  Don't take risk by changing this function 
+
+function deleteRow(module,i)
+{
+	rowCnt--;
+	var tableName = document.getElementById('proTab');
+	var prev = tableName.rows.length;
+	document.getElementById('proTab').deleteRow(i);
+	for(loop_count=i+1;loop_count<prev;loop_count++)
+	{
+
+		var row_id = "row" + loop_count;
+		var new_id = "row" + (loop_count - 1);
+
+		if(module == 'PurchaseOrder')
+		{						
+			var stack = new Array("txtProduct","txtQty","txtListPrice","hdnTaxTotal","txtTaxTotal","hdnProductId","hdnRowStatus","hdnTotal","txtVATTax","txtVATTaxTotal","txtSalesTax","txtSalesTaxTotal","txtServiceTax","txtServiceTaxTotal");
+			var stack_new = new Array("txtProduct","txtQty","txtListPrice","hdnTaxTotal","txtTaxTotal","hdnProductId","hdnRowStatus","hdnTotal","txtVATTax","txtVATTaxTotal","txtSalesTax","txtSalesTaxTotal","txtServiceTax","txtServiceTaxTotal");
+		}
+		else
+		{
+			var stack = new Array("txtProduct","qtyInStock","txtQty","txtListPrice","hdnTaxTotal","txtTaxTotal","hdnProductId","hdnRowStatus","hdnTotal","txtVATTax","txtVATTaxTotal","txtSalesTax","txtSalesTaxTotal","txtServiceTax","txtServiceTaxTotal");
+			var stack_new = new Array("txtProduct","qtyInStock","txtQty","txtListPrice","hdnTaxTotal","txtTaxTotal","hdnProductId","hdnRowStatus","hdnTotal","txtVATTax","txtVATTaxTotal","txtSalesTax","txtSalesTaxTotal","txtServiceTax","txtServiceTaxTotal");
+		}
+
+		for(inner_loop=0;inner_loop<stack.length;inner_loop++)
+		{
+			stack_new[inner_loop] = getObj(stack[inner_loop]+loop_count).value;
+		}
+
+		document.getElementById(row_id).id=new_id;
+		document.getElementById('vat'+row_id).id='vat'+new_id;
+		document.getElementById('sales'+row_id).id='sales'+new_id;
+		document.getElementById('service'+row_id).id='service'+new_id;
+
+		var temp = document.getElementById(new_id).innerHTML;
+		var vatTemp = document.getElementById('vat'+new_id).innerHTML;
+		var salesTemp = document.getElementById('sales'+new_id).innerHTML;
+		var serviceTemp = document.getElementById('service'+new_id).innerHTML;
+
+		temp = temp.replace('txtProduct'+loop_count,'txtProduct'+(loop_count-1));
+		temp = temp.replace('txtProduct'+loop_count,'txtProduct'+(loop_count-1));
+
+		if(module != 'PurchaseOrder')
+		{
+			temp = temp.replace('qtyInStock'+loop_count,'qtyInStock'+(loop_count-1));
+		}
+
+		temp = temp.replace('txtQty'+loop_count,'txtQty'+(loop_count-1));
+		temp = temp.replace('txtQty'+loop_count,'txtQty'+(loop_count-1));
+		temp = temp.replace('unitPrice'+loop_count,'unitPrice'+(loop_count-1));
+		temp = temp.replace('txtListPrice'+loop_count,'txtListPrice'+(loop_count-1));
+		temp = temp.replace('txtListPrice'+loop_count,'txtListPrice'+(loop_count-1));
+		temp = temp.replace('total'+loop_count,'total'+(loop_count-1));
+		temp = temp.replace('hdnTaxTotal'+loop_count,'hdnTaxTotal'+(loop_count-1));
+		temp = temp.replace('hdnTaxTotal'+loop_count,'hdnTaxTotal'+(loop_count-1));
+		temp = temp.replace('txtTaxTotal'+loop_count,'txtTaxTotal'+(loop_count-1));
+		temp = temp.replace('txtTaxTotal'+loop_count,'txtTaxTotal'+(loop_count-1));
+		temp = temp.replace('hdnProductId'+loop_count,'hdnProductId'+(loop_count-1));
+		temp = temp.replace('hdnProductId'+loop_count,'hdnProductId'+(loop_count-1));
+		temp = temp.replace('hdnRowStatus'+loop_count,'hdnRowStatus'+(loop_count-1));
+		temp = temp.replace('hdnRowStatus'+loop_count,'hdnRowStatus'+(loop_count-1));
+		temp = temp.replace('hdnTotal'+loop_count,'hdnTotal'+(loop_count-1));
+		temp = temp.replace('hdnTotal'+loop_count,'hdnTotal'+(loop_count-1));
+		temp = temp.replace('tax_Lay'+loop_count,'tax_Lay'+(loop_count-1));
+		temp = temp.replace('tax_Lay'+loop_count,'tax_Lay'+(loop_count-1));	
+
+		vatTemp = vatTemp.replace('txtVATTax'+loop_count,'txtVATTax'+(loop_count-1));
+		vatTemp = vatTemp.replace('txtVATTax'+loop_count,'txtVATTax'+(loop_count-1));
+		vatTemp = vatTemp.replace('txtVATTax'+loop_count,'txtVATTax'+(loop_count-1));
+		vatTemp = vatTemp.replace('txtVATTaxTotal'+loop_count,'txtVATTaxTotal'+(loop_count-1));
+		vatTemp = vatTemp.replace('txtVATTaxTotal'+loop_count,'txtVATTaxTotal'+(loop_count-1));
+		vatTemp = vatTemp.replace('txtVATTaxTotal'+loop_count,'txtVATTaxTotal'+(loop_count-1));
+		salesTemp = salesTemp.replace('txtSalesTax'+loop_count,'txtSalesTax'+(loop_count-1));
+		salesTemp = salesTemp.replace('txtSalesTax'+loop_count,'txtSalesTax'+(loop_count-1));
+		salesTemp = salesTemp.replace('txtSalesTax'+loop_count,'txtSalesTax'+(loop_count-1));
+		salesTemp = salesTemp.replace('txtSalesTaxTotal'+loop_count,'txtSalesTaxTotal'+(loop_count-1));
+		salesTemp = salesTemp.replace('txtSalesTaxTotal'+loop_count,'txtSalesTaxTotal'+(loop_count-1));
+		salesTemp = salesTemp.replace('txtSalesTaxTotal'+loop_count,'txtSalesTaxTotal'+(loop_count-1));
+		serviceTemp = serviceTemp.replace('txtServiceTax'+loop_count,'txtServiceTax'+(loop_count-1));
+		serviceTemp = serviceTemp.replace('txtServiceTax'+loop_count,'txtServiceTax'+(loop_count-1));
+		serviceTemp = serviceTemp.replace('txtServiceTax'+loop_count,'txtServiceTax'+(loop_count-1));
+		serviceTemp = serviceTemp.replace('txtServiceTaxTotal'+loop_count,'txtServiceTaxTotal'+(loop_count-1));
+		serviceTemp = serviceTemp.replace('txtServiceTaxTotal'+loop_count,'txtServiceTaxTotal'+(loop_count-1));
+		serviceTemp = serviceTemp.replace('txtServiceTaxTotal'+loop_count,'txtServiceTaxTotal'+(loop_count-1));
+
+		document.getElementById(new_id).innerHTML = temp;
+		document.getElementById('vat'+new_id).innerHTML = vatTemp;
+		document.getElementById('sales'+new_id).innerHTML = salesTemp;
+		document.getElementById('service'+new_id).innerHTML = serviceTemp;
+
+		for(inner_loop=0;inner_loop<stack.length;inner_loop++)
+		{
+			getObj(stack[inner_loop]+(loop_count-1)).value = stack_new[inner_loop];
+		}
+
+	}
+	calcGrandTotal()
+}
+/*  End */
+
 
 
 function calcTotal(currObj) {

Modified: vtigercrm/trunk/include/utils/DetailViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/DetailViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/DetailViewUtils.php Mon May 29 16:25:34 2006
@@ -894,7 +894,11 @@
 		$qtyinstock=$adb->query_result($result,$i-1,'qtyinstock');
 		$qty=$adb->query_result($result,$i-1,'quantity');
 		$listprice=$adb->query_result($result,$i-1,'listprice');
+		$vat=$adb->query_result($result,$i-1,'vattax');
+		$sales=$adb->query_result($result,$i-1,'salestax');
+		$service=$adb->query_result($result,$i-1,'servicetax');
 		$total = $qty*$listprice;
+		$total_with_tax = $total+($vat*$total/100)+($sales*$total/100)+($service*$total/100);
 
 		if($i%2 == 0)
 		{
@@ -914,7 +918,7 @@
 		$output .= '<td style="padding:3px;">'.$qty.'</td>';
 		$output .= '<td style="padding:3px;">'.$unitprice.'</td>';
 		$output .= '<td style="padding:3px;">'.$listprice.'</td>';
-		$output .= '<td style="padding:3px;"><div id="total'.$i.'" align="right">'.$total.'</div></td>';
+		$output .= '<td style="padding:3px;"><div id="total'.$i.'" align="right">'.$total_with_tax.'</div></td>';
 		$output .= '</tr>';
 
 

Modified: vtigercrm/trunk/include/utils/EditViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/EditViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/EditViewUtils.php Mon May 29 16:25:34 2006
@@ -1209,11 +1209,16 @@
 		$productid=$adb->query_result($result,$i-1,'productid');
 		$qty=$adb->query_result($result,$i-1,'quantity');
 		$listprice=$adb->query_result($result,$i-1,'listprice');
+		$vat=$adb->query_result($result,$i-1,'vattax');
+		$sales=$adb->query_result($result,$i-1,'salestax');
+		$service=$adb->query_result($result,$i-1,'servicetax');
+
 		if($listprice == '')
 			$listprice = $unitprice;
 		if($qty =='')
 			$qty = 1;
 		$total = $qty*$listprice;
+		$total_with_tax = $total+($vat*$total/100)+($sales*$total/100)+($service*$total/100);
 
 		$product_id_var = 'hdnProductId'.$i;
 		$status_var = 'hdnRowStatus'.$i;
@@ -1233,7 +1238,7 @@
 		$product_Detail[$i]['txtQty'.$i]=$qty;
 		$product_Detail[$i]['unitPrice'.$i]=$unitprice;
 		$product_Detail[$i]['txtListPrice'.$i]=$listprice;
-		$product_Detail[$i]['total'.$i]=$total;
+		$product_Detail[$i]['total'.$i]=$total_with_tax;
 
 		if($i != 1)
 		{
@@ -1245,9 +1250,9 @@
 		$product_Detail[$i]['hdnTotal'.$i] = $total;
 
 		//Added to pass the tax percentage values
-		$product_Detail[$i]['txtVATTax'.$i] = getProductTaxPercentage('VAT',$productid,'default');
-		$product_Detail[$i]['txtSalesTax'.$i] = getProductTaxPercentage('Sales',$productid,'default');
-		$product_Detail[$i]['txtServiceTax'.$i] = getProductTaxPercentage('Service',$productid,'default');
+		$product_Detail[$i]['txtVATTax'.$i] = $vat;//getProductTaxPercentage('VAT',$productid,'default');
+		$product_Detail[$i]['txtSalesTax'.$i] = $sales;//getProductTaxPercentage('Sales',$productid,'default');
+		$product_Detail[$i]['txtServiceTax'.$i] = $service;//getProductTaxPercentage('Service',$productid,'default');
 
 	}
 	$log->debug("Exiting getAssociatedProducts method ...");

Modified: vtigercrm/trunk/modules/Invoice/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/Save.php (original)
+++ vtigercrm/trunk/modules/Invoice/Save.php Mon May 29 16:25:34 2006
@@ -69,14 +69,22 @@
         $qty_var = 'txtQty'.$i;
         $list_price_var = 'txtListPrice'.$i;
 
+	$vat_var = 'txtVATTax'.$i;
+	$sales_var = 'txtSalesTax'.$i;
+	$service_var = 'txtServiceTax'.$i;
+
         $prod_id = $_REQUEST[$product_id_var];
         $prod_status = $_REQUEST[$status_var];
         $qty = $_REQUEST[$qty_var];
         $listprice = $_REQUEST[$list_price_var];
+	$vat = $_REQUEST[$vat_var];
+	$sales = $_REQUEST[$sales_var];
+	$service = $_REQUEST[$service_var];
+
         if($prod_status != 'D')
         {
 
-                $query ="insert into invoiceproductrel values(".$focus->id.",".$prod_id.",".$qty.",".$listprice.")";
+                $query ="insert into invoiceproductrel values($focus->id, $prod_id, $qty, $listprice, $vat, $sales, $service)";
                 $adb->query($query);
 		//Updating the Quantity in Stock in the Product Table
 		updateStk($prod_id,$qty,$focus->mode,$ext_prod_arr,'Invoice');

Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php
==============================================================================
--- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php (original)
+++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Mon May 29 16:25:34 2006
@@ -2756,7 +2756,27 @@
 $update_query5 = "update field set quickcreate=1, quickcreatesequence=NULL where tabid in (10,14)";
 Execute($update_query5);
 
-
+$alter_query_array18 = Array(
+				"alter table soproductrel add column vattax decimal(7,3) default NULL",
+				"alter table soproductrel add column salestax decimal(7,3) default NULL",
+				"alter table soproductrel add column servicetax decimal(7,3) default NULL",
+				
+				"alter table poproductrel add column vattax decimal(7,3) default NULL",
+				"alter table poproductrel add column salestax decimal(7,3) default NULL",
+				"alter table poproductrel add column servicetax decimal(7,3) default NULL",
+				
+				"alter table quotesproductrel add column vattax decimal(7,3) default NULL",
+				"alter table quotesproductrel add column salestax decimal(7,3) default NULL",
+				"alter table quotesproductrel add column servicetax decimal(7,3) default NULL",
+				
+				"alter table invoiceproductrel add column vattax decimal(7,3) default NULL",
+				"alter table invoiceproductrel add column salestax decimal(7,3) default NULL",
+				"alter table invoiceproductrel add column servicetax decimal(7,3) default NULL",
+			    );
+foreach($alter_query_array18 as $query)
+{
+	Execute($query);
+}
 
 
 

Modified: vtigercrm/trunk/modules/PurchaseOrder/Save.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/Save.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/Save.php Mon May 29 16:25:34 2006
@@ -59,14 +59,22 @@
         $qty_var = 'txtQty'.$i;
         $list_price_var = 'txtListPrice'.$i;
 
+	$vat_var = 'txtVATTax'.$i;
+	$sales_var = 'txtSalesTax'.$i;
+	$service_var = 'txtServiceTax'.$i;
+	
         $prod_id = $_REQUEST[$product_id_var];
         $prod_status = $_REQUEST[$status_var];
         $qty = $_REQUEST[$qty_var];
         $listprice = $_REQUEST[$list_price_var];
+	$vat = $_REQUEST[$vat_var];
+	$sales = $_REQUEST[$sales_var];
+	$service = $_REQUEST[$service_var];
+
         if($prod_status != 'D')
         {
 
-                $query ="insert into poproductrel values(".$focus->id.",".$prod_id.",".$qty.",".$listprice.")";
+                $query ="insert into poproductrel values($focus->id, $prod_id, $qty, $listprice, $vat, $sales, $service)";
                 $adb->query($query);
 		if($update_prod_stock == 'true')
                 {

Modified: vtigercrm/trunk/modules/Quotes/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/Save.php (original)
+++ vtigercrm/trunk/modules/Quotes/Save.php Mon May 29 16:25:34 2006
@@ -67,14 +67,22 @@
 	$qty_var = 'txtQty'.$i;
 	$list_price_var = 'txtListPrice'.$i;
 
+	$vat_var = 'txtVATTax'.$i;
+	$sales_var = 'txtSalesTax'.$i;
+	$service_var = 'txtServiceTax'.$i;
+
 	$prod_id = $_REQUEST[$product_id_var];
 	$prod_status = $_REQUEST[$status_var];
 	$qty = $_REQUEST[$qty_var];
 	$listprice = $_REQUEST[$list_price_var];
+	$vat = $_REQUEST[$vat_var];
+	$sales = $_REQUEST[$sales_var];
+	$service = $_REQUEST[$service_var];
+
 	if($prod_status != 'D')
 	{
 		
-		$query ="insert into quotesproductrel values(".$focus->id.",".$prod_id.",".$qty.",".$listprice.")";
+		$query ="insert into quotesproductrel values($focus->id, $prod_id, $qty, $listprice, $vat, $sales, $service)";
 		$adb->query($query);
 		//Checking the re-order level and sending mail	
 		updateStk($prod_id,$qty,$focus->mode,$ext_prod_arr,'Quotes');

Modified: vtigercrm/trunk/modules/SalesOrder/Save.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/Save.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/Save.php Mon May 29 16:25:34 2006
@@ -69,14 +69,22 @@
         $qty_var = 'txtQty'.$i;
         $list_price_var = 'txtListPrice'.$i;
 
+	$vat_var = 'txtVATTax'.$i;
+	$sales_var = 'txtSalesTax'.$i;
+	$service_var = 'txtServiceTax'.$i;
+
         $prod_id = $_REQUEST[$product_id_var];
         $prod_status = $_REQUEST[$status_var];
         $qty = $_REQUEST[$qty_var];
         $listprice = $_REQUEST[$list_price_var];
+	$vat = $_REQUEST[$vat_var];
+	$sales = $_REQUEST[$sales_var];
+	$service = $_REQUEST[$service_var];
+
         if($prod_status != 'D')
         {
 
-                $query ="insert into soproductrel values(".$focus->id.",".$prod_id.",".$qty.",".$listprice.")";
+                $query ="insert into soproductrel values($focus->id, $prod_id , $qty, $listprice, $vat, $sales, $service)";
                 $adb->query($query);
 		updateStk($prod_id,$qty,$focus->mode,$ext_prod_arr,'SalesOrder');
         }





More information about the vtigercrm-commits mailing list