Просмотр исходного кода

库存明细增加备注及订单、发货单、收入凭证和支出凭证列表增加根据经销商和备注查询

hu 3 лет назад
Родитель
Сommit
5e464b2a8b

+ 6 - 0
src/custom/restcontroller/sale/cashbill/cashbill.java

@@ -441,6 +441,9 @@ public class cashbill extends Controller {
             if (whereObject.containsKey("isrebate") && !"".equals(whereObject.getString("isrebate"))) {
             if (whereObject.containsKey("isrebate") && !"".equals(whereObject.getString("isrebate"))) {
                 where = where + " and ifnull(t3.isrebate,0) ='" + whereObject.getLongValue("isrebate") + "'";
                 where = where + " and ifnull(t3.isrebate,0) ='" + whereObject.getLongValue("isrebate") + "'";
             }
             }
+            if (whereObject.containsKey("remarks") && !"".equals(whereObject.getString("remarks"))) {
+                where = where+" and t1.remarks like'%"+whereObject.getString("remarks") + "%' ";
+            }
             if (whereObject.containsKey("agentinfo") && !"".equals(whereObject.getString("agentinfo"))) {
             if (whereObject.containsKey("agentinfo") && !"".equals(whereObject.getString("agentinfo"))) {
                 where = where + " and(t2.enterprisename like'%" + whereObject.getString("agentinfo") + "%'"
                 where = where + " and(t2.enterprisename like'%" + whereObject.getString("agentinfo") + "%'"
                         + "  or t4.agentnum like '%" + whereObject.getString("agentinfo") + "%'"
                         + "  or t4.agentnum like '%" + whereObject.getString("agentinfo") + "%'"
@@ -506,6 +509,9 @@ public class cashbill extends Controller {
             if (whereObject.containsKey("isrebate") && !"".equals(whereObject.getString("isrebate"))) {
             if (whereObject.containsKey("isrebate") && !"".equals(whereObject.getString("isrebate"))) {
                 where = where + " and ifnull(t3.isrebate,0) ='" + whereObject.getLongValue("isrebate") + "'";
                 where = where + " and ifnull(t3.isrebate,0) ='" + whereObject.getLongValue("isrebate") + "'";
             }
             }
+            if (whereObject.containsKey("remarks") && !"".equals(whereObject.getString("remarks"))) {
+                where = where+" and t1.remarks like'%"+whereObject.getString("remarks") + "%' ";
+            }
             if (whereObject.containsKey("agentinfo") && !"".equals(whereObject.getString("agentinfo"))) {
             if (whereObject.containsKey("agentinfo") && !"".equals(whereObject.getString("agentinfo"))) {
                 where = where + " and(t2.enterprisename like'%" + whereObject.getString("agentinfo") + "%'"
                 where = where + " and(t2.enterprisename like'%" + whereObject.getString("agentinfo") + "%'"
                         + "  or t4.agentnum like '%" + whereObject.getString("agentinfo") + "%'"
                         + "  or t4.agentnum like '%" + whereObject.getString("agentinfo") + "%'"

+ 12 - 0
src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

@@ -215,6 +215,18 @@ public class dispatch extends Controller {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
                 where.append(" and t1.billdate <='").append(whereObject.getString("enddate")).append("' ");
                 where.append(" and t1.billdate <='").append(whereObject.getString("enddate")).append("' ");
             }
             }
+            if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
+                where.append(" and t1.billdate <='").append(whereObject.getString("enddate")).append("' ");
+            }
+            if (whereObject.containsKey("remarks") && !"".equals(whereObject.getString("remarks"))) {
+                where.append("and t1.remarks like'%").append(whereObject.getString("remarks")).append("%' ");
+            }
+            if (whereObject.containsKey("agentinfo") && !"".equals(whereObject.getString("agentinfo"))) {
+                where.append(" and(");
+                where.append(" t2.enterprisename like'%").append(whereObject.getString("agentinfo")).append("%' ");
+                where.append("or t7.agentnum like'%").append(whereObject.getString("agentinfo")).append("%' ");
+                where.append(")");
+            }
             if (whereObject.containsKey("param") && !"".equals(whereObject.getString("param"))) {
             if (whereObject.containsKey("param") && !"".equals(whereObject.getString("param"))) {
                Rows rowsDispatchid = dbConnect.runSqlQuery("select t1.sa_dispatchid from sa_dispatch_items t1 left join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid " +
                Rows rowsDispatchid = dbConnect.runSqlQuery("select t1.sa_dispatchid from sa_dispatch_items t1 left join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid " +
                        "left join sa_order t3 on t2.sa_orderid=t3.sa_orderid and t2.siteid=t3.siteid left join plm_item t4 on t1.itemid=t4.itemid and t1.siteid=t4.siteid where t1.siteid='"+siteid+"' and (t4.itemname like '%"+whereObject.getString("param")+"%' or t4.itemno like '%"+whereObject.getString("param")+"%' or t3.sonum='"+whereObject.getString("param")+"')");
                        "left join sa_order t3 on t2.sa_orderid=t3.sa_orderid and t2.siteid=t3.siteid left join plm_item t4 on t1.itemid=t4.itemid and t1.siteid=t4.siteid where t1.siteid='"+siteid+"' and (t4.itemname like '%"+whereObject.getString("param")+"%' or t4.itemno like '%"+whereObject.getString("param")+"%' or t3.sonum='"+whereObject.getString("param")+"')");

+ 3 - 1
src/custom/restcontroller/webmanage/sale/invbal/SQL/未发货订单明细列表.sql

@@ -9,7 +9,9 @@ SELECT t3.sonum,
        t4.unitname,
        t4.unitname,
        t1.qty,
        t1.qty,
        t1.undeliqty,
        t1.undeliqty,
-       t1.isfreeze
+       t1.isfreeze,
+       t3.remarks,
+       t1.remarks detailremarks
 FROM sa_orderitems t1
 FROM sa_orderitems t1
          inner join plm_item t2 on t1.siteid = t2.siteid and t1.itemid = t2.itemid
          inner join plm_item t2 on t1.siteid = t2.siteid and t1.itemid = t2.itemid
          inner join sa_order t3 on t1.siteid=t3.siteid and t1.sa_orderid=t3.sa_orderid
          inner join sa_order t3 on t1.siteid=t3.siteid and t1.sa_orderid=t3.sa_orderid

+ 40 - 21
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -544,6 +544,16 @@ public class Order extends Controller {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
                 where.append(" and t1.billdate <='").append(whereObject.getString("enddate")).append("' ");
                 where.append(" and t1.billdate <='").append(whereObject.getString("enddate")).append("' ");
             }
             }
+            if (whereObject.containsKey("remarks") && !"".equals(whereObject.getString("remarks"))) {
+                where.append("and t1.remarks like'%").append(whereObject.getString("remarks")).append("%' ");
+            }
+            if (whereObject.containsKey("agentinfo") && !"".equals(whereObject.getString("agentinfo"))) {
+                where.append(" and(");
+                where.append(" t2.enterprisename like'%").append(whereObject.getString("agentinfo")).append("%' ");
+                where.append("or t7.agentnum like'%").append(whereObject.getString("agentinfo")).append("%' ");
+                where.append(")");
+            }
+
 //            if (whereObject.containsKey("writeoffstatus") && !"".equals(whereObject.getString("writeoffstatus"))) {
 //            if (whereObject.containsKey("writeoffstatus") && !"".equals(whereObject.getString("writeoffstatus"))) {
 //                String writeoffstatus = whereObject.getStringValue("writeoffstatus");
 //                String writeoffstatus = whereObject.getStringValue("writeoffstatus");
 //                if (writeoffstatus.equals("未核销")) {
 //                if (writeoffstatus.equals("未核销")) {
@@ -706,29 +716,38 @@ public class Order extends Controller {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
                 where.append(" and t1.billdate <='").append(whereObject.getString("enddate")).append("' ");
                 where.append(" and t1.billdate <='").append(whereObject.getString("enddate")).append("' ");
             }
             }
-
-            if (whereObject.containsKey("writeoffstatus") && !"".equals(whereObject.getString("writeoffstatus"))) {
-                String writeoffstatus = whereObject.getStringValue("writeoffstatus");
-                if (writeoffstatus.equals("未核销")) {
-                    where.append(" and t7.writeoffamount = 0");
-                } else if (writeoffstatus.equals("已核销")) {
-                    where.append(" and t7.writeoffamount = t7.amount and t7.amount > 0");
-                } else {
-                    where.append(" and t7.writeoffamount < t7.amount and t7.writeoffamount > 0");
-                }
-
+            if (whereObject.containsKey("remarks") && !"".equals(whereObject.getString("remarks"))) {
+                where.append("and t1.remarks like'%").append(whereObject.getString("remarks")).append("%' ");
             }
             }
-            if (whereObject.containsKey("invoicestatus") && !"".equals(whereObject.getString("invoicestatus"))) {
-                String invoicestatus = whereObject.getStringValue("invoicestatus");
-                if (invoicestatus.equals("未开票")) {
-                    where.append(" and t7.invoiceamount = 0");
-                } else if (invoicestatus.equals("已开票")) {
-                    where.append(" and t7.invoiceamount = t7.amount and t7.amount > 0");
-                } else {
-                    where.append(" and t7.invoiceamount < t7.amount and t7.invoiceamount > 0");
-                }
-
+            if (whereObject.containsKey("agentinfo") && !"".equals(whereObject.getString("agentinfo"))) {
+                where.append(" and(");
+                where.append(" t2.enterprisename like'%").append(whereObject.getString("agentinfo")).append("%' ");
+                where.append("or t7.agentnum like'%").append(whereObject.getString("agentinfo")).append("%' ");
+                where.append(")");
             }
             }
+
+//            if (whereObject.containsKey("writeoffstatus") && !"".equals(whereObject.getString("writeoffstatus"))) {
+//                String writeoffstatus = whereObject.getStringValue("writeoffstatus");
+//                if (writeoffstatus.equals("未核销")) {
+//                    where.append(" and t7.writeoffamount = 0");
+//                } else if (writeoffstatus.equals("已核销")) {
+//                    where.append(" and t7.writeoffamount = t7.amount and t7.amount > 0");
+//                } else {
+//                    where.append(" and t7.writeoffamount < t7.amount and t7.writeoffamount > 0");
+//                }
+//
+//            }
+//            if (whereObject.containsKey("invoicestatus") && !"".equals(whereObject.getString("invoicestatus"))) {
+//                String invoicestatus = whereObject.getStringValue("invoicestatus");
+//                if (invoicestatus.equals("未开票")) {
+//                    where.append(" and t7.invoiceamount = 0");
+//                } else if (invoicestatus.equals("已开票")) {
+//                    where.append(" and t7.invoiceamount = t7.amount and t7.amount > 0");
+//                } else {
+//                    where.append(" and t7.invoiceamount < t7.amount and t7.invoiceamount > 0");
+//                }
+//
+//            }
         }
         }
 
 
         ArrayList<Long> sys_enterpriseids = Hr.getAgents(this, hrid);
         ArrayList<Long> sys_enterpriseids = Hr.getAgents(this, hrid);