- defaultCondition: "sl_vendid = "+pb_vendid+" and sl_currency ='"+pb_currency+"' AND sl_custid = 0 AND ( sl_kind IN ( '采购验收单','采购验退单' ) OR ( sl_kind = '期初余额' AND sl_ym = (select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) ) "+
- ") and sl_namount<>0 "
+ defaultCondition: "sl_vendid = "+pb_vendid+" and sl_currency ='"+pb_currency+"' AND sl_custid = 0 AND sl_kind IN ( '采购验收单','采购验退单', '期初余额' ) and ifnull(sl_preamount,0)=0 and sl_namount<>0 "
- defaultCondition: "sl_custid = "+rb_custid+" and sl_currency ='"+rb_currency+"' AND sl_custid <> 0 AND ( sl_kind IN ( '出货单', '销售退货单' ) OR ( sl_kind = '期初余额' AND sl_ym = (select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) ) "+
- ") and sl_namount<>0 "
+ defaultCondition: "sl_custid = "+rb_custid+" and sl_currency ='"+rb_currency+"' AND sl_custid <> 0 AND sl_kind IN ( '出货单', '销售退货单', '期初余额' ) and ifnull(sl_preamount,0)=0 and sl_namount<>0 "