<%@ LANGUAGE = "VBScript" %> <% busca=request.QueryString("busca") doc=request.QueryString("doc") origen=request.QueryString("origen") Date_ini=Request.Form("Date_ini") Date_end=Request.Form("Date_end") lvende=Request.Form("cvende") criterio22=Request.Form("criterio22") if criterio22="" then xcriterio22=" Todos " end if if Date_ini="" or Date_ini=null then Date_ini=date()-(day(date()))+1 Date_end=date() end if dia1=right("00"&day(Date_ini),2) mes1=right("00"&month(Date_ini),2) anno1=right("00"&year(Date_ini),4) 'Date_inii=cdate(dia1+"/"+mes1+"/"+anno1) cfechai=cdbl(anno1+mes1+dia1) dia2=right("00"&day(Date_end),2) mes2=right("00"&month(Date_end),2) anno2=right("00"&year(Date_end),4) 'cfechaf=cdate((dia2+"/"+mes2+"/"+anno2)) cfechaf=cdbl(anno2+mes2+dia2) '''''''''''''''''''''''''''''''''''''' strday = Right("00" & Day(Date_ini), 2) strmonth = Right("00" & Month(Date_ini), 2) stryear = Right("00" & Year(Date_ini), 4) strday2 = Right("00" & Day(Date_end), 2) strmonth2 = Right("00" & Month(Date_end), 2) stryear2 = Right("00" & Year(Date_end), 4) fechainicial = CDbl(stryear + strmonth + strday) fechafinal = CDbl(stryear2 + strmonth2 + strday2) %> Report Inventory Cost datepicker demo <% if busca="" or busca=null then origen=doc end if %>
Report Rolls Cost (Plant 1)
         
Period:
         
<% d="/" ctipomov1="FACTURA" ctipomov2="REMISION" sla="/" cero1="00" cero2="0000" '''''''''''calcula strday = Right("00" & Day(Date_ini), 2) strmonth = Right("00" & Month(Date_ini), 2) stryear = Right("00" & Year(Date_ini), 4) strday2 = Right("00" & Day(Date_end), 2) strmonth2 = Right("00" & Month(Date_end), 2) stryear2 = Right("00" & Year(Date_end), 4) fechainicial = CStr(stryear + strmonth + strday) fechafinal = CStr(stryear2 + strmonth2 + strday2) 'response.write(fechainicial)&" FI " ' response.write(fechafinal)&" Ff " layer=weekday(date()-1) If layer = 1 Then lfecinicial=date()-3 lfecfinal=date()-3 else if layer=7 then lfecinicial=date()-2 lfecfinal=date()-2 else lfecinicial=date()-1 lfecfinal=date()-1 end if end if strdaybook = Right("00" & Day(lfecinicial), 2) strmonthbook = Right("00" & Month(lfecinicial), 2) stryearbook = Right("00" & Year(lfecinicial), 4) lfechabook1 = CStr(stryearbook + strmonthbook + strdaybook) lfechabook2 = CStr(stryearbook + strmonthbook + strdaybook) ltxtdate1= date() ltxtdate2= date() ltxtdate3= date()+1 Dim Rscosto2 set Rscosto2=cnn2.execute("SELECT Products.ID AS Prod_id, Products.Location, Suppliers.Company, Customers.Company, Products.[Product Name], Products.Category, Products.[Rev No], Products.Inch, Products.Type, Products.Caliber,Products.MedidaSalida, Products.Length, Products.Departament, Products.[Standard Cost], Products.[List Price], Iif([products].[departament]='ROLL',[RollosCompletosParciales].[Completos],[SheetsCompletosParciales].[Completos]) AS Complete, Iif([products].[departament]='ROLL',[RollosCompletosParciales].[Parciales],[SheetsCompletosParciales].[Parciales]) AS [Partial], (iif (isnull([Quantity_In]),0,[Quantity_In])-iif(isnull([Quantity_Sold]),0,[Quantity_Sold])+iif(isnull([Quantity_Retu]),0,[Quantity_Retu])) AS Qty_open, iif(isnull([Quantity In]),0,[Quantity In]) AS QtyIn, iif(isnull([Quantity Return]),0,[Quantity Return]) AS QtyRet, iif(isnull([Quantity Sold]),0,[Quantity Sold]) AS QtyOut, QSheetsCost.SumOfKPallet, Products.[Reorder Level], Products.Discontinued, QSheetsCost.limporte, QRollsCost.limporte, Iif([Departament]='SHEETS',[QSheetsCost.limporte],[QRollsCost.limporte]) AS Simporte, Iif([Departament]='SHEETS',[SumOfKPallet],Iif([Departament]='ROLL',iif(isnull([complete]),0,[complete])+iif(isnull([partial]),0,[partial]),(iif(isnull([Qty_open]),0,[Qty_open])+iif(isnull([QtyIn]),0,[QtyIn])-iif(isnull([QtyOut]),0,[QtyOut])+iif(isnull([QtyRet]),0,[QtyRet])))) AS Balance, iIf([Departament]='SHEETS' Or [Departament]='ROLL',[Simporte],iif(isnull([Balance]),0,[Balance])*iif(isnull([Standard Cost]),0,[Standard Cost])) AS COST "& _ "FROM (((((((((((Products LEFT JOIN Customers ON Products.Customer_cd=Customers.ID) LEFT JOIN Suppliers ON Products.[Supplier Id]=Suppliers.ID) LEFT JOIN RollosCompletosParciales ON Products.ID=RollosCompletosParciales.ProductID) LEFT JOIN SheetsCompletosParciales ON Products.ID=SheetsCompletosParciales.ProductID) LEFT JOIN QSheetsCost ON Products.ID=QSheetsCost.ProductID) LEFT JOIN QRollsCost ON Products.ID=QRollsCost.ProductID) LEFT JOIN InventoryPurchased_openCost ON Products.ID=InventoryPurchased_openCost.[Product ID]) LEFT JOIN InventorySold_openCost ON Products.ID=InventorySold_openCost.[Product ID]) LEFT JOIN InventoryReturn_openCost ON Products.ID=InventoryReturn_openCost.[Product ID]) LEFT JOIN InventoryPurchasedCost ON Products.ID=InventoryPurchasedCost.[Product ID]) LEFT JOIN InventorySoldCost ON Products.ID=InventorySoldCost.[Product ID]) LEFT JOIN InventoryReturnedCost ON Products.ID=InventoryReturnedCost.[Product ID] WHERE (((Products.Discontinued)=0)) ORDER BY Products.[Category],Products.[Product Name]") %>

Materials Cost <% If Rscosto2.EOF And Rscosto2.BOF Then ExisteUsuario = False Msg = "No records exist for this date." Style = vbDefaultButton2 Title = "Msg from System" Help = "" ctxt = 1000 'Response = MsgBox(Msg, Style, Title, Help, ctxt) Else Rscosto2.MoveFirst Do While Not Rscosto2.EOF if Rscosto2("Departament")="SHEETS" then lstdcost=Rscosto2("List Price") else lstdcost=Rscosto2("Standard Cost") end if if not isnumeric(Rscosto2("Cost")) then lcosto=0 else lcosto=Rscosto2("Cost") end if %> <% lctototal=lctototal+lcosto Rscosto2.MoveNext Loop End If Rscosto2.Close Set Rscosto2 = Nothing %>
  Location  Product Name Category         U/M  Complete Partial Balance Std Cost Cost
  <%=Rscosto2("Location")%>  <%=Rscosto2("Product Name")%>  <%=Rscosto2("Category")%>          <%=Rscosto2("MedidaSalida")%>  <%=Rscosto2("Complete")%>  <%=Rscosto2("Partial")%>  <%=Rscosto2("Balance")%>  <%=lstdcost%>  <%=formatnumber(lcosto,2)%> 
  <%=formatnumber(lctototal,2)%>