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;