[Vtigercrm-commits] [vtiger-commits] r6016 - in /vtigercrm/trunk/include/js: Inventory.js general.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue May 16 01:45:38 EDT 2006
Author: saraj
Date: Mon May 15 23:45:33 2006
New Revision: 6016
Log:
* Modified to handle the popuptype for Inventory modules. ie., module has been passed and based on the module Inventoy modules popuptype handled
Modified:
vtigercrm/trunk/include/js/Inventory.js
vtigercrm/trunk/include/js/general.js
Modified: vtigercrm/trunk/include/js/Inventory.js
==============================================================================
--- vtigercrm/trunk/include/js/Inventory.js (original)
+++ vtigercrm/trunk/include/js/Inventory.js Mon May 15 23:45:33 2006
@@ -48,10 +48,15 @@
document.EditView.totalProductCount.value = rowCnt;
}
-function productPickList(currObj) {
+function productPickList(currObj,module) {
var trObj=currObj.parentNode.parentNode
var rowId=parseInt(trObj.id.substr(trObj.id.indexOf("w")+1,trObj.id.length))
- window.open("index.php?module=Products&action=Popup&html=Popup_picker&form=HelpDeskEditView&popuptype=inventory_prod&curr_row="+rowId,"productWin","width=600,height=400,resizable=1,scrollbars=1,top=150,left=200");
+
+ popuptype = 'inventory_prod';
+ if(module == 'PurchaseOrder')
+ popuptype = 'inventory_prod_po';
+
+ window.open("index.php?module=Products&action=Popup&html=Popup_picker&form=HelpDeskEditView&popuptype="+popuptype+"&curr_row="+rowId,"productWin","width=600,height=400,resizable=1,scrollbars=1,status=1,top=150,left=200");
}
function priceBookPickList(currObj) {
@@ -161,6 +166,7 @@
function calcTotal(currObj) {
var trObj=currObj.parentNode.parentNode
var rowId=parseInt(trObj.id.substr(trObj.id.indexOf("w")+1,trObj.id.length))
+
var total=eval(getObj("txtQty"+rowId).value*getObj("txtListPrice"+rowId).value)
getObj("total"+rowId).innerHTML=getObj("hdnTotal"+rowId).value=roundValue(total.toString())
calcGrandTotal()
Modified: vtigercrm/trunk/include/js/general.js
==============================================================================
--- vtigercrm/trunk/include/js/general.js (original)
+++ vtigercrm/trunk/include/js/general.js Mon May 15 23:45:33 2006
@@ -1362,7 +1362,7 @@
// Add & Delete Row in a Table
-function fnAddRow(){
+function fnAddRow(module){
rowCnt++;
var tableName = document.getElementById('proTab');
var prev = tableName.rows.length;
@@ -1380,16 +1380,16 @@
var colfive = row.insertCell(4);
var colsix = row.insertCell(5);
var colseven = row.insertCell(6);
- colone.innerHTML="<input type='text' name='txtProduct"+count+"' class='detailedViewProdTextBox' readonly/> <img src='themes/blue/images/search.gif' onclick='productPickList(this)' align='absmiddle' /><input type='hidden' id='hdnProductId"+count+"' name='hdnProductId"+count+"'>";
+ colone.innerHTML="<input type='text' id='txtProduct"+count+"' name='txtProduct"+count+"' class='txtBox' readonly/> <img src='themes/blue/images/search.gif' onclick='productPickList(this,\""+module+"\")' align='absmiddle' /><input type='hidden' id='hdnProductId"+count+"' name='hdnProductId"+count+"'>";
coltwo.innerHTML="<div id='qtyInStock"+count+"'>";
- colthree.innerHTML="<input type='text' name='txtQty"+count+"' class='detailedViewTextBox' onfocus='this.className=\"detailedViewTextBoxOn\"' onBlur='this.className=\"detailedViewTextBox\"; settotalnoofrows(); calcTotal(this);' /> ";
+ colthree.innerHTML="<input type='text' id='txtQty"+count+"' name='txtQty"+count+"' class='detailedViewTextBox' onfocus='this.className=\"detailedViewTextBoxOn\"' onBlur='this.className=\"detailedViewTextBox\"; settotalnoofrows(); calcTotal(this);' /> ";
colfour.innerHTML=" </div><div id='unitPrice"+count+"'></div>";
- colfive.innerHTML="<input type='text' name='txtListPrice"+count+"' class='detailedViewProdTextBox' readonly onBlur='settotalnoofrows(); calcTotal(this)'> <img src='themes/blue/images/pricebook.gif' onClick='priceBookPickList(this)' align='absmiddle' style='cursor:hand;cursor:pointer' title='Price Book' /> ";
+ colfive.innerHTML="<input type='text' id='txtListPrice"+count+"' name='txtListPrice"+count+"' class='txtBox' readonly onBlur='settotalnoofrows(); calcTotal(this)'> <img src='themes/blue/images/pricebook.gif' onClick='priceBookPickList(this)' align='absmiddle' style='cursor:hand;cursor:pointer' title='Price Book' /> ";
colsix.innerHTML=" <div id='total"+count+"' align='right'></div><input type='hidden' id='hdnTotal"+count+"' name='hdnTotal"+count+"'>";
colseven.innerHTML="<span class='delTxt' onclick=\"deleteRow(this.parentNode.parentNode.rowIndex)\">Del</span>";
}
-function fnAddRowForPO(){
+function fnAddRowForPO(module){
rowCnt++;
var tableName = document.getElementById('proTab');
@@ -1407,10 +1407,10 @@
var colfour = row.insertCell(3);
var colfive = row.insertCell(4);
var colsix = row.insertCell(5);
- colone.innerHTML="<input type='text' name='txtProduct"+count+"' class='detailedViewProdTextBox' readonly/> <img src='themes/blue/images/search.gif' onclick='productPickList(this)' align='absmiddle' /><input type='hidden' id='hdnProductId"+count+"' name='hdnProductId"+count+"'>";
- coltwo.innerHTML="<input type='text' name='txtQty"+count+"' class='detailedViewTextBox' onfocus='this.className=\"detailedViewTextBoxOn\"' onBlur='this.className=\"detailedViewTextBox\"; settotalnoofrows(); calcTotal(this);' /> ";
+ colone.innerHTML="<input type='text'id='txtProduct"+count+"' name='txtProduct"+count+"' class='txtBox' readonly/> <img src='themes/blue/images/search.gif' onclick='productPickList(this,\""+module+"\")' align='absmiddle' /><input type='hidden' id='hdnProductId"+count+"' name='hdnProductId"+count+"'>";
+ coltwo.innerHTML="<input type='text'id='txtQty"+count+"' name='txtQty"+count+"' class='detailedViewTextBox' onfocus='this.className=\"detailedViewTextBoxOn\"' onBlur='this.className=\"detailedViewTextBox\"; settotalnoofrows(); calcTotal(this);' /> ";
colthree.innerHTML=" <div id='unitPrice"+count+"'></div>";
- colfour.innerHTML="<input type='text' name='txtListPrice"+count+"' class='detailedViewProdTextBox' readonly onBlur='settotalnoofrows(); calcTotal(this)'> <img src='themes/blue/images/pricebook.gif' onClick='priceBookPickList(this)' align='absmiddle' style='cursor:hand;cursor:pointer' title='Price Book' /> ";
+ colfour.innerHTML="<input type='text' id='txtListPrice"+count+"' name='txtListPrice"+count+"' class='txtBox' readonly onBlur='settotalnoofrows(); calcTotal(this)'> <img src='themes/blue/images/pricebook.gif' onClick='priceBookPickList(this)' align='absmiddle' style='cursor:hand;cursor:pointer' title='Price Book' /> ";
colfive.innerHTML=" <div id='total"+count+"' align='right'></div><input type='hidden' id='hdnTotal"+count+"' name='hdnTotal"+count+"'>";
colsix.innerHTML="<span class='delTxt' onclick=\"deleteRow(this.parentNode.parentNode.rowIndex)\">Del</span>";
More information about the vtigercrm-commits
mailing list