沈静伟 пре 4 година
родитељ
комит
20bf1560be

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

@@ -1,4 +1,6 @@
-select *,t2.freceivedamount,tp.fprojectname,sdate.closedate1,(isnull(t2.freceivedamount,0)-isnull(t1.finvoiceamount,0)) as fcaninvoiceamount from saorderdetail t1
+select
+t1.fsonum,t1.saorderdetailid,sa.saorderid,t1.frownum,t1.fitemno,t1.fitemname,t1.fmodel,t1.fspec,t1.fwriteoffamount
+,t2.freceivedamount,tp.fprojectname,sdate.closedate1,(isnull(t2.freceivedamount,0)-isnull(t1.finvoiceamount,0)) as fcaninvoiceamount 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 and sa.fpayagentnum=$fagentnum$ and sa.fstatus in('ÉóºË','¹Ø±Õ')
 left join tproject tp on sa.fprojectnum = tp.fprojectnum and sa.siteid=tp.siteid

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

@@ -1,4 +1,6 @@
-select *,t2.freceivedamount,tp.fprojectname,sdate.closedate1,(isnull(t1.frateamount,0)-isnull(t1.finvoiceamount,0)) as fcaninvoiceamount from saorderdetail t1
+select
+t1.fsonum,t1.saorderdetailid,sa.saorderid,t1.frownum,t1.fitemno,t1.fitemname,t1.fmodel,t1.fspec,t1.fwriteoffamount
+,t2.freceivedamount,tp.fprojectname,sdate.closedate1,(isnull(t1.frateamount,0)-isnull(t1.finvoiceamount,0)) as fcaninvoiceamount from saorderdetail t1
 left join saorder_receivedview t2 on t1.siteid=t2.siteid and t1.saorderdetailid=t2.saorderdetailid
 inner join tagents t3 on t1.siteid=t3.siteid and t3.fagentnum=$fagentnum$ and fcheckordermakeinv=1
 inner join saorder sa on t1.fparentid = sa.saorderid and sa.fpayagentnum=$fagentnum$ and sa.fstatus in('ÉóºË','¹Ø±Õ')