First create solution
This commit is contained in:
+129
@@ -0,0 +1,129 @@
|
||||
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.Persistent.Base.General
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Configuration
|
||||
Imports System.Linq
|
||||
Imports System.Linq.Expressions
|
||||
Imports DevExpress.ExpressApp.ConditionalAppearance
|
||||
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem(False), CreatableItem(False)> _
|
||||
<DeferredDeletion(False)> _
|
||||
<Appearance("Disable UserCreated,ObjectCreated-SpecTranRevaluation", AppearanceItemType:="ViewItem", Enabled:=False, TargetItems:="ObjectCreated,UserCreated", Criteria:="1=1")> _
|
||||
Public Class SpecTranRevaluation 'Devizás átértékelés
|
||||
Inherits BaseObject
|
||||
Private _CustomersFrom As CustomersFrom
|
||||
Private _DateClose As Date '-- Záró dátum
|
||||
Private _ShortName As String '-- Lekérdezés megnevezése
|
||||
Private _CurrencyName As CurrencyName '-- Záró kimutatás devizaneme
|
||||
Private _CurrencyRate As Double '-- Záró kimutatás átértékelési árfolyama
|
||||
Private _ObjectCreated As Date
|
||||
Private _UserCreated As User
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(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
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
If Session.IsNewObject(Me) Then
|
||||
Me.DateClose = Now
|
||||
End If
|
||||
End Sub
|
||||
Property CustomersFrom As CustomersFrom
|
||||
Get
|
||||
Return _CustomersFrom
|
||||
End Get
|
||||
Set(value As CustomersFrom)
|
||||
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
|
||||
End Set
|
||||
End Property
|
||||
Property DateClose As Date
|
||||
Get
|
||||
Return _DateClose
|
||||
End Get
|
||||
Set(ByVal value As Date)
|
||||
SetPropertyValue("DateClose", _DateClose, value)
|
||||
End Set
|
||||
End Property
|
||||
Property ShortName As String
|
||||
Get
|
||||
Return _ShortName
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("ShortName", _ShortName, value)
|
||||
End Set
|
||||
End Property
|
||||
<ImmediatePostData(True)> _
|
||||
Property CurrencyName As CurrencyName
|
||||
Get
|
||||
Return _CurrencyName
|
||||
End Get
|
||||
Set(value As CurrencyName)
|
||||
SetPropertyValue("CurrencyName", _CurrencyName, value)
|
||||
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
|
||||
'// MNB Árfolyam lekérése a záró dátumra
|
||||
Dim _CurrencyRate As CurrencyRate = Session.FindObject(Of CurrencyRate)(CriteriaOperator.Parse("IsMNB=True and GetDate(DateValid)=? and CurrencyName.ShortName=?", Me.DateClose.Date, value.ShortName))
|
||||
If _CurrencyRate IsNot Nothing Then
|
||||
If CurrencyRate = 0 Then
|
||||
CurrencyRate = _CurrencyRate.RateAverage
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Property CurrencyRate As Double
|
||||
Get
|
||||
Return _CurrencyRate
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("CurrencyRate", _CurrencyRate, value)
|
||||
|
||||
End Set
|
||||
End Property
|
||||
<NonCloneable> _
|
||||
Property ObjectCreated As Date
|
||||
Get
|
||||
Return _ObjectCreated
|
||||
End Get
|
||||
Set(value As Date)
|
||||
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
|
||||
End Set
|
||||
End Property
|
||||
<NonCloneable> _
|
||||
Property UserCreated As User
|
||||
Get
|
||||
Return _UserCreated
|
||||
End Get
|
||||
Set(value As User)
|
||||
SetPropertyValue("UserCreated", _UserCreated, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Association("SpecTranRevaluation-SpecTranRevaluationRowsAccounts", GetType(SpecTranRevaluationRowsAccounts)), VisibleInListView(False)> _
|
||||
ReadOnly Property SpecTranRevaluationRowsAccounts As XPCollection(Of SpecTranRevaluationRowsAccounts)
|
||||
Get
|
||||
Return GetCollection(Of SpecTranRevaluationRowsAccounts)("SpecTranRevaluationRowsAccounts")
|
||||
End Get
|
||||
End Property
|
||||
<Association("SpecTranRevaluation-SpecTranRevaluationLiquidAssets", GetType(SpecTranRevaluationLiquidAssets))> _
|
||||
ReadOnly Property SpecTranRevaluationLiquidAssets As XPCollection(Of SpecTranRevaluationLiquidAssets)
|
||||
Get
|
||||
Return GetCollection(Of SpecTranRevaluationLiquidAssets)("SpecTranRevaluationLiquidAssets")
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
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 SpecTranRevaluationLiquidAssets
|
||||
Inherits BaseObject
|
||||
|
||||
Private _SpecTranRevaluation As SpecTranRevaluation
|
||||
Private _LiquidAssets As LiquidAssets
|
||||
Private _BallanceDEV As Double
|
||||
Private _BallanceHUF As Double
|
||||
Private _BallanceHUF_Revaluation As Double
|
||||
Private _DifferenceHUF As Double
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
' This constructor is used when an object is loaded from a persistent storage.
|
||||
' Do not place any code here or place it only when the IsLoading property is false:
|
||||
' if (!IsLoading){
|
||||
' It is now OK to place your initialization code here.
|
||||
' }
|
||||
' or as an alternative, move your initialization code into the AfterConstruction method.
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
' Place here your initialization code.
|
||||
End Sub
|
||||
|
||||
<Association("SpecTranRevaluation-SpecTranRevaluationLiquidAssets", GetType(SpecTranRevaluation))> _
|
||||
Property SpecTranRevaluation As SpecTranRevaluation
|
||||
Get
|
||||
Return _SpecTranRevaluation
|
||||
End Get
|
||||
Set(value As SpecTranRevaluation)
|
||||
SetPropertyValue("SpecTranRevaluation", _SpecTranRevaluation, value)
|
||||
End Set
|
||||
End Property
|
||||
Property LiquidAssets As LiquidAssets
|
||||
Get
|
||||
Return _LiquidAssets
|
||||
End Get
|
||||
Set(value As LiquidAssets)
|
||||
SetPropertyValue("LiquidAssets", _LiquidAssets, value)
|
||||
End Set
|
||||
End Property
|
||||
Property BallanceDEV As Double
|
||||
Get
|
||||
Return _BallanceDEV
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("BallanceDEV", _BallanceDEV, value)
|
||||
End Set
|
||||
End Property
|
||||
Property BallanceHUF As Double
|
||||
Get
|
||||
Return _BallanceHUF
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("BallanceHUF", _BallanceHUF, value)
|
||||
End Set
|
||||
End Property
|
||||
Property BallanceHUF_Revaluation As Double
|
||||
Get
|
||||
Return _BallanceHUF_Revaluation
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("BallanceHUF_Revaluation", _BallanceHUF_Revaluation, value)
|
||||
End Set
|
||||
End Property
|
||||
Property DifferenceHUF As Double
|
||||
Get
|
||||
Return _DifferenceHUF
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("DifferenceHUF", _DifferenceHUF, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Class
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
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.Persistent.Base.General
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Configuration
|
||||
Imports System.Linq
|
||||
Imports System.Linq.Expressions
|
||||
Imports System.Drawing
|
||||
Imports DevExpress.ExpressApp.Utils
|
||||
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem(False), CreatableItem(False)> _
|
||||
<DeferredDeletion(False)> _
|
||||
Public Class SpecTranRevaluationRowsAccounts 'Devizás átértékelés számlák
|
||||
Inherits BaseObject
|
||||
Private _SpecTranRevaluation As SpecTranRevaluation
|
||||
Private _CustomersFrom As CustomersFrom
|
||||
Private _Customers As Customers
|
||||
Private _PartnerType As ePartnerType
|
||||
Private _ConnectInfo As String
|
||||
Private _BallanceDEV As Double
|
||||
Private _BallanceHUF As Double
|
||||
Private _BallanceHUF_Revaluation As Double
|
||||
Private _DifferenceHUF As Double
|
||||
Private _CurrencyRate_Account As Double
|
||||
Private _GLAccounts As GLAccounts
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
End Sub
|
||||
<Association("SpecTranRevaluation-SpecTranRevaluationRowsAccounts", GetType(SpecTranRevaluation))> _
|
||||
Property SpecTranRevaluation As SpecTranRevaluation
|
||||
Get
|
||||
Return _SpecTranRevaluation
|
||||
End Get
|
||||
Set(value As SpecTranRevaluation)
|
||||
SetPropertyValue("SpecTranRevaluation", _SpecTranRevaluation, value)
|
||||
End Set
|
||||
End Property
|
||||
Property CustomersFrom As CustomersFrom
|
||||
Get
|
||||
Return _CustomersFrom
|
||||
End Get
|
||||
Set(value As CustomersFrom)
|
||||
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
|
||||
End Set
|
||||
End Property
|
||||
Property Customers As Customers
|
||||
Get
|
||||
Return _Customers
|
||||
End Get
|
||||
Set(value As Customers)
|
||||
SetPropertyValue("Customers", _Customers, value)
|
||||
End Set
|
||||
End Property
|
||||
Property PartnerType As ePartnerType
|
||||
Get
|
||||
Return _PartnerType
|
||||
End Get
|
||||
Set(value As ePartnerType)
|
||||
SetPropertyValue("PartnerType", _PartnerType, value)
|
||||
End Set
|
||||
End Property
|
||||
Property ConnectInfo As String
|
||||
Get
|
||||
Return _ConnectInfo
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("ConnectInfo", _ConnectInfo, value)
|
||||
End Set
|
||||
End Property
|
||||
Property BallanceDEV As Double
|
||||
Get
|
||||
Return _BallanceDEV
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("BallanceDEV", _BallanceDEV, value)
|
||||
End Set
|
||||
End Property
|
||||
Property BallanceHUF As Double
|
||||
Get
|
||||
Return _BallanceHUF
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("BallanceHUF", _BallanceHUF, value)
|
||||
End Set
|
||||
End Property
|
||||
Property BallanceHUF_Revaluation As Double
|
||||
Get
|
||||
Return _BallanceHUF_Revaluation
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("BallanceHUF_Revaluation", _BallanceHUF_Revaluation, value)
|
||||
End Set
|
||||
End Property
|
||||
Property DifferenceHUF As Double
|
||||
Get
|
||||
Return _DifferenceHUF
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("DifferenceHUF", _DifferenceHUF, value)
|
||||
End Set
|
||||
End Property
|
||||
<VisibleInDetailView(False)> _
|
||||
ReadOnly Property BallanceRateDiffImage As Image
|
||||
Get
|
||||
If PartnerType = ePartnerType.eReceivables Then
|
||||
If BallanceHUF - BallanceHUF_Revaluation > 0 Then 'Árfolyam veszteség
|
||||
Return ImageLoader.Instance.GetImageInfo("nav_down_red").Image
|
||||
Else 'Árfolyam nyereség
|
||||
Return ImageLoader.Instance.GetImageInfo("nav_up_green").Image
|
||||
End If
|
||||
ElseIf PartnerType = ePartnerType.ePayabels Then
|
||||
If BallanceHUF - BallanceHUF_Revaluation > 0 Then 'Árfolyam nyereség
|
||||
Return ImageLoader.Instance.GetImageInfo("nav_up_green").Image
|
||||
Else 'Árfolyam veszteség
|
||||
Return ImageLoader.Instance.GetImageInfo("nav_down_red").Image
|
||||
End If
|
||||
Else
|
||||
Return ImageLoader.Instance.GetImageInfo("bullet_ball_glass_blue").Image
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Property CurrencyRate_Account As Double
|
||||
Get
|
||||
Return _CurrencyRate_Account
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("CurrencyRate_Account", _CurrencyRate_Account, value)
|
||||
End Set
|
||||
End Property
|
||||
<Browsable(False)> _
|
||||
Property GLAccounts As GLAccounts
|
||||
Get
|
||||
Return _GLAccounts
|
||||
End Get
|
||||
Set(ByVal value As GLAccounts)
|
||||
SetPropertyValue("GLAccounts", _GLAccounts, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Class
|
||||
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
Partial Class SpecTranRevaluationVC
|
||||
|
||||
<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.aGenerateSpecTranRevaluationQuery = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aViewPCIDSpecTranRevaluation = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aCreateRevaluation = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aRemoveRevaluation = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
'
|
||||
'aGenerateSpecTranRevaluationQuery
|
||||
'
|
||||
Me.aGenerateSpecTranRevaluationQuery.Caption = "Query"
|
||||
Me.aGenerateSpecTranRevaluationQuery.ConfirmationMessage = "Do You want to execute ?"
|
||||
Me.aGenerateSpecTranRevaluationQuery.Id = "aGenerateSpecTranRevaluationQuery"
|
||||
Me.aGenerateSpecTranRevaluationQuery.ImageName = "stopwatch_run"
|
||||
Me.aGenerateSpecTranRevaluationQuery.Shortcut = Nothing
|
||||
Me.aGenerateSpecTranRevaluationQuery.Tag = Nothing
|
||||
Me.aGenerateSpecTranRevaluationQuery.TargetObjectsCriteria = Nothing
|
||||
Me.aGenerateSpecTranRevaluationQuery.TargetObjectType = GetType(Nuvolar.[Module].SpecTranRevaluation)
|
||||
Me.aGenerateSpecTranRevaluationQuery.TargetViewId = Nothing
|
||||
Me.aGenerateSpecTranRevaluationQuery.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aGenerateSpecTranRevaluationQuery.ToolTip = Nothing
|
||||
Me.aGenerateSpecTranRevaluationQuery.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aViewPCIDSpecTranRevaluation
|
||||
'
|
||||
Me.aViewPCIDSpecTranRevaluation.Caption = "aViewPCIDSpecTranRevaluation"
|
||||
Me.aViewPCIDSpecTranRevaluation.ConfirmationMessage = Nothing
|
||||
Me.aViewPCIDSpecTranRevaluation.Id = "aViewPCIDSpecTranRevaluation"
|
||||
Me.aViewPCIDSpecTranRevaluation.ImageName = Nothing
|
||||
Me.aViewPCIDSpecTranRevaluation.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject
|
||||
Me.aViewPCIDSpecTranRevaluation.Shortcut = Nothing
|
||||
Me.aViewPCIDSpecTranRevaluation.Tag = Nothing
|
||||
Me.aViewPCIDSpecTranRevaluation.TargetObjectsCriteria = Nothing
|
||||
Me.aViewPCIDSpecTranRevaluation.TargetObjectType = GetType(Nuvolar.[Module].SpecTranRevaluationRowsAccounts)
|
||||
Me.aViewPCIDSpecTranRevaluation.TargetViewId = ""
|
||||
Me.aViewPCIDSpecTranRevaluation.ToolTip = Nothing
|
||||
Me.aViewPCIDSpecTranRevaluation.TypeOfView = Nothing
|
||||
'
|
||||
'aCreateRevaluation
|
||||
'
|
||||
Me.aCreateRevaluation.Caption = "aCreate Revaluation"
|
||||
Me.aCreateRevaluation.ConfirmationMessage = "Are you sure ?"
|
||||
Me.aCreateRevaluation.Id = "aCreateRevaluation"
|
||||
Me.aCreateRevaluation.ImageName = Nothing
|
||||
Me.aCreateRevaluation.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireMultipleObjects
|
||||
Me.aCreateRevaluation.Shortcut = Nothing
|
||||
Me.aCreateRevaluation.Tag = Nothing
|
||||
Me.aCreateRevaluation.TargetObjectsCriteria = Nothing
|
||||
Me.aCreateRevaluation.TargetObjectType = GetType(Nuvolar.[Module].SpecTranRevaluationRowsAccounts)
|
||||
Me.aCreateRevaluation.TargetViewId = Nothing
|
||||
Me.aCreateRevaluation.ToolTip = Nothing
|
||||
Me.aCreateRevaluation.TypeOfView = Nothing
|
||||
'
|
||||
'aRemoveRevaluation
|
||||
'
|
||||
Me.aRemoveRevaluation.Caption = "aRemove Revaluation"
|
||||
Me.aRemoveRevaluation.ConfirmationMessage = "Are you sure ?"
|
||||
Me.aRemoveRevaluation.Id = "aRemoveRevaluation"
|
||||
Me.aRemoveRevaluation.ImageName = Nothing
|
||||
Me.aRemoveRevaluation.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireMultipleObjects
|
||||
Me.aRemoveRevaluation.Shortcut = Nothing
|
||||
Me.aRemoveRevaluation.Tag = Nothing
|
||||
Me.aRemoveRevaluation.TargetObjectsCriteria = Nothing
|
||||
Me.aRemoveRevaluation.TargetObjectType = GetType(Nuvolar.[Module].GLAccountsRevaluations)
|
||||
Me.aRemoveRevaluation.TargetViewId = Nothing
|
||||
Me.aRemoveRevaluation.TargetViewType = DevExpress.ExpressApp.ViewType.ListView
|
||||
Me.aRemoveRevaluation.ToolTip = Nothing
|
||||
Me.aRemoveRevaluation.TypeOfView = GetType(DevExpress.ExpressApp.ListView)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aGenerateSpecTranRevaluationQuery As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aViewPCIDSpecTranRevaluation As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aCreateRevaluation As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aRemoveRevaluation As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
|
||||
End Class
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
<?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="aGenerateSpecTranRevaluationQuery.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>174, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aViewPCIDSpecTranRevaluation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>594, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aCreateRevaluation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aRemoveRevaluation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>428, 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>
|
||||
+367
@@ -0,0 +1,367 @@
|
||||
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.Xpo
|
||||
Imports DevExpress.ExpressApp.SystemModule
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Imports System.Linq
|
||||
Public Class SpecTranRevaluationVC
|
||||
Inherits DevExpress.ExpressApp.ViewController
|
||||
Public Event InitWork(ByVal _Minimum As Long, ByVal _Step As Long, ByVal _Maximum As Long)
|
||||
Public Event DoWork()
|
||||
Public Event FinalWork
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
|
||||
'This call is required by the Component Designer.
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub aGenerateSpecTranRevaluationQuery_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aGenerateSpecTranRevaluationQuery.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _uow As New UnitOfWork(_ocur.Session.DataLayer)
|
||||
Dim _SpecTranRevaluation As SpecTranRevaluation = _uow.GetObjectByKey(Of SpecTranRevaluation)(TryCast(View.SelectedObjects(0), SpecTranRevaluation).Oid)
|
||||
|
||||
Dim _SpecTranRevaluationRowsAccounts_Collection = New XPCollection(Of SpecTranRevaluationRowsAccounts)(_uow, CriteriaOperator.Parse("SpecTranRevaluation=?", _SpecTranRevaluation))
|
||||
_uow.Delete(_SpecTranRevaluationRowsAccounts_Collection)
|
||||
|
||||
Dim _SpecTranRevaluationLiquidAssets_Collection = New XPCollection(Of SpecTranRevaluationLiquidAssets)(_uow, CriteriaOperator.Parse("SpecTranRevaluation=?", _SpecTranRevaluation))
|
||||
_uow.Delete(_SpecTranRevaluationLiquidAssets_Collection)
|
||||
|
||||
Dim _LiquidAssets_Collection As New XPCollection(Of LiquidAssets)(_uow, CriteriaOperator.Parse("CurrencyName.ShortName <>'HUF' and CustomerFrom=?", _SpecTranRevaluation.CustomersFrom))
|
||||
Dim _LiquidAssets As LiquidAssets
|
||||
|
||||
'// Pénzeszközök egyenlege
|
||||
|
||||
Dim _SpecTranRevaluationLiquidAssets As SpecTranRevaluationLiquidAssets
|
||||
Dim _BallanceDEV As Double = 0
|
||||
RaiseEvent InitWork(1, 1, _LiquidAssets_Collection.Count)
|
||||
For Each _LiquidAssets In _LiquidAssets_Collection
|
||||
RaiseEvent DoWork()
|
||||
_BallanceDEV = 0
|
||||
|
||||
Select Case _LiquidAssets.LiquidAssetsType
|
||||
|
||||
Case eLiquidAssetsType.NormalBank
|
||||
_BallanceDEV = GetBallanceDEVBank(_uow, _LiquidAssets, _SpecTranRevaluation.DateClose.Date)
|
||||
If _BallanceDEV <> 0 Then
|
||||
_SpecTranRevaluationLiquidAssets = New SpecTranRevaluationLiquidAssets(_uow)
|
||||
_SpecTranRevaluationLiquidAssets.SpecTranRevaluation = _SpecTranRevaluation
|
||||
_SpecTranRevaluationLiquidAssets.LiquidAssets = _LiquidAssets
|
||||
_SpecTranRevaluationLiquidAssets.BallanceDEV = _BallanceDEV
|
||||
_SpecTranRevaluationLiquidAssets.BallanceHUF = GetBallanceHUFBank(_uow, _LiquidAssets, _SpecTranRevaluation.DateClose.Date)
|
||||
_SpecTranRevaluationLiquidAssets.BallanceHUF_Revaluation = _SpecTranRevaluationLiquidAssets.BallanceDEV * _SpecTranRevaluation.CurrencyRate
|
||||
_SpecTranRevaluationLiquidAssets.DifferenceHUF = _SpecTranRevaluationLiquidAssets.BallanceHUF - _SpecTranRevaluationLiquidAssets.BallanceHUF_Revaluation
|
||||
End If
|
||||
|
||||
|
||||
Case eLiquidAssetsType.NormalCheckout, eLiquidAssetsType.CurrencyCheckout, eLiquidAssetsType.DepositCheckout
|
||||
_BallanceDEV = GetBallanceDEVCassa(_uow, _LiquidAssets, _SpecTranRevaluation.DateClose.Date)
|
||||
If Math.Round(_BallanceDEV, 4, MidpointRounding.AwayFromZero) <> 0 Then
|
||||
_SpecTranRevaluationLiquidAssets = New SpecTranRevaluationLiquidAssets(_uow)
|
||||
_SpecTranRevaluationLiquidAssets.SpecTranRevaluation = _SpecTranRevaluation
|
||||
_SpecTranRevaluationLiquidAssets.LiquidAssets = _LiquidAssets
|
||||
_SpecTranRevaluationLiquidAssets.BallanceDEV = _BallanceDEV
|
||||
_SpecTranRevaluationLiquidAssets.BallanceHUF = GetBallanceHUFCassa(_uow, _LiquidAssets, _SpecTranRevaluation.DateClose.Date)
|
||||
_SpecTranRevaluationLiquidAssets.BallanceHUF_Revaluation = _SpecTranRevaluationLiquidAssets.BallanceDEV * _SpecTranRevaluation.CurrencyRate
|
||||
_SpecTranRevaluationLiquidAssets.DifferenceHUF = _SpecTranRevaluationLiquidAssets.BallanceHUF - _SpecTranRevaluationLiquidAssets.BallanceHUF_Revaluation
|
||||
End If
|
||||
|
||||
End Select
|
||||
Next
|
||||
_uow.CommitChanges()
|
||||
RaiseEvent FinalWork
|
||||
|
||||
|
||||
|
||||
'// Szállítói vevõi egyenlegek
|
||||
Dim _SpecTranRevaluationRowsAccounts As SpecTranRevaluationRowsAccounts
|
||||
Dim PCI As New XPQuery(Of PCIDetail)(_uow)
|
||||
|
||||
Dim query = From _PCI In PCI
|
||||
Where _PCI.DateExecution.Date <= _SpecTranRevaluation.DateClose.Date And
|
||||
_PCI.Customers IsNot Nothing And
|
||||
_PCI.ConnectInfo IsNot Nothing And
|
||||
_PCI.CustomersFrom Is _SpecTranRevaluation.CustomersFrom And
|
||||
_PCI.CurrencyName_Account IsNot Nothing And
|
||||
_PCI.CurrencyName_Account Is _SpecTranRevaluation.CurrencyName And
|
||||
_PCI.GLAccounts IsNot Nothing
|
||||
Group _PCI By _PCI.Customers, _
|
||||
_PCI.PartnerType, _
|
||||
_PCI.ConnectInfo, _PCI.GLAccounts Into g = Group
|
||||
Order By PartnerType, Customers, ConnectInfo
|
||||
Select New With {Key .Customers = Customers, _
|
||||
Key .PartnerType = PartnerType, _
|
||||
Key .ConnectInfo = ConnectInfo, _
|
||||
Key .GLAccounts = GLAccounts, _
|
||||
Key .DocumentNumber = g.Max(Function(inv) inv.DocumentNumber), _
|
||||
Key .RegistryNumber = g.Max(Function(inv) inv.RegistryNumber), _
|
||||
Key .AmountHUF = g.Sum(Function(inv) inv.AmountHUF_Account), _
|
||||
Key .AmountDEV = g.Sum(Function(inv) inv.AmountDEV_Account), _
|
||||
Key .BallanceHUF = g.Sum(Function(inv) inv.BallanceHUF), _
|
||||
Key .BallanceDEV = g.Sum(Function(inv) inv.BallanceDEV), _
|
||||
Key .DatePayment = g.Max(Function(inv) inv.DatePayment_Account), _
|
||||
Key .DateExecution = g.Max(Function(inv) inv.DateExecution_Account) _
|
||||
}
|
||||
|
||||
RaiseEvent InitWork(1, 1, query.Count)
|
||||
For Each item In query
|
||||
RaiseEvent DoWork()
|
||||
Dim _GLAccountsRevaluations As GLAccountsRevaluations = _uow.FindObject(Of GLAccountsRevaluations)(CriteriaOperator.Parse("GLAccounts=?", item.GLAccounts))
|
||||
If _GLAccountsRevaluations Is Nothing Then
|
||||
If Math.Round(item.BallanceDEV, 2, MidpointRounding.AwayFromZero) <> 0 Then
|
||||
_SpecTranRevaluationRowsAccounts = New SpecTranRevaluationRowsAccounts(_uow)
|
||||
_SpecTranRevaluationRowsAccounts.SpecTranRevaluation = _SpecTranRevaluation
|
||||
_SpecTranRevaluationRowsAccounts.PartnerType = item.PartnerType
|
||||
_SpecTranRevaluationRowsAccounts.Customers = item.Customers
|
||||
_SpecTranRevaluationRowsAccounts.ConnectInfo = item.ConnectInfo
|
||||
_SpecTranRevaluationRowsAccounts.CustomersFrom = _SpecTranRevaluation.CustomersFrom
|
||||
_SpecTranRevaluationRowsAccounts.BallanceDEV = item.BallanceDEV
|
||||
_SpecTranRevaluationRowsAccounts.GLAccounts = item.GLAccounts
|
||||
_SpecTranRevaluationRowsAccounts.BallanceHUF_Revaluation = Math.Round(item.BallanceDEV * _SpecTranRevaluation.CurrencyRate, 4, MidpointRounding.AwayFromZero)
|
||||
_SpecTranRevaluationRowsAccounts.CurrencyRate_Account = 1
|
||||
If item.AmountDEV <> 0 Then
|
||||
_SpecTranRevaluationRowsAccounts.CurrencyRate_Account = Math.Round(item.AmountHUF / item.AmountDEV, 4, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
_SpecTranRevaluationRowsAccounts.BallanceHUF = Math.Round(item.BallanceDEV * _SpecTranRevaluationRowsAccounts.CurrencyRate_Account, 4, MidpointRounding.AwayFromZero)
|
||||
_SpecTranRevaluationRowsAccounts.DifferenceHUF = Math.Round((item.BallanceDEV * _SpecTranRevaluationRowsAccounts.CurrencyRate_Account) - _SpecTranRevaluationRowsAccounts.BallanceHUF_Revaluation, 4, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
_uow.CommitChanges()
|
||||
RaiseEvent FinalWork
|
||||
|
||||
|
||||
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
|
||||
End Sub
|
||||
Private Function GetBallanceHUFCassa(ByVal _uow As UnitOfWork, ByVal _LiquidAssets As LiquidAssets, ByVal _ToDate As Date) As Double
|
||||
Dim _GLCassa_Collection As New XPCollection(Of GLCassa)(PersistentCriteriaEvaluationBehavior.InTransaction, _uow, _
|
||||
CriteriaOperator.Parse("LiquidAssets_Cassa=? and DateExecution<=? and DocumentNumber<>''", _LiquidAssets, DateAdd(DateInterval.Minute, 1439, _ToDate.Date)))
|
||||
Dim _GLCassa As GLCassa
|
||||
Dim _GLRows As GLRows
|
||||
Dim _InAmountHUF As Double = 0
|
||||
Dim _OutAmountHUF As Double = 0
|
||||
|
||||
For Each _GLCassa In _GLCassa_Collection
|
||||
For Each _GLRows In _GLCassa.GLRows
|
||||
_InAmountHUF += _GLRows.InAmountHUF
|
||||
_OutAmountHUF += _GLRows.OutAmountHUF
|
||||
Next
|
||||
Next
|
||||
Return _InAmountHUF - _OutAmountHUF
|
||||
End Function
|
||||
Private Function GetBallanceDEVCassa(ByVal _uow As UnitOfWork, ByVal _LiquidAssets As LiquidAssets, ByVal _ToDate As Date) As Double
|
||||
Dim _GLCassa_Collection As New XPCollection(Of GLCassa)(PersistentCriteriaEvaluationBehavior.InTransaction, _uow, _
|
||||
CriteriaOperator.Parse("LiquidAssets_Cassa=? and DateExecution<=? and DocumentNumber<>''", _LiquidAssets, DateAdd(DateInterval.Minute, 1439, _ToDate.Date)))
|
||||
Dim _GLCassa As GLCassa
|
||||
Dim _GLRows As GLRows
|
||||
Dim _InAmountDEV As Double = 0
|
||||
Dim _OutAmountDEV As Double = 0
|
||||
|
||||
For Each _GLCassa In _GLCassa_Collection
|
||||
For Each _GLRows In _GLCassa.GLRows
|
||||
_InAmountDEV += _GLRows.InAmountDEV
|
||||
_OutAmountDEV += _GLRows.OutAmountDEV
|
||||
Next
|
||||
Next
|
||||
Return _InAmountDEV - _OutAmountDEV
|
||||
End Function
|
||||
Function GetBallanceHUFBank(ByVal _uow As UnitOfWork, ByVal _LiquidAssets As LiquidAssets, ByVal _ToDate As Date) As Double
|
||||
Dim _GLBank_Collection As New XPCollection(Of GLBank)(_uow, _
|
||||
CriteriaOperator.Parse("LiquidAssets_Main=? and DateExecution<=? and IsEditable=False", _LiquidAssets, DateAdd(DateInterval.Minute, 1439, _ToDate.Date)))
|
||||
Dim _GLBank As GLBank
|
||||
Dim _GLRows As GLRows
|
||||
Dim _InAmountHUF As Double = 0
|
||||
Dim _OutAmountHUF As Double = 0
|
||||
|
||||
For Each _GLBank In _GLBank_Collection
|
||||
For Each _GLRows In _GLBank.GLRows
|
||||
_InAmountHUF += _GLRows.InAmountHUF
|
||||
_OutAmountHUF += _GLRows.OutAmountHUF
|
||||
Next
|
||||
Next
|
||||
Return _InAmountHUF - _OutAmountHUF
|
||||
End Function
|
||||
Function GetBallanceDEVBank(ByVal _uow As UnitOfWork, ByVal _LiquidAssets As LiquidAssets, ByVal _ToDate As Date) As Double
|
||||
Dim _GLBank_Collection As New XPCollection(Of GLBank)(_uow, _
|
||||
CriteriaOperator.Parse("LiquidAssets_Main=? and DateExecution<=? and IsEditable=False", _LiquidAssets, DateAdd(DateInterval.Minute, 1439, _ToDate.Date)))
|
||||
Dim _GLBank As GLBank
|
||||
Dim _GLRows As GLRows
|
||||
Dim _InAmountDEV As Double = 0
|
||||
Dim _OutAmountDEV As Double = 0
|
||||
|
||||
For Each _GLBank In _GLBank_Collection
|
||||
For Each _GLRows In _GLBank.GLRows
|
||||
_InAmountDEV += _GLRows.InAmountDEV
|
||||
_OutAmountDEV += _GLRows.OutAmountDEV
|
||||
Next
|
||||
Next
|
||||
Return _InAmountDEV - _OutAmountDEV
|
||||
End Function
|
||||
|
||||
Private Sub aViewPCIDSpecTranRevaluation_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aViewPCIDSpecTranRevaluation.Execute
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _SpecTranRevaluationRowsAccounts As SpecTranRevaluationRowsAccounts = TryCast(View.SelectedObjects(0), SpecTranRevaluationRowsAccounts)
|
||||
|
||||
ViewPDCI.ViewPDCIDetail(_onew, Application, e, _SpecTranRevaluationRowsAccounts.CustomersFrom, _
|
||||
_SpecTranRevaluationRowsAccounts.Customers, _SpecTranRevaluationRowsAccounts.PartnerType, _
|
||||
_SpecTranRevaluationRowsAccounts.ConnectInfo)
|
||||
End Sub
|
||||
|
||||
Private Sub aCreateRevaluation_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aCreateRevaluation.Execute
|
||||
'// devizás átértékelési bizonylatot csinál
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _uow As New UnitOfWork(_ocur.Session.DataLayer)
|
||||
Dim _SpecTranRevaluationRowsAccounts As SpecTranRevaluationRowsAccounts
|
||||
Dim _SpecTranRevaluation As SpecTranRevaluation = TryCast(View.SelectedObjects(0), SpecTranRevaluationRowsAccounts).SpecTranRevaluation
|
||||
|
||||
Dim _GLHeader_Revaluation As GLMixed = Nothing
|
||||
Dim _GLRows_Revaluation As GLRows
|
||||
Dim _DebitChartOfAccounts As ChartOfAccounts = Nothing
|
||||
Dim _CreditChartOfAccounts As ChartOfAccounts = Nothing
|
||||
Dim _Controlling As Controlling = Nothing
|
||||
Dim _GLMixedNG As GLMixedNG
|
||||
Dim _Rate As Double = 1
|
||||
|
||||
|
||||
Dim _GLHeader_RevaluationParameter = _ocur.FindObject(Of GLHeader_RateDiffParameter)(CriteriaOperator.Parse("1=1"))
|
||||
If _GLHeader_RevaluationParameter Is Nothing Then
|
||||
Throw New Exception("*Nincs beállítva az átértékelési paraméter !")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim _ChartOfAccounts_Revaluation_Win As ChartOfAccounts = _GLHeader_RevaluationParameter.GetChartOfAccounts(_SpecTranRevaluation.DateClose.Year, eWinLoss.eRevaluationWin)
|
||||
Dim _ChartOfAccounts_Revaluation_Loss As ChartOfAccounts = _GLHeader_RevaluationParameter.GetChartOfAccounts(_SpecTranRevaluation.DateClose.Year, eWinLoss.eRevaluationLoss)
|
||||
|
||||
Dim _Controlling_Revaluation_Win As Controlling = _GLHeader_RevaluationParameter.Controlling_Revaluation_Win
|
||||
Dim _Controlling_Revaluation_Loss As Controlling = _GLHeader_RevaluationParameter.Controlling_Revaluation_Loss
|
||||
|
||||
|
||||
If _ChartOfAccounts_Revaluation_Loss Is Nothing Or _
|
||||
_ChartOfAccounts_Revaluation_Win Is Nothing Then
|
||||
Throw New Exception("*Nincs beállítva az átértékelési paraméter !")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim _CurrencyName As CurrencyName = Nothing
|
||||
Dim i As Long = 0
|
||||
Dim _InAmountHUF As Double = 0
|
||||
Dim _OutAmountHUF As Double = 0
|
||||
Dim _InAmountDEV As Double = 0
|
||||
Dim _OutAmountDEV As Double = 0
|
||||
|
||||
|
||||
|
||||
_GLHeader_Revaluation = _ocur.CreateObject(Of GLMixed)()
|
||||
_GLHeader_Revaluation.CustomersFrom = _SpecTranRevaluation.CustomersFrom
|
||||
|
||||
_GLMixedNG = _ocur.FindObject(Of GLMixedNG)(CriteriaOperator.Parse("CustomersFrom=?", _GLHeader_Revaluation.CustomersFrom), True)
|
||||
If _GLMixedNG IsNot Nothing Then
|
||||
If _GLHeader_Revaluation.DocumentNumber = "" Then
|
||||
_GLHeader_Revaluation.DocumentNumber = _GLMixedNG.NumberGenerator.GetNewNumber(_GLMixedNG.NumberGenerator_Revaluation)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
_GLHeader_Revaluation.DateExecution = _SpecTranRevaluation.DateClose.Date
|
||||
_GLHeader_Revaluation.DateCreated = _SpecTranRevaluation.DateClose.Date
|
||||
_GLHeader_Revaluation.NoteHeader = "Devizás átértékelés"
|
||||
|
||||
|
||||
|
||||
_GLHeader_Revaluation.GLDocumentType = eGLDocumentType.eGLRateDiff
|
||||
_GLHeader_Revaluation.IsEditable = False
|
||||
_GLHeader_Revaluation.IsStorno = False
|
||||
|
||||
|
||||
For Each _SpecTranRevaluationRowsAccounts In View.SelectedObjects
|
||||
_GLHeader_Revaluation.CurrencyName = _ocur.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
||||
_InAmountDEV = 0
|
||||
_InAmountHUF = 0
|
||||
_OutAmountDEV = 0
|
||||
_OutAmountHUF = 0
|
||||
Select Case _SpecTranRevaluationRowsAccounts.PartnerType
|
||||
Case ePartnerType.ePayabels
|
||||
If _SpecTranRevaluationRowsAccounts.DifferenceHUF > 0 Then
|
||||
_DebitChartOfAccounts = _SpecTranRevaluationRowsAccounts.Customers.CustomersGLParameters.GetChartOfAccounts(_GLHeader_Revaluation.DateExecution.Year, eVATMode.eIn)
|
||||
_CreditChartOfAccounts = _ChartOfAccounts_Revaluation_Win
|
||||
_Controlling = _Controlling_Revaluation_Win
|
||||
_InAmountHUF = Math.Round(Math.Abs(_SpecTranRevaluationRowsAccounts.DifferenceHUF), 2)
|
||||
Else 'Árfolyam veszteség szállító
|
||||
_DebitChartOfAccounts = _ChartOfAccounts_Revaluation_Loss
|
||||
_CreditChartOfAccounts = _SpecTranRevaluationRowsAccounts.Customers.CustomersGLParameters.GetChartOfAccounts(_GLHeader_Revaluation.DateExecution.Year, eVATMode.eIn)
|
||||
_Controlling = _Controlling_Revaluation_Loss
|
||||
_OutAmountHUF = Math.Round(Math.Abs(_SpecTranRevaluationRowsAccounts.DifferenceHUF), 2)
|
||||
End If
|
||||
Case ePartnerType.eReceivables
|
||||
If _SpecTranRevaluationRowsAccounts.DifferenceHUF > 0 Then 'Nyereség vevõ
|
||||
_DebitChartOfAccounts = _ChartOfAccounts_Revaluation_Loss
|
||||
_CreditChartOfAccounts = _SpecTranRevaluationRowsAccounts.Customers.CustomersGLParameters.GetChartOfAccounts(_GLHeader_Revaluation.DateExecution.Year, eVATMode.eOut)
|
||||
_Controlling = _Controlling_Revaluation_Loss
|
||||
_InAmountHUF = Math.Round(Math.Abs(_SpecTranRevaluationRowsAccounts.DifferenceHUF), 2)
|
||||
Else 'Árfolyam nyereség vevõ
|
||||
_DebitChartOfAccounts = _SpecTranRevaluationRowsAccounts.Customers.CustomersGLParameters.GetChartOfAccounts(_GLHeader_Revaluation.DateExecution.Year, eVATMode.eOut)
|
||||
_CreditChartOfAccounts = _ChartOfAccounts_Revaluation_Win
|
||||
_Controlling = _Controlling_Revaluation_Win
|
||||
_OutAmountHUF = Math.Round(Math.Abs(_SpecTranRevaluationRowsAccounts.DifferenceHUF), 2)
|
||||
End If
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
_GLRows_Revaluation = _ocur.CreateObject(Of GLRows)()
|
||||
_GLRows_Revaluation.GLHeader = _GLHeader_Revaluation
|
||||
_GLRows_Revaluation.InAmountHUF = _InAmountHUF
|
||||
_GLRows_Revaluation.OutAmountHUF = _OutAmountHUF
|
||||
_GLRows_Revaluation.InAmountDEV = 0
|
||||
_GLRows_Revaluation.OutAmountDEV = 0
|
||||
|
||||
_GLRows_Revaluation.AddGLRows(_GLHeader_Revaluation, _DebitChartOfAccounts, _CreditChartOfAccounts, 0, Math.Abs(_SpecTranRevaluationRowsAccounts.DifferenceHUF), Nothing, _
|
||||
_SpecTranRevaluationRowsAccounts.Customers, Nothing, Nothing, "", Nothing, _Controlling, Nothing, Nothing, Nothing, _SpecTranRevaluationRowsAccounts.ConnectInfo, _
|
||||
eGLRowsTypeVAT.eNettoRow, Guid.NewGuid, eTransactionType.eNotSet, eCashType.ePartner, _SpecTranRevaluationRowsAccounts.PartnerType)
|
||||
|
||||
|
||||
Dim _GLAccountsRevaluations As GLAccountsRevaluations = _ocur.CreateObject(Of GLAccountsRevaluations)()
|
||||
|
||||
_GLAccountsRevaluations.GLAccounts = _SpecTranRevaluationRowsAccounts.GLAccounts
|
||||
_GLAccountsRevaluations.GLRows = _GLRows_Revaluation
|
||||
_GLAccountsRevaluations.CurrencyRate_Revaluation = _SpecTranRevaluation.CurrencyRate
|
||||
_GLAccountsRevaluations.CurrencyRate = _SpecTranRevaluationRowsAccounts.CurrencyRate_Account
|
||||
_ocur.CommitChanges()
|
||||
|
||||
GLFunctions.ReconfigurePCI(_uow, _SpecTranRevaluationRowsAccounts.CustomersFrom, _SpecTranRevaluationRowsAccounts.Customers, _SpecTranRevaluationRowsAccounts.PartnerType, _SpecTranRevaluationRowsAccounts.ConnectInfo)
|
||||
|
||||
Next
|
||||
_ocur.CommitChanges()
|
||||
|
||||
'Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub aRemoveRevaluation_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aRemoveRevaluation.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _GLAccountsRevaluations As GLAccountsRevaluations
|
||||
|
||||
For Each _GLAccountsRevaluations In View.SelectedObjects
|
||||
|
||||
_ocur.Delete(_GLAccountsRevaluations.GLRows)
|
||||
_ocur.Delete(_GLAccountsRevaluations)
|
||||
|
||||
|
||||
Next
|
||||
_ocur.CommitChanges()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user