First create solution
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Persistent.Validation
|
||||
Imports DevExpress.ExpressApp.ConditionalAppearance
|
||||
|
||||
'<Appearance("Disable CustomersFrom-Corner when it is not nothing", AppearanceItemType.ViewItem, "IsNull(CustomersFrom)=False", TargetItems:="CustomersFrom", Enabled:=False)> _
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem("SQL Imports")> _
|
||||
<Appearance("Disable UserCreated-Corner", AppearanceItemType.ViewItem, "1=1", TargetItems:="UserCreated", Enabled:=False)> _
|
||||
<Appearance("Disable ObjectCreated-Corner", AppearanceItemType.ViewItem, "1=1", TargetItems:="ObjectCreated", Enabled:=False)> _
|
||||
Public Class Corner
|
||||
Inherits BaseObject
|
||||
Private _CustomersFrom As CustomersFrom
|
||||
Private _ObjectCreated As Date 'Maga az objektum mikor készült el
|
||||
Private _UserCreated As User 'Ki csinálta
|
||||
Private _ShortName As String
|
||||
Private _ExcelCorner As String
|
||||
Private _ExcelFile As FileData
|
||||
Private _CostHolder As CostHolder
|
||||
Private _Customers_Cash As Customers ' Készpénzes vevõ melyik legyen az ügyféltörzsben
|
||||
Private _Customers_ATM As Customers ' Bankkártyás vevõ melyik legyen
|
||||
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()
|
||||
' Place here your initialization code.
|
||||
End Sub
|
||||
<RuleRequiredField("Corner-CustomersFrom", DefaultContexts.Save)> _
|
||||
Property CustomersFrom As CustomersFrom
|
||||
Get
|
||||
Return _CustomersFrom
|
||||
End Get
|
||||
Set(value As CustomersFrom)
|
||||
SetPropertyValue("CustomersFrom", _CustomersFrom, 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
|
||||
<NonCloneable> _
|
||||
Property ObjectCreated As Date
|
||||
Get
|
||||
Return _ObjectCreated
|
||||
End Get
|
||||
Set(ByVal 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 ExcelFile As FileData
|
||||
Get
|
||||
Return _ExcelFile
|
||||
End Get
|
||||
Set(value As FileData)
|
||||
SetPropertyValue("ExcelFile", _ExcelFile, value)
|
||||
End Set
|
||||
End Property
|
||||
<Size(-1)> _
|
||||
Property ExcelCorner As String
|
||||
Get
|
||||
Return _ExcelCorner
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("ExcelCorner", _ExcelCorner, value)
|
||||
End Set
|
||||
End Property
|
||||
<VisibleInListView(False)> _
|
||||
ReadOnly Property GLAccounts As XPCollection(Of GLAccounts)
|
||||
Get
|
||||
Return New XPCollection(Of GLAccounts)(Session, CriteriaOperator.Parse("ImportedOther=?", Me.Oid))
|
||||
End Get
|
||||
End Property
|
||||
<VisibleInListView(False)> _
|
||||
ReadOnly Property InvoiceNameParameters As XPCollection(Of InvoiceNameParameters)
|
||||
Get
|
||||
Return New XPCollection(Of InvoiceNameParameters)(Session, CriteriaOperator.Parse("PHImportType=0"))
|
||||
End Get
|
||||
End Property
|
||||
<VisibleInListView(False)> _
|
||||
ReadOnly Property CustomerNameParameters As XPCollection(Of CustomerNameParameters)
|
||||
Get
|
||||
Return New XPCollection(Of CustomerNameParameters)(Session, CriteriaOperator.Parse("PHImportType=0"))
|
||||
End Get
|
||||
End Property
|
||||
Property CostHolder As CostHolder
|
||||
Get
|
||||
Return _CostHolder
|
||||
End Get
|
||||
Set(ByVal value As CostHolder)
|
||||
SetPropertyValue("CostHolder", _CostHolder, value)
|
||||
End Set
|
||||
End Property
|
||||
<RuleRequiredField("Corner-Customers_Cash", DefaultContexts.Save)> _
|
||||
Property Customers_Cash As Customers
|
||||
Get
|
||||
Return _Customers_Cash
|
||||
End Get
|
||||
Set(ByVal value As Customers)
|
||||
SetPropertyValue("Customers_Cash", _Customers_Cash, value)
|
||||
End Set
|
||||
End Property
|
||||
<RuleRequiredField("Corner-Customers_ATM", DefaultContexts.Save)> _
|
||||
Property Customers_ATM As Customers
|
||||
Get
|
||||
Return _Customers_ATM
|
||||
End Get
|
||||
Set(ByVal value As Customers)
|
||||
SetPropertyValue("Customers_ATM", _Customers_ATM, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
@@ -0,0 +1,78 @@
|
||||
Partial Class CornerVC
|
||||
|
||||
<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.aCreateGLAccounts_Corner = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aCheckName_Corner = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aRemoveGLAccounts_Corner = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
'
|
||||
'aCreateGLAccounts_Corner
|
||||
'
|
||||
Me.aCreateGLAccounts_Corner.Caption = "Create GL Accounts"
|
||||
Me.aCreateGLAccounts_Corner.ConfirmationMessage = "Do you want to execute ?"
|
||||
Me.aCreateGLAccounts_Corner.Id = "aCreateGLAccounts_Corner"
|
||||
Me.aCreateGLAccounts_Corner.ImageName = Nothing
|
||||
Me.aCreateGLAccounts_Corner.Shortcut = Nothing
|
||||
Me.aCreateGLAccounts_Corner.Tag = Nothing
|
||||
Me.aCreateGLAccounts_Corner.TargetObjectsCriteria = Nothing
|
||||
Me.aCreateGLAccounts_Corner.TargetViewId = "Corner_DetailView"
|
||||
Me.aCreateGLAccounts_Corner.ToolTip = Nothing
|
||||
Me.aCreateGLAccounts_Corner.TypeOfView = Nothing
|
||||
'
|
||||
'aCheckName_Corner
|
||||
'
|
||||
Me.aCheckName_Corner.Caption = "Check names"
|
||||
Me.aCheckName_Corner.ConfirmationMessage = "Do you want to execute ?"
|
||||
Me.aCheckName_Corner.Id = "aCheckName_Corner"
|
||||
Me.aCheckName_Corner.ImageName = Nothing
|
||||
Me.aCheckName_Corner.Shortcut = Nothing
|
||||
Me.aCheckName_Corner.Tag = Nothing
|
||||
Me.aCheckName_Corner.TargetObjectsCriteria = Nothing
|
||||
Me.aCheckName_Corner.TargetViewId = "Corner_DetailView"
|
||||
Me.aCheckName_Corner.ToolTip = Nothing
|
||||
Me.aCheckName_Corner.TypeOfView = Nothing
|
||||
'
|
||||
'aRemoveGLAccounts_Corner
|
||||
'
|
||||
Me.aRemoveGLAccounts_Corner.Caption = "Remove GL Accounts"
|
||||
Me.aRemoveGLAccounts_Corner.ConfirmationMessage = "Do you want to execute command ?"
|
||||
Me.aRemoveGLAccounts_Corner.Id = "aRemoveGLAccounts_Corner"
|
||||
Me.aRemoveGLAccounts_Corner.ImageName = Nothing
|
||||
Me.aRemoveGLAccounts_Corner.Shortcut = Nothing
|
||||
Me.aRemoveGLAccounts_Corner.Tag = Nothing
|
||||
Me.aRemoveGLAccounts_Corner.TargetObjectsCriteria = Nothing
|
||||
Me.aRemoveGLAccounts_Corner.TargetViewId = "Corner_DetailView"
|
||||
Me.aRemoveGLAccounts_Corner.ToolTip = Nothing
|
||||
Me.aRemoveGLAccounts_Corner.TypeOfView = Nothing
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aCreateGLAccounts_Corner As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aCheckName_Corner As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aRemoveGLAccounts_Corner As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,132 @@
|
||||
<?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="aCreateGLAccounts_Corner.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aCheckName_Corner.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 56</value>
|
||||
</metadata>
|
||||
<metadata name="aRemoveGLAccounts_Corner.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>217, 56</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,678 @@
|
||||
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 FarPoint.Win.Spread
|
||||
Imports DevExpress.ExpressApp.SystemModule
|
||||
Imports System.IO
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.ExpressApp.Win.Editors
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.ExpressApp.Win.SystemModule
|
||||
Imports DevExpress.ExpressApp.Editors
|
||||
|
||||
|
||||
Public Class CornerVC
|
||||
Inherits DevExpress.ExpressApp.ViewController
|
||||
Dim _WaitFormClass As New WaitFormClass
|
||||
Private _FpSpread As FpSpread
|
||||
Private _GridListEditor As GridListEditor
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
End Sub
|
||||
Protected Overrides Sub OnActivated()
|
||||
MyBase.OnActivated()
|
||||
If View.Id = "Corner_InvoiceNameParameters_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "Corner_CustomerNameParameters_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "Corner_GLAccounts_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.DeleteObjectsViewController)().Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "GLHeader_GLRows_ListView_Accounts" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "Corner_DetailView" Then
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAction.Executing, AddressOf SaveAction_Executing
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAndCloseAction.Executing, AddressOf SaveAction_Executing
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAndNewAction.Executing, AddressOf SaveAction_Executing
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub OnDeactivated()
|
||||
MyBase.OnDeactivated()
|
||||
If View.Id = "Corner_InvoiceNameParameters_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "Corner_CustomerNameParameters_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "Corner_GLAccounts_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.DeleteObjectsViewController)().Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "GLHeader_GLRows_ListView_Accounts" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "Corner_CustomerNameParameters_ListView" Then ' Az inline edit beállítása.
|
||||
Dim _ListView As ListView = TryCast(View, ListView)
|
||||
_GridListEditor = TryCast(_ListView.Editor, GridListEditor)
|
||||
|
||||
If _GridListEditor IsNot Nothing Then
|
||||
Dim _Grid = _GridListEditor.GridView
|
||||
RemoveHandler _Grid.ShownEditor, AddressOf GridView_ShownEditor
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub ExcelControlViewItem_ControlCreated(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim itemControl As Object = (CType(sender, ViewItem)).Control
|
||||
|
||||
_FpSpread = TryCast(itemControl, ExcelUserControl).FpSpreadControl
|
||||
|
||||
Dim _FileName As String = Path.GetTempPath & "Out.xls"
|
||||
Dim _StreamFile As New FileStream(_FileName, FileMode.Create)
|
||||
Dim _Corner As Corner = TryCast(View.SelectedObjects(0), Corner)
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
|
||||
If _Corner IsNot Nothing Then
|
||||
If _ocur.Session.IsNewObject(_Corner) = False Then
|
||||
_Corner.ExcelFile.SaveToStream(_StreamFile)
|
||||
_StreamFile.Close()
|
||||
_FpSpread.OpenExcel(_FileName)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnViewControlsCreated()
|
||||
MyBase.OnViewControlsCreated()
|
||||
If View.Id = "Corner_DetailView" Then
|
||||
Dim _DetailView As DetailView = TryCast(View, DetailView)
|
||||
Dim _ExcelControlViewItem As ViewItem
|
||||
If _DetailView IsNot Nothing Then
|
||||
_ExcelControlViewItem = _DetailView.GetItems(Of ExcelPropertyEditor)(0)
|
||||
If _ExcelControlViewItem IsNot Nothing Then
|
||||
AddHandler _ExcelControlViewItem.ControlCreated, AddressOf ExcelControlViewItem_ControlCreated
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'If View.Id = "Corner_InvoiceNameParameters_ListView" Then ' Az inline edit beállítása.
|
||||
' Dim _ListView As ListView = TryCast(View, ListView)
|
||||
' _GridListEditor = TryCast(_ListView.Editor, GridListEditor)
|
||||
|
||||
' If _GridListEditor IsNot Nothing Then
|
||||
' _GridListEditor.AllowEdit = True
|
||||
|
||||
' For i As Integer = 0 To _GridListEditor.Columns.Count - 1
|
||||
' If _GridListEditor.GridView.Columns(i).FieldName <> "Controlling!" Then
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.ReadOnly = True
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.AllowEdit = False
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.TabStop = False
|
||||
' End If
|
||||
' Next i
|
||||
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If View.Id = "Corner_CustomerNameParameters_ListView" Then ' Az inline edit beállítása.
|
||||
Dim _ListView As ListView = TryCast(View, ListView)
|
||||
_GridListEditor = TryCast(_ListView.Editor, GridListEditor)
|
||||
|
||||
If _GridListEditor IsNot Nothing Then
|
||||
|
||||
Dim _Grid = _GridListEditor.GridView
|
||||
AddHandler _Grid.ShownEditor, AddressOf GridView_ShownEditor
|
||||
|
||||
'_GridListEditor.AllowEdit = True
|
||||
|
||||
'For i As Integer = 0 To _GridListEditor.Columns.Count - 1
|
||||
' If _GridListEditor.GridView.Columns(i).FieldName <> "Customers!" Then
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.ReadOnly = True
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.AllowEdit = False
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.TabStop = False
|
||||
' End If
|
||||
'Next i
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Sub GridView_ShownEditor(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
Dim _LookupEdit As LookupEdit = sender.ActiveEditor
|
||||
|
||||
If _LookupEdit.Frame IsNot Nothing Then
|
||||
_LookupEdit.Frame.GetController(Of FilterController)().FullTextFilterAction.Value = _GridListEditor.GridView.GetRowCellValue(_GridListEditor.GridView.FocusedRowHandle, "CustomerText")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Sub SaveAction_Executing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
|
||||
Dim _FileName As String = Path.GetTempPath & "In.xls"
|
||||
Dim _StreamFile As New FileStream(_FileName, FileMode.Create)
|
||||
Dim _Corner As Corner = TryCast(View.SelectedObjects(0), Corner)
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
If _Corner IsNot Nothing Then
|
||||
_FpSpread.SaveExcel(_StreamFile)
|
||||
_StreamFile.Close()
|
||||
Dim _StreamFile2 As New FileStream(_FileName, FileMode.Open)
|
||||
_Corner.ExcelFile = New FileData(_ocur.Session)
|
||||
_Corner.ExcelFile.LoadFromStream("Excel worksheet", _StreamFile2)
|
||||
_Corner.Save()
|
||||
_StreamFile2.Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub aCreateGLAccounts_Corner_Execute(ByVal sender As System.Object, ByVal e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aCreateGLAccounts_Corner.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _uow As New UnitOfWork(_ocur.Session.DataLayer)
|
||||
|
||||
Dim _Corner As Corner = _uow.GetObjectByKey(Of Corner)(TryCast(View.SelectedObjects(0), Corner).Oid)
|
||||
Dim _GLAccounts As GLAccounts = Nothing
|
||||
Dim _GLAccounts_check As GLAccounts
|
||||
Dim _GLRows As GLRows
|
||||
Dim _CustomersFrom As CustomersFrom = Nothing
|
||||
Dim _InvoiceNameParameters As InvoiceNameParameters
|
||||
Dim _CustomerNameParameters As CustomerNameParameters
|
||||
|
||||
Dim _column As Integer = 0
|
||||
Dim _row As Integer = 0
|
||||
Dim _firstHeaderSRow As Integer
|
||||
Dim _FooterIndicator As Boolean = False
|
||||
Dim _HeaderIndicator As String = "T."
|
||||
Dim _GUID As Guid
|
||||
Dim _RowIndex As Integer = 0
|
||||
Dim _SysDate As DateTime
|
||||
Dim _Rate As Double
|
||||
Dim _VAT As VAT = Nothing
|
||||
Dim _VATText As String = ""
|
||||
Dim _CustomersText As String = ""
|
||||
Dim _CustomersFromText As String = ""
|
||||
|
||||
Dim _iCustomer As Integer = 0
|
||||
Dim _iPaymentOption As Integer = 0
|
||||
Dim _iCurrencyName As Integer = 0
|
||||
Dim _iCurrencySum As Integer = 0
|
||||
Dim _iDateCreated As Integer = 0
|
||||
Dim _iDateExecution As Integer = 0
|
||||
Dim _iDatePayment As Integer = 0
|
||||
Dim _iDocumentNumber As Integer = 0
|
||||
Dim _iVATHeader As Integer = 0
|
||||
Dim _iVATRow As Integer = 0
|
||||
Dim _iNetHeader As Integer = 0
|
||||
Dim _iNetRow As Integer = 0
|
||||
Dim _iGrossHeader As Integer = 0
|
||||
Dim _iGrossRow As Integer = 0
|
||||
Dim _iCustomerNumber As Integer = 0
|
||||
|
||||
Dim _GLAccounts_List As New ArrayList
|
||||
_GLAccounts_List.Clear()
|
||||
|
||||
'_uow.GetObjectByKey(Of InvoiceNameParameters)("PHImportType=0 And IsNull(Controlling)")
|
||||
_InvoiceNameParameters = _uow.FindObject(Of InvoiceNameParameters)(CriteriaOperator.Parse("PHImportType=0 And IsNull(Controlling)"))
|
||||
If _InvoiceNameParameters IsNot Nothing Then ' Megvizsgáljuk, hogy az összes tétel megnevezéséhez tartozik-e controlling adat.
|
||||
Throw New UserFriendlyException("A művelet indítása előtt végezze el a Megnevezés paraméterek feldolgozását!")
|
||||
End If
|
||||
|
||||
For _column = 0 To _FpSpread.ActiveSheet.GetLastNonEmptyColumn(NonEmptyItemFlag.Data) 'Saját cég nevének megeresése a táblázatban.
|
||||
If _FpSpread.ActiveSheet.Cells(0, _column).Text <> "" Then
|
||||
'_CustomersFromText = _FpSpread.ActiveSheet.Cells(0, _column).Text.Trim 'Ha itt kap értéket a változó, a blokkon kívül nem látható az értéke. (???)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
_CustomersFromText = _FpSpread.ActiveSheet.Cells(0, _column).Text.Trim
|
||||
|
||||
' Mégsem a táblázatból olvassuk ki a saját céget, hanem egy propertybe bekérjük.
|
||||
'_CustomersFrom = _uow.FindObject(Of CustomersFrom)(CriteriaOperator.Parse("Name=?", _CustomersFromText))
|
||||
'If _CustomersFrom Is Nothing Then ' Saját cég keresése.
|
||||
' Throw New UserFriendlyException("A számlát kiállító saját cég nem azonosítható.")
|
||||
'End If
|
||||
|
||||
For _row = 0 To _FpSpread.ActiveSheet.GetLastNonEmptyRow(NonEmptyItemFlag.Data) 'Fejléc keresése.
|
||||
If _FpSpread.ActiveSheet.Cells(_row, 0).Text = _HeaderIndicator Then
|
||||
_firstHeaderSRow = _row
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
For _column = 0 To _FpSpread.ActiveSheet.GetLastNonEmptyColumn(NonEmptyItemFlag.Data) ' Fejléc feldolgozása.
|
||||
Select Case _FpSpread.ActiveSheet.Cells(_firstHeaderSRow, _column).Text
|
||||
Case "Számlaszám"
|
||||
_iDocumentNumber = _column
|
||||
Case "Megrendelő neve"
|
||||
_iCustomer = _column
|
||||
Case "R-Nr"
|
||||
_iCustomerNumber = _column
|
||||
Case "Kelte"
|
||||
_iDateCreated = _column
|
||||
Case "Teljesítés"
|
||||
_iDateExecution = _column
|
||||
Case "Esedékes"
|
||||
_iDatePayment = _column
|
||||
Case "Mennyiség"
|
||||
_iCurrencySum = _column
|
||||
Case "FM"
|
||||
_iPaymentOption = _column
|
||||
Case "Áfakulcs"
|
||||
_iCurrencyName = _column
|
||||
Case "ÁFA"
|
||||
If _FpSpread.ActiveSheet.Cells(_firstHeaderSRow, _column).Font.Bold = True Then
|
||||
_iVATHeader = _column
|
||||
Else
|
||||
_iVATRow = _column
|
||||
End If
|
||||
Case "Nettó"
|
||||
If _FpSpread.ActiveSheet.Cells(_firstHeaderSRow, _column).Font.Bold = True Then
|
||||
_iNetHeader = _column
|
||||
Else
|
||||
_iNetRow = _column
|
||||
End If
|
||||
Case "Bruttó"
|
||||
If _FpSpread.ActiveSheet.Cells(_firstHeaderSRow, _column).Font.Bold = True Then
|
||||
_iGrossHeader = _column
|
||||
Else
|
||||
_iGrossRow = _column
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
|
||||
_SysDate = GetSQLTime(_uow)
|
||||
_WaitFormClass.InitWork(1, 1, _FpSpread.ActiveSheet.GetLastNonEmptyRow(NonEmptyItemFlag.Data))
|
||||
For _row = _firstHeaderSRow + 1 To _FpSpread.ActiveSheet.GetLastNonEmptyRow(NonEmptyItemFlag.Data) 'Számlák készítése indul.
|
||||
|
||||
_VAT = Nothing
|
||||
If (_FpSpread.ActiveSheet.Cells(_row, _iDocumentNumber).Text = "SZÁMLÁK ÖSSZESÍTÉS FIZETÉSI MÓDONKÉNT") _
|
||||
Or (_FpSpread.ActiveSheet.Cells(_row, _iCustomerNumber).Text = "SZÁMLÁK ÖSSZESÍTÉS FIZETÉSI MÓDONKÉNT") Then 'Innét tudjuk, hogy elfogytak a feldolgozandó sorok.
|
||||
_FooterIndicator = True
|
||||
End If
|
||||
|
||||
_WaitFormClass.DoWork()
|
||||
|
||||
If (_FpSpread.ActiveSheet.Cells(_row, 0).Text <> _HeaderIndicator) And (_FpSpread.ActiveSheet.Cells(_row, _iDocumentNumber).Text.Trim <> _CustomersFromText) _
|
||||
And Not _FooterIndicator Then
|
||||
|
||||
If (_FpSpread.ActiveSheet.Cells(_row, _iDocumentNumber).Text <> "") Then
|
||||
|
||||
_GLAccounts_check = _uow.FindObject(Of GLAccounts)(CriteriaOperator.Parse("DocumentNumber=? And CustomersFrom=?", _FpSpread.ActiveSheet.Cells(_row, _iDocumentNumber).Text, _Corner.CustomersFrom))
|
||||
If _GLAccounts_check IsNot Nothing Then ' A DocumentNumbernek egyedinek kell lennie.
|
||||
_ocur.Rollback()
|
||||
_WaitFormClass.Finalwork
|
||||
Throw New UserFriendlyException("A művelet nem végezhető el, már létezik számla ezzel a számmal: " + _GLAccounts_check.DocumentNumber)
|
||||
End If
|
||||
|
||||
'_GLAccounts = _ocur.CreateObjec(Of GLAccounts)()
|
||||
'_GLAccounts = New GLAccounts(_ocur.Session)
|
||||
_GLAccounts = New GLAccounts(_uow)
|
||||
|
||||
_RowIndex = _RowIndex + 1
|
||||
_GLAccounts.HeaderInfo = Format(_SysDate.Date, "yyyy-MM-dd") + " " + Format(_RowIndex, "0000") + " " + _FpSpread.ActiveSheet.Cells(_row, _iDocumentNumber).Text
|
||||
|
||||
_GLAccounts.PartnerType = ePartnerType.eReceivables ' Partner típusa.
|
||||
_GLAccounts.CustomersFrom = _Corner.CustomersFrom ' Saját cég.
|
||||
_CustomersText = _FpSpread.ActiveSheet.Cells(_row, _iCustomer).Text ' Partner neve a táblázatban
|
||||
_CustomerNameParameters = _uow.FindObject(Of CustomerNameParameters)(CriteriaOperator.Parse("CustomerNumber=? And PHImportType=0", _FpSpread.ActiveSheet.Cells(_row, _iCustomerNumber).Text))
|
||||
|
||||
If _FpSpread.ActiveSheet.Cells(_row, _iPaymentOption).Text = "KP" Then ' A fizetési módnak megfelelő ügyfél és fizetési mód kiválasztása.
|
||||
_GLAccounts.Customers = _Corner.Customers_Cash ' Partner.
|
||||
If _CustomerNameParameters IsNot Nothing Then
|
||||
If _CustomerNameParameters.Customers IsNot Nothing Then
|
||||
_GLAccounts.Customers = _CustomerNameParameters.Customers ' Ha találunk partnert a CustomerNameParameters táblában, akkor felülírjuk
|
||||
End If
|
||||
End If
|
||||
_GLAccounts.PaymentOption = _uow.FindObject(Of PaymentOption)(CriteriaOperator.Parse("PayMode=?", ePayMode.InCash)) ' Fizetési mód.
|
||||
Else 'ElseIf _FpSpread.ActiveSheet.Cells(_row, _iPaymentOption).Text = "HK" Then
|
||||
_GLAccounts.Customers = _Corner.Customers_ATM ' Partner
|
||||
If _CustomerNameParameters IsNot Nothing Then
|
||||
If _CustomerNameParameters.Customers IsNot Nothing Then
|
||||
_GLAccounts.Customers = _CustomerNameParameters.Customers ' Ha találunk partnert a CustomerNameParameters táblában, akkor felülírjuk
|
||||
End If
|
||||
End If
|
||||
_GLAccounts.PaymentOption = _uow.FindObject(Of PaymentOption)(CriteriaOperator.Parse("PayMode=?", ePayMode.InTransfer))
|
||||
End If
|
||||
|
||||
_GLAccounts.CurrencyName = _uow.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName=?", _FpSpread.ActiveSheet.Cells(_row, _iCurrencyName).Text()))
|
||||
If _GLAccounts.CurrencyName Is Nothing Then
|
||||
_ocur.Rollback()
|
||||
_WaitFormClass.Finalwork
|
||||
Throw New UserFriendlyException("Nem sikerült beazonosítani az alábbi devizanemet: " + _FpSpread.ActiveSheet.Cells(_row, _iCurrencyName).Text)
|
||||
End If
|
||||
|
||||
If _GLAccounts.CurrencyName.ShortName = "HUF" Then ' Árfolyam kiszámolása.
|
||||
_Rate = 1 ' A belső számolásokhoz
|
||||
_GLAccounts.CurrencyRateVAT = 1
|
||||
Else
|
||||
_Rate = Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iGrossHeader).Text) / Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iCurrencySum).Text) ' A belső számolásokhoz
|
||||
_GLAccounts.CurrencyRateVAT = Math.Round(_Rate, 4, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
_GLAccounts.CurrencyRate = _GLAccounts.CurrencyRateVAT ' A két árfolyam azonos.
|
||||
|
||||
_GLAccounts.DateCreated = Convert.ToDateTime(_FpSpread.ActiveSheet.Cells(_row, _iDateCreated).Text).Date
|
||||
_GLAccounts.DateExecution = Convert.ToDateTime(_FpSpread.ActiveSheet.Cells(_row, _iDateExecution).Text).Date
|
||||
_GLAccounts.DatePayment = Convert.ToDateTime(_FpSpread.ActiveSheet.Cells(_row, _iDatePayment).Text).Date
|
||||
|
||||
_GLAccounts.DocumentNumber = _FpSpread.ActiveSheet.Cells(_row, _iDocumentNumber).Text
|
||||
_GLAccounts.ConnectInfo = _FpSpread.ActiveSheet.Cells(_row, _iDocumentNumber).Text
|
||||
_GLAccounts.GLDocumentType = eGLDocumentType.eGLAccount ' Dokumentum típusa.
|
||||
|
||||
_GLAccounts.IsEditable = False ' Nem szerkeszthető.
|
||||
_GLAccounts.IsStorno = False ' Nem sztornózott.
|
||||
|
||||
_GLAccounts.NoteHeader = "Corner"
|
||||
_GLAccounts.ImportedOther = _Corner.Oid
|
||||
|
||||
_GLAccounts.Save()
|
||||
_GLAccounts_List.Add(_GLAccounts)
|
||||
End If
|
||||
|
||||
If _FpSpread.ActiveSheet.Cells(_row, _iGrossRow).Text <> "" Then ' Tétel sorok.
|
||||
_GUID = Guid.NewGuid
|
||||
_InvoiceNameParameters = _uow.FindObject(Of InvoiceNameParameters)(CriteriaOperator.Parse("PHImportType=0 And ShortName=?", _FpSpread.ActiveSheet.Cells(_row, _iPaymentOption).Text))
|
||||
|
||||
If _InvoiceNameParameters Is Nothing Then ' Megvizsgáljuk, hogy az adott tétel megtalálható-e.
|
||||
_ocur.Rollback()
|
||||
_WaitFormClass.Finalwork
|
||||
Throw New UserFriendlyException("A művelet nem végezhető el, végre kell hajtani a Megnevezés paraméterek feldolgozását!")
|
||||
End If
|
||||
|
||||
If _VAT Is Nothing Then
|
||||
Select Case _FpSpread.ActiveSheet.Cells(_row, _iCurrencyName).Text ' Egyenlőre úgy tűnik, át kell konvertálni az ÁFA kódolkat, ez a PH-ra lett szabva.
|
||||
Case "27"
|
||||
_VATText = "27%"
|
||||
Case "25"
|
||||
_VATText = "25%"
|
||||
Case "18"
|
||||
_VATText = "18%"
|
||||
Case "0"
|
||||
_VATText = "ÁTHK"
|
||||
Case Else
|
||||
_VATText = ""
|
||||
End Select
|
||||
_VAT = _uow.FindObject(Of VAT)(CriteriaOperator.Parse("ShortName=?", _VATText))
|
||||
End If
|
||||
|
||||
If _VAT Is Nothing Then
|
||||
_VAT = _uow.FindObject(Of VAT)(CriteriaOperator.Parse("ShortName=?", LTrim(RTrim(_FpSpread.ActiveSheet.Cells(_row, _iCurrencyName).Text)) + "%"))
|
||||
End If
|
||||
If _VAT Is Nothing Then
|
||||
_VAT = _uow.FindObject(Of VAT)(CriteriaOperator.Parse("ShortName=?", LTrim(RTrim(_FpSpread.ActiveSheet.Cells(_row, _iCurrencyName).Text)) + " %"))
|
||||
End If 'Nem egységes az áfakulcs sor rögzítése, de megtesszük, amit lehet...
|
||||
|
||||
If _VAT Is Nothing Then ' Nem találtuk meg az ÁFA-kulcsot
|
||||
_ocur.Rollback()
|
||||
_WaitFormClass.Finalwork
|
||||
Throw New UserFriendlyException("Nem sikerült megtalálni az Áfa-kulcs paramétert: " + _VATText)
|
||||
End If
|
||||
|
||||
|
||||
If Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iNetRow).Text) <> 0 Then ' Nettó rész.
|
||||
_GLRows = New GLRows(_uow)
|
||||
|
||||
If _GLAccounts.CurrencyName.ShortName = "HUF" Then
|
||||
_GLRows.AmountHUF = Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iNetRow).Text)
|
||||
Else
|
||||
_GLRows.AmountDEV = Math.Round(Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iNetRow).Text) / _Rate, 4, MidpointRounding.AwayFromZero) ' Számolni kell.
|
||||
_GLRows.AmountHUF = Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iNetRow).Text)
|
||||
End If
|
||||
|
||||
If _FpSpread.ActiveSheet.Cells(_row, _iPaymentOption).Text = "KP" Then ' Más a főkönyvi szlaszám kp., és más utalás esetén.
|
||||
_GLRows.DebitChartOfAccounts = _Corner.Customers_Cash.CustomersGLParameters.GetChartOfAccounts(_GLAccounts.DateExecution.Year, eVATMode.eOut)
|
||||
Else
|
||||
_GLRows.DebitChartOfAccounts = _Corner.Customers_ATM.CustomersGLParameters.GetChartOfAccounts(_GLAccounts.DateExecution.Year, eVATMode.eOut)
|
||||
End If
|
||||
_GLRows.CreditChartOfAccounts = _InvoiceNameParameters.Controlling.ChartOfAccounts
|
||||
|
||||
_GLRows.GLRowsGUID = _GUID
|
||||
_GLRows.ConnectInfo = _GLAccounts.DocumentNumber
|
||||
_GLRows.GLHeader = TryCast(_GLAccounts, GLHeader)
|
||||
|
||||
_GLRows.Customer = _GLAccounts.Customers
|
||||
_GLRows.PartnerType = ePartnerType.eReceivables
|
||||
_GLRows.NoteRows = _CustomersText
|
||||
_GLRows.GLHeader.NoteHeader = _CustomersText
|
||||
|
||||
_GLRows.DateVAT = _GLAccounts.DateExecution
|
||||
_GLRows.VAT = _VAT
|
||||
_GLRows.GLRowsTypeVAT = eGLRowsTypeVAT.eNettoRow
|
||||
|
||||
_GLRows.CostHolder = _Corner.CostHolder
|
||||
_GLRows.Controlling = _InvoiceNameParameters.Controlling
|
||||
_GLRows.CostPlace = Nothing
|
||||
_GLRows.JobNumberObjects = Nothing
|
||||
|
||||
_GLRows.Save()
|
||||
_GLAccounts.RecalculateTotal()
|
||||
|
||||
|
||||
_GLRows = New GLRows(_uow) ' Áfa rész
|
||||
|
||||
If _GLAccounts.CurrencyName.ShortName = "HUF" Then
|
||||
_GLRows.AmountHUF = Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iVATRow).Text)
|
||||
Else
|
||||
_GLRows.AmountDEV = Math.Round(Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iVATRow).Text) / _Rate, 4, MidpointRounding.AwayFromZero) ' Számolni kell.
|
||||
_GLRows.AmountHUF = Convert.ToDouble(_FpSpread.ActiveSheet.Cells(_row, _iVATRow).Text)
|
||||
End If
|
||||
|
||||
If _FpSpread.ActiveSheet.Cells(_row, _iPaymentOption).Text = "KP" Then ' Más a főkönyvi szlaszám kp., és más utalás esetén.
|
||||
_GLRows.DebitChartOfAccounts = _Corner.Customers_Cash.CustomersGLParameters.GetChartOfAccounts(_GLAccounts.DateExecution.Year, eVATMode.eOut)
|
||||
Else
|
||||
_GLRows.DebitChartOfAccounts = _Corner.Customers_ATM.CustomersGLParameters.GetChartOfAccounts(_GLAccounts.DateExecution.Year, eVATMode.eOut)
|
||||
End If
|
||||
_GLRows.CreditChartOfAccounts = _VAT.ChartOfAccountsOut
|
||||
|
||||
_GLRows.GLRowsGUID = _GUID
|
||||
_GLRows.ConnectInfo = _GLAccounts.DocumentNumber
|
||||
_GLRows.GLHeader = TryCast(_GLAccounts, GLHeader)
|
||||
|
||||
_GLRows.Customer = _GLAccounts.Customers
|
||||
_GLRows.PartnerType = ePartnerType.eReceivables
|
||||
_GLRows.NoteRows = _CustomersText
|
||||
_GLRows.GLHeader.NoteHeader = _CustomersText
|
||||
|
||||
_GLRows.DateVAT = _GLAccounts.DateExecution
|
||||
_GLRows.VAT = _VAT
|
||||
_GLRows.GLRowsTypeVAT = eGLRowsTypeVAT.eVATRow
|
||||
|
||||
_GLRows.CostHolder = _Corner.CostHolder
|
||||
_GLRows.Controlling = _InvoiceNameParameters.Controlling
|
||||
_GLRows.CostPlace = Nothing
|
||||
_GLRows.JobNumberObjects = Nothing
|
||||
|
||||
_GLRows.Save()
|
||||
_GLAccounts.RecalculateTotal()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
_uow.CommitChanges()
|
||||
_WaitFormClass.Finalwork
|
||||
|
||||
'// Pontozás lefuttatása
|
||||
_WaitFormClass.InitWork(1, 1, _GLAccounts_List.Count)
|
||||
For Each _GLAccounts In _GLAccounts_List
|
||||
_WaitFormClass.DoWork()
|
||||
GLFunctions.ReconfigurePCI(_uow, _GLAccounts.CustomersFrom, _GLAccounts.Customers, ePartnerType.eReceivables, _GLAccounts.ConnectInfo)
|
||||
Next
|
||||
_WaitFormClass.Finalwork
|
||||
|
||||
|
||||
View.Refresh()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub aCheckName_Corner_Execute(ByVal sender As System.Object, ByVal e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aCheckName_Corner.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _uow As New UnitOfWork(_ocur.Session.DataLayer)
|
||||
|
||||
Dim _InvoiceNameParameters As InvoiceNameParameters
|
||||
Dim _CustomerNameParameters As CustomerNameParameters
|
||||
|
||||
Dim _firstHeaderSRow As Integer
|
||||
Dim _HeaderIndicator As String = "T."
|
||||
Dim _ColumnName1 As String = "FM"
|
||||
Dim _ColumnName2 As String = "Bruttó"
|
||||
Dim _ColumnName3 As String = "Megrendelő neve"
|
||||
Dim _ColumnName31 As String = "Útlevél"
|
||||
Dim _ColumnName4 As String = "R-Nr"
|
||||
Dim _ColumnName5 As String = "Mennyiség"
|
||||
Dim _iCol1 As Integer
|
||||
Dim _iCol2 As Integer
|
||||
Dim _iCol3 As Integer
|
||||
Dim _iCol4 As Integer
|
||||
Dim _iCol5 As Integer
|
||||
|
||||
Dim _row As Integer
|
||||
Dim _column As Integer
|
||||
|
||||
For _row = 0 To _FpSpread.ActiveSheet.GetLastNonEmptyRow(NonEmptyItemFlag.Data) 'Megkeressük az első oldal fejlécét.
|
||||
If _FpSpread.ActiveSheet.Cells(_row, 0).Text = _HeaderIndicator Then
|
||||
_firstHeaderSRow = _row
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
For _column = 0 To _FpSpread.ActiveSheet.GetLastNonEmptyColumn(NonEmptyItemFlag.Data) 'Végigmegyünk az oszlopokon.
|
||||
|
||||
Select Case _FpSpread.ActiveSheet.Cells(_firstHeaderSRow, _column).Text ' Fejléc feldolgozása.
|
||||
Case _ColumnName1
|
||||
_iCol1 = _column ' Eltároljuk a "fizetési mód/megnevezés" oszlop sorszámát.
|
||||
Case _ColumnName2
|
||||
If _FpSpread.ActiveSheet.Cells(_firstHeaderSRow, _column).Font.Bold = False Then
|
||||
_iCol2 = _column ' Eltároljuk a "tételsor bruttó értéke" oszlop sorszámát
|
||||
End If
|
||||
Case _ColumnName3 ' Eltároljuk a "Vendég neve/Útlevél" oszlop sorszámát
|
||||
_iCol3 = _column
|
||||
Case _ColumnName4 ' Eltároljuk az "R-Nr" oszlop sorszámát
|
||||
_iCol4 = _column
|
||||
Case _ColumnName5 ' Eltároljuk a "Mennyiség" oszlop sorszámát
|
||||
_iCol5 = _column
|
||||
|
||||
End Select
|
||||
Next
|
||||
|
||||
_WaitFormClass.InitWork(1, 1, _FpSpread.ActiveSheet.GetLastNonEmptyRow(NonEmptyItemFlag.Data))
|
||||
For _row = _firstHeaderSRow To _FpSpread.ActiveSheet.GetLastNonEmptyRow(NonEmptyItemFlag.Data) ' Végigmegyünk az egész táblázaton.
|
||||
|
||||
_WaitFormClass.DoWork()
|
||||
|
||||
If _FpSpread.ActiveSheet.Cells(_row, _iCol2).Text <> _ColumnName2 And _FpSpread.ActiveSheet.Cells(_row, _iCol2).Text <> "" Then ' Ha a cella szövege nem üres, de nem is az oszlop fejlécének szövege, akkor találtunk tételsort.
|
||||
_InvoiceNameParameters = _uow.FindObject(Of InvoiceNameParameters)(CriteriaOperator.Parse("ShortName=? And PHImportType=0", _FpSpread.ActiveSheet.Cells(_row, _iCol1).Text))
|
||||
|
||||
If _InvoiceNameParameters Is Nothing Then ' Amennyigen a megnevezés még nincs az InvoiceNameParameters táblában, beszúrjuk.
|
||||
_InvoiceNameParameters = New InvoiceNameParameters(_uow)
|
||||
_InvoiceNameParameters.PHImportType = ePHImportType.eCorner
|
||||
_InvoiceNameParameters.ShortName = _FpSpread.ActiveSheet.Cells(_row, _iCol1).Text
|
||||
|
||||
Try
|
||||
_InvoiceNameParameters.Save()
|
||||
_uow.CommitChanges()
|
||||
Catch
|
||||
_WaitFormClass.Finalwork
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
If _FpSpread.ActiveSheet.Cells(_row, _iCol3).Text <> _ColumnName3 And _FpSpread.ActiveSheet.Cells(_row, _iCol3).Text <> _ColumnName31 _
|
||||
And _FpSpread.ActiveSheet.Cells(_row, _iCol3).Text <> "" And _FpSpread.ActiveSheet.Cells(_row, _iCol5).Text <> "" Then ' Ha a cella szövege nem üres, de nem is az oszlop fejlécének szövege, akkor találtunk tételsort.
|
||||
_CustomerNameParameters = _uow.FindObject(Of CustomerNameParameters)(CriteriaOperator.Parse("CustomerNumber=? And PHImportType=0", _FpSpread.ActiveSheet.Cells(_row, _iCol4).Text))
|
||||
|
||||
If _CustomerNameParameters Is Nothing Then ' Amennyigen az ügyfélszám még nincs az CustomerNameParameters táblában, beszúrjuk.
|
||||
_CustomerNameParameters = New CustomerNameParameters(_uow)
|
||||
_CustomerNameParameters.PHImportType = ePHImportType.eCorner
|
||||
_CustomerNameParameters.CustomerText = _FpSpread.ActiveSheet.Cells(_row, _iCol3).Text
|
||||
_CustomerNameParameters.CustomerNumber = _FpSpread.ActiveSheet.Cells(_row, _iCol4).Text
|
||||
|
||||
Try
|
||||
_CustomerNameParameters.Save()
|
||||
_uow.CommitChanges()
|
||||
Catch
|
||||
_WaitFormClass.Finalwork
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
_WaitFormClass.Finalwork
|
||||
View.Refresh()
|
||||
End Sub
|
||||
Private Sub aRemoveGLAccounts_Corner_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aRemoveGLAccounts_Corner.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _uow As New UnitOfWork(_ocur.Session.DataLayer)
|
||||
Dim _Corner As Corner = TryCast(View.SelectedObjects(0), Corner)
|
||||
Dim _GLAccounts_Collection As New XPCollection(Of GLAccounts)(_uow, CriteriaOperator.Parse("ImportedOther=?", _Corner.Oid))
|
||||
|
||||
_uow.Delete(_GLAccounts_Collection)
|
||||
_uow.CommitChanges()
|
||||
|
||||
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,58 @@
|
||||
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 CustomerNameParameters
|
||||
Inherits BaseObject
|
||||
Private _PHImportType As ePHImportType
|
||||
Private _CustomerNumber As String
|
||||
Private _CustomerText As String
|
||||
Private _Customers As Customers
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
End Sub
|
||||
Public Property PHImportType As ePHImportType
|
||||
Get
|
||||
Return _PHImportType
|
||||
End Get
|
||||
Set(value As ePHImportType)
|
||||
SetPropertyValue("PHImportType", _PHImportType, value)
|
||||
End Set
|
||||
End Property
|
||||
Property CustomerNumber As String
|
||||
Get
|
||||
Return _CustomerNumber
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("CustomerNumber", _CustomerNumber, value)
|
||||
End Set
|
||||
End Property
|
||||
Property CustomerText As String
|
||||
Get
|
||||
Return _CustomerText
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("CustomerText", _CustomerText, 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
|
||||
End Class
|
||||
@@ -0,0 +1,53 @@
|
||||
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
|
||||
Public Enum ePHImportType
|
||||
eCorner = 0
|
||||
eVivaldi = 1
|
||||
End Enum
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem(False), CreatableItem(False)> _
|
||||
Public Class InvoiceNameParameters
|
||||
Inherits BaseObject
|
||||
Private _PHImportType As ePHImportType
|
||||
Private _ShortName As String
|
||||
Private _Controlling As Controlling
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
End Sub
|
||||
Public Property PHImportType As ePHImportType
|
||||
Get
|
||||
Return _PHImportType
|
||||
End Get
|
||||
Set(value As ePHImportType)
|
||||
SetPropertyValue("PHImportType", _PHImportType, value)
|
||||
End Set
|
||||
End Property
|
||||
Public Property ShortName As String
|
||||
Get
|
||||
Return _ShortName
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("ShortName", _ShortName, value)
|
||||
End Set
|
||||
End Property
|
||||
<ImmediatePostData(True), DataSourceCriteria("IsParent=False")>
|
||||
Public Property Controlling As Controlling
|
||||
Get
|
||||
Return _Controlling
|
||||
End Get
|
||||
Set(value As Controlling)
|
||||
SetPropertyValue("Controlling", _Controlling, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
@@ -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.ExpressApp.ConditionalAppearance
|
||||
|
||||
'<Appearance("Disable CustomersFrom-Vivaldi when it is not nothing", AppearanceItemType.ViewItem, "IsNull(CustomersFrom)=False", TargetItems:="CustomersFrom", Enabled:=False)> _
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem("SQL Imports")> _
|
||||
<Appearance("Disable UserCreated-Vivaldi", AppearanceItemType.ViewItem, "1=1", TargetItems:="UserCreated", Enabled:=False)> _
|
||||
<Appearance("Disable ObjectCreated-Vivaldi", AppearanceItemType.ViewItem, "1=1", TargetItems:="ObjectCreated", Enabled:=False)> _
|
||||
Public Class Vivaldi
|
||||
Inherits BaseObject
|
||||
Private _CustomersFrom As CustomersFrom
|
||||
Private _ObjectCreated As Date 'Maga az objektum mikor készült el
|
||||
Private _UserCreated As User 'Ki csinálta
|
||||
Private _ShortName As String
|
||||
Private _ExcelFile As FileData 'Import file, amibõl a betöltés létrejön
|
||||
Private _CostHolder As CostHolder
|
||||
Private _Customers_Cash As Customers ' Készpénzes vevõ melyik legyen az ügyféltörzsben
|
||||
Private _Customers_ATM As Customers ' Bankkártyás vevõ melyik legyen
|
||||
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()
|
||||
' Place here your initialization code.
|
||||
End Sub
|
||||
<RuleRequiredField("Vivaldi-CustomersFrom", DefaultContexts.Save)> _
|
||||
Property CustomersFrom As CustomersFrom
|
||||
Get
|
||||
Return _CustomersFrom
|
||||
End Get
|
||||
Set(value As CustomersFrom)
|
||||
SetPropertyValue("CustomersFrom", _CustomersFrom, 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
|
||||
<NonCloneable> _
|
||||
Property ObjectCreated As Date
|
||||
Get
|
||||
Return _ObjectCreated
|
||||
End Get
|
||||
Set(ByVal 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 ExcelFile As FileData
|
||||
Get
|
||||
Return _ExcelFile
|
||||
End Get
|
||||
Set(value As FileData)
|
||||
SetPropertyValue("ExcelFile", _ExcelFile, value)
|
||||
End Set
|
||||
End Property
|
||||
<VisibleInListView(False)> _
|
||||
ReadOnly Property GLAccounts As XPCollection(Of GLAccounts)
|
||||
Get
|
||||
Return New XPCollection(Of GLAccounts)(Session, CriteriaOperator.Parse("ImportedOther=?", Me.Oid))
|
||||
End Get
|
||||
End Property
|
||||
<VisibleInListView(False)> _
|
||||
ReadOnly Property InvoiceNameParameters As XPCollection(Of InvoiceNameParameters)
|
||||
Get
|
||||
Return New XPCollection(Of InvoiceNameParameters)(Session, CriteriaOperator.Parse("PHImportType=1"))
|
||||
End Get
|
||||
End Property
|
||||
<VisibleInListView(False)> _
|
||||
ReadOnly Property CustomerNameParameters As XPCollection(Of CustomerNameParameters)
|
||||
Get
|
||||
Return New XPCollection(Of CustomerNameParameters)(Session, CriteriaOperator.Parse("PHImportType=1"))
|
||||
End Get
|
||||
End Property
|
||||
Property CostHolder As CostHolder
|
||||
Get
|
||||
Return _CostHolder
|
||||
End Get
|
||||
Set(ByVal value As CostHolder)
|
||||
SetPropertyValue("CostHolder", _CostHolder, value)
|
||||
End Set
|
||||
End Property
|
||||
<RuleRequiredField("Vivaldi-Customers_Cash", DefaultContexts.Save)> _
|
||||
Property Customers_Cash As Customers
|
||||
Get
|
||||
Return _Customers_Cash
|
||||
End Get
|
||||
Set(ByVal value As Customers)
|
||||
SetPropertyValue("Customers_Cash", _Customers_Cash, value)
|
||||
End Set
|
||||
End Property
|
||||
<RuleRequiredField("Vivaldi-Customers_ATM", DefaultContexts.Save)> _
|
||||
Property Customers_ATM As Customers
|
||||
Get
|
||||
Return _Customers_ATM
|
||||
End Get
|
||||
Set(ByVal value As Customers)
|
||||
SetPropertyValue("Customers_ATM", _Customers_ATM, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
@@ -0,0 +1,78 @@
|
||||
Partial Class VivaldiVC
|
||||
|
||||
<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.aCreateGLAccounts_Vivaldi = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aCheckName_Vivaldi = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aRemoveGLAccounts_Vivaldi = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
'
|
||||
'aCreateGLAccounts_Vivaldi
|
||||
'
|
||||
Me.aCreateGLAccounts_Vivaldi.Caption = "Create GL Accounts"
|
||||
Me.aCreateGLAccounts_Vivaldi.ConfirmationMessage = "Do you want to execute ?"
|
||||
Me.aCreateGLAccounts_Vivaldi.Id = "aCreateGLAccounts_Vivaldi"
|
||||
Me.aCreateGLAccounts_Vivaldi.ImageName = Nothing
|
||||
Me.aCreateGLAccounts_Vivaldi.Shortcut = Nothing
|
||||
Me.aCreateGLAccounts_Vivaldi.Tag = Nothing
|
||||
Me.aCreateGLAccounts_Vivaldi.TargetObjectsCriteria = Nothing
|
||||
Me.aCreateGLAccounts_Vivaldi.TargetViewId = "Vivaldi_DetailView"
|
||||
Me.aCreateGLAccounts_Vivaldi.ToolTip = Nothing
|
||||
Me.aCreateGLAccounts_Vivaldi.TypeOfView = Nothing
|
||||
'
|
||||
'aCheckName_Vivaldi
|
||||
'
|
||||
Me.aCheckName_Vivaldi.Caption = "Check names"
|
||||
Me.aCheckName_Vivaldi.ConfirmationMessage = "Do you want to execute ?"
|
||||
Me.aCheckName_Vivaldi.Id = "aCheckName_Vivaldi"
|
||||
Me.aCheckName_Vivaldi.ImageName = Nothing
|
||||
Me.aCheckName_Vivaldi.Shortcut = Nothing
|
||||
Me.aCheckName_Vivaldi.Tag = Nothing
|
||||
Me.aCheckName_Vivaldi.TargetObjectsCriteria = Nothing
|
||||
Me.aCheckName_Vivaldi.TargetViewId = "Vivaldi_DetailView"
|
||||
Me.aCheckName_Vivaldi.ToolTip = Nothing
|
||||
Me.aCheckName_Vivaldi.TypeOfView = Nothing
|
||||
'
|
||||
'aRemoveGLAccounts_Vivaldi
|
||||
'
|
||||
Me.aRemoveGLAccounts_Vivaldi.Caption = "Remove GL Accounts"
|
||||
Me.aRemoveGLAccounts_Vivaldi.ConfirmationMessage = "Do you want to execute command ?"
|
||||
Me.aRemoveGLAccounts_Vivaldi.Id = "aRemoveGLAccounts_Vivaldi"
|
||||
Me.aRemoveGLAccounts_Vivaldi.ImageName = Nothing
|
||||
Me.aRemoveGLAccounts_Vivaldi.Shortcut = Nothing
|
||||
Me.aRemoveGLAccounts_Vivaldi.Tag = Nothing
|
||||
Me.aRemoveGLAccounts_Vivaldi.TargetObjectsCriteria = Nothing
|
||||
Me.aRemoveGLAccounts_Vivaldi.TargetViewId = "Vivaldi_DetailView"
|
||||
Me.aRemoveGLAccounts_Vivaldi.ToolTip = Nothing
|
||||
Me.aRemoveGLAccounts_Vivaldi.TypeOfView = Nothing
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aCreateGLAccounts_Vivaldi As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aCheckName_Vivaldi As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aRemoveGLAccounts_Vivaldi As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,132 @@
|
||||
<?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="aCreateGLAccounts_Vivaldi.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aCheckName_Vivaldi.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 56</value>
|
||||
</metadata>
|
||||
<metadata name="aRemoveGLAccounts_Vivaldi.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>216, 56</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,404 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Diagnostics
|
||||
Imports System.Text
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.ExpressApp.Actions
|
||||
Imports DevExpress.Persistent.Base
|
||||
|
||||
Imports DevExpress.ExpressApp.SystemModule
|
||||
Imports System.IO
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.ExpressApp.Win.Editors
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.ExpressApp.Win.SystemModule
|
||||
Imports DevExpress.ExpressApp.Editors
|
||||
Imports Microsoft.VisualBasic.FileIO
|
||||
Imports System.Threading
|
||||
|
||||
Public Class VivaldiVC
|
||||
Inherits DevExpress.ExpressApp.ViewController
|
||||
Dim _WaitFormClass As New WaitFormClass
|
||||
|
||||
Private _GridListEditor As GridListEditor
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
End Sub
|
||||
Protected Overrides Sub OnActivated()
|
||||
MyBase.OnActivated()
|
||||
_WaitFormClass = New WaitFormClass
|
||||
|
||||
If View.Id = "Vivaldi_InvoiceNameParameters_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "Vivaldi_CustomerNameParameters_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "Vivaldi_GLAccounts_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.DeleteObjectsViewController)().Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "GLHeader_GLRows_ListView_Accounts" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", False)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "Vivaldi_DetailView" Then
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAction.Executing, AddressOf SaveAction_Executing
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAndCloseAction.Executing, AddressOf SaveAction_Executing
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAndNewAction.Executing, AddressOf SaveAction_Executing
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub OnDeactivated()
|
||||
MyBase.OnDeactivated()
|
||||
If View.Id = "Vivaldi_InvoiceNameParameters_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "Vivaldi_CustomerNameParameters_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "Vivaldi_GLAccounts_ListView" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.DeleteObjectsViewController)().Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "GLHeader_GLRows_ListView_Accounts" Then
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.Win.SystemModule.OpenObjectController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ExportController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RecordsNavigationController)().Active.SetItemValue("", True)
|
||||
Frame.GetController(Of PrintingController)().Active.SetItemValue("", True)
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub OnViewControlsCreated()
|
||||
MyBase.OnViewControlsCreated()
|
||||
End Sub
|
||||
Sub SaveAction_Executing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
|
||||
End Sub
|
||||
|
||||
Private Sub aCreateGLAccounts_Vivaldi_Execute(ByVal sender As System.Object, ByVal e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aCreateGLAccounts_Vivaldi.Execute
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _Vivaldi As Vivaldi = _onew.GetObject(TryCast(View.SelectedObjects(0), Vivaldi))
|
||||
Dim _RowCount As Long = 0
|
||||
Dim _GLAccount As GLAccounts
|
||||
Dim _GLRows As GLRows
|
||||
If _Vivaldi.ExcelFile Is Nothing Then Exit Sub
|
||||
Dim _VAT As VAT
|
||||
Dim _DocumentNumber As String = ""
|
||||
Dim _DocumentNumber_Last As String = ""
|
||||
Dim _DocumentNumber_Act As String = ""
|
||||
Dim _MemoryStream As New MemoryStream
|
||||
_Vivaldi.ExcelFile.SaveToStream(_MemoryStream)
|
||||
Dim _StreamReader As New System.IO.StreamReader(_MemoryStream, System.Text.Encoding.GetEncoding(1250))
|
||||
Dim _StrBuffer As String = ""
|
||||
Dim columns As String()
|
||||
Dim _Loadable As Boolean = False
|
||||
|
||||
_MemoryStream.Seek(0, System.IO.SeekOrigin.Begin)
|
||||
_StrBuffer = _StreamReader.ReadToEnd()
|
||||
_StreamReader.Close()
|
||||
_MemoryStream.Close()
|
||||
|
||||
Using parser As New TextFieldParser(New StringReader(_StrBuffer))
|
||||
parser.TextFieldType = FieldType.Delimited
|
||||
parser.SetDelimiters(";")
|
||||
While Not parser.EndOfData
|
||||
Try
|
||||
columns = parser.ReadFields()
|
||||
_RowCount += 1
|
||||
Catch ex As MalformedLineException
|
||||
|
||||
End Try
|
||||
End While
|
||||
End Using
|
||||
Try
|
||||
Frame.GetController(Of Validation.PersistenceValidationController).Active.SetItemValue("", False)
|
||||
GLOBAL_HAS_Audit = False
|
||||
|
||||
Using parser As New TextFieldParser(New StringReader(_StrBuffer))
|
||||
parser.TextFieldType = FieldType.Delimited
|
||||
parser.SetDelimiters(";")
|
||||
parser.TrimWhiteSpace = True
|
||||
_WaitFormClass.Initwork(1, 1, _RowCount)
|
||||
While Not parser.EndOfData
|
||||
Try
|
||||
columns = parser.ReadFields()
|
||||
_WaitFormClass.DoWork()
|
||||
If parser.LineNumber > 2 Or parser.LineNumber = -1 Then
|
||||
_DocumentNumber = Replace(columns(3).ToString, " ", "")
|
||||
'If _DocumentNumber = "F01-1-204/2014" Then
|
||||
If _DocumentNumber_Last <> _DocumentNumber Then
|
||||
If _DocumentNumber_Last <> "" Then
|
||||
'// Az előző befejezése
|
||||
If _GLAccount IsNot Nothing Then
|
||||
_GLAccount.RecalculateTotal()
|
||||
_onew.CommitChanges()
|
||||
End If
|
||||
End If
|
||||
_Loadable = False
|
||||
_GLAccount = _onew.FindObject(Of GLAccounts)(CriteriaOperator.Parse("CustomersFrom=? and DocumentNumber=? and PartnerType=0 and IsEditable=False", _Vivaldi.CustomersFrom, _DocumentNumber), True)
|
||||
If _GLAccount Is Nothing Then
|
||||
_Loadable = True
|
||||
_GLAccount = _onew.CreateObject(Of GLAccounts)()
|
||||
|
||||
_GLAccount.ConnectInfo = _DocumentNumber
|
||||
_GLAccount.CurrencyName = _onew.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName=?", columns(18).ToString))
|
||||
If _GLAccount.CurrencyName Is Nothing Then _GLAccount.CurrencyName = _onew.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'", columns(18).ToString))
|
||||
_GLAccount.Customers = _Vivaldi.Customers_ATM
|
||||
If columns(0).ToString = "KPS" Then _GLAccount.Customers = _Vivaldi.Customers_Cash
|
||||
If columns(0).ToString = "HKS" Then _GLAccount.Customers = _Vivaldi.Customers_ATM
|
||||
_GLAccount.CustomersFrom = _Vivaldi.CustomersFrom
|
||||
If _GLAccount.Customers.Oid = _Vivaldi.Customers_Cash.Oid Then
|
||||
_GLAccount.PaymentOption = _onew.FindObject(Of PaymentOption)(CriteriaOperator.Parse("ShortName='Készpénz'"))
|
||||
Else
|
||||
_GLAccount.PaymentOption = _onew.FindObject(Of PaymentOption)(CriteriaOperator.Parse("ShortName='Átutalás'"))
|
||||
End If
|
||||
_GLAccount.DateCreated = CDate(columns(5))
|
||||
_GLAccount.DateExecution = CDate(columns(6))
|
||||
_GLAccount.DatePayment = CDate(columns(7))
|
||||
_GLAccount.DocumentNumber = _GLAccount.ConnectInfo
|
||||
_GLAccount.GLDocumentType = eGLDocumentType.eGLAccount
|
||||
_GLAccount.ImportedOther = _Vivaldi.Oid
|
||||
_GLAccount.IsEditable = False
|
||||
_GLAccount.IsStorno = False
|
||||
_GLAccount.NoteHeader = ""
|
||||
_GLAccount.PartnerType = ePartnerType.eReceivables
|
||||
|
||||
|
||||
_GLAccount.VATAvowalType = eVATAvowalType.eGeneral
|
||||
End If
|
||||
|
||||
_DocumentNumber_Last = _DocumentNumber
|
||||
Else
|
||||
|
||||
End If
|
||||
|
||||
If _GLAccount IsNot Nothing And _Loadable = True Then
|
||||
|
||||
'Nettó sor
|
||||
|
||||
Dim _Rate As Double = 1
|
||||
If Val(SQLNum(columns(17))) <> 0 Then
|
||||
_Rate = Math.Round((Val(SQLNum(columns(13))) + Val(SQLNum(columns(16)))) / Val(SQLNum(columns(17))), 4, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
|
||||
_GLRows = _onew.CreateObject(Of GLRows)()
|
||||
_GLRows.GLHeader = _GLAccount
|
||||
|
||||
_GLRows.AmountHUF = Val(SQLNum(columns(13)))
|
||||
If Val(SQLNum(columns(17))) <> 0 Then
|
||||
_GLRows.AmountDEV = Math.Round(_GLRows.AmountHUF / _Rate, 4, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
_GLRows.ConnectInfo = _GLAccount.ConnectInfo
|
||||
_GLRows.Controlling = Nothing
|
||||
_GLRows.CostHolder = _Vivaldi.CostHolder
|
||||
_GLRows.CostPlace = Nothing
|
||||
If columns(11) = "K" Then
|
||||
_GLRows.CreditChartOfAccounts = _onew.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber=?", Year(_GLAccount.DateExecution), columns(8).ToString))
|
||||
_GLRows.DebitChartOfAccounts = _GLAccount.Customers.CustomersGLParameters.GetChartOfAccounts(Year(_GLAccount.DateExecution), eVATMode.eOut)
|
||||
ElseIf columns(11) = "T" Then
|
||||
_GLRows.DebitChartOfAccounts = _onew.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber=?", Year(_GLAccount.DateExecution), columns(8).ToString))
|
||||
_GLRows.CreditChartOfAccounts = _GLAccount.Customers.CustomersGLParameters.GetChartOfAccounts(Year(_GLAccount.DateExecution), eVATMode.eOut)
|
||||
End If
|
||||
_GLRows.Customer = _GLAccount.Customers
|
||||
_GLRows.DateExecution = _GLAccount.DateExecution
|
||||
_GLRows.DateVAT = _GLAccount.DateExecution
|
||||
_GLRows.GLRowsType = eGLRowsType.eNormal
|
||||
_GLRows.GLRowsTypeVAT = eGLRowsTypeVAT.eNettoRow
|
||||
_GLRows.NoteRows = columns(12).ToString
|
||||
_GLRows.PartnerType = ePartnerType.eReceivables
|
||||
_GLRows.RowIndex = Val(columns(4))
|
||||
_GLRows.TransactionType = eTransactionType.eNotSet
|
||||
_VAT = _onew.FindObject(Of VAT)(CriteriaOperator.Parse("VATBag=?", columns(14)))
|
||||
|
||||
|
||||
If _VAT IsNot Nothing Then _GLRows.VAT = _VAT
|
||||
If Val(columns(16)) > 0 Then
|
||||
'ÁFA sor
|
||||
_GLRows = _onew.CreateObject(Of GLRows)()
|
||||
_GLRows.GLHeader = _GLAccount
|
||||
_GLRows.AmountDEV = 0
|
||||
_GLRows.AmountHUF = Val(SQLNum(columns(16)))
|
||||
If Val(SQLNum(columns(17))) <> 0 Then
|
||||
_GLRows.AmountDEV = Math.Round(_GLRows.AmountHUF / _Rate, 4, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
|
||||
_GLRows.ConnectInfo = _GLAccount.ConnectInfo
|
||||
_GLRows.CostHolder = _Vivaldi.CostHolder
|
||||
|
||||
If columns(11) = "K" Then
|
||||
_GLRows.CreditChartOfAccounts = _onew.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber=?", Year(_GLAccount.DateExecution), columns(15).ToString))
|
||||
_GLRows.DebitChartOfAccounts = _GLAccount.Customers.CustomersGLParameters.GetChartOfAccounts(Year(_GLAccount.DateExecution), eVATMode.eOut)
|
||||
ElseIf columns(11) = "T" Then
|
||||
_GLRows.DebitChartOfAccounts = _onew.FindObject(Of ChartOfAccounts)(CriteriaOperator.Parse("AccountYear=? and AccountNumber=?", Year(_GLAccount.DateExecution), columns(15).ToString))
|
||||
_GLRows.CreditChartOfAccounts = _GLAccount.Customers.CustomersGLParameters.GetChartOfAccounts(Year(_GLAccount.DateExecution), eVATMode.eOut)
|
||||
End If
|
||||
|
||||
_GLRows.Customer = _GLAccount.Customers
|
||||
_GLRows.DateExecution = _GLAccount.DateExecution
|
||||
_GLRows.DateVAT = _GLAccount.DateExecution
|
||||
|
||||
_GLRows.GLRowsType = eGLRowsType.eNormal
|
||||
_GLRows.GLRowsTypeVAT = eGLRowsTypeVAT.eVATRow
|
||||
_GLRows.NoteRows = ""
|
||||
_GLRows.PartnerType = ePartnerType.eReceivables
|
||||
_GLRows.RowIndex = Val(columns(4)) + 1
|
||||
If _VAT IsNot Nothing Then _GLRows.VAT = _VAT
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
'End If
|
||||
Catch ex As MalformedLineException
|
||||
|
||||
End Try
|
||||
End While
|
||||
If _GLAccount IsNot Nothing Then _GLAccount.RecalculateTotal()
|
||||
_onew.CommitChanges()
|
||||
_WaitFormClass.FinalWork()
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
Finally
|
||||
GLOBAL_HAS_Audit = True
|
||||
Frame.GetController(Of Validation.PersistenceValidationController).Active.SetItemValue("", True)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub aCheckName_Vivaldi_Execute(ByVal sender As System.Object, ByVal e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aCheckName_Vivaldi.Execute
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _Vivaldi As Vivaldi = _onew.GetObject(TryCast(View.SelectedObjects(0), Vivaldi))
|
||||
Dim _RowCount As Long = 0
|
||||
Dim _GLAccount As GLAccounts
|
||||
Dim _GLRows As GLRows
|
||||
If _Vivaldi.ExcelFile Is Nothing Then Exit Sub
|
||||
Dim _VAT As VAT
|
||||
Dim _DocumentNumber As String
|
||||
Dim _J As Long = 1
|
||||
Dim _MemoryStream As New MemoryStream
|
||||
_Vivaldi.ExcelFile.SaveToStream(_MemoryStream)
|
||||
Dim _StreamReader As New System.IO.StreamReader(_MemoryStream, System.Text.Encoding.GetEncoding(1250))
|
||||
Dim _StrBuffer As String = ""
|
||||
_MemoryStream.Seek(0, System.IO.SeekOrigin.Begin)
|
||||
_StrBuffer = _StreamReader.ReadToEnd()
|
||||
_StreamReader.Close()
|
||||
_MemoryStream.Close()
|
||||
|
||||
Using parser As New TextFieldParser(New StringReader(_StrBuffer))
|
||||
parser.TextFieldType = FieldType.Delimited
|
||||
parser.SetDelimiters(";")
|
||||
While Not parser.EndOfData
|
||||
Try
|
||||
Dim columns As String() = parser.ReadFields()
|
||||
_RowCount += 1
|
||||
Catch ex As MalformedLineException
|
||||
|
||||
End Try
|
||||
End While
|
||||
End Using
|
||||
Try
|
||||
Frame.GetController(Of Validation.PersistenceValidationController).Active.SetItemValue("", False)
|
||||
GLOBAL_HAS_Audit = False
|
||||
|
||||
Using parser As New TextFieldParser(New StringReader(_StrBuffer))
|
||||
parser.TextFieldType = FieldType.Delimited
|
||||
parser.SetDelimiters(";")
|
||||
parser.TrimWhiteSpace = True
|
||||
_WaitFormClass.Initwork(1, 1, _RowCount)
|
||||
While Not parser.EndOfData
|
||||
Try
|
||||
Dim columns As String() = parser.ReadFields()
|
||||
_WaitFormClass.DoWork()
|
||||
If parser.LineNumber > 2 Then
|
||||
_DocumentNumber = Replace(columns(3).ToString, " ", "")
|
||||
_GLAccount = _onew.FindObject(Of GLAccounts)(CriteriaOperator.Parse("CustomersFrom=? and DocumentNumber=? and PartnerType=0", _Vivaldi.CustomersFrom, _DocumentNumber), True)
|
||||
If _GLAccount Is Nothing Then
|
||||
Debug.Print(String.Format("{0:0000}. {1}", _J, _DocumentNumber))
|
||||
_J += 1
|
||||
End If
|
||||
End If
|
||||
Catch ex As MalformedLineException
|
||||
|
||||
End Try
|
||||
End While
|
||||
_WaitFormClass.FinalWork()
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
Finally
|
||||
GLOBAL_HAS_Audit = True
|
||||
Frame.GetController(Of Validation.PersistenceValidationController).Active.SetItemValue("", True)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub aRemoveGLAccounts_Vivaldi_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aRemoveGLAccounts_Vivaldi.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _uow As New UnitOfWork(_ocur.Session.DataLayer)
|
||||
Dim _Vivaldi As Vivaldi = TryCast(View.SelectedObjects(0), Vivaldi)
|
||||
Dim _GLAccounts_Collection As New XPCollection(Of GLAccounts)(_uow, CriteriaOperator.Parse("ImportedOther=?", _Vivaldi.Oid))
|
||||
|
||||
_uow.Delete(_GLAccounts_Collection)
|
||||
_uow.CommitChanges()
|
||||
|
||||
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user