Commit 101d63fe authored by kdabholkar's avatar kdabholkar

commit new changes regarding hsn wise gstr custom data sheet

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187702 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bb49b862
...@@ -6252,11 +6252,12 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi ...@@ -6252,11 +6252,12 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
String tranId = "", ctin = "", posStateCode = "", docNo = "", docDateStr = "",chgDateStr="",errorCode = "", dataErrMsg = "", refInvId = "", String tranId = "", ctin = "", posStateCode = "", docNo = "", docDateStr = "",chgDateStr="",errorCode = "", dataErrMsg = "", refInvId = "",
refInvDtStr = "", preGST = "", portCode = "", gstDateFormat = "", customerName = "", regUreg = "UNREGISTERED", refInvDtStr = "", preGST = "", portCode = "", gstDateFormat = "", customerName = "", regUreg = "UNREGISTERED",
siteGSTStCode = "", isRCM = "", tranTypeStr = "", interIntraExp = "", suppGSTStCode = "", crdrType = "", refId=""; siteGSTStCode = "", isRCM = "", tranTypeStr = "", interIntraExp = "", suppGSTStCode = "", crdrType = "", refId="",hsnNo="",
transType = "",gstCode ="",lineNo ="";
boolean noDataFound = false; boolean noDataFound = false;
double amount =0.0, gstRate = 0.0, taxableAmt = 0.0, cessAmt = 0.0; double amount =0.0, gstRate = 0.0, taxableAmt = 0.0, cessAmt = 0.0;
int outWrdSuppdataRow = 2, inWrdSuppdataRow = 2, crdrPaydataRow = 2, crdrRecdataRow = 2; int outWrdSuppdataRow = 2, inWrdSuppdataRow = 2, crdrPaydataRow = 2, crdrRecdataRow = 2, HsnwiseSalesPurchaseRow = 2;
double igstAmt = 0.0, cgstAmt = 0.0, sgstAmt = 0.0; double igstAmt = 0.0, cgstAmt = 0.0, sgstAmt = 0.0;
HashMap<String,String> stateCodeHMap = new HashMap<String, String>(); HashMap<String,String> stateCodeHMap = new HashMap<String, String>();
...@@ -6509,7 +6510,7 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi ...@@ -6509,7 +6510,7 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
} }
else else
{ {
if(suppGSTStCode.equalsIgnoreCase(posStateCode)) if(siteGSTStCode.equalsIgnoreCase(posStateCode))
{ {
interIntraExp = "IntraState"; interIntraExp = "IntraState";
} }
...@@ -6822,6 +6823,103 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi ...@@ -6822,6 +6823,103 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
closeResources(hdrRs, hdrPstmt); closeResources(hdrRs, hdrPstmt);
/** Added create a extra excel in custom data file for inward and outward types which will show the data of HSN wise with transactions
** By Kaustubh on 12 july 2018 start **/
hdrSql = "select d.GS_CODE,h.ref_id, d.LINE_NO,h.CHG_DATE,h.CUST_NAME,h.TAX_REG_NO,h.GST_CODE,s.descr,d.TAXABLE_AMT,d.GST_RATE, " +
"d.IGST_AMT,d.CGST_AMT ,d.SGST_AMT,d.CESS_AMT,h.AMOUNT," +
" case when h.rec_type ='1' then 'Sales' else 'Purchase' end as trans_type" +
" from gst_data_hdr h, gst_data_det d, state s " +
"where h.TRAN_ID = d.TRAN_ID " +
"and s.gst_code =h.gst_code "+
"and h.PRD_CODE = ? " +
"and h.SITE_CODE = ? and SUBMIT_STATUS = ?";
hdrPstmt = conn.prepareStatement(hdrSql);
hdrPstmt.setString(1, periodCode);
hdrPstmt.setString(2, siteCode);
hdrPstmt.setString(3, "P");
hdrRs = hdrPstmt.executeQuery();
XSSFSheet HsnwiseSalesPurchasedata = retDataWorkbook.getSheet("Hsn_wise_Sales_Purchase_data");
while(hdrRs.next())
{
hsnNo =hdrRs.getString("GS_CODE");
customerName = checkNull(hdrRs.getString("CUST_NAME"));
ctin = checkNull(hdrRs.getString("TAX_REG_NO"));
posStateCode = checkNull(hdrRs.getString("GST_CODE"));
refId = checkNull(hdrRs.getString("REF_ID"));
lineNo = checkNull(hdrRs.getString("LINE_NO"));
chgDate = hdrRs.getDate("CHG_DATE");
gstRate = Double.parseDouble(String.format("%.2f",hdrRs.getDouble("GST_RATE")));
gstCode = checkNull(hdrRs.getString("descr"));
taxableAmt = Double.parseDouble(String.format("%.2f",hdrRs.getDouble("TAXABLE_AMT")));
igstAmt = Double.parseDouble(String.format("%.2f",hdrRs.getDouble("IGST_AMT")));
cgstAmt = Double.parseDouble(String.format("%.2f",hdrRs.getDouble("CGST_AMT")));
sgstAmt = Double.parseDouble(String.format("%.2f",hdrRs.getDouble("SGST_AMT")));
cessAmt = Double.parseDouble(String.format("%.2f",hdrRs.getDouble("CESS_AMT")));
amount = Double.parseDouble(String.format("%.2f",hdrRs.getDouble("AMOUNT")));
transType =hdrRs.getString("trans_type");
double totTaxAmt = igstAmt + cgstAmt + sgstAmt + cessAmt;
totTaxAmt = Double.parseDouble(String.format("%.2f",totTaxAmt));
if(chgDate!=null)
{
chgDateStr = gstDateFormatSdf.format(chgDate);
}
XSSFRow dataRow = HsnwiseSalesPurchasedata.createRow(HsnwiseSalesPurchaseRow++);
dataRow.createCell(0).setCellValue(hsnNo);
dataRow.createCell(1).setCellValue(refId);
dataRow.createCell(2).setCellValue(lineNo);
XSSFCell tranDateCell = dataRow.createCell(3);
if(chgDateStr!=null && chgDateStr.trim().length()>0)
{
tranDateCell.setCellValue(gstDateFormatSdf.parse(chgDateStr));
tranDateCell.setCellStyle(dateCellStyle);
}
dataRow.createCell(4).setCellValue(customerName);
dataRow.createCell(5).setCellValue(transType);
// dataRow.createCell(4).setCellValue(interIntraExp);
//dataRow.createCell(5).setCellValue(isRCM);
// dataRow.createCell(6).setCellValue(tranTypeStr);
dataRow.createCell(6).setCellValue(ctin);
dataRow.createCell(7).setCellValue(posStateCode+"-"+gstCode);
/*dataRow.createCell(9).setCellValue(docNo);
XSSFCell docDateCell = dataRow.createCell(10);
if(docDateStr!=null && docDateStr.trim().length()>0)
{
docDateCell.setCellValue(gstDateFormatSdf.parse(docDateStr));
docDateCell.setCellStyle(dateCellStyle);
}*/
dataRow.createCell(8).setCellValue(amount);
dataRow.createCell(9).setCellValue(taxableAmt);
dataRow.createCell(10).setCellValue(gstRate);
dataRow.createCell(11).setCellValue(igstAmt);
dataRow.createCell(12).setCellValue(cgstAmt);
dataRow.createCell(13).setCellValue(sgstAmt);
dataRow.createCell(14).setCellValue(cessAmt);
dataRow.createCell(15).setCellValue(totTaxAmt);
// dataRow.createCell(19).setCellValue(portCode);
//closeResources(detRs, detPstmt);
}
closeResources(hdrRs, hdrPstmt);
/** Added By Kaustubh on 12 july 2018 end **/
return retDataWorkbook; return retDataWorkbook;
} }
} }
......
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