Преглед изворни кода

前端开票申请选择订单行时,后端直接算好可开票金额

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

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

@@ -1,4 +1,4 @@
-select *,t2.freceivedamount,tp.fprojectname,sdate.closedate1 from saorderdetail t1
+select *,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

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

@@ -1,4 +1,4 @@
-select *,t2.freceivedamount,tp.fprojectname,sdate.closedate1 from saorderdetail t1
+select *,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('ÉóºË','¹Ø±Õ')