Commit 749eba1c authored by steurwadkar's avatar steurwadkar

F17ABAS001 source code commit


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106556 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3e851a35
...@@ -3628,42 +3628,146 @@ public class GSTDataSubmitWizPos extends ValidatorEJB implements GSTDataSubmitWi ...@@ -3628,42 +3628,146 @@ public class GSTDataSubmitWizPos extends ValidatorEJB implements GSTDataSubmitWi
List<ITCData> itcInelgDataList = new ArrayList<ITCData>(); List<ITCData> itcInelgDataList = new ArrayList<ITCData>();
List<InwardSuppliesDetails> inwardSuppliesList = new ArrayList<InwardSuppliesDetails>(); List<InwardSuppliesDetails> inwardSuppliesList = new ArrayList<InwardSuppliesDetails>();
OutwardSuppliesDetails outwardSuppliesDetails = null;
OutwardZeroRatedSupplies outwardZeroRatedSupplies = null;
OutwardExempetedSupplies outwardExempetedSupplies = null;
InwardSuppliesUnderRevCharge inwardSuppliesUnderRevCharge = null;
OutwardNonGSTSupplies outwardNonGSTSupplies = null;
SuppliesDetails suppliesDetails = null;
int noOfRecords = 0; int noOfRecords = 0;
ArrayList<String> tranIdList = new ArrayList<String>(); ArrayList<String> tranIdList = new ArrayList<String>();
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try try
{ {
OutwardSuppliesDetails outwardSuppliesDetails = new OutwardSuppliesDetails(); sql = " SELECT SUM(GDD.TAXABLE_AMT) AS TAXABLE_AMT, SUM(GDD.IGST_AMT) AS IGST_AMT, SUM(GDD.CGST_AMT) AS CGST_AMT, SUM(GDD.SGST_AMT) AS SGST_AMT, SUM(GDD.CESS_AMT) AS CESS_AMT"
outwardSuppliesDetails.taxableAmount = 25000; + " FROM GST_DATA_HDR GDH, GST_DATA_DET GDD"
outwardSuppliesDetails.igstAmount = 1200; + " WHERE GDH.TRAN_ID=GDD.TRAN_ID"
outwardSuppliesDetails.cgstAmount = 1000; + " AND GDH.REC_TYPE = ? AND GDH.SITE_CODE = ?"
outwardSuppliesDetails.sgstAmount = 1000; + " AND GDH.PRD_CODE = ? AND GDH.TRAN_TYPE = ? AND GDH.SUBMIT_STATUS = ?";
outwardSuppliesDetails.cessAmount = 200; pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "6");
pstmt.setString(2, siteCode);
pstmt.setString(3, periodCode);
pstmt.setString(4, "01");
pstmt.setString(5, "P");
OutwardZeroRatedSupplies outwardZeroRatedSupplies = new OutwardZeroRatedSupplies(); rs = pstmt.executeQuery();
outwardZeroRatedSupplies.taxableAmount = 12000;
outwardZeroRatedSupplies.igstAmount = 1000;
outwardZeroRatedSupplies.cessAmount = 250;
OutwardExempetedSupplies outwardExempetedSupplies = new OutwardExempetedSupplies(); if(rs.next())
outwardExempetedSupplies.taxableAmount = 60000; {
outwardSuppliesDetails = new OutwardSuppliesDetails();
outwardSuppliesDetails.taxableAmount = rs.getDouble("TAXABLE_AMT");
outwardSuppliesDetails.igstAmount = rs.getDouble("IGST_AMT");
outwardSuppliesDetails.cgstAmount = rs.getDouble("CGST_AMT");
outwardSuppliesDetails.sgstAmount = rs.getDouble("SGST_AMT");
outwardSuppliesDetails.cessAmount = rs.getDouble("CESS_AMT");
}
closeResources(rs,pstmt);
InwardSuppliesUnderRevCharge inwardSuppliesUnderRevCharge = new InwardSuppliesUnderRevCharge(); sql = " SELECT SUM(GDD.TAXABLE_AMT) AS TAXABLE_AMT, SUM(GDD.IGST_AMT) AS IGST_AMT, SUM(GDD.CGST_AMT) AS CGST_AMT, SUM(GDD.SGST_AMT) AS SGST_AMT, SUM(GDD.CESS_AMT) AS CESS_AMT"
inwardSuppliesUnderRevCharge.taxableAmount = 25000; + " FROM GST_DATA_HDR GDH, GST_DATA_DET GDD"
inwardSuppliesUnderRevCharge.igstAmount = 1200; + " WHERE GDH.TRAN_ID=GDD.TRAN_ID"
inwardSuppliesUnderRevCharge.cgstAmount = 1000; + " AND GDH.REC_TYPE = ? AND GDH.SITE_CODE = ?"
inwardSuppliesUnderRevCharge.sgstAmount = 1000; + " AND GDH.PRD_CODE = ? AND GDH.TRAN_TYPE = ? AND GDH.SUBMIT_STATUS = ?";
inwardSuppliesUnderRevCharge.cessAmount = 200; pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "6");
pstmt.setString(2, siteCode);
pstmt.setString(3, periodCode);
pstmt.setString(4, "02");
pstmt.setString(5, "P");
rs = pstmt.executeQuery();
if(rs.next())
{
outwardZeroRatedSupplies = new OutwardZeroRatedSupplies();
outwardZeroRatedSupplies.taxableAmount = rs.getDouble("TAXABLE_AMT");
outwardZeroRatedSupplies.igstAmount = rs.getDouble("IGST_AMT");
outwardZeroRatedSupplies.cessAmount = rs.getDouble("CESS_AMT");
}
closeResources(rs,pstmt);
OutwardNonGSTSupplies outwardNonGSTSupplies = new OutwardNonGSTSupplies(); sql = " SELECT SUM(GDD.TAXABLE_AMT) AS TAXABLE_AMT, SUM(GDD.IGST_AMT) AS IGST_AMT, SUM(GDD.CGST_AMT) AS CGST_AMT, SUM(GDD.SGST_AMT) AS SGST_AMT, SUM(GDD.CESS_AMT) AS CESS_AMT"
outwardNonGSTSupplies.taxableAmount = 35000; + " FROM GST_DATA_HDR GDH, GST_DATA_DET GDD"
+ " WHERE GDH.TRAN_ID=GDD.TRAN_ID"
+ " AND GDH.REC_TYPE = ? AND GDH.SITE_CODE = ?"
+ " AND GDH.PRD_CODE = ? AND GDH.TRAN_TYPE = ? AND GDH.SUBMIT_STATUS = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "6");
pstmt.setString(2, siteCode);
pstmt.setString(3, periodCode);
pstmt.setString(4, "03");
pstmt.setString(5, "P");
SuppliesDetails suppliesDetails = new SuppliesDetails(); rs = pstmt.executeQuery();
if(rs.next())
{
outwardExempetedSupplies = new OutwardExempetedSupplies();
outwardExempetedSupplies.taxableAmount = rs.getDouble("TAXABLE_AMT");
}
closeResources(rs,pstmt);
sql = " SELECT SUM(GDD.TAXABLE_AMT) AS TAXABLE_AMT, SUM(GDD.IGST_AMT) AS IGST_AMT, SUM(GDD.CGST_AMT) AS CGST_AMT, SUM(GDD.SGST_AMT) AS SGST_AMT, SUM(GDD.CESS_AMT) AS CESS_AMT"
+ " FROM GST_DATA_HDR GDH, GST_DATA_DET GDD"
+ " WHERE GDH.TRAN_ID=GDD.TRAN_ID"
+ " AND GDH.REC_TYPE = ? AND GDH.SITE_CODE = ?"
+ " AND GDH.PRD_CODE = ? AND GDH.TRAN_TYPE = ? AND GDH.SUBMIT_STATUS = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "6");
pstmt.setString(2, siteCode);
pstmt.setString(3, periodCode);
pstmt.setString(4, "04");
pstmt.setString(5, "P");
rs = pstmt.executeQuery();
if(rs.next())
{
inwardSuppliesUnderRevCharge = new InwardSuppliesUnderRevCharge();
inwardSuppliesUnderRevCharge.taxableAmount = rs.getDouble("TAXABLE_AMT");
inwardSuppliesUnderRevCharge.igstAmount = rs.getDouble("IGST_AMT");
inwardSuppliesUnderRevCharge.cgstAmount = rs.getDouble("CGST_AMT");
inwardSuppliesUnderRevCharge.sgstAmount = rs.getDouble("SGST_AMT");
inwardSuppliesUnderRevCharge.cessAmount = rs.getDouble("CESS_AMT");
}
closeResources(rs,pstmt);
sql = " SELECT SUM(GDD.TAXABLE_AMT) AS TAXABLE_AMT, SUM(GDD.IGST_AMT) AS IGST_AMT, SUM(GDD.CGST_AMT) AS CGST_AMT, SUM(GDD.SGST_AMT) AS SGST_AMT, SUM(GDD.CESS_AMT) AS CESS_AMT"
+ " FROM GST_DATA_HDR GDH, GST_DATA_DET GDD"
+ " WHERE GDH.TRAN_ID=GDD.TRAN_ID"
+ " AND GDH.REC_TYPE = ? AND GDH.SITE_CODE = ?"
+ " AND GDH.PRD_CODE = ? AND GDH.TRAN_TYPE = ? AND GDH.SUBMIT_STATUS = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "6");
pstmt.setString(2, siteCode);
pstmt.setString(3, periodCode);
pstmt.setString(4, "05");
pstmt.setString(5, "P");
rs = pstmt.executeQuery();
if(rs.next())
{
outwardNonGSTSupplies = new OutwardNonGSTSupplies();
outwardNonGSTSupplies.taxableAmount = rs.getDouble("TAXABLE_AMT");
}
closeResources(rs,pstmt);
if(outwardSuppliesDetails!=null || outwardZeroRatedSupplies!=null || outwardExempetedSupplies!=null || inwardSuppliesUnderRevCharge!=null || outwardNonGSTSupplies!=null)
{
suppliesDetails = new SuppliesDetails();
suppliesDetails.outwardSuppliesDetails = outwardSuppliesDetails; suppliesDetails.outwardSuppliesDetails = outwardSuppliesDetails;
suppliesDetails.outwardZeroRatedSupplies = outwardZeroRatedSupplies; suppliesDetails.outwardZeroRatedSupplies = outwardZeroRatedSupplies;
suppliesDetails.outwardExempetedSupplies = outwardExempetedSupplies; suppliesDetails.outwardExempetedSupplies = outwardExempetedSupplies;
suppliesDetails.inwardSuppliesUnderRevCharge = inwardSuppliesUnderRevCharge; suppliesDetails.inwardSuppliesUnderRevCharge = inwardSuppliesUnderRevCharge;
suppliesDetails.outwardNonGSTSupplies = outwardNonGSTSupplies; suppliesDetails.outwardNonGSTSupplies = outwardNonGSTSupplies;
}
InterStateSuppliesData interStateSuppliesData = new InterStateSuppliesData(); InterStateSuppliesData interStateSuppliesData = new InterStateSuppliesData();
interStateSuppliesData.placeOfSupply = "01"; interStateSuppliesData.placeOfSupply = "01";
...@@ -3769,7 +3873,10 @@ public class GSTDataSubmitWizPos extends ValidatorEJB implements GSTDataSubmitWi ...@@ -3769,7 +3873,10 @@ public class GSTDataSubmitWizPos extends ValidatorEJB implements GSTDataSubmitWi
gstr3b.gstin = gstin; gstr3b.gstin = gstin;
gstr3b.financialPeriod = periodCode; gstr3b.financialPeriod = periodCode;
if(suppliesDetails != null)
{
gstr3b.supplyDetails = suppliesDetails; gstr3b.supplyDetails = suppliesDetails;
}
gstr3b.interStateSupplies = interStateSupplies; gstr3b.interStateSupplies = interStateSupplies;
gstr3b.itcEligibility = itcEligibility; gstr3b.itcEligibility = itcEligibility;
gstr3b.inwardSupplies = inwardSupplies; gstr3b.inwardSupplies = inwardSupplies;
...@@ -6138,5 +6245,55 @@ public class GSTDataSubmitWizPos extends ValidatorEJB implements GSTDataSubmitWi ...@@ -6138,5 +6245,55 @@ public class GSTDataSubmitWizPos extends ValidatorEJB implements GSTDataSubmitWi
} }
return value; return value;
} }
private void closeResources(ResultSet rs, PreparedStatement pstmt) throws SQLException
{
boolean isError = false;
try
{
if(rs!=null)
{
rs.close();
rs=null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
}
catch(SQLException se)
{
isError = true;
System.out.println("GSTDataSubmitWizPos.closeResources()["+se.getMessage()+"]");
se.printStackTrace();
throw new SQLException(se);
}
finally
{
try
{
if(isError)
{
if(rs!=null)
{
rs.close();
rs=null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
}
}
catch(SQLException se)
{
isError = true;
System.out.println("GSTDataSubmitWizPos.closeResources()inside finally["+se.getMessage()+"]");
se.printStackTrace();
throw new SQLException(se);
}
}
}
} }
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