From c4223f324dfddf451a41eaa115d5729b13d003a0 Mon Sep 17 00:00:00 2001 From: ivanszabo Date: Sun, 22 Apr 2018 23:46:07 +0200 Subject: [PATCH] =?UTF-8?q?Na=20MOST=20J=C3=93=20!!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Orders/OrderIn/OrderIn_VC.Designer.cs | 36 ++++++++++++++-- .../Orders/OrderIn/OrderIn_VC.cs | 43 ++++++++++++++++--- .../Orders/OrderIn/OrderIn_VC.resx | 6 +++ .../Model.DesignedDiffs.Localization.hu.xafml | 2 + .../Model.DesignedDiffs.xafml | 6 ++- .../Properties/licenses.licx | 2 + .../Orders/OrdersIn/OrderInVC.vb | 4 +- 7 files changed, 85 insertions(+), 14 deletions(-) diff --git a/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.Designer.cs b/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.Designer.cs index fdd9a13..6370022 100644 --- a/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.Designer.cs +++ b/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.Designer.cs @@ -28,14 +28,44 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + this.aPrintLastInvoice = new DevExpress.ExpressApp.Actions.SimpleAction(this.components); + this.aPrintLastDeliveryNoteOut = new DevExpress.ExpressApp.Actions.SimpleAction(this.components); // - // aOrderInStorageOutDeliveryNoteOutInvoice + // aPrintLastInvoice // - this.aOrderInStorageOutDeliveryNoteOutInvoice.CustomizePopupWindowParams += new DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventHandler(this.InvoiceCustomization); - this.aOrderInStorageOutDeliveryNoteOutInvoice.Execute += new DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventHandler(this.aOrderInStorageOutDeliveryNoteOutInvoice_Execute); + this.aPrintLastInvoice.Caption = "aPrint Last Invoice"; + this.aPrintLastInvoice.ConfirmationMessage = null; + this.aPrintLastInvoice.Id = "aPrintLastInvoice"; + this.aPrintLastInvoice.TargetObjectType = typeof(Nuvolar.Module.OrderInHeader); + this.aPrintLastInvoice.TargetViewNesting = DevExpress.ExpressApp.Nesting.Root; + this.aPrintLastInvoice.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView; + this.aPrintLastInvoice.ToolTip = null; + this.aPrintLastInvoice.TypeOfView = typeof(DevExpress.ExpressApp.DetailView); + this.aPrintLastInvoice.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aPrintLastInvoice_Execute); + // + // aPrintLastDeliveryNoteOut + // + this.aPrintLastDeliveryNoteOut.Caption = "aPrint Last Delivery Note Out"; + this.aPrintLastDeliveryNoteOut.ConfirmationMessage = null; + this.aPrintLastDeliveryNoteOut.Id = "aPrintLastDeliveryNoteOut"; + this.aPrintLastDeliveryNoteOut.TargetObjectType = typeof(Nuvolar.Module.OrderInHeader); + this.aPrintLastDeliveryNoteOut.TargetViewNesting = DevExpress.ExpressApp.Nesting.Root; + this.aPrintLastDeliveryNoteOut.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView; + this.aPrintLastDeliveryNoteOut.ToolTip = null; + this.aPrintLastDeliveryNoteOut.TypeOfView = typeof(DevExpress.ExpressApp.DetailView); + this.aPrintLastDeliveryNoteOut.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aPrintLastDeliveryNoteOut_Execute); + // + // OrderIn_VC + // + this.Actions.Add(this.aPrintLastInvoice); + this.Actions.Add(this.aPrintLastDeliveryNoteOut); } #endregion + + private DevExpress.ExpressApp.Actions.SimpleAction aPrintLastInvoice; + private DevExpress.ExpressApp.Actions.SimpleAction aPrintLastDeliveryNoteOut; } } diff --git a/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.cs b/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.cs index 67243ec..ea88d40 100644 --- a/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.cs +++ b/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.cs @@ -11,8 +11,10 @@ using DevExpress.ExpressApp.Model.NodeGenerators; using DevExpress.ExpressApp.SystemModule; using DevExpress.ExpressApp.Templates; using DevExpress.ExpressApp.Utils; +using DevExpress.ExpressApp.Xpo; using DevExpress.Persistent.Base; using DevExpress.Persistent.Validation; +using DevExpress.Xpo; namespace Nuvolar.Module.CSharp { @@ -39,17 +41,44 @@ namespace Nuvolar.Module.CSharp // Unsubscribe from previously subscribed events and release other references and resources. base.OnDeactivated(); } - public override void aOrderInStorageOutDeliveryNoteOutInvoice_Execute(object sender, PopupWindowShowActionExecuteEventArgs e) - { - base.aOrderInStorageOutDeliveryNoteOutInvoice_Execute(sender, e); + private void aPrintLastInvoice_Execute(object sender, SimpleActionExecuteEventArgs e) + { + XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace; + OrderInHeader _OrderInHeader = View.SelectedObjects[0] as OrderInHeader; + + XPCollection _InvoiceRows_Collection = new XPCollection(_ocur.Session, + CriteriaOperator.Parse("(OrderInRows.OrderInHeader = ? or OrderInRowsOther.OrderInHeader = ?) and IsNull(InvoiceHeader.GCRecord)=True and IsNull(InvoiceHeader)=False", + _OrderInHeader.Oid, _OrderInHeader.Oid)); + + if (_InvoiceRows_Collection.Count > 0) + { + _InvoiceRows_Collection.Sorting.Add(new SortProperty("InvoiceHeader.DateCreated", DevExpress.Xpo.DB.SortingDirection.Descending)); + _InvoiceRows_Collection.Sorting.Add(new SortProperty("InvoiceHeader.DocumentNumber", DevExpress.Xpo.DB.SortingDirection.Ascending)); + + InvoiceHeader _InvoiceHeader = _InvoiceRows_Collection[0].InvoiceHeader; + XAFPrintHelper _XAFPrintHelper = new XAFPrintHelper(_ocur, Frame, _InvoiceHeader.InvoiceType.ReportDataV2, CriteriaOperator.Parse("InvoiceHeader.Oid = ?", _InvoiceHeader.Oid)); + _XAFPrintHelper.ShowPreviewV2(); + } } - - public override void InvoiceCustomization(object sender, CustomizePopupWindowParamsEventArgs e) + private void aPrintLastDeliveryNoteOut_Execute(object sender, SimpleActionExecuteEventArgs e) { - base.InvoiceCustomization(sender, e); - } + XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace; + OrderInHeader _OrderInHeader = View.SelectedObjects[0] as OrderInHeader; + XPCollection _DeliveryNoteOutRows_Collection = new XPCollection(_ocur.Session, + CriteriaOperator.Parse("StorageOutRowsInRows.StorageOutRows.OrderInRows.OrderInHeader.Oid = ?",_OrderInHeader.Oid)); + + if (_DeliveryNoteOutRows_Collection.Count>0) + { + _DeliveryNoteOutRows_Collection.Sorting.Add(new SortProperty("DeliveryNoteOutHeader.DateCreated", DevExpress.Xpo.DB.SortingDirection.Descending)); + _DeliveryNoteOutRows_Collection.Sorting.Add(new SortProperty("DeliveryNoteOutHeader.DocumentNumber", DevExpress.Xpo.DB.SortingDirection.Ascending)); + + DeliveryNoteOutHeader _DeliveryNoteOutHeader = _DeliveryNoteOutRows_Collection[0].DeliveryNoteOutHeader; + XAFPrintHelper _XAFPrintHelper = new XAFPrintHelper(_ocur, Frame, _DeliveryNoteOutHeader.DeliveryNoteOutType.ReportDataV2, CriteriaOperator.Parse("DeliveryNoteOutHeader.Oid = ?", _DeliveryNoteOutHeader.Oid)); + _XAFPrintHelper.ShowPreviewV2(); + } + } } } diff --git a/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.resx b/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.resx index cc86294..286a673 100644 --- a/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.resx +++ b/Nuvolar.Module.CSharp/BusinessObjects/Business/BusinessTransactions/Orders/OrderIn/OrderIn_VC.resx @@ -120,6 +120,12 @@ 17, 17 + + 310, 17 + + + 453, 17 + False diff --git a/Nuvolar.Module.CSharp/Model.DesignedDiffs.Localization.hu.xafml b/Nuvolar.Module.CSharp/Model.DesignedDiffs.Localization.hu.xafml index 0acaf05..1deab27 100644 --- a/Nuvolar.Module.CSharp/Model.DesignedDiffs.Localization.hu.xafml +++ b/Nuvolar.Module.CSharp/Model.DesignedDiffs.Localization.hu.xafml @@ -8,6 +8,8 @@ + + diff --git a/Nuvolar.Module.CSharp/Model.DesignedDiffs.xafml b/Nuvolar.Module.CSharp/Model.DesignedDiffs.xafml index e6d4c6b..88be985 100644 --- a/Nuvolar.Module.CSharp/Model.DesignedDiffs.xafml +++ b/Nuvolar.Module.CSharp/Model.DesignedDiffs.xafml @@ -10,6 +10,8 @@ + + @@ -79,10 +81,10 @@ - + - + diff --git a/Nuvolar.Module.CSharp/Properties/licenses.licx b/Nuvolar.Module.CSharp/Properties/licenses.licx index eab008c..f1ab4b8 100644 --- a/Nuvolar.Module.CSharp/Properties/licenses.licx +++ b/Nuvolar.Module.CSharp/Properties/licenses.licx @@ -1 +1,3 @@ DevExpress.ExpressApp.ViewController, DevExpress.ExpressApp.v17.2, Version=17.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + +DevExpress.ExpressApp.SystemModule.SystemModule, DevExpress.ExpressApp.v17.2, Version=17.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a \ No newline at end of file diff --git a/Nuvolar.Module/BusinessObjects/Business/BusinessTransactions/Orders/OrdersIn/OrderInVC.vb b/Nuvolar.Module/BusinessObjects/Business/BusinessTransactions/Orders/OrdersIn/OrderInVC.vb index c00e531..c74d2f5 100644 --- a/Nuvolar.Module/BusinessObjects/Business/BusinessTransactions/Orders/OrdersIn/OrderInVC.vb +++ b/Nuvolar.Module/BusinessObjects/Business/BusinessTransactions/Orders/OrdersIn/OrderInVC.vb @@ -1928,7 +1928,7 @@ CheckError: #End Region #Region "Transactions" '// Invoice customization - Public Overridable Sub InvoiceCustomization(sender As Object, e As CustomizePopupWindowParamsEventArgs) _ + Private Sub InvoiceCustomization(sender As Object, e As CustomizePopupWindowParamsEventArgs) _ Handles aORI_Create_DeliveryInvoice.CustomizePopupWindowParams, aOrderInStorageOutDeliveryNoteOutInvoice.CustomizePopupWindowParams, aORI_Create_Invoice.CustomizePopupWindowParams, @@ -2370,7 +2370,7 @@ CheckError: End Try End Sub - Public Overridable Sub aOrderInStorageOutDeliveryNoteOutInvoice_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aOrderInStorageOutDeliveryNoteOutInvoice.Execute + Private Sub aOrderInStorageOutDeliveryNoteOutInvoice_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aOrderInStorageOutDeliveryNoteOutInvoice.Execute '// Kitárolás + kiszállítás + számla egyben Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace Dim _uow_lock As New UnitOfWork(_onew.Session.DataLayer)