First create solution

This commit is contained in:
2017-03-08 11:21:27 +01:00
commit a2fb86bacf
5508 changed files with 1082238 additions and 0 deletions
@@ -0,0 +1,216 @@
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 RegistryTelephone
Inherits BaseObject
Private _GLAccounts As GLAccounts
Private _RegistryHeader As RegistryHeader
Private _RegistryTelephoneParameters As RegistryTelephoneParameters
Private _UniqueObjects As UniqueObjects
Private _Amount_Brutto_INTERNET As Double
Private _Amount_Netto_INTERNET As Double
Private _Amount_VAT_INTERNET As Double
Private _Amount_Brutto_PARKING As Double
Private _Amount_Brutto_TELEPHON As Double
Private _AmountNetto_TELEPHON_80 As Double
Private _AmountNetto_TELEPHON_20 As Double
Private _Amount_VAT_TELEPHON_70 As Double
Private _Amount_Brutto_OTHER_DEFAULTVAT As Double
Private _Amount_Netto_OTHER_DEFAULTVAT As Double
Private _Amount_VAT_OTHER_DEFAULTVAT As Double
Private _Amount_Brutto_OTHER_NOVAT As Double
Public Sub New(ByVal session As Session)
MyBase.New(session)
' This constructor is used when an object is loaded from a persistent storage.
' Do not place any code here or place it only when the IsLoading property is false:
' if (!IsLoading){
' It is now OK to place your initialization code here.
' }
' or as an alternative, move your initialization code into the AfterConstruction method.
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
' Place here your initialization code.
End Sub
<Browsable(False)> _
Property GLAccounts As GLAccounts
Get
Return _GLAccounts
End Get
Set(value As GLAccounts)
SetPropertyValue("GLAccounts", _GLAccounts, value)
End Set
End Property
Property RegistryHeader As RegistryHeader
Get
Return _RegistryHeader
End Get
Set(value As RegistryHeader)
SetPropertyValue("RegistryHeader", _RegistryHeader, value)
End Set
End Property
Property RegistryTelephoneParameters As RegistryTelephoneParameters
Get
Return _RegistryTelephoneParameters
End Get
Set(value As RegistryTelephoneParameters)
SetPropertyValue("RegistryTelephoneParameters", _RegistryTelephoneParameters, value)
End Set
End Property
Property UniqueObjects As UniqueObjects
Get
Return _UniqueObjects
End Get
Set(value As UniqueObjects)
SetPropertyValue("UniqueObjects", _UniqueObjects, value)
End Set
End Property
Property Amount_Brutto_INTERNET As Double
Get
Return _Amount_Brutto_INTERNET
End Get
Set(value As Double)
SetPropertyValue("Amount_Brutto_INTERNET", _Amount_Brutto_INTERNET, value)
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
If Me.RegistryTelephoneParameters.VAT_DEFAULTVAT_INTERNET IsNot Nothing Then
Amount_Netto_INTERNET = Math.Round(value / (1 + RegistryTelephoneParameters.VAT_DEFAULTVAT_INTERNET.KeyValue), 0, MidpointRounding.AwayFromZero)
Amount_VAT_INTERNET = Math.Round(value - Amount_Netto_INTERNET, 0, MidpointRounding.AwayFromZero)
Else
Amount_Netto_INTERNET = value
Amount_VAT_INTERNET = 0
End If
End If
End Set
End Property
Property Amount_Netto_INTERNET As Double
Get
Return _Amount_Netto_INTERNET
End Get
Set(value As Double)
SetPropertyValue("Amount_Netto_INTERNET", _Amount_Netto_INTERNET, value)
End Set
End Property
Property Amount_VAT_INTERNET As Double
Get
Return _Amount_VAT_INTERNET
End Get
Set(value As Double)
SetPropertyValue("Amount_VAT_INTERNET", _Amount_VAT_INTERNET, value)
End Set
End Property
Property Amount_Brutto_PARKING As Double
Get
Return _Amount_Brutto_PARKING
End Get
Set(value As Double)
SetPropertyValue("Amount_Brutto_PARKING", _Amount_Brutto_PARKING, value)
End Set
End Property
Property Amount_Brutto_TELEPHON As Double
Get
Return _Amount_Brutto_TELEPHON
End Get
Set(value As Double)
SetPropertyValue("Amount_Brutto_TELEPHON", _Amount_Brutto_TELEPHON, value)
If Session.IsObjectsSaving = False And Session.IsObjectsLoading = False Then
If Me.RegistryTelephoneParameters.VAT_DEFAULTVAT IsNot Nothing Then
Dim _Amount_Netto_TELEPHONE = Math.Round(Math.Round(value * 0.7, 2, MidpointRounding.AwayFromZero) / _
(1 + RegistryTelephoneParameters.VAT_DEFAULTVAT.KeyValue), 2, MidpointRounding.AwayFromZero)
Me.Amount_VAT_TELEPHON_70 = Math.Round(_Amount_Netto_TELEPHONE * RegistryTelephoneParameters.VAT_DEFAULTVAT.KeyValue, 2, MidpointRounding.AwayFromZero)
_Amount_Netto_TELEPHONE = value - Amount_VAT_TELEPHON_70
Me.AmountNetto_TELEPHON_80 = Math.Round(_Amount_Netto_TELEPHONE * 0.8, 2, MidpointRounding.AwayFromZero)
Me.AmountNetto_TELEPHON_20 = _Amount_Netto_TELEPHONE - Me.AmountNetto_TELEPHON_80
Else
Dim _Amount_Netto_TELEPHONE = Math.Round(Math.Round(value * 0.7, 2, MidpointRounding.AwayFromZero) / _
(1), 0, MidpointRounding.AwayFromZero)
Me.Amount_VAT_TELEPHON_70 = 0
_Amount_Netto_TELEPHONE = value - Amount_VAT_TELEPHON_70
Me.AmountNetto_TELEPHON_80 = Math.Round(_Amount_Netto_TELEPHONE * 0.8, 2, MidpointRounding.AwayFromZero)
Me.AmountNetto_TELEPHON_20 = _Amount_Netto_TELEPHONE - Me.AmountNetto_TELEPHON_80
End If
End If
End Set
End Property
Property AmountNetto_TELEPHON_80 As Double
Get
Return _AmountNetto_TELEPHON_80
End Get
Set(value As Double)
SetPropertyValue("AmountNetto_TELEPHON_80", _AmountNetto_TELEPHON_80, value)
End Set
End Property
Property AmountNetto_TELEPHON_20 As Double
Get
Return _AmountNetto_TELEPHON_20
End Get
Set(value As Double)
SetPropertyValue("AmountNetto_TELEPHON_20", _AmountNetto_TELEPHON_20, value)
End Set
End Property
Property Amount_VAT_TELEPHON_70 As Double
Get
Return _Amount_VAT_TELEPHON_70
End Get
Set(value As Double)
SetPropertyValue("Amount_VAT_TELEPHON_70", _Amount_VAT_TELEPHON_70, value)
End Set
End Property
Property Amount_Brutto_OTHER_DEFAULTVAT As Double
Get
Return _Amount_Brutto_OTHER_DEFAULTVAT
End Get
Set(value As Double)
SetPropertyValue("Amount_Brutto_OTHER_DEFAULTVAT", _Amount_Brutto_OTHER_DEFAULTVAT, value)
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
If Me.RegistryTelephoneParameters.VAT_DEFAULTVAT IsNot Nothing Then
Amount_Netto_OTHER_DEFAULTVAT = Math.Round(value / (1 + RegistryTelephoneParameters.VAT_DEFAULTVAT.KeyValue), 0, MidpointRounding.AwayFromZero)
Amount_VAT_OTHER_DEFAULTVAT = Math.Round(value - Amount_Netto_OTHER_DEFAULTVAT, 0, MidpointRounding.AwayFromZero)
Else
Amount_Netto_OTHER_DEFAULTVAT = value
Amount_VAT_OTHER_DEFAULTVAT = 0
End If
End If
End Set
End Property
Property Amount_Netto_OTHER_DEFAULTVAT As Double
Get
Return _Amount_Netto_OTHER_DEFAULTVAT
End Get
Set(value As Double)
SetPropertyValue("Amount_Netto_OTHER_DEFAULTVAT", _Amount_Netto_OTHER_DEFAULTVAT, value)
End Set
End Property
Property Amount_VAT_OTHER_DEFAULTVAT As Double
Get
Return _Amount_VAT_OTHER_DEFAULTVAT
End Get
Set(value As Double)
SetPropertyValue("Amount_VAT_OTHER_DEFAULTVAT", _Amount_VAT_OTHER_DEFAULTVAT, value)
End Set
End Property
Property Amount_Brutto_OTHER_NOVAT As Double
Get
Return _Amount_Brutto_OTHER_NOVAT
End Get
Set(value As Double)
SetPropertyValue("Amount_Brutto_OTHER_NOVAT", _Amount_Brutto_OTHER_NOVAT, value)
End Set
End Property
ReadOnly Property RowTotalBrutto As Double
Get
Return Amount_Brutto_INTERNET + Amount_Brutto_OTHER_DEFAULTVAT + Amount_Brutto_OTHER_NOVAT + Amount_Brutto_PARKING + Amount_Brutto_TELEPHON
End Get
End Property
End Class
@@ -0,0 +1,124 @@
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 RegistryTelephoneParameters
Inherits BaseObject
Private _CustomersFrom As CustomersFrom
Private _Controlling_INTERNET As Controlling
Private _Controlling_PARKING As Controlling
Private _Controlling_TELEPHON_80 As Controlling
Private _Controlling_TELEPHON_20 As Controlling
Private _Controlling_OTHER_DEFAULTVAT As Controlling
Private _Controlling_OTHER_NOVAT As Controlling
Private _VAT_DEFAULTVAT As VAT
Private _VAT_DEFAULTVAT_INTERNET As VAT
Private _VAT_NOVAT As VAT
Public Sub New(ByVal session As Session)
MyBase.New(session)
' This constructor is used when an object is loaded from a persistent storage.
' Do not place any code here or place it only when the IsLoading property is false:
' if (!IsLoading){
' It is now OK to place your initialization code here.
' }
' or as an alternative, move your initialization code into the AfterConstruction method.
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
' Place here your initialization code.
End Sub
Property CustomersFrom As CustomersFrom
Get
Return _CustomersFrom
End Get
Set(value As CustomersFrom)
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
End Set
End Property
Property Controlling_INTERNET As Controlling
Get
Return _Controlling_INTERNET
End Get
Set(value As Controlling)
SetPropertyValue("Controlling_INTERNET", _Controlling_INTERNET, value)
End Set
End Property
Property Controlling_PARKING As Controlling
Get
Return _Controlling_PARKING
End Get
Set(value As Controlling)
SetPropertyValue("Controlling_PARKING", _Controlling_PARKING, value)
End Set
End Property
Property Controlling_TELEPHON_80 As Controlling
Get
Return _Controlling_TELEPHON_80
End Get
Set(value As Controlling)
SetPropertyValue("Controlling_TELEPHON_80", _Controlling_TELEPHON_80, value)
End Set
End Property
Property Controlling_TELEPHON_20 As Controlling
Get
Return _Controlling_TELEPHON_20
End Get
Set(value As Controlling)
SetPropertyValue("Controlling_TELEPHON_20", _Controlling_TELEPHON_20, value)
End Set
End Property
Property Controlling_OTHER_DEFAULTVAT As Controlling
Get
Return _Controlling_OTHER_DEFAULTVAT
End Get
Set(value As Controlling)
SetPropertyValue("Controlling_OTHER_DEFAULTVAT", _Controlling_OTHER_DEFAULTVAT, value)
End Set
End Property
Property Controlling_OTHER_NOVAT As Controlling
Get
Return _Controlling_OTHER_NOVAT
End Get
Set(value As Controlling)
SetPropertyValue("Controlling_OTHER_NOVAT", _Controlling_OTHER_NOVAT, value)
End Set
End Property
Property VAT_DEFAULTVAT As VAT
Get
Return _VAT_DEFAULTVAT
End Get
Set(value As VAT)
SetPropertyValue("VAT_DEFAULTVAT", _VAT_DEFAULTVAT, value)
End Set
End Property
Property VAT_DEFAULTVAT_INTERNET As VAT
Get
Return _VAT_DEFAULTVAT_INTERNET
End Get
Set(value As VAT)
SetPropertyValue("VAT_DEFAULTVAT_INTERNET", _VAT_DEFAULTVAT_INTERNET, value)
End Set
End Property
Property VAT_NOVAT As VAT
Get
Return _VAT_NOVAT
End Get
Set(value As VAT)
SetPropertyValue("VAT_NOVAT", _VAT_NOVAT, value)
End Set
End Property
End Class
@@ -0,0 +1,52 @@
Partial Class RegistryTelephoneVC
<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.aControllRegistryTelephone = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
'
'aControllRegistryTelephone
'
Me.aControllRegistryTelephone.AcceptButtonCaption = Nothing
Me.aControllRegistryTelephone.CancelButtonCaption = Nothing
Me.aControllRegistryTelephone.Caption = "aControll Registry Telephone"
Me.aControllRegistryTelephone.Category = "aControllRegistryTelephone"
Me.aControllRegistryTelephone.ConfirmationMessage = Nothing
Me.aControllRegistryTelephone.Id = "aControllRegistryTelephone"
Me.aControllRegistryTelephone.ImageName = Nothing
Me.aControllRegistryTelephone.Shortcut = Nothing
Me.aControllRegistryTelephone.Tag = Nothing
Me.aControllRegistryTelephone.TargetObjectsCriteria = Nothing
Me.aControllRegistryTelephone.TargetObjectType = GetType(Nuvolar.[Module].RegistryHeader)
Me.aControllRegistryTelephone.TargetViewId = Nothing
Me.aControllRegistryTelephone.ToolTip = Nothing
Me.aControllRegistryTelephone.TypeOfView = Nothing
End Sub
Friend WithEvents aControllRegistryTelephone As DevExpress.ExpressApp.Actions.PopupWindowShowAction
End Class
@@ -0,0 +1,126 @@
<?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="aControllRegistryTelephone.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,216 @@
Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp.Utils
Public Class RegistryTelephoneVC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Private Sub aControllRegistryTelephone_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aControllRegistryTelephone.CustomizePopupWindowParams
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _CollectionSource As CollectionSource = New CollectionSource(_onew, GetType(RegistryTelephone))
Dim _RegistryTelephone As RegistryTelephone
Dim _Phones_Collection As New XPCollection(Of Phones)(_onew.Session, CriteriaOperator.Parse(""))
Dim _RegistryHeader As RegistryHeader = _onew.GetObject(TryCast(View.SelectedObjects(0), RegistryHeader))
Dim _Phones As Phones
Dim _RegistryTelephoneParameters As RegistryTelephoneParameters = _onew.FindObject(Of RegistryTelephoneParameters)(CriteriaOperator.Parse("CustomersFrom.Oid=?", _RegistryHeader.CustomersFrom.Oid))
For Each _Phones In _Phones_Collection
_RegistryTelephone = _onew.FindObject(Of RegistryTelephone)(CriteriaOperator.Parse("RegistryHeader=? and UniqueObjects=?", _RegistryHeader, _Phones.UniqueObjects))
If _RegistryTelephone Is Nothing Then
_RegistryTelephone = _onew.CreateObject(Of RegistryTelephone)()
End If
_RegistryTelephone.UniqueObjects = _Phones.UniqueObjects
_RegistryTelephone.RegistryTelephoneParameters = _RegistryTelephoneParameters
_RegistryTelephone.RegistryHeader = _RegistryHeader
_CollectionSource.Add(_RegistryTelephone)
Next
_onew.CommitChanges() 'ezt át kell nézni!!!!!!
_CollectionSource.BeginUpdateCriteria()
_CollectionSource.Criteria("ByTelephone") = CriteriaOperator.Parse("RegistryHeader.Oid=?", _RegistryHeader.Oid) 'PersistentCriteriaEvaluationBehavior.InTransaction
_CollectionSource.EndUpdateCriteria()
e.View = Application.CreateListView("RegistryTelephone_ListView", _CollectionSource, False)
End Sub
Private Sub aControllRegistryTelephone_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aControllRegistryTelephone.Execute
'//Telefonszámla rögzítése
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _RegistryHeader As RegistryHeader = TryCast(View.SelectedObjects(0), RegistryHeader)
Dim _RegistryTelephone As RegistryTelephone
Dim _TechnicalContractTemplate As ContractTemplate = _ocur.FindObject(Of ContractTemplate)(CriteriaOperator.Parse("CustomersFrom=? And IsTechnical=True", _RegistryHeader.CustomersFrom))
Dim _Contracts As Contracts = _ocur.FindObject(Of Contracts)(CriteriaOperator.Parse("CustomersFrom=? AND Customers=? AND ContractTemplate=?", _RegistryHeader.CustomersFrom, _RegistryHeader.Customers, _TechnicalContractTemplate))
Dim _ListView As ListView = TryCast(e.PopupWindow.View, ListView)
'// Ellenőrzések
'e.PopupWindow.View.ObjectSpace.CommitChanges()
If _TechnicalContractTemplate Is Nothing Then
'// Nincs technikai szerződési sablon
MsgBox(String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions\RegistryTelephone", "NoTechnicalContractTemplate")), _
MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, _
String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Exit Sub
End If
'// Ellenőrzés, hogy a total bruttó le lett-e bontva
If _ListView IsNot Nothing Then
Dim _BruttoAmountRemaining As Double = 0
For Each _RegistryTelephone In _ListView.CollectionSource.List
_BruttoAmountRemaining += _RegistryTelephone.Amount_Brutto_INTERNET + _RegistryTelephone.Amount_Brutto_OTHER_DEFAULTVAT + _RegistryTelephone.Amount_Brutto_OTHER_NOVAT + _RegistryTelephone.Amount_Brutto_PARKING + _RegistryTelephone.Amount_Brutto_TELEPHON
Next
If _BruttoAmountRemaining <> _RegistryHeader.F_AmountBruttoHUF Then
'// Hiba, hogy neincs minden sor lebontva
MsgBox(String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions\RegistryTelephone", "NotEqualTotalwithDivided")), _
MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, _
String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Exit Sub
End If
End If
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'//Technikai szerződés létrehozása
If _Contracts Is Nothing Then
_Contracts = _ocur.CreateObject(Of Contracts)()
_Contracts.CustomersFrom = _RegistryHeader.CustomersFrom
_Contracts.Customers = _RegistryHeader.Customers
_Contracts.ContractTemplate = _TechnicalContractTemplate
_Contracts.DateCreated = _RegistryHeader.F_DateCreated
_Contracts.DateExecution = _RegistryHeader.F_DateExecution
_Contracts.DocumentNumber = _Contracts.ContractTemplate.NumberGenerator.GetNewNumber(_Contracts.ContractTemplate.NumberGenerator)
_Contracts.State = State.Signed
End If
If _ListView IsNot Nothing Then
Frame.GetController(Of Validation.PersistenceValidationController).Active.SetItemValue("", False)
_ocur.Delete(_RegistryHeader.RegistryRowsFinancial)
_ocur.Delete(_RegistryHeader.RegistryRowsFinancialControlling)
For Each _RegistryTelephone In _ListView.CollectionSource.List
''//Először az ÁFÁ-s tételek rögzítése
If _RegistryTelephone.Amount_Brutto_INTERNET > 0 Then
Create_RRF_Row(_ocur, _RegistryHeader, _RegistryTelephone.Amount_Brutto_INTERNET, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_DEFAULTVAT_INTERNET))
Create_RRFC_Row(_ocur, _Contracts, _RegistryHeader, _RegistryTelephone.Amount_Netto_INTERNET, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.Controlling_INTERNET),
_ocur.GetObject(_RegistryTelephone.UniqueObjects), _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_DEFAULTVAT_INTERNET))
End If
If _RegistryTelephone.Amount_Brutto_OTHER_DEFAULTVAT > 0 Then
Create_RRF_Row(_ocur, _RegistryHeader, _RegistryTelephone.Amount_Brutto_OTHER_DEFAULTVAT, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_DEFAULTVAT))
Create_RRFC_Row(_ocur, _Contracts, _RegistryHeader, _RegistryTelephone.Amount_Netto_OTHER_DEFAULTVAT, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.Controlling_OTHER_DEFAULTVAT), _
_ocur.GetObject(_RegistryTelephone.UniqueObjects), _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_DEFAULTVAT))
End If
If _RegistryTelephone.Amount_Brutto_OTHER_NOVAT > 0 Then
Create_RRF_Row(_ocur, _RegistryHeader, _RegistryTelephone.Amount_Brutto_OTHER_NOVAT, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_NOVAT))
Create_RRFC_Row(_ocur, _Contracts, _RegistryHeader, _RegistryTelephone.Amount_Brutto_OTHER_NOVAT, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.Controlling_OTHER_NOVAT), _
_ocur.GetObject(_RegistryTelephone.UniqueObjects), _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_NOVAT))
End If
If _RegistryTelephone.Amount_Brutto_PARKING > 0 Then
Create_RRF_Row(_ocur, _RegistryHeader, _RegistryTelephone.Amount_Brutto_PARKING, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_NOVAT))
Create_RRFC_Row(_ocur, _Contracts, _RegistryHeader, _RegistryTelephone.Amount_Brutto_PARKING, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.Controlling_PARKING), _
_ocur.GetObject(_RegistryTelephone.UniqueObjects), _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_NOVAT))
End If
If _RegistryTelephone.Amount_Brutto_TELEPHON > 0 Then
Create_RRF_Row(_ocur, _RegistryHeader, Math.Round(_RegistryTelephone.Amount_Brutto_TELEPHON * 0.7, 0, MidpointRounding.AwayFromZero), _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_DEFAULTVAT))
Create_RRF_Row(_ocur, _RegistryHeader, _RegistryTelephone.Amount_Brutto_TELEPHON - Math.Round(_RegistryTelephone.Amount_Brutto_TELEPHON * 0.7, 0, MidpointRounding.AwayFromZero), _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_NOVAT))
Create_RRFC_Row(_ocur, _Contracts, _RegistryHeader, _RegistryTelephone.AmountNetto_TELEPHON_80, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.Controlling_TELEPHON_80), _
_ocur.GetObject(_RegistryTelephone.UniqueObjects), _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_DEFAULTVAT))
Create_RRFC_Row(_ocur, _Contracts, _RegistryHeader, _RegistryTelephone.AmountNetto_TELEPHON_20, _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.Controlling_TELEPHON_20), _
_ocur.GetObject(_RegistryTelephone.UniqueObjects), _ocur.GetObject(_RegistryTelephone.RegistryTelephoneParameters.VAT_DEFAULTVAT))
End If
Next
End If
_ocur.CommitChanges()
'// Kerekítés rendberakása -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
If _RegistryHeader.BruttoAmountRemaining = 0 And Math.Abs(_RegistryHeader.NettoAmountRemaining) < 5 Then
'Beep()
Dim _RegistryRowsFinancialControlling As RegistryRowsFinancialControlling
_RegistryHeader.RegistryRowsFinancialControlling.Sorting.Add(New SortProperty("Amount", DB.SortingDirection.Descending))
For Each _RegistryRowsFinancialControlling In _RegistryHeader.RegistryRowsFinancialControlling
If _RegistryRowsFinancialControlling.Controlling.Oid.ToString = _RegistryTelephone.RegistryTelephoneParameters.Controlling_TELEPHON_80.Oid.ToString Then
'Beep()
If _RegistryHeader.NettoAmountRemaining > 0 Then
_RegistryRowsFinancialControlling.Amount += _RegistryHeader.NettoAmountRemaining
Else
_RegistryRowsFinancialControlling.Amount -= _RegistryHeader.NettoAmountRemaining
End If
_ocur.CommitChanges()
Exit For
End If
Next
End If
Frame.GetController(Of Validation.PersistenceValidationController).Active.SetItemValue("", True)
End Sub
Private Sub Create_RRF_Row(_ocur As Xpo.XPObjectSpace, _RegistryHeader As RegistryHeader, _BruttoAmount As Double, _VAT As VAT)
Dim _RegistryRowsFinancial As RegistryRowsFinancial = _ocur.FindObject(Of RegistryRowsFinancial)(CriteriaOperator.Parse("RegistryHeader=? and VAT=?", _RegistryHeader, _VAT))
If _RegistryRowsFinancial Is Nothing Then
_RegistryRowsFinancial = _ocur.CreateObject(Of RegistryRowsFinancial)()
_RegistryRowsFinancial.RegistryHeader = _RegistryHeader
_RegistryRowsFinancial.BruttoAmount = _BruttoAmount
_RegistryRowsFinancial.VAT = _VAT
_RegistryRowsFinancial.DateVAT = _RegistryHeader.F_DateVAT
Else
_RegistryRowsFinancial.BruttoAmount += _BruttoAmount
End If
End Sub
Private Sub Create_RRFC_Row(_ocur As Xpo.XPObjectSpace, _Contracts As Contracts, _RegistryHeader As RegistryHeader, _
_Amount As Double, _Controlling As Controlling, _UniqueObjects As UniqueObjects, _VAT As VAT)
Dim _ContractRows As ContractRows
Dim _RegistryRowsFinancialControlling As RegistryRowsFinancialControlling
_ContractRows = _ocur.CreateObject(Of ContractRows)()
_ContractRows.Contracts = _Contracts
_ContractRows.CurrencyName = _RegistryHeader.F_CurrencyName
_ContractRows.ContractRowsType = eContractRowsType.eFix
_ContractRows.DateExecution = _RegistryHeader.F_DateExecution
_ContractRows.Controlling = _Controlling
If _RegistryHeader.F_CurrencyName.ShortName = "HUF" Then
_ContractRows.NettoPriceHUF = _Amount
Else
If _RegistryHeader.F_CurrencyRate <> 0 Then
_ContractRows.NettoPriceDEV = _Amount / _RegistryHeader.F_CurrencyRate
Else
_ContractRows.NettoPriceDEV = 0
End If
_ContractRows.NettoPriceHUF = _Amount
End If
_ContractRows.ShortName = "TELEFON"
_ContractRows.UniqueObjects = _UniqueObjects
'IDE KELL VALAMI ÁFA !
_ContractRows.VAT = _VAT
_ContractRows.Controlling = _Controlling
_ContractRows.JobNumberObjects = _RegistryHeader.JobNumberObjects
_RegistryRowsFinancialControlling = _ocur.CreateObject(Of RegistryRowsFinancialControlling)()
_RegistryRowsFinancialControlling.RegistryHeader = _RegistryHeader
_RegistryRowsFinancialControlling.ContractRows = _ContractRows
_RegistryRowsFinancialControlling.Amount = _Amount
_RegistryRowsFinancialControlling.Controlling = _Controlling
_RegistryRowsFinancialControlling.UniqueObjects = _UniqueObjects
End Sub
End Class