From 51be4568d2b516b05f837d80cc45f2bdc4be27ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szab=C3=B3=20Iv=C3=A1n?= Date: Mon, 25 Jun 2018 20:15:36 +0200 Subject: [PATCH] =?UTF-8?q?GANT=20csesztet=C3=A9se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/Product/ProductsGant_VC.vb | 396 ++++++++++++++---- .../Orders/OrdersIn/OrderInVC.vb | 6 +- .../Business/Products/ProductsGantRows.vb | 28 ++ .../Products/ProductsGant_VC.Designer.vb | 35 +- .../Business/Products/ProductsGant_VC.resx | 6 - .../Business/Products/ProductsGant_VC.vb | 284 ------------- .../SIS/App_Code/GeneralFunction.vb | 4 +- .../Model.DesignedDiffs.Localization.hu.xafml | 6 +- Nuvolar.Module/Model.DesignedDiffs.xafml | 29 +- 9 files changed, 368 insertions(+), 426 deletions(-) diff --git a/Nuvolar.Module.Win/BusinessObjects/Business/Product/ProductsGant_VC.vb b/Nuvolar.Module.Win/BusinessObjects/Business/Product/ProductsGant_VC.vb index abb46ee..d8a37ec 100644 --- a/Nuvolar.Module.Win/BusinessObjects/Business/Product/ProductsGant_VC.vb +++ b/Nuvolar.Module.Win/BusinessObjects/Business/Product/ProductsGant_VC.vb @@ -8,6 +8,8 @@ Imports DevExpress.Xpo Imports DevExpress.Data.Filtering Imports DevExpress.ExpressApp.SystemModule Imports DevExpress.ExpressApp.Model +Imports DevExpress.Xpo.DB +Imports System.Globalization Public Class ProductsGant_VC Inherits Nuvolar.Module.ProductsGant_VC @@ -86,6 +88,175 @@ Public Class ProductsGant_VC AddHandler _GanttControl.SelectionChanged, AddressOf _GanttControl_SelectionChanged Frame.GetController(Of ProductsGant_VC).aProductsGant_Refresh.DoExecute() + End Sub + Private Sub GenerateData(_ProductsGant As ProductsGant, _onew As Xpo.XPObjectSpace) + + + + Dim _SQL As String + + _SQL = "SELECT t1.Customers,t1.`Products`,IFNULL(t2.`CalculatedRotation`,0) AS CW16," + _SQL += " IFNULL(t3.`CalculatedRotation`,0) AS CW52" + _SQL += " FROM vv_Gant_Base t1 LEFT JOIN vv_CalculatedRotation12Month t2 ON" + _SQL += " t1.`Customers`=t2.`Customers` AND t1.`Products`=t2.`Products` LEFT JOIN vv_CalculatedRotation16Week t3 ON" + _SQL += " t1.`Customers`=t3.`Customers` AND t1.`Products`=t3.`Products`" + + 'Ideiglenes !!! + '_SQL += " where t1.Products ='81ed2085-6bf7-4c77-9906-d7165d0cbb8b'" + + Dim _SelectedData As SelectedData = _onew.Session.ExecuteQuery(_SQL) + + 'Try + _WaitFormClass.Initwork(1, 1, _SelectedData.ResultSet(0).Rows.Length) + For Each row As SelectStatementResultRow In _SelectedData.ResultSet(0).Rows + _WaitFormClass.DoWork() + + If row.Values(0) IsNot Nothing Then + + Dim _ProductsGantRows As ProductsGantRows = + _onew.FindObject(Of ProductsGantRows)(CriteriaOperator.Parse("Products.Oid = ? AND Customers.Oid= ? AND ProductsGant.Oid= ?", row.Values(1), row.Values(0), _ProductsGant.Oid)) + If _ProductsGantRows Is Nothing Then + _SQL = "insert ProductsGantRows (Oid,ProductsGant,Customers,Products,CalculatedRotation,ManualRotation,CalculatedRotationW52,QTT_Minimum,QTT_Critical)" + _SQL += " select " + _SQL += " UUID(), " + _SQL += "'" & _ProductsGant.Oid.ToString() & "'," + _SQL += "'" & row.Values(0) & "'," + _SQL += "'" & row.Values(1) & "'," + _SQL += Double.Parse(row.Values(2)).ToString("F", CultureInfo.InvariantCulture) & "," + _SQL += "0," + _SQL += Double.Parse(row.Values(3)).ToString("F", CultureInfo.InvariantCulture) & "," + _SQL += "0,0" + + _onew.Session.ExecuteNonQuery(_SQL) + Else + _SQL = " update ProductsGantRows set CalculatedRotation = " & Double.Parse(row.Values(2)).ToString("F", CultureInfo.InvariantCulture) & "," + _SQL += " CalculatedRotationW52 = " & Double.Parse(row.Values(3)).ToString("F", CultureInfo.InvariantCulture) + _SQL += " where Oid='" & _ProductsGantRows.Oid.ToString & "'" + _onew.Session.ExecuteNonQuery(_SQL) + End If + + If _ProductsGantRows IsNot Nothing Then + Dim _Item As Long = _GanttControl.Items.get_FindItem(_ProductsGantRows.Oid.ToString, 0) + 'Most le kéne generálni a GANTROWSBAR elemeket is ..... + + _SQL = " select t1.QTT,t1.DateExecution" + _SQL += " from productsgantcustomersreport t1" + _SQL += " where t1.Products='" & row.Values(1) & "'" + _SQL += " AND t1.Customers='" & row.Values(0) & "'" + _SQL += " AND t1.GCRecord is null" + _SQL += " order by t1.DateExecution DESC" + + + Dim _SelectedData2 As SelectedData = _onew.Session.ExecuteQuery(_SQL) + For Each row2 As SelectStatementResultRow In _SelectedData2.ResultSet(0).Rows + Dim _AD As Double = 1 + + If Double.Parse(row.Values(2)) <> 0 Then + _AD = row2.Values(0) * 7 / Double.Parse(row.Values(2)) + End If + + + If _ProductsGantRows IsNot Nothing Then + If _ProductsGantRows.ManualRotation > 0 Then + _AD = row2.Values(0) * 7 / _ProductsGantRows.ManualRotation + End If + End If + + Dim _Key As String = Guid.NewGuid.ToString + _GanttControl.Items.AddBar(CInt(_Item), "Reported", row2.Values(1), DateTime.Parse(row2.Values(1)).AddDays(_AD), _Key, row2.Values(0)) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) + _GanttControl.Items.set_BarHAlignCaption(CInt(_Item), _Key, AlignmentEnum.LeftAlignment) + + Exit For + Next + + + _SQL = " select sum(t1.QTT),DATE_FORMAT(t2.DateExecution,'%Y-%m-%d')" + _SQL += " from OrderInRows t1 join OrderInHeader t2 on t1.OrderInHeader=t2.Oid" + _SQL += " where t1.Products='" & row.Values(1) & "' AND t1.QTT > t1.QTT_Invoiced " + _SQL += " AND t2.Customers='" & row.Values(0) & "'" + _SQL += " AND t1.GCRecord is null and t2.GCRecord is null" + _SQL += " GROUP BY DATE_FORMAT(t2.DateExecution,'%Y-%m-%d')" + _SQL += " order by DATE_FORMAT(t2.DateExecution,'%Y-%m-%d') DESC" + + + _SelectedData2 = _onew.Session.ExecuteQuery(_SQL) + For Each row2 As SelectStatementResultRow In _SelectedData2.ResultSet(0).Rows + Dim _AD As Double = 1 + + If Double.Parse(row.Values(2)) <> 0 Then + _AD = row2.Values(0) * 7 / Double.Parse(row.Values(2)) + End If + + + If _ProductsGantRows IsNot Nothing Then + If _ProductsGantRows.ManualRotation > 0 Then + _AD = row2.Values(0) * 7 / _ProductsGantRows.ManualRotation + End If + End If + + Dim _Key As String = Guid.NewGuid.ToString + _GanttControl.Items.AddBar(CInt(_Item), "Ordered", row2.Values(1), DateTime.Parse(row2.Values(1)).AddDays(_AD), _Key, row2.Values(0)) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) + _GanttControl.Items.set_BarHAlignCaption(CInt(_Item), _Key, AlignmentEnum.LeftAlignment) + + Next + + _SQL = " select sum(t1.QTT),DATE_FORMAT(t2.DateExecution,'%Y-%m-%d')" + _SQL += " from InvoiceRows t1 join InvoiceHeader t2 on t1.InvoiceHeader=t2.Oid" + _SQL += " left join OrderInRows t3 on t1.OrderInRows=t3.Oid" + _SQL += " where t3.Products='" & row.Values(1) & "'" + _SQL += " AND t2.Customers='" & row.Values(0) & "'" + _SQL += " AND t1.GCRecord is null and t2.GCRecord is null AND t2.IsEditable=0" + _SQL += " GROUP BY DATE_FORMAT(t2.DateExecution,'%Y-%m-%d')" + _SQL += " order by DATE_FORMAT(t2.DateExecution,'%Y-%m-%d') DESC" + + + _SelectedData2 = _onew.Session.ExecuteQuery(_SQL) + For Each row2 As SelectStatementResultRow In _SelectedData2.ResultSet(0).Rows + Dim _AD As Double = 1 + + If Double.Parse(row.Values(2)) <> 0 Then + _AD = row2.Values(0) * 7 / Double.Parse(row.Values(2)) + End If + + + If _ProductsGantRows IsNot Nothing Then + If _ProductsGantRows.ManualRotation > 0 Then + _AD = row2.Values(0) * 7 / _ProductsGantRows.ManualRotation + End If + End If + + Dim _Key As String = Guid.NewGuid.ToString + _GanttControl.Items.AddBar(CInt(_Item), "Accounted", row2.Values(1), DateTime.Parse(row2.Values(1)).AddDays(_AD), _Key, row2.Values(0)) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) + _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) + _GanttControl.Items.set_BarHAlignCaption(CInt(_Item), _Key, AlignmentEnum.LeftAlignment) + + Next + End If + End If + Next row + 'Catch ex As Exception + ' Throw New Exception(ex.Message) + 'Finally + + _WaitFormClass.FinalWork() + 'End Try + + + + + + End Sub Private Sub aProductsGant_Refresh_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aProductsGant_Refresh.Execute Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace @@ -94,40 +265,42 @@ Public Class ProductsGant_VC _ProductsGant = TryCast(TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject, ProductsGant) End If - Dim _ProductsGantRowsBar_Collection As New XPCollection(Of ProductsGantRowsBar)(_onew.Session, CriteriaOperator.Parse("BarType=3")) + 'GenerateData(_ProductsGant, _onew) - If _ProductsGantRowsBar_Collection.Count > 0 Then - For Each _ProductsGantRowsBar As ProductsGantRowsBar In _ProductsGantRowsBar_Collection - With _ProductsGantRowsBar - .FromDate = GetSQLTime(_onew.Session).Date - If .ProductsGantRows.Products.CustomersOrderPriority.Count > 0 Then - .ProductsGantRows.Products.CustomersOrderPriority.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) + 'Dim _ProductsGantRowsBar_Collection As New XPCollection(Of ProductsGantRowsBar)(_onew.Session, CriteriaOperator.Parse("BarType=3")) - .ToDate = .FromDate.AddDays(.ProductsGantRows.Products.CustomersOrderPriority(0).DeadlineWeek * 7) - Else - .ToDate = .FromDate - End If - End With + 'If _ProductsGantRowsBar_Collection.Count > 0 Then + ' For Each _ProductsGantRowsBar As ProductsGantRowsBar In _ProductsGantRowsBar_Collection + ' With _ProductsGantRowsBar + ' .FromDate = GetSQLTime(_onew.Session).Date + ' If .ProductsGantRows.Products.CustomersOrderPriority.Count > 0 Then + ' .ProductsGantRows.Products.CustomersOrderPriority.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) - Next - End If - _ProductsGantRowsBar_Collection = New XPCollection(Of ProductsGantRowsBar)(_onew.Session, CriteriaOperator.Parse("BarType=0")) + ' .ToDate = .FromDate.AddDays(.ProductsGantRows.Products.CustomersOrderPriority(0).DeadlineWeek * 7) + ' Else + ' .ToDate = .FromDate + ' End If + ' End With - If _ProductsGantRowsBar_Collection.Count > 0 Then - For Each _ProductsGantRowsBar As ProductsGantRowsBar In _ProductsGantRowsBar_Collection - With _ProductsGantRowsBar - If _ProductsGantRowsBar.ProductsGantRows.ManualRotation > 0 Then - .ToDate = .FromDate.AddDays(_ProductsGantRowsBar.ProductsGantRows.ManualRotation * 7) - ElseIf _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation > 0 Then - .ToDate = .FromDate.AddDays(_ProductsGantRowsBar.ProductsGantRows.CalculatedRotation * 7) - Else - .ToDate = .FromDate.AddDays(1) + ' Next + 'End If + '_ProductsGantRowsBar_Collection = New XPCollection(Of ProductsGantRowsBar)(_onew.Session, CriteriaOperator.Parse("BarType=0")) - End If - End With - Next - End If - _onew.CommitChanges() + 'If _ProductsGantRowsBar_Collection.Count > 0 Then + ' For Each _ProductsGantRowsBar As ProductsGantRowsBar In _ProductsGantRowsBar_Collection + ' With _ProductsGantRowsBar + ' If _ProductsGantRowsBar.ProductsGantRows.ManualRotation > 0 Then + ' .ToDate = .FromDate.AddDays(_ProductsGantRowsBar.ProductsGantRows.ManualRotation * 7) + ' ElseIf _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation > 0 Then + ' .ToDate = .FromDate.AddDays(_ProductsGantRowsBar.ProductsGantRows.CalculatedRotation * 7) + ' Else + ' .ToDate = .FromDate.AddDays(1) + + ' End If + ' End With + ' Next + 'End If + '_onew.CommitChanges() Dim _DetailView As DetailView = TryCast(View, DetailView) Dim _ProductsGantRowsViewItem As ListPropertyEditor = _DetailView.FindItem("ProductsGantRows") @@ -193,17 +366,19 @@ Public Class ProductsGant_VC .HistogramPattern = PatternEnum.exPatternBox + PatternEnum.exPatternDot + PatternEnum.exPatternShadow .HistogramColor = Drawing.Color.Yellow .OverlaidType = OverlaidBarsTypeEnum.exOverlaidBarsStack + .OverlaidGroup = "Reported,Ordered,Accounted" End With With .Copy("Task", "Ordered") .Color = Drawing.Color.Black .Shape = ShapeBarEnum.exShapeSolid .StartColor = Drawing.Color.LightPink - .EndColor = Drawing.Color.Pink + .EndColor = Drawing.Color.LightPink .Pattern = PatternEnum.exPatternBox + PatternEnum.exPatternDot + PatternEnum.exPatternShadow .Height = 18 .HistogramPattern = PatternEnum.exPatternBox + PatternEnum.exPatternDot + PatternEnum.exPatternShadow .HistogramColor = Drawing.Color.Pink .OverlaidType = OverlaidBarsTypeEnum.exOverlaidBarsStack + .OverlaidGroup = "Reported,Ordered,Accounted" End With With .Copy("Summary", "Reported") .Color = Drawing.Color.DarkGray @@ -211,13 +386,14 @@ Public Class ProductsGant_VC .StartShape = ShapeCornerEnum.exShapeIconUp3 .EndShape = ShapeCornerEnum.exShapeIconDown3 .HistogramRulerLinesColor = Drawing.Color.Black - .StartColor = Drawing.Color.DarkGreen + .StartColor = Drawing.Color.LightGreen .EndColor = Drawing.Color.LightGreen .Pattern = PatternEnum.exPatternBox + PatternEnum.exPatternDot + PatternEnum.exPatternShadow + PatternEnum.exPatternEmpty .Height = 18 .HistogramPattern = PatternEnum.exPatternBox + PatternEnum.exPatternDot + PatternEnum.exPatternShadow + PatternEnum.exPatternEmpty .HistogramColor = Drawing.Color.Green .OverlaidType = OverlaidBarsTypeEnum.exOverlaidBarsStack + .OverlaidGroup = "Reported,Ordered,Accounted" End With With .Copy("Milestone", "OrderArrive") .StartShape = ShapeCornerEnum.exShapeIconVBar @@ -412,6 +588,7 @@ Public Class ProductsGant_VC _GantItemColumn_Array.Clear() _GantChange = True End With + GenerateData(_ProductsGant, _onew) End If End Sub Private Sub SetItemBars(_item As Long, _ProductsGantRows As ProductsGantRows) @@ -497,8 +674,12 @@ Public Class ProductsGant_VC Select Case _G2Column.Key Case "ManualRotation" _ProductsGantRows.ManualRotation = _GanttControl.Items.get_CellValue(_GanttControl.Items.get_SelectedItem(0), _G2Column.Index) - 'Case "CalculatedRotation" - ' _ProductsGantRows.CalculatedRotation = _GanttControl.Items.get_CellValue(_GanttControl.Items.get_SelectedItem(0), _G2Column.Index) + 'Case "CalculatedRotation" + ' _ProductsGantRows.CalculatedRotation = _GanttControl.Items.get_CellValue(_GanttControl.Items.get_SelectedItem(0), _G2Column.Index) + Case "QTT_Critical" + _ProductsGantRows.QTT_Critical = _GanttControl.Items.get_CellValue(_GanttControl.Items.get_SelectedItem(0), _G2Column.Index) + Case "QTT_Minimum" + _ProductsGantRows.QTT_Minimum = _GanttControl.Items.get_CellValue(_GanttControl.Items.get_SelectedItem(0), _G2Column.Index) End Select Next @@ -579,17 +760,24 @@ Public Class ProductsGant_VC With _ProductsGantRowsBar .ProductsGantRows = _ProductsGantRows .FromDate = _ProductsGantCustomersReport.DateExecution - If _ProductsGantRowsBar.ProductsGantRows.Products.CustomersOrderPriority.Count > 0 Then - .ProductsGantRows.Products.CustomersOrderPriority.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) - .ToDate = .FromDate.AddDays(.ProductsGantRows.Products.CustomersOrderPriority(0).DeadlineWeek * 7) + 'If _ProductsGantRowsBar.ProductsGantRows.Products.CustomersOrderPriority.Count > 0 Then + ' .ProductsGantRows.Products.CustomersOrderPriority.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) + ' .ToDate = .FromDate.AddDays(.ProductsGantRows.Products.CustomersOrderPriority(0).DeadlineWeek * 7) + 'Else + ' If _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation > 0 Then + ' .ToDate = .FromDate.AddDays(_ProductsGantRowsBar.ProductsGantRows.CalculatedRotation * 7) + ' ElseIf _ProductsGantRowsBar.ProductsGantRows.ManualRotation > 0 Then + ' .ToDate = .FromDate.AddDays(.ProductsGantRows.ManualRotation * 7) + ' Else + ' .ToDate = .FromDate.AddDays(1) 'temp + ' End If + 'End If + If _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation > 0 Then + .ToDate = .FromDate.AddDays(_ProductsGantCustomersReport_New.QTT / _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation) + ElseIf _ProductsGantRowsBar.ProductsGantRows.ManualRotation > 0 Then + .ToDate = .FromDate.AddDays(_ProductsGantCustomersReport_New.QTT / .ProductsGantRows.ManualRotation) Else - If _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation > 0 Then - .ToDate = .FromDate.AddDays(_ProductsGantRowsBar.ProductsGantRows.CalculatedRotation * 7) - ElseIf _ProductsGantRowsBar.ProductsGantRows.ManualRotation > 0 Then - .ToDate = .FromDate.AddDays(.ProductsGantRows.ManualRotation * 7) - Else - .ToDate = .FromDate.AddDays(1) 'temp - End If + .ToDate = .FromDate.AddDays(1) 'temp End If .BarType = eBarType.eReported .Caption = _ProductsGantCustomersReport_New.QTT.ToString @@ -597,17 +785,24 @@ Public Class ProductsGant_VC Else With _ProductsGantRowsBar .FromDate = _ProductsGantCustomersReport.DateExecution - If _ProductsGantRowsBar.ProductsGantRows.Products.CustomersOrderPriority.Count > 0 Then - .ProductsGantRows.Products.CustomersOrderPriority.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) - .ToDate = .FromDate.AddDays(.ProductsGantRows.Products.CustomersOrderPriority(0).DeadlineWeek * 7) + 'If _ProductsGantRowsBar.ProductsGantRows.Products.CustomersOrderPriority.Count > 0 Then + ' .ProductsGantRows.Products.CustomersOrderPriority.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) + ' .ToDate = .FromDate.AddDays(.ProductsGantRows.Products.CustomersOrderPriority(0).DeadlineWeek * 7) + 'Else + ' If _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation > 0 Then + ' .ToDate = .FromDate.AddDays(_ProductsGantRowsBar.ProductsGantRows.CalculatedRotation * 7) + ' ElseIf _ProductsGantRowsBar.ProductsGantRows.ManualRotation > 0 Then + ' .ToDate = .FromDate.AddDays(.ProductsGantRows.ManualRotation * 7) + ' Else + ' .ToDate = .FromDate.AddDays(1) 'temp + ' End If + 'End If + If _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation > 0 Then + .ToDate = .FromDate.AddDays(_ProductsGantCustomersReport_New.QTT / _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation) + ElseIf _ProductsGantRowsBar.ProductsGantRows.ManualRotation > 0 Then + .ToDate = .FromDate.AddDays(_ProductsGantCustomersReport_New.QTT / .ProductsGantRows.ManualRotation) Else - If _ProductsGantRowsBar.ProductsGantRows.CalculatedRotation > 0 Then - .ToDate = .FromDate.AddDays(_ProductsGantRowsBar.ProductsGantRows.CalculatedRotation * 7) - ElseIf _ProductsGantRowsBar.ProductsGantRows.ManualRotation > 0 Then - .ToDate = .FromDate.AddDays(.ProductsGantRows.ManualRotation * 7) - Else - .ToDate = .FromDate.AddDays(1) 'temp - End If + .ToDate = .FromDate.AddDays(1) 'temp End If .Caption = _ProductsGantCustomersReport_New.QTT.ToString End With @@ -665,6 +860,10 @@ Public Class ProductsGant_VC ' _ProductsGantRows.CalculatedRotation = CType(NewValue, Double) Case "ManualRotation" _ProductsGantRows.ManualRotation = CType(NewValue, Double) + Case "QTT_Critical" + _ProductsGantRows.QTT_Critical = CType(NewValue, Double) + Case "QTT_Minimum" + _ProductsGantRows.QTT_Minimum = CType(NewValue, Double) End Select _onew.CommitChanges() @@ -686,16 +885,18 @@ Public Class ProductsGant_VC Private Sub GanttControl_LayoutChanged(sender As Object) If _GantChange Then Dim _DetailView As DetailView = TryCast(View, DetailView) - Dim _ProductsGantRowsViewItem As ListPropertyEditor = _DetailView.FindItem("ProductsGantRows") - Dim _IModelListView As IModelListView = Application.Model.Views.GetNode("ProductsGant_ProductsGantRows_ListView") - For Each _Column In _IModelListView.Columns - For Each _G2Column As exontrol.EXG2ANTTLib.Column In _GanttControl.Columns - If _Column.Id = _G2Column.Key Then - _Column.Width = _G2Column.Width - End If + If _DetailView IsNot Nothing Then + Dim _ProductsGantRowsViewItem As ListPropertyEditor = _DetailView.FindItem("ProductsGantRows") + Dim _IModelListView As IModelListView = Application.Model.Views.GetNode("ProductsGant_ProductsGantRows_ListView") + For Each _Column In _IModelListView.Columns + For Each _G2Column As exontrol.EXG2ANTTLib.Column In _GanttControl.Columns + If _Column.Id = _G2Column.Key Then + _Column.Width = _G2Column.Width + End If + Next Next - Next - Application.SaveModelChanges() + Application.SaveModelChanges() + End If End If End Sub Private Sub SetItemsAndItemData(_Item As Long, _ProductsGantRows As ProductsGantRows) @@ -711,44 +912,55 @@ Public Class ProductsGant_VC If _ProductsGantRows.CalculatedRotation > 0 Then _GanttControl.Items.set_CellValue(_Item, _G2Column.Index, _ProductsGantRows.CalculatedRotation) End If - + Case "CalculatedRotationW52" + If _ProductsGantRows.CalculatedRotation > 0 Then + _GanttControl.Items.set_CellValue(_Item, _G2Column.Index, _ProductsGantRows.CalculatedRotationW52) + End If Case "ManualRotation" If _ProductsGantRows.ManualRotation > 0 Then _GanttControl.Items.set_CellValue(_Item, _G2Column.Index, _ProductsGantRows.ManualRotation) End If + Case "QTT_Minimum" + If _ProductsGantRows.QTT_Minimum > 0 Then + _GanttControl.Items.set_CellValue(_Item, _G2Column.Index, _ProductsGantRows.QTT_Minimum) + End If + Case "QTT_Critical" + If _ProductsGantRows.QTT_Critical > 0 Then + _GanttControl.Items.set_CellValue(_Item, _G2Column.Index, _ProductsGantRows.QTT_Critical) + End If End Select Next - For Each _ProductsGantRowsBar As ProductsGantRowsBar In _ProductsGantRows.ProductsGantRowsBar - Dim _Key As String = Guid.NewGuid.ToString - Select Case _ProductsGantRowsBar.BarType - Case eBarType.eAccounted - _GanttControl.Items.AddBar(CInt(_Item), "Accounted", _ProductsGantRowsBar.FromDate, _ProductsGantRowsBar.ToDate, _Key, _ProductsGantRowsBar.Caption) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) - Case eBarType.eOrdered - _GanttControl.Items.AddBar(CInt(_Item), "Ordered", _ProductsGantRowsBar.FromDate, _ProductsGantRowsBar.ToDate, _Key, _ProductsGantRowsBar.Caption) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) - Case eBarType.eReported - _GanttControl.Items.AddBar(CInt(_Item), "Reported", _ProductsGantRowsBar.FromDate, _ProductsGantRowsBar.ToDate, _Key, _ProductsGantRowsBar.Caption) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) - Case eBarType.eOrderArrive - _GanttControl.Items.AddBar(CInt(_Item), "OrderArrive", _ProductsGantRowsBar.ToDate, _ProductsGantRowsBar.ToDate, _Key, _ProductsGantRowsBar.Caption) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) - _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) - End Select - Next + 'For Each _ProductsGantRowsBar As ProductsGantRowsBar In _ProductsGantRows.ProductsGantRowsBar + ' Dim _Key As String = Guid.NewGuid.ToString + ' Select Case _ProductsGantRowsBar.BarType + ' Case eBarType.eAccounted + ' _GanttControl.Items.AddBar(CInt(_Item), "Accounted", _ProductsGantRowsBar.FromDate, _ProductsGantRowsBar.ToDate, _Key, _ProductsGantRowsBar.Caption) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) + ' Case eBarType.eOrdered + ' _GanttControl.Items.AddBar(CInt(_Item), "Ordered", _ProductsGantRowsBar.FromDate, _ProductsGantRowsBar.ToDate, _Key, _ProductsGantRowsBar.Caption) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) + ' Case eBarType.eReported + ' _GanttControl.Items.AddBar(CInt(_Item), "Reported", _ProductsGantRowsBar.FromDate, _ProductsGantRowsBar.ToDate, _Key, _ProductsGantRowsBar.Caption) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) + ' Case eBarType.eOrderArrive + ' _GanttControl.Items.AddBar(CInt(_Item), "OrderArrive", _ProductsGantRowsBar.ToDate, _ProductsGantRowsBar.ToDate, _Key, _ProductsGantRowsBar.Caption) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanResize, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanMove, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanStartLink, False) + ' _GanttControl.Items.set_ItemBar(CInt(_Item), _Key, exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarCanBeLinked, False) + ' End Select + 'Next End Sub Private Sub _GanttControl_SelectionChanged(sender As Object) diff --git a/Nuvolar.Module/BusinessObjects/Business/BusinessTransactions/Orders/OrdersIn/OrderInVC.vb b/Nuvolar.Module/BusinessObjects/Business/BusinessTransactions/Orders/OrdersIn/OrderInVC.vb index 010b9ae..77b9071 100644 --- a/Nuvolar.Module/BusinessObjects/Business/BusinessTransactions/Orders/OrdersIn/OrderInVC.vb +++ b/Nuvolar.Module/BusinessObjects/Business/BusinessTransactions/Orders/OrdersIn/OrderInVC.vb @@ -3795,12 +3795,12 @@ CheckError: .DiscountPriceDEV = _DeliveryNoteOutRows.StorageOutRowsInRows.StorageOutRows.OrderInRows.DiscountPriceDEV .DiscountPriceHUF = _DeliveryNoteOutRows.StorageOutRowsInRows.StorageOutRows.OrderInRows.DiscountPriceHUF .ListPriceDEV = _DeliveryNoteOutRows.StorageOutRowsInRows.StorageOutRows.OrderInRows.ListPriceDEV + .ListPriceHUF = _DeliveryNoteOutRows.StorageOutRowsInRows.StorageOutRows.OrderInRows.ListPriceHUF + 'Ha a DEVIZA != HUF, akkor itt kell árfolyam alapján újragenerálás !!! If .InvoiceHeader.CurrencyName.ShortName <> "HUF" And _ORI_Invoice_Popup.PriceMode = ePriceMode.eDEVToHUF Then - .DiscountPriceHUF = _DeliveryNoteOutRows.StorageOutRowsInRows.StorageOutRows.OrderInRows.DiscountPriceDEV * _ORI_Invoice_Popup.CurrencyRate, 2, MidpointRounding.AwayFromZero) + .DiscountPriceHUF = Math.Round(_DeliveryNoteOutRows.StorageOutRowsInRows.StorageOutRows.OrderInRows.DiscountPriceDEV * _ORI_Invoice_Popup.CurrencyRate, 2, MidpointRounding.AwayFromZero) .ListPriceHUF = Math.Round(_DeliveryNoteOutRows.StorageOutRowsInRows.StorageOutRows.OrderInRows.ListPriceDEV * _ORI_Invoice_Popup.CurrencyRate, 2, MidpointRounding.AwayFromZero) - Else - .ListPriceHUF = _DeliveryNoteOutRows.StorageOutRowsInRows.StorageOutRows.OrderInRows.ListPriceHUF End If diff --git a/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGantRows.vb b/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGantRows.vb index 913aaaa..eba22f5 100644 --- a/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGantRows.vb +++ b/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGantRows.vb @@ -17,7 +17,11 @@ Public Class ProductsGantRows Private _Customers As Customers Private _Products As Products Private _CalculatedRotation As Double 'Kalkulált forgási sebesség + Private _CalculatedRotationW52 As Double 'Kalkulált forgási sebesség 52hétre vonatkozó Private _ManualRotation As Double 'Manuális forgási sebesség + Private _QTT_Minimum As Double 'Minimális mennyiség az ügyfélnél + Private _QTT_Critical As Double 'Kritikus mennyiség az ügyfélnél + Public Sub New(ByVal session As Session) MyBase.New(session) @@ -57,6 +61,14 @@ Public Class ProductsGantRows SetPropertyValue("CalculatedRotation", _CalculatedRotation, value) End Set End Property + Property CalculatedRotationW52 As Double + Get + Return _CalculatedRotationW52 + End Get + Set(value As Double) + SetPropertyValue("CalculatedRotationW52", _CalculatedRotationW52, value) + End Set + End Property Property ManualRotation As Double Get Return _ManualRotation @@ -65,6 +77,22 @@ Public Class ProductsGantRows SetPropertyValue("ManualRotation", _ManualRotation, value) End Set End Property + Property QTT_Minimum As Double + Get + Return _QTT_Minimum + End Get + Set(value As Double) + SetPropertyValue("QTT_Minimum", _QTT_Minimum, value) + End Set + End Property + Property QTT_Critical As Double + Get + Return _QTT_Critical + End Get + Set(value As Double) + SetPropertyValue("QTT_Critical", _QTT_Critical, value) + End Set + End Property 'ReadOnly diff --git a/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.Designer.vb b/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.Designer.vb index b638b26..8b13ee7 100644 --- a/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.Designer.vb +++ b/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.Designer.vb @@ -27,43 +27,10 @@ Partial Class ProductsGant_VC _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Me.aProductsGant_GerenrateProductsGantRows = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components) - Me.aProductsGant_UpdateProductsGantRows = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components) ' - 'aProductsGant_GerenrateProductsGantRows + 'ProductsGant_VC ' - Me.aProductsGant_GerenrateProductsGantRows.Caption = "aProductsGant_GerenrateProductsGantRows" - Me.aProductsGant_GerenrateProductsGantRows.Category = "ObjectsCreation" - Me.aProductsGant_GerenrateProductsGantRows.ConfirmationMessage = "Biztos benne, hogy eldobja a Gant diagram jelenlegi tartalmát és újra felépíti?" - Me.aProductsGant_GerenrateProductsGantRows.Id = "aProductsGant_GerenrateProductsGantRows" - Me.aProductsGant_GerenrateProductsGantRows.ImageName = Nothing - Me.aProductsGant_GerenrateProductsGantRows.Shortcut = Nothing - Me.aProductsGant_GerenrateProductsGantRows.Tag = Nothing - Me.aProductsGant_GerenrateProductsGantRows.TargetObjectsCriteria = Nothing - Me.aProductsGant_GerenrateProductsGantRows.TargetObjectType = GetType(Nuvolar.[Module].ProductsGant) - Me.aProductsGant_GerenrateProductsGantRows.TargetViewId = Nothing - Me.aProductsGant_GerenrateProductsGantRows.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView - Me.aProductsGant_GerenrateProductsGantRows.ToolTip = Nothing - Me.aProductsGant_GerenrateProductsGantRows.TypeOfView = GetType(DevExpress.ExpressApp.DetailView) - ' - 'aProductsGant_UpdateProductsGantRows - ' - Me.aProductsGant_UpdateProductsGantRows.Caption = "aProductsGant_UpdateProductsGantRows" - Me.aProductsGant_UpdateProductsGantRows.Category = "ObjectsCreation" - Me.aProductsGant_UpdateProductsGantRows.ConfirmationMessage = Nothing - Me.aProductsGant_UpdateProductsGantRows.Id = "aProductsGant_UpdateProductsGantRows" - Me.aProductsGant_UpdateProductsGantRows.ImageName = Nothing - Me.aProductsGant_UpdateProductsGantRows.Shortcut = Nothing - Me.aProductsGant_UpdateProductsGantRows.Tag = Nothing - Me.aProductsGant_UpdateProductsGantRows.TargetObjectsCriteria = Nothing - Me.aProductsGant_UpdateProductsGantRows.TargetObjectType = GetType(Nuvolar.[Module].ProductsGant) - Me.aProductsGant_UpdateProductsGantRows.TargetViewId = Nothing - Me.aProductsGant_UpdateProductsGantRows.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView - Me.aProductsGant_UpdateProductsGantRows.ToolTip = Nothing - Me.aProductsGant_UpdateProductsGantRows.TypeOfView = GetType(DevExpress.ExpressApp.DetailView) End Sub - Friend WithEvents aProductsGant_GerenrateProductsGantRows As DevExpress.ExpressApp.Actions.SimpleAction - Friend WithEvents aProductsGant_UpdateProductsGantRows As DevExpress.ExpressApp.Actions.SimpleAction End Class diff --git a/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.resx b/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.resx index aa3b597..e5858cc 100644 --- a/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.resx +++ b/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.resx @@ -117,12 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 56 - - - 310, 56 - False diff --git a/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.vb b/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.vb index 9b3cfae..a9de070 100644 --- a/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.vb +++ b/Nuvolar.Module/BusinessObjects/Business/Products/ProductsGant_VC.vb @@ -67,289 +67,5 @@ Public Class ProductsGant_VC Return _CalculatedRotation End Function - Private Sub aProductsGant_GerenrateProductsGantRows_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aProductsGant_GerenrateProductsGantRows.Execute - Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace) - Dim _uow As New UnitOfWork(_ocur.Session.DataLayer) - Dim _ProductsGant As ProductsGant = TryCast(View.SelectedObjects(0), ProductsGant) - Dim _ProductsGantRows_DELCollection As New XPCollection(Of ProductsGantRows)(_uow, CriteriaOperator.Parse("ProductsGant.Oid=?", _ProductsGant.Oid)) - If _ProductsGantRows_DELCollection.Count > 0 Then - - Dim _ProductsGantRowsBar_DELCollection As New XPCollection(Of ProductsGantRowsBar)(_uow, CriteriaOperator.Parse("ProductsGantRows.ProductsGant.Oid=?", _ProductsGant.Oid)) - _uow.Delete(_ProductsGantRows_DELCollection) - _uow.Delete(_ProductsGantRowsBar_DELCollection) - - _uow.CommitChanges() - End If - - - - Dim InvoiceRowsXPQ As New XPQuery(Of InvoiceRows)(_ocur.Session) - Dim IRXPQ = From _InvoiceRowsXPQ In InvoiceRowsXPQ - Where _InvoiceRowsXPQ.OrderInRows IsNot Nothing And - _InvoiceRowsXPQ.OrderInRows.Products IsNot Nothing And - _InvoiceRowsXPQ.InvoiceHeader.IsStorno = False And - String.IsNullOrEmpty(_InvoiceRowsXPQ.InvoiceHeader.DocumentNumber) = False And - _InvoiceRowsXPQ.InvoiceHeader IsNot Nothing And - _InvoiceRowsXPQ.InvoiceHeader.IsEditable = False And - _InvoiceRowsXPQ.InvoiceHeader.CustomersFrom.Oid = _ProductsGant.CustomersFrom.Oid - Group _InvoiceRowsXPQ By _InvoiceRowsXPQ.InvoiceHeader.Customers, - _InvoiceRowsXPQ.OrderInRows.Products Into g = Group - Select New With {Key .Customers = Customers, - Key .Products = Products} - - Try - GeneralFunction.GLOBAL_HAS_Audit = False - RaiseEvent InitWork(1, 1, IRXPQ.Count) - For Each item In IRXPQ - RaiseEvent DoWork() - Dim _ProductsGantRows As New ProductsGantRows(_ocur.Session) - With _ProductsGantRows - .ProductsGant = _ProductsGant - .Customers = item.Customers - .Products = item.Products - .CalculatedRotation = CountLast16Week(item.Products.Oid.ToString, item.Customers.Oid.ToString) - .ManualRotation = 0 - End With - - 'Számlázott mennyiségekhez ProductsGantRowsBar - Dim _InvoiceRows_Collection As New XPCollection(Of InvoiceRows)(_ocur.Session, CriteriaOperator.Parse("InvoiceHeader.Customers=? AND OrderInRows.Products=? AND InvoiceHeader.IsEditable=False AND " + - "InvoiceHeader.IsStorno=False AND (IsNull(InvoiceHeader.DocumentNumber)=False OR InvoiceHeader.DocumentNumber<>'')", item.Customers, item.Products)) - - If _InvoiceRows_Collection.Count > 0 Then - _InvoiceRows_Collection.Sorting.Add(New SortProperty("DateExecution", DB.SortingDirection.Ascending)) - For Each _InvoiceRows As InvoiceRows In _InvoiceRows_Collection - - Dim _ProductsGantRowsBar_OrderArrive As New ProductsGantRowsBar(_ocur.Session) - With _ProductsGantRowsBar_OrderArrive - .ProductsGantRows = _ProductsGantRows - .FromDate = New Date(_InvoiceRows.InvoiceHeader.DateExecution.Year, _InvoiceRows.InvoiceHeader.DateExecution.Month, _InvoiceRows.InvoiceHeader.DateExecution.Day, 0, 0, 0) - .ToDate = New Date(_InvoiceRows.InvoiceHeader.DateExecution.Year, _InvoiceRows.InvoiceHeader.DateExecution.Month, _InvoiceRows.InvoiceHeader.DateExecution.Day, 23, 59, 59) - .BarType = eBarType.eAccounted - .Caption = _InvoiceRows.QTT - End With - Next - End If - - - 'Adott pillanatban leadott rendelés érkezése - dinamikos cucc, frissítésnél ezeket update! - Dim _CustomersOrderPriority_Collection As New XPCollection(Of CustomersOrderPriority)(_ocur.Session, CriteriaOperator.Parse("Products=?", item.Products)) - - If _CustomersOrderPriority_Collection.Count > 0 Then - _CustomersOrderPriority_Collection.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) - - Dim _ProductsGantRowsBar_OrderArrive As New ProductsGantRowsBar(_ocur.Session) - With _ProductsGantRowsBar_OrderArrive - .ProductsGantRows = _ProductsGantRows - .FromDate = GetSQLTime(_ocur.Session) - If _CustomersOrderPriority_Collection(0).DeadlineWeek = 0 Then - .ToDate = .FromDate.AddDays(7) - Else - .ToDate = .FromDate.AddDays(_CustomersOrderPriority_Collection(0).DeadlineWeek * 7) - End If - .BarType = eBarType.eOrderArrive - End With - End If - - 'Jelentett készlet - Dim _ProductsGantCustomersReport_Collection As New XPCollection(Of ProductsGantCustomersReport)(_ocur.Session, CriteriaOperator.Parse("Customers=? AND Products=?", item.Customers, item.Products)) - - If _ProductsGantCustomersReport_Collection.Count > 0 Then - For Each _ProductsGantCustomersReport As ProductsGantCustomersReport In _ProductsGantCustomersReport_Collection - Dim _ProductsGantRowsBar_Reported As New ProductsGantRowsBar(_ocur.Session) - With _ProductsGantRowsBar_Reported - .ProductsGantRows = _ProductsGantRows - .FromDate = _ProductsGantCustomersReport.DateExecution - If .ProductsGantRows.Products.CustomersOrderPriority.Count > 0 Then - .ProductsGantRows.Products.CustomersOrderPriority.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) - .ToDate = .FromDate.AddDays(.ProductsGantRows.Products.CustomersOrderPriority(0).DeadlineWeek * 7) - Else - .ToDate = .FromDate.AddDays(_ProductsGantCustomersReport.QTT) - End If - .Caption = _ProductsGantCustomersReport.QTT.ToString - .BarType = eBarType.eReported - End With - Next - End If - - - 'Rendelések - Dim _OrderInRowsCollection As New XPCollection(Of OrderInRows)(_ocur.Session, CriteriaOperator.Parse("Products=? AND OrderInHeader.Customers=?", _ProductsGantRows.Products, _ProductsGantRows.Customers)) - - If _OrderInRowsCollection.Count > 0 Then - For Each _OrderInRows As OrderInRows In _OrderInRowsCollection - Dim _ProductsGantRowsBar As New ProductsGantRowsBar(_ocur.Session) - With _ProductsGantRowsBar - .ProductsGantRows = _ProductsGantRows - .FromDate = New Date(_OrderInRows.OrderInHeader.DateExecution.Year, _OrderInRows.OrderInHeader.DateExecution.Month, _OrderInRows.OrderInHeader.DateExecution.Day, 0, 0, 0) - .ToDate = New Date(_OrderInRows.OrderInHeader.DateExecution.Year, _OrderInRows.OrderInHeader.DateExecution.Month, _OrderInRows.OrderInHeader.DateExecution.Day, 23, 59, 59) - .BarType = eBarType.eOrdered - .Caption = String.Format("{0}", _OrderInRows.QTT) - End With - Next - End If - Next - _ocur.CommitChanges() - Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain"))) - Finally - RaiseEvent FinalWork() - GLOBAL_HAS_Audit = True - End Try - End Sub - - Private Sub aProductsGant_UpdateProductsGantRows_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aProductsGant_UpdateProductsGantRows.Execute - Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace) - Dim _uow As New UnitOfWork(_ocur.Session.DataLayer) - Dim _ProductsGant As ProductsGant = TryCast(View.SelectedObjects(0), ProductsGant) - - Dim InvoiceRowsXPQ As New XPQuery(Of InvoiceRows)(_ocur.Session) - Dim IRXPQ = From _InvoiceRowsXPQ In InvoiceRowsXPQ - Where _InvoiceRowsXPQ.OrderInRows IsNot Nothing And - _InvoiceRowsXPQ.OrderInRows.Products IsNot Nothing And - _InvoiceRowsXPQ.InvoiceHeader.IsStorno = False And - String.IsNullOrEmpty(_InvoiceRowsXPQ.InvoiceHeader.DocumentNumber) = False And - _InvoiceRowsXPQ.InvoiceHeader IsNot Nothing And - _InvoiceRowsXPQ.InvoiceHeader.IsEditable = False And - _InvoiceRowsXPQ.InvoiceHeader.CustomersFrom.Oid = _ProductsGant.CustomersFrom.Oid - Group _InvoiceRowsXPQ By _InvoiceRowsXPQ.InvoiceHeader.Customers, - _InvoiceRowsXPQ.OrderInRows.Products Into g = Group - Select New With {Key .Customers = Customers, - Key .Products = Products} - - ' _InvoiceRowsXPQ.InvoiceHeader.DateExecution.Date > #7/1/2013# - Try - GLOBAL_HAS_Audit = False - RaiseEvent InitWork(1, 1, IRXPQ.Count) - For Each item In IRXPQ - RaiseEvent DoWork() - Dim _ProductsGantRows As ProductsGantRows = _ocur.FindObject(Of ProductsGantRows)(CriteriaOperator.Parse("ProductsGant=? AND Customers=? AND Products=?", _ProductsGant, item.Customers, item.Products)) - - If _ProductsGantRows Is Nothing Then - _ProductsGantRows = New ProductsGantRows(_ocur.Session) - With _ProductsGantRows - .ProductsGant = _ProductsGant - .Customers = item.Customers - .Products = item.Products - .CalculatedRotation = CountLast16Week(item.Products.Oid.ToString, item.Customers.Oid.ToString) - .ManualRotation = 0 - End With - End If - - 'Számlázott mennyiségekhez ProductsGantRowsBar - Dim _InvoiceRows_Collection As New XPCollection(Of InvoiceRows)(_ocur.Session, CriteriaOperator.Parse("InvoiceHeader.Customers=? AND OrderInRows.Products=? AND InvoiceHeader.IsEditable=False AND " + - "InvoiceHeader.IsStorno=False AND (IsNull(InvoiceHeader.DocumentNumber)=False OR InvoiceHeader.DocumentNumber<>'')", item.Customers, item.Products)) - If _InvoiceRows_Collection.Count > 0 Then - _InvoiceRows_Collection.Sorting.Add(New SortProperty("DateExecution", DB.SortingDirection.Ascending)) - For Each _InvoiceRows As InvoiceRows In _InvoiceRows_Collection - Dim _FromDate As New Date(_InvoiceRows.InvoiceHeader.DateExecution.Year, _InvoiceRows.InvoiceHeader.DateExecution.Month, _InvoiceRows.InvoiceHeader.DateExecution.Day, 0, 0, 0) - Dim _ToDate = New Date(_InvoiceRows.InvoiceHeader.DateExecution.Year, _InvoiceRows.InvoiceHeader.DateExecution.Month, _InvoiceRows.InvoiceHeader.DateExecution.Day, 23, 59, 59) - - Dim _ProductsGantRowsBar_InvoiceRows As ProductsGantRowsBar = _ocur.FindObject(Of ProductsGantRowsBar)(CriteriaOperator.Parse("ProductsGantRows=? AND FromDate=? AND ToDate=? AND BarType=0", - _ProductsGantRows, _FromDate, _ToDate)) - If _ProductsGantRowsBar_InvoiceRows Is Nothing Then - _ProductsGantRowsBar_InvoiceRows = New ProductsGantRowsBar(_ocur.Session) - With _ProductsGantRowsBar_InvoiceRows - .ProductsGantRows = _ProductsGantRows - .FromDate = _FromDate - .ToDate = _ToDate - .BarType = eBarType.eAccounted - .Caption = _InvoiceRows.QTT - End With - End If - - Next - End If - - - 'Adott pillanatban leadott rendelés érkezése - dinamikos cucc, frissítésnél ezeket update! - Dim _CustomersOrderPriority_Collection As New XPCollection(Of CustomersOrderPriority)(_ocur.Session, CriteriaOperator.Parse("Products=?", item.Products)) - - If _CustomersOrderPriority_Collection.Count > 0 Then - _CustomersOrderPriority_Collection.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) - - Dim _ProductsGantRowsBar_OrderArrive As ProductsGantRowsBar = _ocur.FindObject(Of ProductsGantRowsBar)(CriteriaOperator.Parse("ProductsGantRows=? AND BarType=3", _ProductsGantRows)) - If _ProductsGantRowsBar_OrderArrive Is Nothing Then - _ProductsGantRowsBar_OrderArrive = New ProductsGantRowsBar(_ocur.Session) - With _ProductsGantRowsBar_OrderArrive - .ProductsGantRows = _ProductsGantRows - .FromDate = GetSQLTime(_ocur.Session).Date - If _CustomersOrderPriority_Collection(0).DeadlineWeek = 0 Then - .ToDate = .FromDate.AddDays(7) - Else - .ToDate = .FromDate.AddDays(_CustomersOrderPriority_Collection(0).DeadlineWeek * 7) - End If - .BarType = eBarType.eOrderArrive - End With - End If - - End If - - 'Jelentett készlet - Dim _ProductsGantCustomersReport_Collection As New XPCollection(Of ProductsGantCustomersReport)(_ocur.Session, CriteriaOperator.Parse("Customers=? AND Products=?", item.Customers, item.Products)) - - If _ProductsGantCustomersReport_Collection.Count > 0 Then - For Each _ProductsGantCustomersReport As ProductsGantCustomersReport In _ProductsGantCustomersReport_Collection - - Dim _FromDate As Date = _ProductsGantCustomersReport.DateExecution - _ProductsGantRows.Products.CustomersOrderPriority.Sorting.Add(New SortProperty("RowIndex", DB.SortingDirection.Ascending)) - - Dim _ToDate As Date - If _ProductsGantRows.Products.CustomersOrderPriority.Count > 0 Then - _ToDate = _FromDate.AddDays(_ProductsGantRows.Products.CustomersOrderPriority(0).DeadlineWeek * 7) - Else - _ToDate = _FromDate.Date - End If - - - Dim _ProductsGantRowsBar_Reported As ProductsGantRowsBar = _ocur.FindObject(Of ProductsGantRowsBar)(CriteriaOperator.Parse("ProductsGantRows=? AND FromDate=? AND ToDate=? AND BarType=2", - _ProductsGantRows, _FromDate, _ToDate)) - If _ProductsGantRowsBar_Reported Is Nothing Then - _ProductsGantRowsBar_Reported = New ProductsGantRowsBar(_ocur.Session) - With _ProductsGantRowsBar_Reported - .ProductsGantRows = _ProductsGantRows - .FromDate = _FromDate - .ToDate = _ToDate - .Caption = _ProductsGantCustomersReport.QTT.ToString - .BarType = eBarType.eReported - End With - End If - - Next - End If - - - 'Rendelések - Dim _OrderInRowsCollection As New XPCollection(Of OrderInRows)(_ocur.Session, CriteriaOperator.Parse("Products=? AND OrderInHeader.Customers=?", _ProductsGantRows.Products, _ProductsGantRows.Customers)) - - If _OrderInRowsCollection.Count > 0 Then - For Each _OrderInRows As OrderInRows In _OrderInRowsCollection - Dim _FromDate As New Date(_OrderInRows.OrderInHeader.DateExecution.Year, _OrderInRows.OrderInHeader.DateExecution.Month, _OrderInRows.OrderInHeader.DateExecution.Day, 0, 0, 0) - Dim _ToDate As New Date(_OrderInRows.OrderInHeader.DateExecution.Year, _OrderInRows.OrderInHeader.DateExecution.Month, _OrderInRows.OrderInHeader.DateExecution.Day, 23, 59, 59) - - Dim _ProductsGantRowsBar As ProductsGantRowsBar = _ocur.FindObject(Of ProductsGantRowsBar)(CriteriaOperator.Parse("ProductsGantRows=? AND FromDate=? AND ToDate=? AND BarType=1", - _ProductsGantRows, _FromDate, _ToDate)) - - If _ProductsGantRowsBar Is Nothing Then - _ProductsGantRowsBar = New ProductsGantRowsBar(_ocur.Session) - With _ProductsGantRowsBar - .ProductsGantRows = _ProductsGantRows - .FromDate = New Date(_OrderInRows.OrderInHeader.DateExecution.Year, _OrderInRows.OrderInHeader.DateExecution.Month, _OrderInRows.OrderInHeader.DateExecution.Day, 0, 0, 0) - .ToDate = New Date(_OrderInRows.OrderInHeader.DateExecution.Year, _OrderInRows.OrderInHeader.DateExecution.Month, _OrderInRows.OrderInHeader.DateExecution.Day, 23, 59, 59) - .BarType = eBarType.eOrdered - .Caption = String.Format("{0}", _OrderInRows.QTT) - End With - End If - - Next - End If - Next - _ocur.CommitChanges() - Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain"))) - Finally - RaiseEvent FinalWork() - GLOBAL_HAS_Audit = True - End Try - End Sub End Class diff --git a/Nuvolar.Module/BusinessObjects/SIS/App_Code/GeneralFunction.vb b/Nuvolar.Module/BusinessObjects/SIS/App_Code/GeneralFunction.vb index ea2fa0d..85a6438 100644 --- a/Nuvolar.Module/BusinessObjects/SIS/App_Code/GeneralFunction.vb +++ b/Nuvolar.Module/BusinessObjects/SIS/App_Code/GeneralFunction.vb @@ -255,7 +255,7 @@ Public Module GeneralFunction l = Math.Round(Math.Abs(l), 2, MidpointRounding.AwayFromZero) VégStr = "" - SzámSzöveg = Format(l, "000000000000.0") + SzámSzöveg = Format(l, "000000000000.00") seged = Mid(SzámSzöveg, 1, 3) seged = Change3Value(seged) @@ -285,7 +285,7 @@ Public Module GeneralFunction seged = Change3Value(seged) VégStr = VégStr & seged seged = Mid(SzámSzöveg, 14, 1) - VégStr = VégStr & " " & seged & "0/100" + VégStr = VégStr & " " & seged & "/100" Return UCase$(VégStr) End Function diff --git a/Nuvolar.Module/Model.DesignedDiffs.Localization.hu.xafml b/Nuvolar.Module/Model.DesignedDiffs.Localization.hu.xafml index 2ea7652..387ea30 100644 --- a/Nuvolar.Module/Model.DesignedDiffs.Localization.hu.xafml +++ b/Nuvolar.Module/Model.DesignedDiffs.Localization.hu.xafml @@ -6393,12 +6393,15 @@ - + + + + @@ -9364,6 +9367,7 @@ + diff --git a/Nuvolar.Module/Model.DesignedDiffs.xafml b/Nuvolar.Module/Model.DesignedDiffs.xafml index 2eb518c..cbfb550 100644 --- a/Nuvolar.Module/Model.DesignedDiffs.xafml +++ b/Nuvolar.Module/Model.DesignedDiffs.xafml @@ -2919,7 +2919,15 @@ - + + + + + + + + + @@ -4418,9 +4426,14 @@ - - - + + + + + + + + @@ -24217,6 +24230,14 @@ + + + + + + + +