From c82ebaa241f7d7e407c7b7a7c59375b21f0394ea Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Fri, 9 Nov 2007 00:07:35 +0000 Subject: [PATCH] [ 1828629 ] Posterita pnly support dd-MMM-yyyy format date http://sourceforge.net/tracker/index.php?func=detail&aid=1828629&group_id=176962&atid=928568 --- .../posterita/businesslogic/POSManager.java | 20 ++++++++++++------- .../businesslogic/POSReportManager.java | 3 ++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/posterita/src/main/org/posterita/businesslogic/POSManager.java b/posterita/src/main/org/posterita/businesslogic/POSManager.java index b40b344bca..f4c66dd52a 100644 --- a/posterita/src/main/org/posterita/businesslogic/POSManager.java +++ b/posterita/src/main/org/posterita/businesslogic/POSManager.java @@ -1059,7 +1059,8 @@ public class POSManager //" where pay.created>=TO_DATE('" +sqlDate+"','YYYY-MM-DD HH24:MI:SS')"+ " where pay.created>="+sqlDate+ " and inv.c_order_id=ord.c_order_id"+ - " and ord.POSID="+posId+ + //" and ord.POSID="+posId+ + " and ord.c_pos_id="+posId+ " and ord.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ " and ord.AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ " and inv.isSotrx='Y'"+ @@ -1112,12 +1113,15 @@ public class POSManager "from C_PAYMENT pay " ; if(toDate==null) { - sql=sql+ "where pay.created>=TO_DATE('" +fromDate+"','YYYY-MM-DD HH24:MI:SS')"; + //sql=sql+ "where pay.created>=TO_DATE('" +fromDate+"','YYYY-MM-DD HH24:MI:SS')"; + sql=sql+ "where pay.created>=" + fromDate; } else { - sql=sql+ " where pay.created between to_date('"+ fromDate+"','DD-MM-YYYY HH24:MI:SS') " + - " and to_date('" + toDate+"','DD-MM-YYYY HH24:MI:SS') " ; + //sql=sql+ " where pay.created between to_date('"+ fromDate+"','DD-MM-YYYY HH24:MI:SS') " + + //" and to_date('" + toDate+"','DD-MM-YYYY HH24:MI:SS') " ; + sql=sql+ " where pay.created between "+ fromDate +" and " + toDate; + //" and to_date('" + toDate+"','DD-MM-YYYY HH24:MI:SS') " ; } @@ -1172,15 +1176,17 @@ public class POSManager " from C_INVOICE inv,C_order ord,c_payment pay " + " where inv.c_order_id=ord.c_order_id"+ " and inv.c_Invoice_id=pay.c_Invoice_id"+ - " and ord.POSID="+posId+ + //" and ord.POSID="+posId+ + " and ord.c_pos_id="+posId+ " and ord.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ " and ord.AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ " and inv.isSotrx='Y'"+ " and ord.orderType in ('"+UDIOrderTypes.POS_ORDER.getOrderType()+"',"+ "'"+UDIOrderTypes.CREDIT_ORDER.getOrderType()+"')"+ " and pay.tenderType='"+paymentRule+"'"+ - " and pay.created between to_date('"+ fromDate+"','DD-MM-YYYY HH24:MI:SS') " + - " and to_date('" + toDate+"','DD-MM-YYYY HH24:MI:SS') " ; + //" and pay.created between to_date('"+ fromDate+"','DD-MM-YYYY HH24:MI:SS') " + + //" and to_date('" + toDate+"','DD-MM-YYYY HH24:MI:SS') " ; + " and pay.created between "+fromDate + " and "+ toDate; PreparedStatement pstmt = DB.prepareStatement(sql,null); diff --git a/posterita/src/main/org/posterita/businesslogic/POSReportManager.java b/posterita/src/main/org/posterita/businesslogic/POSReportManager.java index 569cb37c74..4eb02c8930 100644 --- a/posterita/src/main/org/posterita/businesslogic/POSReportManager.java +++ b/posterita/src/main/org/posterita/businesslogic/POSReportManager.java @@ -2564,7 +2564,8 @@ public class POSReportManager { .append(" and ord.ORDERTYPE = 'POS Order' ") .append(" and ord.AD_CLIENT_ID = ? ") .append(" and ord.AD_ORG_ID = ? ") - .append(" and ord.POSID = ? ") + //.append(" and ord.POSID = ? ") + .append(" and ord.c_pos_id = ? ") .append(" group by p.NAME"); PreparedStatement pstmt = null;