servsys-svn Mailing List for ServSys
Brought to you by:
molnar_c
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <mol...@us...> - 2010-12-24 21:08:43
|
Revision: 125 http://servsys.svn.sourceforge.net/servsys/?rev=125&view=rev Author: molnar_c Date: 2010-12-24 21:08:36 +0000 (Fri, 24 Dec 2010) Log Message: ----------- Updated version to 2.52 and date to 2011 Modified Paths: -------------- trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-25 22:12:08 UTC (rev 124) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-12-24 21:08:36 UTC (rev 125) @@ -4924,7 +4924,7 @@ out.println("</BODY>"); out.println("</HTML>"); out.println("<br><br><br><br><CENTER>"); -out.println("(C) Copyright 2002-2010 - Our World Services, LLC<br>"); +out.println("(C) Copyright 2002-2011 - Our World Services, LLC<br>"); //out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); //out.println("<br>Software Expire Date: "+doFormatDate(getDate(doGetExpireDate()))+"<br>"); //out.println("<br>Software Expire Date has been removed for GPL version.<br>"); @@ -5350,7 +5350,7 @@ out.println("</BODY>"); out.println("</HTML>"); out.println("<br><br><br><br><CENTER>"); -out.println("(C) Copyright 2002-2010 - Our World Services, LLC<br>"); +out.println("(C) Copyright 2002-2011 - Our World Services, LLC<br>"); out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); //out.println("<br>Software Expire Date: "+doFormatDate(getDate(doGetExpireDate()))+"<br>"); //out.println("<br>Software Expire Date has been removed for GPL version.<br>"); @@ -6424,8 +6424,13 @@ } //RELEASE_VERSION - vnumber = "2.51"; + vnumber = "2.52"; + if (dbvnumber.equalsIgnoreCase("2.51")) { + Statement stmtu2 = con.createStatement(); + int result250z = stmtu2.executeUpdate("UPDATE version set vnumber='2.52';"); + int result250x = stmtu2.executeUpdate("UPDATE version set vdate='2011-01-02';"); + } if (dbvnumber.equalsIgnoreCase("2.50")) { Statement stmtu2 = con.createStatement(); int result251z = stmtu2.executeUpdate("UPDATE version set vnumber='2.51';"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2010-01-25 22:12:15
|
Revision: 124 http://servsys.svn.sourceforge.net/servsys/?rev=124&view=rev Author: molnar_c Date: 2010-01-25 22:12:08 +0000 (Mon, 25 Jan 2010) Log Message: ----------- Fix sync server. Needed to add some fields that had been forgotten about. Modified Paths: -------------- trunk/servsys/src/com/pandmservices/UniCompConfig.java trunk/servsys/src/com/pandmservices/dbserver/SyncCustQuotes.java trunk/servsys/src/com/pandmservices/dbserver/SyncQuotes.java trunk/servsys/src/com/pandmservices/dbserver/SyncWorksheets.java trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/src/com/pandmservices/UniCompConfig.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniCompConfig.java 2010-01-24 19:01:09 UTC (rev 123) +++ trunk/servsys/src/com/pandmservices/UniCompConfig.java 2010-01-25 22:12:08 UTC (rev 124) @@ -81,7 +81,7 @@ { Statement stmt = con.createStatement(); stmt.executeUpdate("DROP TABLE IF EXISTS configcompany;"); - stmt.executeUpdate("create table configcompany (image text, imagewidth text, imagehight text, coname text, cologo text, coaddress text, cophone text, useletterhead text not null, yearenddate date default '2005-09-31', enabcustomer text not null, nocustonlaptop text, laptopretentiontime int(11), reportemail text not null);"); + stmt.executeUpdate("create table configcompany (image text, imagewidth text, imagehight text, coname text, cologo text, coaddress text, cophone text, useletterhead text not null, yearenddate date default '2010-12-31', enabcustomer text not null, nocustonlaptop text, laptopretentiontime int(11), reportemail text not null);"); stmt.executeUpdate("insert into configcompany (image,imagehight, imagewidth, coname, cologo,coaddress,cophone, useletterhead, enabcustomer, reportemail, yearenddate, nocustonlaptop, laptopretentiontime) values ('"+image+"','"+imagehight+"','"+imagewidth+"','"+coname+"','"+cologo+"','"+coaddress+"','"+cophone+"','"+useletterhead+"', '"+enabcustomer+"', '"+reportemail+"', '"+yearenddate+"', 'yes', 4);"); } Modified: trunk/servsys/src/com/pandmservices/dbserver/SyncCustQuotes.java =================================================================== --- trunk/servsys/src/com/pandmservices/dbserver/SyncCustQuotes.java 2010-01-24 19:01:09 UTC (rev 123) +++ trunk/servsys/src/com/pandmservices/dbserver/SyncCustQuotes.java 2010-01-25 22:12:08 UTC (rev 124) @@ -81,7 +81,7 @@ String acolumns= new String("quotenum"); String tqnotes = qnotes.replaceAll("'","''"); - int recordset = stmtu.executeUpdate("INSERT INTO quotes (crecnum, qdate, qdescription, qpayterms, qnotes, qdisc, qadditionalserv, status, solddate, antstart, custsite, sitenum, techid, servsync,combineopts) Values ('"+remotecrecnum+"','" +qdate+ "','" +qdescription+ "','"+qpayterms+"','"+tqnotes+"', '"+qdisc+"','"+qadditionalserv+"', '"+qstatus+"', '"+solddate+"', '"+antstart+"', '"+custsite +"','"+sitenum +"','"+techid +"', '"+servsync+"','"+combineopts+"')",keyColumn); + int recordset = stmtu.executeUpdate("INSERT INTO quotes (crecnum, qdate, qdescription, qpayterms, qnotes, qdisc, qadditionalserv, status, solddate, antstart, custsite, sitenum, techid, servsync,combineopts, jobnum) Values ('"+remotecrecnum+"','" +qdate+ "','" +qdescription+ "','"+qpayterms+"','"+tqnotes+"', '"+qdisc+"','"+qadditionalserv+"', '"+qstatus+"', '"+solddate+"', '"+antstart+"', '"+custsite +"','"+sitenum +"','"+techid +"', '"+servsync+"','"+combineopts+"','"+jobnum+"')",keyColumn); ResultSet rsKeyColumn = stmtu.getGeneratedKeys(); if(rsKeyColumn.next()) { // ADD THIS LINE! IMPORTANT! Modified: trunk/servsys/src/com/pandmservices/dbserver/SyncQuotes.java =================================================================== --- trunk/servsys/src/com/pandmservices/dbserver/SyncQuotes.java 2010-01-24 19:01:09 UTC (rev 123) +++ trunk/servsys/src/com/pandmservices/dbserver/SyncQuotes.java 2010-01-25 22:12:08 UTC (rev 124) @@ -115,7 +115,7 @@ String acolumns= new String("quotenum"); String tqnotes = qnotes.replaceAll("'","''"); - int recordset = stmtu.executeUpdate("INSERT INTO quotes (crecnum, qdate, qdescription, qpayterms, qnotes, qdisc, qadditionalserv, status, solddate, antstart, custsite, sitenum, techid, servsync,combineopts) Values ('"+remotecrecnum+"','" +qdate+ "','" +qdescription+ "','"+qpayterms+"','"+tqnotes+"', '"+qdisc+"','"+qadditionalserv+"', '"+qstatus+"', '"+solddate+"', '"+antstart+"', '"+custsite +"','"+sitenum +"','"+techid +"', '"+servsync+"','"+combineopts+"')",keyColumn); + int recordset = stmtu.executeUpdate("INSERT INTO quotes (crecnum, qdate, qdescription, qpayterms, qnotes, qdisc, qadditionalserv, status, solddate, jobnum, antstart, custsite, sitenum, techid, servsync,combineopts) Values ('"+remotecrecnum+"','" +qdate+ "','" +qdescription+ "','"+qpayterms+"','"+tqnotes+"', '"+qdisc+"','"+qadditionalserv+"', '"+qstatus+"', '"+solddate+"','"+jobnum+"', '"+antstart+"', '"+custsite +"','"+sitenum +"','"+techid +"', '"+servsync+"','"+combineopts+"')",keyColumn); ResultSet rsKeyColumn = stmtu.getGeneratedKeys(); if(rsKeyColumn.next()) { // ADD THIS LINE! IMPORTANT! Modified: trunk/servsys/src/com/pandmservices/dbserver/SyncWorksheets.java =================================================================== --- trunk/servsys/src/com/pandmservices/dbserver/SyncWorksheets.java 2010-01-24 19:01:09 UTC (rev 123) +++ trunk/servsys/src/com/pandmservices/dbserver/SyncWorksheets.java 2010-01-25 22:12:08 UTC (rev 124) @@ -25,6 +25,7 @@ private String custsite=null; private String sitenum=null; private String techid=null; + private String wsnotes=null; private String remotecrecnum=null; private int custnum=0; private int servsync; @@ -33,6 +34,8 @@ private String wsdate=null; //default value to null private String wsdesc=null; //default value to null private String wsmult=null; + private String wsmultlab=null; + private String wsmultsub=null; @@ -80,7 +83,10 @@ this.wsrec = rs2.getInt("wsrec"); this.crec = rs2.getInt("crec"); this.wsmult = rs2.getString("wsmult"); + this.wsmultlab = rs2.getString("wsmultlab"); + this.wsmultsub = rs2.getString("wsmultsub"); this.wsdate = rs2.getString("wsdate"); + this.wsnotes = rs2.getString("wsnotes"); this.wsdesc = rs2.getString("wsdesc"); this.custsite=rs2.getString("custsite"); this.sitenum=rs2.getString("sitenum"); @@ -108,8 +114,8 @@ String acolumns= new String("quotenum"); ///String tqnotes = qnotes.replaceAll("'","''"); -System.out.println("\nINSERT INTO worksheet (crec, wsdate, wsdesc, wsmult) Values ('"+remotecrecnum+"','" +wsdate+ "','" +wsdesc+ "', '"+wsmult+"')\n"); -int recordset=stmtu.executeUpdate("INSERT INTO worksheet (crec, wsdate, wsdesc, wsmult) Values ('"+remotecrecnum+"','" +wsdate+ "','" +wsdesc+ "', '"+wsmult+"')",keyColumn); +System.out.println("\nINSERT INTO worksheet (crec, wsdate, wsdesc, wsmult, wsmultlab, wsmultsub) Values ('"+remotecrecnum+"','" +wsdate+ "','" +wsdesc+ "', '"+wsmult+"')\n"); +int recordset=stmtu.executeUpdate("INSERT INTO worksheet (crec, wsdate, wsdesc, wsmult, wsmultlab, wsmultsub, wsnotes) Values ('"+remotecrecnum+"','" +wsdate+ "','" +wsdesc+ "', '"+wsmult+"', '"+wsmultlab+"', '"+wsmultsub+"', '"+wsnotes+"')",keyColumn); ResultSet rsKeyColumn = stmtu.getGeneratedKeys(); if(rsKeyColumn.next()) { // ADD THIS LINE! IMPORTANT! ID = rsKeyColumn.getString(1); @@ -133,11 +139,13 @@ int laborhours = tp.getWsLaborHours(); int shophours = tp.getWsShopHours(); double laborcost = tp.getWsLaborCost(); + double subcost = tp.getWsSubCost(); String scost=""+cost+""; + String ssubcost=""+subcost+""; String slaborcost=""+laborcost+""; String titem = item.replaceAll("'","''"); - UniWsItems.AddItem(conu,Integer.parseInt(ID),titem,keycode,quantity,scost,laborhours,slaborcost,shophours); + UniWsItems.AddItem(conu,Integer.parseInt(ID),titem,keycode,quantity,scost,laborhours,slaborcost,shophours,ssubcost); } Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-24 19:01:09 UTC (rev 123) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-25 22:12:08 UTC (rev 124) @@ -3003,9 +3003,9 @@ int result=stmt.executeUpdate("DROP TABLE IF EXISTS masterworksheet;"); result=stmt.executeUpdate("DROP TABLE IF EXISTS masterwsitem;"); // Rebuild Local Tables - result=stmt.executeUpdate("create table masterworksheet (wsrec int(11) NOT NULL auto_increment,wsdesc text NOT NULL, wsdate date NOT NULL default '2000-01-01',wsnotes text NOT NULL,wsmult decimal(10,2) NOT NULL default '0.00',PRIMARY KEY (wsrec),KEY wsrec (wsrec));"); + result=stmt.executeUpdate("create table masterworksheet (wsrec int(11) NOT NULL auto_increment,wsdesc text NOT NULL, wsdate date NOT NULL default '2000-01-01',wsnotes text NOT NULL,wsmult decimal(10,2) NOT NULL default '0.00',wsmultlab decimal(10,2) NOT NULL default '0.00',wsmultsub decimal(10,2) NOT NULL default '0.00',PRIMARY KEY (wsrec),KEY wsrec (wsrec));"); - result=stmt.executeUpdate("CREATE TABLE masterwsitem ( wsrec int(11) NOT NULL default '0',itemrec int(11) NOT NULL auto_increment,item text NOT NULL,keycode text NOT NULL,quantity int(11) NOT NULL default '0',cost decimal(10,2) NOT NULL default '0.00',laborhours int(11) NOT NULL default '0', laborcost decimal(10,2) NOT NULL default '0.00',shophours int(11) NOT NULL default '0',UNIQUE KEY itemrec_2 (itemrec),KEY itemrec (itemrec));"); + result=stmt.executeUpdate("CREATE TABLE masterwsitem ( wsrec int(11) NOT NULL default '0',itemrec int(11) NOT NULL auto_increment,item text NOT NULL,keycode text NOT NULL,quantity int(11) NOT NULL default '0',cost decimal(10,2) NOT NULL default '0.00',laborhours int(11) NOT NULL default '0', laborcost decimal(10,2) NOT NULL default '0.00',shophours int(11) NOT NULL default '0' , subcost decimal(10,2) NOT NULL default '0.00',UNIQUE KEY itemrec_2 (itemrec),KEY itemrec (itemrec));"); // Get Master Worksheet Items Vector vw; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2010-01-24 19:01:19
|
Revision: 123 http://servsys.svn.sourceforge.net/servsys/?rev=123&view=rev Author: molnar_c Date: 2010-01-24 19:01:09 +0000 (Sun, 24 Jan 2010) Log Message: ----------- Continued adding the ability to change labar, parts, and subcontractor markup Modified Paths: -------------- trunk/servsys/src/com/pandmservices/UniMasterWorksheet.java trunk/servsys/src/com/pandmservices/UniWorksheet.java trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/src/com/pandmservices/UniMasterWorksheet.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniMasterWorksheet.java 2010-01-24 01:05:56 UTC (rev 122) +++ trunk/servsys/src/com/pandmservices/UniMasterWorksheet.java 2010-01-24 19:01:09 UTC (rev 123) @@ -14,6 +14,8 @@ private String wsdate=null; //default value to null private String wsdesc=null; //default value to null private String wsmult=null; + private String wsmultlab=null; + private String wsmultsub=null; public UniMasterWorksheet (Connection c, int id) @@ -26,6 +28,8 @@ throw new TodoException("Record not found, id = " + id); } this.wsrec = rs.getInt("wsrec"); + this.wsmultlab=rs.getString("wsmultlab"); + this.wsmultsub=rs.getString("wsmultsub"); this.wsmult = rs.getString("wsmult"); this.wsdate = rs.getString("wsdate"); this.wsdesc = rs.getString("wsdesc"); @@ -119,11 +123,11 @@ } -public static void AddItem(Connection con, String wsdate, String wsdescription, String wsmult) +public static void AddItem(Connection con, String wsdate, String wsdescription, String wsmult, String wsmultlab, String wsmultsub) throws SQLException { Statement stmt = con.createStatement(); - stmt.executeUpdate("INSERT INTO masterworksheet (wsdate, wsdesc, wsmult, wsnotes) Values ('" +wsdate+ "','" +wsdescription+ "', '"+wsmult+"','-')"); + stmt.executeUpdate("INSERT INTO masterworksheet (wsdate, wsdesc, wsmult, wsnotes, wsmultlab, wsmultsub) Values ('" +wsdate+ "','" +wsdescription+ "', '"+wsmult+"','-', '"+wsmultlab+"', '"+wsmultsub+"')"); } public static Vector getMaxItem(Connection c) @@ -146,6 +150,8 @@ public int getWsRec() { return wsrec; } public String getWsMult() { return wsmult; } + public String getWsMultLab() { return wsmultlab; } + public String getWsMultSub() { return wsmultsub; } public String getWsDate() { return wsdate; } public String getWsDesc() { return wsdesc; } Modified: trunk/servsys/src/com/pandmservices/UniWorksheet.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniWorksheet.java 2010-01-24 01:05:56 UTC (rev 122) +++ trunk/servsys/src/com/pandmservices/UniWorksheet.java 2010-01-24 19:01:09 UTC (rev 123) @@ -41,7 +41,7 @@ this.techid=rs.getString("techid"); this.servsync=rs.getInt("servsync"); this.wsmultlab = rs.getString("wsmultlab"); - this.wsmult = rs.getString("wsmultsub"); + this.wsmultsub = rs.getString("wsmultsub"); } Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-24 01:05:56 UTC (rev 122) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-24 19:01:09 UTC (rev 123) @@ -11009,14 +11009,17 @@ out.println("<input type=\"text\" name=\"cost\">"); out.println("</p>"); out.println("<p>Labor Hours :"); - out.println("<input type=\"text\" value=\"0.00\" name=\"laborhours\">"); + out.println("<input type=\"text\" value=\"0\" name=\"laborhours\">"); out.println("</p>"); out.println("<p>Shop Hours :"); - out.println("<input type=\"text\" value=\"0.00\" name=\"shophours\">"); + out.println("<input type=\"text\" value=\"0\" name=\"shophours\">"); out.println("</p>"); out.println("<p>Labor Cost :"); out.println("<input type=\"text\" name=\"laborcost\" value=\""+doGetLaborCost()+"\">"); out.println("</p>"); + out.println("<p>Sub Cost :"); + out.println("<input type=\"text\" name=\"subcost\" value=\"0.00\">"); + out.println("</p>"); out.println("<input type=\"hidden\" name=\"wsnum\" value=\""+wsrec+"\">"); out.println("<input type=\"hidden\" name=\"custnum\" value=\""+custrec+"\">"); out.println("<p> <CENTER>"); @@ -23562,6 +23565,7 @@ int quantity=0; double cost=0.00; double subcost=0.00; + double totsubcost=0.00; int laborhours=0; int shophours=0; double laborcost=0; @@ -23669,15 +23673,16 @@ laborhours = tp.getWsLaborHours(); shophours = tp.getWsShopHours(); laborcost = tp.getWsLaborCost(); + subcost=tp.getWsSubCost(); double subtot=cost*quantity; subtotlabor=(shophours+laborhours)*laborcost; - + totsubcost=totsubcost+subcost; totinvestment=totinvestment+subtot; totlabor = totlabor+subtotlabor; totlaborhours = totlaborhours+laborhours; totshophours = totshophours+shophours; - out.println("<tr><td>"+item+"</td><td>"+keycode+"</td><td>"+quantity+"</td><td>"+NumberFormat.getCurrencyInstance().format(cost)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtot)+"</td><td>"+laborhours+"</td><td>"+shophours+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtotlabor)+"</td></tr>"); + out.println("<tr><td>"+item+"</td><td>"+keycode+"</td><td>"+quantity+"</td><td>"+NumberFormat.getCurrencyInstance().format(cost)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtot)+"</td><td>"+laborhours+"</td><td>"+shophours+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtotlabor)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subcost)+"</td></tr>"); } double partmarkup = totinvestment * doGetPartMult(); @@ -23685,7 +23690,7 @@ double adjtotlabor = (totlaborhours+totshophours) * doGetLabMult(); //double fsellprice = (totlabor+partmarkup)/awsmult; double laborsellprice = (laborcost*adjtotlabor)/awsmultlab; - double subsellprice = subcost/awsmultsub; + double subsellprice = totsubcost/awsmultsub; double partsellprice = partmarkup/awsmult; double fsellprice = laborsellprice+partsellprice+subsellprice; double lsellprice = (totlabor*doGetGpToLabor())+totlabor+partmarkup; @@ -24055,6 +24060,7 @@ String investment=null; double qtotal=0.00; +log("Action: Enter Edit Worksheet"); Vector vv; vv = UniWorksheet.getIndItem(con,crecnum,wsnum); @@ -24068,6 +24074,7 @@ wsmultlab=tt.getWsMultLab(); wsmultsub=tt.getWsMultSub(); } +log("Action: Get worksheet information"); if (Double.parseDouble(wsmult)!=0.00) { awsmult = Double.parseDouble(wsmult); } @@ -24076,20 +24083,23 @@ } +log("Action: Part markup = "+awsmult+""); if (Double.parseDouble(wsmultlab)!=0.00) { awsmultlab = Double.parseDouble(wsmultlab); } else { - awsmultlab = awsmult; + awsmultlab = doGetMarkUpDiv(); } +log("Action: labor markup = "+awsmultlab+""); if (Double.parseDouble(wsmultsub)!=0.00) { awsmultsub = Double.parseDouble(wsmultsub); } else { - awsmultsub = awsmult; + awsmultsub = doGetMarkUpDiv(); } - +log("Action: sub markup = "+awsmultsub+""); +log("Action: Edit Worksheet missing items"); out.println("<html>"); out.println("<head>"); out.println("<title>Edit Worksheet</title>"); @@ -24119,10 +24129,10 @@ out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\">"); out.println("<INPUT TYPE=\"reset\">"); out.println("</CENTER></form>"); - +log("Action: Form complete"); out.println("<br><br><br><table border=\"1\" width=\"100%\">"); out.println("<tr><th>Item Name</th><th>Keycode<br>Part #</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th><th>Sub Cost</th><th>Delete</th></tr>"); - +log("Action: Edit Worksheet Top Items"); Vector vp; vp = UniWsItems.getAllItems(con,wsnum); for (int j = 0 ; j < vp.size(); j++) @@ -24187,15 +24197,18 @@ out.println("<tr><td>"); out.println("Total Labor Cost</td><td>"+ NumberFormat.getCurrencyInstance().format(adjtotlabor*laborcost)+""); out.println("</td></tr>"); - out.println("<tr><td>"); - out.println("<b>Total Cost</td><td>"+ NumberFormat.getCurrencyInstance().format(adjtotlabor*laborcost+partmarkup)+"</b>"); + out.println("Total Sub Cost</td><td>"+ NumberFormat.getCurrencyInstance().format(totsubcost)+""); out.println("</td></tr>"); out.println("<tr><td>"); - out.println("<b>Total Cost / "+awsmult+"</td><td>"+ NumberFormat.getCurrencyInstance().format(fsellprice)+"</b>"); - out.println("</td></tr>"); + out.println("<b>Total Cost</td><td>"+ NumberFormat.getCurrencyInstance().format(adjtotlabor*laborcost+partmarkup+totsubcost)+"</b>"); + out.println("</td></tr></table>"); + //out.println("<tr><td>"); + //out.println("<b>Total Cost / "+awsmult+"</td><td>"+ NumberFormat.getCurrencyInstance().format(fsellprice)+"</b>"); + //out.println("</td></tr>"); + /* out.println("<tr><td>"); out.println("Sell Price-Direct Cost</td><td>"+ NumberFormat.getCurrencyInstance().format(fsellprice-partmarkup-totlabor)+""); @@ -24216,6 +24229,9 @@ out.println("</td></tr>"); } else { */ + + out.println("<br><br>"); + out.println("<table width=\"75%\" border=1>"); out.println("<tr><td>"); out.println("<b>Parts Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(partsellprice)+"</b>"); out.println("</td></tr>"); @@ -24371,6 +24387,8 @@ String keycode=""; int quantity=0; String wsmult=null; + String wsmultsub=null; + String wsmultlab=null; double cost=0.00; int laborhours=0; double subcost=0.00; @@ -24388,9 +24406,11 @@ UniWorksheet tt = (UniWorksheet) vv.elementAt(i); wsdate=tt.getWsDate(); wsmult=tt.getWsMult(); + wsmultsub=tt.getWsMultSub(); + wsmultlab=tt.getWsMultLab(); wsdescription=tt.getWsDesc(); } - UniMasterWorksheet.AddItem(con2, wsdate, wsdescription, wsmult); + UniMasterWorksheet.AddItem(con2, wsdate, wsdescription, wsmult, wsmultlab, wsmultsub); Vector v; @@ -24755,6 +24775,7 @@ keycode = tp.getWsKeyCode(); quantity = tp.getWsQuant(); laborhours = tp.getWsLaborHours(); + subcost = tp.getWsSubCost(); shophours = tp.getWsShopHours(); cost=tp.getWsCost(); laborcost=tp.getWsLaborCost(); @@ -24803,6 +24824,7 @@ int totlaborhours=0; int totshophours=0; double totlabor=0.00; + double totsubcost=0.00; double subtotlabor=0.00; int wsrec=0; @@ -24814,8 +24836,13 @@ int laborhours=0; int shophours=0; double laborcost=0; + double subcost=0.00; double awsmult=0.00; + double awsmultlab=0.00; + double awsmultsub=0.00; String wsmult=null; + String wsmultlab=null; + String wsmultsub=null; String investment=null; double qtotal=0.00; @@ -24829,14 +24856,27 @@ wsdate=tt.getWsDate(); wsdescription=tt.getWsDesc(); wsmult=tt.getWsMult(); + wsmultlab=tt.getWsMultLab(); + wsmultsub=tt.getWsMultSub(); } if (Double.parseDouble(wsmult)!=0.00) { awsmult = Double.parseDouble(wsmult); } else { awsmult = doGetMarkUpDiv(); - } + if (Double.parseDouble(wsmultlab)!=0.00) { + awsmultlab = Double.parseDouble(wsmultlab); + } + else { + awsmultlab = awsmult; + } + if (Double.parseDouble(wsmultsub)!=0.00) { + awsmultsub = Double.parseDouble(wsmultsub); + } + else { + awsmultsub = awsmult; + } String custsite = doGetCustSite(crecnum); String login=(String)session.getAttribute("login"); String sitenum = doGetSiteNum(crecnum); @@ -24878,15 +24918,17 @@ laborhours = tp.getWsLaborHours(); shophours = tp.getWsShopHours(); laborcost = tp.getWsLaborCost(); + subcost=tp.getWsSubCost(); double subtot=cost*quantity; subtotlabor=(shophours+laborhours)*laborcost*doGetLabMult(); totinvestment=totinvestment+subtot; + totsubcost=totsubcost+subcost; totlabor = totlabor+subtotlabor; totlaborhours = totlaborhours+laborhours; totshophours = totshophours+shophours; double partmarkup = subtot * doGetPartMult(); //double ifsellprice = (subtotlabor+partmarkup)/doGetMarkUpDiv(); - double ifsellprice = (subtotlabor+partmarkup)/awsmult; + double ifsellprice = (subtotlabor/awsmultlab)+(partmarkup/awsmult)+(subcost/awsmultsub); String techid=(String)session.getAttribute("login"); double ilsellprice = (subtotlabor*doGetGpToLabor())+subtotlabor+partmarkup; //if (lsellprice > fsellprice) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2010-01-24 01:06:03
|
Revision: 122 http://servsys.svn.sourceforge.net/servsys/?rev=122&view=rev Author: molnar_c Date: 2010-01-24 01:05:56 +0000 (Sun, 24 Jan 2010) Log Message: ----------- Added subcontractor costs Changed keycode description All changes on worksheets and master worksheets Modified Paths: -------------- trunk/servsys/src/com/pandmservices/UniMasterWsItems.java trunk/servsys/src/com/pandmservices/UniWorksheet.java trunk/servsys/src/com/pandmservices/UniWsItems.java trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/src/com/pandmservices/UniMasterWsItems.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniMasterWsItems.java 2010-01-22 01:47:55 UTC (rev 121) +++ trunk/servsys/src/com/pandmservices/UniMasterWsItems.java 2010-01-24 01:05:56 UTC (rev 122) @@ -16,6 +16,7 @@ private int quantity=0; //default value to null private double cost=0; //default value to null private double laborcost=0; //default value to null + private double subcost=0; private int laborhours=0; private int shophours=0; @@ -38,6 +39,7 @@ this.laborhours = rs.getInt("laborhours"); this.shophours = rs.getInt("shophours"); this.laborcost = rs.getDouble("laborcost"); + this.subcost=rs.getDouble("subcost"); } @@ -99,18 +101,18 @@ } - public static void UpdateItem(Connection con, int itemrec, int wsrec, String item, String keycode, int quantity, String cost, int laborhours, String laborcost, int shophours ) + public static void UpdateItem(Connection con, int itemrec, int wsrec, String item, String keycode, int quantity, String cost, int laborhours, String laborcost, int shophours, String subcost ) throws SQLException { Statement stmt = con.createStatement(); - stmt.executeUpdate("Update masterwsitem Set wsrec='" +wsrec+ "',item = '"+item+"', keycode = '"+keycode +"',quantity = '"+quantity +"',cost = '"+cost +"', laborhours = '"+laborhours+"', laborcost = '"+laborcost+"', shophours = '"+shophours+"' Where itemrec=" + itemrec + ";"); + stmt.executeUpdate("Update masterwsitem Set wsrec='" +wsrec+ "',item = '"+item+"', keycode = '"+keycode +"',quantity = '"+quantity +"',cost = '"+cost +"', laborhours = '"+laborhours+"', laborcost = '"+laborcost+"', shophours = '"+shophours+"', subcost = '"+subcost+"' Where itemrec=" + itemrec + ";"); } -public static void AddItem(Connection con, int wsrec, String item, String keycode, int quantity, String cost, int laborhours, String laborcost, int shophours) +public static void AddItem(Connection con, int wsrec, String item, String keycode, int quantity, String cost, int laborhours, String laborcost, int shophours, String subcost) throws SQLException { Statement stmt = con.createStatement(); - stmt.executeUpdate("INSERT INTO masterwsitem (wsrec, item, keycode, quantity, cost, laborhours, laborcost, shophours) Values ('" +wsrec+ "','" +item + "','"+keycode +"','"+quantity +"','"+cost+"','"+laborhours+"','"+laborcost+"','"+shophours+"')"); + stmt.executeUpdate("INSERT INTO masterwsitem (wsrec, item, keycode, quantity, cost, laborhours, laborcost, shophours, subcost) Values ('" +wsrec+ "','" +item + "','"+keycode +"','"+quantity +"','"+cost+"','"+laborhours+"','"+laborcost+"','"+shophours+"','"+subcost+"')"); } public int getId() { return id; } @@ -122,6 +124,7 @@ public int getWsQuant() { return quantity; } public double getWsCost() { return cost; } public double getWsLaborCost() { return laborcost; } + public double getWsSubCost() { return subcost; } public int getWsLaborHours() { return laborhours; } public int getWsShopHours() { return shophours; } Modified: trunk/servsys/src/com/pandmservices/UniWorksheet.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniWorksheet.java 2010-01-22 01:47:55 UTC (rev 121) +++ trunk/servsys/src/com/pandmservices/UniWorksheet.java 2010-01-24 01:05:56 UTC (rev 122) @@ -14,6 +14,8 @@ private String wsdate=null; //default value to null private String wsdesc=null; //default value to null private String wsmult=null; + private String wsmultlab=null; + private String wsmultsub=null; private String custsite=null; private String sitenum=null; private String techid=null; @@ -38,6 +40,8 @@ this.sitenum=rs.getString("sitenum"); this.techid=rs.getString("techid"); this.servsync=rs.getInt("servsync"); + this.wsmultlab = rs.getString("wsmultlab"); + this.wsmult = rs.getString("wsmultsub"); } @@ -129,19 +133,19 @@ stmt.executeUpdate("Delete From wsitem Where custsite=NULL and sitenum=NULL;"); } - public static void UpdateItem(Connection con, int wsrec, int crec, String wsdate, String wsdescription, String wsmult) + public static void UpdateItem(Connection con, int wsrec, int crec, String wsdate, String wsdescription, String wsmult, String wsmultlab, String wsmultsub) throws SQLException { Statement stmt = con.createStatement(); - stmt.executeUpdate("Update worksheet Set crec='" +crec+ "',wsdate = '"+wsdate+"',wsdesc = '"+wsdescription +"', wsmult='"+wsmult+"', servsync='9' Where wsrec=" + wsrec + ";"); + stmt.executeUpdate("Update worksheet Set crec='" +crec+ "',wsdate = '"+wsdate+"',wsdesc = '"+wsdescription +"', wsmult='"+wsmult+"', wsmultlab='"+wsmultlab+"', wsmultsub='"+wsmultsub+"', servsync='9' Where wsrec=" + wsrec + ";"); } -public static void AddItem(Connection con, int crec, String wsdate, String wsdescription, String wsmult, String custsite, String sitenum, String techid, int servsync) +public static void AddItem(Connection con, int crec, String wsdate, String wsdescription, String wsmult, String custsite, String sitenum, String techid, int servsync, String wsmultlab, String wsmultsub) throws SQLException { Statement stmt = con.createStatement(); //System.out.println("INSERT INTO worksheet (crec, wsdate, wsdesc, wsmult) Values ('"+crec+"','" +wsdate+ "','" +wsdescription+ "', '"+wsmult+"')"); - stmt.executeUpdate("INSERT INTO worksheet (crec, wsdate, wsdesc, wsmult, custsite, sitenum, techid, servsync, wsnotes) Values ('"+crec+"','" +wsdate+ "','" +wsdescription+ "', '"+wsmult+"', '"+custsite+"','"+sitenum+"','"+techid+"','"+servsync+"','-')"); + stmt.executeUpdate("INSERT INTO worksheet (crec, wsdate, wsdesc, wsmult, custsite, sitenum, techid, servsync, wsnotes, wsmultlab, wsmultsub) Values ('"+crec+"','" +wsdate+ "','" +wsdescription+ "', '"+wsmult+"', '"+custsite+"','"+sitenum+"','"+techid+"','"+servsync+"','-', '"+wsmultlab+"','"+wsmultsub+"')"); } public static Vector getMaxItem(Connection c) @@ -171,5 +175,7 @@ public String getCustSite() { return custsite; } public String getTechId() { return techid; } public int getServSync() { return servsync; } + public String getWsMultLab() { return wsmultlab; } + public String getWsMultSub() { return wsmultsub; } } Modified: trunk/servsys/src/com/pandmservices/UniWsItems.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniWsItems.java 2010-01-22 01:47:55 UTC (rev 121) +++ trunk/servsys/src/com/pandmservices/UniWsItems.java 2010-01-24 01:05:56 UTC (rev 122) @@ -16,6 +16,7 @@ private int quantity=0; //default value to null private double cost=0; //default value to null private double laborcost=0; //default value to null + private double subcost=0; private int laborhours=0; private int shophours=0; @@ -38,6 +39,7 @@ this.laborhours = rs.getInt("laborhours"); this.shophours = rs.getInt("shophours"); this.laborcost = rs.getDouble("laborcost"); + this.subcost = rs.getDouble("subcost"); } @@ -83,19 +85,19 @@ } - public static void UpdateItem(Connection con, int itemrec, int wsrec, String item, String keycode, int quantity, String cost, int laborhours, String laborcost, int shophours ) + public static void UpdateItem(Connection con, int itemrec, int wsrec, String item, String keycode, int quantity, String cost, int laborhours, String laborcost, int shophours, String subcost ) throws SQLException { Statement stmt = con.createStatement(); - stmt.executeUpdate("Update wsitem Set wsrec='" +wsrec+ "',item = '"+item+"', keycode = '"+keycode +"',quantity = '"+quantity +"',cost = '"+cost +"', laborhours = '"+laborhours+"', laborcost = '"+laborcost+"', shophours = '"+shophours+"' Where itemrec=" + itemrec + ";"); + stmt.executeUpdate("Update wsitem Set wsrec='" +wsrec+ "',item = '"+item+"', keycode = '"+keycode +"',quantity = '"+quantity +"',cost = '"+cost +"', laborhours = '"+laborhours+"', laborcost = '"+laborcost+"', shophours = '"+shophours+"', subcost='"+subcost+"' Where itemrec=" + itemrec + ";"); } -public static void AddItem(Connection con, int wsrec, String item, String keycode, int quantity, String cost, int laborhours, String laborcost, int shophours) +public static void AddItem(Connection con, int wsrec, String item, String keycode, int quantity, String cost, int laborhours, String laborcost, int shophours, String subcost) throws SQLException { Statement stmt = con.createStatement(); - System.out.println("INSERT INTO wsitem (wsrec, item, keycode, quantity, cost, laborhours, laborcost, shophours) Values ('" +wsrec+ "','" +item + "','"+keycode +"','"+quantity +"','"+cost+"','"+laborhours+"','"+laborcost+"','"+shophours+"')"); - stmt.executeUpdate("INSERT INTO wsitem (wsrec, item, keycode, quantity, cost, laborhours, laborcost, shophours) Values ('" +wsrec+ "','" +item + "','"+keycode +"','"+quantity +"','"+cost+"','"+laborhours+"','"+laborcost+"','"+shophours+"')"); + //System.out.println("INSERT INTO wsitem (wsrec, item, keycode, quantity, cost, laborhours, laborcost, shophours) Values ('" +wsrec+ "','" +item + "','"+keycode +"','"+quantity +"','"+cost+"','"+laborhours+"','"+laborcost+"','"+shophours+"')"); + stmt.executeUpdate("INSERT INTO wsitem (wsrec, item, keycode, quantity, cost, laborhours, laborcost, shophours, subcost) Values ('" +wsrec+ "','" +item + "','"+keycode +"','"+quantity +"','"+cost+"','"+laborhours+"','"+laborcost+"','"+shophours+"', '"+subcost+"')"); } public int getId() { return id; } @@ -108,6 +110,7 @@ public double getWsCost() { return cost; } public double getWsLaborCost() { return laborcost; } public int getWsLaborHours() { return laborhours; } + public double getWsSubCost() { return subcost; } public int getWsShopHours() { return shophours; } Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-22 01:47:55 UTC (rev 121) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-24 01:05:56 UTC (rev 122) @@ -36,6 +36,8 @@ import org.apache.commons.io.*; //import org.apache.commons.beanutils.*; //import org.apache.commons.beanutils.MethodUtils; +import java.io.FileOutputStream; +import java.io.IOException; public class UniCash extends HttpServlet { @@ -3032,10 +3034,12 @@ int laborhours = tp.getWsLaborHours(); int shophours = tp.getWsShopHours(); double cost=tp.getWsCost(); + double subcost=tp.getWsSubCost(); double laborcost=tp.getWsLaborCost(); String scost= ""+cost+""; + String ssubcost=""+subcost+""; String slaborcost=""+laborcost+""; - UniMasterWsItems.AddItem(con,wsrec,item,keycode,quantity,scost,laborhours,slaborcost,shophours); + UniMasterWsItems.AddItem(con,wsrec,item,keycode,quantity,scost,laborhours,slaborcost,shophours, ssubcost); } printHeader(req, res, out, username); @@ -6420,16 +6424,28 @@ } //RELEASE_VERSION - vnumber = "2.50"; + vnumber = "2.51"; + + if (dbvnumber.equalsIgnoreCase("2.50")) { + Statement stmtu2 = con.createStatement(); + int result251z = stmtu2.executeUpdate("UPDATE version set vnumber='2.51';"); + int result251x = stmtu2.executeUpdate("UPDATE version set vdate='2010-01-23';"); + int result251a = stmtu2.executeUpdate("alter table worksheet add wsmultlab decimal(10,2) default 0.00 after techid;"); + int result251b = stmtu2.executeUpdate("alter table worksheet add wsmultsub decimal(10,2) default 0.00 after wsmultlab;"); + int result251c = stmtu2.executeUpdate("alter table masterworksheet add wsmultlab decimal(10,2) default 0.00 after wsmult;"); + int result251d = stmtu2.executeUpdate("alter table masterworksheet add wsmultsub decimal(10,2) default 0.00 after wsmultlab;"); + int result251e = stmtu2.executeUpdate("alter table masterwsitem add subcost decimal(10,2) default 0.00 after shophours;"); + int result251f = stmtu2.executeUpdate("alter table wsitem add subcost decimal(10,2) default 0.00 after techid;"); + } if (dbvnumber.equalsIgnoreCase("2.31")) { Statement stmtu2 = con.createStatement(); - int result230z = stmtu2.executeUpdate("UPDATE version set vnumber='2.50';"); - int result230x = stmtu2.executeUpdate("UPDATE version set vdate='2010-01-21';"); + int result250z = stmtu2.executeUpdate("UPDATE version set vnumber='2.50';"); + int result250x = stmtu2.executeUpdate("UPDATE version set vdate='2010-01-21';"); } if (dbvnumber.equalsIgnoreCase("2.30")) { Statement stmtu2 = con.createStatement(); - int result230z = stmtu2.executeUpdate("UPDATE version set vnumber='2.31';"); - int result230x = stmtu2.executeUpdate("UPDATE version set vdate='2009-08-01';"); + int result231z = stmtu2.executeUpdate("UPDATE version set vnumber='2.31';"); + int result231x = stmtu2.executeUpdate("UPDATE version set vdate='2009-08-01';"); } if (dbvnumber.equalsIgnoreCase("2.29")) { Statement stmtu2 = con.createStatement(); @@ -8676,6 +8692,8 @@ String custnum=req.getParameter("custnum"); String wsnum=req.getParameter("wsnum"); out.println("<html><head><title>Proposal System</title></head><body><table width=60% border=1>"); + + out.println("<br><br><br><a href="+classdir+"UniCash?action=editws&custnum="+custnum+"&wsnum="+wsnum+">Back to Worksheet</a></body></html>"); out.println("<tr>"); out.println("<th>Category</th>"); out.println("</tr>"); @@ -10898,6 +10916,7 @@ double laborcost = 0.00; int laborhours = 0; int shophours = 0; + double subcost = 0.00; int counter=0; for (int i = 0 ; i < v.size(); i++) @@ -10911,6 +10930,7 @@ laborhours = t.getWsLaborHours(); shophours = t.getWsShopHours(); laborcost = t.getWsLaborCost(); + subcost = t.getWsSubCost(); } out.println("<html>"); out.println("<head>"); @@ -10920,7 +10940,7 @@ out.println("<p>Item :"); out.println("<input type=\"text\" name=\"item\" value = \""+item+"\">"); out.println("</p>"); - out.println("<p>Keycode :"); + out.println("<p>Keycode or Part # :"); out.println("<input type=\"text\" name=\"keycode\" value = \""+keycode+"\"> "); out.println("</p>"); out.println("<p>Quantity :"); @@ -10937,7 +10957,10 @@ out.println("</p>"); out.println("<p>Labor Cost :"); out.println("<input type=\"text\" name=\"laborcost\" value=\""+laborcost+"\">"); + out.println("<p>Sub Cost :"); + out.println("<input type=\"text\" name=\"subcost\" value = \""+subcost+"\">"); out.println("</p>"); + out.println("</p>"); out.println("<input type=\"hidden\" name=\"itemrec\" value=\""+itemrec+"\">"); out.println("<input type=\"hidden\" name=\"wsnum\" value=\""+wsrec+"\">"); out.println("<input type=\"hidden\" name=\"custnum\" value=\""+custrec+"\">"); @@ -10976,20 +10999,20 @@ out.println("<p>Item :"); out.println("<input type=\"text\" name=\"item\">"); out.println("</p>"); - out.println("<p>Keycode :"); + out.println("<p>Keycode or Part Number :"); out.println("<input type=\"text\" name=\"keycode\" > "); out.println("</p>"); out.println("<p>Quantity :"); out.println("<input type=\"text\" name=\"quantity\">"); out.println("</p>"); - out.println("<p>Cost :"); + out.println("<p>Part Cost :"); out.println("<input type=\"text\" name=\"cost\">"); out.println("</p>"); out.println("<p>Labor Hours :"); - out.println("<input type=\"text\" name=\"laborhours\">"); + out.println("<input type=\"text\" value=\"0.00\" name=\"laborhours\">"); out.println("</p>"); out.println("<p>Shop Hours :"); - out.println("<input type=\"text\" name=\"shophours\">"); + out.println("<input type=\"text\" value=\"0.00\" name=\"shophours\">"); out.println("</p>"); out.println("<p>Labor Cost :"); out.println("<input type=\"text\" name=\"laborcost\" value=\""+doGetLaborCost()+"\">"); @@ -11171,7 +11194,7 @@ out.println("<p>Item :"); out.println("<input type=\"text\" name=\"item\" value=\""+item+"\">"); out.println("</p>"); - out.println("<p>Keycode :"); + out.println("<p>Keycode or Part # :"); out.println("<input type=\"text\" name=\"keycode\" value=\""+keycode+"\" > "); out.println("</p>"); out.println("<p>Quantity :"); @@ -11891,13 +11914,14 @@ String tquantity = req.getParameter("quantity"); int quantity = Integer.parseInt(tquantity); String cost = req.getParameter("cost"); + String subcost = req.getParameter("subcost"); String tlaborhours = req.getParameter("laborhours"); int laborhours = Integer.parseInt(tlaborhours); String tshophours = req.getParameter("shophours"); int shophours = Integer.parseInt(tshophours); String laborcost = req.getParameter("laborcost"); - UniWsItems.UpdateItem(con, itemrec, wsrec, item, keycode, quantity, cost, laborhours, laborcost, shophours); + UniWsItems.UpdateItem(con, itemrec, wsrec, item, keycode, quantity, cost, laborhours, laborcost, shophours, subcost); con.close(); res.sendRedirect(""+classdir+"UniCash?action=editws&wsnum="+wsnum+"&custnum="+custnum+""); } @@ -11914,6 +11938,7 @@ String tquantity = req.getParameter("quantity"); int quantity = Integer.parseInt(tquantity); String cost = req.getParameter("cost"); + String subcost = req.getParameter("subcost"); String tlaborhours = req.getParameter("laborhours"); int laborhours = Integer.parseInt(tlaborhours); String tshophours = req.getParameter("shophours"); @@ -11923,7 +11948,7 @@ BigDecimal d = new BigDecimal(cost); d = d.setScale(2, BigDecimal.ROUND_HALF_UP); String cost2 = d.toString(); - UniWsItems.AddItem(con, wsrec, item, keycode, quantity, cost2, laborhours, laborcost, shophours); + UniWsItems.AddItem(con, wsrec, item, keycode, quantity, cost2, laborhours, laborcost, shophours, subcost); con.close(); res.sendRedirect(""+classdir+"UniCash?action=editws&wsnum="+wsnum+"&custnum="+custnum+"&adjper="+adjper+""); } @@ -22334,6 +22359,8 @@ out.println("<input type=\"hidden\" name=\"custstart\" value=\""+custstart+"\">"); out.println("<input type=\"hidden\" name=\"custstop\" value=\""+custstop+"\">"); out.println("<input type=\"hidden\" name=\"wsmult\" value=\""+doGetMarkUpDiv()+"\">"); + out.println("<input type=\"hidden\" name=\"wsmultlab\" value=\""+doGetMarkUpDiv()+"\">"); + out.println("<input type=\"hidden\" name=\"wsmultsub\" value=\""+doGetMarkUpDiv()+"\">"); out.println("</table>"); out.println("<p> <CENTER>"); out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\">"); @@ -22570,13 +22597,15 @@ String tcustnum = req.getParameter("custnum"); String twsnum = req.getParameter("contnum"); String wsmult = req.getParameter("wsmult"); + String wsmultlab = req.getParameter("wsmultlab"); + String wsmultsub = req.getParameter("wsmultsub"); String custstart = req.getParameter("custstart"); String custstop = req.getParameter("custstop"); int custnum = Integer.parseInt(tcustnum); int wsnum = Integer.parseInt(twsnum); String wsdescription = req.getParameter("wsdescription"); String wsdate = req.getParameter("wsdate"); - UniWorksheet.UpdateItem(con, wsnum, custnum, doFormatDateDb(getDateDb(wsdate)), wsdescription, wsmult); + UniWorksheet.UpdateItem(con, wsnum, custnum, doFormatDateDb(getDateDb(wsdate)), wsdescription, wsmult, wsmultlab, wsmultsub); out.println("Your item has been updated in the database<br>"); con.close(); res.sendRedirect(""+classdir+"UniCash?action=showcustdetail&csection=6&custnum="+custnum+"&custstart="+custstart+"&custstop="+custstop+""); @@ -22646,13 +22675,15 @@ String custstop = req.getParameter("custstop"); int custnum = Integer.parseInt(tcustnum); String wsmult = req.getParameter("wsmult"); + String wsmultlab = req.getParameter("wsmultlab"); + String wsmultsub = req.getParameter("wsmultsub"); String wsdescription = req.getParameter("wssummary"); String wsdate = req.getParameter("wsdate"); String custsite = doGetCustSite(custnum); String sitenum = doGetSiteNum(custnum); int servsync=0; String login=(String)session.getAttribute("login"); - UniWorksheet.AddItem(con, custnum, doFormatDateDb(getDateDb(wsdate)), wsdescription, wsmult, custsite, sitenum,login, 0); + UniWorksheet.AddItem(con, custnum, doFormatDateDb(getDateDb(wsdate)), wsdescription, wsmult, custsite, sitenum,login, 0, wsmultlab, wsmultsub); con.close(); out.println("Your item has been updated in the database<br>"); res.sendRedirect(""+classdir+"UniCash?action=showcustdetail&csection=6&custnum="+custnum+"&custstart="+custstart+"&custstop="+custstop+""); @@ -22826,6 +22857,7 @@ String keycode=""; int quantity=0; double cost=0.00; + double subcost=0.00; int laborhours=0; int shophours=0; double laborcost=0; @@ -22907,7 +22939,7 @@ mbody=combinestring(mbody,"</table>"); mbody=combinestring(mbody,"<br><br><br><table border=\"1\" width=\"100%\">"); - mbody=combinestring(mbody,"<tr><th>Item Name</th><th>Keycode</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th></tr>"); + mbody=combinestring(mbody,"<tr><th>Item Name</th><th>Keycode<br>Part #</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th></tr>"); Vector vp; vp = UniWsItems.getAllItems(con,wsnum); @@ -22924,6 +22956,7 @@ laborhours = tp.getWsLaborHours(); shophours = tp.getWsShopHours(); laborcost = tp.getWsLaborCost(); + subcost = tp.getWsSubCost(); double subtot=cost*quantity; subtotlabor=(shophours+laborhours)*laborcost; @@ -23076,6 +23109,7 @@ int totlaborhours=0; int totshophours=0; double totlabor=0.00; + double subcost=0.00; double subtotlabor=0.00; int itemrec=0; String item=null; @@ -23085,6 +23119,7 @@ int laborhours=0; int shophours=0; double laborcost=0; + double totsubcost=0.00; double awsmult=0.00; String wsmult=""; String investment=null; @@ -23144,7 +23179,7 @@ mbody=combinestring(mbody,"</tr>"); mbody=combinestring(mbody,"</table>"); mbody=combinestring(mbody,"<br><br><br><table border=\"1\" width=\"100%\">"); - mbody=combinestring(mbody,"<tr><th>Item Name</th><th>Keycode</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th></tr>"); + mbody=combinestring(mbody,"<tr><th>Item Name</th><th>Keycode<br>Part #</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th><th>Sub Cost</th></tr>"); Vector vp; vp = UniWsItems.getAllItems(con,wsnum); for (int j = 0 ; j < vp.size(); j++) @@ -23156,16 +23191,18 @@ keycode = tp.getWsKeyCode(); quantity = tp.getWsQuant(); cost = tp.getWsCost(); + subcost=tp.getWsSubCost(); laborhours = tp.getWsLaborHours(); shophours = tp.getWsShopHours(); laborcost = tp.getWsLaborCost(); double subtot=cost*quantity; subtotlabor=(shophours+laborhours)*laborcost; totinvestment=totinvestment+subtot; + totsubcost=totsubcost+subcost; totlabor = totlabor+subtotlabor; totlaborhours = totlaborhours+laborhours; totshophours = totshophours+shophours; - mbody=combinestring(mbody,"<tr><td>"+item+"</td><td>"+keycode+"</td><td>"+quantity+"</td><td>"+NumberFormat.getCurrencyInstance().format(cost)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtot)+"</td><td>"+laborhours+"</td><td>"+shophours+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtotlabor)+"</td></tr>"); + mbody=combinestring(mbody,"<tr><td>"+item+"</td><td>"+keycode+"</td><td>"+quantity+"</td><td>"+NumberFormat.getCurrencyInstance().format(cost)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtot)+"</td><td>"+laborhours+"</td><td>"+shophours+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtotlabor)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subcost)+"</td></tr>"); } double partmarkup = totinvestment * doGetPartMult(); @@ -23259,6 +23296,7 @@ int itemquant=0; int itemnum=0; double totinvestment=0.00; + double subcost=0.00; int totlaborhours=0; int totshophours=0; double totlabor=0.00; @@ -23272,6 +23310,7 @@ int laborhours=0; int shophours=0; double laborcost=0; + double totsubcost=0.00; double awsmult=0.00; String wsmult=""; String investment=null; @@ -23340,7 +23379,7 @@ mbody=combinestring(mbody,"</table>"); mbody=combinestring(mbody,"<br><br><br><table border=\"1\" width=\"100%\">"); - mbody=combinestring(mbody,"<tr><th>Item Name</th><th>Keycode</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th></tr>"); + mbody=combinestring(mbody,"<tr><th>Item Name</th><th>Keycode<br>Part #</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th><th>Sub Cost</th></tr>"); Vector vp; vp = UniWsItems.getAllItems(con,wsnum); @@ -23355,17 +23394,19 @@ quantity = tp.getWsQuant(); cost = tp.getWsCost(); laborhours = tp.getWsLaborHours(); + subcost = tp.getWsSubCost(); shophours = tp.getWsShopHours(); laborcost = tp.getWsLaborCost(); double subtot=cost*quantity; subtotlabor=(shophours+laborhours)*laborcost; totinvestment=totinvestment+subtot; + totsubcost = totsubcost + subcost; totlabor = totlabor+subtotlabor; totlaborhours = totlaborhours+laborhours; totshophours = totshophours+shophours; - mbody=combinestring(mbody,"<tr><td>"+item+"</td><td>"+keycode+"</td><td>"+quantity+"</td><td>"+NumberFormat.getCurrencyInstance().format(cost)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtot)+"</td><td>"+laborhours+"</td><td>"+shophours+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtotlabor)+"</td></tr>"); + mbody=combinestring(mbody,"<tr><td>"+item+"</td><td>"+keycode+"</td><td>"+quantity+"</td><td>"+NumberFormat.getCurrencyInstance().format(cost)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtot)+"</td><td>"+laborhours+"</td><td>"+shophours+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtotlabor)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subcost)+"</td></tr>"); } double partmarkup = totinvestment * doGetPartMult(); @@ -23520,11 +23561,16 @@ String keycode=""; int quantity=0; double cost=0.00; + double subcost=0.00; int laborhours=0; int shophours=0; double laborcost=0; double awsmult=0.00; + double awsmultlab=0.00; + double awsmultsub=0.00; String wsmult=""; + String wsmultlab=""; + String wsmultsub=""; String investment=null; double qtotal=0.00; @@ -23553,6 +23599,8 @@ wsdate=doFormatDate(getDate(tt.getWsDate())); wsdescription=tt.getWsDesc(); wsmult=tt.getWsMult(); + wsmultlab=tt.getWsMultLab(); + wsmultsub=tt.getWsMultSub(); } if (Double.parseDouble(wsmult)!=0.00) { awsmult = Double.parseDouble(wsmult); @@ -23561,6 +23609,20 @@ awsmult = doGetMarkUpDiv(); } + if (Double.parseDouble(wsmultlab)!=0.00) { + awsmultlab = Double.parseDouble(wsmultlab); + } + else { + awsmultlab = awsmult; + } + + if (Double.parseDouble(wsmultsub)!=0.00) { + awsmultsub = Double.parseDouble(wsmultsub); + } + else { + awsmultsub = awsmult; + } + out.println("<html><basefont size=2>"); out.println("<html><head><title>Quote Worksheet</title></head>"); doMHeader(req, res, out, session, username); @@ -23590,7 +23652,7 @@ out.println("</table>"); out.println("<br><br><br><table border=\"1\" width=\"100%\">"); - out.println("<tr><th>Item Name</th><th>Keycode</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th></tr>"); + out.println("<tr><th>Item Name</th><th>Keycode<br>Part #</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th></tr>"); Vector vp; vp = UniWsItems.getAllItems(con,wsnum); @@ -23622,10 +23684,12 @@ // HERE IS ADJUSTED LABOR HOUTS double adjtotlabor = (totlaborhours+totshophours) * doGetLabMult(); //double fsellprice = (totlabor+partmarkup)/awsmult; - double fsellprice = ((laborcost*adjtotlabor)+partmarkup)/awsmult; + double laborsellprice = (laborcost*adjtotlabor)/awsmultlab; + double subsellprice = subcost/awsmultsub; + double partsellprice = partmarkup/awsmult; + double fsellprice = laborsellprice+partsellprice+subsellprice; double lsellprice = (totlabor*doGetGpToLabor())+totlabor+partmarkup; totcrewdays = totlaborhours / laborday; - out.println("</table><br><h4>Summary Section</h4>"); out.println("<table width=\"75%\" border=1>"); out.println("<tr><td>"); @@ -23680,6 +23744,15 @@ */ out.println("<tr><td>"); + out.println("<b>Parts Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(partsellprice)+"</b>"); + out.println("</td></tr>"); + out.println("<tr><td>"); + out.println("<b>Labor Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(laborsellprice)+"</b>"); + out.println("</td></tr>"); + out.println("<tr><td>"); + out.println("<b>Subs Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(subsellprice)+"</b>"); + out.println("</td></tr>"); + out.println("<tr><td>"); out.println("<b>Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(fsellprice)+"</b>"); out.println("</td></tr>"); /* @@ -23802,7 +23875,7 @@ out.println("</CENTER></form>"); out.println("<br><br><br><table border=\"1\" width=\"100%\">"); - out.println("<tr><th>Item Name</th><th>Keycode</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th><th>Delete</th></tr>"); + out.println("<tr><th>Item Name</th><th>Keycode<br>Part #</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th><th>Delete</th></tr>"); Vector vp; vp = UniMasterWsItems.getAllItems(con,wsnum); @@ -23958,7 +24031,9 @@ int totlaborhours=0; int totshophours=0; double totlabor=0.00; + double subcost=0.00; double subtotlabor=0.00; + double totsubcost=0.00; int laborday = 16; int wsrec=0; @@ -23968,7 +24043,11 @@ int quantity=0; String twsmult=null; String wsmult=null; + String wsmultlab=null; + String wsmultsub=null; double awsmult=0.00; + double awsmultlab=0.00; + double awsmultsub=0.00; double cost=0.00; int laborhours=0; int shophours=0; @@ -23986,6 +24065,8 @@ wsdate=tt.getWsDate(); wsdescription=tt.getWsDesc(); wsmult=tt.getWsMult(); + wsmultlab=tt.getWsMultLab(); + wsmultsub=tt.getWsMultSub(); } if (Double.parseDouble(wsmult)!=0.00) { awsmult = Double.parseDouble(wsmult); @@ -23995,6 +24076,20 @@ } + if (Double.parseDouble(wsmultlab)!=0.00) { + awsmultlab = Double.parseDouble(wsmultlab); + } + else { + awsmultlab = awsmult; + } + + if (Double.parseDouble(wsmultsub)!=0.00) { + awsmultsub = Double.parseDouble(wsmultsub); + } + else { + awsmultsub = awsmult; + } + out.println("<html>"); out.println("<head>"); out.println("<title>Edit Worksheet</title>"); @@ -24004,9 +24099,15 @@ out.println("<tr><td>Date</td><td>"); out.println("<input type=\"text\" name=\"wsdate\" value=\""+doFormatDate(getDate(wsdate))+"\"></td>"); out.println("</tr>"); - out.println("<tr><td>MarkUp</td><td>"); + out.println("<tr><td>Parts MarkUp</td><td>"); out.println("<input type=\"text\" name=\"wsmult\" value=\""+awsmult+"\" size=\"60\" ></td>"); out.println("</tr>"); + out.println("<tr><td>Labor MarkUp</td><td>"); + out.println("<input type=\"text\" name=\"wsmultlab\" value=\""+awsmultlab+"\" size=\"60\" ></td>"); + out.println("</tr>"); + out.println("<tr><td>Subs MarkUp</td><td>"); + out.println("<input type=\"text\" name=\"wsmultsub\" value=\""+awsmultsub+"\" size=\"60\" ></td>"); + out.println("</tr>"); out.println("<tr><td>Summary</td><td>"); out.println("<input type=\"text\" name=\"wsdescription\" value=\""+wsdescription +"\" size=\"60\" ></td>"); out.println("</tr>"); @@ -24020,7 +24121,7 @@ out.println("</CENTER></form>"); out.println("<br><br><br><table border=\"1\" width=\"100%\">"); - out.println("<tr><th>Item Name</th><th>Keycode</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th><th>Delete</th></tr>"); + out.println("<tr><th>Item Name</th><th>Keycode<br>Part #</th><th>Quantity</th><th>Price</th><th>Item Cost</th><th>Labor Hours</th><th>Shop Hours</th><th>Labor Cost</th><th>Sub Cost</th><th>Delete</th></tr>"); Vector vp; vp = UniWsItems.getAllItems(con,wsnum); @@ -24035,6 +24136,7 @@ quantity = tp.getWsQuant(); cost = tp.getWsCost(); laborhours = tp.getWsLaborHours(); + subcost=tp.getWsSubCost(); shophours = tp.getWsShopHours(); laborcost = tp.getWsLaborCost(); double subtot=cost*quantity; @@ -24043,16 +24145,20 @@ totinvestment=totinvestment+subtot; totlabor = totlabor+subtotlabor; totlaborhours = totlaborhours+laborhours; + totsubcost=totsubcost+subcost; totshophours = totshophours+shophours; totcrewdays = totlaborhours / laborday; - out.println("<tr><td><a href=\""+classdir+"UniCash?action=editwsitem&custnum="+crecnum+"&wsnum="+wsrec+"&itemrec="+itemrec+"\">"+item+"</a></td><td>"+keycode+"</td><td>"+quantity+"</td><td>"+NumberFormat.getCurrencyInstance().format(cost)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtot)+"</td><td>"+laborhours+"</td><td>"+shophours+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtotlabor)+"</td><td><a href="+classdir+"UniCash?action=delwsitem&custnum="+crecnum+"&wsrec="+wsrec+"&itemrec="+itemrec+">Delete</a></td></tr>"); + out.println("<tr><td><a href=\""+classdir+"UniCash?action=editwsitem&custnum="+crecnum+"&wsnum="+wsrec+"&itemrec="+itemrec+"\">"+item+"</a></td><td>"+keycode+"</td><td>"+quantity+"</td><td>"+NumberFormat.getCurrencyInstance().format(cost)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtot)+"</td><td>"+laborhours+"</td><td>"+shophours+"</td><td>"+NumberFormat.getCurrencyInstance().format(subtotlabor)+"</td><td>"+NumberFormat.getCurrencyInstance().format(subcost)+"</td><td><a href="+classdir+"UniCash?action=delwsitem&custnum="+crecnum+"&wsrec="+wsrec+"&itemrec="+itemrec+">Delete</a></td></tr>"); } double partmarkup = totinvestment * doGetPartMult(); // HERE IS ADJUSTED LABOR HOUTS double adjtotlabor = (totlaborhours + totshophours) * doGetLabMult(); //double fsellprice = (totlabor+partmarkup)/awsmult; - double fsellprice = ((laborcost*adjtotlabor)+partmarkup)/awsmult; + double laborsellprice = (laborcost*adjtotlabor)/awsmultlab; + double subsellprice = totsubcost/awsmultsub; + double partsellprice = partmarkup/awsmult; + double fsellprice = laborsellprice+partsellprice+subsellprice; double lsellprice = (totlabor*doGetGpToLabor())+totlabor+partmarkup; totcrewdays = totlaborhours / laborday; out.println("</table><br><h4>Summary Section</h4>"); @@ -24111,6 +24217,15 @@ } else { */ out.println("<tr><td>"); + out.println("<b>Parts Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(partsellprice)+"</b>"); + out.println("</td></tr>"); + out.println("<tr><td>"); + out.println("<b>Labor Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(laborsellprice)+"</b>"); + out.println("</td></tr>"); + out.println("<tr><td>"); + out.println("<b>Subs Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(subsellprice)+"</b>"); + out.println("</td></tr>"); + out.println("<tr><td>"); out.println("<b>Sellprice</td><td>"+ NumberFormat.getCurrencyInstance().format(fsellprice)+"</b>"); out.println("</td></tr>"); // } @@ -24258,6 +24373,7 @@ String wsmult=null; double cost=0.00; int laborhours=0; + double subcost=0.00; int shophours=0; double laborcost=0; @@ -24299,14 +24415,16 @@ itemrec = tp.getItemRec(); item = tp.getWsItem(); keycode = tp.getWsKeyCode(); + subcost = tp.getWsSubCost(); quantity = tp.getWsQuant(); laborhours = tp.getWsLaborHours(); shophours = tp.getWsShopHours(); cost=tp.getWsCost(); laborcost=tp.getWsLaborCost(); String scost= ""+cost+""; + String ssubcost = ""+subcost+""; String slaborcost=""+laborcost+""; - UniMasterWsItems.AddItem(con2,qnum,item,keycode,quantity,scost,laborhours,slaborcost,shophours); + UniMasterWsItems.AddItem(con2,qnum,item,keycode,quantity,scost,laborhours,slaborcost,shophours,ssubcost); } con.close(); con2.close(); @@ -24349,8 +24467,11 @@ String keycode=""; int quantity=0; String wsmult=null; + String wsmultlab=null; + String wsmultsub=null; double cost=0.00; int laborhours=0; + double subcost=0.00; int shophours=0; double laborcost=0; @@ -24365,6 +24486,8 @@ UniMasterWorksheet tt = (UniMasterWorksheet) vv.elementAt(i); wsdate=tt.getWsDate(); wsmult=tt.getWsMult(); + wsmultlab=tt.getWsMult(); + wsmultsub=tt.getWsMult(); wsdescription=tt.getWsDesc(); } String custsite = doGetCustSite(ncrecnum); @@ -24377,7 +24500,7 @@ //formatter = new SimpleDateFormat("MM-dd-yyyy"); formatter = new SimpleDateFormat("yyyy-MM-dd"); String s = formatter.format(date); - UniWorksheet.AddItem(con, ncrecnum, s, wsdescription, wsmult, custsite, sitenum, login, servsync); + UniWorksheet.AddItem(con, ncrecnum, s, wsdescription, wsmult, custsite, sitenum, login, servsync, wsmultlab, wsmultsub); Vector v; @@ -24407,9 +24530,11 @@ shophours = tp.getWsShopHours(); cost=tp.getWsCost(); laborcost=tp.getWsLaborCost(); + subcost=tp.getWsSubCost(); String scost= ""+cost+""; + String ssubcost =""+subcost+""; String slaborcost=""+laborcost+""; - UniWsItems.AddItem(con,qnum,item,keycode,quantity,scost,laborhours,slaborcost,shophours); + UniWsItems.AddItem(con,qnum,item,keycode,quantity,scost,laborhours,slaborcost,shophours,ssubcost); } con.close(); @@ -24443,6 +24568,7 @@ int itemnum=0; int qnum=0; double totinvestment=0.00; + double subcost=0.00; int totlaborhours=0; double totlabor=0.00; double subtotlabor=0.00; @@ -24453,6 +24579,8 @@ String keycode=""; int quantity=0; String wsmult=null; + String wsmultlab=null; + String wsmultsub=null; double cost=0.00; int laborhours=0; int shophours=0; @@ -24469,6 +24597,8 @@ UniWorksheet tt = (UniWorksheet) vv.elementAt(i); wsdate=tt.getWsDate(); wsmult=tt.getWsMult(); + wsmultlab=tt.getWsMultLab(); + wsmultsub=tt.getWsMultSub(); wsdescription=tt.getWsDesc(); } Format formatter; @@ -24480,8 +24610,16 @@ String custsite = doGetCustSite(ncrecnum); String sitenum = doGetSiteNum(ncrecnum); int servsync=0; + if (Double.parseDouble(wsmultlab)==0.00) { + wsmultlab = wsmult; + } + + if (Double.parseDouble(wsmultsub)==0.00) { + wsmultsub = wsmult; + } + String login=(String)session.getAttribute("login"); - UniWorksheet.AddItem(con, ncrecnum, s, wsdescription, wsmult, custsite, sitenum, login, servsync); + UniWorksheet.AddItem(con, ncrecnum, s, wsdescription, wsmult, custsite, sitenum, login, servsync, wsmultlab, wsmultsub); Vector v; @@ -24508,12 +24646,14 @@ keycode = tp.getWsKeyCode(); quantity = tp.getWsQuant(); laborhours = tp.getWsLaborHours(); + subcost = tp.getWsSubCost(); shophours = tp.getWsShopHours(); cost=tp.getWsCost(); laborcost=tp.getWsLaborCost(); String scost= ""+cost+""; + String ssubcost=""+subcost+""; String slaborcost=""+laborcost+""; - UniWsItems.AddItem(con,qnum,item,keycode,quantity,scost,laborhours,slaborcost,shophours); + UniWsItems.AddItem(con,qnum,item,keycode,quantity,scost,laborhours,slaborcost,shophours,ssubcost); } con.close(); @@ -24555,9 +24695,12 @@ String keycode=""; int quantity=0; String wsmult=null; + String wsmultlab=null; + String wsmultsub=null; double cost=0.00; int laborhours=0; int shophours=0; + double subcost=0; double laborcost=0; String investment=null; @@ -24577,13 +24720,15 @@ UniWorksheet tt = (UniWorksheet) vv.elementAt(i); wsdate=tt.getWsDate(); wsmult=tt.getWsMult(); + wsmultlab=tt.getWsMultLab(); + wsmultsub=tt.getWsMultSub(); wsdescription=tt.getWsDesc(); } String custsite = doGetCustSite(crecnum); String sitenum = doGetSiteNum(crecnum); int servsync=0; String login=(String)session.getAttribute("login"); - UniWorksheet.AddItem(con, crecnum, s, wsdescription, wsmult, custsite, sitenum, login, servsync); + UniWorksheet.AddItem(con, crecnum, s, wsdescription, wsmult, custsite, sitenum, login, servsync, wsmultlab, wsmultsub); Vector v; @@ -24614,8 +24759,9 @@ cost=tp.getWsCost(); laborcost=tp.getWsLaborCost(); String scost= ""+cost+""; + String ssubcost=""+subcost+""; String slaborcost=""+laborcost+""; - UniWsItems.AddItem(con,qnum,item,keycode,quantity,scost,laborhours,slaborcost,shophours); + UniWsItems.AddItem(con,qnum,item,keycode,quantity,scost,laborhours,slaborcost,shophours,ssubcost); } con.close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2010-01-22 01:48:01
|
Revision: 121 http://servsys.svn.sourceforge.net/servsys/?rev=121&view=rev Author: molnar_c Date: 2010-01-22 01:47:55 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Updated to recent versions Added Paths: ----------- trunk/servsys/support-files/commons-fileupload-1.2.1.jar trunk/servsys/support-files/commons-io-1.4.jar trunk/servsys/support-files/mail-1.4.3.jar trunk/servsys/support-files/mysql-connector-java-5.1.11-bin.jar trunk/servsys/support-files/servlet.jar Added: trunk/servsys/support-files/commons-fileupload-1.2.1.jar =================================================================== (Binary files differ) Property changes on: trunk/servsys/support-files/commons-fileupload-1.2.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/servsys/support-files/commons-io-1.4.jar =================================================================== (Binary files differ) Property changes on: trunk/servsys/support-files/commons-io-1.4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/servsys/support-files/mail-1.4.3.jar =================================================================== (Binary files differ) Property changes on: trunk/servsys/support-files/mail-1.4.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/servsys/support-files/mysql-connector-java-5.1.11-bin.jar =================================================================== (Binary files differ) Property changes on: trunk/servsys/support-files/mysql-connector-java-5.1.11-bin.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/servsys/support-files/servlet.jar =================================================================== (Binary files differ) Property changes on: trunk/servsys/support-files/servlet.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2010-01-22 01:46:19
|
Revision: 120 http://servsys.svn.sourceforge.net/servsys/?rev=120&view=rev Author: molnar_c Date: 2010-01-22 01:46:07 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Fixed one more copyright date Modified Paths: -------------- trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-22 00:49:18 UTC (rev 119) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-22 01:46:07 UTC (rev 120) @@ -5346,7 +5346,7 @@ out.println("</BODY>"); out.println("</HTML>"); out.println("<br><br><br><br><CENTER>"); -out.println("(C) Copyright 2002-2009 - Our World Services, LLC<br>"); +out.println("(C) Copyright 2002-2010 - Our World Services, LLC<br>"); out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); //out.println("<br>Software Expire Date: "+doFormatDate(getDate(doGetExpireDate()))+"<br>"); //out.println("<br>Software Expire Date has been removed for GPL version.<br>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2010-01-22 00:49:25
|
Revision: 119 http://servsys.svn.sourceforge.net/servsys/?rev=119&view=rev Author: molnar_c Date: 2010-01-22 00:49:18 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Update copyright and version prior to redeploy on Java 6 Modified Paths: -------------- trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2009-08-01 02:30:55 UTC (rev 118) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2010-01-22 00:49:18 UTC (rev 119) @@ -4920,7 +4920,7 @@ out.println("</BODY>"); out.println("</HTML>"); out.println("<br><br><br><br><CENTER>"); -out.println("(C) Copyright 2002-2009 - Our World Services, LLC<br>"); +out.println("(C) Copyright 2002-2010 - Our World Services, LLC<br>"); //out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); //out.println("<br>Software Expire Date: "+doFormatDate(getDate(doGetExpireDate()))+"<br>"); //out.println("<br>Software Expire Date has been removed for GPL version.<br>"); @@ -6420,7 +6420,12 @@ } //RELEASE_VERSION - vnumber = "2.31"; + vnumber = "2.50"; + if (dbvnumber.equalsIgnoreCase("2.31")) { + Statement stmtu2 = con.createStatement(); + int result230z = stmtu2.executeUpdate("UPDATE version set vnumber='2.50';"); + int result230x = stmtu2.executeUpdate("UPDATE version set vdate='2010-01-21';"); + } if (dbvnumber.equalsIgnoreCase("2.30")) { Statement stmtu2 = con.createStatement(); int result230z = stmtu2.executeUpdate("UPDATE version set vnumber='2.31';"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2009-08-01 02:31:04
|
Revision: 118 http://servsys.svn.sourceforge.net/servsys/?rev=118&view=rev Author: molnar_c Date: 2009-08-01 02:30:55 +0000 (Sat, 01 Aug 2009) Log Message: ----------- Change copyright and recompile after a few years. Recompile on java 1.60 Bump version number Modified Paths: -------------- trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-25 17:11:46 UTC (rev 117) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2009-08-01 02:30:55 UTC (rev 118) @@ -4920,7 +4920,7 @@ out.println("</BODY>"); out.println("</HTML>"); out.println("<br><br><br><br><CENTER>"); -out.println("(C) Copyright 2002-2006 - Our World Services, LLC<br>"); +out.println("(C) Copyright 2002-2009 - Our World Services, LLC<br>"); //out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); //out.println("<br>Software Expire Date: "+doFormatDate(getDate(doGetExpireDate()))+"<br>"); //out.println("<br>Software Expire Date has been removed for GPL version.<br>"); @@ -5346,7 +5346,7 @@ out.println("</BODY>"); out.println("</HTML>"); out.println("<br><br><br><br><CENTER>"); -out.println("(C) Copyright 2002-2006 - Our World Shopping, LLC<br>"); +out.println("(C) Copyright 2002-2009 - Our World Services, LLC<br>"); out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); //out.println("<br>Software Expire Date: "+doFormatDate(getDate(doGetExpireDate()))+"<br>"); //out.println("<br>Software Expire Date has been removed for GPL version.<br>"); @@ -6420,7 +6420,12 @@ } //RELEASE_VERSION - vnumber = "2.30"; + vnumber = "2.31"; + if (dbvnumber.equalsIgnoreCase("2.30")) { + Statement stmtu2 = con.createStatement(); + int result230z = stmtu2.executeUpdate("UPDATE version set vnumber='2.31';"); + int result230x = stmtu2.executeUpdate("UPDATE version set vdate='2009-08-01';"); + } if (dbvnumber.equalsIgnoreCase("2.29")) { Statement stmtu2 = con.createStatement(); int result230a = stmtu2.executeUpdate("alter table time_sheet add odostart int default 0 after callcount;"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2006-05-25 17:12:02
|
Revision: 117 Author: molnar_c Date: 2006-05-25 10:11:46 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/servsys/?rev=117&view=rev Log Message: ----------- import inventory csv file is now complete. Modified Paths: -------------- trunk/servsys/TODO trunk/servsys/src/com/pandmservices/UniPreventative.java trunk/servsys/src/com/pandmservices/web/MainMenu.java trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/TODO =================================================================== --- trunk/servsys/TODO 2006-05-25 01:11:36 UTC (rev 116) +++ trunk/servsys/TODO 2006-05-25 17:11:46 UTC (rev 117) @@ -6,16 +6,15 @@ - Upload checkme - move all select statements into other classes and out of UniCash.java. - if running on master server allow update of server dates. -- Edit Planned Service Pricing need to be added/fixed. -- Need to add CSV file import for Inventory Data ================================================================= RELEASE 2.30 ================================================================= (N) Added odometer start and stop to time sheet entries and databases. (N) Made sure that odometer readings are added to everything that is printed. +(N) Edit Planned Service Pricing has been added, tested and fixed. +(N) Need to add CSV file import for Inventory Data - ================================================================= RELEASE 2.29 ================================================================= Modified: trunk/servsys/src/com/pandmservices/UniPreventative.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniPreventative.java 2006-05-25 01:11:36 UTC (rev 116) +++ trunk/servsys/src/com/pandmservices/UniPreventative.java 2006-05-25 17:11:46 UTC (rev 117) @@ -53,7 +53,22 @@ return V; } + public static Vector getAllItems(Connection c, String d) + throws SQLException, TodoException + { + Vector V = new Vector(); + Statement stmt = c.createStatement(); + ResultSet rs = stmt.executeQuery("SELECT * FROM prevprices where planrec='"+d+"' order by descript"); + while(rs.next()) + { + + UniPreventative t = new UniPreventative(c,rs.getInt("planrec")); + V.addElement(t); + } + return V; + } + public static void deleteItem(Connection con, String d) throws SQLException { @@ -87,6 +102,16 @@ stmt.executeUpdate("INSERT INTO prevprices (descript, tm_est, yr1, yr2, yr3) Values ('" + tdescription + "','" +tm_est+ "','"+ yr_1 + "','"+ yr_2 + "','"+ yr_3 + "')"); } +public static void UpdatePreventative(Connection con, String prevrec, String description, String tm_est, String yr_1, String yr_2, String yr_3, String newdate) + throws SQLException + { + String tdescription = description.replaceAll("'","''"); + Statement stmt = con.createStatement(); + stmt.executeUpdate("Update prevprices set descript='" + tdescription + "', tm_est='" +tm_est+ "', yr1='"+ yr_1 + "', yr2='"+ yr_2 + "', yr3='"+ yr_3 + "' where planrec='"+prevrec+"';"); + stmt.executeUpdate("update prevprices_date set dateupdated='"+newdate+"';"); + } + + public int getId() { return planrec; } public String getDescription() { return description; } Modified: trunk/servsys/src/com/pandmservices/web/MainMenu.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/MainMenu.java 2006-05-25 01:11:36 UTC (rev 116) +++ trunk/servsys/src/com/pandmservices/web/MainMenu.java 2006-05-25 17:11:46 UTC (rev 117) @@ -177,6 +177,7 @@ mbody=combinestring(mbody," - <a href="+classdir+"UniCash?action=configforms target=phpmain>Forms</a><br>"); mbody=combinestring(mbody," - <a href="+classdir+"UniCash?action=edrespsform target=phpmain>Residential Planned Service Form</a><br>"); mbody=combinestring(mbody," - <a href="+classdir+"UniCash?action=editrateconfig target=phpmain>Rate Calculation Configuration</a><br>"); + mbody=combinestring(mbody," - <a href="+classdir+"UniCash?action=uploadinvcsvfile target=phpmain>Upload Inventory CSV File</a><br>"); } mbody=combinestring(mbody,"<br><a href="+classdir+"UniCash?action=menu&menu=reports target=nav>Reports</a><br>"); if (menu.equalsIgnoreCase("reports")) { Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-25 01:11:36 UTC (rev 116) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-25 17:11:46 UTC (rev 117) @@ -21,6 +21,21 @@ import java.sql.*; import javax.mail.*; import javax.mail.internet.*; +import org.apache.commons.fileupload.*; +import org.apache.commons.fileupload.disk.*; +import org.apache.commons.fileupload.servlet.*; +import java.io.File; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.io.PrintWriter; +import javax.servlet.ServletInputStream; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileUpload; +import org.apache.commons.fileupload.MultipartStream; +import org.apache.commons.io.*; +//import org.apache.commons.beanutils.*; +//import org.apache.commons.beanutils.MethodUtils; public class UniCash extends HttpServlet { @@ -1949,14 +1964,26 @@ { doAddPrevPrice(req, res, out, session, username); } + else if (action.equalsIgnoreCase("editprevprice")) + { + doAddPrevPrice(req, res, out, session, username); + } else if (action.equalsIgnoreCase("uploadinvcsvfile")) { doUploadInvCSVFile(req, res, out, session, username); } + else if (action.equalsIgnoreCase("importinvcsv")) + { + doImportInvCSVFile(req, res, out, session, username); + } else if (action.equalsIgnoreCase("saveprevprice")) { doSavePrevPrice(req, res, out, session, username); } + else if (action.equalsIgnoreCase("updateprevprice")) + { + doSavePrevPrice(req, res, out, session, username); + } else if (action.equalsIgnoreCase("listprevprice")) { doListPrevPrice(req, res, out, session, username); @@ -10274,14 +10301,18 @@ private void doUploadInvCSVFile(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) throws Exception { + out.println("<html>"); out.println("<head>"); out.println("<title>Upload CSV File</title>"); out.println("</head>"); - out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=importinvcsv\" name=\"importcsv\">"); + out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=importinvcsv\" name=\"importcsv\" enctype=\"multipart/form-data\">"); out.println("<p>File :"); - out.println("<input type=\"file\" name=\"csvfile\" size=\"50\">"); + out.println("<input type=\"file\" name=\"csvfile\">"); out.println("</p>"); + //out.println("<p>File Name:"); + out.println("<input type=\"hidden\" name=\"cvsfilename\" value=\"dsaa.csv\">"); + out.println("</p>"); out.println("<p> <CENTER>"); out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Import\">"); out.println("<INPUT TYPE=\"reset\">"); @@ -10289,31 +10320,250 @@ con.close(); } + + private void doImportInvCSVFile(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + Format formatter; + Calendar now = Calendar.getInstance(); + Date date = new Date(); + formatter = new SimpleDateFormat("yyyy-MM-dd"); + String s = formatter.format(date); + boolean isMultipart = FileUpload.isMultipartContent(req); + // Create a new file upload handler + DiskFileUpload upload = new DiskFileUpload(); + // parse this request by the handler + // this gives us a list of items from the request + List items = null; + + try { + items = upload.parseRequest(req); + } catch (FileUploadException e) { + // TODO Auto-generated catch block + //e.printStackTrace(); + out.println("Problem at Parse Request line 10326<br>"); + } + + Iterator itr = items.iterator(); + + while(itr.hasNext()) { + FileItem item = (FileItem) itr.next(); + + // check if the current item is a form field or an uploaded file + if(item.isFormField()) { + + // get the name of the field + String fieldName = item.getFieldName(); + + // if it is name, we can set it in request to thank the user + if(fieldName.equals("filename")) { + req.setAttribute("msg", "Thank You: " + item.getString()); + // later you can use it like this: + out.println(req.getAttribute("msg")+"<br>"); + } + + out.println(item.getFieldName() + " = " + item.getString() + "<br>"); + } + + else { + + // the item must be an uploaded file save it to disk. Note that there + // seems to be a bug in item.getName() as it returns the full path on + // the client's machine for the uploaded file name, instead of the file + // name only. To overcome that, I have used a workaround using + // fullFile.getName(). + File fullFile = new File(item.getName()); + //File savedFile = new File(getServletContext().getRealPath("/"), fullFile.getName()); + File savedFile = new File("/tmp/", fullFile.getName()); + try { + item.write(savedFile); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + out.println(e1+"<br>"); + //out.println("Exception in the file save portion of rountine<br>"); + } + out.println("<br>saved file = " + fullFile.getName()+"<br>"); + + // here is where we do the csv sql stuff. + try + { + // load the driver into memory + Class.forName("org.relique.jdbc.csv.CsvDriver"); + // create a connection. The first command line parameter is assumed to + // be the directory in which the .csv files are held + Connection conn = DriverManager.getConnection("jdbc:relique:csv:/tmp"); + // create a Statement object to execute the query with + Statement stmt = conn.createStatement(); + Statement stmt2 = con.createStatement(); + // Select the ID and NAME columns from sample.csv + ResultSet results = stmt.executeQuery("SELECT * FROM dsaa"); + // dump out the results + + int result1=stmt2.executeUpdate("DROP TABLE IF EXISTS inv_keycodes;"); + int result2=stmt2.executeUpdate("CREATE TABLE inv_keycodes (ID int(11) NOT NULL auto_increment,keycodep text,part_number text,sort_desc text,description text,manu text,location text,oh_qty double,qty_opt double,part_cost double,extended_cost double,sell_price text,stocknum text,orderuom text,conversion double,peak_oh text,off_peak_oh text,PRIMARY KEY (ID),UNIQUE ID (ID),KEY ID_2 (ID));"); + int counter=0; + while (results.next()) + { + + //---------------------------------------------------------- + + String keycodep=results.getString("Keycode"); + String part_number=results.getString("Part Number"); + String sort_desc=results.getString("Sort Description"); + String description=results.getString("Description"); + String manu=results.getString("Manufacturer"); + String location=results.getString("Location"); + String oh_qty=results.getString("Qty OH"); + String qty_opt=results.getString("Opt Qty"); + String part_cost=results.getString("ACTUAL COST"); + String extended_cost=results.getString("Extended Cost"); + String sell_price=results.getString("Sell Price"); + String stocknum=results.getString("Stock UOM"); + String orderuom=results.getString("Order UOM"); + String conversion=results.getString("Conversion"); + String peak_oh=results.getString("Peak Qty"); + String off_peak_oh=results.getString("Off-Peak Qty"); + if ((oh_qty==null)||(oh_qty.equalsIgnoreCase(""))) oh_qty="0"; + if ((qty_opt==null)||(qty_opt.equalsIgnoreCase(""))) qty_opt="0"; + if ((part_cost==null)||(part_cost.equalsIgnoreCase(""))) part_cost="0"; + if ((extended_cost==null)||(extended_cost.equalsIgnoreCase(""))) extended_cost="0"; + if ((sell_price==null)||(sell_price.equalsIgnoreCase(""))) sell_price="0"; + if ((conversion==null)||(conversion.equalsIgnoreCase(""))) conversion="0"; + + //if (oh_qty.length()<1) oh_qty="0"; + //if (qty_opt.length()<1) qty_opt="0"; + //if (part_cost.length()<1) part_cost="0"; + //if (extended_cost.length()<1) extended_cost="0"; + //if (sell_price.length()<1) sell_price="0"; + //if (conversion.length()<1) conversion="0"; + counter++; + //sort_desc=""; + if (!description.equalsIgnoreCase("DO NOT USE")) { + stmt2.executeUpdate("INSERT INTO inv_keycodes (keycodep, part_number, sort_desc, description, manu, location, oh_qty, qty_opt, part_cost, extended_cost, sell_price, stocknum, orderuom, conversion, peak_oh, off_peak_oh) Values ('"+keycodep+"','" +part_number+ "', '"+sort_desc+"','"+description+"','" +manu+ "', '"+location+"','"+oh_qty+"','" +qty_opt+ "', '"+part_cost+"','"+extended_cost+"','" +sell_price+ "', '"+stocknum+"','"+orderuom+"','" +conversion+ "', '"+peak_oh+"','"+off_peak_oh+"')"); + out.println("KEYCODE = " + results.getString("Keycode") + " PART NUMBER= " + results.getString("Part Number")+"<br>"); + } else { + + //---------------------------------------------------------- + + out.println("SKIP KEYCODE = " + results.getString("Keycode") + " PART NUMBER= " + results.getString("Part Number")+"<br>"); + } + } + + out.println("<br><H1>Records Imported = "+counter+"</h1><br>"); + + stmt2.executeUpdate("update inv_keycodes_date set dateupdated='"+s+"';"); + ResultSet rs = stmt2.executeQuery("SELECT * FROM inv_keycodes_date"); + while(rs.next()) + { + String nlocaldate=rs.getString("dateupdated"); + out.println("<br>New Local Date: "+ nlocaldate +"<br>"); + } + + + // clean up + results.close(); + stmt.close(); + conn.close(); + + } + catch(Exception e) + { + out.println("Oops-> " + e); + } + } + } + + con.close(); + } + + + private void OlddoImportInvCSVFile(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + out.println("<html>"); + out.println("<head>"); + out.println("<title>Import Inventory CSV File</title>"); + out.println("</head>"); + + // Create a factory for disk-based file items + DiskFileItemFactory factory = new DiskFileItemFactory(); + +// Set factory constraints + //factory.setSizeThreshold(yourMaxMemorySize); + //factory.setRepositoryPath("upload1/"); + factory.setRepository(new File("/tmp")); + +// Create a new file upload handler + ServletFileUpload upload = new ServletFileUpload(factory); + + // Set overall request size constraint + //upload.setSizeMax(yourMaxRequestSize); + // Parse the request + List /* FileItem */ items = upload.parseRequest(req); + out.println("File Upload Complete"); + + + out.println("Import Complete<br>"); + con.close(); + } + private void doAddPrevPrice(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) throws Exception { + String action=req.getParameter("action"); + String descript=""; + String tm_est=""; + String yr1=""; + String yr2=""; + String yr3=""; + int tplanrec=0; + String planrec=""; + if (action.equalsIgnoreCase("editprevprice")) { + planrec= req.getParameter("planrec"); + Vector v; + v = UniPreventative.getAllItems(con, planrec); + int counter=0; + for (int i = 0 ; i < v.size(); i++) + { + UniPreventative t = (UniPreventative) v.elementAt(i); + tplanrec = t.getId(); + planrec=""+tplanrec+""; + descript= t.getDescription(); + tm_est = t.getTmEst(); + yr1 = t.getYr1(); + yr2 = t.getYr2(); + yr3 = t.getYr3(); + } + } out.println("<html>"); out.println("<head>"); - out.println("<title>Add Preventative Price</title>"); + out.println("<title>Add/Edit Preventative Price</title>"); out.println("</head>"); + if (action.equalsIgnoreCase("addprevprice")) { out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=saveprevprice\" name=\"addcust\">"); + } + if (action.equalsIgnoreCase("editprevprice")) { + out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=updateprevprice\" name=\"addcust\">"); + } out.println("<p>Description :"); - out.println("<input type=\"text\" name=\"descript\" size=\"40\">"); + out.println("<input type=\"text\" name=\"descript\" value=\""+descript+"\" size=\"40\">"); out.println("</p>"); out.println("<p>Time and Material Estimate :"); - out.println("<input type=\"text\" name=\"tm_est\" size=\"8\">"); + out.println("<input type=\"text\" name=\"tm_est\" value=\""+tm_est+"\" size=\"8\">"); out.println("</p>"); out.println("<p>1 Year :"); - out.println("<input type=\"text\" name=\"yr1\" size=\"8\">"); + out.println("<input type=\"text\" name=\"yr1\" value=\""+yr1+"\" size=\"8\">"); out.println("</p>"); out.println("<p>2 Year :"); - out.println("<input type=\"text\" name=\"yr2\" size=\"8\">"); + out.println("<input type=\"text\" name=\"yr2\" value=\""+yr2+"\" size=\"8\">"); out.println("</p>"); out.println("<p>3 Year :"); - out.println("<input type=\"text\" name=\"yr3\" size=\"8\">"); + out.println("<input type=\"text\" name=\"yr3\" value=\""+yr3+"\" size=\"8\">"); out.println("</p>"); out.println("<p> <CENTER>"); + out.println("<input type=\"hidden\" Name=\"planrec\" value=\""+planrec+"\">"); out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\">"); out.println("<INPUT TYPE=\"reset\">"); out.println("</CENTER>"); @@ -10323,6 +10573,8 @@ private void doSavePrevPrice(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) throws Exception { + String action=req.getParameter("action"); + String planrec=req.getParameter("planrec"); String descript = req.getParameter("descript"); String yr3 = req.getParameter("yr3"); String yr2 = req.getParameter("yr2"); @@ -10333,15 +10585,18 @@ Date date = new Date(); formatter = new SimpleDateFormat("yyyy-MM-dd"); String s = formatter.format(date); - + if (action.equalsIgnoreCase("saveprevprice")) { UniPreventative.addPreventative(con, descript, tm_est, yr1, yr2, yr3, s); - out.println("Your item has been added to the database<br>"); - + } + if (action.equalsIgnoreCase("updateprevprice")) { + UniPreventative.UpdatePreventative(con, planrec, descript, tm_est, yr1, yr2, yr3, s); + } + out.println("Your item has been added to the database<br>"); con.close(); res.sendRedirect(""+classdir+"UniCash?action=listprevprice"); } - private void doListPhoneList(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) +private void doListPhoneList(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) throws Exception { int phonelistperm=Integer.parseInt(doGetEditCompPhoneList(username)); @@ -10437,7 +10692,7 @@ counter=0; } -out.println("<tr><td><a href=edprevprice.php?planrec="+planrec+">"+description+"</a></td><td>"+tm_est+"</td><td>"+yr_1+"</td><td>"+yr_2+"</td><td>"+yr_3+"</td></tr>"); +out.println("<tr><td><a href="+classdir+"UniCash?action=editprevprice&planrec="+planrec+">"+description+"</a></td><td>"+tm_est+"</td><td>"+yr_1+"</td><td>"+yr_2+"</td><td>"+yr_3+"</td></tr>"); //out.println("<tr><td><a href=edprevprice.php?planrec="+planrec+">"+description+"</a></td><td>"+tm_est+"</td><td>"+yr_2+"</td><td>"+yr_3+"</td></tr>"); } out.println("</table>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2006-05-25 01:12:00
|
Revision: 116 Author: molnar_c Date: 2006-05-24 18:11:36 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/servsys/?rev=116&view=rev Log Message: ----------- Odometer readings are now added. Also found some problems with the changes that where done last night. Fixed them prior to distributing this morning. Modified Paths: -------------- trunk/servsys/TODO trunk/servsys/src/com/pandmservices/UniCompConfig.java trunk/servsys/src/com/pandmservices/UniTimeSheet.java trunk/servsys/src/com/pandmservices/dbserver/SyncTimeSheets.java trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/TODO =================================================================== --- trunk/servsys/TODO 2006-05-23 17:49:32 UTC (rev 115) +++ trunk/servsys/TODO 2006-05-25 01:11:36 UTC (rev 116) @@ -12,6 +12,8 @@ ================================================================= RELEASE 2.30 ================================================================= +(N) Added odometer start and stop to time sheet entries and databases. +(N) Made sure that odometer readings are added to everything that is printed. ================================================================= Modified: trunk/servsys/src/com/pandmservices/UniCompConfig.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniCompConfig.java 2006-05-23 17:49:32 UTC (rev 115) +++ trunk/servsys/src/com/pandmservices/UniCompConfig.java 2006-05-25 01:11:36 UTC (rev 116) @@ -81,8 +81,8 @@ { Statement stmt = con.createStatement(); stmt.executeUpdate("DROP TABLE IF EXISTS configcompany;"); - stmt.executeUpdate("create table configcompany (image text, imagewidth text, imagehight text, coname text, cologo text, coaddress text, cophone text, useletterhead text not null, yearenddate date default '2005-09-31', enabcustomer text not null, reportemail text not null);"); - stmt.executeUpdate("insert into configcompany (image,imagehight, imagewidth, coname, cologo,coaddress,cophone, useletterhead, enabcustomer, reportemail, yearenddate) values ('"+image+"','"+imagehight+"','"+imagewidth+"','"+coname+"','"+cologo+"','"+coaddress+"','"+cophone+"','"+useletterhead+"', '"+enabcustomer+"', '"+reportemail+"', '"+yearenddate+"');"); + stmt.executeUpdate("create table configcompany (image text, imagewidth text, imagehight text, coname text, cologo text, coaddress text, cophone text, useletterhead text not null, yearenddate date default '2005-09-31', enabcustomer text not null, nocustonlaptop text, laptopretentiontime int(11), reportemail text not null);"); + stmt.executeUpdate("insert into configcompany (image,imagehight, imagewidth, coname, cologo,coaddress,cophone, useletterhead, enabcustomer, reportemail, yearenddate, nocustonlaptop, laptopretentiontime) values ('"+image+"','"+imagehight+"','"+imagewidth+"','"+coname+"','"+cologo+"','"+coaddress+"','"+cophone+"','"+useletterhead+"', '"+enabcustomer+"', '"+reportemail+"', '"+yearenddate+"', 'yes', 4);"); } Modified: trunk/servsys/src/com/pandmservices/UniTimeSheet.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniTimeSheet.java 2006-05-23 17:49:32 UTC (rev 115) +++ trunk/servsys/src/com/pandmservices/UniTimeSheet.java 2006-05-25 01:11:36 UTC (rev 116) @@ -8,6 +8,7 @@ import java.util.Vector; import java.util.Date; import java.security.*; +import java.lang.Integer.*; public class UniTimeSheet @@ -30,6 +31,8 @@ private String commision; private String ctype; private int tsid; + private String odostart; + private String odostop; private String dispatch_time; private int servsync; private String paytype; @@ -61,6 +64,8 @@ this.login = rs.getString("login"); this.paytype = rs.getString("paytype"); this.servsync=rs.getInt("servsync"); + this.odostart = rs.getString("odostart"); + this.odostop=rs.getString("odostop"); } @@ -174,25 +179,25 @@ stmt.executeUpdate("Update todo Set Done=true Where ID=" + id + ";"); } - public static void UpdateItem(Connection con, String tsid, String listdate, String callslip, String customer, String dispatch_time, String time_in, String time_out, String isold, String asold, String collected, String commision, String cisold, String casold, String ctype, String login, String paytype) + public static void UpdateItem(Connection con, String tsid, String listdate, String callslip, String customer, String dispatch_time, String time_in, String time_out, String isold, String asold, String collected, String commision, String cisold, String casold, String ctype, String login, String paytype, String odostart, String odostop) throws SQLException { Statement stmt = con.createStatement(); - stmt.executeUpdate("Update time_sheet Set tdate ='" +listdate + "', callslip='"+callslip +"', customer='"+customer +"', dispatch_time='"+dispatch_time +"', time_in='"+time_in +"', time_out='"+time_out +"', item_sold='"+isold +"', amount='"+asold +"', citem_sold='"+cisold +"', camount='"+casold +"',amount_collected='"+collected +"', commision='"+commision +"', ctype='"+ctype +"', login='"+login+"', paytype='"+paytype+"' Where tsid=" + tsid + ";"); + stmt.executeUpdate("Update time_sheet Set tdate ='" +listdate + "', callslip='"+callslip +"', customer='"+customer +"', dispatch_time='"+dispatch_time +"', time_in='"+time_in +"', time_out='"+time_out +"', item_sold='"+isold +"', amount='"+asold +"', citem_sold='"+cisold +"', camount='"+casold +"',amount_collected='"+collected +"', commision='"+commision +"', ctype='"+ctype +"', login='"+login+"', paytype='"+paytype+"', odostart='"+odostart+"', odostop='"+odostop+"' Where tsid=" + tsid + ";"); } - public static void addTimeSheetItem( Connection con, String listdate, String callslip, String customer, String dispatch_time, String time_in, String time_out, String isold, String asold, String collected, String commision, String cisold, String casold, String ctype, String login, String paytype) + public static void addTimeSheetItem( Connection con, String listdate, String callslip, String customer, String dispatch_time, String time_in, String time_out, String isold, String asold, String collected, String commision, String cisold, String casold, String ctype, String login, String paytype, String odostart, String odostop) throws SQLException, NoSuchAlgorithmException, NoSuchProviderException { Statement stmt = con.createStatement(); - stmt.executeUpdate("INSERT INTO time_sheet (tdate, callslip, customer, time_in, time_out, item_sold, amount, amount_collected, commision, dispatch_time, citem_sold, camount, ctype, login, paytype) Values ('" + listdate + "','" +callslip+ "','"+ customer + "','"+ time_in + "','" + time_out + "','"+ isold + "','"+ asold +"','"+collected+"','"+ commision+"','"+ dispatch_time + "', '"+ cisold + "','"+ casold +"','"+ctype+"', '"+login+"', '"+paytype+"')"); + stmt.executeUpdate("INSERT INTO time_sheet (tdate, callslip, customer, time_in, time_out, item_sold, amount, amount_collected, commision, dispatch_time, citem_sold, camount, ctype, login, paytype, odostart, odostop) Values ('" + listdate + "','" +callslip+ "','"+ customer + "','"+ time_in + "','" + time_out + "','"+ isold + "','"+ asold +"','"+collected+"','"+ commision+"','"+ dispatch_time + "', '"+ cisold + "','"+ casold +"','"+ctype+"', '"+login+"', '"+paytype+"', '"+odostart+"', '"+odostop+"')"); } - public static void addAdminTimeSheetItem( Connection con, String listdate, String callslip, String customer, String dispatch_time, String time_in, String time_out, String isold, String asold, String collected, String commision, String cisold, String casold, String ctype, String login, String paytype, String callcount) + public static void addAdminTimeSheetItem( Connection con, String listdate, String callslip, String customer, String dispatch_time, String time_in, String time_out, String isold, String asold, String collected, String commision, String cisold, String casold, String ctype, String login, String paytype, String callcount, String odostart, String odostop) throws SQLException, NoSuchAlgorithmException, NoSuchProviderException { Statement stmt = con.createStatement(); - stmt.executeUpdate("INSERT INTO time_sheet (tdate, callslip, customer, time_in, time_out, item_sold, amount, amount_collected, commision, dispatch_time, citem_sold, camount, ctype, login, paytype, callcount) Values ('" + listdate + "','" +callslip+ "','"+ customer + "','"+ time_in + "','" + time_out + "','"+ isold + "','"+ asold +"','"+collected+"','"+ commision+"','"+ dispatch_time + "', '"+ cisold + "','"+ casold +"','"+ctype+"', '"+login+"', '"+paytype+"', '"+callcount+"')"); + stmt.executeUpdate("INSERT INTO time_sheet (tdate, callslip, customer, time_in, time_out, item_sold, amount, amount_collected, commision, dispatch_time, citem_sold, camount, ctype, login, paytype, callcount, odostart, odostop) Values ('" + listdate + "','" +callslip+ "','"+ customer + "','"+ time_in + "','" + time_out + "','"+ isold + "','"+ asold +"','"+collected+"','"+ commision+"','"+ dispatch_time + "', '"+ cisold + "','"+ casold +"','"+ctype+"', '"+login+"', '"+paytype+"', '"+callcount+"','"+odostart+"','"+odostop+"')"); } public int getId() { return tsid; } @@ -213,6 +218,8 @@ public String TLogin() { return login; } public int getServSync() { return servsync; } public String TPayType() { return paytype; } + public String OdoStart() { return odostart; } + public String OdoStop() { return odostop; } public void setId(int id) { this.id = id; } } Modified: trunk/servsys/src/com/pandmservices/dbserver/SyncTimeSheets.java =================================================================== --- trunk/servsys/src/com/pandmservices/dbserver/SyncTimeSheets.java 2006-05-23 17:49:32 UTC (rev 115) +++ trunk/servsys/src/com/pandmservices/dbserver/SyncTimeSheets.java 2006-05-25 01:11:36 UTC (rev 116) @@ -32,6 +32,8 @@ private int tsid; private String dispatch_time; private String paytype; + private int odostart; + private int odostop; public SyncTimeSheets (Connection con, Connection conu) throws SQLException, TodoException @@ -59,6 +61,8 @@ this.camount = rs.getString("camount"); this.login = rs.getString("login"); this.paytype = rs.getString("paytype"); + this.odostart = rs.getInt("odostart"); + this.odostop = rs.getInt("odostop"); String tcustname=""; if (customer!=null) { tcustname = customer.replaceAll("'","''"); @@ -66,7 +70,7 @@ //System.out.println("INSERT INTO time_sheet (tdate, callslip, customer, time_in, time_out, item_sold, amount, amount_collected, commision, dispatch_time, citem_sold, camount, ctype, login) Values ('" + tdate + "','" +callslip+ "','"+ tcustname + "','"+ time_in + "','" + time_out + "','"+ isold + "','"+ amount +"','"+amount_collected+"','"+ commision+"','"+ dispatch_time + "', '"+ cisold + "','"+ camount +"','"+ctype+"', '"+login+"')\n"); - stmtu.executeUpdate("INSERT INTO time_sheet (tdate, callslip, customer, time_in, time_out, item_sold, amount, amount_collected, commision, dispatch_time, citem_sold, camount, ctype, login, paytype) Values ('" + tdate + "','" +callslip+ "','"+ tcustname + "','"+ time_in + "','" + time_out + "','"+ isold + "','"+ amount +"','"+amount_collected+"','"+ commision+"','"+ dispatch_time + "', '"+ cisold + "','"+ camount +"','"+ctype+"', '"+login+"', '"+paytype+"')"); + stmtu.executeUpdate("INSERT INTO time_sheet (tdate, callslip, customer, time_in, time_out, item_sold, amount, amount_collected, commision, dispatch_time, citem_sold, camount, ctype, login, paytype, odostart, odostop) Values ('" + tdate + "','" +callslip+ "','"+ tcustname + "','"+ time_in + "','" + time_out + "','"+ isold + "','"+ amount +"','"+amount_collected+"','"+ commision+"','"+ dispatch_time + "', '"+ cisold + "','"+ camount +"','"+ctype+"', '"+login+"', '"+paytype+"','"+odostart+"','"+odostop+"')"); stmt2.executeUpdate("update time_sheet set servsync=2 where tsid='"+tsid+"';"); } Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-23 17:49:32 UTC (rev 115) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-25 01:11:36 UTC (rev 116) @@ -1949,6 +1949,10 @@ { doAddPrevPrice(req, res, out, session, username); } + else if (action.equalsIgnoreCase("uploadinvcsvfile")) + { + doUploadInvCSVFile(req, res, out, session, username); + } else if (action.equalsIgnoreCase("saveprevprice")) { doSavePrevPrice(req, res, out, session, username); @@ -6389,7 +6393,14 @@ } //RELEASE_VERSION - vnumber = "2.29"; + vnumber = "2.30"; + if (dbvnumber.equalsIgnoreCase("2.29")) { + Statement stmtu2 = con.createStatement(); + int result230a = stmtu2.executeUpdate("alter table time_sheet add odostart int default 0 after callcount;"); + int result230b = stmtu2.executeUpdate("alter table time_sheet add odostop int default 0 after odostart;"); + int result230z = stmtu2.executeUpdate("UPDATE version set vnumber='2.30';"); + int result230x = stmtu2.executeUpdate("UPDATE version set vdate='2006-05-24';"); + } if (dbvnumber.equalsIgnoreCase("2.28")) { Statement stmtu2 = con.createStatement(); int result225z = stmtu2.executeUpdate("UPDATE version set vnumber='2.29';"); @@ -10260,6 +10271,25 @@ //res.sendRedirect(""+classdir+"UniCash?action=top"); } + private void doUploadInvCSVFile(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + out.println("<html>"); + out.println("<head>"); + out.println("<title>Upload CSV File</title>"); + out.println("</head>"); + out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=importinvcsv\" name=\"importcsv\">"); + out.println("<p>File :"); + out.println("<input type=\"file\" name=\"csvfile\" size=\"50\">"); + out.println("</p>"); + out.println("<p> <CENTER>"); + out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Import\">"); + out.println("<INPUT TYPE=\"reset\">"); + out.println("</CENTER>"); + con.close(); + } + + private void doAddPrevPrice(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) throws Exception { @@ -11156,6 +11186,8 @@ String camount=null; String ctype=null; String paytype=null; + String odostart=null; + String odostop=null; int counter=0; for (int i = 0 ; i < v.size(); i++) @@ -11176,6 +11208,8 @@ camount = t.CAmount(); ctype=t.CType(); paytype=t.TPayType(); + odostart=t.OdoStart(); + odostop=t.OdoStop(); } @@ -11243,8 +11277,12 @@ out.println("<option value="+tc.Code()+">"+tc.Code()+" - "+tc.Category()+"</option>"); } out.println("</select></td></tr>"); -out.println("</table>"); -out.println("<input type=\"hidden\" name=\"timeadd\" value=1>"); +out.println("<tr><td>Odometer Start :</td>"); +out.println("<td><input type=\"text\" name=\"odostart\" value=\""+ odostart +"\"></td></tr>"); +out.println("<tr><td>Odometer Stop :</td>"); +out.println("<td><input type=\"text\" name=\"odostop\" value=\""+odostop +"\">"); + out.println("</table>"); +out.println("<input type=\"hidden\" name=\"timeadd\" value=1>"); out.println("<input type=\"hidden\" name=\"tsid\" value="+ttsid+">"); out.println("<p> <CENTER>"); out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\">"); @@ -11310,20 +11348,13 @@ out.println("<option value="+tc.Code()+">"+tc.Code()+" - "+tc.Category()+"</option>"); } out.println("</select></td></tr>"); +out.println("<tr><td>Odometer Start :</td>"); +out.println("<td><input type=\"text\" name=\"odostart\" value=\"0\"></td></tr>"); +out.println("<tr><td>Odometer Stop :</td>"); +out.println("<td><input type=\"text\" name=\"odostop\" value=\"0\">"); out.println("<input type=\"hidden\" name=\"timeadd\" value=1>"); out.println("</table></td>"); out.println("<td><table>"); - /* Vector v; - v = TimeCat.getAllItems(con); - for (int i = 0 ; i < v.size(); i++) - { - TimeCat t = (TimeCat) v.elementAt(i); - int catnum = t.getCatnum(); - String category = t.Category(); - String code = t.Code(); - out.println("<tr><td>"+code+"</td><td>"+category+"</td></tr>"); - } - */ out.println("</table></td></tr></table>"); out.println("<p> <CENTER>"); out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\">"); @@ -11469,12 +11500,14 @@ String casold = req.getParameter("casold"); String ctype = req.getParameter("ctype"); String paytype = req.getParameter("paytype"); + String odostart=req.getParameter("odostart"); + String odostop=req.getParameter("odostop"); if (callslip == null || callslip.length() < 1) { out.println("Callslip field blank please use back key and try again"); return; } else { - UniTimeSheet.UpdateItem(con, tsid, doFormatDateDb(getDateDb(listdate)), callslip, customer, dispatch_time, time_in, time_out, isold, asold, collected, commision, cisold, casold, ctype, username, paytype); + UniTimeSheet.UpdateItem(con, tsid, doFormatDateDb(getDateDb(listdate)), callslip, customer, dispatch_time, time_in, time_out, isold, asold, collected, commision, cisold, casold, ctype, username, paytype, odostart, odostop); out.println("Your item has been updated in the database<br>"); //doShowTimeSheet(req, res, out, session, username); con.close(); @@ -11501,12 +11534,14 @@ String paytype = req.getParameter("paytype"); String callcount = req.getParameter("callcount"); String techid=req.getParameter("techid"); + String odostart=req.getParameter("odostart"); + String odostop=req.getParameter("odostop"); if (callslip == null || callslip.length() < 1) { out.println("Callslip field blank please use back key and try again"); return; } else { - UniTimeSheet.addAdminTimeSheetItem(con, doFormatDateDb(getDateDb(listdate)), callslip, customer, dispatch_time, time_in, time_out, isold, asold, collected, commision, cisold, casold, ctype, techid, paytype, callcount); + UniTimeSheet.addAdminTimeSheetItem(con, doFormatDateDb(getDateDb(listdate)), callslip, customer, dispatch_time, time_in, time_out, isold, asold, collected, commision, cisold, casold, ctype, techid, paytype, callcount, odostart, odostop); out.println("Your item has been added to the database<br>"); //res.sendRedirect(""+classdir+"UniCash?action=showtimesheet"); @@ -11534,12 +11569,14 @@ String casold = req.getParameter("casold"); String ctype = req.getParameter("ctype"); String paytype = req.getParameter("paytype"); + String odostart=req.getParameter("odostart"); + String odostop=req.getParameter("odostop"); if (callslip == null || callslip.length() < 1) { out.println("Callslip field blank please use back key and try again"); return; } else { - UniTimeSheet.addTimeSheetItem(con, doFormatDateDb(getDateDb(listdate)), callslip, customer, dispatch_time, time_in, time_out, isold, asold, collected, commision, cisold, casold, ctype, username, paytype); + UniTimeSheet.addTimeSheetItem(con, doFormatDateDb(getDateDb(listdate)), callslip, customer, dispatch_time, time_in, time_out, isold, asold, collected, commision, cisold, casold, ctype, username, paytype, odostart, odostop); out.println("Your item has been added to the database<br>"); //res.sendRedirect(""+classdir+"UniCash?action=showtimesheet"); @@ -12555,8 +12592,10 @@ String TimeIn = ts.TimeIn(); String TimeOut = ts.TimeOut(); String DispatchTime = ts.DispatchTime(); + String odostart=ts.OdoStart(); + String odostop=ts.OdoStop(); - mbody=combinestring(mbody,"<br>Dispatched Time: "+DispatchTime+"<br>Time In: "+TimeIn+"<br>Time Out: "+TimeOut+"<br><br>"); + mbody=combinestring(mbody,"<br>Dispatched Time: "+DispatchTime+"<br>Time In: "+TimeIn+"<br>Time Out: "+TimeOut+"<br>Odometer Stop: "+odostop+"<br>Odometer Start: "+odostart+"<br><br>"); } @@ -13188,8 +13227,10 @@ String CAmount = ts.CAmount(); String ItemSold = ts.ItemSold(); String paytype = ts.TPayType(); + String odostart=ts.OdoStart(); + String odostop=ts.OdoStop(); - mbody=combinestring(mbody,"<br>Dispatched Time: "+DispatchTime+"<br>Time In: "+TimeIn+"<br>Time Out: "+TimeOut+"<br><br>"); + mbody=combinestring(mbody,"<br>Dispatched Time: "+DispatchTime+"<br>Time In: "+TimeIn+"<br>Time Out: "+TimeOut+"<br>Odometer Stop: "+odostop+"<br>Odometer Start: "+odostart+"<br><br>"); mbody=combinestring(mbody,"Item Sold: "+ItemSold+"<br>Amount Sold: "+Amount+"<br>Commision Item Sold: "+CItemSold+"<br>Commision Amount Sold: "+CAmount+"<br>Amount Collected: "+AmountCollected+"<br>Commision: "+Commision+"<br>Paid With: "+paytype+"<br>"); } @@ -13524,8 +13565,10 @@ String CAmount = ts.CAmount(); String ItemSold = ts.ItemSold(); String paytype = ts.TPayType(); + String odostop=ts.OdoStop(); + String odostart=ts.OdoStart(); - mbody=combinestring(mbody,"<br>Dispatched Time: "+DispatchTime+"<br>Time In: "+TimeIn+"<br>Time Out: "+TimeOut+"<br><br>"); + mbody=combinestring(mbody,"<br>Dispatched Time: "+DispatchTime+"<br>Time In: "+TimeIn+"<br>Time Out: "+TimeOut+"<br>Odometer Stop: "+odostop+"<br>Odometer Start: "+odostart+"<br><br>"); mbody=combinestring(mbody,"Item Sold: "+ItemSold+"<br>Amount Sold: "+Amount+"<br>Commision Item Sold: "+CItemSold+"<br>Commision Amount Sold: "+CAmount+"<br>Amount Collected: "+AmountCollected+"<br>Commision: "+Commision+"<br>Paid With: "+paytype+"<br>"); } @@ -16446,7 +16489,7 @@ out.println(timesheetdate+"<br>"); out.println("<table border=1 width=100%>"); - out.println("<th>Call Slip</th><th>Customer</th><th>Dispatched</th><th>Time In</th><th>Time Out</th><th>NC<br>Item Sold</th><th>NC<br>Amount</th><th>Com<br>Item Sold</th><th>Com<br>Amount</th><th>Amount Collected</th><th>Paid<br>With</th><th>Commision</th><th>Code</th><th>Delete</th>"); + out.println("<th>Call Slip</th><th>Customer</th><th>Dispatched</th><th>Time In</th><th>Time Out</th><th>NC<br>Item Sold</th><th>NC<br>Amount</th><th>Com<br>Item Sold</th><th>Com<br>Amount</th><th>Amount Collected</th><th>Paid<br>With</th><th>Commision</th><th>Code</th><th>Odometer<br>Start</th><th>Odometer<br>Stop</th><th>Delete</th>"); Vector v; @@ -16471,6 +16514,9 @@ String ctype = t.CType(); String paytype = t.TPayType(); int servsync = t.getServSync(); + String odostart=t.OdoStart(); + String odostop=t.OdoStop(); + counter++; if (counter==1) @@ -16483,9 +16529,9 @@ counter=0; } if (servsync==0) { - out.println("<td><a href="+classdir+"UniCash?action=edittimeentry&tsid="+tsid+"&tdate="+tdate+"&callslip="+callslip+"&customer="+customer+"&time_in="+time_in+"&time_out="+time_out+"&item_sold="+item_sold+"&amount="+amount+"&amount_collected="+amount_collected+"&paytype="+paytype+"&commision="+commision+"&action=timeupdate&tsid="+tsid+"&dispatch_time="+dispatch_time+">"+callslip+"</a></td><td>"+customer+"</td><td>"+dispatch_time+"</td><td>"+time_in+"</td><td>"+time_out+"</td><td>"+item_sold+"</td><td>"+amount+"</td><td>"+citem_sold+"</td><td>"+camount+"</td><td>"+amount_collected+"</td><td>"+paytype+"</td><td>"+commision+"</td><td>"+ctype+"</td><td><a href="+classdir+"UniCash?action=deletesingletime&tsid="+tsid+"&listdate="+timesheetdate+">Delete</a></td></tr>"); + out.println("<td><a href="+classdir+"UniCash?action=edittimeentry&tsid="+tsid+"&tdate="+tdate+"&callslip="+callslip+"&customer="+customer+"&time_in="+time_in+"&time_out="+time_out+"&item_sold="+item_sold+"&amount="+amount+"&amount_collected="+amount_collected+"&paytype="+paytype+"&commision="+commision+"&action=timeupdate&tsid="+tsid+"&dispatch_time="+dispatch_time+">"+callslip+"</a></td><td>"+customer+"</td><td>"+dispatch_time+"</td><td>"+time_in+"</td><td>"+time_out+"</td><td>"+item_sold+"</td><td>"+amount+"</td><td>"+citem_sold+"</td><td>"+camount+"</td><td>"+amount_collected+"</td><td>"+paytype+"</td><td>"+commision+"</td><td>"+ctype+"</td><td>"+odostart+"</td><td>"+odostop+"</td><td><a href="+classdir+"UniCash?action=deletesingletime&tsid="+tsid+"&listdate="+timesheetdate+">Delete</a></td></tr>"); } else { - out.println("<td><a href="+classdir+"UniCash?action=edittimeentry&tsid="+tsid+"&tdate="+tdate+"&callslip="+callslip+"&customer="+customer+"&time_in="+time_in+"&time_out="+time_out+"&item_sold="+item_sold+"&amount="+amount+"&amount_collected="+amount_collected+"&commision="+commision+"&action=timeupdate&tsid="+tsid+"&dispatch_time="+dispatch_time+">"+callslip+"</a></td><td>"+customer+"</td><td>"+dispatch_time+"</td><td>"+time_in+"</td><td>"+time_out+"</td><td>"+item_sold+"</td><td>"+amount+"</td><td>"+citem_sold+"</td><td>"+camount+"</td><td>"+amount_collected+"</td><td>"+paytype+"</td><td>"+commision+"</td><td>"+ctype+"</td><td>-</td></tr>"); + out.println("<td><a href="+classdir+"UniCash?action=edittimeentry&tsid="+tsid+"&tdate="+tdate+"&callslip="+callslip+"&customer="+customer+"&time_in="+time_in+"&time_out="+time_out+"&item_sold="+item_sold+"&amount="+amount+"&amount_collected="+amount_collected+"&commision="+commision+"&action=timeupdate&tsid="+tsid+"&dispatch_time="+dispatch_time+">"+callslip+"</a></td><td>"+customer+"</td><td>"+dispatch_time+"</td><td>"+time_in+"</td><td>"+time_out+"</td><td>"+item_sold+"</td><td>"+amount+"</td><td>"+citem_sold+"</td><td>"+camount+"</td><td>"+amount_collected+"</td><td>"+paytype+"</td><td>"+commision+"</td><td>"+ctype+"</td><td>"+odostart+"</td><td>"+odostop+"</td><td>-</td></tr>"); } } @@ -16538,7 +16584,7 @@ out.println("<BODY TEXT=#000000 LINK=#0000ff VLINK=#000080 BGCOLOR=#ffffff><p align=\"center\"> "); out.println("<table width=\"95%\" align=\"center\"><tr><td><h3>Date:"+ startdate+"<br>to<br>Date: "+enddate+"</h3></td><td><h3>Service Tech:"+ tech_name+"</h3></td></tr></table>"); out.println("<br><br><br><table align=\"center\" border=1 width=\"100%\" cellpadding=2>"); - out.println("<font=-2><th>Call Slip</th><th>Customer</th><th>Date</th><th>Item Sold</th><th>Amount</th><th>Amount<br>Collected</th><th>Commision</th>"); + out.println("<font=-2><th>Call Slip</th><th>Customer</th><th>Date</th><th>Item Sold</th><th>Amount</th><th>Amount<br>Collected</th><th>Commision</th><th>Odometer<br>Start</th><th>Odometer<br>Stop</th>"); } Vector v; v = UniTimeSheet.getAllItems(con,doFormatDateDb(getDateDb(startdate)),doFormatDateDb(getDateDb(enddate)), username ); @@ -16573,6 +16619,8 @@ String amount_collected = t.AmountCollected(); String commision = t.Commision(); String tdate = t.TDate(); + String odostart=t.OdoStart(); + String odostop=t.OdoStop(); counter++; double iamount = Double.parseDouble(amount); @@ -16595,10 +16643,10 @@ day_billed=day_billed+iamount; day_collected=day_collected+iamount_collected; if (subvalue.equalsIgnoreCase("email")) { -mbody=combinestring(mbody,"<tr><td>"+callslip+"</td><td>"+customer+"</td><td>"+tdate+"</td><td>"+item_sold+"</td><td>"+amount+"</td><td>"+amount_collected+"</td><td>"+commision+"</td></tr>"); +mbody=combinestring(mbody,"<tr><td>"+callslip+"</td><td>"+customer+"</td><td>"+tdate+"</td><td>"+item_sold+"</td><td>"+amount+"</td><td>"+amount_collected+"</td><td>"+commision+"</td><td>"+odostart+"</td><td>"+odostop+"</td></tr>"); } else { -out.println("<tr><td>"+callslip+"</td><td>"+customer+"</td><td>"+tdate+"</td><td>"+item_sold+"</td><td>"+amount+"</td><td>"+amount_collected+"</td><td>"+commision+"</td></tr>"); +out.println("<tr><td>"+callslip+"</td><td>"+customer+"</td><td>"+tdate+"</td><td>"+item_sold+"</td><td>"+amount+"</td><td>"+amount_collected+"</td><td>"+commision+"</td><td>"+odostart+"</td><td>"+odostop+"</td></tr>"); } } counter1++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2006-05-23 17:50:07
|
Revision: 115 Author: molnar_c Date: 2006-05-23 10:49:32 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/servsys/?rev=115&view=rev Log Message: ----------- RELEASE 2.29 - DATED 2006-05-23 Modified Paths: -------------- trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-23 17:35:00 UTC (rev 114) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-23 17:49:32 UTC (rev 115) @@ -6389,14 +6389,19 @@ } //RELEASE_VERSION - vnumber = "2.28"; + vnumber = "2.29"; + if (dbvnumber.equalsIgnoreCase("2.28")) { + Statement stmtu2 = con.createStatement(); + int result225z = stmtu2.executeUpdate("UPDATE version set vnumber='2.29';"); + int result221x = stmtu2.executeUpdate("UPDATE version set vdate='2006-05-23';"); + } if (dbvnumber.equalsIgnoreCase("2.27")) { Statement stmtu2 = con.createStatement(); int result225a1 = stmtu2.executeUpdate("alter table inv_use add invloc text after servsync;"); int result226a1=stmtu2.executeUpdate("update inv_use set invloc='TRUCK';"); //int result225a2 = stmtu2.executeUpdate(""); int result225z = stmtu2.executeUpdate("UPDATE version set vnumber='2.28';"); - int result221x = stmtu2.executeUpdate("UPDATE version set vdate='2006-05-17';"); + int result221x = stmtu2.executeUpdate("UPDATE version set vdate='2006-05-23';"); } if (dbvnumber.equalsIgnoreCase("2.26")) { Statement stmtu2 = con.createStatement(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2006-05-23 17:35:40
|
Revision: 114 Author: molnar_c Date: 2006-05-23 10:35:00 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/servsys/?rev=114&view=rev Log Message: ----------- Needed to fix some bugs that I found during documentation for Meachams. Modified Paths: -------------- trunk/servsys/TODO trunk/servsys/src/com/pandmservices/UniPhoneList.java trunk/servsys/src/com/pandmservices/UniPreventative.java trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/TODO =================================================================== --- trunk/servsys/TODO 2006-05-21 02:16:40 UTC (rev 113) +++ trunk/servsys/TODO 2006-05-23 17:35:00 UTC (rev 114) @@ -1,30 +1,33 @@ - Need to figure out a way for master worksheets to update when pricing updates. 55. Identify email of callslips into system - 54. Read email from server - -136. Load calc entry form - -137. Load calc edit form - -138. Load calc report - 145. Add prompting for package selection - 146. Add color prompting for package selection - - Upload checkme - move all select statements into other classes and out of UniCash.java. - if running on master server allow update of server dates. -- Add customer interface: customer selects on "request service" from main screen prior to log in. - is prompted for customer number from bill. customer number is searched to match address and phone number. - customer is presented with a pre-filled form or requested for information. Customer is asked to complete - information and aknowladge billing and disclaimer. Customer is given a reciept and email is sent to the - appropriate people. +- Edit Planned Service Pricing need to be added/fixed. +- Need to add CSV file import for Inventory Data +================================================================= +RELEASE 2.30 +================================================================= + ================================================================= RELEASE 2.29 ================================================================= (N) Moved from localhost cvs to svn.sourceforge.net /svnroot/servsys re-imported and updated. This is test commit. (N) Customer request form is now added +(F) Fixed the return from adding a service proposal to go to the correct spot on the servsys grid. +(N) Add customer interface: customer selects on "request service" from main screen prior to log in. + is prompted for customer number from bill. customer number is searched to match address and phone number. + customer is presented with a pre-filled form or requested for information. Customer is asked to complete + information and aknowladge billing and disclaimer. Customer is given a reciept and email is sent to the + appropriate people. +(F) Fixed the add planned service price routine. Error found while working on documentation. - - ================================================================= RELEASE 2.28 ================================================================= @@ -62,6 +65,9 @@ (N) Now added SyncCustQuotes (N) Now added SyncCustWorksheet (N) Now Added SyncCustPagreement +136. Load calc entry form +137. Load calc edit form - +138. Load calc report - ================================================================= RELEASE 2.25 Modified: trunk/servsys/src/com/pandmservices/UniPhoneList.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniPhoneList.java 2006-05-21 02:16:40 UTC (rev 113) +++ trunk/servsys/src/com/pandmservices/UniPhoneList.java 2006-05-23 17:35:00 UTC (rev 114) @@ -80,13 +80,13 @@ } - public static void UpdateItem(Connection con, int record_number, String name, String home_number, String cell_number, String direct_connect, String truck_number, String additional_number) + public static void UpdateItem(Connection con, int record_number, String name, String home_number, String cell_number, String direct_connect, String truck_number, String additional_number, String newdate) throws SQLException { Statement stmt = con.createStatement(); stmt.executeUpdate("Update phone_list Set name ='" +name + "', home_number='"+home_number +"', cell_number='"+cell_number +"', direct_connect='"+direct_connect +"', truck_number='"+truck_number +"', additional_number='"+additional_number +"' Where record_number=" + record_number + ";"); + stmt.executeUpdate("update phone_list_date set dateupdated='"+newdate+"';"); } - public static void AddItem(Connection con, String name, String home_number, String cell_number, String direct_connect, String truck_number, String additional_number) throws SQLException, NoSuchAlgorithmException, NoSuchProviderException { @@ -94,6 +94,14 @@ stmt.executeUpdate("INSERT INTO phone_list (name, home_number, cell_number, direct_connect, truck_number, additional_number) Values ('" + name + "','" +home_number+ "','"+ cell_number+ "','"+ direct_connect + "','" + truck_number + "','"+ additional_number + "')"); } + public static void AddItem(Connection con, String name, String home_number, String cell_number, String direct_connect, String truck_number, String additional_number, String newdate) + throws SQLException, NoSuchAlgorithmException, NoSuchProviderException + { + Statement stmt = con.createStatement(); + stmt.executeUpdate("INSERT INTO phone_list (name, home_number, cell_number, direct_connect, truck_number, additional_number) Values ('" + name + "','" +home_number+ "','"+ cell_number+ "','"+ direct_connect + "','" + truck_number + "','"+ additional_number + "')"); + stmt.executeUpdate("update phone_list_date set dateupdated='"+newdate+"';"); + } + public int getId() { return record_number; } public String getName() { return name; } Modified: trunk/servsys/src/com/pandmservices/UniPreventative.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniPreventative.java 2006-05-21 02:16:40 UTC (rev 113) +++ trunk/servsys/src/com/pandmservices/UniPreventative.java 2006-05-23 17:35:00 UTC (rev 114) @@ -69,7 +69,16 @@ Statement stmt = con.createStatement(); stmt.executeUpdate("Update todo Set descript='" +desc+ "' Where ID=" + id + ";"); } - + +public static void addPreventative(Connection con, String description, String tm_est, String yr_1, String yr_2, String yr_3, String newdate) + throws SQLException + { + String tdescription = description.replaceAll("'","''"); + Statement stmt = con.createStatement(); + stmt.executeUpdate("INSERT INTO prevprices (descript, tm_est, yr1, yr2, yr3) Values ('" + tdescription + "','" +tm_est+ "','"+ yr_1 + "','"+ yr_2 + "','"+ yr_3 + "')"); + stmt.executeUpdate("update prevprices_date set dateupdated='"+newdate+"';"); + } + public static void addPreventative(Connection con, String description, String tm_est, String yr_1, String yr_2, String yr_3) throws SQLException { Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-21 02:16:40 UTC (rev 113) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-23 17:35:00 UTC (rev 114) @@ -4823,7 +4823,7 @@ out.println("</td><td>"); out.println("<input type=\"text\" name=\"lname\" size=\"20\" >"); out.println("</td></tr><tr><td>"); - out.println("First Name:"); + out.println("First Name:<br>(Leave blank if business)"); out.println("</td><td>"); out.println("<input type=\"text\" name=\"fname\" size=\"20\" >"); out.println("</td></tr><tr><td>"); @@ -4881,7 +4881,7 @@ out.println("</P>"); out.println("</TD>"); out.println("<TD WIDTH=50% ALIGN=LEFT>"); - out.println("<h2><i>Service Entry and Reporting System</i></h2>"); + //out.println("<h2><i>Service Entry and Reporting System</i></h2>"); out.println("</TD>"); out.println("</TR>"); out.println("</THEAD>"); @@ -4890,13 +4890,13 @@ out.println("</HTML>"); out.println("<br><br><br><br><CENTER>"); out.println("(C) Copyright 2002-2006 - Our World Services, LLC<br>"); -out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); +//out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); //out.println("<br>Software Expire Date: "+doFormatDate(getDate(doGetExpireDate()))+"<br>"); //out.println("<br>Software Expire Date has been removed for GPL version.<br>"); //out.println("<br>Source code per the GPL can be found on sourceforge.net or at servsys.org<br>"); out.println("<br><br><br>For assistance with this product please contact:<br>Chris Molnar<br>860-798-7032<br>mo...@ma..."); -out.println("<br><br><br><P><IMG SRC=\""+Gwebhome+"MacOS_Pnthr_Vert_v1.gif\" NAME=\"Graphic1\" ALIGN=CENTER WIDTH=50 HEIGHT=60 BORDER=0><BR CLEAR=LEFT><BR>"); -out.println("Developed on Mac OS/X for all platforms<br>"); +//out.println("<br><br><br><P><IMG SRC=\""+Gwebhome+"MacOS_Pnthr_Vert_v1.gif\" NAME=\"Graphic1\" ALIGN=CENTER WIDTH=50 HEIGHT=60 BORDER=0><BR CLEAR=LEFT><BR>"); +//out.println("Developed on Mac OS/X for all platforms<br>"); /* #system("uptime"); */ out.println("</CENTER>"); @@ -5213,6 +5213,8 @@ mbody=combinestring(mbody,"Customer Name: "+cname+"<br>"); mbody=combinestring(mbody,"Address: "+address1+"<br>"); mbody=combinestring(mbody,"Address: "+address2+"<br>"); + mbody=combinestring(mbody,"Phone: "+homephone+"<br>"); + mbody=combinestring(mbody,"Phone 2: "+altphone+"<br>"); mbody=combinestring(mbody,"City, State Zip:"+city+", "+state+" "+zip+"<br>"); mbody=combinestring(mbody,"<br>"); mbody=combinestring(mbody,"Date:"+cdate+"<br>"); @@ -10260,7 +10262,7 @@ out.println("<head>"); out.println("<title>Add Preventative Price</title>"); out.println("</head>"); - out.println("<form method=\"post\" action=\"href="+classdir+"UniCash?action=saveprevprice\" name=\"addcust\">"); + out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=saveprevprice\" name=\"addcust\">"); out.println("<p>Description :"); out.println("<input type=\"text\" name=\"descript\" size=\"40\">"); out.println("</p>"); @@ -10280,8 +10282,7 @@ out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\">"); out.println("<INPUT TYPE=\"reset\">"); out.println("</CENTER>"); - - con.close(); + con.close(); } private void doSavePrevPrice(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) @@ -10292,9 +10293,15 @@ String yr2 = req.getParameter("yr2"); String yr1 = req.getParameter("yr1"); String tm_est = req.getParameter("tm_est"); + Format formatter; + Calendar now = Calendar.getInstance(); + Date date = new Date(); + formatter = new SimpleDateFormat("yyyy-MM-dd"); + String s = formatter.format(date); - UniPreventative.addPreventative(con, descript, tm_est, yr1, yr2, yr3); + UniPreventative.addPreventative(con, descript, tm_est, yr1, yr2, yr3, s); out.println("Your item has been added to the database<br>"); + con.close(); res.sendRedirect(""+classdir+"UniCash?action=listprevprice"); } @@ -10367,11 +10374,11 @@ out.println("<title>Planned Service Prices</title>"); out.println("</head>"); out.println("<BODY TEXT=#000000 LINK=#0000ff VLINK=#000080 BGCOLOR=#ffffff> "); -out.println("<a href="+classdir+"UniCash?action=addprevetative>Add a Service Price</a>"); +out.println("<a href="+classdir+"UniCash?action=addprevprice>Add a Service Plan Price</a>"); out.println("<P><P>"); out.println("<table border=1 width=100%>"); -//out.println("<th>Description</th><th>T/M Cost</th><th>1 Year</th><th>2 Year</th><th>3 Year</th>"); -out.println("<th>Description</th><th>T/M Cost</th><th>2 Year</th><th>3 Year</th>"); +out.println("<th>Description</th><th>T/M Cost</th><th>1 Year</th><th>2 Year</th><th>3 Year</th>"); +//out.println("<th>Description</th><th>T/M Cost</th><th>2 Year</th><th>3 Year</th>"); Vector v; v = UniPreventative.getAllItems(con); int counter=0; @@ -10395,12 +10402,11 @@ counter=0; } -//out.println("<tr><td><a href=edprevprice.php?planrec="+planrec+">"+description+"</a></td><td>"+tm_est+"</td><td>"+yr_1+"</td><td>"+yr_2+"</td><td>"+yr_3+"</td></tr>"); - out.println("<tr><td><a href=edprevprice.php?planrec="+planrec+">"+description+"</a></td><td>"+tm_est+"</td><td>"+yr_2+"</td><td>"+yr_3+"</td></tr>"); +out.println("<tr><td><a href=edprevprice.php?planrec="+planrec+">"+description+"</a></td><td>"+tm_est+"</td><td>"+yr_1+"</td><td>"+yr_2+"</td><td>"+yr_3+"</td></tr>"); + //out.println("<tr><td><a href=edprevprice.php?planrec="+planrec+">"+description+"</a></td><td>"+tm_est+"</td><td>"+yr_2+"</td><td>"+yr_3+"</td></tr>"); } out.println("</table>"); -out.println("<P><P>"); -out.println("<a href="+classdir+"UniCash?action=addprevetative>Add a Service Price</a>"); +out.println("<P><P>");out.println("<a href="+classdir+"UniCash?action=addprevprice>Add a Service Plan Price</a>"); con.close(); } @@ -21235,7 +21241,13 @@ String dirconnect = req.getParameter("dirconnect"); String trucknum = req.getParameter("trucknum"); String addnum = req.getParameter("addnum"); - UniPhoneList.UpdateItem(con, recnum, ename, homenum, cellnum, dirconnect, trucknum, addnum); + Format formatter; + Calendar now = Calendar.getInstance(); + Date date = new Date(); + formatter = new SimpleDateFormat("yyyy-MM-dd"); + String s = formatter.format(date); + + UniPhoneList.UpdateItem(con, recnum, ename, homenum, cellnum, dirconnect, trucknum, addnum, s); con.close(); res.sendRedirect(""+classdir+"UniCash?action=listphonelist"); } @@ -21250,7 +21262,13 @@ String dirconnect = req.getParameter("dirconnect"); String trucknum = req.getParameter("trucknum"); String addnum = req.getParameter("addnum"); - UniPhoneList.AddItem(con, ename, homenum, cellnum, dirconnect, trucknum, addnum); + Format formatter; + Calendar now = Calendar.getInstance(); + Date date = new Date(); + formatter = new SimpleDateFormat("yyyy-MM-dd"); + String s = formatter.format(date); + + UniPhoneList.AddItem(con, ename, homenum, cellnum, dirconnect, trucknum, addnum, s); con.close(); res.sendRedirect(""+classdir+"UniCash?action=listphonelist"); } @@ -22357,7 +22375,7 @@ con.close(); out.println("Your item has been updated in the database<br>"); - res.sendRedirect(""+classdir+"UniCash?action=showcustdetail&csection=6&custnum="+custnum+"&custstart="+custstart+"&custstop="+custstop+""); + res.sendRedirect(""+classdir+"UniCash?action=showcustdetail&csection=5&custnum="+custnum+"&custstart="+custstart+"&custstop="+custstop+""); } private void doSavePrev(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2006-05-21 02:16:53
|
Revision: 113 Author: molnar_c Date: 2006-05-20 19:16:40 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/servsys/?rev=113&view=rev Log Message: ----------- We now have the customer request form added. Must also have a tech id of servsys and it will email to the company reports section. Modified Paths: -------------- trunk/servsys/TODO trunk/servsys/src/com/pandmservices/UniCustomer.java trunk/servsys/src/com/pandmservices/web/UniCash.java Modified: trunk/servsys/TODO =================================================================== --- trunk/servsys/TODO 2006-05-19 23:24:19 UTC (rev 112) +++ trunk/servsys/TODO 2006-05-21 02:16:40 UTC (rev 113) @@ -21,6 +21,7 @@ ================================================================= (N) Moved from localhost cvs to svn.sourceforge.net /svnroot/servsys re-imported and updated. This is test commit. +(N) Customer request form is now added Modified: trunk/servsys/src/com/pandmservices/UniCustomer.java =================================================================== --- trunk/servsys/src/com/pandmservices/UniCustomer.java 2006-05-19 23:24:19 UTC (rev 112) +++ trunk/servsys/src/com/pandmservices/UniCustomer.java 2006-05-21 02:16:40 UTC (rev 113) @@ -208,7 +208,21 @@ return V; } + public static Vector getAllItems(Connection c, String cname, String phone, String zip) + throws SQLException, TodoException + { + Vector V = new Vector(); + Statement stmt = c.createStatement(); + ResultSet rs = stmt.executeQuery("SELECT custnum, cname, address1, city FROM customers where cname ='"+cname+"' and homephone ='"+phone+"' and zip ='"+zip+"' order by cname"); + while(rs.next()) + { + UniCustomer t = new UniCustomer(c,rs.getInt("custnum")); + V.addElement(t); + } + return V; + } + public static Vector getAllItems(Connection c, String custstart, String custstop) throws SQLException, TodoException { @@ -227,15 +241,13 @@ throws SQLException, TodoException { Statement stmt = c.createStatement(); - ResultSet rs = stmt.executeQuery("SELECT id FROM todo ORDER BY id;"); + ResultSet rs = stmt.executeQuery("SELECT max(custnum) as id FROM customers;"); int idlarge = 0; while(rs.next()) { idlarge = rs.getInt("id"); } - return idlarge; - } public static String getAccountID(Connection c, String TAName) Modified: trunk/servsys/src/com/pandmservices/web/UniCash.java =================================================================== --- trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-19 23:24:19 UTC (rev 112) +++ trunk/servsys/src/com/pandmservices/web/UniCash.java 2006-05-21 02:16:40 UTC (rev 113) @@ -107,7 +107,19 @@ log("just got session information in doGet. User: "+username+""); if (action.equalsIgnoreCase("checklogin")) { doCheckUserLogin(req, res, out, session, username); - } else { + } else if (action.equalsIgnoreCase("customerrequest")) { + doCustomerRequest(req, res, out, session, username); + } else if (action.equalsIgnoreCase("checkcustomer")) { + doCheckCustomer(req, res, out, session, username); + } else if (action.equalsIgnoreCase("custaddform")) { + doCustAddForm(req, res, out, session, username); + } else if (action.equalsIgnoreCase("savecustaddform")) { + doSaveCustAddForm(req, res, out, session, username); + } else if (action.equalsIgnoreCase("addservicerequest")) { + doAddServiceRequest(req, res, out, session, username); + } else if (action.equalsIgnoreCase("savecustcallslip")) { + doSaveCustCallslip(req, res, out, session, username); + } else{ if (username==null) { doLoginUser(req, res, out, session, username); @@ -4796,6 +4808,437 @@ res.sendRedirect(""+classdir+"UniCash?action=checkadminuser&next_page="+next_page+""); } +private void doCustomerRequest(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + doVersionInfo_VNumber(); + String action = req.getParameter("action"); + out.println("<html>"); + out.println("<head>"); + out.println("<title>Customer Service Request</title>"); + out.println("</head><table border=0><tr><td valign=\"top\" width=\"50%\">"); + out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=checkcustomer\" name=\"addcust\">"); + out.println("<table><tr><td>"); + out.println("Last Name<br>Business Name:"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"lname\" size=\"20\" >"); + out.println("</td></tr><tr><td>"); + out.println("First Name:"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"fname\" size=\"20\" >"); + out.println("</td></tr><tr><td>"); + out.println("Phone Number (example: 508-555-1212) :"); + out.println("</td><td>"); + out.println("<input type=\"phone\" name=\"phonenumber\" size=\"20\" >"); + out.println("</td></tr><tr><td>"); + out.println("Zip Code (example: 06279) :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"zipcode\" size=\"5\" >"); + out.println("</td></tr><tr><td>"); + out.println("</td></tr></table>"); + out.println("<p> <CENTER>"); + out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Login\">"); + out.println("<INPUT TYPE=\"reset\">"); +out.println("</CENTER>"); + out.println("</form></td><td>"); + + String imagename=null; + String imagewidth=null; + String imagehight=null; + String compname=null; + String complogo=null; + String compaddress=null; + String compphone=null; + + Vector v; + v = UniCompConfig.getAllItems(con); + int counter=0; + for (int i = 0 ; i < v.size(); i++) + { + UniCompConfig t = (UniCompConfig) v.elementAt(i); + imagename=t.getImage(); + imagewidth=t.getImageWidth(); + imagehight=t.getImageHight(); + compname=t.getCoName(); + complogo=t.getCoLogo(); + compaddress=t.getCoAddress(); + compphone=t.getCoPhone(); + } + + out.println("<HTML>"); +out.println("<HEAD>"); +out.println(" <META HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=iso-8859-1\">"); + out.println(" <TITLE>Servsys Login</TITLE>"); +out.println("</HEAD>"); +out.println("<BODY TEXT=\"#000000\" LINK=\"#0000ff\" VLINK=\"#000080\" BGCOLOR=\"#ffffff\">"); + +out.println("<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>"); + out.println("<THEAD>"); + out.println("<TR>"); + out.println("</TD>"); + out.println("<TD WIDTH=30% VALIGN=TOP>"); + out.println("<P><IMG SRC=\""+imagename+"\" NAME=\"Graphic1\" ALIGN=CENTER WIDTH="+imagewidth+" HEIGHT="+imagehight+" BORDER=0><BR CLEAR=LEFT><BR>"); + out.println("</P>"); + out.println("</TD>"); + out.println("<TD WIDTH=50% ALIGN=LEFT>"); + out.println("<h2><i>Service Entry and Reporting System</i></h2>"); + out.println("</TD>"); + out.println("</TR>"); + out.println("</THEAD>"); +out.println("</TABLE>"); +out.println("</BODY>"); +out.println("</HTML>"); +out.println("<br><br><br><br><CENTER>"); +out.println("(C) Copyright 2002-2006 - Our World Services, LLC<br>"); +out.println("<br>Version: "+doVersionInfo_VNumber()+" - Compiled: "+doFormatDate(getDate(doVersionInfo_VDate()))+"<br>"); +//out.println("<br>Software Expire Date: "+doFormatDate(getDate(doGetExpireDate()))+"<br>"); +//out.println("<br>Software Expire Date has been removed for GPL version.<br>"); +//out.println("<br>Source code per the GPL can be found on sourceforge.net or at servsys.org<br>"); +out.println("<br><br><br>For assistance with this product please contact:<br>Chris Molnar<br>860-798-7032<br>mo...@ma..."); +out.println("<br><br><br><P><IMG SRC=\""+Gwebhome+"MacOS_Pnthr_Vert_v1.gif\" NAME=\"Graphic1\" ALIGN=CENTER WIDTH=50 HEIGHT=60 BORDER=0><BR CLEAR=LEFT><BR>"); +out.println("Developed on Mac OS/X for all platforms<br>"); +/* #system("uptime"); */ + + out.println("</CENTER>"); + con.close(); + } + +private void doCheckCustomer(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + + String action = req.getParameter("action"); + String lname = req.getParameter("lname"); + String fname = req.getParameter("fname"); + String phonenumber = req.getParameter("phonenumber"); + String zipcode=req.getParameter("zipcode"); + String cname1=null; + String address1=null; + String address2=null; + String city=null; + String state=null; + String zip=null; + String homephone=null; + String altphone=null; + String custsite=null; + String sitenum=null; + String crecnum=null; + + String cname = ""; + if (fname.length() > 1 ) { + cname = combinestring(cname, lname+", "); + cname = combinestring(cname, fname); + } else { + cname = combinestring(cname, lname); + } + + Vector v; + v = UniCustomer.getAllItems(con, cname, phonenumber, zipcode); + + if (v.size() == 0) { + // put form for no customer found - enter remainder of information + out.println("No Information found<br>"); + // send to a new customer form. + res.sendRedirect(""+classdir+"UniCash?action=custaddform"); + + } else { + + for (int i = 0 ; i < v.size(); i++) + { + UniCustomer t = (UniCustomer) v.elementAt(i); + address1=t.getAddress1(); + address2=t.getAddress2(); + crecnum=t.getCusNum(); + custsite=t.getCustSite(); + sitenum=t.getSiteNum(); + } + + // show customer information found - ask if correct + out.println("<html><body><h2>I believe we have serviced this location before.</h2><br><br>"); + out.println("<h2>I have your address as: "+address1+" "+address2+"<br><br></h2>"); + out.println("<h2>Is this correct?<h2><br>"); + out.println("<h2><a href="+classdir+"UniCash?action=addservicerequest&custsite="+custsite+"&sitenum="+sitenum+"&crecnum="+crecnum+">Yes</a></h2><br>"); + out.println("<h2><a href="+classdir+"UniCash?action=custaddform>No</a></h2><br>"); + } + + } + + private void doCustAddForm(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + + out.println("<html>"); + out.println("<head>"); + out.println("<title>Add Customer</title>"); + out.println("</head>"); + out.println("<h2>Please complete the following form. Make sure the address and phone number are correct and then press save.</h2>"); + out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=savecustaddform\" name=\"custform\">"); + out.println("<table><tr><td>"); + out.println("Customer Name<br> (Business or Last, First) :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"cname\" size=\"40\">"); + out.println("</td></tr><tr><td>"); + out.println("Address :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"address1\" size=\"40\">"); + out.println("</td></tr><tr><td>"); + out.println("Address :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"address2\" size=\"40\">"); + out.println("</td></tr><tr><td>"); + out.println("City :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"city\" size=\"40\">"); + out.println("</td></tr><tr><td>"); + out.println("State :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"state\" size=\"3\">"); + out.println("</td></tr><tr><td>"); + out.println("Zip Code :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"zip\" size=\"10\">"); + out.println("</td></tr><tr><td>"); + out.println("Primary Phone:"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"homephone\" size=\"15\">"); + out.println("</td></tr><tr><td>"); + out.println("Alt Phone :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"altphone\" size=\"15\">"); + out.println("</td></tr><tr><td>"); + out.println("Email Address :"); + out.println("</td><td>"); + out.println("<input type=\"text\" name=\"cemail\" size=\"50\">"); + //out.println("</td></tr><tr><td>"); + //out.println("Customer Number :"); + //out.println("</td><td>"); + //out.println("<input type=\"text\" name=\"custsite\" size=\"15\">"); + //out.println("</td></tr><tr><td>"); + //out.println("Site Number :"); + //out.println("</td><td>"); + //out.println("<input type=\"text\" name=\"sitenum\" size=\"15\">"); + //out.println("</td></tr><tr><td>"); + //out.println("Customer Type (T=T/M, F=Full) :"); + //out.println("</td><td>"); + //out.println("<input type=\"text\" name=\"custtype\" size=\"15\">"); + //out.println("</td></tr><tr><td>"); + //out.println("Customer Notes :"); + //out.println("</td><td>"); + //out.println("<input type=\"text\" name=\"cust_notes\" size=\"80\">"); + out.println("</td></tr></table>"); + out.println("<p> <CENTER>"); + out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\">"); + out.println("<INPUT TYPE=\"reset\">"); + out.println("</CENTER>"); + con.close(); + } + + +private void doSaveCustAddForm(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + String custstart = req.getParameter("custstart"); + String custstop = req.getParameter("custstop"); + String cname = req.getParameter("cname"); + String address1 = req.getParameter("address1"); + String address2 = req.getParameter("address2"); + String city = req.getParameter("city"); + String custtype = req.getParameter("custtype"); + custtype="T"; + String state = req.getParameter("state"); + String zip = req.getParameter("zip"); + String homephone = req.getParameter("homephone"); + String altphone = req.getParameter("altphone"); + String cust_notes = req.getParameter("cust_notes"); + cust_notes="Added from a customer request"; + String cemail = req.getParameter("cemail"); + //String custsite = req.getParameter("custsite"); + //String sitenum = req.getParameter("sitenum"); + // get date in YYYYMMDD format + if ((cname.length()<=1)||(address1.length()<=1)||(homephone.length()<=7)) { + out.println("<h2>You either did not complete<br>1) Name<br>2) Address<br>3)Phone Number<br><br>Please use your back key on the browser and correct problem.<br>"); + } else { + Format formatter; + Calendar now = Calendar.getInstance(); + Date date = new Date(); + formatter = new SimpleDateFormat("yyyyMMdd"); + String s = formatter.format(date); + // get max customer number and add 1 + int highrecnum = UniCustomer.getMaxID(con); + highrecnum++; + // String combine the max customer number and date to get custsite + String custsite=combinestring(s,""+highrecnum+""); + String sitenum="001"; + out.println("Custsite: "+custsite+"<br>Sitenum: "+sitenum+"<br>"); + UniCustomer.addCustomer(con, cname, address1, address2, city, state, zip, homephone, altphone, cust_notes,cemail,custsite,sitenum,custtype); + // Now get new max customer record and this is crecnum + int newcustrec = UniCustomer.getMaxID(con); + out.println("Your item has been added to the database"); + con.close(); + res.sendRedirect(""+classdir+"UniCash?action=addservicerequest&custsite="+custsite+"&sitenum="+sitenum+"&crecnum="+newcustrec+""); + } + } + +private void doAddServiceRequest(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + String custsite=req.getParameter("custsite"); + String sitenum=req.getParameter("sitenum"); + String tcustnum=req.getParameter("crecnum"); + Format formatter; + Calendar now = Calendar.getInstance(); + Date date = new Date(); + formatter = new SimpleDateFormat("MM-dd-yyyy"); + String s = formatter.format(date); + int hour = now.get(Calendar.HOUR_OF_DAY); + int second = now.get(Calendar.SECOND); + int year = now.get(Calendar.YEAR); + int month = now.get(Calendar.MONTH); + int minute = now.get(Calendar.MINUTE); + int millisecond = now.get(Calendar.MILLISECOND); + String collected="0.00"; + String charges="0.00"; + int custnum = Integer.parseInt(tcustnum); + int eenum=0; + int ecustnum=0; + String brand=null; + String modelnum=null; + String serialnum=null; + String filter=null; + String notes=null; + out.println("<html>"); + out.println("<head>"); + out.println("<title>Add Customer Request</title>"); + out.println("</head>"); + out.println("<form method=\"post\" action=\""+classdir+"UniCash?action=savecustcallslip&custnum="+custnum+"\" name=\"addcat\">"); + out.println("<table size=100% border=1>"); + out.println("<tr><td>Date</td><td>"+s+""); + out.println("<input type=\"hidden\" name=\"cdate\" value="+s+"></td>"); + out.println("</tr>"); + out.println("<tr><td>Please Enter Your Initials</td><td>"); + out.println("<input type=\"text\" name=\"custinits\" ></td>"); + out.println("</tr>"); + out.println("<tr><td>Reason</td><td>"); + out.println("<SELECT name=\"reason\">"); + out.println("<OPTION>Air Conditioning - System Down"); + out.println("<OPTION>Air Conditioning - Maintenance Needed"); + out.println("<OPTION>Heating - System Down"); + out.println("<OPTION>Heating - Maintenance Needed"); + out.println("<OPTION>Refrigeration - System Down"); + out.println("<OPTION>Refrigeration - Maintenance Needed"); + out.println("<OPTION>Sales Quote - New Equipment"); + out.println("<OPTION>Sales Quote - Equipment Replacement"); + out.println("<OPTION>Indoor Air Quality - Inspection"); + out.println("<OPTION>Indoor Air Quality - Problem"); + out.println("<OPTION>Other - Please call"); + out.println("</SELECT></td></tr>"); + out.println("<tr><td>Please describe problem or request with as much detail as possible:</td><td>"); + out.println("<textarea name=\"services\" cols=\"60\" rows=\"8\" wrap=\"VIRTUAL\" style=\"width: 500px\"></textarea></td></tr>"); + out.println("<input type=\"hidden\" name=\"custsite\" value=\""+custsite+"\">"); + out.println("<input type=\"hidden\" name=\"sitenum\" value=\""+sitenum+"\">"); + out.println("<input type=\"hidden\" name=\"custnum\" value=\""+custnum+"\">"); + out.println("</td></tr></table>"); + out.println("<p> <CENTER>"); + out.println("<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\">"); + out.println("<INPUT TYPE=\"reset\">"); + out.println("</CENTER>"); + out.println("</form>"); + } + +private void doSaveCustCallslip(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) + throws Exception + { + String tcustnum = req.getParameter("custnum"); + String custsite = req.getParameter("custsite"); + String sitenum = req.getParameter("sitenum"); + int custnum = Integer.parseInt(tcustnum); + Format formatter; + Calendar now = Calendar.getInstance(); + Date date = new Date(); + formatter = new SimpleDateFormat("yyyyMMdd"); + String s = formatter.format(date); + String custinits=req.getParameter("custinits"); + String callslip =""; + callslip=combinestring(s,custinits); + String reason= req.getParameter("reason"); + String services= req.getParameter("services"); + String cdate= req.getParameter("cdate"); + String recommendations="Needs Attention - Entered by Customer Request"; + String rscheduled=""; + String charges="0.00"; + String collected= "0.00"; + String notes= "-"; + String equip1="0"; + String equip2="0"; + String equip3="0"; + String equip4="0"; + String crectype="C"; + String tfollowup= req.getParameter("followup"); + //int followup = Integer.parseInt(tfollowup); + String tservices = services.replaceAll("\n","<br>"); + String trecommendations = recommendations.replaceAll("\n","<br>"); + String parts="-"; + String address1=""; + String address2=""; + int followup=5; + String cname=""; + String city=""; + String homephone=""; + String altphone=""; + String crecnum=""; + String state=""; + String email=""; + String zip=""; + UniCallslip.AddItem(con, custnum, callslip, doFormatDateDb(getDateDb(cdate)), equip1, equip2,equip3, equip4, reason, services, recommendations, rscheduled, charges, collected, notes, followup, custsite, sitenum, crectype, username,parts); + String mbody=""; + mbody=combinestring(mbody,"A Call was just entered on the system by a customer. The information is as follows:<br>"); + Vector v; + v = UniCustomer.getCustNumSite(con, custsite, sitenum); + for (int i = 0 ; i < v.size(); i++) + { + UniCustomer t = (UniCustomer) v.elementAt(i); + address1=t.getAddress1(); + address2=t.getAddress2(); + crecnum=t.getCusNum(); + custsite=t.getCustSite(); + sitenum=t.getSiteNum(); + cname = t.getCustomerName(); + city=t.getCity(); + state=t.getState(); + homephone=t.getHomePhone(); + altphone=t.getAltPhone(); + email=t.getCEmail(); + zip=t.getZip(); + } + mbody=combinestring(mbody,"Customer Name: "+cname+"<br>"); + mbody=combinestring(mbody,"Address: "+address1+"<br>"); + mbody=combinestring(mbody,"Address: "+address2+"<br>"); + mbody=combinestring(mbody,"City, State Zip:"+city+", "+state+" "+zip+"<br>"); + mbody=combinestring(mbody,"<br>"); + mbody=combinestring(mbody,"Date:"+cdate+"<br>"); + mbody=combinestring(mbody,"Callslip Number: "+callslip+"<br>"); + mbody=combinestring(mbody,"Reason: "+reason+"<br>"); + mbody=combinestring(mbody,"<br>Description of Problem:<br>"+services+"<br>"+recommendations+"<br>"); + out.println("Your item has been added to the database.<br><br>"); + out.println("Your request was entered on: "+cdate+"<br>"); + out.println("Your record number is: "+callslip+"<br><br>"); + out.println("Your request has been emailed out to the appropriate technician who will confirm call with you<br>within 30 minutes<br>"); + out.println("Please print or write down this confirmation for your reference.<br>"); + out.println("Thank you for helping us save you money by using our automated system.<br><br><br>--------------------------------------<br>"+mbody+""); + + // put email routine in here + + String emailserver = doGetSmtpServer("servsys"); + //emailsendaddress=doGetIns_Email(username); + String emailsendaddress=doGetCompanyReportEmail(); + String techemailaddress=doGetTech_Email("servsys"); + String smtpuser = doGetSmtpUser("servsys"); + String smtppassword = doGetSmtpPassword("servsys"); + doMailSend(emailserver, emailsendaddress, techemailaddress, "Customer Service Request: Callslip: "+callslip+"" , mbody, smtpuser, smtppassword); + + con.close(); + } + private void doLoginUser(HttpServletRequest req, HttpServletResponse res, PrintWriter out, HttpSession session, String username) throws Exception { @@ -8991,7 +9434,7 @@ out.println("<br><br><br><a href="+classdir+"UniCash?action=addtimecat>Add a Category</a></body></html>"); String thismainserver=doGetThisMainServer(); - if (!thismainserver.equalsIgnoreCase("yes") { + if (!thismainserver.equalsIgnoreCase("yes")) { out.println("<br><br><br><a href="+classdir+"UniCash?action=uploadtimecat>Upload to Main Server (NEED INTERNET CONNECT)</a></body></html>"); } con.close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |