|
@@ -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_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('ÉóºË','¹Ø±Õ')
|
|
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 tproject tp on sa.fprojectnum = tp.fprojectnum and sa.siteid=tp.siteid
|