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.SystemModule Imports DevExpress.Persistent.Base.Security Imports DevExpress.ExpressApp.ConditionalAppearance Imports DevExpress.ExpressApp.Filtering ' _ ' _ '1", "MileStone", EditorState.Hidden, "ContractRowsType<>1", ViewType.DetailView)> _ ' _ _ _ _ 1", TargetItems:="MileStone", Criteria:="ContractRowsType<>1", Visibility:=Editors.ViewItemVisibility.Hide, Context:="DetailView")> _ _ _ _ _ _ _ _ _ _ _ _ _ Public Class ContractRows 'Szerződési sorok Inherits BaseObject Private _Contracts As Contracts '-- Szerződés fejléc Private _MileStone As ContractMileStone '-- Mérföldkő Private _DateExecution As Date '-- Teljesítési dátum Private _ShortName As String '-- Megnevezés Private _Description As String '-- Leírás Private _QTT As Double '-- Mennyiség Private _Units As Units '-- Mennyiségi egység Private _NettoPriceHUF As Double '-- Nettó egységár (HUF) Private _NettoPriceDEV As Double '-- Nettó egységár (DEV) Private _SumNettoPriceHUF As Double '-- Nettó sorérték (HUF) Private _SumNettoPriceDEV As Double '-- Nettó sorérték (DEV) Private _SumBruttoPriceHUF As Double '-- Nettó sorérték (HUF) Private _SumBruttoPriceDEV As Double '-- Nettó sorérték (DEV) Private _CurrencyName As CurrencyName '-- Deviza Private _CurrencyRate As Double = 1 '-- Árfolyam Private _PaymentOption As PaymentOption '--Fizetési opció Private _ShipmentOption As ShipmentOption '-- Szállítási opció Private _QualityOption As QualityOption '-- Minőségi opció Private _VAT As VAT 'ÁFA kód Private _InvoiceRows As InvoiceRows '-- Milyen soron lett kiszámlázva _ Private _InvoiceRowsAdvance As InvoiceRows ' --Ez a szerződés sor, ha ki van állítva számlán akkor milyen számlán lett visszaminuszolva. _ Private _ContractRowsType As eContractRowsType ' -- A szerződés sorának a típusa '-- Jelölő adatok ------------------------------------------------------------------------------- Private _Controlling As Controlling '-- Controlling szám Private _CostHolder As CostHolder ' -- Költségviselő Private _CostPlace As CostPlace '-- Költséghely Private _JobNumberObjects As JobNumberObjects '-- Projekt amihez a sor tartozik Private _UniqueObjects As UniqueObjects ' -- Egyedi azonosító '------------------------------------------------------------------------------------------------ Private _RegistryRowsFinancialControlling As RegistryRowsFinancialControlling ' -- Iktatási teljesítésre bontás sora (le van e teljesítési igazolva a sor) _ Private _RowGroup1 As String Private _RowGroup2 As String Private _CustomsTariffs As CustomsTariffs Private _InvoicePeriod As String 'Számlázási időszak Private _CertificateofContractRows As CertificateofContractRows ' _ Private _eContractRowsInvoiceState As eContractRowsInvoiceState 'Ki van-e számlázva az aktuális sor? _ Private _eContractRowsCOCState As eContractRowsCOCState 'Le van-e teljesítési igazolva az aktuális sor? _ Private _eContractRowsRRFCState As eContractRowsRRFCState 'Le van-e számla igazolva az aktuális sor? _ Private _ImmovablesCostRecordEvents As ImmovablesCostRecordEvents Private _Apartments As Apartments '-- Lakás Private _Garages As Garages '-- Garázs Private _Container As Container '-- Tároló Private _Offices As Offices '-- Üzletek Private _XLSGuid As String ' XLS sorban lévő saját guid Public Sub New(ByVal session As Session) MyBase.New(session) End Sub Public Overrides Sub AfterConstruction() MyBase.AfterConstruction() Units = Session.FindObject(Of Units)(1, CriteriaOperator.Parse("ShortName='DB'")) QTT = 1 CurrencyName = Session.FindObject(Of CurrencyName)(PersistentCriteriaEvaluationBehavior.InTransaction, Session.ParseCriteria("ShortName='HUF'")) End Sub Protected Overrides Sub OnSaving() MyBase.OnSaving() If VAT Is Nothing Then SumNettoPriceHUF = Math.Round(QTT * NettoPriceHUF, 0, MidpointRounding.AwayFromZero) SumBruttoPriceHUF = SumNettoPriceHUF SumNettoPriceDEV = Math.Round(QTT * NettoPriceDEV, 2, MidpointRounding.AwayFromZero) SumBruttoPriceDEV = SumNettoPriceDEV Else SumNettoPriceHUF = Math.Round(QTT * NettoPriceHUF, 0, MidpointRounding.AwayFromZero) SumBruttoPriceHUF = Math.Round(SumNettoPriceHUF * (1 + VAT.KeyValue), 0, MidpointRounding.AwayFromZero) SumNettoPriceDEV = Math.Round(QTT * NettoPriceDEV, 2, MidpointRounding.AwayFromZero) SumBruttoPriceDEV = Math.Round(SumNettoPriceDEV * (1 + VAT.KeyValue), 0, MidpointRounding.AwayFromZero) End If End Sub _ Property Contracts() As Contracts Get Return _Contracts End Get Set(ByVal value As Contracts) SetPropertyValue("Contracts", _Contracts, value) End Set End Property _ Property MileStone As ContractMileStone Get Return _MileStone End Get Set(ByVal value As ContractMileStone) SetPropertyValue("MileStone", _MileStone, value) End Set End Property _ Property DateExecution() As Date Get Return _DateExecution End Get Set(ByVal value As Date) SetPropertyValue("DateExecution", _DateExecution, value) End Set End Property ' _ _ Property ShortName() As String Get Return _ShortName End Get Set(ByVal value As String) SetPropertyValue("ShortName", _ShortName, value) End Set End Property _ Property Description() As String Get Return _Description End Get Set(ByVal value As String) SetPropertyValue("Description", _Description, value) End Set End Property Property QTT() As Double Get Return _QTT End Get Set(ByVal value As Double) SetPropertyValue("QTT", _QTT, value) End Set End Property _ Property Units() As Units Get Return _Units End Get Set(ByVal value As Units) SetPropertyValue("Units", _Units, value) End Set End Property _ Property NettoPriceHUF() As Double Get Return _NettoPriceHUF End Get Set(ByVal value As Double) SetPropertyValue("NettoPriceHUF", _NettoPriceHUF, value) End Set End Property _ Property NettoPriceDEV() As Double Get Return _NettoPriceDEV End Get Set(ByVal value As Double) SetPropertyValue("NettoPriceDEV", _NettoPriceDEV, value) If Session.IsObjectsSaving = False And Session.IsObjectsLoading = False Then If CurrencyName IsNot Nothing Then If CurrencyName.ShortName <> "HUF" Then NettoPriceHUF = Math.Round(CurrencyRate * value, 0, MidpointRounding.AwayFromZero) End If End If End If End Set End Property _ Property SumNettoPriceHUF As Double Get Return _SumNettoPriceHUF End Get Set(value As Double) SetPropertyValue("SumNettoPriceHUF", _SumNettoPriceHUF, value) End Set End Property _ Property SumNettoPriceDEV As Double Get Return _SumNettoPriceDEV End Get Set(value As Double) SetPropertyValue("SumNettoPriceDEV", _SumNettoPriceDEV, value) End Set End Property _ Property SumBruttoPriceHUF As Double Get Return _SumBruttoPriceHUF End Get Set(value As Double) SetPropertyValue("SumBruttoPriceHUF", _SumBruttoPriceHUF, value) End Set End Property _ Property SumBruttoPriceDEV As Double Get Return _SumBruttoPriceDEV End Get Set(value As Double) SetPropertyValue("SumBruttoPriceDEV", _SumBruttoPriceDEV, value) End Set End Property _ Property CurrencyName() As CurrencyName Get Return _CurrencyName End Get Set(ByVal value As CurrencyName) SetPropertyValue("CurrencyName", _CurrencyName, value) End Set End Property '1", DefaultContexts.Save, ValueComparisonType.NotEquals, 1, TargetCriteria:="CurrencyName.ShortName<>'HUF'")> _ _ Property CurrencyRate As Double Get Return _CurrencyRate End Get Set(ByVal value As Double) SetPropertyValue("CurrencyRate", _CurrencyRate, value) If Session.IsObjectsSaving = False And Session.IsObjectsLoading = False Then If CurrencyName IsNot Nothing Then If CurrencyName.ShortName <> "HUF" Then NettoPriceHUF = Math.Round(NettoPriceDEV * value, 0, MidpointRounding.AwayFromZero) End If End If End If End Set End Property _ Property PaymentOption() As PaymentOption Get Return _PaymentOption End Get Set(ByVal value As PaymentOption) SetPropertyValue("PaymentOption", _PaymentOption, value) End Set End Property Property ShipmentOption() As ShipmentOption Get Return _ShipmentOption End Get Set(ByVal value As ShipmentOption) SetPropertyValue("ShipmentOption", _ShipmentOption, value) End Set End Property Property QualityOption() As QualityOption Get Return _QualityOption End Get Set(ByVal value As QualityOption) SetPropertyValue("QualityOption", _QualityOption, value) End Set End Property _ Property VAT As VAT Get Return _VAT End Get Set(ByVal value As VAT) SetPropertyValue("VAT", _VAT, value) End Set End Property _ Property InvoiceRows As InvoiceRows Get Return _InvoiceRows End Get Set(ByVal value As InvoiceRows) SetPropertyValue("InvoiceRows", _InvoiceRows, value) End Set End Property _ Property InvoiceRowsAdvance As InvoiceRows Get Return _InvoiceRowsAdvance End Get Set(ByVal value As InvoiceRows) SetPropertyValue("InvoiceRowsAdvance", _InvoiceRowsAdvance, value) End Set End Property _ Property ContractRowsType As eContractRowsType Get Return _ContractRowsType End Get Set(ByVal value As eContractRowsType) SetPropertyValue("ContractRowsType", _ContractRowsType, value) End Set End Property Property InvoicePeriod As String Get Return _InvoicePeriod End Get Set(value As String) SetPropertyValue("InvoicePeriod", _InvoicePeriod, value) End Set End Property _ Property ImmovablesCostRecordEvents As ImmovablesCostRecordEvents Get Return _ImmovablesCostRecordEvents End Get Set(value As ImmovablesCostRecordEvents) SetPropertyValue("ImmovablesCostRecordEvents", _ImmovablesCostRecordEvents, value) End Set End Property 'Rule5DMatrix ! --------------------------------- _ Property Controlling() As Controlling Get Return _Controlling End Get Set(ByVal value As Controlling) SetPropertyValue("Controlling", _Controlling, value) If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving And Me.RegistryRowsFinancialControlling IsNot Nothing Then If Me.RegistryRowsFinancialControlling.Controlling IsNot value Then _RegistryRowsFinancialControlling.Controlling = value _RegistryRowsFinancialControlling.Save() End If End If End Set End Property _ Property CostHolder As CostHolder Get Return _CostHolder End Get Set(ByVal value As CostHolder) SetPropertyValue("CostHolder", _CostHolder, value) If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving And Me.RegistryRowsFinancialControlling IsNot Nothing Then If Me.RegistryRowsFinancialControlling.CostHolder IsNot value Then Me.RegistryRowsFinancialControlling.CostHolder = value Me.RegistryRowsFinancialControlling.Save() End If End If End Set End Property _ Property CostPlace As CostPlace Get Return _CostPlace End Get Set(ByVal value As CostPlace) SetPropertyValue("CostPlace", _CostPlace, value) End Set End Property _ Property JobNumberObjects As JobNumberObjects Get Return _JobNumberObjects End Get Set(ByVal value As JobNumberObjects) SetPropertyValue("JobNumberObjects", _JobNumberObjects, value) If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving And Me.RegistryRowsFinancialControlling IsNot Nothing Then If Me.RegistryRowsFinancialControlling.JobNumberObjects IsNot value Then Me.RegistryRowsFinancialControlling.JobNumberObjects = value Me.RegistryRowsFinancialControlling.Save() End If End If End Set End Property _ Property UniqueObjects As UniqueObjects Get Return _UniqueObjects End Get Set(ByVal value As UniqueObjects) SetPropertyValue("UniqueObjects", _UniqueObjects, value) If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving And Me.RegistryRowsFinancialControlling IsNot Nothing Then If Me.RegistryRowsFinancialControlling.UniqueObjects IsNot value Then _RegistryRowsFinancialControlling.UniqueObjects = value _RegistryRowsFinancialControlling.Save() End If End If End Set End Property _ Property RegistryRowsFinancialControlling As RegistryRowsFinancialControlling Get Return _RegistryRowsFinancialControlling End Get Set(ByVal value As RegistryRowsFinancialControlling) SetPropertyValue("RegistryRowsFinancialControlling", _RegistryRowsFinancialControlling, value) End Set End Property Property RowGroup1 As String Get Return _RowGroup1 End Get Set(ByVal value As String) SetPropertyValue("RowGroup1", _RowGroup1, value) End Set End Property Property RowGroup2 As String Get Return _RowGroup2 End Get Set(ByVal value As String) SetPropertyValue("RowGroup2", _RowGroup2, value) End Set End Property Property CustomsTariffs As CustomsTariffs Get Return _CustomsTariffs End Get Set(value As CustomsTariffs) SetPropertyValue("CustomsTariffs", _CustomsTariffs, value) End Set End Property _ Property CertificateofContractRows As CertificateofContractRows Get Return _CertificateofContractRows End Get Set(value As CertificateofContractRows) SetPropertyValue("CertificateofContractRows", _CertificateofContractRows, value) End Set End Property 'Readonly ReadOnly Property DisplayName() As String Get If Me.Contracts Is Nothing Then Return ShortName & ", " & DateExecution ElseIf Me.Contracts.Customers Is Nothing Then Return Contracts.DocumentNumber & ", " & ShortName & ", " & DateExecution Else Return Contracts.DocumentNumber & ", " & ShortName & ", " & DateExecution & ", " & Contracts.Customers.FullName End If End Get End Property ReadOnly Property eContractRowsCOCState As eContractRowsCOCState Get If Me.CertificateofContractRows IsNot Nothing Then Return [Module].eContractRowsCOCState.eCertificated Else Return [Module].eContractRowsCOCState.eNotCertificated End If End Get End Property ReadOnly Property eContractRowsInvoiceState As eContractRowsInvoiceState Get If Me.InvoiceRows IsNot Nothing Or Me.InvoiceRowsAdvance IsNot Nothing Then Return [Module].eContractRowsInvoiceState.eInvoiced Else Return [Module].eContractRowsInvoiceState.eNotInvoiced End If End Get End Property ReadOnly Property eContractRowsRRFCState As eContractRowsRRFCState Get If Me.RegistryRowsFinancialControlling IsNot Nothing Then Return [Module].eContractRowsRRFCState.eControlled Else Return [Module].eContractRowsRRFCState.eNotControlled End If End Get End Property _ Property Apartments As Apartments Get Return _Apartments End Get Set(value As Apartments) SetPropertyValue("Apartments", _Apartments, value) End Set End Property _ Property Garages As Garages Get Return _Garages End Get Set(value As Garages) SetPropertyValue("Garages", _Garages, value) End Set End Property _ Property Container As Container Get Return _Container End Get Set(value As Container) SetPropertyValue("Container", _Container, value) End Set End Property _ Property Offices As Offices Get Return _Offices End Get Set(value As Offices) SetPropertyValue("Offices", _Offices, value) End Set End Property _ Property XLSGuid As String Get Return _XLSGuid End Get Set(value As String) SetPropertyValue("XLSGuid", _XLSGuid, value) End Set End Property End Class