/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/mm/missing.aspx
279 строк
13 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Missing.aspx.vb" Inherits="r" %> <%@ Register Src="~/UserControls/editableGridNew.ascx" TagPrefix="uc1" TagName="editableGridNew" %> <%@ Register Src="~/UserControls/alerter.ascx" TagPrefix="uc1" TagName="alerter" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Missing Surplus MM</title> <link href="../Styles/page.css" rel="stylesheet" /> </head> <body> <form id="form1" runat="server"> <%--<div class="center"> <asp:ImageButton ID="ibRefresh" runat="server" ImageUrl="~/Images/Refresh.png" class="vcenter" /> <asp:ImageButton ID="ibExcelDownload" runat="server" Height="27" Width="27" ImageUrl="~/Images/Microsoft%20Office%202003%20Excel.png" CssClass="vcenter" /> </div><br/>--%> <table> <tr> <td> <asp:Chart ID="Chart1" runat="server" Width="800px" Height="600px"> <Titles> <asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" Text="Missing cases pc (unsolved / solved) this and previous year" ForeColor="26, 59, 105"></asp:Title> </Titles> <Series runat="server"> <asp:Series Name="Closed_prev" Label="#VAL" Font="Microsoft Sans Serif, 18pt" ChartType="StackedColumn" Color="#00ccff" runat="server" LegendText="Solved in previous year"> </asp:Series> <asp:Series Name="InProgress_prev" Label="#VAL" Font="Microsoft Sans Serif, 18pt" ChartType="StackedColumn" Color="#669999" runat="server" LegendText="Unsolved in previous year"> </asp:Series> <asp:Series Name="Closed_current" Label="#VAL" Font="Microsoft Sans Serif, 18pt" ChartType="StackedColumn" Color="Purple" runat="server" LegendText="Solved in this year"> </asp:Series> <asp:Series Name="InProgress_current" Label="#VAL" Font="Microsoft Sans Serif, 18pt" ChartType="StackedColumn" Color="Yellow" runat="server" LegendText="Unsolved in this year"> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="True" Area3DStyle-Inclination="10" Area3DStyle-Rotation="5" AlignmentOrientation="Horizontal" Area3DStyle-IsClustered="True" BackColor="White"> <AxisX IsLabelAutoFit="False" Interval="1"> </AxisX> </asp:ChartArea> </ChartAreas> <Legends> <asp:Legend Name="Legend1" Docking="Bottom" Alignment="Center" AutoFitMinFontSize="10" Font="Microsoft Sans Serif; 10pt"> </asp:Legend> </Legends> </asp:Chart> </td> <td> <asp:Chart ID="Chart2" runat="server" Width="800px" Height="600px" DataSourceID ="Amount"> <Titles> <asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" Text="Missing Amount (USD) by week" ForeColor="26, 59, 105"></asp:Title> </Titles> <Series runat="server"> <asp:Series Name="Amount" Label="#VAL$" XValueMember ="Week" YValueMembers="Value blocked stock" Font="Microsoft Sans Serif, 18pt" ChartType="Column" Color="#00ccff" runat="server" LegendText="Missing Amount (USD)"> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="True" Area3DStyle-Inclination="10" Area3DStyle-Rotation="5" AlignmentOrientation="Horizontal" Area3DStyle-IsClustered="True" BackColor="White"> <AxisX IsLabelAutoFit="False" Interval="1"> </AxisX> </asp:ChartArea> </ChartAreas> <Legends> <asp:Legend Name="Legend1" Docking="Bottom" Alignment="Center" AutoFitMinFontSize="10" Font="Microsoft Sans Serif; 10pt"> </asp:Legend> </Legends> </asp:Chart> </td> </tr> <tr> <td style="vertical-align: top"> <asp:GridView ID="report" runat="server" CellPadding="4" ForeColor="#333333" Style="margin: 0 auto;" AutoGenerateColumns="True" HorizontalAlign="Center"> <AlternatingRowStyle BackColor="White" /> <EditRowStyle BackColor="#2461BF" /> <EmptyDataRowStyle BackColor="Red" /> <FooterStyle BackColor="#229EE5" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#229EE5" Font-Bold="True" ForeColor="White" /> <PagerSettings Mode="NumericFirstLast" PageButtonCount="5" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="#EFF3FB" HorizontalAlign="Center" VerticalAlign="Middle" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <SortedAscendingCellStyle BackColor="#F5F7FB" /> <SortedAscendingHeaderStyle BackColor="#6D95E1" /> <SortedDescendingCellStyle BackColor="#E9EBEF" /> <SortedDescendingHeaderStyle BackColor="#4870BE" /> <%-- <Columns> <asp:BoundField HeaderText="Month" DataField="Month" /> <asp:BoundField HeaderText="Closed" DataField="Closed" /> <asp:BoundField HeaderText="In porgress" DataField="In progress" /> </Columns>--%> </asp:GridView> </td> <td style="vertical-align: top"> <asp:GridView ID="Details" runat="server" CellPadding="4" ForeColor="#333333" Style="margin: 0 auto;" AutoGenerateColumns="True" HorizontalAlign="Center"> <AlternatingRowStyle BackColor="White" /> <EditRowStyle BackColor="#2461BF" /> <EmptyDataRowStyle BackColor="Red" /> <FooterStyle BackColor="#229EE5" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#229EE5" Font-Bold="True" ForeColor="White" /> <PagerSettings Mode="NumericFirstLast" PageButtonCount="5" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="#EFF3FB" HorizontalAlign="Center" VerticalAlign="Middle" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <SortedAscendingCellStyle BackColor="#F5F7FB" /> <SortedAscendingHeaderStyle BackColor="#6D95E1" /> <SortedDescendingCellStyle BackColor="#E9EBEF" /> <SortedDescendingHeaderStyle BackColor="#4870BE" /> <%-- <Columns> <asp:BoundField HeaderText="Material" DataField="Material" /> <asp:BoundField HeaderText="Plant" DataField="Plant" /> <asp:BoundField HeaderText="Storage Location" DataField="St_loc" /> <asp:BoundField HeaderText="UoM" DataField="UN" /> <asp:BoundField HeaderText="Currency" DataField="Currency" /> <asp:BoundField HeaderText="Blocked" DataField="Blocked" /> <asp:BoundField HeaderText="Blocked stock value" DataField="VALUE BLOCKED STOCK" /> <asp:BoundField HeaderText="Purchaser" DataField="Purchaser" /> </Columns>--%> </asp:GridView> </td> </tr> </table> <asp:SqlDataSource ID="Sql_current" runat="server" ConnectionString="<%$ ConnectionStrings:SERKIntranetConnectionString %>"></asp:SqlDataSource> <asp:SqlDataSource ID="SQL_prev" runat="server" ConnectionString="<%$ ConnectionStrings:SERKIntranetConnectionString %>"></asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SERKIntranetConnectionString %>" SelectCommand=" select tt.[Current_Status] ,tt.[Year] ,tt.[Month] ,sum(cast(tt.[Qty] as float)) as [Qty] ,cast(sum (cast(tt.[%] as float)) as decimal (4,2)) as [%] from ( select DATENAME(YEAR, cast([POSTING_DATE] as date)) as [Year] ,DATENAME(MONTH, cast([POSTING_DATE] as date)) as [Month] , count( cast([Quntity] as float)) as [Qty] ,[CURRENT_STATUS] , 100*count( cast([Quntity] as float)) / (select count (cast( [QUNTITY] as float)) as [Total Qty] from [UserModules].[user].[MISSING] where [DIFF_TYPE]<> 'OVER') as [%] from [UserModules].[user].[MISSING] where [DIFF_TYPE]<> 'OVER' and DATENAME(YEAR, cast([POSTING_DATE] as date)) = year(getdate()) group by [CURRENT_STATUS], [POSTING_DATE] ) as tt group by tt.[Year], tt.[Month], tt.[CURRENT_STATUS] union all select 'Total' as [Current_status] , '' as [Total] ,'' ,count (cast( [QUNTITY] as float)) as [Total Qty] , null as [%] from [UserModules].[user].[MISSING] where [DIFF_TYPE]<> 'OVER' and DATENAME(YEAR, cast([POSTING_DATE] as date)) = year(getdate()) --union all --select --'Total missing Amt (RUB)' as [Current_status] --, '' as [Total] --,'' --,cast(sum(cast(replace(replace([VALUE_BLOCKED_STOCK], ',','.'), ' ','') as float)) as decimal (20,2)) as [Total missing Amt(Rub)] --, null as [%] --FROM [UserModules].[user].[RR01_EXTRACTION] --where [VALUE_BLOCKED_STOCK] <>'' and DATENAME(YEAR, cast([extraction_date] as date)) = year(getdate()) --union all --select --'Total missing Amt ($)' as [Current_status] --, '' as [Total] --,'' --,cast(sum(cast(replace(replace([VALUE_BLOCKED_STOCK], ',','.'), ' ','') as float)) --/ --(select [exch_rate] from [UserModules].[user].[CURRENCY] where [From] = 'USD' and [To]= 'RUB')as decimal (20,2)) as [Total missing Amt($)] --, null as [%] --FROM [UserModules].[user].[RR01_EXTRACTION] --where [VALUE_BLOCKED_STOCK] <>'' and DATENAME(YEAR, cast([extraction_date] as date)) = year(getdate()) "></asp:SqlDataSource> <asp:SqlDataSource ID="Amount" runat="server" ConnectionString="<%$ ConnectionStrings:SERKIntranetConnectionString %>" SelectCommand=" select 'Total missing Amt $' as [Blocked] ,cast(sum(cast(replace(replace([VALUE_BLOCKED_STOCK], ',','.'), ' ','') as float)) / (select [exch_rate] from [UserModules].[user].[CURRENCY] where [From] = 'USD' and [To]= 'RUB')as decimal (20,2)) as [VALUE BLOCKED STOCK] ,DATENAME(Week, cast([UserModules].[user].[RR01_EXTRACTION].[Extraction_date] as date)) as [Week] from [UserModules].[user].[RR01_EXTRACTION] where DATENAME(YEAR, cast([Extraction_date] as date)) = year(getdate()) group by [Extraction_date] order by [Extraction_date] asc "></asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SERKIntranetConnectionString %>" SelectCommand=" /****** Script for SelectTopNRows command from SSMS ******/ ----RR01 total stock SELECT [UserModules].[user].[RR01_EXTRACTION].[MATERIAL] ,[PLANT] ,[ST_LOC] ,[UN] ,[CURRENCY] ,replace(replace([BLOCKED], ',','.'), ' ','') as [BLOCKED] ,replace(replace([VALUE_BLOCKED_STOCK], ',','.'), ' ','') as [VALUE BLOCKED STOCK] , t1.[PURCHASER] ,DATENAME(Week, cast([UserModules].[user].[RR01_EXTRACTION].[Extraction_date] as date)) as [Week] FROM [UserModules].[user].[RR01_EXTRACTION] left join ( select [material] ,[Purchaser]+ '@samsung.com' as [purchaser] from [UserModules].[user].[MATERIAL_MASTER_124] where [Purchaser] <> 'Purchaser') as t1 on t1.[MATERIAL] = [UserModules].[user].[RR01_EXTRACTION].[MATERIAL] where t1.[MATERIAL] <> '' and cast(EXTRACTION_DATE as datetime) = (select max(cast(EXTRACTION_DATE as datetime)) from [UserModules].[user].[RR01_EXTRACTION]) "></asp:SqlDataSource> </form> </body> </html>