WIP Quick Report Salepad


<report name="WIP Report" AutoLinks="true" autorun="true" bestFitAll="true">

<search name="VendorName" column="VENDNAME" searchOp="like"/>
<search name="Total" column="UNITCOST" searchOp="like"/>
<search name="Begin PO Date" Type="DateTime" column="stadate" searchOp="&gt;=" />
<search name="End PO Date" Type="DateTime" column="enddate"  searchOp="&lt;=" />
<search name="SalesDoc#" column="VNDDOCNM" searchOp="like"/>
<search name="CustomerName" column="Customer" searchOp="like"/>
<search name="PO#" column="Customer_PO_Num" searchOp="like"/>
<search name="DocDate" column="DocDate"  Type="DateTime" searchOp="like"/>

<query addWhere="true">

select
VENDNAME, UNITCOST, stadate, enddate, VNDDOCNM, Customer, Customer_PO_Num, DocDate, Item_Number, PO_Number, PO_Type
from(

select vendinv.VENDNAME,    
rcpt.UNITCOST,     
stadate=CONVERT(datetime,receiptdate, 101), enddate=CONVERT(datetime,receiptdate, 101),   
VNDDOCNM,  
soppop.PO_Number,    
PO_Type=dbo.spfpurchaseordertype(pop.potype),
sd.Customer,    
sd.Customer_PO_Num,    
sd.Sales_Doc_Num,    
pop.DOCDATE,    
sd.Item_Number    
from POP30300 as vendinv (NOLOCK)    
left join POP30310 as rcpt (NOLOCK) on vendinv.POPRCTNM = rcpt.POPRCTNM    
left join POP10100 as pop (NOLOCK) on rcpt.PONUMBER = pop.PONUMBER    
join spvSopToPop as soppop on pop.PONUMBER = soppop.PO_Number and Sales_Doc_Type = 'ORDER' and soppop.PO_Line_Num = rcpt.RCPTLNNM  
left join spvSalesLineItemSearch as sd on soppop.Sales_Doc_Num = sd.Sales_Doc_Num and soppop.Line_Num = sd.Line_Num and sd.Sales_Doc_Type = 'ORDER' 
)as a
/*where*/

</query>

<column name="stadate" Caption="PO Date" Visible="true" BestFit="true" />
<column name="enddate" Visible="false" BestFit="true" />
<column name="PO_Type" Visible="false" BestFit="true" />
</report>

Leave a Reply