[Vtigercrm-commits] [vtiger-commits] r9257 - in /vtigercrm/trunk: Smarty/templates/Inventory/ modules/Products/ themes/woodspice/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Sep 4 10:58:24 EDT 2006
Author: saraj
Date: Mon Sep 4 08:58:15 2006
New Revision: 9257
Log:
* Modified to display the discount, tax divs in the mouse click area
Modified:
vtigercrm/trunk/Smarty/templates/Inventory/InventoryCreateView.tpl
vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl
vtigercrm/trunk/Smarty/templates/Inventory/ProductDetails.tpl
vtigercrm/trunk/Smarty/templates/Inventory/ProductDetailsEditView.tpl
vtigercrm/trunk/modules/Products/InventoryTaxAjax.php
vtigercrm/trunk/themes/woodspice/style.css
Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryCreateView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/InventoryCreateView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryCreateView.tpl Mon Sep 4 08:58:15 2006
@@ -188,6 +188,9 @@
</table>
</form>
+<!-- This div is added to get the left and top values to show the tax details-->
+<div id="tax_container" style="display:none; position:absolute; z-index:1px;"></div>
+
<script>
Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl Mon Sep 4 08:58:15 2006
@@ -171,6 +171,9 @@
</table>
</form>
+<!-- This div is added to get the left and top values to show the tax details-->
+<div id="tax_container" style="display:none; position:absolute; z-index:1px;"></div>
+
<script>
var fieldname = new Array({$VALIDATION_DATA_FIELDNAME})
Modified: vtigercrm/trunk/Smarty/templates/Inventory/ProductDetails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/ProductDetails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/ProductDetails.tpl Mon Sep 4 08:58:15 2006
@@ -21,7 +21,7 @@
// window.onmousemove= displayCoords;
// window.onclick = fnRevert;
-function displayCoords(event,obj,mode,curr_row)
+function displayCoords(currObj,obj,mode,curr_row)
{ldelim}
if(mode != 'discount_final' && mode != 'sh_tax_div_title' && mode != 'group_tax_div_title')
{ldelim}
@@ -38,6 +38,10 @@
{ldelim}
document.getElementById("discount_div_title"+curr_row).innerHTML = '<b>Set Discount for : '+document.getElementById("productTotal"+curr_row).innerHTML+'</b>';
{rdelim}
+ else if(mode == 'tax')
+ {ldelim}
+ document.getElementById("tax_div_title"+curr_row).innerHTML = "<b>Set Tax for "+document.getElementById("totalAfterDiscount"+curr_row).innerHTML+'</b>';
+ {rdelim}
else if(mode == 'discount_final')
{ldelim}
document.getElementById("discount_div_title_final").innerHTML = '<b>Set Discount for : '+document.getElementById("netTotal").innerHTML+'</b>';
@@ -52,19 +56,23 @@
document.getElementById("group_tax_div_title").innerHTML = '<b>Set Group Tax for : '+net_total_after_discount+'</b>';
{rdelim}
- var move_Element = document.getElementById(obj).style;
- if(!event)
- {ldelim}
- move_Element.left = e.pageX +'px' ;
- move_Element.top = e.pageY + 'px';
- {rdelim}
- else
- {ldelim}
- move_Element.left = event.clientX +'px' ;
- move_Element.top = event.clientY + 'px';
- {rdelim}
-
- move_Element.display = 'block';
+ fnvshobj(currObj,'tax_container');
+ if(document.all)
+ {ldelim}
+ var divleft = document.getElementById("tax_container").style.left;
+ var divabsleft = divleft.substring(0,divleft.length-2);
+ document.getElementById(obj).style.left = eval(divabsleft) - 120;
+
+ var divtop = document.getElementById("tax_container").style.top;
+ var divabstop = divtop.substring(0,divtop.length-2);
+ document.getElementById(obj).style.top = eval(divabstop) - 200;
+ {rdelim}else
+ {ldelim}
+ document.getElementById(obj).style.left = document.getElementById("tax_container").left;
+ document.getElementById(obj).style.top = document.getElementById("tax_container").top;
+ {rdelim}
+ document.getElementById(obj).style.display = "block";
+
{rdelim}
function doNothing(){ldelim}
@@ -177,7 +185,7 @@
</tr>
<tr>
<td align="right" style="padding:5px;" nowrap>
- (-) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'discount_div1','discount','1')" >{$APP.LBL_DISCOUNT}</a> : </b>
+ (-) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'discount_div1','discount','1')" >{$APP.LBL_DISCOUNT}</a> : </b>
<div class="discountUI" id="discount_div1">
<input type="hidden" id="discount_type1" name="discount_type1" value="">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="small">
@@ -208,7 +216,7 @@
</tr>
<tr id="individual_tax_row1" class="TaxShow">
<td align="right" style="padding:5px;" nowrap>
- (+) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'tax_div1','tax','1')" >{$APP.LBL_TAX} </a> : </b>
+ (+) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'tax_div1','tax','1')" >{$APP.LBL_TAX} </a> : </b>
<div class="discountUI" id="tax_div1">
</div>
</td>
@@ -269,13 +277,14 @@
<!-- Product Details Final Total Discount, Tax and Shipping&Hanling - Starts -->
<tr valign="top">
- <td width="88%" class="crmTableRow small lineOnTop" align="right"><b>{$APP.LBL_NET_TOTAL}</b></td>
+ <td width="88%" colspan="2" class="crmTableRow small lineOnTop" align="right"><b>{$APP.LBL_NET_TOTAL}</b></td>
<td width="12%" id="netTotal" class="crmTableRow small lineOnTop" align="right">0.00</td>
</tr>
<tr valign="top">
+ <td class="crmTableRow small lineOnTop" width="60%" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small lineOnTop" align="right">
- (-) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'discount_div_final','discount_final','1')">{$APP.LBL_DISCOUNT}</a>
+ (-) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'discount_div_final','discount_final','1')">{$APP.LBL_DISCOUNT}</a>
<!-- Popup Discount DIV -->
<div class="discountUI" id="discount_div_final">
<input type="hidden" id="discount_type_final" name="discount_type_final" value="">
@@ -306,8 +315,9 @@
<!-- Group Tax - starts -->
<tr id="group_tax_row" valign="top" class="TaxHide">
+ <td class="crmTableRow small lineOnTop" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small lineOnTop" align="right">
- (+) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'group_tax_div','group_tax_div_title',''); calcGroupTax();" >{$APP.LBL_TAX}</a></b>
+ (+) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'group_tax_div','group_tax_div_title',''); calcGroupTax();" >{$APP.LBL_TAX}</a></b>
<!-- Pop Div For Group TAX -->
<div class="discountUI" id="group_tax_div">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="small">
@@ -322,7 +332,7 @@
<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()"> %
</td>
- <td align="center" class="lineOnTop">{$tax_detail.taxname}</td>
+ <td align="center" class="lineOnTop">{$tax_detail.taxlabel}</td>
<td align="right" class="lineOnTop">
<input type="text" class="small" size="6" name="{$tax_detail.taxname}_group_amount" id="group_tax_amount{$smarty.foreach.group_tax_loop.iteration}" style="cursor:pointer;" value="0.00" readonly>
</td>
@@ -343,6 +353,7 @@
<tr valign="top">
+ <td class="crmTableRow small" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small" align="right">
(+) <b>{$APP.LBL_SHIPPING_AND_HANDLING_CHARGES} </b>
</td>
@@ -352,8 +363,9 @@
</tr>
<tr valign="top">
+ <td class="crmTableRow small" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small" align="right">
- (+) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'shipping_handling_div','sh_tax_div_title',''); calcSHTax();" >{$APP.LBL_TAX_FOR_SHIPPING_AND_HANDLING} </a></b>
+ (+) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'shipping_handling_div','sh_tax_div_title',''); calcSHTax();" >{$APP.LBL_TAX_FOR_SHIPPING_AND_HANDLING} </a></b>
<!-- Pop Div For Shipping and Handlin TAX -->
<div class="discountUI" id="shipping_handling_div">
@@ -386,6 +398,7 @@
<td id="shipping_handling_tax" class="crmTableRow small" align="right">0.00</td>
</tr>
<tr valign="top">
+ <td class="crmTableRow small" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small" align="right">
{$APP.LBL_ADJUSTMENT}
<select id="adjustmentType" name="adjustmentType" class=small onchange="calcTotal();">
@@ -398,6 +411,7 @@
</td>
</tr>
<tr valign="top">
+ <td class="crmTableRow big lineOnTop" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow big lineOnTop" align="right"><b>{$APP.LBL_GRAND_TOTAL}</b></td>
<td id="grandTotal" name="grandTotal" class="crmTableRow big lineOnTop" align="right"> </td>
</tr>
Modified: vtigercrm/trunk/Smarty/templates/Inventory/ProductDetailsEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/ProductDetailsEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/ProductDetailsEditView.tpl Mon Sep 4 08:58:15 2006
@@ -22,7 +22,7 @@
// window.onmousemove= displayCoords;
// window.onclick = fnRevert;
-function displayCoords(event,obj,mode,curr_row)
+function displayCoords(currObj,obj,mode,curr_row)
{ldelim}
if(mode != 'discount_final' && mode != 'sh_tax_div_title' && mode != 'group_tax_div_title')
{ldelim}
@@ -39,6 +39,10 @@
{ldelim}
document.getElementById("discount_div_title"+curr_row).innerHTML = '<b>Set Discount for : '+document.getElementById("productTotal"+curr_row).innerHTML+'</b>';
{rdelim}
+ else if(mode == 'tax')
+ {ldelim}
+ document.getElementById("tax_div_title"+curr_row).innerHTML = "<b>Set Tax for "+document.getElementById("totalAfterDiscount"+curr_row).innerHTML+'</b>';
+ {rdelim}
else if(mode == 'discount_final')
{ldelim}
document.getElementById("discount_div_title_final").innerHTML = '<b>Set Discount for : '+document.getElementById("netTotal").innerHTML+'</b>';
@@ -53,19 +57,23 @@
document.getElementById("group_tax_div_title").innerHTML = '<b>Set Group Tax for : '+net_total_after_discount+'</b>';
{rdelim}
- var move_Element = document.getElementById(obj).style;
- if(!event)
- {ldelim}
- move_Element.left = e.pageX +'px' ;
- move_Element.top = e.pageY + 'px';
- {rdelim}
- else
- {ldelim}
- move_Element.left = event.clientX +'px' ;
- move_Element.top = event.clientY + 'px';
- {rdelim}
-
- move_Element.display = 'block';
+ fnvshobj(currObj,'tax_container');
+ if(document.all)
+ {ldelim}
+ var divleft = document.getElementById("tax_container").style.left;
+ var divabsleft = divleft.substring(0,divleft.length-2);
+ document.getElementById(obj).style.left = eval(divabsleft) - 120;
+
+ var divtop = document.getElementById("tax_container").style.top;
+ var divabstop = divtop.substring(0,divtop.length-2);
+ document.getElementById(obj).style.top = eval(divabstop);
+ {rdelim}else
+ {ldelim}
+ document.getElementById(obj).style.left = document.getElementById("tax_container").left;
+ document.getElementById(obj).style.top = document.getElementById("tax_container").top;
+ {rdelim}
+ document.getElementById(obj).style.display = "block";
+
{rdelim}
function doNothing(){ldelim}
@@ -198,7 +206,7 @@
</tr>
<tr>
<td align="right" style="padding:5px;" nowrap>
- (-) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'discount_div{$row_no}','discount','{$row_no}')" >{$APP.LBL_DISCOUNT}</a> : </b>
+ (-) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'discount_div{$row_no}','discount','{$row_no}')" >{$APP.LBL_DISCOUNT}</a> : </b>
<div class="discountUI" id="discount_div{$row_no}">
<input type="hidden" id="discount_type{$row_no}" name="discount_type{$row_no}" value="{$data.$discount_type}">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="small">
@@ -229,12 +237,12 @@
</tr>
<tr id="individual_tax_row{$row_no}" class="TaxShow">
<td align="right" style="padding:5px;" nowrap>
- (+) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'tax_div{$row_no}','tax','{$row_no}')" >{$APP.LBL_TAX} </a> : </b>
+ (+) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'tax_div{$row_no}','tax','{$row_no}')" >{$APP.LBL_TAX} </a> : </b>
<div class="discountUI" id="tax_div{$row_no}">
<!-- we will form the table with all taxes -->
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="small">
<tr>
- <td nowrap align="left" >Set Tax for : {$data.$totalAfterDiscount}</td>
+ <td id="tax_div_title{$row_no}" nowrap align="left" ><b>Set Tax for : {$data.$totalAfterDiscount}</b></td>
<td> </td>
<td align="right"><img src="{$IMAGE_PATH}close.gif" border="0" onClick="fnHidePopDiv('tax_div{$row_no}')" style="cursor:pointer;"></td>
</tr>
@@ -317,13 +325,14 @@
<!-- Product Details Final Total Discount, Tax and Shipping&Hanling - Starts -->
<tr valign="top">
- <td width="88%" class="crmTableRow small lineOnTop" align="right"><b>{$APP.LBL_NET_TOTAL}</b></td>
+ <td width="88%" colspan="2" class="crmTableRow small lineOnTop" align="right"><b>{$APP.LBL_NET_TOTAL}</b></td>
<td width="12%" id="netTotal" class="crmTableRow small lineOnTop" align="right">0.00</td>
</tr>
<tr valign="top">
+ <td class="crmTableRow small lineOnTop" width="60%" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small lineOnTop" align="right">
- (-) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'discount_div_final','discount_final','1')">{$APP.LBL_DISCOUNT}</a>
+ (-) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'discount_div_final','discount_final','1')">{$APP.LBL_DISCOUNT}</a>
<!-- Popup Discount DIV -->
<div class="discountUI" id="discount_div_final">
@@ -356,8 +365,9 @@
<!-- Group Tax - starts -->
<tr id="group_tax_row" valign="top" class="TaxHide">
+ <td class="crmTableRow small lineOnTop" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small lineOnTop" align="right">
- (+) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'group_tax_div','group_tax_div_title',''); calcGroupTax();" >{$APP.LBL_TAX}</a></b>
+ (+) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'group_tax_div','group_tax_div_title',''); calcGroupTax();" >{$APP.LBL_TAX}</a></b>
<!-- Pop Div For Group TAX -->
<div class="discountUI" id="group_tax_div">
@@ -396,6 +406,7 @@
<tr valign="top">
+ <td class="crmTableRow small" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small" align="right">
(+) <b>{$APP.LBL_SHIPPING_AND_HANDLING_CHARGES} </b>
</td>
@@ -406,8 +417,9 @@
<tr valign="top">
+ <td class="crmTableRow small" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small" align="right">
- (+) <b><a href="javascript:doNothing();" onClick="displayCoords(event,'shipping_handling_div','sh_tax_div_title',''); calcSHTax();" >{$APP.LBL_TAX_FOR_SHIPPING_AND_HANDLING} </a></b>
+ (+) <b><a href="javascript:doNothing();" onClick="displayCoords(this,'shipping_handling_div','sh_tax_div_title',''); calcSHTax();" >{$APP.LBL_TAX_FOR_SHIPPING_AND_HANDLING} </a></b>
<!-- Pop Div For Shipping and Handlin TAX -->
<div class="discountUI" id="shipping_handling_div">
@@ -442,6 +454,7 @@
<tr valign="top">
+ <td class="crmTableRow small" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow small" align="right">
{$APP.LBL_ADJUSTMENT}
<select id="adjustmentType" name="adjustmentType" class=small onchange="calcTotal();">
@@ -456,6 +469,7 @@
<tr valign="top">
+ <td class="crmTableRow big lineOnTop" style="border-right:1px #dadada;"> </td>
<td class="crmTableRow big lineOnTop" align="right"><b>{$APP.LBL_GRAND_TOTAL}</b></td>
<td id="grandTotal" name="grandTotal" class="crmTableRow big lineOnTop" align="right">{$FINAL.grandTotal}</td>
</tr>
Modified: vtigercrm/trunk/modules/Products/InventoryTaxAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Products/InventoryTaxAjax.php (original)
+++ vtigercrm/trunk/modules/Products/InventoryTaxAjax.php Mon Sep 4 08:58:15 2006
@@ -24,7 +24,7 @@
$tax_div = '
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="small">
<tr>
- <td nowrap align="left" >Set Tax for : '.$product_total.'</td>
+ <td id="tax_div_title'.$rowid.'" nowrap align="left" ><b>Set Tax for : '.$product_total.'</b></td>
<td> </td>
<td align="right"><img src="'.$image_path.'close.gif" border="0" onClick="fnHidePopDiv(\'tax_div'.$rowid.'\')" style="cursor:pointer;"></td>
</tr>
Modified: vtigercrm/trunk/themes/woodspice/style.css
==============================================================================
--- vtigercrm/trunk/themes/woodspice/style.css (original)
+++ vtigercrm/trunk/themes/woodspice/style.css Mon Sep 4 08:58:15 2006
@@ -3135,7 +3135,7 @@
.discountUI{
border:3px solid #CCCCCC;
- width:200px;
+ width:250px;
padding:5px;
position:absolute;
background-color:#FFFFFF;
More information about the vtigercrm-commits
mailing list