| | |
| | | + " and isnull(a.Status,0) = 1 \n" |
| | | + " and isnull(c.Status,0) = 1 \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or a.ShopCcCode = @ShopCcCode ) \n" |
| | | + " and isnull(a.MatGroupStatus,0) = 1 \n"; |
| | | + " and isnull(a.MatGroupStatus,0) = 1 \n" |
| | | + " and isnull(a.ExchangePointsQuantity,0) = 0 \n"; |
| | | if (!this.isShowSubMatGroup()) { |
| | | sql += " and (isnull(@ShoppingMatGroups,'') = '' or a.ShoppingMatGroups like '%' + @ShoppingMatGroups + '%') \n"; |
| | | } else { |
| | |
| | | + " where isnull(a.inActive,0) = 0 \n" |
| | | + " and isnull(a.Status,0) = 1 \n" |
| | | + " and isnull(c.Status,0) = 1 \n" |
| | | + " and isnull(a.ExchangePointsQuantity,0) = 0 \n" |
| | | +" and (" + (isShowAllWhenBlankSearch?"isnull(@Search,'') = '' or ":"") + "\n" |
| | | + " a.MatCode like '%'+@Search+'%' \n" |
| | | + " or a.MatName like '%' + @Search + '%' \n" |
| | |
| | | + " and isnull(a.inActive,0) = 0 \n" |
| | | + " and isnull(a.Status,0) = 1 \n" |
| | | + " and isnull(c.Status,0) = 1 \n" |
| | | + " and isnull(a.ExchangePointsQuantity,0) = 0 \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or a.ShopCcCode in (select list from getinstr( @ShopCcCode))) \n" |
| | | + " and (isnull(@Brand,'') = '' or a.Brand in (select list from getinstr(@brand))) \n" |
| | | + " and isnull(a.MatGroupStatus,0) = 1 \n"; |
| | |
| | | + " and isnull(a.Status,0) = 1 \n" |
| | | + " and isnull(c.Status,0) = 1 \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or a.ShopCcCode in (select list from getinstr( @ShopCcCode))) \n" |
| | | + " and isnull(a.MatGroupStatus,0) = 1 \n"; |
| | | + " and isnull(a.MatGroupStatus,0) = 1 \n" |
| | | + " and isnull(a.ExchangePointsQuantity,0) = 0 \n"; |
| | | //+ " and exists (select 1 from t710104 b join t110501 e on b.MatGroup = e.MatGroup \n" |
| | | //+ " where a.DocCode = b.doccode and isnull(e.Status,0) = 1 \n" |
| | | //+ " and (isnull(@ShopCcCode,'') = '' or e.ShopCcCode = @ShopCcCode) ) \n"; |
| | |
| | | + " where isnull(c.Status,0) = 1 \n" |
| | | + " and c.MatCode = @MatCode \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or c.ShopCcCode = @ShopCcCode ) \n" |
| | | + " and isnull(c.MatGroupStatus,0) = 1 ) \n"; |
| | | + " and isnull(c.MatGroupStatus,0) = 1 ) \n " |
| | | + "and isnull(a.ExchangePointsQuantity,0) = 0 \n"; |
| | | //+ " and exists (select 1 from t710104 h join t110501 e on h.MatGroup = e.MatGroup \n" |
| | | //+ " where c.DocCode = h.doccode and isnull(e.Status,0) = 1 \n" |
| | | //+ " and (isnull(@ShopCcCode,'') = '' or e.ShopCcCode = @ShopCcCode ) ) ) \n" ; |
| | |
| | | + " and ISNULL(d.Status,0) = 1 \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or b.ShopCcCode = @ShopCcCode ) \n" |
| | | + " and isnull(b.MatGroupStatus,0) = 1 \n" |
| | | + " and isnull(b.ExchangePointsQuantity,0) = 0 \n" |
| | | //+ " and exists (select 1 from t710104 h join t110501 e on h.MatGroup = e.MatGroup \n" |
| | | //+ " where b.DocCode = h.doccode and isnull(e.Status,0) = 1 \n" |
| | | //+ " and (isnull(@ShopCcCode,'') = '' or e.ShopCcCode = @ShopCcCode ) ) \n" |
| | |
| | | + " and c.BrandId = @BrandId \n" |
| | | + " and isnull(c.Status,0) = 1 \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or a.ShopCcCode = @ShopCcCode ) \n" |
| | | + " and isnull(a.MatGroupStatus,0) = 1 \n"; |
| | | + " and isnull(a.MatGroupStatus,0) = 1 \n" |
| | | + " and isnull(a.ExchangePointsQuantity,0) = 0 \n"; |
| | | //+ " and exists (select 1 from t710104 h join t110501 e on h.MatGroup = e.MatGroup \n" |
| | | //+ " where a.DocCode = h.doccode and isnull(e.Status,0) = 1 \n" |
| | | //+ " and (isnull(@ShopCcCode,'') = '' or e.ShopCcCode = @ShopCcCode ) ) \n" ; |
| | |
| | | + " where isnull(a.inActive,0) = 0 \n" |
| | | + " and isnull(a.Status,0) = 1 \n" |
| | | + " and isnull(c.Status,0) = 1 \n" |
| | | + " and isnull(a.ExchangePointsQuantity,0) = 0 \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or a.ShopCcCode = @ShopCcCode ) \n" |
| | | + " and exists(select 1 from t710109 e where a.DocCode = e.DocCode \n" |
| | | + " and convert(datetime,convert(varchar(10),getdate(),120)) between e.DateStart and e.DateEnd ) \n" |
| | |
| | | + " where isnull(a.inActive,0) = 0 \n" |
| | | + " and isnull(a.Status,0) = 1 \n" |
| | | + " and isnull(c.Status,0) = 1 \n" |
| | | + " and isnull(a.ExchangePointsQuantity,0) = 0 \n" |
| | | + " and (isnull(@GroupDocCode,'') = '' or f.DocCode = @GroupDocCode ) \n" |
| | | + " and isnull(f.Status,0) = 1 \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or a.ShopCcCode = @ShopCcCode ) \n" |
| | |
| | | + " where isnull(a.inActive,0) = 0 \n" |
| | | + " and isnull(a.Status,0) = 1 \n" |
| | | + " and isnull(c.Status,0) = 1 \n" |
| | | + " and isnull(a.ExchangePointsQuantity,0) = 0 \n" |
| | | + " and (isnull(@GroupDocCode,'') = '' or f.DocCode = @GroupDocCode ) \n" |
| | | + " and isnull(f.Status,0) = 1 \n" |
| | | + " and (isnull(@ShopCcCode,'') = '' or a.ShopCcCode = @ShopCcCode ) \n" |