Parcourir la source

出入库单查询新增字段

hu il y a 2 mois
Parent
commit
9179fd3a56

+ 7 - 1
src/custom/restcontroller/webmanage/sale/stockbill/SQL/出入库单详情.sql

@@ -8,11 +8,17 @@ SELECT t1.*,
        t4.address recaddress,
        t5.discountamount,
        t6.depno,
-       t6.depname
+       t6.depname,
+       t7.suppno,
+       t7.suppname,
+       t7.suppshortname,
+       t8.stockname
 FROM st_stockbill t1
          LEFT JOIN sys_enterprise t2 ON t1.sys_enterpriseid = t2.sys_enterpriseid AND t1.siteid = t2.siteid
          LEFT JOIN sa_agents t3 ON t1.sys_enterpriseid = t3.sys_enterpriseid AND t1.siteid = t3.siteid
          left join sys_enterprise_contacts t4 on t1.rec_contactsid=t4.contactsid and t1.siteid = t4.siteid
          left join sa_accountbalance t5 on t5.sys_enterpriseid=t1.sys_enterpriseid and t1.siteid = t5.siteid and t5.sa_accountclassid =(select sa_accountclassid from sa_accountclass where siteid=$siteid$ and accountname='现金账户')
          left join sys_department t6 on t1.departmentid=t6.departmentid and t1.siteid = t6.siteid
+         left join sa_supplier t7 on t1.sa_supplierid=t7.sa_supplierid and t1.siteid = t7.siteid
+         left join st_stock t8 on t1.stockid=t8.stockid and t1.siteid = t8.siteid
            where t1.siteid=$siteid$ and t1.st_stockbillid=$st_stockbillid$

+ 2 - 0
src/custom/restcontroller/webmanage/sale/stockbill/stockbill.java

@@ -282,6 +282,8 @@ public class stockbill extends Controller {
                 "depno","depname");
         querySQL.addJoinTable(JOINTYPE.left, "sa_supplier", "t7", "t1.sa_supplierid=t7.sa_supplierid and t1.siteid = t7.siteid",
                 "suppno","suppname","suppshortname");
+        querySQL.addJoinTable(JOINTYPE.left, "st_stock", "t8", "t1.stockid=t8.stockid and t1.siteid = t8.siteid",
+                "stockname");
         querySQL.addQueryFields("recname", "t4.name");
         querySQL.addQueryFields("recphonenumber", "t4.phonenumber");
         querySQL.addQueryFields("recaddress", "t4.address");