Commit 8362546b authored by kdabholkar's avatar kdabholkar

commited GSTR 2 purchase data Query changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106568 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c40fb1bc
...@@ -7547,8 +7547,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7547,8 +7547,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql = hdrSql +" and ti.tax_env not in ("+taxEnvAllStrOfPurchase+") "; hdrSql = hdrSql +" and ti.tax_env not in ("+taxEnvAllStrOfPurchase+") ";
} }
hdrSql = hdrSql +" ) = 0 " hdrSql = hdrSql +" ) = 0 "
+" and i.tran_date between ? and ? "; +" and i.tran_date between ? and ? "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) /*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) commented on 10 aug
{ {
hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' "; hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' ";
} }
...@@ -7556,7 +7556,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7556,7 +7556,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' "; hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
} }
hdrSql = hdrSql hdrSql = hdrSql */
+" and (select count(1) from gst_data_hdr where ref_ser = 'VOUCH' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'VOUCH' and ref_id = i.tran_id ) = 0 ";
/** /**
...@@ -7576,7 +7576,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7576,7 +7576,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" 0 as LINE_NO, " // +" 0 as LINE_NO, "
+" 'A' as STATUS, " +" 'A' as STATUS, "
+" 0 as SR_NO__OLD, " +" 0 as SR_NO__OLD, "
+" 'G' as LINE_TYPE,"; //+" 'G' as LINE_TYPE,";
+" case when it.item_code is null then 'S' else 'G' end as LINE_TYPE , ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -7709,8 +7710,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7709,8 +7710,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql = hdrSql +" and ti.tax_env not in ("+taxEnvAllStr+") "; hdrSql = hdrSql +" and ti.tax_env not in ("+taxEnvAllStr+") ";
} }
hdrSql = hdrSql +" ) = 0 " hdrSql = hdrSql +" ) = 0 "
+" and i.tran_date between ? and ? "; +" and i.tran_date between ? and ? "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) /*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' "; hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' ";
} }
...@@ -7718,7 +7719,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7718,7 +7719,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' "; hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
} }
hdrSql = hdrSql hdrSql = hdrSql */
+" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";
/** /**
...@@ -7739,6 +7740,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7739,6 +7740,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
//dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code) AS GS_CODE,"
dtlSql = dtlSql +"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE," dtlSql = dtlSql +"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, " +" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
...@@ -7750,6 +7752,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7750,6 +7752,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
else else
{ {
//dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,) AS GS_CODE,"
dtlSql = dtlSql dtlSql = dtlSql
+ "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE," + "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
...@@ -10093,6 +10096,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10093,6 +10096,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" null as LR_DATE," // +" null as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
+" ' ' as REF_ID__INV,"
// +" (select tran_date from voucher v where v.tran_id = voucher_o) as REF_ID__INV, " // +" (select tran_date from voucher v where v.tran_id = voucher_o) as REF_ID__INV, "
// +"case when inv.gp_date is null then inv.tran_date else inv.gp_date end as REF_DATE__INV, " // +"case when inv.gp_date is null then inv.tran_date else inv.gp_date end as REF_DATE__INV, "
+" 'N' as PROV_ASSMNT, " +" 'N' as PROV_ASSMNT, "
...@@ -10239,6 +10243,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10239,6 +10243,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" null as LR_DATE," // +" null as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
+ " '' as REF_ID__INV, "
// +" (select tran_date from voucher v where v.tran_id = voucher_o) as REF_ID__INV, " // +" (select tran_date from voucher v where v.tran_id = voucher_o) as REF_ID__INV, "
// +"case when inv.gp_date is null then inv.tran_date else inv.gp_date end as REF_DATE__INV, " // +"case when inv.gp_date is null then inv.tran_date else inv.gp_date end as REF_DATE__INV, "
+" 'N' as PROV_ASSMNT, " +" 'N' as PROV_ASSMNT, "
...@@ -10358,7 +10363,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10358,7 +10363,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/*** 6C(2) Header DRNPAY Debit Note (Register User) *****/ /*** 6C(2) Header DRNPAY Debit Note (Register User) *****/
{ {
hdrSql = " select '' as TRAN_ID, " hdrSql = " select '' as TRAN_ID, "
...@@ -10383,6 +10387,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10383,6 +10387,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" null as LR_DATE," // +" null as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
+" ' ' as REF_ID__INV, "
// +" (select tran_date from voucher v where v.tran_id = voucher_o) as REF_ID__INV, " // +" (select tran_date from voucher v where v.tran_id = voucher_o) as REF_ID__INV, "
// +"case when inv.gp_date is null then inv.tran_date else inv.gp_date end as REF_DATE__INV, " // +"case when inv.gp_date is null then inv.tran_date else inv.gp_date end as REF_DATE__INV, "
+" 'N' as PROV_ASSMNT, " +" 'N' as PROV_ASSMNT, "
...@@ -10524,6 +10530,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10524,6 +10530,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" null as LR_DATE," // +" null as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
+" ' ' as REF_ID__INV, "
// +" (select tran_date from voucher v where v.tran_id = voucher_o) as REF_ID__INV, " // +" (select tran_date from voucher v where v.tran_id = voucher_o) as REF_ID__INV, "
// +"case when inv.gp_date is null then inv.tran_date else inv.gp_date end as REF_DATE__INV, " // +"case when inv.gp_date is null then inv.tran_date else inv.gp_date end as REF_DATE__INV, "
+" 'N' as PROV_ASSMNT, " +" 'N' as PROV_ASSMNT, "
...@@ -13170,7 +13177,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -13170,7 +13177,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
currDate = Timestamp.valueOf(genericUtility.getValidDateString(currDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); currDate = Timestamp.valueOf(genericUtility.getValidDateString(currDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("cuuent Date"+currDate); System.out.println("cuuent Datedddddd"+currDate);
int updCnt = 0; int updCnt = 0;
int detCnts = 0,hdrCnts = 0,lineNo = 0; int detCnts = 0,hdrCnts = 0,lineNo = 0;
......
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