[Vtigercrm-commits] [vtiger-commits] r10888 - in /vtigercrm/branches/5.0.3: Smarty/templates/Inventory/ProductDetails.tpl Smarty/templates/Inventory/ProductDetailsEditView.tpl include/js/Inventory.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Sun May 13 02:48:02 EDT 2007


Author: richie
Date: Sun May 13 00:47:53 2007
New Revision: 10888

Log:
* Fixed the issue in total calculation, Fixed #3724

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetails.tpl
    vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetailsEditView.tpl
    vtigercrm/branches/5.0.3/include/js/Inventory.js

Modified: vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetails.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetails.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/Inventory/ProductDetails.tpl Sun May 13 00:47:53 2007
@@ -103,7 +103,7 @@
 		<b>{$APP.LBL_TAX_MODE}</b>
 	</td>
 	<td class="dvInnerHeader">
-		<select id="taxtype" name="taxtype" onchange="decideTaxDiv();">
+		<select id="taxtype" name="taxtype" onchange="decideTaxDiv(); calcTotal();">
 			<OPTION value="individual" selected>{$APP.LBL_INDIVIDUAL}</OPTION>
 			<OPTION value="group">{$APP.LBL_GROUP}</OPTION>
 		</select>
@@ -330,7 +330,7 @@
 
 					   <tr>
 						<td align="left" class="lineOnTop">
-							<input type="text" class="small" size="5" name="{$tax_detail.taxname}_group_percentage" id="group_tax_percentage{$smarty.foreach.group_tax_loop.iteration}" value="{$tax_detail.percentage}" onBlur="calcGroupTax()">&nbsp;%
+							<input type="text" class="small" size="5" name="{$tax_detail.taxname}_group_percentage" id="group_tax_percentage{$smarty.foreach.group_tax_loop.iteration}" value="{$tax_detail.percentage}" onBlur="calcTotal()">&nbsp;%
 						</td>
 						<td align="center" class="lineOnTop">{$tax_detail.taxlabel}</td>
 						<td align="right" class="lineOnTop">

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 Sun May 13 00:47:53 2007
@@ -107,7 +107,7 @@
 	{/if}
 
 	<td class="dvInnerHeader">
-		<select id="taxtype" name="taxtype" onchange="decideTaxDiv();">
+		<select id="taxtype" name="taxtype" onchange="decideTaxDiv(); calcTotal();">
 			<OPTION value="individual" {$individual_selected}>{$APP.LBL_INDIVIDUAL}</OPTION>
 			<OPTION value="group" {$group_selected}>{$APP.LBL_GROUP}</OPTION>
 		</select>
@@ -347,16 +347,16 @@
 				<td align="right"><img src="{$IMAGE_PATH}close.gif" border="0" onClick="fnHidePopDiv('discount_div_final')" style="cursor:pointer;"></td>
 			   </tr>
 			   <tr>
-				<td align="left" class="lineOnTop"><input type="radio" name="discount_final" checked onclick="setDiscount(this,'_final'); calcGroupTax();">&nbsp; {$APP.LBL_ZERO_DISCOUNT}</td>
+				<td align="left" class="lineOnTop"><input type="radio" name="discount_final" checked onclick="setDiscount(this,'_final'); calcTotal(); calcGroupTax();">&nbsp; {$APP.LBL_ZERO_DISCOUNT}</td>
 				<td class="lineOnTop">&nbsp;</td>
 			   </tr>
 			   <tr>
-				<td align="left"><input type="radio" name="discount_final" onclick="setDiscount(this,'_final'); calcGroupTax();" {$FINAL.checked_discount_percentage_final}>&nbsp; % {$APP.LBL_OF_PRICE}</td>
-				<td align="right"><input type="text" class="small" size="5" id="discount_percentage_final" name="discount_percentage_final" value="{$FINAL.discount_percentage_final}" {$FINAL.style_discount_percentage_final} onBlur="setDiscount(this,'_final'); calcGroupTax();">&nbsp;%</td>
+				<td align="left"><input type="radio" name="discount_final" onclick="setDiscount(this,'_final');  calcTotal(); calcGroupTax();" {$FINAL.checked_discount_percentage_final}>&nbsp; % {$APP.LBL_OF_PRICE}</td>
+				<td align="right"><input type="text" class="small" size="5" id="discount_percentage_final" name="discount_percentage_final" value="{$FINAL.discount_percentage_final}" {$FINAL.style_discount_percentage_final} onBlur="setDiscount(this,'_final');  calcTotal(); calcGroupTax();">&nbsp;%</td>
 			   </tr>
 			   <tr>
-				<td align="left" nowrap><input type="radio" name="discount_final" onclick="setDiscount(this,'_final'); calcGroupTax();" {$FINAL.checked_discount_amount_final}>&nbsp;{$APP.LBL_DIRECT_PRICE_REDUCTION}</td>
-				<td align="right"><input type="text" id="discount_amount_final" name="discount_amount_final" size="5" value="{$FINAL.discount_amount_final}" {$FINAL.style_discount_amount_final} onBlur="setDiscount(this,'_final'); calcGroupTax();"></td>
+				<td align="left" nowrap><input type="radio" name="discount_final" onclick="setDiscount(this,'_final');  calcTotal(); calcGroupTax();" {$FINAL.checked_discount_amount_final}>&nbsp;{$APP.LBL_DIRECT_PRICE_REDUCTION}</td>
+				<td align="right"><input type="text" id="discount_amount_final" name="discount_amount_final" size="5" value="{$FINAL.discount_amount_final}" {$FINAL.style_discount_amount_final} onBlur="setDiscount(this,'_final');  calcTotal(); calcGroupTax();"></td>
 			   </tr>
 			</table>
 		</div>
@@ -371,7 +371,7 @@
    <tr id="group_tax_row" valign="top" class="TaxHide">
 	<td class="crmTableRow small lineOnTop" style="border-right:1px #dadada;">&nbsp;</td>
 	<td class="crmTableRow small lineOnTop" align="right">
-		(+)&nbsp;<b><a href="javascript:doNothing();" onClick="displayCoords(this,'group_tax_div','group_tax_div_title',''); calcGroupTax();" >{$APP.LBL_TAX}</a></b>
+		(+)&nbsp;<b><a href="javascript:doNothing();" onClick="displayCoords(this,'group_tax_div','group_tax_div_title','');  calcTotal(); calcGroupTax();" >{$APP.LBL_TAX}</a></b>
 
 				<!-- Pop Div For Group TAX -->
 				<div class="discountUI" id="group_tax_div">
@@ -385,7 +385,7 @@
 
 					   <tr>
 						<td align="left" class="lineOnTop">
-							<input type="text" class="small" size="5" name="{$tax_detail.taxname}_group_percentage" id="group_tax_percentage{$smarty.foreach.group_tax_loop.iteration}" value="{$tax_detail.percentage}" onBlur="calcGroupTax()">&nbsp;%
+							<input type="text" class="small" size="5" name="{$tax_detail.taxname}_group_percentage" id="group_tax_percentage{$smarty.foreach.group_tax_loop.iteration}" value="{$tax_detail.percentage}" onBlur="calcTotal()">&nbsp;%
 						</td>
 						<td align="center" class="lineOnTop">{$tax_detail.taxlabel}</td>
 						<td align="right" class="lineOnTop">

Modified: vtigercrm/branches/5.0.3/include/js/Inventory.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/Inventory.js (original)
+++ vtigercrm/branches/5.0.3/include/js/Inventory.js Sun May 13 00:47:53 2007
@@ -135,7 +135,8 @@
 
 		}
 	}
-	calcGrandTotal()
+	calcGroupTax();
+	calcGrandTotal();
 }
 
 function calcGrandTotal() {
@@ -712,7 +713,6 @@
 
 	document.getElementById("tax_final").innerHTML = roundValue(group_tax_total);
 
-	calcTotal();
 }
 
 function calcSHTax()





More information about the vtigercrm-commits mailing list