/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/fi/giform.aspx.vb
57 строк
2 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
Imports System.Data Imports sharedClasses.dbFunctions Partial Class FI_prnt Inherits System.Web.UI.Page Private sqlf As New SqlFunctions Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load docNumber.Text = IIf(IsNothing(Request.QueryString("dn")), "", Request.QueryString("dn")) Dim dt As DataTable = buildList(docNumber.Text) Dim first As Boolean = True If Not IsNothing(dt) Then For Each dr As DataRow In dt.Rows Dim tr As New HtmlTableRow For c As Integer = 1 To 10 Dim tc As New HtmlTableCell tc.InnerHtml = templateRow.Cells(c - 1).InnerHtml tc.InnerHtml = tc.InnerHtml.Replace("MATERIAL", dr("material")) tc.InnerHtml = tc.InnerHtml.Replace("GTD", dr("gtd")) tc.InnerHtml = tc.InnerHtml.Replace("QTY", dr("qty")) tc.InnerHtml = tc.InnerHtml.Replace("MAP", Math.Round(dr("map"), 2).ToString) tc.InnerHtml = tc.InnerHtml.Replace("AMNT", Math.Round(dr("amnt"), 2).ToString) tc.InnerHtml = tc.InnerHtml.Replace("MODEL", dr("model")) tc.Attributes("style") = templateRow.Cells(c - 1).Attributes("style") tr.Cells.Add(tc) If first Then docDate.Text = dr("order_date") first = False End If Next data.Rows.Add(tr) Next End If End Sub Private Function buildList(documentNumber As String) As DataTable Dim sql As New StringBuilder sql.AppendLine("select ") sql.AppendLine("order_date, model, material, gtd,") sql.AppendLine("max(map) as map, ") sql.AppendLine("sum(map*qty) as amnt, sum(qty) as qty ") sql.AppendLine("from ( ") sql.AppendLine("select material, gtd,") sql.AppendLine("cast(vsolm as decimal) as qty, ") sql.AppendLine("isnull(cast(replace(replace(UNIT_PRICE,' ' ,''),',','.') as decimal(18,4)) * EXCH__RATE__RUB,0) as map, ") sql.AppendLine("model,order_date ") sql.AppendLine("from usermodules.[user].WMS_GI_INFORMATION ") sql.AppendLine("where PRINT_DOCUMENT_NUMBER='" & documentNumber & "'") sql.AppendLine(") t1 group by order_date, model, material, gtd ") Return sqlf.GetData(sql.ToString) End Function End Class