|
@@ -74,7 +74,7 @@ from tinvoiceapply t1
|
|
|
on t2.siteid = t3.siteid and t2.tinvoiceapplyid = t3.tinvoiceapplyid and
|
|
on t2.siteid = t3.siteid and t2.tinvoiceapplyid = t3.tinvoiceapplyid and
|
|
|
t2.tinvoiceapplyordid = t3.tinvoiceapplyordid
|
|
t2.tinvoiceapplyordid = t3.tinvoiceapplyordid
|
|
|
inner join tinvoicebill t4 on t3.siteid = t4.siteid and t3.tinvoiceapplyid = t4.tinvoiceapplyid and
|
|
inner join tinvoicebill t4 on t3.siteid = t4.siteid and t3.tinvoiceapplyid = t4.tinvoiceapplyid and
|
|
|
- t3.tinvoicebillid = t4.tinvoicebillid and t4.status = 2
|
|
|
|
|
|
|
+ t3.tinvoicebillid = t4.tinvoicebillid and (t4.status = 2 or t1.ftype='ÊÖ¹¤')
|
|
|
where t1.fstatus = 'ÉóºË'
|
|
where t1.fstatus = 'ÉóºË'
|
|
|
and t1.siteid =$siteid$
|
|
and t1.siteid =$siteid$
|
|
|
and t2.saorderid=$saorderid$
|
|
and t2.saorderid=$saorderid$
|