Commit bdfb794a authored by mjadhav's avatar mjadhav

add state desc from state master


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97034 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 041a679b
......@@ -553,7 +553,7 @@ public class GenInvoiceSchedule implements Schedule {
String siteAreaCode="",siteAdd1="",siteAdd2="",sitecity="",sitePin="",siteStateCode="",siteRegNo="",siteContactPersion="";
String custAdd1="",custAdd2="",custCity="",custState="",custPin="",custTaxreg="",custType="",custName="",custCountrtCode="";
String rate="",unitRate="",discountInv="",siteDescr="",custCodeBill="",custCodeDlv="";
String dlvAdd1="",dlvAdd2="",dlvCity="",dlvPin="",dlvCountryCode="";
String dlvAdd1="",dlvAdd2="",dlvCity="",dlvPin="",dlvCountryCode="",siteStatedescr="",custStatedescr="";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
......@@ -682,6 +682,10 @@ public class GenInvoiceSchedule implements Schedule {
pstmt = null;
siteStatedescr=getStateDescr(conn,siteStateCode);
System.out.println("siteStatedescr "+siteStatedescr);
custStatedescr=getStateDescr(conn,custState);
System.out.println("custStatedescr "+custStatedescr);
}
......@@ -720,6 +724,8 @@ public class GenInvoiceSchedule implements Schedule {
custName = custName == null ? " " : custName.trim();
custCountrtCode = custCountrtCode == null ? " " : custCountrtCode.trim();
custCodeBill = custCodeBill == null ? " " : custCodeBill.trim();
siteStatedescr = siteStatedescr == null ? " " : siteStatedescr.trim();
custStatedescr = custStatedescr == null ? " " : custStatedescr.trim();
......@@ -740,7 +746,7 @@ public class GenInvoiceSchedule implements Schedule {
addressInSpain.appendChild(getElementValue(doc, parties, "Address", siteAdd1));
addressInSpain.appendChild(getElementValue(doc, parties, "PostCode", sitePin));
addressInSpain.appendChild(getElementValue(doc, parties, "Town", sitecity));
addressInSpain.appendChild(getElementValue(doc, parties, "Province", siteStateCode));
addressInSpain.appendChild(getElementValue(doc, parties, "Province", siteStatedescr));
addressInSpain.appendChild(getElementValue(doc, parties, "CountryCode", "ESP"));
individual.appendChild(addressInSpain);
sellerParty.appendChild(individual);
......@@ -770,7 +776,7 @@ public class GenInvoiceSchedule implements Schedule {
addCustDlv.appendChild(getElementValue(doc, parties, "Address", dlvAdd1));
addCustDlv.appendChild(getElementValue(doc, parties, "PostCode", dlvPin));
addCustDlv.appendChild(getElementValue(doc, parties, "Town", dlvCity));
addCustDlv.appendChild(getElementValue(doc, parties, "Province", custState));
addCustDlv.appendChild(getElementValue(doc, parties, "Province", custStatedescr));
//addCustDlv.appendChild(getElementValue(doc, parties, "CountryCode", dlvCountryCode));
addCustDlv.appendChild(getElementValue(doc, parties, "CountryCode", "ESP"));
admCustDlv.appendChild(addCustDlv);
......@@ -792,7 +798,7 @@ public class GenInvoiceSchedule implements Schedule {
addCustBill.appendChild(getElementValue(doc, parties, "Address", custAdd1));
addCustBill.appendChild(getElementValue(doc, parties, "PostCode", custPin));
addCustBill.appendChild(getElementValue(doc, parties, "Town", custCity));
addCustBill.appendChild(getElementValue(doc, parties, "Province", custState));
addCustBill.appendChild(getElementValue(doc, parties, "Province", custStatedescr));
//addCustBill.appendChild(getElementValue(doc, parties, "CountryCode", custCountrtCode));
addCustBill.appendChild(getElementValue(doc, parties, "CountryCode", "ESP"));
admCustBill.appendChild(addCustBill);
......@@ -812,7 +818,7 @@ public class GenInvoiceSchedule implements Schedule {
addressbuyer.appendChild(getElementValue(doc, parties, "Address", custAdd1));
addressbuyer.appendChild(getElementValue(doc, parties, "PostCode", custPin));
addressbuyer.appendChild(getElementValue(doc, parties, "Town", custCity));
addressbuyer.appendChild(getElementValue(doc, parties, "Province", custState));
addressbuyer.appendChild(getElementValue(doc, parties, "Province", custStatedescr));
// addressbuyer.appendChild(getElementValue(doc, parties, "CountryCode", custCountrtCode));
addressbuyer.appendChild(getElementValue(doc, parties, "CountryCode", "ESP"));
administrativeCentres.appendChild(addressbuyer);
......@@ -830,7 +836,7 @@ public class GenInvoiceSchedule implements Schedule {
addlegalEntity.appendChild(getElementValue(doc, parties, "Address",siteAdd1));
addlegalEntity.appendChild(getElementValue(doc, parties, "PostCode", sitePin));
addlegalEntity.appendChild(getElementValue(doc, parties, "Town", sitecity));
addlegalEntity.appendChild(getElementValue(doc, parties, "Province", siteStateCode));
addlegalEntity.appendChild(getElementValue(doc, parties, "Province", siteStatedescr));
addlegalEntity.appendChild(getElementValue(doc, parties, "CountryCode","ESP"));
legalEntity.appendChild(addlegalEntity);
buyerParty.appendChild(legalEntity);
......@@ -1243,6 +1249,40 @@ public class GenInvoiceSchedule implements Schedule {
return result;
}
public static String getStateDescr(Connection conn,String col1)
{
String result="",sql="";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
sql = "select descr from state where state_code=? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, col1);
rs = pstmt.executeQuery();
if (rs.next())
{
result = rs.getString("descr");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
return result;
}
/*------------added by mahendra dated 24-DEC-2014 for file upload-------------------------*/
......
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