First create solution
This commit is contained in:
+309
@@ -0,0 +1,309 @@
|
||||
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 GLOpenCloseHeader
|
||||
Inherits BaseObject
|
||||
Private _ShortName As String
|
||||
Private _CustomersFrom As CustomersFrom
|
||||
Private _AccountYearClose As Long
|
||||
Private _AccountYearOpen As Long
|
||||
Private _ObjectCreated As Date
|
||||
Private _UserCreated As User
|
||||
Private _IsEditable As Boolean = True
|
||||
Private _IsClosedBallance As Boolean = False 'Mérlegszámlák lezárva ?
|
||||
Private _IsClosedSheetProfit As Boolean = False 'Eredményszámlák lezárva ?
|
||||
Private _IsDividend As Boolean = False 'Osztalék elszámolva
|
||||
Private _IsOpenNew As Boolean = False 'Új év megnyitva
|
||||
|
||||
Private _TrialBalanceHeaderBeforeClose As TrialBalanceHeader 'Zárás alapjául szolgáló fõkönyvi kivonat
|
||||
Private _TrialBalanceHeaderAfterClose_Ballance As TrialBalanceHeader 'Zárás utáni fõkönyvi kivonat (mérlegszámlák után)
|
||||
Private _TrialBalanceHeaderAfterClose_SheetProfit As TrialBalanceHeader 'Zárás utáni fõkönyvi kivonat (eredményszámlák után)
|
||||
Private _TrialBalanceHeaderAfterDividend As TrialBalanceHeader 'Osztalék elszámolás utáni fk. kivonat
|
||||
Private _TrialBalanceHeaderAfterOpen As TrialBalanceHeader 'Új év megnyitása utáni fõkönyvi kivonat
|
||||
|
||||
Private _GLMixed_AfterClose_SheetProfit As GLMixed 'Eredményszámlák zárása fk. vegyes bizonylat
|
||||
Private _GLMixed_AfterClose_Ballance As GLMixed 'Mérlegszámlák zárása vegyes bizonylat
|
||||
Private _GLMixed_AfterDividend As GLMixed 'Osztalék elszámolási fk vegyes bizonylat
|
||||
Private _GLMixed_AfterOpen 'Nyitási fk. vegyes bizonylat
|
||||
|
||||
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.
|
||||
AccountYearClose = GetSQLTime(Session).Year - 1
|
||||
AccountYearOpen = GetSQLTime(Session).Year
|
||||
IsClosedBallance = False
|
||||
IsClosedSheetProfit = False
|
||||
IsDividend = False
|
||||
IsOpenNew = False
|
||||
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))
|
||||
If TrialBalanceHeaderBeforeClose Is Nothing Then
|
||||
TrialBalanceHeaderBeforeClose = New TrialBalanceHeader(Session)
|
||||
TrialBalanceHeaderBeforeClose.CustomersFrom = Me.CustomersFrom
|
||||
TrialBalanceHeaderBeforeClose.DateFrom = New Date(Me.AccountYearClose, 1, 1)
|
||||
TrialBalanceHeaderBeforeClose.DateTo = New Date(Me.AccountYearClose, 12, 31)
|
||||
TrialBalanceHeaderBeforeClose.GLReportDateExecutionMode = eDateExecutionMode.eHeader
|
||||
TrialBalanceHeaderBeforeClose.QueryLevel = 10
|
||||
TrialBalanceHeaderBeforeClose.ShortName = Me.ShortName & " - zárás elõtti fõkönyvi kivonat"
|
||||
TrialBalanceHeaderBeforeClose.IsGLOpenClose = True
|
||||
TrialBalanceHeaderBeforeClose.Save()
|
||||
|
||||
TrialBalanceHeaderAfterClose_SheetProfit = New TrialBalanceHeader(Session)
|
||||
TrialBalanceHeaderAfterClose_SheetProfit.CustomersFrom = Me.CustomersFrom
|
||||
TrialBalanceHeaderAfterClose_SheetProfit.DateFrom = New Date(Me.AccountYearClose, 1, 1)
|
||||
TrialBalanceHeaderAfterClose_SheetProfit.DateTo = New Date(Me.AccountYearClose, 12, 31)
|
||||
TrialBalanceHeaderAfterClose_SheetProfit.GLReportDateExecutionMode = eDateExecutionMode.eHeader
|
||||
TrialBalanceHeaderAfterClose_SheetProfit.QueryLevel = 10
|
||||
TrialBalanceHeaderAfterClose_SheetProfit.ShortName = Me.ShortName & " - eredményszámlák zárása utáni fõkönyvi kivonat"
|
||||
TrialBalanceHeaderAfterClose_SheetProfit.IsGLOpenClose = True
|
||||
TrialBalanceHeaderAfterClose_SheetProfit.Save()
|
||||
|
||||
TrialBalanceHeaderAfterClose_Ballance = New TrialBalanceHeader(Session)
|
||||
TrialBalanceHeaderAfterClose_Ballance.CustomersFrom = Me.CustomersFrom
|
||||
TrialBalanceHeaderAfterClose_Ballance.DateFrom = New Date(Me.AccountYearClose, 1, 1)
|
||||
TrialBalanceHeaderAfterClose_Ballance.DateTo = New Date(Me.AccountYearClose, 12, 31)
|
||||
TrialBalanceHeaderAfterClose_Ballance.GLReportDateExecutionMode = eDateExecutionMode.eHeader
|
||||
TrialBalanceHeaderAfterClose_Ballance.QueryLevel = 10
|
||||
TrialBalanceHeaderAfterClose_Ballance.ShortName = Me.ShortName & " - mérlegszámlák zárása utáni fõkönyvi kivonat"
|
||||
TrialBalanceHeaderAfterClose_Ballance.IsGLOpenClose = True
|
||||
TrialBalanceHeaderAfterClose_Ballance.Save()
|
||||
|
||||
TrialBalanceHeaderAfterDividend = New TrialBalanceHeader(Session)
|
||||
TrialBalanceHeaderAfterDividend.CustomersFrom = Me.CustomersFrom
|
||||
TrialBalanceHeaderAfterDividend.DateFrom = New Date(Me.AccountYearClose, 1, 1)
|
||||
TrialBalanceHeaderAfterDividend.DateTo = New Date(Me.AccountYearClose, 12, 31)
|
||||
TrialBalanceHeaderAfterDividend.GLReportDateExecutionMode = eDateExecutionMode.eHeader
|
||||
TrialBalanceHeaderAfterDividend.QueryLevel = 10
|
||||
TrialBalanceHeaderAfterDividend.ShortName = Me.ShortName & " - osztalék elszámolás utáni fõkönyvi kivonat"
|
||||
TrialBalanceHeaderAfterDividend.IsGLOpenClose = True
|
||||
TrialBalanceHeaderAfterDividend.Save()
|
||||
|
||||
TrialBalanceHeaderAfterOpen = New TrialBalanceHeader(Session)
|
||||
TrialBalanceHeaderAfterOpen.CustomersFrom = Me.CustomersFrom
|
||||
TrialBalanceHeaderAfterOpen.DateFrom = New Date(Me.AccountYearClose, 1, 1)
|
||||
TrialBalanceHeaderAfterOpen.DateTo = New Date(Me.AccountYearClose, 12, 31)
|
||||
TrialBalanceHeaderAfterOpen.GLReportDateExecutionMode = eDateExecutionMode.eHeader
|
||||
TrialBalanceHeaderAfterOpen.QueryLevel = 10
|
||||
TrialBalanceHeaderAfterOpen.ShortName = Me.ShortName & " - nyitás utáni fõkönyvi kivonat"
|
||||
TrialBalanceHeaderAfterOpen.IsGLOpenClose = True
|
||||
TrialBalanceHeaderAfterOpen.Save()
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
If Me.GLMixed_AfterDividend Is Nothing Then
|
||||
GLMixed_AfterDividend = New GLMixed(Session)
|
||||
GLMixed_AfterDividend.CustomersFrom = Me.CustomersFrom
|
||||
GLMixed_AfterDividend.DateExecution = New Date(Me.AccountYearClose, 12, 31)
|
||||
GLMixed_AfterDividend.DateCreated = GLMixed_AfterDividend.DateExecution
|
||||
GLMixed_AfterDividend.DatePayment = GLMixed_AfterDividend.DateExecution
|
||||
GLMixed_AfterDividend.CurrencyName = Session.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
||||
GLMixed_AfterDividend.Save()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Property ShortName As String
|
||||
Get
|
||||
Return _ShortName
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("ShortName", _ShortName, 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 AccountYearClose As Long
|
||||
Get
|
||||
Return _AccountYearClose
|
||||
End Get
|
||||
Set(value As Long)
|
||||
SetPropertyValue("AccountYearClose", _AccountYearClose, value)
|
||||
End Set
|
||||
End Property
|
||||
Property AccountYearOpen As Long
|
||||
Get
|
||||
Return _AccountYearOpen
|
||||
End Get
|
||||
Set(value As Long)
|
||||
SetPropertyValue("AccountYearOpen", _AccountYearOpen, 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
|
||||
Property IsEditable As Boolean
|
||||
Get
|
||||
Return _IsEditable
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
SetPropertyValue("IsEditable", _IsEditable, value)
|
||||
End Set
|
||||
End Property
|
||||
Property IsClosedBallance As Boolean
|
||||
Get
|
||||
Return _IsClosedBallance
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
SetPropertyValue("IsClosedBallance", _IsClosedBallance, value)
|
||||
End Set
|
||||
End Property
|
||||
Property IsClosedSheetProfit As Boolean
|
||||
Get
|
||||
Return _IsClosedSheetProfit
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
SetPropertyValue("IsClosedSheetProfit", _IsClosedSheetProfit, value)
|
||||
End Set
|
||||
End Property
|
||||
Property IsDividend As Boolean
|
||||
Get
|
||||
Return _IsDividend
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
SetPropertyValue("IsDividend", _IsDividend, value)
|
||||
End Set
|
||||
End Property
|
||||
Property IsOpenNew As Boolean
|
||||
Get
|
||||
Return _IsOpenNew
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
SetPropertyValue("IsOpenNew", _IsOpenNew, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Browsable(False)> _
|
||||
Property TrialBalanceHeaderBeforeClose As TrialBalanceHeader
|
||||
Get
|
||||
Return _TrialBalanceHeaderBeforeClose
|
||||
End Get
|
||||
Set(value As TrialBalanceHeader)
|
||||
SetPropertyValue("TrialBalanceHeaderBeforeClose", _TrialBalanceHeaderBeforeClose, value)
|
||||
End Set
|
||||
End Property
|
||||
<Browsable(False)> _
|
||||
Property TrialBalanceHeaderAfterClose_Ballance As TrialBalanceHeader
|
||||
Get
|
||||
Return _TrialBalanceHeaderAfterClose_Ballance
|
||||
End Get
|
||||
Set(value As TrialBalanceHeader)
|
||||
SetPropertyValue("TrialBalanceHeaderAfterClose_Ballance", _TrialBalanceHeaderAfterClose_Ballance, value)
|
||||
End Set
|
||||
End Property
|
||||
<Browsable(False)> _
|
||||
Property TrialBalanceHeaderAfterClose_SheetProfit As TrialBalanceHeader
|
||||
Get
|
||||
Return _TrialBalanceHeaderAfterClose_SheetProfit
|
||||
End Get
|
||||
Set(value As TrialBalanceHeader)
|
||||
SetPropertyValue("TrialBalanceHeaderAfterClose_SheetProfit", _TrialBalanceHeaderAfterClose_SheetProfit, value)
|
||||
End Set
|
||||
End Property
|
||||
<Browsable(False)> _
|
||||
Property TrialBalanceHeaderAfterDividend As TrialBalanceHeader
|
||||
Get
|
||||
Return _TrialBalanceHeaderAfterDividend
|
||||
End Get
|
||||
Set(value As TrialBalanceHeader)
|
||||
SetPropertyValue("TrialBalanceHeaderAfterDividend", _TrialBalanceHeaderAfterDividend, value)
|
||||
End Set
|
||||
End Property
|
||||
<Browsable(False)> _
|
||||
Property TrialBalanceHeaderAfterOpen As TrialBalanceHeader
|
||||
Get
|
||||
Return _TrialBalanceHeaderAfterOpen
|
||||
End Get
|
||||
Set(value As TrialBalanceHeader)
|
||||
SetPropertyValue("TrialBalanceHeaderAfterOpen", _TrialBalanceHeaderAfterOpen, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<VisibleInListView(False), VisibleInDetailView(False), VisibleInLookupListView(False)> _
|
||||
Property GLMixed_AfterClose_SheetProfit As GLMixed
|
||||
Get
|
||||
Return _GLMixed_AfterClose_SheetProfit
|
||||
End Get
|
||||
Set(value As GLMixed)
|
||||
SetPropertyValue("GLMixed_AfterClose_SheetProfit", _GLMixed_AfterClose_SheetProfit, value)
|
||||
End Set
|
||||
End Property
|
||||
<VisibleInListView(False), VisibleInDetailView(False), VisibleInLookupListView(False)> _
|
||||
Property GLMixed_AfterClose_Ballance As GLMixed
|
||||
Get
|
||||
Return _GLMixed_AfterClose_Ballance
|
||||
End Get
|
||||
Set(value As GLMixed)
|
||||
SetPropertyValue("GLMixed_AfterClose_Ballance", _GLMixed_AfterClose_Ballance, value)
|
||||
End Set
|
||||
End Property
|
||||
<VisibleInListView(False), VisibleInDetailView(False), VisibleInLookupListView(False)> _
|
||||
Property GLMixed_AfterDividend As GLMixed
|
||||
Get
|
||||
Return _GLMixed_AfterDividend
|
||||
End Get
|
||||
Set(value As GLMixed)
|
||||
SetPropertyValue("GLMixed_AfterDividend", _GLMixed_AfterDividend, value)
|
||||
End Set
|
||||
End Property
|
||||
<VisibleInListView(False), VisibleInDetailView(False), VisibleInLookupListView(False)> _
|
||||
Property GLMixed_AfterOpen As GLMixed
|
||||
Get
|
||||
Return _GLMixed_AfterOpen
|
||||
End Get
|
||||
Set(value As GLMixed)
|
||||
SetPropertyValue("GLMixed_AfterOpen", _GLMixed_AfterOpen, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'//XPCollections
|
||||
'<Association("GLOpenCloseHeader-GLOpenCloseRows", GetType(GLOpenCloseRows)), VisibleInListView(False), VisibleInLookupListView(False)> _
|
||||
'ReadOnly Property GLOpenCloseRows As XPCollection(Of GLOpenCloseRows)
|
||||
' Get
|
||||
' Return GetCollection(Of GLOpenCloseRows)("GLOpenCloseRows")
|
||||
' End Get
|
||||
'End Property
|
||||
End Class
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
Partial Class GLOpenCloseVC
|
||||
|
||||
<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.aGenerateOpenCloseRows = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aCloseAccountYearBallance = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aReopenAccountYear = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aCloseAccountYearSheetProfit = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aOpenNewAccountYear = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aGenerateTrialBalanceDividend = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aRepairBadGLRows = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
'
|
||||
'aGenerateOpenCloseRows
|
||||
'
|
||||
Me.aGenerateOpenCloseRows.Caption = "aGenerate Open Close Rows"
|
||||
Me.aGenerateOpenCloseRows.ConfirmationMessage = "Do you want to execute command ?"
|
||||
Me.aGenerateOpenCloseRows.Id = "aGenerateOpenCloseRows"
|
||||
Me.aGenerateOpenCloseRows.ImageName = Nothing
|
||||
Me.aGenerateOpenCloseRows.Shortcut = Nothing
|
||||
Me.aGenerateOpenCloseRows.Tag = Nothing
|
||||
Me.aGenerateOpenCloseRows.TargetObjectsCriteria = Nothing
|
||||
Me.aGenerateOpenCloseRows.TargetObjectType = GetType(Nuvolar.[Module].GLOpenCloseHeader)
|
||||
Me.aGenerateOpenCloseRows.TargetViewId = Nothing
|
||||
Me.aGenerateOpenCloseRows.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aGenerateOpenCloseRows.ToolTip = Nothing
|
||||
Me.aGenerateOpenCloseRows.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aCloseAccountYearBallance
|
||||
'
|
||||
Me.aCloseAccountYearBallance.Caption = "aClose Account Year"
|
||||
Me.aCloseAccountYearBallance.ConfirmationMessage = "Are you sure ?"
|
||||
Me.aCloseAccountYearBallance.Id = "aCloseAccountYearBallance"
|
||||
Me.aCloseAccountYearBallance.ImageName = Nothing
|
||||
Me.aCloseAccountYearBallance.Shortcut = Nothing
|
||||
Me.aCloseAccountYearBallance.Tag = Nothing
|
||||
Me.aCloseAccountYearBallance.TargetObjectsCriteria = Nothing
|
||||
Me.aCloseAccountYearBallance.TargetObjectType = GetType(Nuvolar.[Module].GLOpenCloseHeader)
|
||||
Me.aCloseAccountYearBallance.TargetViewId = Nothing
|
||||
Me.aCloseAccountYearBallance.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aCloseAccountYearBallance.ToolTip = Nothing
|
||||
Me.aCloseAccountYearBallance.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aReopenAccountYear
|
||||
'
|
||||
Me.aReopenAccountYear.Caption = "aReopen Account Year"
|
||||
Me.aReopenAccountYear.ConfirmationMessage = "Are you sure ?"
|
||||
Me.aReopenAccountYear.Id = "aReopenAccountYear"
|
||||
Me.aReopenAccountYear.ImageName = Nothing
|
||||
Me.aReopenAccountYear.Shortcut = Nothing
|
||||
Me.aReopenAccountYear.Tag = Nothing
|
||||
Me.aReopenAccountYear.TargetObjectsCriteria = Nothing
|
||||
Me.aReopenAccountYear.TargetObjectType = GetType(Nuvolar.[Module].GLOpenCloseHeader)
|
||||
Me.aReopenAccountYear.TargetViewId = Nothing
|
||||
Me.aReopenAccountYear.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aReopenAccountYear.ToolTip = Nothing
|
||||
Me.aReopenAccountYear.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aCloseAccountYearSheetProfit
|
||||
'
|
||||
Me.aCloseAccountYearSheetProfit.Caption = "aClose Account Year Sheet Profit"
|
||||
Me.aCloseAccountYearSheetProfit.ConfirmationMessage = "Are you sure ?"
|
||||
Me.aCloseAccountYearSheetProfit.Id = "aCloseAccountYearSheetProfit"
|
||||
Me.aCloseAccountYearSheetProfit.ImageName = Nothing
|
||||
Me.aCloseAccountYearSheetProfit.Shortcut = Nothing
|
||||
Me.aCloseAccountYearSheetProfit.Tag = Nothing
|
||||
Me.aCloseAccountYearSheetProfit.TargetObjectsCriteria = Nothing
|
||||
Me.aCloseAccountYearSheetProfit.TargetObjectType = GetType(Nuvolar.[Module].GLOpenCloseHeader)
|
||||
Me.aCloseAccountYearSheetProfit.TargetViewId = Nothing
|
||||
Me.aCloseAccountYearSheetProfit.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aCloseAccountYearSheetProfit.ToolTip = Nothing
|
||||
Me.aCloseAccountYearSheetProfit.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aOpenNewAccountYear
|
||||
'
|
||||
Me.aOpenNewAccountYear.Caption = "aOpen New Account Year"
|
||||
Me.aOpenNewAccountYear.ConfirmationMessage = "Do you want to execute command ?"
|
||||
Me.aOpenNewAccountYear.Id = "aOpenNewAccountYear"
|
||||
Me.aOpenNewAccountYear.ImageName = Nothing
|
||||
Me.aOpenNewAccountYear.Shortcut = Nothing
|
||||
Me.aOpenNewAccountYear.Tag = Nothing
|
||||
Me.aOpenNewAccountYear.TargetObjectsCriteria = Nothing
|
||||
Me.aOpenNewAccountYear.TargetObjectType = GetType(Nuvolar.[Module].GLOpenCloseHeader)
|
||||
Me.aOpenNewAccountYear.TargetViewId = Nothing
|
||||
Me.aOpenNewAccountYear.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aOpenNewAccountYear.ToolTip = Nothing
|
||||
Me.aOpenNewAccountYear.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aGenerateTrialBalanceDividend
|
||||
'
|
||||
Me.aGenerateTrialBalanceDividend.Caption = "aGenerate Trial Balance Dividend"
|
||||
Me.aGenerateTrialBalanceDividend.ConfirmationMessage = "Are you sure ?"
|
||||
Me.aGenerateTrialBalanceDividend.Id = "aGenerateTrialBalanceDividend"
|
||||
Me.aGenerateTrialBalanceDividend.ImageName = Nothing
|
||||
Me.aGenerateTrialBalanceDividend.Shortcut = Nothing
|
||||
Me.aGenerateTrialBalanceDividend.Tag = Nothing
|
||||
Me.aGenerateTrialBalanceDividend.TargetObjectsCriteria = Nothing
|
||||
Me.aGenerateTrialBalanceDividend.TargetObjectType = GetType(Nuvolar.[Module].GLOpenCloseHeader)
|
||||
Me.aGenerateTrialBalanceDividend.TargetViewId = Nothing
|
||||
Me.aGenerateTrialBalanceDividend.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aGenerateTrialBalanceDividend.ToolTip = Nothing
|
||||
Me.aGenerateTrialBalanceDividend.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aRepairBadGLRows
|
||||
'
|
||||
Me.aRepairBadGLRows.Caption = "aRepair Bad GLRows"
|
||||
Me.aRepairBadGLRows.ConfirmationMessage = "Do you want to execute command ?"
|
||||
Me.aRepairBadGLRows.Id = "aRepairBadGLRows"
|
||||
Me.aRepairBadGLRows.ImageName = Nothing
|
||||
Me.aRepairBadGLRows.Shortcut = Nothing
|
||||
Me.aRepairBadGLRows.Tag = Nothing
|
||||
Me.aRepairBadGLRows.TargetObjectsCriteria = Nothing
|
||||
Me.aRepairBadGLRows.TargetObjectType = GetType(Nuvolar.[Module].GLOpenCloseHeader)
|
||||
Me.aRepairBadGLRows.TargetViewId = Nothing
|
||||
Me.aRepairBadGLRows.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aRepairBadGLRows.ToolTip = Nothing
|
||||
Me.aRepairBadGLRows.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aGenerateOpenCloseRows As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aCloseAccountYearBallance As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aReopenAccountYear As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aCloseAccountYearSheetProfit As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aOpenNewAccountYear As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aGenerateTrialBalanceDividend As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aRepairBadGLRows As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
|
||||
End Class
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
<?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="aGenerateOpenCloseRows.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aCloseAccountYearBallance.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>213, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aReopenAccountYear.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>414, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aCloseAccountYearSheetProfit.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>582, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aOpenNewAccountYear.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>1019, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aGenerateTrialBalanceDividend.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>798, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aRepairBadGLRows.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>1200, 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>
|
||||
+675
@@ -0,0 +1,675 @@
|
||||
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.Data.Filtering
|
||||
Imports System.Linq
|
||||
Imports System.Linq.Expressions
|
||||
Imports DevExpress.ExpressApp.SystemModule
|
||||
|
||||
Public Class GLOpenCloseVC
|
||||
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
|
||||
Protected Overrides Sub OnActivated()
|
||||
MyBase.OnActivated()
|
||||
End Sub
|
||||
Protected Overrides Sub OnDeactivated()
|
||||
MyBase.OnDeactivated()
|
||||
End Sub
|
||||
|
||||
Private Sub aGenerateOpenCloseRows_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aGenerateOpenCloseRows.Execute
|
||||
Try
|
||||
|
||||
GLOBAL_HAS_Audit = False
|
||||
|
||||
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _uow As New UnitOfWork(_onew.Session.DataLayer)
|
||||
Dim _GLOpenCloseHeader As GLOpenCloseHeader = _uow.GetObjectByKey(Of GLOpenCloseHeader)(_onew.GetObject(TryCast(View.SelectedObjects(0), GLOpenCloseHeader)).Oid)
|
||||
'Dim _GLOpenCloseRows As GLOpenCloseRows
|
||||
|
||||
'Dim _GLOpenCloseRows_Collection As New XPCollection(Of GLOpenCloseRows)(_uow, CriteriaOperator.Parse("GLOpenCloseHeader.Oid=?", _GLOpenCloseHeader.Oid))
|
||||
'_uow.Delete(_GLOpenCloseRows_Collection)
|
||||
|
||||
Dim _ChartOfAccounts As ChartOfAccounts
|
||||
Dim _ChartOfAccounts_Collection As New XPCollection(Of ChartOfAccounts)(_uow, CriteriaOperator.Parse("AccountYear=? and IsParent=False", _GLOpenCloseHeader.AccountYearClose))
|
||||
|
||||
Dim _DebitAmountHUF As Double = 0
|
||||
Dim _CreditAmountHUF As Double = 0
|
||||
Dim _GLRows_Collection As New XPQuery(Of GLRows)(_uow)
|
||||
|
||||
Dim _ChartOfAccounts_491 As ChartOfAccounts = _uow.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountNumber='491' and AccountYear=?", _GLOpenCloseHeader.AccountYearOpen))
|
||||
Dim _ChartOfAccounts_599 As ChartOfAccounts = _uow.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountNumber='599' and AccountYear=?", _GLOpenCloseHeader.AccountYearClose))
|
||||
Dim _ChartOfAccounts_493 As ChartOfAccounts = _uow.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountNumber='493' and AccountYear=?", _GLOpenCloseHeader.AccountYearClose))
|
||||
Dim _ChartOfAccounts_492 As ChartOfAccounts = _uow.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountNumber='492' and AccountYear=?", _GLOpenCloseHeader.AccountYearClose))
|
||||
|
||||
'RaiseEvent InitWork(1, 1, _ChartOfAccounts_Collection.Count)
|
||||
'For Each _ChartOfAccounts In _ChartOfAccounts_Collection
|
||||
' RaiseEvent DoWork()
|
||||
' _DebitAmountHUF = 0
|
||||
' _CreditAmountHUF = 0
|
||||
|
||||
' Dim query_d = From _GLRows In _GLRows_Collection
|
||||
' Where _GLRows.DebitChartOfAccounts.AccountNumber = _ChartOfAccounts.AccountNumber And _
|
||||
' _GLRows.GLHeader.IsEditable = False And _
|
||||
' _GLRows.GLHeader.DateExecution.Year >= _GLOpenCloseHeader.AccountYearClose And _
|
||||
' _GLRows.GLHeader.CustomersFrom Is _GLOpenCloseHeader.CustomersFrom And _
|
||||
' _GLRows.GLHeader.DateExecution.Year < _GLOpenCloseHeader.AccountYearOpen _
|
||||
' Group _GLRows By _GLRows.DebitChartOfAccounts.AccountNumber Into gg = Group
|
||||
' Select New With {Key .DebitAmountHUF = gg.Sum(Function(inv) inv.AmountHUF)}
|
||||
' For Each item In query_d
|
||||
' _DebitAmountHUF = Math.Round(item.DebitAmountHUF, 2, MidpointRounding.AwayFromZero)
|
||||
' Next
|
||||
|
||||
' Dim query_c = From _GLRows In _GLRows_Collection
|
||||
' Where _GLRows.CreditChartOfAccounts.AccountNumber = _ChartOfAccounts.AccountNumber And _
|
||||
' _GLRows.GLHeader.IsEditable = False And _
|
||||
' _GLRows.GLHeader.DateExecution.Year >= _GLOpenCloseHeader.AccountYearClose And _
|
||||
' _GLRows.GLHeader.CustomersFrom Is _GLOpenCloseHeader.CustomersFrom And _
|
||||
' _GLRows.GLHeader.DateExecution.Year < _GLOpenCloseHeader.AccountYearOpen _
|
||||
' Group _GLRows By _GLRows.CreditChartOfAccounts.AccountNumber Into gg = Group
|
||||
' Select New With {Key .CreditAmountHUF = gg.Sum(Function(inv) inv.AmountHUF)}
|
||||
' For Each item In query_c
|
||||
' _CreditAmountHUF = Math.Round(item.CreditAmountHUF, 2, MidpointRounding.AwayFromZero)
|
||||
' Next
|
||||
|
||||
' If _DebitAmountHUF - _CreditAmountHUF <> 0 Then
|
||||
' _GLOpenCloseRows = _uow.FindObject(Of GLOpenCloseRows)(CriteriaOperator.Parse("ChartOfAccounts.AccountNumber=? and GLOpenCloseHeader.Oid=?", _ChartOfAccounts.AccountNumber, _GLOpenCloseHeader.Oid))
|
||||
' If _GLOpenCloseRows Is Nothing Then
|
||||
' _GLOpenCloseRows = New GLOpenCloseRows(_uow)
|
||||
' _GLOpenCloseRows.GLOpenCloseHeader = _GLOpenCloseHeader
|
||||
' End If
|
||||
|
||||
' If _DebitAmountHUF >= _CreditAmountHUF Then
|
||||
' _GLOpenCloseRows.DebitAmountHUF = _DebitAmountHUF - _CreditAmountHUF
|
||||
' Else
|
||||
' _GLOpenCloseRows.CreditAmountHUF = _CreditAmountHUF - _DebitAmountHUF
|
||||
' End If
|
||||
|
||||
' _GLOpenCloseRows.ChartOfAccounts = _ChartOfAccounts
|
||||
|
||||
|
||||
' Select Case Mid(_ChartOfAccounts.AccountNumber, 1, 1)
|
||||
' Case "5"
|
||||
' _GLOpenCloseRows.OnlyClose = True
|
||||
' _GLOpenCloseRows.ChartOfAccountsClose = _ChartOfAccounts_599
|
||||
' Case "8", "9"
|
||||
' _GLOpenCloseRows.OnlyClose = True
|
||||
' _GLOpenCloseRows.ChartOfAccountsClose = _ChartOfAccounts_493
|
||||
' Case Else
|
||||
' _GLOpenCloseRows.OnlyClose = False
|
||||
' _GLOpenCloseRows.ChartOfAccountsClose = _ChartOfAccounts_492
|
||||
' _GLOpenCloseRows.ChartOfAccountsOpen = _ChartOfAccounts_491
|
||||
' End Select
|
||||
' End If
|
||||
' _uow.CommitChanges()
|
||||
'Next
|
||||
'_uow.CommitChanges()
|
||||
'RaiseEvent FinalWork
|
||||
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceNew(_onew, _GLOpenCloseHeader.TrialBalanceHeaderBeforeClose)
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceOpenClose(_onew, _GLOpenCloseHeader.TrialBalanceHeaderBeforeClose)
|
||||
_uow.CommitChanges()
|
||||
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "HIBA !")
|
||||
Finally
|
||||
GLOBAL_HAS_Audit = True
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Private Sub aCloseAccountYearBallance_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aCloseAccountYearBallance.Execute
|
||||
'// Mérleg számlák lezárása csak akkor, ha már van eredményszámla lezárás
|
||||
'// K1-4 T492 12.31
|
||||
'// T1-4 K491 01.01
|
||||
|
||||
|
||||
'// Nem lehet olyan tétel, ami nincs feladva erre az évre !
|
||||
'// InvoiceHeader
|
||||
'// Registryheader
|
||||
Try
|
||||
GLOBAL_HAS_Audit = False
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _GLOpenCloseHeader As GLOpenCloseHeader = _onew.GetObject(TryCast(View.SelectedObjects(0), GLOpenCloseHeader))
|
||||
'Dim _GLOpenCloseRows As GLOpenCloseRows
|
||||
Dim _TrialBalance As TrialBalance
|
||||
Dim _LiquidAssetsYear As LiquidAssetsYear
|
||||
Dim _GLBank As GLBank
|
||||
Dim _GLCassa As GLCassa
|
||||
|
||||
Dim _GLRows_Close As GLRows
|
||||
Dim _ChartOfAccounts_492 As ChartOfAccounts = _onew.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountNumber='492' and AccountYear=?", _GLOpenCloseHeader.AccountYearClose))
|
||||
|
||||
Dim IsOk As Boolean = True
|
||||
Dim _ChartOfAccounts_Ok As ChartOfAccounts = Nothing
|
||||
'// Ellenõrzések ---------------------------------------------------------------------------
|
||||
'RaiseEvent InitWork(1, 1, _GLOpenCloseHeader.GLOpenCloseRows.Count)
|
||||
'For Each _GLOpenCloseRows In _GLOpenCloseHeader.GLOpenCloseRows
|
||||
' RaiseEvent DoWork()
|
||||
' Select Case Mid(_GLOpenCloseRows.ChartOfAccounts.AccountNumber, 1, 1)
|
||||
' Case "1", "2", "3", "4"
|
||||
' _ChartOfAccounts_Ok = _onew.FindObject(Of ChartOfAccounts) _
|
||||
' (CriteriaOperator.Parse("AccountNumber=? and AccountYear=?", _GLOpenCloseRows.ChartOfAccounts.AccountNumber, _GLOpenCloseHeader.AccountYearOpen))
|
||||
' If _ChartOfAccounts_Ok Is Nothing Then
|
||||
' RaiseEvent FinalWork
|
||||
' Throw New Exception(String.Format("Nincs megnyitva ez a főkönyvi számla: {0}", _GLOpenCloseRows.ChartOfAccounts.Name))
|
||||
' End If
|
||||
' End Select
|
||||
'Next
|
||||
'RaiseEvent FinalWork
|
||||
'// Zárási bizonylat -----------------------------------------------------------------------
|
||||
If _GLOpenCloseHeader.GLMixed_AfterClose_Ballance IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.GLRows)
|
||||
Else
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance = _onew.CreateObject(Of GLMixed)()
|
||||
End If
|
||||
|
||||
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.CurrencyName = _onew.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.CurrencyRate = 1
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.CustomersFrom = _GLOpenCloseHeader.CustomersFrom
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.DateCreated = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.DateExecution = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.DatePayment = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.DocumentNumber = _GLOpenCloseHeader.ShortName & " - mérlegszámla záró"
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.GLDocumentType = eGLDocumentType.eGLMixed
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.GLOpenCloseHeader = _GLOpenCloseHeader
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.IsEditable = False
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.IsStorno = False
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.NoteHeader = ""
|
||||
|
||||
RaiseEvent InitWork(1, 1, _GLOpenCloseHeader.TrialBalanceHeaderAfterDividend.TrialBalance.Count)
|
||||
For Each _TrialBalance In _GLOpenCloseHeader.TrialBalanceHeaderAfterDividend.TrialBalance
|
||||
RaiseEvent DoWork()
|
||||
Select Case Mid(_TrialBalance.ChartOfAccounts.AccountNumber, 1, 1)
|
||||
Case "1", "2", "3", "4"
|
||||
If _TrialBalance.ChartOfAccounts.IsParent = False Then
|
||||
_GLRows_Close = _onew.CreateObject(Of GLRows)()
|
||||
_GLRows_Close.GLHeader = _GLOpenCloseHeader.GLMixed_AfterClose_Ballance
|
||||
_GLRows_Close.GLRowsGUID = Guid.NewGuid
|
||||
If (_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF) > 0 Then
|
||||
_GLRows_Close.DebitChartOfAccounts = _ChartOfAccounts_492
|
||||
_GLRows_Close.CreditChartOfAccounts = _TrialBalance.ChartOfAccounts
|
||||
_GLRows_Close.AmountHUF = Math.Abs(_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF)
|
||||
_LiquidAssetsYear = _onew.FindObject(Of LiquidAssetsYear) _
|
||||
(CriteriaOperator.Parse("AccountYear=? and ChartOfAccounts=? and LiquidAssets.CustomerFrom.Oid=?", _
|
||||
_GLRows_Close.GLHeader.DateExecution.Year, _GLRows_Close.CreditChartOfAccounts, _GLOpenCloseHeader.CustomersFrom.Oid))
|
||||
'// Ha pénzeszköz, akkor HUF + DEV érték lezárása is !
|
||||
If _LiquidAssetsYear IsNot Nothing Then
|
||||
_GLRows_Close.LiquidAssets = _LiquidAssetsYear.LiquidAssets
|
||||
|
||||
Select Case _LiquidAssetsYear.LiquidAssets.LiquidAssetsType
|
||||
Case eLiquidAssetsType.NormalBank
|
||||
_GLBank = _onew.FindObject(Of GLBank)(CriteriaOperator.Parse("LiquidAssets_Main=?", _LiquidAssetsYear.LiquidAssets))
|
||||
If _GLBank IsNot Nothing Then
|
||||
_GLRows_Close.AmountDEV = _GLBank.GetBallanceDEV(_LiquidAssetsYear.LiquidAssets, _GLRows_Close.GLHeader.DateExecution)
|
||||
End If
|
||||
Case eLiquidAssetsType.DepositCheckout, eLiquidAssetsType.NormalCheckout, eLiquidAssetsType.CurrencyCheckout
|
||||
_GLCassa = _onew.FindObject(Of GLCassa)(CriteriaOperator.Parse("LiquidAssets_Cassa=?", _LiquidAssetsYear.LiquidAssets))
|
||||
If _GLCassa IsNot Nothing Then
|
||||
_GLRows_Close.AmountDEV = _GLCassa.GetBallanceDEV(_LiquidAssetsYear.LiquidAssets, _GLRows_Close.GLHeader.DateExecution)
|
||||
End If
|
||||
End Select
|
||||
|
||||
End If
|
||||
Else
|
||||
_GLRows_Close.CreditChartOfAccounts = _ChartOfAccounts_492
|
||||
_GLRows_Close.DebitChartOfAccounts = _TrialBalance.ChartOfAccounts
|
||||
_GLRows_Close.AmountHUF = Math.Abs(_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF)
|
||||
_LiquidAssetsYear = _onew.FindObject(Of LiquidAssetsYear) _
|
||||
(CriteriaOperator.Parse("AccountYear=? and ChartOfAccounts=? and LiquidAssets.CustomerFrom.Oid=?", _
|
||||
_GLRows_Close.GLHeader.DateExecution.Year, _GLRows_Close.DebitChartOfAccounts, _GLOpenCloseHeader.CustomersFrom.Oid))
|
||||
'// Ha pénzeszköz, akkor HUF + DEV érték lezárása is !
|
||||
If _LiquidAssetsYear IsNot Nothing Then
|
||||
_GLRows_Close.LiquidAssets = _LiquidAssetsYear.LiquidAssets
|
||||
|
||||
Select Case _LiquidAssetsYear.LiquidAssets.LiquidAssetsType
|
||||
Case eLiquidAssetsType.NormalBank
|
||||
_GLBank = _onew.FindObject(Of GLBank)(CriteriaOperator.Parse("LiquidAssets_Main=?", _LiquidAssetsYear.LiquidAssets))
|
||||
If _GLBank IsNot Nothing Then
|
||||
_GLRows_Close.AmountDEV = _GLBank.GetBallanceDEV(_LiquidAssetsYear.LiquidAssets, _GLRows_Close.GLHeader.DateExecution)
|
||||
End If
|
||||
Case eLiquidAssetsType.DepositCheckout, eLiquidAssetsType.NormalCheckout, eLiquidAssetsType.CurrencyCheckout
|
||||
_GLCassa = _onew.FindObject(Of GLCassa)(CriteriaOperator.Parse("LiquidAssets_Cassa=?", _LiquidAssetsYear.LiquidAssets))
|
||||
If _GLCassa IsNot Nothing Then
|
||||
_GLRows_Close.AmountDEV = _GLCassa.GetBallanceDEV(_LiquidAssetsYear.LiquidAssets, _GLRows_Close.GLHeader.DateExecution)
|
||||
End If
|
||||
End Select
|
||||
|
||||
End If
|
||||
End If
|
||||
_GLRows_Close.DateExecution = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLRows_Close.GLRowsTypeVAT = eGLRowsTypeVAT.eNettoRow
|
||||
_GLRows_Close.NoteRows = "-> 492"
|
||||
_GLRows_Close.PartnerType = ePartnerType.eNotSet
|
||||
_GLRows_Close.TransactionType = eTransactionType.eNotSet
|
||||
|
||||
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
RaiseEvent FinalWork
|
||||
_GLOpenCloseHeader.IsClosedSheetProfit = True
|
||||
_GLOpenCloseHeader.IsClosedBallance = True
|
||||
_onew.CommitChanges()
|
||||
|
||||
'// Záró utáni fk. kivonat lekérdezése !!!
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceNew(_onew, _GLOpenCloseHeader.TrialBalanceHeaderAfterClose_Ballance)
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceOpenClose(_onew, _GLOpenCloseHeader.TrialBalanceHeaderAfterClose_Ballance)
|
||||
_onew.CommitChanges()
|
||||
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "HIBA !")
|
||||
Finally
|
||||
|
||||
GLOBAL_HAS_Audit = True
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Private Sub aCloseAccountYearSheetProfit_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aCloseAccountYearSheetProfit.Execute
|
||||
'// Eredményszámlák zárása
|
||||
'// 5 -> K599 -> T419
|
||||
Try
|
||||
GLOBAL_HAS_Audit = False
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _GLOpenCloseHeader As GLOpenCloseHeader = _onew.GetObject(TryCast(View.SelectedObjects(0), GLOpenCloseHeader))
|
||||
|
||||
Dim _GLRows As GLRows
|
||||
|
||||
Dim _AmountHUF_599 As Double = 0
|
||||
'// Ellenõrzések ---------------------------------------------------------------------------
|
||||
'Dim _InvoiceHeader_Collection As New XPCollection(Of InvoiceHeader)(_ocur.Session, CriteriaOperator.Parse("GetYear(DateExecution)=? and isnull(GLAccounts)=True and InvoiceType.InvoiceTypeBase in (0,1,2,3)", _GLOpenCloseHeader.AccountYearClose))
|
||||
'If _InvoiceHeader_Collection.Count > 0 Then
|
||||
' Throw New Exception("*Van még erre az évre olyan kimenõ számla, ami nincs lekönyvelve !")
|
||||
'End If
|
||||
'Dim _RegistryHeader_Collection As New XPCollection(Of RegistryHeader)(_ocur.Session, CriteriaOperator.Parse("GetYear(F_DateExecution)=? and isnull(F_GLAccounts)=True and RegistryType.RegistryMainType in (0,2,3,4)", _GLOpenCloseHeader.AccountYearClose))
|
||||
'If _RegistryHeader_Collection.Count > 0 Then
|
||||
' Throw New Exception("*Van még erre az évre olyan iktatott számla, ami nincs lekönyvelve !")
|
||||
'End If
|
||||
|
||||
'// Ellenõrzés, hogy van-e 599 fk. számla és az levél-e?
|
||||
Dim _ChartOfAccounts_599 As ChartOfAccounts = _onew.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber='599'", _GLOpenCloseHeader.AccountYearClose))
|
||||
If _ChartOfAccounts_599 IsNot Nothing Then
|
||||
If _ChartOfAccounts_599.Children.Count > 0 Then
|
||||
Throw New Exception("*Nem könyvelhetõ az 599 költség záró számla, mert vannak gyermekei !")
|
||||
End If
|
||||
Else
|
||||
Throw New Exception("*Nincs 599 költség záró számla !")
|
||||
End If
|
||||
|
||||
'// Ellenõrzés, hogy van-e 493 fk. számla és az levél-e?
|
||||
Dim _ChartOfAccounts_493 As ChartOfAccounts = _onew.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber='493'", _GLOpenCloseHeader.AccountYearClose))
|
||||
If _ChartOfAccounts_493 IsNot Nothing Then
|
||||
If _ChartOfAccounts_493.Children.Count > 0 Then
|
||||
Throw New Exception("*Nem könyvelhetõ az 493 számla, mert vannak gyermekei !")
|
||||
End If
|
||||
Else
|
||||
Throw New Exception("*Nincs 493 eredmény záró számla !")
|
||||
End If
|
||||
|
||||
'// 599 - 493 Zárási bizonylat -----------------------------------------------------------------------
|
||||
If _GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.GLRows)
|
||||
Else
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit = _onew.CreateObject(Of GLMixed)()
|
||||
End If
|
||||
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.CurrencyName = _onew.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.CurrencyRate = 1
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.CustomersFrom = _GLOpenCloseHeader.CustomersFrom
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.DateCreated = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.DateExecution = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.DatePayment = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.DocumentNumber = _GLOpenCloseHeader.ShortName & " - eredményszámla záró"
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.GLDocumentType = eGLDocumentType.eGLMixed
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.GLOpenCloseHeader = _GLOpenCloseHeader
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.IsEditable = False
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.IsStorno = False
|
||||
_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.NoteHeader = ""
|
||||
|
||||
RaiseEvent InitWork(1, 1, _GLOpenCloseHeader.TrialBalanceHeaderBeforeClose.TrialBalance.Count)
|
||||
For Each _TrialBalance As TrialBalance In _GLOpenCloseHeader.TrialBalanceHeaderBeforeClose.TrialBalance
|
||||
RaiseEvent DoWork()
|
||||
If _TrialBalance.ChartOfAccounts.AccountNumber Like "5*" And _TrialBalance.ChartOfAccounts.IsParent = False Then
|
||||
_GLRows = _onew.CreateObject(Of GLRows)()
|
||||
_GLRows.GLHeader = _GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit
|
||||
_GLRows.GLRowsGUID = Guid.NewGuid
|
||||
If (_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF) > 0 Then
|
||||
_GLRows.DebitChartOfAccounts = _ChartOfAccounts_599
|
||||
_GLRows.CreditChartOfAccounts = _TrialBalance.ChartOfAccounts
|
||||
_GLRows.AmountHUF = Math.Abs(_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF)
|
||||
_AmountHUF_599 += _GLRows.AmountHUF
|
||||
Else
|
||||
_GLRows.CreditChartOfAccounts = _ChartOfAccounts_599
|
||||
_GLRows.DebitChartOfAccounts = _TrialBalance.ChartOfAccounts
|
||||
_GLRows.AmountHUF = Math.Abs(_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF)
|
||||
_AmountHUF_599 -= _GLRows.AmountHUF
|
||||
End If
|
||||
_GLRows.DateExecution = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLRows.GLRowsTypeVAT = eGLRowsTypeVAT.eNettoRow
|
||||
_GLRows.NoteRows = "-> 599"
|
||||
_GLRows.PartnerType = ePartnerType.eNotSet
|
||||
_GLRows.TransactionType = eTransactionType.eNotSet
|
||||
End If
|
||||
Next
|
||||
RaiseEvent FinalWork
|
||||
'// K599 +K8 + T9 -> 493-re
|
||||
_GLRows = _onew.CreateObject(Of GLRows)()
|
||||
_GLRows.GLHeader = _GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit
|
||||
_GLRows.GLRowsGUID = Guid.NewGuid
|
||||
If _AmountHUF_599 > 0 Then
|
||||
_GLRows.DebitChartOfAccounts = _ChartOfAccounts_493
|
||||
_GLRows.CreditChartOfAccounts = _ChartOfAccounts_599
|
||||
_GLRows.AmountHUF = _AmountHUF_599
|
||||
Else
|
||||
_GLRows.CreditChartOfAccounts = _ChartOfAccounts_493
|
||||
_GLRows.DebitChartOfAccounts = _ChartOfAccounts_599
|
||||
_GLRows.AmountHUF = _AmountHUF_599
|
||||
End If
|
||||
_GLRows.DateExecution = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLRows.GLRowsTypeVAT = eGLRowsTypeVAT.eNettoRow
|
||||
_GLRows.NoteRows = "599 -> 493"
|
||||
_GLRows.PartnerType = ePartnerType.eNotSet
|
||||
_GLRows.TransactionType = eTransactionType.eNotSet
|
||||
|
||||
RaiseEvent InitWork(1, 1, _GLOpenCloseHeader.TrialBalanceHeaderBeforeClose.TrialBalance.Count)
|
||||
For Each _TrialBalance As TrialBalance In _GLOpenCloseHeader.TrialBalanceHeaderBeforeClose.TrialBalance
|
||||
RaiseEvent DoWork()
|
||||
If (_TrialBalance.ChartOfAccounts.AccountNumber Like "8*" Or _TrialBalance.ChartOfAccounts.AccountNumber Like "9*") And _TrialBalance.ChartOfAccounts.IsParent = False Then
|
||||
_GLRows = _onew.CreateObject(Of GLRows)()
|
||||
_GLRows.GLHeader = _GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit
|
||||
_GLRows.GLRowsGUID = Guid.NewGuid
|
||||
If (_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF) > 0 Then
|
||||
_GLRows.DebitChartOfAccounts = _ChartOfAccounts_493
|
||||
_GLRows.CreditChartOfAccounts = _TrialBalance.ChartOfAccounts
|
||||
_GLRows.AmountHUF = Math.Abs(_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF)
|
||||
Else
|
||||
_GLRows.CreditChartOfAccounts = _ChartOfAccounts_493
|
||||
_GLRows.DebitChartOfAccounts = _TrialBalance.ChartOfAccounts
|
||||
_GLRows.AmountHUF = Math.Abs(_TrialBalance.DebitAmountHUF - _TrialBalance.CreditAmountHUF)
|
||||
End If
|
||||
_GLRows.DateExecution = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLRows.GLRowsTypeVAT = eGLRowsTypeVAT.eNettoRow
|
||||
_GLRows.NoteRows = ""
|
||||
_GLRows.PartnerType = ePartnerType.eNotSet
|
||||
_GLRows.TransactionType = eTransactionType.eNotSet
|
||||
End If
|
||||
Next
|
||||
|
||||
'// Beállítani, hogy megtörtént az eredményszámlák zárása
|
||||
|
||||
_GLOpenCloseHeader.IsClosedSheetProfit = True
|
||||
_onew.CommitChanges()
|
||||
RaiseEvent FinalWork
|
||||
|
||||
'// Záró utáni fk. kivonat lekérdezése !!!
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceNew(_onew, _GLOpenCloseHeader.TrialBalanceHeaderAfterClose_SheetProfit)
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceOpenClose(_onew, _GLOpenCloseHeader.TrialBalanceHeaderAfterClose_SheetProfit)
|
||||
_onew.CommitChanges()
|
||||
|
||||
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "HIBA !")
|
||||
Finally
|
||||
GLOBAL_HAS_Audit = True
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Private Sub aReopenAccountYear_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aReopenAccountYear.Execute
|
||||
'// Lezárt év visszanyitása
|
||||
Try
|
||||
GLOBAL_HAS_Audit = False
|
||||
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _GLOpenCloseHeader As GLOpenCloseHeader = _onew.GetObject(TryCast(View.SelectedObjects(0), GLOpenCloseHeader))
|
||||
|
||||
If _GLOpenCloseHeader IsNot Nothing Then
|
||||
|
||||
|
||||
RaiseEvent InitWork(1, 1, 5)
|
||||
RaiseEvent DoWork()
|
||||
Dim _GLRows_Collection As New XPCollection(Of GLRows)(_onew.Session, CriteriaOperator.Parse("GLHeader.GLOpenCloseHeader=?", _GLOpenCloseHeader))
|
||||
_onew.Delete(_GLRows_Collection)
|
||||
|
||||
RaiseEvent DoWork()
|
||||
Dim _GLMixed_Collection As New XPCollection(Of GLMixed)(_onew.Session, CriteriaOperator.Parse("GLOpenCloseHeader=?", _GLOpenCloseHeader))
|
||||
_onew.Delete(_GLMixed_Collection)
|
||||
|
||||
_GLOpenCloseHeader.IsClosedBallance = False
|
||||
_GLOpenCloseHeader.IsClosedSheetProfit = False
|
||||
RaiseEvent DoWork()
|
||||
|
||||
'// Itt elég sok mindent kell törölni !
|
||||
If _GLOpenCloseHeader.TrialBalanceHeaderAfterClose_Ballance IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterClose_Ballance.TrialBalance)
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterClose_Ballance.TrialBalanceOpenClose)
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterClose_Ballance.TrialBalanceSum)
|
||||
End If
|
||||
If _GLOpenCloseHeader.TrialBalanceHeaderAfterClose_SheetProfit IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterClose_SheetProfit.TrialBalance)
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterClose_SheetProfit.TrialBalanceOpenClose)
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterClose_SheetProfit.TrialBalanceSum)
|
||||
End If
|
||||
If _GLOpenCloseHeader.TrialBalanceHeaderAfterDividend IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterDividend.TrialBalance)
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterDividend.TrialBalanceOpenClose)
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterDividend.TrialBalanceSum)
|
||||
End If
|
||||
|
||||
If _GLOpenCloseHeader.TrialBalanceHeaderAfterOpen IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterOpen.TrialBalance)
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterOpen.TrialBalanceOpenClose)
|
||||
_onew.Delete(_GLOpenCloseHeader.TrialBalanceHeaderAfterOpen.TrialBalanceSum)
|
||||
End If
|
||||
RaiseEvent DoWork()
|
||||
If _GLOpenCloseHeader.GLMixed_AfterClose_Ballance IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterClose_Ballance.GLRows)
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterClose_Ballance)
|
||||
End If
|
||||
|
||||
If _GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit.GLRows)
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterClose_SheetProfit)
|
||||
End If
|
||||
|
||||
If _GLOpenCloseHeader.GLMixed_AfterDividend IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterDividend.GLRows)
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterDividend)
|
||||
End If
|
||||
|
||||
If _GLOpenCloseHeader.GLMixed_AfterOpen IsNot Nothing Then
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterOpen.GLRows)
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterOpen)
|
||||
End If
|
||||
RaiseEvent DoWork()
|
||||
_GLOpenCloseHeader.IsClosedBallance = False
|
||||
_GLOpenCloseHeader.IsClosedSheetProfit = False
|
||||
_GLOpenCloseHeader.IsDividend = False
|
||||
_GLOpenCloseHeader.IsOpenNew = False
|
||||
_onew.CommitChanges()
|
||||
|
||||
RaiseEvent FinalWork
|
||||
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "HIBA !")
|
||||
Finally
|
||||
GLOBAL_HAS_Audit = True
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aOpenNewAccountYear_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aOpenNewAccountYear.Execute
|
||||
Try
|
||||
GLOBAL_HAS_Audit = False
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
|
||||
|
||||
Dim _GLOpenCloseHeader As GLOpenCloseHeader = _onew.GetObject(TryCast(View.SelectedObjects(0), GLOpenCloseHeader))
|
||||
Dim _GLRows_Open As GLRows
|
||||
|
||||
Dim _LiquidAssetsYear_Collection As New XPCollection(Of LiquidAssetsYear)(_onew.Session, CriteriaOperator.Parse("AccountYear=? and LiquidAssets.CustomerFrom.Oid=? and LiquidAssets.CurrencyName.ShortName<>'HUF'", _GLOpenCloseHeader.AccountYearOpen, _GLOpenCloseHeader.CustomersFrom.Oid))
|
||||
Dim _LiquidAssetsYear As LiquidAssetsYear
|
||||
|
||||
Dim _ChartOfAccounts_491 As ChartOfAccounts = _onew.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountNumber='491' and AccountYear=?", _GLOpenCloseHeader.AccountYearOpen))
|
||||
|
||||
If _GLOpenCloseHeader.GLMixed_AfterOpen Is Nothing Then
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen = _onew.CreateObject(Of GLMixed)()
|
||||
Else
|
||||
_onew.Delete(_GLOpenCloseHeader.GLMixed_AfterOpen.GLRows)
|
||||
End If
|
||||
_GLOpenCloseHeader.IsOpenNew = True
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen = _onew.CreateObject(Of GLMixed)()
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.CurrencyName = _onew.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.CurrencyRate = 1
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.CustomersFrom = _GLOpenCloseHeader.CustomersFrom
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.DateCreated = New Date(_GLOpenCloseHeader.AccountYearOpen, 1, 1)
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.DateExecution = New Date(_GLOpenCloseHeader.AccountYearOpen, 1, 1)
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.DatePayment = New Date(_GLOpenCloseHeader.AccountYearOpen, 1, 1)
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.DocumentNumber = _GLOpenCloseHeader.ShortName & " - mérlegszámla nyitó"
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.GLDocumentType = eGLDocumentType.eGLMixed
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.GLOpenCloseHeader = _GLOpenCloseHeader
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.IsEditable = False
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.IsStorno = False
|
||||
_GLOpenCloseHeader.GLMixed_AfterOpen.NoteHeader = ""
|
||||
|
||||
RaiseEvent InitWork(1, 1, _GLOpenCloseHeader.GLMixed_AfterClose_Ballance.GLRows.Count)
|
||||
For Each _GLRows_Close In _GLOpenCloseHeader.GLMixed_AfterClose_Ballance.GLRows
|
||||
RaiseEvent DoWork()
|
||||
_GLRows_Open = _onew.CreateObject(Of GLRows)()
|
||||
_GLRows_Open.GLHeader = _GLOpenCloseHeader.GLMixed_AfterOpen
|
||||
_GLRows_Open.GLRowsGUID = Guid.NewGuid
|
||||
|
||||
_GLRows_Open.AmountHUF = _GLRows_Close.AmountHUF
|
||||
_GLRows_Open.AmountDEV = _GLRows_Close.AmountDEV
|
||||
|
||||
If _GLRows_Close.CreditChartOfAccounts.AccountNumber = 492 Then
|
||||
_GLRows_Open.DebitChartOfAccounts = _ChartOfAccounts_491
|
||||
_GLRows_Open.CreditChartOfAccounts = _onew.FindObject(Of ChartOfAccounts) _
|
||||
(CriteriaOperator.Parse("AccountNumber=? and AccountYear=?", _GLRows_Close.DebitChartOfAccounts.AccountNumber, _GLOpenCloseHeader.AccountYearOpen))
|
||||
Else
|
||||
_GLRows_Open.CreditChartOfAccounts = _ChartOfAccounts_491
|
||||
_GLRows_Open.DebitChartOfAccounts = _onew.FindObject(Of ChartOfAccounts) _
|
||||
(CriteriaOperator.Parse("AccountNumber=? and AccountYear=?", _GLRows_Close.CreditChartOfAccounts.AccountNumber, _GLOpenCloseHeader.AccountYearOpen))
|
||||
For Each _LiquidAssetsYear In _LiquidAssetsYear_Collection
|
||||
If _GLRows_Open.DebitChartOfAccounts.AccountNumber = _LiquidAssetsYear.ChartOfAccounts.AccountNumber Then
|
||||
|
||||
Dim _LiquidAssetsRate As LiquidAssetsRate = _onew.FindObject(Of LiquidAssetsRate)(CriteriaOperator.Parse("DateExecution=? and LiquidAssets.Oid=?", New Date(_GLOpenCloseHeader.AccountYearOpen, 1, 1), _LiquidAssetsYear.LiquidAssets.Oid))
|
||||
If _LiquidAssetsRate Is Nothing Then
|
||||
_LiquidAssetsRate = _onew.CreateObject(Of LiquidAssetsRate)()
|
||||
End If
|
||||
_LiquidAssetsRate.LiquidAssets = _LiquidAssetsYear.LiquidAssets
|
||||
_LiquidAssetsRate.DateExecution = New Date(_GLOpenCloseHeader.AccountYearOpen, 1, 1)
|
||||
_LiquidAssetsRate.AmountHUF = _GLRows_Close.AmountHUF
|
||||
_LiquidAssetsRate.AmountDEV = _GLRows_Close.AmountDEV
|
||||
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
_GLRows_Open.DateExecution = New Date(_GLOpenCloseHeader.AccountYearClose, 12, 31)
|
||||
_GLRows_Open.GLRowsTypeVAT = eGLRowsTypeVAT.eNettoRow
|
||||
_GLRows_Open.NoteRows = "491 ->"
|
||||
_GLRows_Open.PartnerType = ePartnerType.eNotSet
|
||||
_GLRows_Open.TransactionType = eTransactionType.eNotSet
|
||||
|
||||
Next
|
||||
RaiseEvent FinalWork
|
||||
|
||||
_onew.CommitChanges()
|
||||
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceNew(_onew, _GLOpenCloseHeader.TrialBalanceHeaderAfterOpen)
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceOpenClose(_onew, _GLOpenCloseHeader.TrialBalanceHeaderAfterOpen)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "HIBA !")
|
||||
Finally
|
||||
GLOBAL_HAS_Audit = True
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Private Sub aGenerateTrialBalanceDividend_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aGenerateTrialBalanceDividend.Execute
|
||||
Try
|
||||
GLOBAL_HAS_Audit = False
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _GLOpenCloseHeader As GLOpenCloseHeader = _onew.GetObject(TryCast(View.SelectedObjects(0), GLOpenCloseHeader))
|
||||
|
||||
_GLOpenCloseHeader.IsDividend = True
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceNew(_onew, _GLOpenCloseHeader.TrialBalanceHeaderAfterDividend)
|
||||
Frame.GetController(Of Nuvolar.Module.TrialBalanceVC).LoadTrialBalanceOpenClose(_onew, _GLOpenCloseHeader.TrialBalanceHeaderAfterDividend)
|
||||
_onew.CommitChanges()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "HIBA !")
|
||||
Finally
|
||||
GLOBAL_HAS_Audit = False
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub aRepairBadGLRows_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aRepairBadGLRows.Execute
|
||||
Try
|
||||
GLOBAL_HAS_Audit = False
|
||||
Frame.GetController(Of Validation.PersistenceValidationController).Active.SetItemValue("", True)
|
||||
Dim _GLOpenCloseHeader As GLOpenCloseHeader = TryCast(View.SelectedObjects(0), GLOpenCloseHeader)
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _uow As New UnitOfWork(_onew.Session.DataLayer)
|
||||
Dim _GLRows_Collection As New XPCollection(Of GLRows)(PersistentCriteriaEvaluationBehavior.InTransaction, _uow, CriteriaOperator.Parse("GLHeader.IsEditable=False and GetYear(GLHeader.DateExecution)=?", _GLOpenCloseHeader.AccountYearClose))
|
||||
Dim _GLRows As GLRows
|
||||
Dim _ChartOfAccounts As ChartOfAccounts
|
||||
|
||||
RaiseEvent InitWork(1, 1, _GLRows_Collection.Count)
|
||||
For Each _GLRows In _GLRows_Collection
|
||||
RaiseEvent DoWork()
|
||||
|
||||
'// Törölt FK. számla rendberakása
|
||||
If _GLRows.DebitChartOfAccounts.IsDeleted Then
|
||||
_ChartOfAccounts = _uow.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber=?", _GLRows.GLHeader.DateExecution.Year, _GLRows.DebitChartOfAccounts.AccountNumber))
|
||||
If _ChartOfAccounts IsNot Nothing Then
|
||||
_GLRows.DebitChartOfAccounts = _ChartOfAccounts
|
||||
End If
|
||||
End If
|
||||
If _GLRows.CreditChartOfAccounts.IsDeleted Then
|
||||
_ChartOfAccounts = _uow.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber=?", _GLRows.GLHeader.DateExecution.Year, _GLRows.CreditChartOfAccounts.AccountNumber))
|
||||
If _ChartOfAccounts IsNot Nothing Then
|
||||
_GLRows.CreditChartOfAccounts = _ChartOfAccounts
|
||||
End If
|
||||
End If
|
||||
|
||||
'// Nem azonos év rendberakása
|
||||
|
||||
Next
|
||||
_uow.CommitChanges()
|
||||
RaiseEvent FinalWork
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "HIBA !")
|
||||
Finally
|
||||
GLOBAL_HAS_Audit = True
|
||||
RaiseEvent FinalWork
|
||||
Frame.GetController(Of Validation.PersistenceValidationController).Active.SetItemValue("", True)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user