Files
Nuvolar/Nuvolar.Module/BusinessObjects/Business/StorageTransactions/Inventory/InventorySIR.vb
T
2017-03-08 11:21:27 +01:00

142 lines
5.2 KiB
VB.net

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 InventorySIR
Inherits BaseObject
Private _InventoryHeader As InventoryHeader
Private _StorageInRows As StorageInRows
Private _QTT As Double
Private _QTT_Found As Double
Private _QTT_Different As Double
Private _AveragePriceHUF As Double 'Mérlegelt átlagár adott záró dátumra vonatkozólag
Private _SumAveragePriceHUF_Found As Double 'Talált átlagár
Private _SumAveragePriceHUF As Double
Private _SumAveragePriceHUF_Different As Double
Private _SumAveragePriceHUF_Surplus As Double 'Többlet
Private _SumAveragePriceHUF_Want As Double 'Hiány
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
<Association("InventoryHeader-InventorySIR", GetType(InventoryHeader))> _
Property InventoryHeader As InventoryHeader
Get
Return _InventoryHeader
End Get
Set(value As InventoryHeader)
SetPropertyValue("InventoryHeader", _InventoryHeader, value)
End Set
End Property
Property StorageInRows As StorageInRows
Get
Return _StorageInRows
End Get
Set(value As StorageInRows)
SetPropertyValue("StorageInRows", _StorageInRows, value)
End Set
End Property
Property QTT As Double
Get
Return _QTT
End Get
Set(value As Double)
SetPropertyValue("QTT", _QTT, value)
End Set
End Property
Property QTT_Found As Double
Get
Return Math.Round(_QTT_Found, 4, MidpointRounding.AwayFromZero)
End Get
Set(value As Double)
SetPropertyValue("QTT_Found", _QTT_Found, Math.Round(value, 4, MidpointRounding.AwayFromZero))
If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving Then
QTT_Different = Math.Round(value - QTT, 4, MidpointRounding.AwayFromZero)
SumAveragePriceHUF_Found = AveragePriceHUF * value
SumAveragePriceHUF_Different = SumAveragePriceHUF_Found - SumAveragePriceHUF
If SumAveragePriceHUF_Different > 0 Then
SumAveragePriceHUF_Surplus = SumAveragePriceHUF_Different
Else
SumAveragePriceHUF_Want = Math.Abs(SumAveragePriceHUF_Different)
End If
End If
End Set
End Property
Property QTT_Different As Double
Get
Return Math.Round(_QTT_Different, 4, MidpointRounding.AwayFromZero)
End Get
Set(value As Double)
SetPropertyValue("QTT_Different", _QTT_Different, Math.Round(value, 4, MidpointRounding.AwayFromZero))
End Set
End Property
Property AveragePriceHUF As Double
Get
Return _AveragePriceHUF
End Get
Set(value As Double)
SetPropertyValue("AveragePriceHUF", _AveragePriceHUF, value)
If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
SumAveragePriceHUF_Found = Math.Round(AveragePriceHUF * QTT_Found, 0, MidpointRounding.AwayFromZero)
SumAveragePriceHUF = Math.Round(AveragePriceHUF * QTT, 0, MidpointRounding.AwayFromZero)
SumAveragePriceHUF_Different = Math.Round(AveragePriceHUF * QTT_Different, 0, MidpointRounding.AwayFromZero)
End If
End Set
End Property
Property SumAveragePriceHUF_Found As Double
Get
Return _SumAveragePriceHUF_Found
End Get
Set(value As Double)
SetPropertyValue("SumAveragePriceHUF_Found", _SumAveragePriceHUF_Found, value)
End Set
End Property
Property SumAveragePriceHUF As Double
Get
Return Math.Round(_SumAveragePriceHUF, 4, MidpointRounding.AwayFromZero)
End Get
Set(value As Double)
SetPropertyValue("SumAveragePriceHUF", _SumAveragePriceHUF, Math.Round(value, 4, MidpointRounding.AwayFromZero))
End Set
End Property
Property SumAveragePriceHUF_Different As Double
Get
Return Math.Round(_SumAveragePriceHUF_Different, 4, MidpointRounding.AwayFromZero)
End Get
Set(value As Double)
SetPropertyValue("SumAveragePriceHUF_Different", _SumAveragePriceHUF_Different, Math.Round(value, 4, MidpointRounding.AwayFromZero))
End Set
End Property
Property SumAveragePriceHUF_Surplus As Double
Get
Return _SumAveragePriceHUF_Surplus
End Get
Set(value As Double)
SetPropertyValue("SumAveragePriceHUF_Surplus", _SumAveragePriceHUF_Surplus, value)
End Set
End Property
Property SumAveragePriceHUF_Want As Double
Get
Return _SumAveragePriceHUF_Want
End Get
Set(value As Double)
SetPropertyValue("SumAveragePriceHUF_Want", _SumAveragePriceHUF_Want, value)
End Set
End Property
End Class