|
@@ -1,4 +1,4 @@
|
|
|
-select isnull(SUM(famount6),0) famount6 from (select t1.fagentnum,t1.fsaler,(t1.famount-t2.famount) famount6 from (
|
|
|
|
|
|
|
+select isnull(SUM(famount6),0) famount from (select t1.fagentnum,t1.fsaler,(t1.famount-t2.famount) famount6 from (
|
|
|
select t1.fagentnum,t1.fsaler,sum(t4.famount) famount from saorder t1
|
|
select t1.fagentnum,t1.fsaler,sum(t4.famount) famount from saorder t1
|
|
|
inner join saorderdetail t2 on t1.siteid=t2.siteid and t1.saorderid=t2.fparentid
|
|
inner join saorderdetail t2 on t1.siteid=t2.siteid and t1.saorderid=t2.fparentid
|
|
|
inner join sainvoicedetail t4 on t4.fsourceid=t2.saorderdetailid and t4.siteid=t2.siteid
|
|
inner join sainvoicedetail t4 on t4.fsourceid=t2.saorderdetailid and t4.siteid=t2.siteid
|