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 System.Data.SqlClient
Imports DevExpress.ExpressApp.ConditionalAppearance

Imports System.Linq
Imports System.Linq.Expressions

<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class InvoiceVATRows
    Inherits BaseObject
    Private _InvoiceHeader As InvoiceHeader
    Private _VAT As VAT
    Private _DateVAT As Date 'ÁFA bevallás dátuma !!
    Private _AmountNettoHUF As Double
    Private _AmountVATHUF As Double
    Private _AmountBruttoHUF As Double
    Private _AmountNettoDEV As Double
    Private _AmountVATDEV As Double
    Private _AmountBruttoDEV As Double
    Private _ReadyforBookEntryRows As Boolean = True 'Könyvelhető-e a sor. Ha nem, akkor feladás előtti ellenőrzés nem engedi át
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Protected Overrides Sub OnSaving()
        MyBase.OnSaving()
        If Me.InvoiceHeader IsNot Nothing And (DateVAT = Date.MinValue) Then
            DateVAT = InvoiceHeader.DateExecution
        End If
    End Sub
    <Association("InvoiceHeader-InvoiceVATRows", GetType(InvoiceHeader))> _
    Property InvoiceHeader As InvoiceHeader
        Get
            Return _InvoiceHeader
        End Get
        Set(ByVal value As InvoiceHeader)
            SetPropertyValue("InvoiceHeader", _InvoiceHeader, 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 DateVAT As Date
        Get
            Return _DateVAT
        End Get
        Set(value As Date)
            SetPropertyValue("DateVAT", _DateVAT, value)
        End Set
    End Property
    Property AmountNettoHUF As Double
        Get
            Return _AmountNettoHUF
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AmountNettoHUF", _AmountNettoHUF, value)
        End Set
    End Property
    Property AmountVATHUF As Double
        Get
            Return _AmountVATHUF
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AmountVATHUF", _AmountVATHUF, value)
        End Set
    End Property
    Property AmountBruttoHUF As Double
        Get
            Return _AmountBruttoHUF
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AmountBruttoHUF", _AmountBruttoHUF, value)
        End Set
    End Property
    Property AmountNettoDEV As Double
        Get
            Return _AmountNettoDEV
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AmountNettoDEV", _AmountNettoDEV, value)
        End Set
    End Property
    Property AmountVATDEV As Double
        Get
            Return _AmountVATDEV
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AmountVATDEV", _AmountVATDEV, value)
        End Set
    End Property
    Property AmountBruttoDEV As Double
        Get
            Return _AmountBruttoDEV
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AmountBruttoDEV", _AmountBruttoDEV, value)
        End Set
    End Property
    Property ReadyforBookEntryRows As Boolean
        Get
            Return _ReadyforBookEntryRows
        End Get
        Set(value As Boolean)
            SetPropertyValue("ReadyforBookEntryRows", _ReadyforBookEntryRows, value)
        End Set
    End Property

End Class

