Commit 397c2d6f authored by mjadhav's avatar mjadhav

set cust code bill name


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97117 ce508802-f39f-4f6c-b175-0d175dae99d5
parent de381658
...@@ -569,7 +569,10 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -569,7 +569,10 @@ public class GenInvoiceSchedule implements Schedule {
String siteAreaCode="",siteAdd1="",siteAdd2="",sitecity="",sitePin="",siteStateCode="",siteRegNo="",siteContactPersion=""; String siteAreaCode="",siteAdd1="",siteAdd2="",sitecity="",sitePin="",siteStateCode="",siteRegNo="",siteContactPersion="";
String custAdd1="",custAdd2="",custCity="",custState="",custPin="",custTaxreg="",custType="",custName="",custCountrtCode=""; String custAdd1="",custAdd2="",custCity="",custState="",custPin="",custTaxreg="",custType="",custName="",custCountrtCode="";
String rate="",unitRate="",discountInv="",siteDescr="",custCodeBill="",custCodeDlv=""; String rate="",unitRate="",discountInv="",siteDescr="",custCodeBill="",custCodeDlv="";
String dlvAdd1="",dlvAdd2="",dlvCity="",dlvPin="",dlvCountryCode="",siteStatedescr="",custStatedescr="",custNameBill=""; String dlvAdd1="",dlvAdd2="",dlvCity="",dlvPin="",dlvCountryCode="",siteStatedescr="",custStatedescr="",custNameBill="",custNameDlv="";
String custBillAdd1="",custBillAdd2="",custBillAdd3="",custBillCity="",custBillStateCode="",custBillPin="",custBillCounty="";
String custDlvAdd1="",custDlvAdd2="",custDlvAdd3="",custDlvCity="",custDlvStateCode="",custDlvPin="",custDlvCounty="";
String custBillStatedescr="",custDlvStatedescr="";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
try try
...@@ -613,7 +616,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -613,7 +616,7 @@ public class GenInvoiceSchedule implements Schedule {
{ {
custCode = rs.getString("cust_code"); custCode = rs.getString("cust_code");
siteCode=rs.getString("SITE_CODE"); siteCode=rs.getString("SITE_CODE");
custCodeBil=rs.getString("CUST_CODE__BIL"); custCodeBill=rs.getString("CUST_CODE__BIL");
custCodeDlv=rs.getString("cust_code__dlv"); custCodeDlv=rs.getString("cust_code__dlv");
dlvAdd1=rs.getString("DLV_ADD1"); dlvAdd1=rs.getString("DLV_ADD1");
dlvAdd2=rs.getString("DLV_ADD2"); dlvAdd2=rs.getString("DLV_ADD2");
...@@ -685,7 +688,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -685,7 +688,7 @@ public class GenInvoiceSchedule implements Schedule {
custType = rs.getString("cust_type"); custType = rs.getString("cust_type");
custName = rs.getString("CUST_NAME"); custName = rs.getString("CUST_NAME");
custCountrtCode = rs.getString("COUNT_CODE"); custCountrtCode = rs.getString("COUNT_CODE");
custCodeBill = rs.getString("CUST_CODE__BIL"); //custCodeBill = rs.getString("CUST_CODE__BIL");
} }
rs.close(); rs.close();
...@@ -694,8 +697,10 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -694,8 +697,10 @@ public class GenInvoiceSchedule implements Schedule {
pstmt = null; pstmt = null;
custCodeBill = custCodeBill == null ? " " : custCodeBill.trim(); custCodeBill = custCodeBill == null ? " " : custCodeBill.trim();
custCodeDlv = custCodeDlv == null ? " " : custCodeDlv.trim();
//select cust_name from tarodev.customer where cust_code=? //select cust_name from tarodev.customer where cust_code=?
sql = "select cust_name from customer where CUST_CODE=?" ; sql = "select cust_name,ADDR1,ADDR2,ADDR3,CITY,STATE_CODE,PIN,COUNT_CODE from customer where CUST_CODE=?" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCodeBill); pstmt.setString(1, custCodeBill);
...@@ -703,14 +708,62 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -703,14 +708,62 @@ public class GenInvoiceSchedule implements Schedule {
if (rs.next()) if (rs.next())
{ {
custNameBill = rs.getString("CUST_NAME"); custNameBill = rs.getString("CUST_NAME");
custBillAdd1 = rs.getString("ADDR1");
custBillAdd2 = rs.getString("ADDR2");
custBillAdd3 = rs.getString("ADDR3");
custBillCity = rs.getString("CITY");
custBillStateCode = rs.getString("STATE_CODE");
custBillPin = rs.getString("PIN");
custBillCounty = rs.getString("COUNT_CODE");
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
custBillAdd1 = custBillAdd1 == null ? " " : custBillAdd1.trim();
custBillAdd2 = custBillAdd2 == null ? " " : custBillAdd2.trim();
custBillAdd3 = custBillAdd3 == null ? " " : custBillAdd3.trim();
custBillCity = custBillCity == null ? " " : custBillCity.trim();
custBillStateCode = custBillStateCode == null ? " " : custBillStateCode.trim();
custBillPin = custBillPin == null ? " " : custBillPin.trim();
custBillCounty = custBillCounty == null ? " " : custBillCounty.trim();
sql = "select cust_name,ADDR1,ADDR2,ADDR3,CITY,STATE_CODE,PIN,COUNT_CODE from customer where CUST_CODE=?" ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCodeDlv);
rs = pstmt.executeQuery();
if (rs.next())
{
custNameDlv = rs.getString("CUST_NAME");
custDlvAdd1 = rs.getString("ADDR1");
custDlvAdd2 = rs.getString("ADDR2");
custDlvAdd3 = rs.getString("ADDR3");
custDlvCity = rs.getString("CITY");
custDlvStateCode = rs.getString("STATE_CODE");
custDlvPin = rs.getString("PIN");
custDlvCounty = rs.getString("COUNT_CODE");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
custDlvAdd1 = custDlvAdd1 == null ? " " : custDlvAdd1.trim();
custDlvAdd2 = custDlvAdd2 == null ? " " : custDlvAdd2.trim();
custDlvAdd3 = custDlvAdd3 == null ? " " : custDlvAdd3.trim();
custDlvCity = custDlvCity == null ? " " : custDlvCity.trim();
custDlvStateCode = custDlvStateCode == null ? " " : custDlvStateCode.trim();
custDlvPin = custDlvPin == null ? " " : custDlvPin.trim();
custDlvCounty = custDlvCounty == null ? " " : custDlvCounty.trim();
System.out.println("custNameBill :"+custNameBill);
System.out.println("custNameDlv :"+custNameDlv);
...@@ -719,7 +772,13 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -719,7 +772,13 @@ public class GenInvoiceSchedule implements Schedule {
System.out.println("siteStatedescr "+siteStatedescr); System.out.println("siteStatedescr "+siteStatedescr);
custStatedescr=getStateDescr(conn,custState); custStatedescr=getStateDescr(conn,custState);
System.out.println("custStatedescr "+custStatedescr); System.out.println("custStatedescr "+custStatedescr);
custBillStatedescr=getStateDescr(conn,custBillStateCode);
System.out.println("custBillStatedescr "+custBillStatedescr);
custDlvStatedescr=getStateDescr(conn,custDlvStateCode);
System.out.println("custDlvStateCode "+custDlvStateCode);
custBillStatedescr = custBillStatedescr == null ? " " : custBillStatedescr.trim();
custDlvStatedescr = custDlvStatedescr == null ? " " : custDlvStatedescr.trim();
} }
catch(Exception e) catch(Exception e)
...@@ -760,6 +819,7 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -760,6 +819,7 @@ public class GenInvoiceSchedule implements Schedule {
siteStatedescr = siteStatedescr == null ? " " : siteStatedescr.trim(); siteStatedescr = siteStatedescr == null ? " " : siteStatedescr.trim();
custStatedescr = custStatedescr == null ? " " : custStatedescr.trim(); custStatedescr = custStatedescr == null ? " " : custStatedescr.trim();
custNameBill = custNameBill == null ? " " : custNameBill.trim(); custNameBill = custNameBill == null ? " " : custNameBill.trim();
custNameDlv = custNameDlv == null ? " " : custNameDlv.trim();
...@@ -802,15 +862,15 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -802,15 +862,15 @@ public class GenInvoiceSchedule implements Schedule {
admCustDlv.appendChild(getElementValue(doc, parties, "CentreCode", custCodeDlv)); admCustDlv.appendChild(getElementValue(doc, parties, "CentreCode", custCodeDlv));
admCustDlv.appendChild(getElementValue(doc, parties, "RoleTypeCode", "01")); admCustDlv.appendChild(getElementValue(doc, parties, "RoleTypeCode", "01"));
// administrativeCentres.appendChild(getElementValue(doc, parties, "RoleTypeCode", "03")); // administrativeCentres.appendChild(getElementValue(doc, parties, "RoleTypeCode", "03"));
if(custName != "") if(custNameDlv != "")
{ {
admCustDlv.appendChild(getElementValue(doc, parties, "Name", custName)); admCustDlv.appendChild(getElementValue(doc, parties, "Name", custNameDlv));
} }
Element addCustDlv = doc.createElement("AddressInSpain"); Element addCustDlv = doc.createElement("AddressInSpain");
addCustDlv.appendChild(getElementValue(doc, parties, "Address", dlvAdd1)); addCustDlv.appendChild(getElementValue(doc, parties, "Address", custDlvAdd1));
addCustDlv.appendChild(getElementValue(doc, parties, "PostCode", dlvPin)); addCustDlv.appendChild(getElementValue(doc, parties, "PostCode", custDlvPin));
addCustDlv.appendChild(getElementValue(doc, parties, "Town", dlvCity)); addCustDlv.appendChild(getElementValue(doc, parties, "Town", custDlvCity));
addCustDlv.appendChild(getElementValue(doc, parties, "Province", custStatedescr)); addCustDlv.appendChild(getElementValue(doc, parties, "Province", custDlvStatedescr));
//addCustDlv.appendChild(getElementValue(doc, parties, "CountryCode", dlvCountryCode)); //addCustDlv.appendChild(getElementValue(doc, parties, "CountryCode", dlvCountryCode));
addCustDlv.appendChild(getElementValue(doc, parties, "CountryCode", "ESP")); addCustDlv.appendChild(getElementValue(doc, parties, "CountryCode", "ESP"));
admCustDlv.appendChild(addCustDlv); admCustDlv.appendChild(addCustDlv);
...@@ -824,15 +884,15 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -824,15 +884,15 @@ public class GenInvoiceSchedule implements Schedule {
} }
admCustBill.appendChild(getElementValue(doc, parties, "RoleTypeCode", "02")); admCustBill.appendChild(getElementValue(doc, parties, "RoleTypeCode", "02"));
// administrativeCentres.appendChild(getElementValue(doc, parties, "RoleTypeCode", "03")); // administrativeCentres.appendChild(getElementValue(doc, parties, "RoleTypeCode", "03"));
if(custName != "") if(custNameBill != "")
{ {
admCustBill.appendChild(getElementValue(doc, parties, "Name", custName)); admCustBill.appendChild(getElementValue(doc, parties, "Name", custNameBill));
} }
Element addCustBill = doc.createElement("AddressInSpain"); Element addCustBill = doc.createElement("AddressInSpain");
addCustBill.appendChild(getElementValue(doc, parties, "Address", custAdd1)); addCustBill.appendChild(getElementValue(doc, parties, "Address", custBillAdd1));
addCustBill.appendChild(getElementValue(doc, parties, "PostCode", custPin)); addCustBill.appendChild(getElementValue(doc, parties, "PostCode", custBillPin));
addCustBill.appendChild(getElementValue(doc, parties, "Town", custCity)); addCustBill.appendChild(getElementValue(doc, parties, "Town", custBillCity));
addCustBill.appendChild(getElementValue(doc, parties, "Province", custStatedescr)); addCustBill.appendChild(getElementValue(doc, parties, "Province", custBillStatedescr));
//addCustBill.appendChild(getElementValue(doc, parties, "CountryCode", custCountrtCode)); //addCustBill.appendChild(getElementValue(doc, parties, "CountryCode", custCountrtCode));
addCustBill.appendChild(getElementValue(doc, parties, "CountryCode", "ESP")); addCustBill.appendChild(getElementValue(doc, parties, "CountryCode", "ESP"));
admCustBill.appendChild(addCustBill); admCustBill.appendChild(addCustBill);
...@@ -871,10 +931,10 @@ public class GenInvoiceSchedule implements Schedule { ...@@ -871,10 +931,10 @@ public class GenInvoiceSchedule implements Schedule {
addlegalEntity.appendChild(getElementValue(doc, parties, "PostCode", sitePin)); addlegalEntity.appendChild(getElementValue(doc, parties, "PostCode", sitePin));
addlegalEntity.appendChild(getElementValue(doc, parties, "Town", sitecity)); addlegalEntity.appendChild(getElementValue(doc, parties, "Town", sitecity));
addlegalEntity.appendChild(getElementValue(doc, parties, "Province", siteStatedescr));*/ addlegalEntity.appendChild(getElementValue(doc, parties, "Province", siteStatedescr));*/
addlegalEntity.appendChild(getElementValue(doc, parties, "Address",custAdd1)); addlegalEntity.appendChild(getElementValue(doc, parties, "Address",custBillAdd1));
addlegalEntity.appendChild(getElementValue(doc, parties, "PostCode", custPin)); addlegalEntity.appendChild(getElementValue(doc, parties, "PostCode", custBillPin));
addlegalEntity.appendChild(getElementValue(doc, parties, "Town", custCity)); addlegalEntity.appendChild(getElementValue(doc, parties, "Town", custBillCity));
addlegalEntity.appendChild(getElementValue(doc, parties, "Province", custStatedescr)); addlegalEntity.appendChild(getElementValue(doc, parties, "Province", custBillStatedescr));
addlegalEntity.appendChild(getElementValue(doc, parties, "CountryCode","ESP")); addlegalEntity.appendChild(getElementValue(doc, parties, "CountryCode","ESP"));
legalEntity.appendChild(addlegalEntity); legalEntity.appendChild(addlegalEntity);
buyerParty.appendChild(legalEntity); buyerParty.appendChild(legalEntity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment