First create solution

This commit is contained in:
2017-03-08 11:21:27 +01:00
commit a2fb86bacf
5508 changed files with 1082238 additions and 0 deletions
@@ -0,0 +1,148 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
Imports DevExpress.ExpressApp.ConditionalAppearance
'CreditNoteRows
<DefaultClassOptions()> _
<NavigationItem(False)> _
<CreatableItem(False)> _
<Appearance("InvoiceCreditNoteHeader - Disable UserCreated all time", AppearanceItemType.ViewItem, "1=1", TargetItems:="UserCreated", Enabled:=False)> _
<Appearance("InvoiceCreditNoteHeader - Disable ObjectCreated all time", AppearanceItemType.ViewItem, "1=1", TargetItems:="ObjectCreated", Enabled:=False)> _
<Appearance("InvoiceCreditNoteHeader - Disable CustomersFrom when not empty", AppearanceItemType.ViewItem, "IsNull(CustomersFrom)=False", TargetItems:="CustomersFrom", Enabled:=False)> _
<Appearance("InvoiceCreditNoteHeader - Disable Customers when not empty", AppearanceItemType.ViewItem, "IsNull(Customers)=False", TargetItems:="Customers", Enabled:=False)> _
<Appearance("InvoiceCreditNoteHeader - Hide Item2 when IsNewObject", AppearanceItemType.LayoutItem, "IsNull(ObjectCreated) Or IsNull(UserCreated)", TargetItems:="Item2", visibility:=Editors.ViewItemVisibility.Hide)> _
Public Class InvoiceCreditNoteHeader
Inherits BaseObject
Private _CustomersFrom As CustomersFrom
Private _Customers As Customers
Private _Storage As Storage
Private _StorageMoveType As StorageMoveType
Private _DateExecution As Date
Private _ObjectCreated As Date
Private _UserCreated As User
Private _PaymentOption As PaymentOption
Private _DatePayment As Date
Private _Description As String
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
DateExecution = GetSQLTime(Session)
End Sub
Protected Overrides Sub OnSaving()
MyBase.OnSaving()
If Session.IsNewObject(Me) Then
ObjectCreated = GetSQLTime(Session)
UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
End If
End Sub
<RuleRequiredField("InvoiceCreditNoteHeader - CustomersFrom", DefaultContexts.Save)> _
Property CustomersFrom As CustomersFrom
Get
Return _CustomersFrom
End Get
Set(value As CustomersFrom)
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
End Set
End Property
<RuleRequiredField("InvoiceCreditNoteHeader - Customers", DefaultContexts.Save)> _
Property Customers As Customers
Get
Return _Customers
End Get
Set(value As Customers)
SetPropertyValue("Customers", _Customers, value)
End Set
End Property
<RuleRequiredField("InvoiceCreditNoteHeader - Storage", DefaultContexts.Save)> _
Property Storage As Storage
Get
Return _Storage
End Get
Set(value As Storage)
SetPropertyValue("Storage", _Storage, value)
End Set
End Property
<RuleRequiredField("InvoiceCreditNoteHeader-StorageMoveType", DefaultContexts.Save)>
<ImmediatePostData(True), DataSourceCriteria("Storage='@This.Storage' AND MoveType=8")>
Property StorageMoveType As StorageMoveType
Get
Return _StorageMoveType
End Get
Set(value As StorageMoveType)
SetPropertyValue("StorageMoveType", _StorageMoveType, value)
End Set
End Property
Property DateExecution As Date
Get
Return _DateExecution
End Get
Set(value As Date)
SetPropertyValue("DateExecution", _DateExecution, value)
End Set
End Property
Property ObjectCreated As Date
Get
Return _ObjectCreated
End Get
Set(value As Date)
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
End Set
End Property
Property UserCreated As User
Get
Return _UserCreated
End Get
Set(value As User)
SetPropertyValue("UserCreated", _UserCreated, value)
End Set
End Property
<RuleRequiredField("InvoiceCreditNoteHeader - PaymentOption", DefaultContexts.Save)> _
Property PaymentOption As PaymentOption
Get
Return _PaymentOption
End Get
Set(value As PaymentOption)
SetPropertyValue("PaymentOption", _PaymentOption, value)
End Set
End Property
Property DatePayment As Date
Get
Return _DatePayment
End Get
Set(value As Date)
SetPropertyValue("DatePayment", _DatePayment, value)
End Set
End Property
<Size(-1)> _
Property Description As String
Get
Return _Description
End Get
Set(value As String)
SetPropertyValue("Description", _Description, value)
End Set
End Property
'--==ReadOnly==--
<VisibleInListView(False)> _
<Association("InvoiceCreditNoteHeader-InvoiceCreditNoteRows", GetType(InvoiceCreditNoteRows))> _
ReadOnly Property InvoiceCreditNoteRows As XPCollection(Of InvoiceCreditNoteRows)
Get
Return GetCollection(Of InvoiceCreditNoteRows)("InvoiceCreditNoteRows")
End Get
End Property
End Class
@@ -0,0 +1,154 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NavigationItem(False)> _
<CreatableItem(False)> _
Public Class InvoiceCreditNoteRows
Inherits BaseObject
Private _InvoiceCreditNoteHeader As InvoiceCreditNoteHeader
Private _QTT As Double 'Jóváírt mennyiség
Private _PriceHUF As Double 'Jóváírás ára
Private _PriceDEV As Double
Private _SumPriceHUF As Double 'Netto sor összesen
Private _SumPriceDEV As Double
Private _SumPriceVATHUF As Double 'ÁFA sor összesen
Private _SumPriceVATDEV As Double
Private _SumPriceBruttoHUF As Double 'Brutto sor összesen
Private _SumPriceBruttoDEV As Double
Private _Description As String
Private _StorageInRows As StorageInRows 'Viszaírt betárolási sor
Private _FromInvoiceRows As InvoiceRows
Private _ToInvoiceRows As InvoiceRows
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
<Association("InvoiceCreditNoteHeader-InvoiceCreditNoteRows", GetType(InvoiceCreditNoteHeader))> _
Property InvoiceCreditNoteHeader As InvoiceCreditNoteHeader
Get
Return _InvoiceCreditNoteHeader
End Get
Set(value As InvoiceCreditNoteHeader)
SetPropertyValue("InvoiceCreditNoteHeader", _InvoiceCreditNoteHeader, value)
End Set
End Property
Property QTT As Double
Get
Return _QTT
End Get
Set(value As Double)
SetPropertyValue("QTT", _QTT, value)
End Set
End Property
Property PriceHUF As Double
Get
Return _PriceHUF
End Get
Set(value As Double)
SetPropertyValue("PriceHUF", _PriceHUF, value)
End Set
End Property
Property PriceDEV As Double
Get
Return _PriceDEV
End Get
Set(value As Double)
SetPropertyValue("PriceDEV", _PriceDEV, value)
End Set
End Property
Property SumPriceHUF As Double
Get
Return _SumPriceHUF
End Get
Set(value As Double)
SetPropertyValue("SumPriceHUF", _SumPriceHUF, value)
End Set
End Property
Property SumPriceDEV As Double
Get
Return _SumPriceDEV
End Get
Set(value As Double)
SetPropertyValue("SumPriceDEV", _SumPriceDEV, value)
End Set
End Property
Property SumPriceVATHUF As Double
Get
Return _SumPriceVATHUF
End Get
Set(value As Double)
SetPropertyValue("SumPriceVATHUF", _SumPriceVATHUF, value)
End Set
End Property
Property SumPriceVATDEV As Double
Get
Return _SumPriceVATDEV
End Get
Set(value As Double)
SetPropertyValue("SumPriceVATDEV", _SumPriceVATDEV, value)
End Set
End Property
Property SumPriceBruttoHUF As Double
Get
Return _SumPriceBruttoHUF
End Get
Set(value As Double)
SetPropertyValue("SumPriceBruttoHUF", _SumPriceBruttoHUF, value)
End Set
End Property
Property SumPriceBruttoDEV As Double
Get
Return _SumPriceBruttoDEV
End Get
Set(value As Double)
SetPropertyValue("SumPriceBruttoDEV", _SumPriceBruttoDEV, value)
End Set
End Property
<Size(-1)> _
Property Description As String
Get
Return _Description
End Get
Set(value As String)
SetPropertyValue("Description", _Description, value)
End Set
End Property
Property StorageInRows As StorageInRows
Get
Return _StorageInRows
End Get
Set(value As StorageInRows)
SetPropertyValue("StorageInRows", _StorageInRows, value)
End Set
End Property
Property FromInvoiceRows As InvoiceRows
Get
Return _FromInvoiceRows
End Get
Set(value As InvoiceRows)
SetPropertyValue("FromInvoiceRows", _FromInvoiceRows, value)
End Set
End Property
Property ToInvoiceRows As InvoiceRows
Get
Return _ToInvoiceRows
End Get
Set(value As InvoiceRows)
SetPropertyValue("ToInvoiceRows", _ToInvoiceRows, value)
End Set
End Property
End Class
@@ -0,0 +1,70 @@
Partial Class InvoiceCreditNote_VC
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
MyClass.New()
'Required for Windows.Forms Class Composition Designer support
Container.Add(Me)
End Sub
'Component overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Component Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.aInvoiceCreditNoteHeader_AddRows = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
Me.aInvoiceCreditNoteHeader_Finalize = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aInvoiceCreditNoteHeader_AddRows
'
Me.aInvoiceCreditNoteHeader_AddRows.AcceptButtonCaption = Nothing
Me.aInvoiceCreditNoteHeader_AddRows.CancelButtonCaption = Nothing
Me.aInvoiceCreditNoteHeader_AddRows.Caption = "aInvoiceCreditNoteHeader_AddRows"
Me.aInvoiceCreditNoteHeader_AddRows.Category = "ObjectsCreation"
Me.aInvoiceCreditNoteHeader_AddRows.ConfirmationMessage = Nothing
Me.aInvoiceCreditNoteHeader_AddRows.Id = "aInvoiceCreditNoteHeader_AddRows"
Me.aInvoiceCreditNoteHeader_AddRows.ImageName = Nothing
Me.aInvoiceCreditNoteHeader_AddRows.Shortcut = Nothing
Me.aInvoiceCreditNoteHeader_AddRows.Tag = Nothing
Me.aInvoiceCreditNoteHeader_AddRows.TargetObjectsCriteria = Nothing
Me.aInvoiceCreditNoteHeader_AddRows.TargetObjectType = GetType(Nuvolar.[Module].InvoiceCreditNoteRows)
Me.aInvoiceCreditNoteHeader_AddRows.TargetViewId = "InvoiceCreditNoteHeader_InvoiceCreditNoteRows_ListView"
Me.aInvoiceCreditNoteHeader_AddRows.ToolTip = Nothing
Me.aInvoiceCreditNoteHeader_AddRows.TypeOfView = GetType(DevExpress.ExpressApp.View)
'
'aInvoiceCreditNoteHeader_Finalize
'
Me.aInvoiceCreditNoteHeader_Finalize.Caption = "aInvoiceCreditNoteHeader_Finalize"
Me.aInvoiceCreditNoteHeader_Finalize.Category = "ObjectsCreation"
Me.aInvoiceCreditNoteHeader_Finalize.ConfirmationMessage = "Are you sure ?"
Me.aInvoiceCreditNoteHeader_Finalize.Id = "aInvoiceCreditNoteHeader_Finalize"
Me.aInvoiceCreditNoteHeader_Finalize.ImageName = Nothing
Me.aInvoiceCreditNoteHeader_Finalize.Shortcut = Nothing
Me.aInvoiceCreditNoteHeader_Finalize.Tag = Nothing
Me.aInvoiceCreditNoteHeader_Finalize.TargetObjectsCriteria = Nothing
Me.aInvoiceCreditNoteHeader_Finalize.TargetObjectType = GetType(Nuvolar.[Module].InvoiceCreditNoteHeader)
Me.aInvoiceCreditNoteHeader_Finalize.TargetViewId = Nothing
Me.aInvoiceCreditNoteHeader_Finalize.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
Me.aInvoiceCreditNoteHeader_Finalize.ToolTip = Nothing
Me.aInvoiceCreditNoteHeader_Finalize.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
End Sub
Friend WithEvents aInvoiceCreditNoteHeader_AddRows As DevExpress.ExpressApp.Actions.PopupWindowShowAction
Friend WithEvents aInvoiceCreditNoteHeader_Finalize As DevExpress.ExpressApp.Actions.SimpleAction
End Class
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="aInvoiceCreditNoteHeader_AddRows.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="aInvoiceCreditNoteHeader_Finalize.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>269, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,391 @@
Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.ExpressApp.CloneObject
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.ExpressApp.Utils
Public Class InvoiceCreditNote_VC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
#Region "Overrides"
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Id = "InvoiceCreditNoteHeader_DetailView" Then
Frame.GetController(Of LinkUnlinkController)().Active.SetItemValue("", False)
Frame.GetController(Of DeleteObjectsViewController)().Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
Frame.GetController(Of NewObjectViewController)().Active.SetItemValue("", False)
End If
If View.Id = "InvoiceCreditNoteHeader_InvoiceCreditNoteRows_ListView" Then
Frame.GetController(Of LinkUnlinkController)().Active.SetItemValue("", False)
Frame.GetController(Of DeleteObjectsViewController)().Active.SetItemValue("", False)
Frame.GetController(Of CloneObjectViewController)().Active.SetItemValue("", False)
Frame.GetController(Of NewObjectViewController)().Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", False)
End If
If View.Id = "InvoiceRows_ListView_CreditNote" Then
AddHandler Frame.GetController(Of DevExpress.ExpressApp.SystemModule.DialogController)().AcceptAction.Executing, AddressOf InvoiceRows_ListView_CreditNote_AcceptAction_Executing
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
If View.Id = "InvoiceCreditNoteHeader_DetailView" Then
Frame.GetController(Of LinkUnlinkController)().Active.SetItemValue("", True)
Frame.GetController(Of DeleteObjectsViewController)().Active.SetItemValue("", True)
Frame.GetController(Of CloneObjectViewController)().Active.SetItemValue("", True)
Frame.GetController(Of NewObjectViewController)().Active.SetItemValue("", True)
End If
If View.Id = "InvoiceCreditNoteHeader_InvoiceCreditNoteRows_ListView" Then
Frame.GetController(Of LinkUnlinkController)().Active.SetItemValue("", True)
Frame.GetController(Of DeleteObjectsViewController)().Active.SetItemValue("", True)
Frame.GetController(Of CloneObjectViewController)().Active.SetItemValue("", True)
Frame.GetController(Of NewObjectViewController)().Active.SetItemValue("", True)
End If
End Sub
#End Region
Private Sub aInvoiceCreditNoteHeader_AddRows_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aInvoiceCreditNoteHeader_AddRows.CustomizePopupWindowParams
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _CustomersFrom As CustomersFrom = _onew.GetObjectByKey(Of CustomersFrom)(TryCast(TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject, InvoiceCreditNoteHeader).CustomersFrom.Oid)
Dim _Customers As Customers = _onew.GetObjectByKey(Of Customers)(TryCast(TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject, InvoiceCreditNoteHeader).Customers.Oid)
Dim _InvoiceRows_CollectionSource As New CollectionSource(_onew, GetType(InvoiceRows))
_InvoiceRows_CollectionSource.BeginUpdateCriteria()
_InvoiceRows_CollectionSource.Criteria.Clear()
_InvoiceRows_CollectionSource.Criteria.Add("First", CriteriaOperator.Parse("InvoiceHeader.IsStorno=False AND InvoiceHeader.IsEditable=False AND IsNull(InvoiceHeader.GCRecord)=True AND InvoiceHeader.DocumentNumber<>'' AND IsNull(InvoiceHeader)=False AND InvoiceHeader.CustomersFrom=? AND InvoiceHeader.Customers=? AND IsNull(OrderInRows)=False", _
_CustomersFrom, _Customers))
_InvoiceRows_CollectionSource.EndUpdateCriteria()
e.View = Application.CreateListView("InvoiceRows_ListView_CreditNote", _InvoiceRows_CollectionSource, True)
End Sub
Private Sub aInvoiceCreditNoteHeader_AddRows_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aInvoiceCreditNoteHeader_AddRows.Execute
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _InvoiceCreditNoteHeader As InvoiceCreditNoteHeader = TryCast(TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject, InvoiceCreditNoteHeader)
If _InvoiceCreditNoteHeader IsNot Nothing Then
For Each _InvoiceRows As InvoiceRows In TryCast(e.PopupWindow.View, ListView).CollectionSource.Collection
If _InvoiceRows.QTT_Will > 0 Then
Dim _InvoiceCreditNoteRows As InvoiceCreditNoteRows = _ocur.FindObject(Of InvoiceCreditNoteRows)(CriteriaOperator.Parse("InvoiceCreditNoteHeader=? AND FromInvoiceRows=?", _
_InvoiceCreditNoteHeader, _ocur.GetObject(_InvoiceRows)))
If _InvoiceCreditNoteRows Is Nothing Then
_InvoiceCreditNoteRows = New InvoiceCreditNoteRows(_ocur.Session)
With _InvoiceCreditNoteRows
.InvoiceCreditNoteHeader = _InvoiceCreditNoteHeader
.QTT = _InvoiceRows.QTT_Will
.PriceHUF = _InvoiceRows.PriceHUF
.PriceDEV = _InvoiceRows.PriceDEV
.SumPriceHUF = Math.Round(.QTT * .PriceHUF, 0, MidpointRounding.AwayFromZero)
.SumPriceDEV = Math.Round(.QTT * .PriceDEV, 2, MidpointRounding.AwayFromZero)
.SumPriceVATHUF = Math.Round(.SumPriceHUF * _InvoiceRows.VAT.KeyValue, 0, MidpointRounding.AwayFromZero)
.SumPriceVATDEV = Math.Round(.SumPriceDEV * _InvoiceRows.VAT.KeyValue, 2, MidpointRounding.AwayFromZero)
.SumPriceBruttoHUF = .SumPriceHUF + .SumPriceVATHUF
.SumPriceBruttoDEV = .SumPriceDEV + .SumPriceVATDEV
.Description = _InvoiceRows.Description
.FromInvoiceRows = _ocur.GetObject(_InvoiceRows)
End With
Else
With _InvoiceCreditNoteRows
.QTT += _InvoiceRows.QTT_Will
.SumPriceHUF = Math.Round(.QTT * .PriceHUF, 0, MidpointRounding.AwayFromZero)
.SumPriceDEV = Math.Round(.QTT * .PriceDEV, 2, MidpointRounding.AwayFromZero)
.SumPriceVATHUF = Math.Round(.SumPriceHUF * _InvoiceRows.VAT.KeyValue, 0, MidpointRounding.AwayFromZero)
.SumPriceVATDEV = Math.Round(.SumPriceDEV * _InvoiceRows.VAT.KeyValue, 2, MidpointRounding.AwayFromZero)
.SumPriceBruttoHUF = .SumPriceHUF + .SumPriceVATHUF
.SumPriceBruttoDEV = .SumPriceDEV + .SumPriceVATDEV
End With
End If
End If
Next
_ocur.CommitChanges()
End If
End Sub
Private Sub aInvoiceCreditNoteHeader_Finalize_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aInvoiceCreditNoteHeader_Finalize.Execute
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _uow_lock As New UnitOfWork(_onew.Session.DataLayer)
Dim _User As User = _onew.GetObject(TryCast(SecuritySystem.CurrentUser, User))
Try
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _InvoiceCreditNoteHeader As InvoiceCreditNoteHeader = TryCast(View.SelectedObjects(0), InvoiceCreditNoteHeader)
If _InvoiceCreditNoteHeader IsNot Nothing And _InvoiceCreditNoteHeader.InvoiceCreditNoteRows.Count > 0 Then
If Not LockingModule.LockObject(_uow_lock, GetType(StorageComputed), "-", _User) Then
Dim _LockingObject As LockingObject = _onew.FindObject(Of LockingObject)(CriteriaOperator.Parse("TableName=?", GetType(StorageComputed).Name + "-" + "-"))
Dim _Prompt As String = DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions\StorageComputed", "CanNotStorageInByLocking")
Dim _Title As String = DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxError")
MsgBox(String.Format(_Prompt, _LockingObject.User.FullName, _LockingObject.ObjectCreated), MsgBoxStyle.Information + MsgBoxStyle.OkOnly, _Title)
Exit Sub
Else
'Új számlák darabszámának meghatározása OrderInParameters alapján
Dim _OrderInParameters_Array As New ArrayList
Dim _InvoiceHeader_Credited_Collection As New ArrayList
For Each _InvoiceCreditNoteRows As InvoiceCreditNoteRows In _InvoiceCreditNoteHeader.InvoiceCreditNoteRows
If _OrderInParameters_Array.Count = 0 Then
_OrderInParameters_Array.Add(_InvoiceCreditNoteRows.FromInvoiceRows.OrderInRows.OrderInHeader.OrderInParameters)
Else
Dim _Need As Boolean = True
For Each _OrderInParameters As OrderInParameters In _OrderInParameters_Array
If _OrderInParameters.Oid = _InvoiceCreditNoteRows.FromInvoiceRows.OrderInRows.OrderInHeader.OrderInParameters.Oid Then
_Need = False
Exit For
End If
Next
If _Need Then
_OrderInParameters_Array.Add(_InvoiceCreditNoteRows.FromInvoiceRows.OrderInRows.OrderInHeader.OrderInParameters)
End If
End If
Next
If _OrderInParameters_Array.Count > 0 Then
For Each _OrderInParameters As OrderInParameters In _OrderInParameters_Array
Dim _InvoiceHeader_Credited As New InvoiceHeader(_ocur.Session)
With _InvoiceHeader_Credited
.InvoiceType = _OrderInParameters.InvoiceType
.CustomersFrom = _InvoiceCreditNoteHeader.CustomersFrom
.Customers = _InvoiceCreditNoteHeader.Customers
.DateCreated = GetSQLTime(_ocur.Session)
.DateExecution = _InvoiceCreditNoteHeader.DateExecution
.DatePayment = _InvoiceCreditNoteHeader.DatePayment
.PaymentOption = _InvoiceCreditNoteHeader.PaymentOption
.ShipmentOption = _OrderInParameters.ShipmentOption
.CurrencyName = _OrderInParameters.CurrencyName
If .PaymentOption.PayMode <> ePayMode.InCash Then
.BankInformation = _OrderInParameters.BankInformation
End If
.Description = _InvoiceCreditNoteHeader.Description
InvoiceHeaderSavedSettings(_InvoiceHeader_Credited)
If .PaymentOption.PayMode = ePayMode.InContinuous Then
.DatePayment = .DateExecution
Else
If .PaymentOption.DatePaymentMode = eDatePaymentMode.eDateCreated Then
.DatePayment = .DateCreated.AddDays(.PaymentOption.PayDay)
Else
.DatePayment = .DateExecution.AddDays(.PaymentOption.PayDay)
End If
End If
If .InvoiceType.NumberGeneratorProforma IsNot Nothing Then
.DocumentNumberProforma = .InvoiceType.NumberGeneratorProforma.GetNewNumber(.InvoiceType.NumberGeneratorProforma)
End If
'Véglegesítés
.IsCreditNote = True
.IsEditable = False
.IsProforma = False
.IsStorno = False
'.ConnectInfo = .InvoiceType.NumberGenerator.GetNewNumber(.InvoiceType.NumberGenerator)
.DocumentNumber = .InvoiceType.NumberGenerator.GetNewNumber(.InvoiceType.NumberGenerator) '.ConnectInfo
End With
_InvoiceHeader_Credited_Collection.Add(_InvoiceHeader_Credited)
'Számlasorok beszúrása
Dim _InvoiceCreditNoteRows_Collection As New XPCollection(Of InvoiceCreditNoteRows)(_ocur.Session, CriteriaOperator.Parse("InvoiceCreditNoteHeader=? AND FromInvoiceRows.OrderInRows.OrderInHeader.OrderInParameters=?", _
_InvoiceCreditNoteHeader, _OrderInParameters))
If _InvoiceCreditNoteRows_Collection.Count > 0 Then
For Each _InvoiceCreditNoteRows As InvoiceCreditNoteRows In _InvoiceCreditNoteRows_Collection
Dim _InvoiceRows As New InvoiceRows(_ocur.Session)
With _InvoiceRows
.InvoiceHeader = _InvoiceHeader_Credited
.RowIndex = _InvoiceHeader_Credited.InvoiceRows.Count
.OrderInRows = _InvoiceCreditNoteRows.FromInvoiceRows.OrderInRows
.InvoiceRowtype = eInvoiceRowType.FromOrder
.DiscountPriceDEV = 0
.DiscountPriceHUF = 0
.ListPriceDEV = _InvoiceCreditNoteRows.PriceDEV
.ListPriceHUF = _InvoiceCreditNoteRows.PriceHUF
.QTT = _InvoiceCreditNoteRows.QTT * (-1)
.QualityOption = _InvoiceCreditNoteRows.FromInvoiceRows.QualityOption
.ShortName = _InvoiceCreditNoteRows.FromInvoiceRows.ShortName
.Units = _InvoiceCreditNoteRows.FromInvoiceRows.Units
.VAT = _InvoiceCreditNoteRows.FromInvoiceRows.VAT
.Description = _InvoiceCreditNoteRows.Description
.CustomsTariffs = _InvoiceCreditNoteRows.FromInvoiceRows.CustomsTariffs
.Controlling = _InvoiceCreditNoteRows.FromInvoiceRows.Controlling
.InvoiceRows = _InvoiceCreditNoteRows.FromInvoiceRows
End With
_InvoiceCreditNoteRows.ToInvoiceRows = _InvoiceRows
If String.IsNullOrEmpty(_InvoiceHeader_Credited.ConnectInfo) Then
_InvoiceHeader_Credited.ConnectInfo = _InvoiceCreditNoteRows.FromInvoiceRows.InvoiceHeader.DocumentNumber
End If
Next
End If
Next
'Betárolás
Dim _StorageInHeader As New StorageInHeader(_ocur.Session)
With _StorageInHeader
.Storage = _InvoiceCreditNoteHeader.Storage
.StorageMoveType = _InvoiceCreditNoteHeader.StorageMoveType
.CreateDate = _InvoiceCreditNoteHeader.DateExecution
End With
If _InvoiceCreditNoteHeader.InvoiceCreditNoteRows.Count > 0 Then
For Each _InvoiceCreditNoteRows As InvoiceCreditNoteRows In _InvoiceCreditNoteHeader.InvoiceCreditNoteRows
Dim _StorageInRows As New StorageInRows(_ocur.Session)
With _StorageInRows
.StorageInHeader = _StorageInHeader
.RowIndex = _StorageInHeader.StorageInRows.Count
.Products = _InvoiceCreditNoteRows.FromInvoiceRows.OrderInRows.Products
.QTT_Will = _InvoiceCreditNoteRows.QTT
.AveragePriceInHUF = (_InvoiceCreditNoteRows.ToInvoiceRows.SumAveragePriceHUF / _InvoiceCreditNoteRows.ToInvoiceRows.QTT)
If _InvoiceCreditNoteRows.FromInvoiceRows.DeliveryNoteOutRows IsNot Nothing Then
.PacketNumber = _InvoiceCreditNoteRows.FromInvoiceRows.DeliveryNoteOutRows.StorageOutRowsInRows.StorageInRows.PacketNumber
.SerialNumber = _InvoiceCreditNoteRows.FromInvoiceRows.DeliveryNoteOutRows.StorageOutRowsInRows.StorageInRows.SerialNumber
.Weight = Math.Round(_InvoiceCreditNoteRows.FromInvoiceRows.DeliveryNoteOutRows.StorageOutRowsInRows.StorageInRows.Weight / _InvoiceCreditNoteRows.FromInvoiceRows.DeliveryNoteOutRows.StorageOutRowsInRows.StorageInRows.QTT * _InvoiceCreditNoteRows.QTT, 4, MidpointRounding.AwayFromZero)
.WeightMode = _InvoiceCreditNoteRows.FromInvoiceRows.DeliveryNoteOutRows.StorageOutRowsInRows.StorageInRows.WeightMode
End If
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Products=? and Storage=?", _
.Products, _StorageInHeader.Storage))
If _StorageComputed Is Nothing Then
_StorageComputed = _ocur.CreateObject(Of StorageComputed)()
_StorageComputed.Storage = .Storage
_StorageComputed.Products = .Products
_StorageComputed.QTTReservedIn = .QTT_Will
Else
_StorageComputed.QTTReservedIn += .QTT_Will
End If
End With
Next
End If
'Betárolás véglegesítése
For Each _StorageInRows As StorageInRows In _StorageInHeader.StorageInRows
Dim _StorageComputed As StorageComputed = _onew.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Products=? and Storage=?", _
_onew.GetObject(_StorageInRows.Products), _onew.GetObject(_StorageInHeader.Storage)))
If _StorageInRows.QTT_Will > 0 Then
_StorageInRows.QTT = _StorageInRows.QTT_Will
_StorageComputed.QTTFree += _StorageInRows.QTT_Will
_StorageComputed.QTTReservedIn -= _StorageInRows.QTT_Will
Dim _StorageMoveEvents As New StorageMoveEvents(_onew.Session)
With _StorageMoveEvents
.StorageInRows = _onew.GetObject(_StorageInRows)
.QTT = _StorageInRows.QTT_Will
.QTT_Free_After = _StorageComputed.QTTFree
.QTT_Free_Before = _StorageMoveEvents.QTT_Free_After - _StorageMoveEvents.QTT
.MoveEventsType = eMoveEventsType.StorageInFinal
.ExecutionDate = _StorageInRows.StorageInHeader.CreateDate
End With
_StorageInRows.QTT_Will = 0
End If
Next
_StorageInHeader.IsEditable = False
_StorageInHeader.IsFinalized = True
_ocur.CommitChanges()
For Each _InvoiceHeader As InvoiceHeader In _InvoiceHeader_Credited_Collection
_InvoiceHeader.RecalculateInvoice(_InvoiceHeader, _ocur)
Next
_ocur.CommitChanges()
Dim _ReportData_Storage As ReportData = _onew.FindObject(Of ReportData)(CriteriaOperator.Parse("Oid=?", _StorageInHeader.Storage.ReportIn.Oid), True)
If _ReportData_Storage Is Nothing Or _StorageInHeader Is Nothing Then
Else
Frame.GetController(Of Reports.ReportServiceController).ShowPreview(_ReportData_Storage, CriteriaOperator.Parse("StorageInHeader.DocumentNumber =?", _StorageInHeader.DocumentNumber), True)
End If
For Each _InvoiceHeader As InvoiceHeader In _InvoiceHeader_Credited_Collection
If _InvoiceHeader IsNot Nothing Then
Dim _XAFPrintHelper As New XAFPrintHelper(Nothing, Frame, _InvoiceHeader.InvoiceType.ReportDataV2, CriteriaOperator.Parse("InvoiceHeader.Oid=?", _InvoiceHeader.Oid))
_XAFPrintHelper.ShowPreviewV2()
End If
Next
End If
End If
End If
View.Close()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
LockingModule.UnLockObject(_uow_lock, GetType(StorageComputed), "-", _User)
End Try
End Sub
Private Sub InvoiceRows_ListView_CreditNote_AcceptAction_Executing(sender As Object, e As CancelEventArgs)
Try
Dim _onew As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
For Each _InvoiceRows As InvoiceRows In TryCast(View, ListView).CollectionSource.Collection
If _InvoiceRows.QTT_Will > 0 Then
If (_InvoiceRows.QTT_CreditNote + _InvoiceRows.QTT_Will) > _InvoiceRows.QTT Then
e.Cancel = True
Throw New Exception(String.Format("A {0} rendelésen lévõ {1} sorban az eladott mennyiség kisebb, mint a visszavenni kívánt mennyiség!", _
_InvoiceRows.InvoiceHeader.DocumentNumber, _InvoiceRows.OrderInRows.Products.ShortName))
End If
End If
Next
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
End Try
End Sub
Private Sub InvoiceHeaderSavedSettings(ByVal _InvoiceHeader As InvoiceHeader)
On Error GoTo CheckError
With _InvoiceHeader
.Saved_Customers_Name = _InvoiceHeader.Customers.Name.ToString
.Saved_Customers_Address_Country = _InvoiceHeader.Customers.Address1.Country.ToString
.Saved_Customers_Address_ZipPostal = _InvoiceHeader.Customers.Address1.ZipPostal.ToString
.Saved_Customers_Address_Street = _InvoiceHeader.Customers.Address1.Street.ToString
.Saved_Customers_Address_City = _InvoiceHeader.Customers.Address1.City.ToString
.Saved_Customers_Address_StateProvince = _InvoiceHeader.Customers.Address1.StateProvince.ToString
.Saved_Customers_VATNumber = _InvoiceHeader.Customers.VATNumber.ToString
.Saved_Customers_VATNumberEU = _InvoiceHeader.Customers.VATNumberEU.ToString
.Saved_CustomersFrom_Name = _InvoiceHeader.CustomersFrom.Name.ToString
.Saved_CustomersFrom_Address_ZipPostal = _InvoiceHeader.CustomersFrom.Address1.ZipPostal.ToString
.Saved_CustomersFrom_Address_Street = _InvoiceHeader.CustomersFrom.Address1.Street.ToString
.Saved_CustomersFrom_Address_City = _InvoiceHeader.CustomersFrom.Address1.City.ToString
.Saved_CustomersFrom_Address_StateProvince = _InvoiceHeader.CustomersFrom.Address1.StateProvince.ToString
.Saved_CustomersFrom_VATNumber = _InvoiceHeader.CustomersFrom.VATNumber.ToString
.Saved_CustomersFrom_VATNumberEU = _InvoiceHeader.CustomersFrom.VATNumberEU.ToString
.Saved_CustomersFrom_Bank_ShortName = _InvoiceHeader.BankInformation.FullBankAccount.ToString
.Saved_CustomersFrom_Bank_IBAN = _InvoiceHeader.BankInformation.IBAN.ToString
.Saved_CustomersFrom_Bank_SWIFT = _InvoiceHeader.BankInformation.SWIFT.ToString
.Saved_CustomersFrom_Bank_AccountNumber = _InvoiceHeader.BankInformation.AccountNumber.ToString
End With
CheckError:
If Err.Number = 91 Then Resume Next
If Err.Number = 13 Then Resume Next
End Sub
End Class