First create solution
This commit is contained in:
+104
@@ -0,0 +1,104 @@
|
||||
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
|
||||
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem(False)> _
|
||||
<CreatableItem(False)> _
|
||||
<Appearance("IntrastatHeader - Disable DocumentNumber", AppearanceItemType.ViewItem, "1=1", TargetItems:="DocumentNumber", Enabled:=False)> _
|
||||
<Appearance("IntrastatHeader - Disable ObjectCreated", AppearanceItemType.ViewItem, "1=1", TargetItems:="ObjectCreated", Enabled:=False)> _
|
||||
<Appearance("IntrastatHeader - Disable UserCreate", AppearanceItemType.ViewItem, "1=1", TargetItems:="UserCreate", Enabled:=False)> _
|
||||
Public Class IntrastatHeader
|
||||
Inherits BaseObject
|
||||
|
||||
Private _IntrastatParameters As IntrastatParameters
|
||||
Private _UserCreated As User
|
||||
Private _ObjectCreated As Date
|
||||
Private _DateExecution As Date 'Idõszak Év, hónap
|
||||
Private _DocumentNumber As String
|
||||
Private _DocumentFile As FileData
|
||||
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
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
|
||||
If String.IsNullOrEmpty(DocumentNumber) Then DocumentNumber = IntrastatParameters.NumberGenerator.GetNewNumber(IntrastatParameters.NumberGenerator)
|
||||
End Sub
|
||||
|
||||
<RuleRequiredField("IntrastatHeader - IntrastatParameters", DefaultContexts.Save)> _
|
||||
Property IntrastatParameters As IntrastatParameters
|
||||
Get
|
||||
Return _IntrastatParameters
|
||||
End Get
|
||||
Set(value As IntrastatParameters)
|
||||
SetPropertyValue("IntrastatParameters", _IntrastatParameters, 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
|
||||
<NonCloneable> _
|
||||
Property ObjectCreated As Date
|
||||
Get
|
||||
Return _ObjectCreated
|
||||
End Get
|
||||
Set(value As Date)
|
||||
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
|
||||
End Set
|
||||
End Property
|
||||
Property DateExecution As Date
|
||||
Get
|
||||
Return _DateExecution
|
||||
End Get
|
||||
Set(value As Date)
|
||||
SetPropertyValue("DateExecution", _DateExecution, value)
|
||||
End Set
|
||||
End Property
|
||||
Property DocumentNumber As String
|
||||
Get
|
||||
Return _DocumentNumber
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("DocumentNumber", _DocumentNumber, value)
|
||||
End Set
|
||||
End Property
|
||||
Property DocumentFile As FileData
|
||||
Get
|
||||
Return _DocumentFile
|
||||
End Get
|
||||
Set(value As FileData)
|
||||
SetPropertyValue("DocumentFile", _DocumentFile, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'-------ReadONLY-------
|
||||
<Association("IntrastatHeader - IntrastatRows", GetType(IntrastatRows)), VisibleInListView(False)> _
|
||||
ReadOnly Property IntrastatRows As XPCollection(Of IntrastatRows)
|
||||
Get
|
||||
Return GetCollection(Of IntrastatRows)("IntrastatRows")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
End Class
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
Partial Class IntrastatHeader_VC
|
||||
|
||||
<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.aIntrastatHeader_GenerateIntrastatRows = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aIntrastatCheckPrice = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aIntrastatCheckWeight = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aPrintIntrastat = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
'
|
||||
'aIntrastatHeader_GenerateIntrastatRows
|
||||
'
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.Caption = "aIntrastatHeader_GenerateIntrastatRows"
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.Category = "RecordEdit"
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.ConfirmationMessage = "Are you sure ? All data will lost !"
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.Id = "aIntrastatHeader_GenerateIntrastatRows"
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.ImageName = Nothing
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.Shortcut = Nothing
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.Tag = Nothing
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.TargetObjectsCriteria = Nothing
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.TargetObjectType = GetType(Nuvolar.[Module].IntrastatHeader)
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.TargetViewId = Nothing
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.ToolTip = Nothing
|
||||
Me.aIntrastatHeader_GenerateIntrastatRows.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aIntrastatCheckPrice
|
||||
'
|
||||
Me.aIntrastatCheckPrice.Caption = "aIntrastat Check Price"
|
||||
Me.aIntrastatCheckPrice.ConfirmationMessage = Nothing
|
||||
Me.aIntrastatCheckPrice.Id = "aIntrastatCheckPrice"
|
||||
Me.aIntrastatCheckPrice.ImageName = Nothing
|
||||
Me.aIntrastatCheckPrice.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireMultipleObjects
|
||||
Me.aIntrastatCheckPrice.Shortcut = Nothing
|
||||
Me.aIntrastatCheckPrice.Tag = Nothing
|
||||
Me.aIntrastatCheckPrice.TargetObjectsCriteria = Nothing
|
||||
Me.aIntrastatCheckPrice.TargetObjectType = GetType(Nuvolar.[Module].DeliveryNoteInRows)
|
||||
Me.aIntrastatCheckPrice.TargetViewId = "DeliveryNoteInRows_ListView_INTRASTAT"
|
||||
Me.aIntrastatCheckPrice.ToolTip = Nothing
|
||||
Me.aIntrastatCheckPrice.TypeOfView = Nothing
|
||||
'
|
||||
'aIntrastatCheckWeight
|
||||
'
|
||||
Me.aIntrastatCheckWeight.Caption = "aIntrastat Check Weight"
|
||||
Me.aIntrastatCheckWeight.ConfirmationMessage = Nothing
|
||||
Me.aIntrastatCheckWeight.Id = "aIntrastatCheckWeight"
|
||||
Me.aIntrastatCheckWeight.ImageName = Nothing
|
||||
Me.aIntrastatCheckWeight.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireMultipleObjects
|
||||
Me.aIntrastatCheckWeight.Shortcut = Nothing
|
||||
Me.aIntrastatCheckWeight.Tag = Nothing
|
||||
Me.aIntrastatCheckWeight.TargetObjectsCriteria = Nothing
|
||||
Me.aIntrastatCheckWeight.TargetObjectType = GetType(Nuvolar.[Module].DeliveryNoteInRows)
|
||||
Me.aIntrastatCheckWeight.TargetViewId = Nothing
|
||||
Me.aIntrastatCheckWeight.ToolTip = Nothing
|
||||
Me.aIntrastatCheckWeight.TypeOfView = Nothing
|
||||
'
|
||||
'aPrintIntrastat
|
||||
'
|
||||
Me.aPrintIntrastat.Caption = "aPrint Intrastat"
|
||||
Me.aPrintIntrastat.ConfirmationMessage = Nothing
|
||||
Me.aPrintIntrastat.Id = "aPrintIntrastat"
|
||||
Me.aPrintIntrastat.ImageName = "Action_Printing_Print"
|
||||
Me.aPrintIntrastat.Shortcut = Nothing
|
||||
Me.aPrintIntrastat.Tag = Nothing
|
||||
Me.aPrintIntrastat.TargetObjectsCriteria = Nothing
|
||||
Me.aPrintIntrastat.TargetObjectType = GetType(Nuvolar.[Module].IntrastatHeader)
|
||||
Me.aPrintIntrastat.TargetViewId = Nothing
|
||||
Me.aPrintIntrastat.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aPrintIntrastat.ToolTip = Nothing
|
||||
Me.aPrintIntrastat.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aIntrastatHeader_GenerateIntrastatRows As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aIntrastatCheckPrice As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aIntrastatCheckWeight As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aPrintIntrastat As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
|
||||
End Class
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
<?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="aIntrastatHeader_GenerateIntrastatRows.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aIntrastatCheckPrice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 56</value>
|
||||
</metadata>
|
||||
<metadata name="aIntrastatCheckWeight.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>288, 56</value>
|
||||
</metadata>
|
||||
<metadata name="aPrintIntrastat.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>288, 95</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
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 System.Linq
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.ExpressApp.SystemModule
|
||||
Imports DevExpress.ExpressApp.Utils
|
||||
|
||||
Public Class IntrastatHeader_VC
|
||||
Inherits DevExpress.ExpressApp.ViewController
|
||||
Public Event InitWork(ByVal _Minimum As Long, ByVal _Step As Long, ByVal _Maximum As Long)
|
||||
Public Event DoWork()
|
||||
Public Event FinalWork
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
End Sub
|
||||
|
||||
Private Sub aIntrastatHeader_GenerateIntrastatRows_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aIntrastatHeader_GenerateIntrastatRows.Execute
|
||||
Try
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _IntrastatHeader As IntrastatHeader = TryCast(View.SelectedObjects(0), IntrastatHeader)
|
||||
Dim _IntrastatRows_DELCollection As New XPCollection(Of IntrastatRows)(_ocur.Session, DevExpress.Data.Filtering.CriteriaOperator.Parse("IntrastatHeader=?", _IntrastatHeader))
|
||||
|
||||
|
||||
'// Nullás súlyok terméktörzsbõl update
|
||||
|
||||
|
||||
|
||||
|
||||
_ocur.Delete(_IntrastatRows_DELCollection)
|
||||
_ocur.CommitChanges()
|
||||
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
|
||||
|
||||
Dim _DeliveryNoteInRows_XPQuery = New XPQuery(Of DeliveryNoteInRows)(_onew.Session)
|
||||
Dim query = From _DeliveryNoteInRows In _DeliveryNoteInRows_XPQuery _
|
||||
Where _DeliveryNoteInRows.DeliveryNoteInHeader.DateExecution.Year = _IntrastatHeader.DateExecution.Year And
|
||||
_DeliveryNoteInRows.DeliveryNoteInHeader.DateExecution.Month = _IntrastatHeader.DateExecution.Month
|
||||
Group _DeliveryNoteInRows By _DeliveryNoteInRows.DeliveryNoteInHeader.ShipmentOption,
|
||||
_DeliveryNoteInRows.Products.CustomsTariff,
|
||||
_DeliveryNoteInRows.DeliveryNoteInHeader.Customers.Address1.Country,
|
||||
_DeliveryNoteInRows.Products.CountryFrom,
|
||||
_DeliveryNoteInRows.ShipingCode,
|
||||
_DeliveryNoteInRows.ITransactionNumber,
|
||||
_DeliveryNoteInRows.DeliveryNoteInHeader.DateExecution Into g = Group _
|
||||
Select New With {Key .ShipmentOption = ShipmentOption, _
|
||||
Key .CustomTariffs = CustomsTariff, _
|
||||
Key .ITransactionNumber = ITransactionNumber, _
|
||||
Key .CountryFrom = CountryFrom, _
|
||||
Key .ShipingCode = ShipingCode, _
|
||||
Key .CountrySender = Country, _
|
||||
Key .DateExecution = DateExecution, _
|
||||
Key .AmountHUF_Sum = g.Sum(Function(inv) (inv.ListPriceHUF - inv.DiscountPriceHUF) * inv.QTT), _
|
||||
Key .Area_Sum = g.Sum(Function(inv) inv.Area), _
|
||||
Key .Weight_Sum = g.Sum(Function(inv) inv.Weight)}
|
||||
|
||||
|
||||
Dim _RowIndex As Long = 1
|
||||
RaiseEvent InitWork(1, 1, query.Count)
|
||||
For Each item In query
|
||||
RaiseEvent DoWork()
|
||||
If GLOBAL_EUMemberStates.Contains(item.CountrySender.GetMemberValue("ShortName")) Then
|
||||
Dim _IntrastatRows As New IntrastatRows(_onew.Session)
|
||||
With _IntrastatRows
|
||||
.IntrastatHeader = _onew.GetObject(_IntrastatHeader)
|
||||
.RowIndex = _RowIndex
|
||||
.ITransactionNumber = item.ITransactionNumber
|
||||
.ShipmentOption = item.ShipmentOption
|
||||
.CustomsTariffs = item.CustomTariffs
|
||||
.CountrySender = item.CountrySender
|
||||
.ShipingCode = item.ShipingCode
|
||||
.CountryFrom = item.CountryFrom
|
||||
.AmountHUF = item.AmountHUF_Sum
|
||||
.Area = item.Area_Sum
|
||||
.Weight = item.Weight_Sum
|
||||
End With
|
||||
_RowIndex += 1
|
||||
End If
|
||||
Next
|
||||
|
||||
_onew.CommitChanges()
|
||||
|
||||
If Frame.GetController(Of RefreshController).RefreshAction.Enabled Then
|
||||
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
Finally
|
||||
RaiseEvent FinalWork
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub aIntrastatCheckPrice_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aIntrastatCheckPrice.Execute
|
||||
'// számlaigazolásból árak ellenõrzése
|
||||
Dim _DeliveryNoteInRows As DeliveryNoteInRows
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
RaiseEvent InitWork(1, 1, View.SelectedObjects.Count)
|
||||
For Each _DeliveryNoteInRows In View.SelectedObjects
|
||||
RaiseEvent DoWork()
|
||||
If _DeliveryNoteInRows.DeliveryNoteInHeader.CurrencyName.ShortName <> "HUF" Then
|
||||
If _DeliveryNoteInRows.DeliveryNoteInRRFC.Count > 0 Then
|
||||
_DeliveryNoteInRows.ListPriceHUF = Math.Round(_DeliveryNoteInRows.ListPriceDEV * _DeliveryNoteInRows.DeliveryNoteInHeader.CurrencyRate, 0, MidpointRounding.AwayFromZero)
|
||||
If _DeliveryNoteInRows.Weight <= 0 Then
|
||||
_DeliveryNoteInRows.WeightMode = eWeightMode.eTotalWeightperQuantity
|
||||
If _DeliveryNoteInRows.Products.NettoWeight <> 0 Then
|
||||
_DeliveryNoteInRows.Weight = Math.Round(_DeliveryNoteInRows.QTT * _DeliveryNoteInRows.Products.NettoWeight, 4, 0)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
_ocur.CommitChanges()
|
||||
RaiseEvent FinalWork
|
||||
End Sub
|
||||
|
||||
Private Sub SimpleAction1_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aIntrastatCheckWeight.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _DeliveryNoteInRows As DeliveryNoteInRows
|
||||
|
||||
|
||||
RaiseEvent InitWork(1, 1, View.SelectedObjects.Count)
|
||||
For Each _DeliveryNoteInRows In View.SelectedObjects
|
||||
RaiseEvent DoWork()
|
||||
Dim _StorageInRows_Collection As New XPCollection(Of StorageInRows)(_ocur.Session,
|
||||
CriteriaOperator.Parse("DeliveryNoteInRows=?", _DeliveryNoteInRows))
|
||||
Dim _StorageInRows As StorageInRows
|
||||
|
||||
For Each _StorageInRows In _StorageInRows_Collection
|
||||
If _StorageInRows.DeliveryNoteInRows IsNot Nothing Then
|
||||
If _StorageInRows.DeliveryNoteInRows.Weight <> 0 Then
|
||||
If _StorageInRows.DeliveryNoteInRows.QTT <> 0 Then
|
||||
_StorageInRows.Weight = Math.Round((_StorageInRows.DeliveryNoteInRows.Weight / _StorageInRows.DeliveryNoteInRows.QTT) * _StorageInRows.QTT, 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If _StorageInRows.StorageInRowsFrom IsNot Nothing Then
|
||||
If _StorageInRows.StorageInRowsFrom.DeliveryNoteInRows IsNot Nothing Then
|
||||
_StorageInRows.DeliveryNoteInRows = _StorageInRows.StorageInRowsFrom.DeliveryNoteInRows
|
||||
If _StorageInRows.StorageInRowsFrom.DeliveryNoteInRows.Weight <> 0 Then
|
||||
If _StorageInRows.StorageInRowsFrom.DeliveryNoteInRows.QTT <> 0 Then
|
||||
_StorageInRows.Weight = Math.Round((_StorageInRows.StorageInRowsFrom.DeliveryNoteInRows.Weight / _StorageInRows.StorageInRowsFrom.DeliveryNoteInRows.QTT) * _StorageInRows.QTT, 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim _StorageInRows_From_Collection As New XPCollection(Of StorageInRows)(_ocur.Session, CriteriaOperator.Parse("StorageInRowsFrom=?", _StorageInRows))
|
||||
Dim _StorageInRows_From As StorageInRows
|
||||
|
||||
For Each _StorageInRows_From In _StorageInRows_From_Collection
|
||||
_StorageInRows_From.DeliveryNoteInRows = _StorageInRows.DeliveryNoteInRows
|
||||
_StorageInRows_From.Weight = (_StorageInRows.Weight / _StorageInRows.QTT) * _StorageInRows_From.QTT
|
||||
Next
|
||||
_ocur.CommitChanges()
|
||||
Next
|
||||
Next
|
||||
RaiseEvent FinalWork
|
||||
End Sub
|
||||
|
||||
Private Sub aPrintIntrastat_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aPrintIntrastat.Execute
|
||||
Try
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _IntrastatHeader As IntrastatHeader = TryCast(View.SelectedObjects(0), IntrastatHeader)
|
||||
If _IntrastatHeader Is Nothing Then Throw New Exception("*Váratlan hiba történt, a folyamat megszakadt!")
|
||||
|
||||
Dim _ReportData As ReportData = _IntrastatHeader.IntrastatParameters.Report
|
||||
If _ReportData Is Nothing Then Throw New Exception("*Nincs beállítva nyomtatvány!" + vbNewLine + "A folyamat megszakadt!")
|
||||
|
||||
Frame.GetController(Of Reports.ReportServiceController).ShowPreview(_ReportData, CriteriaOperator.Parse("IntrastatHeader.Oid=?", _IntrastatHeader.Oid), True)
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
+58
@@ -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 IntrastatParameters
|
||||
Inherits BaseObject
|
||||
|
||||
Private _CustomersFrom As CustomersFrom
|
||||
Private _NumberGenerator As NumberGenerator
|
||||
Private _Report As ReportData
|
||||
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
End Sub
|
||||
|
||||
<RuleRequiredField("IntrastatParameters - CustomersFrom", DefaultContexts.Save)> _
|
||||
Property CustomersFrom As CustomersFrom
|
||||
Get
|
||||
Return _CustomersFrom
|
||||
End Get
|
||||
Set(value As CustomersFrom)
|
||||
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
|
||||
End Set
|
||||
End Property
|
||||
<RuleRequiredField("IntrastatParameters - NumberGenerator", DefaultContexts.Save)> _
|
||||
Property NumberGenerator As NumberGenerator
|
||||
Get
|
||||
Return _NumberGenerator
|
||||
End Get
|
||||
Set(value As NumberGenerator)
|
||||
SetPropertyValue("NumberGenerator", _NumberGenerator, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Report() As ReportData
|
||||
Get
|
||||
Return _Report
|
||||
End Get
|
||||
Set(value As ReportData)
|
||||
SetPropertyValue("Report", _Report, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
End Class
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
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 IntrastatRows
|
||||
Inherits BaseObject
|
||||
|
||||
Private _IntrastatHeader As IntrastatHeader
|
||||
Private _RowIndex As Long
|
||||
Private _CustomsTariffs As CustomsTariffs
|
||||
Private _ITransactionNumber As String
|
||||
Private _ShipmentOption As ShipmentOption
|
||||
Private _ShipingCode As String
|
||||
Private _CountrySender As Country 'Szállítóllevél sorhoz tartozó ország
|
||||
Private _CountryFrom As Country 'Termékhez tartozó származási ország
|
||||
Private _Weight As Double
|
||||
Private _Area As Double
|
||||
Private _AmountHUF As Double 'SUMPrice HUF-os a szállítólevél sorból
|
||||
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
End Sub
|
||||
|
||||
<Association("IntrastatHeader - IntrastatRows", GetType(IntrastatHeader))> _
|
||||
Property IntrastatHeader As IntrastatHeader
|
||||
Get
|
||||
Return _IntrastatHeader
|
||||
End Get
|
||||
Set(value As IntrastatHeader)
|
||||
SetPropertyValue("IntrastatHeader", _IntrastatHeader, value)
|
||||
End Set
|
||||
End Property
|
||||
Property RowIndex As Long
|
||||
Get
|
||||
Return _RowIndex
|
||||
End Get
|
||||
Set(value As Long)
|
||||
SetPropertyValue("RowIndex", _RowIndex, 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 ITransactionNumber As String
|
||||
Get
|
||||
Return _ITransactionNumber
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("ITransactionNumber", _ITransactionNumber, value)
|
||||
End Set
|
||||
End Property
|
||||
Property ShipmentOption As ShipmentOption
|
||||
Get
|
||||
Return _ShipmentOption
|
||||
End Get
|
||||
Set(value As ShipmentOption)
|
||||
SetPropertyValue("ShipmentOption", _ShipmentOption, value)
|
||||
End Set
|
||||
End Property
|
||||
Property ShipingCode As String
|
||||
Get
|
||||
Return _ShipingCode
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("ShipingCode", _ShipingCode, value)
|
||||
End Set
|
||||
End Property
|
||||
Property CountrySender As Country
|
||||
Get
|
||||
Return _CountrySender
|
||||
End Get
|
||||
Set(value As Country)
|
||||
SetPropertyValue("CountrySender", _CountrySender, value)
|
||||
End Set
|
||||
End Property
|
||||
Property CountryFrom As Country
|
||||
Get
|
||||
Return _CountryFrom
|
||||
End Get
|
||||
Set(value As Country)
|
||||
SetPropertyValue("CountryFrom", _CountryFrom, value)
|
||||
End Set
|
||||
End Property
|
||||
Property Weight As Double
|
||||
Get
|
||||
Return _Weight
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("Weight", _Weight, value)
|
||||
End Set
|
||||
End Property
|
||||
Property Area As Double
|
||||
Get
|
||||
Return _Area
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("Area", _Area, value)
|
||||
End Set
|
||||
End Property
|
||||
Property AmountHUF As Double
|
||||
Get
|
||||
Return _AmountHUF
|
||||
End Get
|
||||
Set(value As Double)
|
||||
SetPropertyValue("AmountHUF", _AmountHUF, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
Reference in New Issue
Block a user