Przeglądaj źródła

开票订单行选择查询调整

沈静伟 4 lat temu
rodzic
commit
1cbdf816fb

+ 3 - 3
src/rest/openapi/restcontroller/wechatapp/tinvoiceapply/SQL/开票订单行选择查询.sql

@@ -1,9 +1,9 @@
 select *,t2.freceivedamount,tp.fprojectname,sdate.closedate1 from saorderdetail t1
 inner join saorder_receivedview t2 on t1.siteid=t2.siteid and t1.saorderdetailid=t2.saorderdetailid and isnull(t2.freceivedamount,0)>isnull(t1.finvoiceamount,0)
-inner join saorder sa on t1.fparentid = sa.saorderid
-left join tproject tp on sa.fprojectnum = tp.fprojectnum
+inner join saorder sa on t1.fparentid = sa.saorderid and sa.fpayagentnum=$fagentnum$ and sa.fstatus in('ÉóºË','¹Ø±Õ')
+left join tproject tp on sa.fprojectnum = tp.fprojectnum and sa.siteid=tp.siteid
 left join sainvoice_closedate sdate on sdate.fsourceid = t1.saorderdetailid
-where t1.siteid=$siteid$ and sa.fpayagentnum=$fagentnum$ and sa.fstatus in('ÉóºË','¹Ø±Õ')
+where t1.siteid=$siteid$
 and not exists(
     select *from tinvoiceapplyorder where siteid=$siteid$ and tinvoiceapplyid=$tinvoiceapplyid$ and saorderdetailid=t1.saorderdetailid
 ) and $where$

+ 1 - 1
src/rest/openapi/restcontroller/wechatapp/tinvoiceapply/Tinvoiceapply_saler.java

@@ -270,7 +270,7 @@ public class Tinvoiceapply_saler extends Controller {
         if (!"".equals(fbegdate)) {
             where = where + " and sdate.closedate1>='" + fbegdate + "'";
         }
-        if ( !"".equals(fenddate)) {
+        if (!"".equals(fenddate)) {
             where = where + " and sdate.closedate1<='" + fenddate + "'";
         }
         if (!"".equals(fprojectname)) {