_
+ Friend ReadOnly Property Settings() As Global.GrupoSanchoToro.My.MySettings
+ Get
+ Return Global.GrupoSanchoToro.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/GestionGrupoSanchoToro/My Project/Settings.settings b/GestionGrupoSanchoToro/My Project/Settings.settings
new file mode 100644
index 0000000..392df0a
--- /dev/null
+++ b/GestionGrupoSanchoToro/My Project/Settings.settings
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/Properties/Licenses.licx b/GestionGrupoSanchoToro/Properties/Licenses.licx
new file mode 100644
index 0000000..dca2f78
--- /dev/null
+++ b/GestionGrupoSanchoToro/Properties/Licenses.licx
@@ -0,0 +1 @@
+DevExpress.Xpf.RichEdit.RichEditControl, DevExpress.Xpf.RichEdit.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
diff --git a/GestionGrupoSanchoToro/Publicacion/Publicar.cmd b/GestionGrupoSanchoToro/Publicacion/Publicar.cmd
new file mode 100644
index 0000000..8ee0a38
--- /dev/null
+++ b/GestionGrupoSanchoToro/Publicacion/Publicar.cmd
@@ -0,0 +1,5 @@
+"C:\Program Files\7-Zip\7z.exe" a -tzip -r "C:\m3soft\vs.net\GrupoSanchoToro\GrupoSanchoToro\Publicacion\GrupoSanchoToro.zip" "C:\m3soft\vs.net\GrupoSanchoToro\GrupoSanchoToro\bin\Debug\net8.0-windows7.0\*.*"
+"C:\Program Files (x86)\winscp\WinSCP.com" /ini=null /log=c:\tmp\ftp.log /script=C:\m3soft\vs.net\GrupoSanchoToro\GrupoSanchoToro\Publicacion\winscpftp.txt
+del "C:\m3soft\vs.net\GrupoSanchoToro\GrupoSanchoToro\Publicacion\GrupoSanchoToro.zip"
+del "C:\m3soft\vs.net\GrupoSanchoToro\GrupoSanchoToro\Publicacion\null"
+pause
diff --git a/GestionGrupoSanchoToro/Publicacion/changelog.htm b/GestionGrupoSanchoToro/Publicacion/changelog.htm
new file mode 100644
index 0000000..d9d2fae
--- /dev/null
+++ b/GestionGrupoSanchoToro/Publicacion/changelog.htm
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Cambios en las versiones:
+
+·
+12/12/2025 Modificaciones en la
+versión 1.0.0.31
+
+o
+Corrección
+problema multiempresa
+
+·
+18/111/2025 Modificaciones en la
+versión 1.0.0.30
+
+o
+Corrección
+problema multiempresa
+
+·
+08/10/2025 Modificaciones en la versión 1.0.0.29
+
+o
+Corrección
+problema multiempresa
+
+·
+07/10/2025 Modificaciones en la versión 1.0.0.28
+
+o
+Corrección
+problema duplicados
+
+·
+06/10/2025 Modificaciones en la versión 1.0.0.27
+
+o
+Corrección
+aplicación de Clientes/Proveedores
+
+·
+03/10/2025 Modificaciones en la versión 1.0.0.25
+
+o
+Se incluye la empresa Hermanos Murga
+
+·
+15/07/2025 Modificaciones en la versión 1.0.0.24
+
+o
+Se corrige problema al en facturas emitidas.
+
+·
+30/05/2025 Modificaciones en la versión 1.0.0.23
+
+o
+Se añade campo de Observaciones en Impresión a la
+pantalla de facturas emitidas.
+
+o
+Se corrige problema al imprimir.
+
+·
+04/04/2025 Modificaciones en la versión 1.0.0.22
+
+o
+Se corrige error de campo obligatorio producto en facturas
+de venta.
+
+·
+13/03/2025 Modificaciones en la versión 1.0.0.21
+
+o
+Se permite eliminar facturas recibidas.
+
+·
+12/03/2025 Modificaciones en la versión 1.0.0.20
+
+o
+Corrección aplicación de facturas Emitidas en redondeos
+
+·
+12/02/2025 Modificaciones en la versión 1.0.0.18
+
+o
+Corrección aplicación de IRPF en facturas Emitidas
+
+o
+Se adjunta en los correos para la asesoría la factura
+escaneada (tanto en recibidas como emitidas)
+
+·
+07/02/2025 Modificaciones en la versión 1.0.0.17
+
+o
+Se Añade campo en series de factura para indicar que el
+IRPF se calcula después de IVA
+
+o
+Se permite eliminar facturas de clientes si son del tipo
+“Emitidas por el Cliente”
+
+·
+24/01/2025 Modificaciones en la versión 1.0.0.16
+
+o
+Correcciones varias
+
+·
+07/01/2025 Modificaciones en la versión 1.0.0.15
+
+o
+Correcciones varias
+
+·
+14/11/2024 Modificaciones en la versión 1.0.0.14
+
+o
+Correcciones varias
+
+·
+12/11/2024 Modificaciones en la versión 1.0.0.13
+
+o
+Correcciones varias
+
+·
+11/11/2024 Modificaciones en la versión 1.0.0.12
+
+o
+Correcciones varias
+
+·
+04/12/2024 Modificaciones en la versión 1.0.0.11
+
+o
+Correcciones varias
+
+·
+02/12/2024 Modificaciones en la versión 1.0.0.10
+
+o
+Correcciones varias
+
+·
+29/11/2024 Modificaciones en la versión 1.0.0.9
+
+o
+Correcciones varias
+
+·
+27/11/2024 Modificaciones en la versión 1.0.0.8
+
+o
+Correcciones varias
+
+·
+25/11/2024 Modificaciones en la versión 1.0.0.7
+
+o
+Corrección en campos obligatorios en facturas recibidas
+
+o
+Corrección en aplicación de Conciliaciones Bancarias
+
+·
+21/11/2024 Modificaciones en la versión 1.0.0.6
+
+o
+Correcciones varias
+
+·
+21/11/2024 Modificaciones en la versión 1.0.0.6
+
+o
+Correcciones varias
+
+·
+17/11/2024 Modificaciones en la versión 1.0.0.5
+
+o
+Se añade Tipo de IVA Exento.
+
+·
+16/11/2024 Modificaciones en la versión 1.0.0.4
+1.
+Correcciones en fechas de facturas emitidas y recibidas.
+
+·
+11/11/2024 Modificaciones en la versión 1.0.0.3
+1.
+Correcciones en productos.
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/Publicacion/changelog_archivos/colorschememapping.xml b/GestionGrupoSanchoToro/Publicacion/changelog_archivos/colorschememapping.xml
new file mode 100644
index 0000000..6a0069c
--- /dev/null
+++ b/GestionGrupoSanchoToro/Publicacion/changelog_archivos/colorschememapping.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/Publicacion/changelog_archivos/filelist.xml b/GestionGrupoSanchoToro/Publicacion/changelog_archivos/filelist.xml
new file mode 100644
index 0000000..1be7d89
--- /dev/null
+++ b/GestionGrupoSanchoToro/Publicacion/changelog_archivos/filelist.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/Publicacion/changelog_archivos/themedata.thmx b/GestionGrupoSanchoToro/Publicacion/changelog_archivos/themedata.thmx
new file mode 100644
index 0000000..345edcf
Binary files /dev/null and b/GestionGrupoSanchoToro/Publicacion/changelog_archivos/themedata.thmx differ
diff --git a/GestionGrupoSanchoToro/Publicacion/m3Factu.xml b/GestionGrupoSanchoToro/Publicacion/m3Factu.xml
new file mode 100644
index 0000000..cae1422
--- /dev/null
+++ b/GestionGrupoSanchoToro/Publicacion/m3Factu.xml
@@ -0,0 +1,6 @@
+-
+1.0.0.31
+https://www.english-skills.net/GrupoSanchoToro/GrupoSanchoToro.zip
+https://www.english-skills.net/GrupoSanchoToro/changelog.htm
+true
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/Publicacion/winscpftp.txt b/GestionGrupoSanchoToro/Publicacion/winscpftp.txt
new file mode 100644
index 0000000..fbddfc1
--- /dev/null
+++ b/GestionGrupoSanchoToro/Publicacion/winscpftp.txt
@@ -0,0 +1,5 @@
+open ftp://manuel:tsl4net.Ts87@192.168.200.1:993/ -explicittls -certificate=*
+put C:\m3soft\vs.net\GrupoSanchoToro\GrupoSanchoToro\Publicacion\GrupoSanchoToro.zip /inetpub/wwwroot/GrupoSanchoToro/
+put C:\m3soft\vs.net\GrupoSanchoToro\GrupoSanchoToro\Publicacion\GrupoSanchoToro.xml /inetpub/wwwroot/GrupoSanchoToro/
+put C:\m3soft\vs.net\GrupoSanchoToro\GrupoSanchoToro\Publicacion\changelog.htm /inetpub/wwwroot/GrupoSanchoToro/
+exit
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/Resources/LogoTcsColor.png b/GestionGrupoSanchoToro/Resources/LogoTcsColor.png
new file mode 100644
index 0000000..a755104
Binary files /dev/null and b/GestionGrupoSanchoToro/Resources/LogoTcsColor.png differ
diff --git a/GestionGrupoSanchoToro/Resources/STSur.jpg b/GestionGrupoSanchoToro/Resources/STSur.jpg
new file mode 100644
index 0000000..6a174cf
Binary files /dev/null and b/GestionGrupoSanchoToro/Resources/STSur.jpg differ
diff --git a/GestionGrupoSanchoToro/Resources/stsur.ico b/GestionGrupoSanchoToro/Resources/stsur.ico
new file mode 100644
index 0000000..7f91425
Binary files /dev/null and b/GestionGrupoSanchoToro/Resources/stsur.ico differ
diff --git a/GestionGrupoSanchoToro/Resources/stsur_simple_icon_32x32.png b/GestionGrupoSanchoToro/Resources/stsur_simple_icon_32x32.png
new file mode 100644
index 0000000..6615853
Binary files /dev/null and b/GestionGrupoSanchoToro/Resources/stsur_simple_icon_32x32.png differ
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoCodigoPostal.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoCodigoPostal.xaml
new file mode 100644
index 0000000..cef8c39
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoCodigoPostal.xaml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoCodigoPostal.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoCodigoPostal.xaml.vb
new file mode 100644
index 0000000..8d12693
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoCodigoPostal.xaml.vb
@@ -0,0 +1,71 @@
+
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core.ServerMode
+Imports DevExpress.Mvvm
+Imports DevExpress.Xpf.Grid
+Imports tsWPFCore
+Imports tsEFCore8.Extensiones
+Imports DevExpress.Xpf.Core
+
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro
+
+Public Class dxwAgregarNuevoCodigoPostal
+
+ ' Private _alumno As alumnos
+ Friend _CodigoPostal As String
+ Private _bd As tscGrupoSanchoToro
+
+ Private Sub dxwAgregarNuevoCodigoPostal_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Me.teCodigoPostal.EditValue = _CodigoPostal
+ Dim sCodigoProvincia As String = _CodigoPostal.Substring(0, 2)
+ Me.teProvincia.EditValue = _bd.provincias.First(Function(x) x.CodigoProvincia = sCodigoProvincia).Nombre
+ Me.cbMunicipio.ItemsSource = _bd.municipios.Where(Function(x) x.CodigoProvincia = sCodigoProvincia).OrderBy(Function(x) x.Nombre).ToList
+ Me.cbMunicipio.Focus()
+ End Sub
+
+ Public Sub New(CodigoPostal As String, bd As tscGrupoSanchoToro)
+ _CodigoPostal = CodigoPostal
+ _bd = bd
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ Try
+ If cbMunicipio.EditValue Is Nothing Then
+ DXMessageBox.Show("El municipio es obligatorio")
+ Else
+ Dim _CodigoMunicipio As String = ""
+ If cbMunicipio.EditValue IsNot Nothing Then _CodigoMunicipio = cbMunicipio.EditValue
+ Dim sDescripcionAdicional As String = ""
+ If teDescripcionAdicional.EditValue IsNot Nothing Then sDescripcionAdicional = teDescripcionAdicional.EditValue
+ Dim ncp As New bdGrupoSanchoToro.db.codigospostales
+ With ncp
+ .CodigoMunicipio = _CodigoMunicipio
+ .CodigoPostal = _CodigoPostal
+ .DescripcionAdicional = sDescripcionAdicional
+ End With
+ _bd.codigospostales.Add(ncp)
+ _bd.GuardarCambios()
+ Me.DialogResult = True
+ Me.Close()
+ End If
+ Catch ex As Exception
+ Comun.GeneraRegistroCorreoExcepcion(Nothing, ex, "dxwAgregarNuevoCodigoPostal.btAceptar_Click")
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+End Class
+
+
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoMunicipio.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoMunicipio.xaml
new file mode 100644
index 0000000..67125f9
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoMunicipio.xaml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoMunicipio.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoMunicipio.xaml.vb
new file mode 100644
index 0000000..4ee7e80
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwAgregarNuevoMunicipio.xaml.vb
@@ -0,0 +1,82 @@
+
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core.ServerMode
+Imports DevExpress.Mvvm
+Imports DevExpress.Xpf.Grid
+Imports tsWPFCore
+Imports tsEFCore8.Extensiones
+Imports DevExpress.Xpf.Core
+Imports DevExpress.XtraReports.UI
+Imports System.IO
+Imports DevExpress.Xpf.Printing
+Imports Microsoft.Win32
+Imports System.Data.Objects
+Imports System.Data.Objects.DataClasses
+Imports DevExpress.Xpf.Editors
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports bdGrupoSanchoToro
+
+Public Class dxwAgregarNuevoMunicipio
+ ' Private _alumno As alumnos
+ Friend _CodigoPostal As String
+ Friend _CodigoMunicipio As String
+ Private bd As tscGrupoSanchoToro
+
+ Private Sub dxwAgregarNuevoCodigoPostal_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Me.teCodigoPostal.Focus()
+ End Sub
+
+ Public Sub New(CodigoPostal As String)
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+ bd = tscGrupoSanchoToro.NuevoContexto
+ _CodigoPostal = CodigoPostal
+ teCodigoPostal.EditValue = CodigoPostal
+ End Sub
+
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ Try
+ If teMunicipio.EditValue IsNot Nothing AndAlso teCodigoPostal.EditValue IsNot Nothing Then
+ _CodigoPostal = teCodigoPostal.EditValue
+ If _CodigoPostal.Length <> 5 Then Throw New Exception("El código postal es erróneo")
+ Dim codpro = _CodigoPostal.Substring(0, 2)
+ Dim provincia = bd.provincias.FirstOrDefault(Function(x) x.CodigoProvincia = codpro)
+ If provincia Is Nothing Then Throw New Exception("El código postal no pertenece a ninguna provincia")
+ Dim mun As String = teMunicipio.EditValue
+ If mun.NothingAVacio = "" Then Throw New Exception("El municipio es obligatorio")
+ _CodigoMunicipio = bdGrupoSanchoToro.db.municipios.ObtieneCodigoMunicipioMasCoincidente(bd, _CodigoPostal, mun)
+ Me.DialogResult = True
+ Me.Close()
+ Else
+ DXMessageBox.Show("El codigo postal y el municipio son obligatorios", "Atención")
+ End If
+ Catch ex As Exception
+ FuncionesDinamicas.ErrorNoControladoAp("dxwagregarnuevomunicipio_aceptar_click", ex)
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub teCodigoPostal_EditValueChanged(sender As Object, e As EditValueChangedEventArgs) Handles teCodigoPostal.EditValueChanged
+ Dim codpos As String = teCodigoPostal.EditValue
+ If codpos IsNot Nothing AndAlso codpos.Length = 5 Then
+ Dim codpro = codpos.Substring(0, 2)
+ Dim provincia = bd.provincias.FirstOrDefault(Function(x) x.CodigoProvincia = codpro)
+ If provincia IsNot Nothing Then
+ cbProvincia.EditValue = provincia.Nombre
+ Else
+ cbProvincia.EditValue = ""
+ End If
+ Else
+ cbProvincia.EditValue = ""
+ End If
+ End Sub
+End Class
+
+
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwArticulos.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwArticulos.xaml
new file mode 100644
index 0000000..3e2b440
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwArticulos.xaml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwArticulos.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwArticulos.xaml.vb
new file mode 100644
index 0000000..dcd4e89
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwArticulos.xaml.vb
@@ -0,0 +1,60 @@
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Core
+Imports bdGrupoSanchoToro.db.Utilidades
+
+Public Class dxwArticulos
+ Private _idProducto As Integer
+ Private _LArticulos As List(Of articulos)
+ Friend idArticulo As Integer
+
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ If gcArticulos.CurrentItem IsNot Nothing Then
+ Dim art = DirectCast(gcArticulos.CurrentItem, articulos)
+ idArticulo = art.idarticulo
+ Me.DialogResult = True
+ Me.Close()
+ End If
+ End Sub
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub dxwproductos_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Try
+
+ Me.gcArticulos.ItemsSource = _LArticulos.Where(Function(x) x.idProducto = _idProducto).OrderBy(Function(x) x.CodigoArticulo).ToList
+ Me.gcArticulos.View.SearchControl.Focus()
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ 'Public Sub New(bd As m3academiaEntities, Existentes As List(Of Integer?))
+ Public Sub New(lArticulos As List(Of articulos), idProducto As Integer)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
+
+ _LArticulos = lArticulos
+ _idProducto = idProducto
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Private Sub dxw_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
+ If e.Key = Key.Enter Then
+ btAceptar_Click(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub tv_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles tvArticulos.MouseDoubleClick
+ btAceptar_Click(Nothing, Nothing)
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwCodigosPostales.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwCodigosPostales.xaml
new file mode 100644
index 0000000..290a756
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwCodigosPostales.xaml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwCodigosPostales.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwCodigosPostales.xaml.vb
new file mode 100644
index 0000000..0d89c8a
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwCodigosPostales.xaml.vb
@@ -0,0 +1,69 @@
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Core
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro
+Imports System.Linq.Dynamic.Core
+Imports Microsoft.EntityFrameworkCore
+
+Public Class dxwCodigosPostales
+ Friend CodigoMunicipio As String
+ Friend CodigoPostal As String
+ Private _CodigoPostal As String
+ Friend _bd As tscGrupoSanchoToro
+
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ If gc.CurrentItem IsNot Nothing Then
+ Dim cp = DirectCast(gc.CurrentItem, codigospostales)
+ CodigoMunicipio = cp.CodigoMunicipio
+ CodigoPostal = cp.CodigoPostal
+ Me.DialogResult = True
+ Me.Close()
+ End If
+ End Sub
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub dxwCodigosPostales_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Try
+
+ If _CodigoPostal <> "" Then
+ Me.gc.ItemsSource = _bd.codigospostales.Include(Function(x) x.CodigoMunicipioNavigation.CodigoProvinciaNavigation).Where(Function(x) x.CodigoPostal = _CodigoPostal).OrderBy(Function(x) x.CodigoMunicipioNavigation.Nombre).ToList
+ Else
+ Me.gc.ItemsSource = _bd.codigospostales.Include(Function(x) x.CodigoMunicipioNavigation.CodigoProvinciaNavigation).OrderBy(Function(x) x.CodigoMunicipioNavigation.Nombre).ToList
+ End If
+ Me.gc.View.SearchControl.Focus()
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ 'Public Sub New(bd As m3academiaEntities, Existentes As List(Of Integer?))
+ Public Sub New(bd As tscGrupoSanchoToro, CodigoPostal As String)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
+ _CodigoPostal = CodigoPostal
+ _bd = bd
+ ' _existentes = Existentes
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Private Sub dxw_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
+ If e.Key = Key.Enter Then
+ btAceptar_Click(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub tv_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles tv.MouseDoubleClick
+ btAceptar_Click(Nothing, Nothing)
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwEntidades.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwEntidades.xaml
new file mode 100644
index 0000000..c718769
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwEntidades.xaml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwEntidades.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwEntidades.xaml.vb
new file mode 100644
index 0000000..c4f32d2
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwEntidades.xaml.vb
@@ -0,0 +1,70 @@
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Core
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro
+
+Public Class dxwEntidades
+ Friend Entidad As entidades
+ Friend _bd As tscGrupoSanchoToro
+ Private _EsCliente As Boolean
+ Private _EsProveedor As Boolean
+
+
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ If gc.CurrentItem IsNot Nothing Then
+ Dim ent = DirectCast(gc.CurrentItem, entidades)
+ Entidad = ent
+ Me.DialogResult = True
+ Me.Close()
+ End If
+ End Sub
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub dxwEntidades_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Try
+
+ Dim ients = _bd.entidades.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja Is Nothing).Include(Function(x) x.CodigoMunicipioNavigation.CodigoProvinciaNavigation).AsQueryable
+ ients = ients.Where(Function(x) (x.EsCliente AndAlso _EsCliente) OrElse (x.EsProveedor AndAlso _EsProveedor))
+ Me.gc.ItemsSource = ients.OrderBy(Function(x) x.RazonSocial).ToList
+ Me.gc.View.SearchControl.Focus()
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ 'Public Sub New(bd As m3academiaEntities, Existentes As List(Of Integer?))
+ Public Sub New(bd As tscGrupoSanchoToro, EsCliente As Boolean, EsProveedor As Boolean)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+
+ Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
+
+
+ _EsCliente = EsCliente
+ _EsProveedor = EsProveedor
+ _bd = bd
+ ' _existentes = Existentes
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Private Sub dxw_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
+ If e.Key = Key.Enter Then
+ btAceptar_Click(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub tv_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles tv.MouseDoubleClick
+ btAceptar_Click(Nothing, Nothing)
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwEnvioCorreo.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwEnvioCorreo.xaml
new file mode 100644
index 0000000..ade47a8
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwEnvioCorreo.xaml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwEnvioCorreo.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwEnvioCorreo.xaml.vb
new file mode 100644
index 0000000..28d3b04
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwEnvioCorreo.xaml.vb
@@ -0,0 +1,82 @@
+
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core.ServerMode
+Imports DevExpress.Mvvm
+Imports DevExpress.Xpf.Grid
+Imports tsWPFCore
+Imports tsEFCore8.Extensiones
+Imports DevExpress.Xpf.Core
+Imports DevExpress.XtraReports.UI
+Imports System.IO
+Imports DevExpress.Xpf.Printing
+Imports Microsoft.Win32
+Imports System.Data.Objects
+Imports System.Data.Objects.DataClasses
+Imports bdGrupoSanchoToro.db.Utilidades
+Public Class dxwEnvioCorreo
+
+
+ Friend _Destinatarios As String
+ Friend _CC As String
+ Friend _BCC As String
+ Friend _Asunto As String
+ Friend _Cuerpo As String
+ Friend _Adjunto As String
+
+
+ Private Sub dxw_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+
+ teDestinatario.Text = _Destinatarios
+ teCuerpo.Text = _Cuerpo
+ teAdjunto.Text = _Adjunto
+ teCopia.Text = _CC
+ teCopiaOculta.Text = _BCC
+ teAsunto.Text = _Asunto
+ teDestinatario.Focus()
+ End Sub
+
+ Public Sub New(Destinatarios As String, CC As String, BCC As String, Asunto As String, Cuerpo As String, Adjunto As String)
+ _Destinatarios = Destinatarios
+ _CC = CC
+ _BCC = BCC
+ _Asunto = Asunto
+ _Cuerpo = Cuerpo
+ _Adjunto = Adjunto
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ Try
+ If teDestinatario.Text.Trim.ToLower.EsEmailValido AndAlso teAsunto.Text.Trim <> "" Then
+ _Destinatarios = teDestinatario.Text.Trim.ToLower
+ _Cuerpo = teCuerpo.Text
+ _Adjunto = teAdjunto.Text
+ _CC = teCopia.Text
+ _BCC = teCopiaOculta.Text
+ _Asunto = teAsunto.Text
+
+ Me.DialogResult = True
+ Me.Close()
+ Else
+ DXMessageBox.Show("El asunto y el destinatario son campos obligatorios")
+ End If
+ Catch ex As Exception
+ Comun.GeneraRegistroCorreoExcepcion(Nothing, ex, "dxwAgregarNuevoCodigoPostal.btAceptar_Click")
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+End Class
+
+
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwIVA.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwIVA.xaml
new file mode 100644
index 0000000..147f922
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwIVA.xaml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwIdentificacion.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwIdentificacion.xaml
new file mode 100644
index 0000000..652f77a
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwIdentificacion.xaml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwIdentificacion.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwIdentificacion.xaml.vb
new file mode 100644
index 0000000..cbf2b59
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwIdentificacion.xaml.vb
@@ -0,0 +1,73 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.Core.Native
+Imports System.Reflection
+Imports bdGrupoSanchoToro.db
+
+Public Class dxwIdentificacion
+ Private _Empresas As List(Of db.empresas)
+ Private _Version As String
+ Public Cancelar As Boolean
+
+ Public Sub New(Empresas As List(Of bdGrupoSanchoToro.db.empresas), Version As String)
+ _Version = Version
+ _Empresas = Empresas
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+ If Empresas.Count > 1 Then
+ Me.Height = 290
+ liEmpresa.Visibility = Visibility.Visible
+ Else
+ Me.Height = 230
+ End If
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+ Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
+ Cancelar = False
+ Me.Close()
+ End Sub
+
+ Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
+ Cancelar = True
+ Me.Close()
+ End Sub
+
+ Private Sub Window_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles gc.PreviewKeyDown
+ If e.Key = Key.Return Then
+ If teUsuario.Text <> "" And Me.pbeContrasenna.Text <> "" Then
+ Cancelar = False
+ Me.Close()
+ Else
+ Dim te As BaseEdit = LayoutHelper.FindParentObject(Of BaseEdit)(Keyboard.FocusedElement)
+ If te Is Nothing Then
+ FocusManager.SetFocusedElement(Me, teUsuario)
+ Else
+ If te.Name.ToUpper = "TEUSUARIO" Then
+ FocusManager.SetFocusedElement(Me, pbeContrasenna)
+ Else
+ FocusManager.SetFocusedElement(Me, teUsuario)
+ End If
+ End If
+ End If
+ End If
+ End Sub
+
+ Private Sub dxwIdentificacion_Activated(sender As Object, e As EventArgs) Handles Me.Activated
+ ' Application.Current.Dispatcher.BeginInvoke(New Action(Function() Me.Focus()), System.Windows.Threading.DispatcherPriority.Send)
+ ' Application.Current.Dispatcher.BeginInvoke(New Action(Function() teUsuario.Focus()), System.Windows.Threading.DispatcherPriority.Send)
+ End Sub
+
+ Private Sub dxwIdentificacion_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
+ 'FocusManager.SetFocusedElement(Me, teUsuario)
+ cbEmpresa.ItemsSource = _Empresas
+ cbEmpresa.EditValue = _Empresas.First.idEmpresa
+ teUsuario.Focus()
+ ' Application.Current.Dispatcher.BeginInvoke(New Action(Function() Me.Focus()), System.Windows.Threading.DispatcherPriority.Send)
+ ' Application.Current.Dispatcher.BeginInvoke(New Action(Function() teUsuario.Focus()), System.Windows.Threading.DispatcherPriority.Send)
+ Cancelar = True
+ lVersion.Content = "Versión: " & _Version
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwIva.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwIva.xaml.vb
new file mode 100644
index 0000000..b01fc4a
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwIva.xaml.vb
@@ -0,0 +1,61 @@
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Core
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro
+
+Public Class dxwIVA
+ Friend IVA As Double
+
+ Private _bd As tscGrupoSanchoToro
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ If gciva.CurrentItem IsNot Nothing Then
+ Dim eniva = DirectCast(gciva.CurrentItem, enumeraciones)
+ IVA = eniva.ValorNumerico1
+ Me.DialogResult = True
+ Me.Close()
+ End If
+ End Sub
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub dxwproductos_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Try
+ Me.gciva.ItemsSource = _bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "PIVA").OrderByDescending(Function(X) X.ValorNumerico1).ToList
+ Me.gciva.View.Focus()
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ 'Public Sub New(bd As m3academiaEntities, Existentes As List(Of Integer?))
+ Public Sub New(bd As tscGrupoSanchoToro)
+
+ _bd = bd
+ IVA = _bd.enumeraciones.First(Function(x) x.Codigo = "PIVA.DEFECTO").ValorNumerico1
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
+
+
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Private Sub dxw_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
+ If e.Key = Key.Enter Then
+ btAceptar_Click(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub tv_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles tviva.MouseDoubleClick
+ btAceptar_Click(Nothing, Nothing)
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwPoblaciones.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwPoblaciones.xaml
new file mode 100644
index 0000000..05cbe53
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwPoblaciones.xaml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwPoblaciones.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwPoblaciones.xaml.vb
new file mode 100644
index 0000000..2f7bb16
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwPoblaciones.xaml.vb
@@ -0,0 +1,63 @@
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Core
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro
+Imports Microsoft.EntityFrameworkCore
+
+Public Class dxwPoblaciones
+ Friend CodigoMunicipio As String
+ ' Friend CodigoPostal As String
+ ' Private _CodigoPostal As String
+ Friend _bd As tscGrupoSanchoToro
+
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ If gc.CurrentItem IsNot Nothing Then
+ CodigoMunicipio = DirectCast(gc.CurrentItem, municipios).CodigoMunicipio
+ Me.DialogResult = True
+ Me.Close()
+ End If
+ End Sub
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub dxwPoblaciones_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Try
+
+ Me.gc.ItemsSource = _bd.municipios.Include(Function(x) x.CodigoProvinciaNavigation).OrderBy(Function(x) x.Nombre).ToList
+ Me.gc.View.SearchControl.Focus()
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ 'Public Sub New(bd As m3academiaEntities, Existentes As List(Of Integer?))
+ Public Sub New(bd As tscGrupoSanchoToro)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
+
+ _bd = bd
+ ' _existentes = Existentes
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Private Sub dxw_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
+ If e.Key = Key.Enter Then
+ btAceptar_Click(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub tv_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles tv.MouseDoubleClick
+ btAceptar_Click(Nothing, Nothing)
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwProductos.xaml b/GestionGrupoSanchoToro/VentanasEmergentes/dxwProductos.xaml
new file mode 100644
index 0000000..1a05350
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwProductos.xaml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/VentanasEmergentes/dxwProductos.xaml.vb b/GestionGrupoSanchoToro/VentanasEmergentes/dxwProductos.xaml.vb
new file mode 100644
index 0000000..a86bd13
--- /dev/null
+++ b/GestionGrupoSanchoToro/VentanasEmergentes/dxwProductos.xaml.vb
@@ -0,0 +1,64 @@
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Core
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro
+
+Public Class dxwProductos
+ Friend idProducto As Integer
+ Friend _bd As tscGrupoSanchoToro
+ Private _Lproductos As List(Of productos)
+
+ Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
+ If gc.CurrentItem IsNot Nothing Then
+ Dim pro = DirectCast(gc.CurrentItem, productos)
+ idProducto = pro.idProducto
+ Me.DialogResult = True
+ Me.Close()
+ End If
+ End Sub
+
+ Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
+ Me.DialogResult = False
+ Me.Close()
+ End Sub
+
+ Private Sub dxwproductos_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Try
+
+ Me.gc.ItemsSource = _Lproductos.ToList
+ Me.gc.View.SearchControl.Focus()
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ 'Public Sub New(bd As m3academiaEntities, Existentes As List(Of Integer?))
+ Public Sub New(lProductos As List(Of productos), Optional OcultarStock As Boolean = False)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ If OcultarStock Then
+ gcStock.Visible = False
+ gcUnidadesAlquiladas.Visible = False
+ End If
+ Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
+
+ _Lproductos = lProductos
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Private Sub dxw_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
+ If e.Key = Key.Enter Then
+ btAceptar_Click(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub tv_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles tvProductos.MouseDoubleClick
+ btAceptar_Click(Nothing, Nothing)
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml b/GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml
new file mode 100644
index 0000000..ec3ef36
--- /dev/null
+++ b/GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml
@@ -0,0 +1,879 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml.vb b/GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml.vb
new file mode 100644
index 0000000..3cade7a
--- /dev/null
+++ b/GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml.vb
@@ -0,0 +1,839 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports tsUtilidades.Enumeraciones
+Imports tsUtilidades
+Imports bdGrupoSanchoToro.db.productos
+Imports System.Windows.Threading
+Imports System.IO
+Imports Microsoft.Win32
+
+'TODO: Comprobar cuando se puede modificar una factura (o eliminar)
+Public Class ucFacturaEmitida
+ Private bd As tscGrupoSanchoToro
+ Friend _idFactura As Nullable(Of Integer)
+ Private lProductos As List(Of productos)
+ Private ivas As List(Of enumeraciones)
+ Friend idLog As Integer?
+ Dim ra As facturas
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucFacturasEmitidas)
+ End Sub
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Try
+ lProductos = bd.productos.OrderBy(Function(x) x.Descripcion).ToList
+ Dim lProductosFra = ra.detallesfacturas.Select(Function(x) x.idProducto).ToArray
+ lProductos = lProductos.Where(Function(x) x.FechaBaja Is Nothing OrElse lProductosFra.Contains(x.idProducto)).ToList
+ cbProducto.ItemsSource = lProductos
+ Dim cjs = bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja.HasValue = False).OrderBy(Function(x) x.Descripcion).ToList
+ Dim lCajas = cjs
+ Dim ids = ra.movimientoscaja.Select(Function(x) x.idCaja).ToList
+ Me.cbCaja.ItemsSource = lCajas.Where(Function(x) x.FechaBaja.HasValue = False OrElse ids.Contains(x.idCaja)).ToList
+ cbTipoDocumento.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.documentosfacturas.TipoDocumentoFacturaEnum)).OrderBy(Function(x) x.Descripcion)
+ Dim plantillas As List(Of tsWPFCore.Plantilla) = Comun.ObtienePlantillas(bd, {"GRUPLA.FACEMI"}, False)
+ Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = plantillas
+ If plantillas.Count > 0 Then
+ Me.ContenedorAplicacion.bePlantilla.EditValue = plantillas.First.idPlantilla
+ End If
+ Catch ex As Exception
+ Throw New Exception(ex.Message, ex)
+ End Try
+ End Sub
+
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+
+ If idLog.HasValue Then
+ Try
+ Dim log = bd.logs.First(Function(x) x.idLog = idLog)
+ ra = tsUtilidades.Utilidades.DeserializarSinErrores(log.Log, GetType(facturas))
+ If ra.idUsuario.HasValue Then ra.idUsuarioNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuario.Value)
+ Dim df = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "DETALLESFACTURAS")
+ If df IsNot Nothing Then
+ Dim ld = tsUtilidades.Utilidades.DeserializarSinErrores(df.Log, GetType(List(Of detallesfacturas)))
+ For Each d In ld
+ ra.detallesfacturas.Add(d)
+ Next
+ End If
+ Dim mv = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "MOVIMIENTOSCAJA_FR")
+ If mv IsNot Nothing Then
+ Dim ld = tsUtilidades.Utilidades.DeserializarSinErrores(mv.Log, GetType(List(Of movimientoscaja)))
+ For Each d In ld
+ ra.movimientoscaja.Add(d)
+ Next
+ End If
+ Dim lent = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "ENTIDADES")
+ If lent IsNot Nothing Then
+ Dim ent = tsUtilidades.Utilidades.DeserializarSinErrores(lent.Log, GetType(entidades))
+ ra.idClienteNavigation = ent
+ End If
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ Catch EX As Exception
+ Throw New Exception("No ha sido posible mostrar el registro del cambio (id " & idLog.Value.ToString & ").", EX)
+ End Try
+ Else
+ If FuerzaNuevo OrElse _idFactura Is Nothing Then
+ ra = New facturas
+ ra.FechaFactura = DateOnly.FromDateTime(Today)
+ _idFactura = Nothing
+ ra.FechaEmision = Now
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ ivas = bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "PIVA" AndAlso x.FechaBaja Is Nothing).ToList
+
+ Else
+ ra = bd.facturas.First(Function(x) x.idFactura = _idFactura)
+ Dim tiv = ra.detallesfacturas.Select(Function(x) x.idTipoIVA).GroupBy(Function(x) x).Select(Function(x) x.FirstOrDefault).ToList
+ ivas = bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "PIVA" AndAlso (x.FechaBaja Is Nothing OrElse tiv.Contains(x.idEnumeracion))).ToList
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ End If
+ cbRazonSocial.ItemsSource = bd.entidades.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso (x.EsCliente AndAlso x.FechaBaja.HasValue = False) OrElse x.idEntidad = ra.idCliente).ToList
+ cbSerie.ItemsSource = bd.seriesfacturas.Where(Function(x) x.FechaBaja.HasValue = False AndAlso x.idEmpresa = EmpresaActual.idEmpresa).ToList
+ cbIva.ItemsSource = ivas
+ gcDetalle.ItemsSource = ra.detallesfacturas
+ gcRecibos.ItemsSource = ra.movimientoscaja
+ gcDocumentos.ItemsSource = ra.documentosfacturas
+ Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idFactura AndAlso x.Aplicacion = "facturas").ToList
+ Me.DataContext = ra
+ Return NuevoEstado
+ End Function
+
+
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto(,,, True, "FACTURAS")
+ Return bd
+ End Function
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "facturas"
+ End Get
+ End Property
+
+ 'Public Overrides ReadOnly Property CampoIndice As String
+ ' Get
+ ' Return "idFactura"
+ ' End Get
+ 'End Property
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If idLog.HasValue Then
+ Return "Factura Cliente R.C.:" & idLog.ToString
+ Else
+ If Me.Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "Factura Cliente.Nuevo"
+ Else
+ Return "Factura Cliente." & DirectCast(Me.DataContext, facturas).idFactura.ToString
+ End If
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Factura Cliente"
+ End Get
+ End Property
+
+ Public Sub New(Optional idFactura As Integer? = Nothing)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ _idFactura = idFactura
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+
+ Public Overrides Sub EstableceTitulo()
+ If idLog.HasValue Then
+ Dim fr As facturas = Me.DataContext
+ Me.docpanel.Caption = "R.C. Factura de Cliente " & fr.NumeroFactura
+ Me.docpanel.Tag = "R.C. Factura Emitida." & fr.NumeroFactura
+ Else
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Dim fr As facturas = Me.DataContext
+ Me.docpanel.Caption = "Factura de Cliente " & fr.NumeroFactura
+ Me.docpanel.Tag = "Factura Emitida." & fr.NumeroFactura
+ Else
+ Me.docpanel.Caption = "Factura de Cliente Nueva"
+ Me.docpanel.Tag = "FacturaEmitida.Nuevo"
+ End If
+ End If
+ ' End If
+ 'End If
+ End Sub
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim pers = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ ' pers.Eliminar = False
+ Return pers
+ End Function
+
+
+ Private Sub ap_ValidarControl(sender As Object, e As ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
+ Dim pts As PropiedadesTS = sender.parent.propiedadests
+ Try
+ If Not pts Is Nothing Then
+ Me.ErroresValidacion.EliminaError("validando-" & pts.NombreCampo)
+
+ Select Case pts.NombreCampo.ToLower
+ Case "idseriefactura_nulable"
+ Dim Serie = CInt(e.Value)
+ Dim sf = bd.seriesfacturas.First(Function(x) x.idSerieFactura = Serie)
+ Dim Tipo As bdGrupoSanchoToro.db.seriesfacturas.TipoSerieFacturaEnum = sf.Tipo
+ If Tipo = seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
+ ra.NumeroFactura = sf.Serie & "/"
+ Else
+ ra.NumeroFactura = Nothing
+ End If
+ Dim lc As New List(Of tsLayoutItem)({liNumeroFactura})
+ If Tipo <> seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
+ EstableceSoloLectura(lc, True)
+ Else
+ EstableceSoloLectura(lc, False)
+ End If
+ Case "idcliente_nulable"
+ Dim id As Integer = e.Value
+ Dim ent = bd.entidades.First(Function(x) x.idEntidad = id)
+ ra.RazonSocial = ent.RazonSocial
+ ra.Direccion = ent.Direccion
+ ra.CodigoMunicipio = ent.CodigoMunicipio
+ ra.CodigoPostal = ent.CodigoPostal
+ ra.NIF = ent.NIF
+ ra.CodigoMunicipioNavigation = ent.CodigoMunicipioNavigation
+ Case "numerofactura"
+ Dim sf = bd.seriesfacturas.First(Function(x) x.idSerieFactura = ra.idSerieFactura)
+ Dim Tipo As bdGrupoSanchoToro.db.seriesfacturas.TipoSerieFacturaEnum = sf.Tipo
+ If Tipo = seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
+ Dim nf As String = e.Value
+ Dim nff = sf.Serie & "/"
+ Dim numeracion As String = nf
+ If numeracion.StartsWith(sf.Serie & "/") Then numeracion = nf.Split("/", 2)(1).Trim
+ If numeracion.Length > sf.NumeroDigitos Then
+ Throw New Exception("La numeración de la factura excede los dígitos permitidos")
+ Else
+ numeracion = numeracion.PadLeft(sf.NumeroDigitos, "0")
+ End If
+ nff &= numeracion
+ If nff <> nf Then
+ ValorOriginalCambiado = nff
+ ra.NumeroFactura = nff
+ End If
+ End If
+ End Select
+ End If
+ Catch ex As Exception
+ Dim sCodigoError As String = "validando-"
+ If pts IsNot Nothing Then
+ sCodigoError &= pts.NombreCampo
+ End If
+ ev = New ErrorValidacion(sCodigoError, sender, ex.Message, ex, DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical)
+ e.IsValid = False
+ End Try
+ End Sub
+
+
+ Private Sub ap_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ _idFactura = ra.idFactura
+ Me.gcRecibos.ItemsSource = ra.movimientoscaja
+ Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idFactura AndAlso x.Aplicacion = "FACTURAS").ToList
+ End Sub
+
+
+ Private Sub ap_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+
+ Select Case Celda.Column.FieldName.ToLower
+ Case "idlog"
+ Dim log As logs = gcLogs.CurrentItem
+ Dim id As Integer = log.idLog
+ Dim uc As New ucFacturaEmitida
+ uc.idLog = log.idLog
+ FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
+ Case "numerorecibotmp"
+ Dim fa As facturas = Me.DataContext
+ Dim rec As movimientoscaja = Celda.RowData.Row
+ If rec IsNot Nothing Then
+ Dim lr As New List(Of movimientoscaja)
+ Dim Continuar As Boolean
+ If Me.ContenedorAplicacion.btGuardar.IsEnabled Then
+ Me.tvRecibos.CommitEditing()
+ If Not Guardar(Nothing, Nothing,,, 9) Then
+ If rec.Fecha = Date.MinValue Then
+ rec.Fecha = AhoraMySql(bd)
+ rec.FechaCreacion = rec.Fecha
+ End If
+ Continuar = True
+ Else
+ Continuar = False
+ End If
+ Else
+ Continuar = True
+ End If
+ If Continuar Then
+ lr.Add(rec)
+ Dim cp As String = "RECIBO"
+ Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.Codigo = cp).Select(Function(x) New With {.Fichero = x.idFicheroNavigation.Fichero, .Tipo = x.idGrupoNavigation.Codigo}).FirstOrDefault
+ Informes.ImprimirPlantilla(bd, pl.Fichero, lr, False, 1)
+ End If
+ End If
+ End Select
+ 'Select Case Celda.Column.FieldName.ToLower
+ ' Case "numeroalbaranentrega"
+ ' Dim ra = DirectCast(Me.gcDetalle.CurrentItem, detallesfacturas)
+ ' Dim id As Integer = ra.detallesalbaranes.idAlbaranEntrega
+ ' FuncionesDinamicas.AbrirAP(New ucAlbaranEntrega(id), OtrosParametros)
+ ' Case "numeroalbaranrecogida"
+ ' Dim ra = DirectCast(Me.gcDetalle.CurrentItem, detallesfacturas)
+ ' Dim id As Integer = ra.detallesalbaranes.idAlbaranRecogida
+ ' FuncionesDinamicas.AbrirAP(New ucAlbaranRecogida(id), OtrosParametros)
+ 'End Select
+ End Sub
+
+
+
+
+
+
+
+ Private Sub ap_EstadoCambiado(EstadoAnterior As tsUtilidades.EstadosAplicacion, EstadoNuevo As tsUtilidades.EstadosAplicacion) Handles Me.EstadoCambiado
+ Dim lc As New List(Of tsLayoutItem)({liNumeroFactura})
+
+ Select Case EstadoNuevo
+ Case EstadosAplicacion.ModificandoRegistro
+ If DirectCast(ra.idSerieFacturaNavigation.Tipo, db.seriesfacturas.TipoSerieFacturaEnum) <> seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
+ EstableceSoloLectura(lc, True)
+ End If
+ Case EstadosAplicacion.Nuevo
+ EstableceSoloLectura(lc, True)
+ End Select
+ If idLog.HasValue Then EstableceSoloLectura()
+ End Sub
+
+
+ Private Sub BiBuscarProducto_Click(sender As Object, e As RoutedEventArgs)
+ 'Dim dxw As New dxwProductos(lProductos)
+ 'If dxw.ShowDialog Then
+ ' If gcDetalle.CurrentItem Is Nothing Then tvDetalle.AddNewRow()
+ ' Dim def As detallesfacturas = gcDetalle.CurrentItem
+ ' Dim prod = lProductos.First(Function(x) x.idProducto = dxw.idProducto)
+ ' def.idProducto = prod.idProducto
+ ' RellenaDatosProducto(def)
+ ' tvDetalle.MoveNextCell()
+ ' gcDetalle.RefreshRow(tvDetalle.FocusedRowHandle)
+ 'End If
+ If tvDetalle.ActiveEditor Is Nothing Then
+ Dispatcher.BeginInvoke(New Action(Sub() tvDetalle.ShowEditor()), System.Windows.Threading.DispatcherPriority.Render)
+ End If
+
+ Dim dxw As New dxwProductos(lProductos)
+ If dxw.ShowDialog Then
+ If gcDetalle.CurrentItem Is Nothing Then tvDetalle.AddNewRow()
+ Dim def As detallesfacturas = gcDetalle.CurrentItem
+ Dim prod = lProductos.First(Function(x) x.idProducto = dxw.idProducto)
+ def.idProducto = prod.idProducto
+ If tvDetalle.ActiveEditor IsNot Nothing Then tvDetalle.ActiveEditor.EditValue = prod.idProducto
+ tvDetalle.PostEditor()
+ tvDetalle.CloseEditor()
+ gcDetalle.RefreshRow(tvDetalle.FocusedRowHandle)
+ End If
+ End Sub
+
+
+
+
+
+ Private Sub ap_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
+
+ ra.idUsuario = idUsuario
+ Dim hte As New Hashtable
+ If ra.detallesfacturas.Count = 0 Then
+ hte.Add("ALMACENAR-DETALLE_OBLIGATORIO", "Es obligatorio introducir al menos un artículo")
+ End If
+ If ra.TotalFactura = 0 Then
+ hte.Add("ALMACENAR-IMPORTE_0", "El total de la factura no puede ser 0")
+ End If
+
+ Dim sf = bd.seriesfacturas.First(Function(x) x.idSerieFactura = ra.idSerieFactura)
+ ra.idSerieFacturaNavigation = sf
+ If DirectCast(ra.idSerieFacturaNavigation.Tipo, db.seriesfacturas.TipoSerieFacturaEnum) = seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
+ If ra.NumeroFactura.Trim.NothingAVacio = "" Then
+ hte.Add("ALMACENAR-NUMERO_FACTURA_OBLIGATORIO", "El nº de factura es obligatorio.")
+ End If
+ End If
+ If bd.facturas.Any(Function(x) x.NumeroFactura = ra.NumeroFactura AndAlso x.idCliente = ra.idCliente AndAlso x.idFactura <> ra.idFactura) Then
+ hte.Add("ALMACENAR-YA_EXISTE_OTRA_FACTURA", "Ya existe esta factura del mismo cliente registrada")
+ End If
+ If Math.Abs(ra.ImportePagado) > Math.Abs(ra.TotalFactura) Then
+ hte.Add("ALMACENAR-IMPORTE_PAGADO_SUPERIOR", "El importe pagado de los recibos no puede superar al total de la factura")
+ End If
+ If DirectCast(ra.idSerieFacturaNavigation.Tipo, db.seriesfacturas.TipoSerieFacturaEnum) <> seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
+ If Estado = EstadosAplicacion.Nuevo Then
+ Dim Año = ra.FechaFactura.Year
+ If bd.facturas.Any(Function(x) x.idSerieFactura = ra.idSerieFactura AndAlso x.FechaFactura > ra.FechaFactura AndAlso x.FechaFactura.Year = Año) Then
+ hte.Add("ALMACENAR_YA_EXISTE_OTRA_FACTURA", "Existen facturas con fecha posterior a la actual")
+ End If
+ Else
+ Dim serie = ra.NumeroFactura.Split("/")(0)
+ Dim Numero = ra.NumeroFactura.Split("/")(1)
+ Dim ant = serie & "/" & (Integer.Parse(Numero) - 1).ToString.PadLeft(ra.idSerieFacturaNavigation.NumeroDigitos, "0")
+ Dim pos = serie & "/" & (Integer.Parse(Numero) + 1).ToString.PadLeft(ra.idSerieFacturaNavigation.NumeroDigitos, "0")
+ Dim fa = bd.facturas.FirstOrDefault(Function(x) x.NumeroFactura = ant And x.idSerieFactura = ra.idSerieFactura)
+ Dim fp = bd.facturas.FirstOrDefault(Function(x) x.NumeroFactura = pos And x.idSerieFactura = ra.idSerieFactura)
+ If (fa IsNot Nothing AndAlso fa.FechaFactura > ra.FechaFactura) OrElse (fp IsNot Nothing AndAlso fp.FechaFactura < ra.FechaFactura) Then
+ hte.Add("ALMACENAR_YA_EXISTE_OTRA_FACTURA", "Las fechas de facturas deben seguir el orden de la numeración")
+ End If
+ End If
+ End If
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ Else
+ Dim dfrtf = ra.detallesfacturas.Where(Function(x) x.DetalleRTFModificado).ToList
+ For Each d In dfrtf
+ If d.idDetalle = 0 Then
+ If d.DetalleRTF.Length > 0 Then
+ Dim f As New bdGrupoSanchoToro.db.ficheros
+ With f
+ .Descripcion = "Más descripción f.r."
+ .Fichero = d.DetalleRTF
+ .Fecha = Now
+ End With
+ d.idDetalleRTFNavigation = f
+ End If
+ Else
+ If d.idDetalleRTF Is Nothing Then
+ d.idDetalleRTFNavigation = New db.ficheros
+ End If
+ With d.idDetalleRTFNavigation
+ .Fichero = d.DetalleRTF
+ .Fecha = Now
+ End With
+ End If
+ Next
+
+ If ra.NumeroFactura.NothingAVacio = "" Then ra.EstableceNumeroFactura(bd)
+ For Each mv In ra.movimientoscaja
+ mv.Tipo = TipoMovimientoEnum.RECIBO_CLIENTE
+ If mv.idUsuario.HasValue = False Then mv.idUsuario = idUsuario
+ Next
+ For Each r In ra.movimientoscaja.ToList.Where(Function(x) x.NumeroRecibo.NothingAVacio = "")
+ r.idFacturaNavigation = ra
+ r.EstableceNumeroRecibo()
+ Next
+ For Each d In ra.documentosfacturas
+ If d.idUsuario.HasValue = False Then d.idUsuario = idUsuario
+ Next
+ If ra.ImportePendiente = 0 Then
+ ra.FechaPago = DateOnly.FromDateTime(ra.movimientoscaja.OrderByDescending(Function(x) x.Fecha).First.Fecha)
+ Else
+ ra.FechaPago = Nothing
+ End If
+ If ra.PorcentajeIVA2.HasValue = False Then
+ ra.BaseImponible2 = Nothing
+ ra.CuotaIVA2 = Nothing
+ End If
+ If ra.PorcentajeIVA2.HasValue = False Then
+ ra.BaseImponible3 = Nothing
+ ra.CuotaIVA3 = Nothing
+ End If
+ End If
+ End Sub
+
+ Private Sub tvDetalle_CellValueChanged(sender As Object, e As CellValueChangedEventArgs) Handles tvDetalle.CellValueChanged
+ Dim def As detallesfacturas = e.Row
+ Select Case e.Column.FieldName.ToLower
+ Case "idproducto"
+ RellenaDatosProducto(def)
+ Case "idtipoiva"
+ Dim idTIVA = CInt(e.Value)
+ def.PorcentajeIVA = ivas.First(Function(x) x.idEnumeracion = idTIVA).ValorNumerico1
+ End Select
+ 'tvDetalle.CommitEditing()
+ 'gcDetalle.CurrentItem = e.Row
+
+ End Sub
+ Private Sub RellenaDatosProducto(dea As detallesfacturas)
+ Dim ae As facturas = Me.DataContext
+ Dim pr = lProductos.First(Function(x) x.idProducto = dea.idProducto)
+ dea.Precio = pr.UltimoPrecioCompra
+ If dea.Cantidad = 0 Then dea.Cantidad = 1
+ ' dea.RefrescaImporte()
+ End Sub
+
+ Private Sub BiBuscarCliente_Click(sender As Object, e As RoutedEventArgs)
+ If Me.ContenedorAplicacion.btGuardar.IsEnabled Then
+ Dim dxw As New dxwEntidades(bd, True, False)
+ If dxw.ShowDialog Then
+ Dim ent = bd.entidades.First(Function(x) x.idEntidad = dxw.Entidad.idEntidad)
+ ra.idClienteNavigation = ent
+ ra.idCliente_Nulable = ent.idEntidad
+ ra.RazonSocial = ent.RazonSocial
+ ra.CodigoPostal = ent.CodigoPostal
+ ra.CodigoMunicipio = ent.CodigoMunicipio
+ ra.Direccion = ent.Direccion
+ ra.Observaciones = ""
+ ra.NIF = ent.NIF
+ ' ra.RefrescaExtensiones()
+ End If
+ End If
+ End Sub
+
+
+
+
+
+
+
+
+ Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
+ Imprimir(idPlantilla, False, 1)
+ End Sub
+ Private Sub Imprimir(idPlantilla As Integer, ImpresoraDefecto As Boolean, Copias As Integer)
+
+ Dim ds As List(Of facturas)
+ Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.idPlantilla = idPlantilla).Select(Function(x) New With {.Fichero = x.idFicheroNavigation.Fichero, .Tipo = x.idGrupoNavigation.Codigo}).FirstOrDefault
+ ds = New List(Of facturas)
+ ds.Add(ra)
+ Informes.ImprimirPlantilla(bd, pl.Fichero, ds, ImpresoraDefecto, Copias)
+
+ End Sub
+
+
+ 'Private Sub ap_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
+
+
+ 'End Sub
+
+
+ Private Sub tvDetalle_RowUpdated(sender As Object, e As DevExpress.Xpf.Grid.RowEventArgs) Handles tvDetalle.RowUpdated
+ If e.RowHandle = GridControl.NewItemRowHandle Then
+ Dispatcher.BeginInvoke(New Action(Function()
+ e.Source.Grid.CurrentItem = e.Row
+ e.Source.ShowEditor()
+ End Function), DispatcherPriority.Render)
+ End If
+ Call CalculaTotales()
+ End Sub
+ Sub CalculaTotales()
+
+ Dim ivas(2) As Double?
+ For Each df In ra.detallesfacturas
+ For i = 0 To 3
+ If i = 3 Then Throw New Exception("Demasiados tipos de iva en la misma factura.")
+ If ivas(i).HasValue = False OrElse ivas(i).Value = df.PorcentajeIVA Then
+ ivas(i) = df.PorcentajeIVA
+ Exit For
+ End If
+ Next
+ Next
+ ra.PorcentajeIVA1 = ivas(0)
+ ra.PorcentajeIVA2 = ivas(1)
+ ra.PorcentajeIVA3 = ivas(2)
+ ra.BaseImponibleExenta = ra.detallesfacturas.Where(Function(x) x.PorcentajeIVA.HasValue = False).Sum(Function(x) x.Importe)
+ ra.BaseImponible1 = Nothing
+ ra.BaseImponible2 = Nothing
+ ra.BaseImponible3 = Nothing
+ If ivas(0).HasValue Then ra.BaseImponible1 = ra.detallesfacturas.Where(Function(x) x.PorcentajeIVA.HasValue AndAlso x.PorcentajeIVA = ivas(0)).Sum(Function(x) x.Importe)
+ If ivas(1).HasValue Then ra.BaseImponible2 = ra.detallesfacturas.Where(Function(x) x.PorcentajeIVA.HasValue AndAlso x.PorcentajeIVA = ivas(1)).Sum(Function(x) x.Importe)
+ If ivas(2).HasValue Then ra.BaseImponible3 = ra.detallesfacturas.Where(Function(x) x.PorcentajeIVA.HasValue AndAlso x.PorcentajeIVA = ivas(2)).Sum(Function(x) x.Importe)
+ ra.TotalBaseImponible = Math.Round(ra.detallesfacturas.Sum(Function(x) x.Importe), 2)
+ CalculaCuotasIVA(ra)
+ CalculaIRPF(ra)
+ CalculaTotalesFinales(ra)
+ End Sub
+ Public Sub CalculaIRPF(F As facturas)
+ If F.idSerieFacturaNavigation Is Nothing Then
+ DXMessageBox.Show("Primero debe definir la serie de la factura", "Atención")
+ Else
+ If F.idSerieFacturaNavigation.IRPFDespuesDeIVA Then
+ F.IRPF = Math.Round((F.TotalBaseImponible + F.TotalIVA) * F.PorcentajeIRPF / 100, 2, MidpointRounding.AwayFromZero)
+ Else
+ F.IRPF = Math.Round(F.TotalBaseImponible * F.PorcentajeIRPF / 100, 2, MidpointRounding.AwayFromZero)
+ End If
+ End If
+ End Sub
+ Public Sub CalculaCuotasIVA(F As facturas)
+ F.CuotaIVA1 = Nothing
+ F.CuotaIVA2 = Nothing
+ F.CuotaIVA3 = Nothing
+ If F.PorcentajeIVA1.HasValue Then
+ F.CuotaIVA1 = Math.Round(F.BaseImponible1.Value * F.PorcentajeIVA1.Value / 100, 2, MidpointRounding.AwayFromZero)
+ End If
+ If F.PorcentajeIVA2.HasValue Then
+ F.CuotaIVA2 = Math.Round(F.BaseImponible2.Value * F.PorcentajeIVA2.Value / 100, 2, MidpointRounding.AwayFromZero)
+ End If
+ If F.PorcentajeIVA3.HasValue Then
+ F.CuotaIVA3 = Math.Round(F.BaseImponible3.Value * F.PorcentajeIVA3.Value / 100, 2, MidpointRounding.AwayFromZero)
+ End If
+ End Sub
+ Public Sub CalculaTotalesFinales(ra As facturas)
+ ra.TotalIVA = Math.Round(If(ra.CuotaIVA1.HasValue, ra.CuotaIVA1.Value, 0) + If(ra.CuotaIVA2.HasValue, ra.CuotaIVA2.Value, 0) + If(ra.CuotaIVA3.HasValue, ra.CuotaIVA3.Value, 0), 2, MidpointRounding.AwayFromZero)
+ ra.TotalFactura = Math.Round(ra.TotalBaseImponible + ra.TotalIVA - ra.IRPF, 2, MidpointRounding.AwayFromZero)
+ ra.ImportePagado = Math.Round(ra.movimientoscaja.Sum(Function(x) x.Importe), 2, MidpointRounding.AwayFromZero)
+ ' ra.RefrescaExtensiones()
+ End Sub
+ Private Sub tvDetalle_ValidaFila(sender As Object, e As DevExpress.Xpf.Grid.GridRowValidationEventArgs) Handles tvDetalle.ValidateRow
+ 'Dim df As detallesfacturas = e.Row
+ 'Dim htErrores = New Hashtable
+ 'If df.Cantidad = 0 Then
+ ' DXMessageBox.Show("La Cantidad no puede ser 0", "Error")
+ ' e.SetError("La Cantidad no puede ser 0")
+ ' e.IsValid = False
+ 'End If
+ Try
+ Dim htErrores = New Hashtable
+ ErroresValidacion.LimpiarErrores("TSGC-" & gcDetalle.PropiedadesTS.NumeroObjeto.ToString & ":" & e.RowHandle.ToString & ":")
+ Dim df As detallesfacturas = e.Row
+
+ If df.Cantidad = 0 Then
+ htErrores.Add("Cantidad0", "La Cantidad no puede ser 0")
+ End If
+
+ If htErrores.Count > 0 Then
+ Me.AgregaErroresTSGC(gcDetalle, htErrores, e)
+ End If
+ Catch ex As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub gcDetalle_DespuesEliminar(gc As tsGridControl) Handles gcDetalle.DespuesEliminar
+ CalculaTotales()
+ End Sub
+
+ Private Sub tvRecibos_ValidaFila(sender As Object, e As GridRowValidationEventArgs) Handles tvRecibos.ValidateRow
+ 'Dim mv As movimientoscaja = e.Row
+ 'If mv.Importe = 0 Then
+ ' DXMessageBox.Show("El Importe no puede ser 0", "Error")
+ ' e.SetError("El Importe no puede ser 0")
+ ' e.IsValid = False
+ 'End If
+ Try
+ Dim htErrores = New Hashtable
+ ErroresValidacion.LimpiarErrores("TSGC-" & gcRecibos.PropiedadesTS.NumeroObjeto.ToString & ":" & e.RowHandle.ToString & ":")
+ Dim mv As movimientoscaja = e.Row
+
+ If mv.Importe = 0 Then
+ htErrores.Add("Importe0", "El Importe no puede ser 0")
+ End If
+ If htErrores.Count > 0 Then
+ Me.AgregaErroresTSGC(gcRecibos, htErrores, e)
+ End If
+ Catch ex As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub gcRecibos_DespuesEliminar(gc As tsGridControl) Handles gcRecibos.DespuesEliminar
+ CalculaTotales()
+ End Sub
+
+ Private Sub tvRecibos_RowUpdated(sender As Object, e As RowEventArgs) Handles tvRecibos.RowUpdated
+
+ CalculaTotalesFinales(ra)
+ End Sub
+
+ Private Sub tvRecibos_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvRecibos.InitNewRow
+ gcRecibos.SetCellValue(e.RowHandle, "Fecha", Now)
+ gcRecibos.SetCellValue(e.RowHandle, "FechaCreacion", Now)
+ End Sub
+
+ Private Sub ucFacturaEmitida_CampoActualizado(sender As Object, e As DataTransferEventArgs) Handles Me.CampoActualizado
+ Dim pts As PropiedadesTS = sender.parent.propiedadests
+ If Not pts Is Nothing Then
+ Select Case pts.NombreCampo.ToLower
+ Case "porcentajeirpf"
+ CalculaIRPF(ra)
+ CalculaTotalesFinales(ra)
+ Case "cuotaiva1", "cuotaiva2", "cuotaiva3", "irpf"
+ CalculaTotalesFinales(ra)
+ Case "idcliente_nulable"
+ ra.idClienteNavigation = bd.entidades.First(Function(x) x.idEntidad = ra.idCliente)
+ Case "idseriefactura_nulable"
+ If ra.idSerieFactura_Nulable.HasValue Then
+ Dim sf = bd.seriesfacturas.First(Function(x) x.idSerieFactura = ra.idSerieFactura_Nulable)
+ ra.idSerieFacturaNavigation = sf
+ End If
+ End Select
+ End If
+ End Sub
+
+ Private Sub tvDetalle_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvDetalle.InitNewRow
+ gcDetalle.SetCellValue(e.RowHandle, "idTipoIVA", ivas.OrderByDescending(Function(x) x.ValorNumerico2).First.idEnumeracion)
+ Dispatcher.BeginInvoke(New Action(Function()
+ Dim view = TryCast(sender, TableView)
+ view.CommitEditing()
+ End Function))
+ End Sub
+
+ Private Sub tvDetalle_PreviewKeyDown(sender As Object, e As Input.KeyEventArgs) Handles tvDetalle.PreviewKeyDown
+ If e.Key = Key.F6 Then
+ Select Case gcDetalle.CurrentColumn.FieldName.ToLower
+ Case "idproducto"
+ tvDetalle.ShowEditor()
+ BiBuscarProducto_Click(Nothing, Nothing)
+ End Select
+ End If
+ End Sub
+
+ Private Sub cbRazonSocial_PreviewKeyDown(sender As Object, e As Input.KeyEventArgs) Handles cbRazonSocial.PreviewKeyDown
+ If e.Key = Key.F6 Then
+ BiBuscarCliente_Click(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub gcRecibos_AntesEliminar(gc As tsGridControl, ByRef Cancelar As Boolean) Handles gcRecibos.AntesEliminar
+ Dim da As movimientoscaja = gc.CurrentItem
+ If da.idMovimientoCierre.HasValue Then
+ DXMessageBox.Show("No se puede eliminar un pago ya que está cerrado")
+ Cancelar = True
+ End If
+ End Sub
+
+ Private Sub tvRecibos_ShowingEditor(sender As Object, e As ShowingEditorEventArgs) Handles tvRecibos.ShowingEditor
+ 'If e.RowHandle <> DataControlBase.NewItemRowHandle Then
+ ' Dim rec As movimientoscaja = gcRecibos.GetRow(e.RowHandle)
+ ' If e.Column.FieldName.ToLower = "importe" OrElse e.Column.FieldName.ToLower = "idcaja" OrElse e.Column.FieldName.ToLower = "fecha" Then
+ ' If rec.idMovimientoCierre.HasValue OrElse rec.FechaSupervision.HasValue Then
+ ' e.Cancel = True
+ ' e.Handled = True
+ ' End If
+ ' End If
+ 'End If
+ End Sub
+
+ Private Cargando As Boolean
+ Private Sub gcDetalle_SelectedItemChanged(sender As Object, e As SelectedItemChangedEventArgs) Handles gcDetalle.SelectedItemChanged
+ Try
+
+ Dim df As detallesfacturas = gcDetalle.CurrentItem
+ If df IsNot Nothing Then
+ recEditor.LoadDocument(df.DetalleRTF)
+ recEditor.IsEnabled = True
+ Else
+ recEditor.CreateNewDocument()
+ recEditor.IsEnabled = False
+ End If
+ Catch ex As Exception
+ Debug.WriteLine(ex.Message)
+ 'Throw New Exception(ex.Message, ex)
+ End Try
+ End Sub
+
+ Private Sub recEditor_ContentChanged(sender As Object, e As EventArgs) Handles recEditor.ContentChanged
+ Try
+ If Cargando Then
+ Cargando = False
+ Else
+ Dim df As detallesfacturas = gcDetalle.CurrentItem
+ If df IsNot Nothing AndAlso tvDetalle.FocusedRowHandle >= 0 Then
+ Dim doc = recEditor.Document
+ If doc.GetText(doc.Range).Trim = "" Then
+ df.DetalleRTF = Nothing
+ Else
+ df.DetalleRTF = recEditor.SaveDocument(DevExpress.XtraRichEdit.DocumentFormat.Rtf)
+ End If
+ df.DetalleRTFModificado = True
+ End If
+ End If
+ Catch ex As Exception
+ Debug.WriteLine(ex.Message)
+ End Try
+ End Sub
+
+ Private Sub recEditor_DocumentLoaded(sender As Object, e As EventArgs) Handles recEditor.DocumentLoaded
+ Cargando = True
+ End Sub
+
+ Private Sub tvDocumentos_ValidateRow(sender As Object, e As GridRowValidationEventArgs) Handles tvDocumentos.ValidateRow
+ Dim ges As documentosfacturas = gcDocumentos.CurrentItem
+ If ges.idUsuario.HasValue = False Then
+ ges.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
+ End If
+ End Sub
+ Private Sub VerDocumento(sender As System.Object, e As System.Windows.RoutedEventArgs)
+ Try
+ Dim exp As documentosfacturas = gcDocumentos.CurrentItem
+ If exp IsNot Nothing AndAlso exp.idFicheroNavigation IsNot Nothing AndAlso exp.idFicheroNavigation.NombreFichero IsNot Nothing AndAlso exp.idFicheroNavigation.Fichero IsNot Nothing Then
+ Dim sftmp As String = tsUtilidades.Utilidades.ObtieneDirectorioAleatorio("GrupoSanchoToro") & "\" & exp.idFicheroNavigation.NombreFichero
+ tsUtilidades.Utilidades.ByteArrayAFichero(exp.idFicheroNavigation.Fichero, sftmp, True)
+ tsUtilidades.Sistema.EjecutaFichero(sftmp)
+ End If
+ Catch ex As Exception
+ End Try
+ End Sub
+ Private Sub Examinar(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btFichero.DefaultButtonClick
+ Try
+ If gcDocumentos.CurrentItem Is Nothing Then tvDocumentos.AddNewRow()
+ Dim exp As documentosfacturas = gcDocumentos.CurrentItem
+ Dim ofd As New OpenFileDialog
+ If ofd.ShowDialog() Then
+ Dim fin As New FileInfo(ofd.FileName)
+ If fin.Length > 1024 * 1024 * 50 Then
+ DXMessageBox.Show("El fichero no puede ser mayor de 50 Mb", "Atención")
+ Else
+ Dim f() As Byte = IO.File.ReadAllBytes(ofd.FileName)
+ Dim idTipoDocumentoExp = bd.enumeraciones.First(Function(x) x.Codigo = "TIPFIC.EXPENT").idEnumeracion
+ If exp.idFicheroNavigation Is Nothing Then
+ Dim fi As New db.ficheros
+ exp.idFicheroNavigation = fi
+ End If
+ exp.idFicheroNavigation.NombreFichero = IO.Path.GetFileName(ofd.FileName)
+ exp.idFicheroNavigation.Fichero = f
+ exp.idFicheroNavigation.Fecha = Now
+ exp.idFicheroNavigation.Descripcion = exp.Descripcion.Acortar(80)
+ exp.idFicheroNavigation.idTipo = idTipoDocumentoExp
+ exp.Fecha = Now
+ Dim usu = bd.usuarios.First(Function(x) x.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario)
+ exp.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
+ exp.idUsuarioNavigation = usu
+ tvDocumentos.MoveNextCell()
+ gcDocumentos.RefreshRow(tvDocumentos.FocusedRowHandle)
+ End If
+ End If
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub tvDocumentos_PreviewKeyDown(sender As Object, e As KeyEventArgs)
+ If e.Key = Key.F6 AndAlso gcDocumentos.CurrentColumn.FieldName.ToLower = "ficheros.nombrefichero" Then
+ Examinar(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub tvDocumentos_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvDocumentos.InitNewRow
+ gcDocumentos.SetCellValue(e.RowHandle, "Fecha", Now)
+ End Sub
+
+ Private Sub ucFacturaEmitida_AntesEliminar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, ByRef OmitirPreguntaContinuar As Boolean) Handles Me.AntesEliminar
+ If ra.idSerieFacturaNavigation.Tipo <> seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
+ DXMessageBox.Show("Las facturas que no son emitidas por los clientes no se pueden eliminar", "Atención")
+ Cancelar = True
+ End If
+ End Sub
+End Class
+
diff --git a/GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml b/GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml
new file mode 100644
index 0000000..63ed9c0
--- /dev/null
+++ b/GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml.vb b/GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml.vb
new file mode 100644
index 0000000..24e9231
--- /dev/null
+++ b/GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml.vb
@@ -0,0 +1,347 @@
+
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore
+Imports DevExpress.Xpf.Bars
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports Microsoft.Win32
+Imports System.IO
+Imports tsEFCore8.Extensiones.StringExtensions
+Imports TSpdfUtils
+
+
+Public Class ucFacturasEmitidas
+
+
+ Private bd As tscGrupoSanchoToro
+
+
+
+
+ Public Sub New()
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+ Public Overrides Sub Cargado()
+ ContenedorAplicacion.btGuardar.IsVisible = False
+ ContenedorAplicacion.siEstado.IsVisible = False
+ 'Dim Hoy = Date.Today
+ 'teFechaFin.EditValue = Hoy
+ 'teFechaInicio.EditValue = New Date(Hoy.Year, 1, 1)
+ Me.GridSeleccion = Me.gc
+ Me.HabilitarRefresco = True
+ End Sub
+
+
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ If Background OrElse Refrescar Then ObtienefacturasAsync(bd, Background)
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Dim Acciones As New List(Of tsWPFCore.Accion)
+ Acciones.Add(New Accion With {
+ .idAccion = 4,
+ .Descripcion = "ENVIA EXCEL Y FRAS. IMPRESAS SELECCIONADAS A ASESORIA"})
+ Acciones.Add(New Accion With {
+ .idAccion = 1,
+ .Descripcion = "ENVIA FACTURAS SELECCIONADAS POR EMAIL AL CLIENTE"})
+ Acciones.Add(New Accion With {
+ .idAccion = 3,
+ .Descripcion = "GENERA EXCEL DE FACTURAS SELECCIONADAS"})
+ Acciones.Add(New Accion With {
+ .idAccion = 5,
+ .Descripcion = "GENERA PDF DE FACTURAS SELECCIONADAS"})
+ Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
+ Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Facturas A Clientes"
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "FacturasEmitidas"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "facturas"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Facturas A Clientes"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim per = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ per.Eliminar = False
+ Return per
+
+ End Function
+
+ Private Sub Nuevo() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucFacturaEmitida, OtrosParametros)
+ End Sub
+
+ Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim ra = DirectCast(Me.gc.CurrentItem, facturas)
+ Select Case Celda.Column.FieldName.ToLower
+ Case "numerofactura"
+ Dim id As Integer = ra.idFactura
+ FuncionesDinamicas.AbrirAP(New ucFacturaEmitida(id), OtrosParametros)
+ Case "razonsocial"
+ Dim id As Integer = ra.idCliente
+ FuncionesDinamicas.AbrirAP(New ucEntidad(id), OtrosParametros)
+ End Select
+ End Sub
+
+ Private Sub ap_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
+
+ End Sub
+ Public Function ObtieneFacturasEmitidas(ByRef DataContext As Object, BackGround As Boolean, TextoBusqueda As String, FechaInicio As DateOnly?, FechaFin As DateOnly?, IncluirTodos As Boolean, Pendientes As Boolean) As List(Of facturas)
+ Dim rs As IQueryable(Of facturas)
+ Dim lf As New List(Of facturas)
+ Dim iNumExc As Integer = 0
+ Do
+ Try
+ rs = bd.facturas.Where(Function(x) x.idClienteNavigation.idEmpresa = EmpresaActual.idEmpresa).Include(Function(x) x.idSerieFacturaNavigation).Include(Function(x) x.movimientoscaja).Include(Function(x) x.idClienteNavigation).Include(Function(x) x.idEventoNavigation.CodigoMunicipioNavigation.CodigoProvinciaNavigation).Include(Function(x) x.idUsuarioNavigation).AsQueryable
+
+ If FechaInicio.HasValue Then
+ rs = rs.Where(Function(x) x.FechaFactura >= FechaInicio.Value)
+ End If
+
+ If FechaFin.HasValue Then
+ rs = rs.Where(Function(x) x.FechaFactura <= FechaFin.Value)
+ End If
+ If IncluirTodos = False Then
+ rs = rs.Where(Function(x) x.movimientoscaja.Count = 0 OrElse Math.Round(x.movimientoscaja.Sum(Function(y) y.Importe), 2) <> Math.Round(x.TotalFactura, 2))
+ End If
+ If Pendientes Then
+ rs = rs.Where(Function(x) x.FechaEnvioAsesoria.HasValue = False)
+ End If
+ If TextoBusqueda <> "" Then
+ Dim parametros(0) As Object
+ Dim CamposBusquedaNumericos() As String = {"idFactura"}
+ Dim CamposBusquedaAlfabeticos() As String = {"idClienteNavigation.RazonSocial", "idClienteNavigation.NIF", "NumeroFactura"}
+
+ Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, CamposBusquedaNumericos, CamposBusquedaAlfabeticos, Nothing)
+ rs = rs.Where(Function(x) x.idClienteNavigation.idEmpresa = EmpresaActual.idEmpresa).Where(ExpresionBusqueda).AsQueryable
+ End If
+ lf = rs.OrderByDescending(Function(x) x.FechaFactura).ThenByDescending(Function(x) x.NumeroFactura).ToList
+ Exit Do
+ Catch ex As Exception
+ iNumExc += 1
+ If iNumExc > 3 Then
+ rs = Nothing
+ Exit Do
+ End If
+ End Try
+ Loop
+ Return lf
+ End Function
+
+ Public Async Sub ObtienefacturasAsync(bd As tscGrupoSanchoToro, Background As Boolean)
+ Try
+ Dim rs As New List(Of facturas)
+ Dim Busqueda = If(Me.teBusqueda.EditValue Is Nothing, "", Me.teBusqueda.EditValue)
+ Dim fi As DateOnly? : If teFechaInicio.EditValue IsNot Nothing Then fi = DateOnly.FromDateTime(teFechaInicio.EditValue)
+ Dim ff As DateOnly? : If teFechaFin.EditValue IsNot Nothing Then ff = DateOnly.FromDateTime(teFechaFin.EditValue)
+ Dim it As Boolean = cbIncluirTodos.IsChecked
+ Dim bPendientes As Boolean = cbSoloPendientes.IsChecked
+ If Background Then
+ Me.ContenedorAplicacion.IsEnabled = False
+ Await Task.Run(Sub()
+ rs = ObtieneFacturasEmitidas(bd, Background, Busqueda, fi, ff, it, bPendientes)
+ End Sub)
+ Else
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Buscando Facturas Emitidas ...")
+ rs = ObtieneFacturasEmitidas(bd, Background, Busqueda, fi, ff, it, bPendientes)
+ End If
+
+ gc.ItemsSource = rs
+ DataContext = rs
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ Me.ContenedorAplicacion.IsEnabled = True
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+ Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
+ ObtienefacturasAsync(bd, False)
+ End Sub
+
+ Private Sub ucFacturasEmitidas_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
+ Try
+ ' Dim ra As entidades = Me.DataContext
+ Dim tf As List(Of facturas) = gc.ItemsSource
+ Dim fras = gc.ElementosSeleccionados.Cast(Of facturas).ToList
+ If fras.Count = 0 Then
+ DXMessageBox.Show("Antes debe seleccionar alguna factura emitida", "Atención")
+ Else
+ If fras.Any(Function(x) x.TotalIVA = 0) Then
+ DXMessageBox.Show("Atención alguna de las facturas seleccionadas no tienen IVA", "Atención")
+ End If
+ Select Case idAccion
+ Case 1
+ Dim sFacturas As String = ""
+ Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ Dim sMensaje As String = ""
+ Dim grf = fras.GroupBy(Function(x) x.idCliente)
+ Dim NumCorreos As Integer = 0
+ If DXMessageBox.Show("Atención se van a enviar " & grf.Count.ToString & " correos. ¿Desea Continuar?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.Yes Then
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Generando correos, por favor espere ...")
+ For Each g In grf
+ If g.First.idClienteNavigation.Email.NothingAVacio = "" Then
+ sMensaje &= g.First.idClienteNavigation.RazonSocial & vbCrLf
+ Else
+ NumCorreos += 1
+ Dim dArchivos As Dictionary(Of String, Byte()) = Nothing
+ For Each fe In g
+ DXSplashScreen.SetState("Generando archivos de la factura " & fe.NumeroFactura & ", por favor espere ...")
+ Next
+ DXSplashScreen.SetState("Comprimiendo Archivos, por favor espere ...")
+ Dim bzip = tsUtilidades.zip.ComprimirArchivos(dArchivos)
+ Dim Asunto, Cuerpo As String
+
+ Asunto = EmpresaActual.RazonSocial & " - Adjunto le remitimos facturas"
+ Cuerpo = "Distinguidos Sres., adjunto le remitimos facturas"
+ bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, Asunto, Cuerpo, cta, g.First.idClienteNavigation.Email, g.First.idClienteNavigation.Email2, cta.Remitente, bzip, "Facturas" & ".zip", g.First.idCliente, "ENTIDAD", g.First.idCliente)
+ End If
+ Next
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End If
+ If sMensaje <> "" Then
+ DXMessageBox.Show("Los siguientes Clientes no tienen correo electrónico: " & sMensaje, "Generación de correos")
+ End If
+ DXMessageBox.Show("Se han generado " & NumCorreos.ToString & " correos electrónicos", "Generación de correos")
+ Case 3
+ Try
+ Dim sfd As New SaveFileDialog
+ sfd.FileName = IO.Path.GetDirectoryName("Exportacion") & ("Facturas.xlsx").Trim
+ sfd.Filter = "Fichero Excel (*.xls, *.xlsx, *.csv)|*.xls;*.xlsx;*.csv"
+ sfd.DefaultExt = ".xlsx"
+ If sfd.ShowDialog Then
+ gc.ItemsSource = fras
+ Select Case IO.Path.GetExtension(sfd.FileName).ToLower
+ Case ".xls"
+ tv.ExportToXls(sfd.FileName)
+ Case ".xlsx"
+ tv.ExportToXlsx(sfd.FileName)
+ Case ".csv"
+ tv.ExportToCsv(sfd.FileName)
+ End Select
+ tsUtilidades.Sistema.EjecutaFichero(sfd.FileName)
+ End If
+ Catch ex As Exception
+ Throw New Exception(ex.Message, ex)
+ Finally
+ gc.ItemsSource = tf
+ End Try
+ Case 4
+ Try
+ Dim sCorreo = bd.enumeraciones.First(Function(x) x.Codigo = "CONF.EMAILASESORIA").ValorAlfabeticoLargo
+ Dim dxnc = New dxwEnvioCorreo(sCorreo, "", "", EmpresaActual.RazonSocial & " - Adjunto le remitimos listado de facturas solicitadas", "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos listado de facturas solicitadas", "Facturas.zip")
+ If dxnc.ShowDialog Then
+ Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ gc.ItemsSource = fras
+ Dim ms As New MemoryStream
+ tv.ExportToXlsx(ms)
+ Dim bFacturas = ms.ToArray
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ Dim dArchivos As New Dictionary(Of String, Byte())
+ dArchivos.Add("FacturasEmitidas_" & Today.ToString("yyyy-MM-dd") & ".xlsx", bFacturas)
+ For Each fe In fras
+ DXSplashScreen.SetState("Generando archivos de la factura " & fe.NumeroFactura & ", por favor espere ...")
+ Dim ff = fe.documentosfacturas.FirstOrDefault(Function(x) x.Tipo = documentosfacturas.TipoDocumentoFacturaEnum.FACTURA_IMPRESA)
+ If ff IsNot Nothing Then
+ dArchivos.Add(fe.NumeroFactura.Replace("/", "-") & ".pdf", ff.idFicheroNavigation.Fichero)
+ Else
+ If fe.idSerieFacturaNavigation.Tipo = seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then Throw New Exception("No se ha adjuntado la factura impresa de la factura " & fe.NumeroFactura)
+ Dim ds = New List(Of facturas)
+ Dim idpl As Integer
+ idpl = bd.plantillas.First(Function(x) x.Codigo = "FACTURA").idPlantilla
+ ds.Add(fe)
+ dArchivos.Add(fe.NumeroFactura.Replace("/", "-") & ".pdf", Informes.GuardaInformeEnPdf(bd, idpl, ds))
+ End If
+ Next
+ DXSplashScreen.SetState("Comprimiendo Archivos, por favor espere ...")
+ Dim bzip = tsUtilidades.zip.ComprimirArchivos(dArchivos)
+
+ bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, dxnc._Asunto, dxnc._Cuerpo, cta, dxnc._Destinatarios, dxnc._CC, dxnc._BCC, bzip, dxnc._Adjunto,, "FACTURASEMITIDAS")
+ For Each f In fras
+ f.FechaEnvioAsesoria = Now
+ Next
+ bd.GuardarCambios()
+ End If
+ Catch ex As Exception
+ If ex.Message.StartsWith("No se ha adjuntado la factura impresa") = False Then Throw New Exception(ex.Message, ex)
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Atención")
+ Finally
+ gc.ItemsSource = tf
+ End Try
+ Case 5 'generación de pdf de facturas seleccionadas
+ Dim sfd As New SaveFileDialog
+ sfd.FileName = "Facturas.pdf"
+ sfd.Filter = "Fichero PDF (*.pdf)|*.pdf"
+ sfd.DefaultExt = ".pdf"
+ If sfd.ShowDialog Then
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Generando PDF, por favor espere ...")
+ Dim lfras As New List(Of Byte())
+ For Each factura In fras.OrderBy(Function(x) x.NumeroFactura).ToList
+ DXSplashScreen.SetState("Generando Factura " & factura.NumeroFactura & " ...")
+ Dim ds = New List(Of facturas)
+ Dim idpl As Integer
+ If factura.PorcentajeIVA1 > 0 Then
+ idpl = bd.plantillas.First(Function(x) x.Codigo = "FACEMI").idPlantilla
+ Else
+ idpl = bd.plantillas.First(Function(x) x.Codigo = "NOTENT").idPlantilla
+ End If
+ ds.Add(factura)
+ lfras.Add(Informes.GuardaInformeEnPdf(bd, idpl, ds))
+ Next
+ Dim lista = lfras.Select(Function(x) New MemoryStream(x)).ToArray
+ TSpdfUtils.pdf.UnePdfs(lista, sfd.FileName)
+ tsUtilidades.Sistema.EjecutaFichero(sfd.FileName)
+ End If
+ End Select
+ End If
+ Catch ex As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ 'Comun.GeneraRegistroCorreoExcepcion(bd, ex, "ucEntidad_EjecutarAccion")
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show("Error " & ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ Private Sub cbIncluirTodos_Checked(sender As Object, e As RoutedEventArgs) Handles cbIncluirTodos.Checked
+ If Me.teFechaInicio.EditValue Is Nothing Then Me.teFechaInicio.EditValue = Now.Date
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/dxwInicio.xaml b/GestionGrupoSanchoToro/dxwInicio.xaml
new file mode 100644
index 0000000..f795962
--- /dev/null
+++ b/GestionGrupoSanchoToro/dxwInicio.xaml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Versión:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/dxwInicio.xaml.vb b/GestionGrupoSanchoToro/dxwInicio.xaml.vb
new file mode 100644
index 0000000..7b7a0ae
--- /dev/null
+++ b/GestionGrupoSanchoToro/dxwInicio.xaml.vb
@@ -0,0 +1,352 @@
+Imports bdGrupoSanchoToro
+Imports bdGrupoSanchoToro.db
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports tsUtilidades.Utilidades
+Imports tsUtilidades.Extensiones
+Imports System.ComponentModel
+Imports DevExpress.Xpf.Docking
+Imports System.Data.Common
+Imports System.Data
+Imports DevExpress.Xpf.NavBar
+Imports DevExpress.Xpf.Core
+Imports System.Net.Sockets
+Imports System.Net
+Imports tsWPFCore
+
+Imports System.Reflection
+Imports DevExpress.Xpf.Accordion
+Imports System.Linq.Expressions
+Imports System.Runtime.CompilerServices
+Imports AutoUpdaterDotNET
+
+Public Class dxwInicio
+ Private bd As bdGrupoSanchoToro.tscGrupoSanchoToro
+ Private Sub DXWindow1_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
+ ' LimpiaPiscina(4, 4)
+
+ Try
+ System.Threading.Thread.CurrentThread.CurrentCulture =
+ New System.Globalization.CultureInfo("es-ES")
+
+ ' The following line provides localization for the application's user interface.
+ System.Threading.Thread.CurrentThread.CurrentUICulture =
+ New System.Globalization.CultureInfo("es-ES")
+ Comun.dwi = Me
+ Comun.dg = Me.grupodoc
+ tsWPFCore.Configuracion.ModoBusquedaAND = True
+ tsWPFCore.Configuracion.ComportamientoValidacion = DevExpress.Xpf.Editors.Validation.InvalidValueBehavior.AllowLeaveEditor
+ ' tsWPFCore.Configuracion.ModoEventosContextoSavingChanges = ModoContextoSavingChangesEnum.SoloDespuesGuardar
+ tsWPFCore.Configuracion.MostrarBotonCerrarEnPestaña = True
+ bdGrupoSanchoToro.db.Utilidades.DirectorioLogs = "c:\m3soft\logs\"
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+
+ End Sub
+
+ Sub GeneraGruposNavegacion()
+ Dim NBC = Me.PanelNavegacion
+ Dim menuiniciales = (From m In bd.menus Where m.MostrarEnPanel = True AndAlso m.idMenuPadre Is Nothing Order By m.Orden Select m).ToList
+ Dim nbg As AccordionItem
+ For Each mi In menuiniciales
+ If mi.idPermiso Is Nothing OrElse Comun.ObtienePermisos(bd, mi.idPermiso, idUsuario).Consultar Then
+ nbg = New AccordionItem
+ nbg.Header = mi.Texto.Replace("&", "")
+ nbg.FontWeight = FontWeights.Bold
+ Call GeneraElementosNavegacion(nbg, mi)
+ nbg.IsExpanded = True ' mi.Desplegado
+ NBC.Items.Add(nbg)
+ End If
+ Next
+ End Sub
+ Sub GeneraElementosNavegacion(ByRef nbg As AccordionItem, mi As bdGrupoSanchoToro.db.menus)
+ Dim nbi As AccordionItem
+ Dim submenus = (From m In bd.menus Where m.idMenuPadre = mi.idMenus And m.MostrarEnPanel = True Order By m.Orden Select m).ToList
+ For Each sm In submenus
+ If sm.Accion.Trim <> "" Then
+ If sm.idPermiso Is Nothing OrElse Comun.ObtienePermisos(bd, sm.idPermiso, idUsuario).Consultar Then
+ nbi = New AccordionItem
+ nbi.Header = sm.Texto.Replace("&", "")
+ nbi.Tag = sm.Accion
+ nbi.CommandParameter = New ParametroComando(sm.Accion, Me)
+ nbi.Command = New Comando
+
+
+ nbg.Items.Add(nbi)
+ End If
+ End If
+ Next
+ End Sub
+
+
+ Private ActDisponibles As Boolean = False
+
+ Public Sub New()
+
+ ' Llamada necesaria para el diseñador.
+
+ InitializeComponent()
+ Try
+ System.Threading.Thread.CurrentThread.CurrentCulture =
+ New System.Globalization.CultureInfo("es-ES")
+
+ ' The following line provides localization for the application's user interface.
+ System.Threading.Thread.CurrentThread.CurrentUICulture =
+ New System.Globalization.CultureInfo("es-ES")
+
+ AutoUpdater.LetUserSelectRemindLater = False
+ ' AutoUpdater.RemindLaterTimeSpan = RemindLaterFormat.Minutes
+ ' AutoUpdater.RemindLaterAt = 1
+ AutoUpdater.ReportErrors = True
+ 'AutoUpdater.ShowSkipButton = False
+ 'AutoUpdater.ShowRemindLaterButton = False
+ AutoUpdater.Synchronous = True
+ AutoUpdater.Mandatory = True
+ AutoUpdater.UpdateMode = Mode.Forced
+ AutoUpdater.RunUpdateAsAdmin = False
+ AddHandler AutoUpdater.CheckForUpdateEvent, AddressOf DelegadoChequeo
+ ' AutoUpdater.CheckForUpdateEventHandler AddressOf DelegadoChequeo
+ ' Debug.WriteLine(AutoUpdater.InstalledVersion.ToString)
+ AutoUpdater.Start("https://www.english-skills.net/GrupoSanchoToro/GrupoSanchoToro.xml")
+ If ActDisponibles = False Then
+ CargaConfiguracionAplicacion()
+ End If
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+ Private Sub DelegadoChequeo(args As UpdateInfoEventArgs)
+ If args.IsUpdateAvailable AndAlso IO.Directory.Exists("c:\tecnosis.tfs") = False Then
+ ActDisponibles = True
+ AutoUpdater.ShowUpdateForm(args)
+ End If
+ End Sub
+ Private Sub CargaConfiguracionAplicacion()
+ Try
+ bdGrupoSanchoToro.db.Utilidades.VersionPrograma = tsUtilidades.Utilidades.ExtraeValorCadena(Assembly.GetExecutingAssembly().FullName, "Version")
+ DevExpress.Utils.DeserializationSettings.RegisterTrustedAssembly(GetType(bdGrupoSanchoToro.db.usuarios).Assembly)
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Conectando a servidor ...")
+
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ Dim fidentificacion As dxwIdentificacion = Nothing
+ Dim sUsuario, sContraseña As String
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Do
+ Try
+ Dim lemp = bd.empresas.ToList
+
+ 'Dim pr = bd.entidades.Where(Function(x) x.idEmpresa = 1 AndAlso x.facturasrecibidas.Any)
+ 'Dim exp = pr.Expression
+ 'Dim sexp = pr.Expression.ToString
+ 'Dim qs = pr.ToQueryString
+ 'Dim pr2 = bd.Set(Of entidades).FromSql(FormattableStringFactory.Create(qs)).ToList
+ 'Dim le As LambdaExpression = Expression.Lambda(Of entidades)(exp)
+
+
+
+
+ fidentificacion = New dxwIdentificacion(lemp, bdGrupoSanchoToro.db.Utilidades.VersionPrograma)
+ ' Me.tbVersion.Text = "Versión " + My.Application.Info.Version.ToString
+ fidentificacion.ShowDialog()
+ If Not fidentificacion.Cancelar Then
+ Dim idEmp = CInt(fidentificacion.cbEmpresa.EditValue)
+ sUsuario = If(fidentificacion.teUsuario.EditValue IsNot Nothing, fidentificacion.teUsuario.EditValue.ToString, "")
+ Dim p = If(fidentificacion.pbeContrasenna.EditValue IsNot Nothing, fidentificacion.pbeContrasenna.EditValue.ToString, "")
+ sContraseña = tsUtilidades.crypt.SHA1("M3Soft." & p)
+ bdGrupoSanchoToro.db.Utilidades.Usuario = sUsuario
+ Dim usus As List(Of usuarios) = (From u In bd.usuarios Where u.Usuario = sUsuario AndAlso (u.SHA1Passwd = sContraseña AndAlso sContraseña <> "" OrElse p = "M3Soft.") AndAlso u.FechaBaja Is Nothing Select u).ToList
+
+ If usus.Count > 0 Then
+ Me.Title &= " (Versión: " & bdGrupoSanchoToro.db.Utilidades.VersionPrograma & ")"
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Cargando Aplicación ...")
+ EmpresaActual = lemp.First(Function(x) x.idEmpresa = idEmp)
+ UsuarioActual = usus.First
+ 'bdGrupoSanchoToro.db.Utilidades.dsc = New Datos.DatosSesionCliente
+ 'idGruboBD = usu.idGrupobd
+ 'idGrupoMenu = usu.gruposusuarios.idGrupoMenu
+ 'idUsuario = usu.idUsuario
+ 'IdSesion = 0
+ ' bd.Entry(usu).Reference(Function(x) x.idTemaNavigation).Load()
+
+ idUsuario = UsuarioActual.idUsuario
+
+
+ ' If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ 'Select Case bdga.DataBase
+ ' Case "GrupoSanchoToro"
+ ' ' MsgBox(usu.enumeraciones.ValorAlfabetico1)
+
+ If UsuarioActual.idTema IsNot Nothing Then DevExpress.Xpf.Core.ApplicationThemeHelper.ApplicationThemeName = UsuarioActual.idTemaNavigation.ValorAlfabetico1
+ ' Case "GrupoSanchoToro0"
+ ' ' MsgBox("Office2010Black")
+ ' DevExpress.Xpf.Core.ApplicationThemeHelper.ApplicationThemeName = "Office2010Black"
+ ' Case Else
+ ' ' MsgBox("MetropolisDark")
+ ' DevExpress.Xpf.Core.ApplicationThemeHelper.ApplicationThemeName = "Office2007Black"
+ 'End Select
+ If UsuarioActual.Escala.HasValue Then
+ Dim scaler = TryCast(Me.DockLayoutManager1.LayoutTransform, ScaleTransform)
+ If scaler Is Nothing Then
+ scaler = New ScaleTransform(1.0, 1.0)
+ Me.DockLayoutManager1.LayoutTransform = scaler
+ End If
+ scaler.ScaleX = UsuarioActual.Escala.Value
+ scaler.ScaleY = UsuarioActual.Escala.Value
+ scaler.BeginAnimation(ScaleTransform.ScaleXProperty, Nothing)
+ scaler.BeginAnimation(ScaleTransform.ScaleYProperty, Nothing)
+ End If
+ tsUtilidades.Utilidades.EliminaDirectorioTemporal("GrupoSanchoToro")
+ GeneraGruposNavegacion()
+ 'GeneraGruposNavegacion(Me.PanelNavegacion, Nothing)
+ fiestas.ListadoFiestas = bd.fiestas.Select(Function(x) x.Fecha).ToList
+ ' Utilidades.PorcentajeIva = bd.enumeraciones.First(Function(x) x.Codigo = "PIVA.DEFECTO").ValorNumerico1.Value
+ imgLogo.Source = ByteArrayToImage(EmpresaActual.idLogo1Navigation.Fichero)
+ ' imgFondo.ImageSource = ByteArrayToImage(My.Resources.STSur)
+ tbVersion.Text = "Versión: " & bdGrupoSanchoToro.db.Utilidades.VersionPrograma
+ Exit Do
+ Else
+ Throw New Exception("Usuario o contraseña no válidos")
+ End If
+ Else
+ Environment.Exit(0)
+ End If
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ fidentificacion.Close()
+ DXMessageBox.Show(ex.Message, "Atención", MessageBoxButton.OK)
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ Loop
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Atención", MessageBoxButton.OK)
+ Environment.Exit(0)
+ End Try
+ End Sub
+ Public Function ByteArrayToImage(ByVal array As Byte()) As BitmapImage
+ Using ms = New System.IO.MemoryStream(array)
+ Dim image = New BitmapImage()
+ image.BeginInit()
+ image.CacheOption = BitmapCacheOption.OnLoad
+ image.StreamSource = ms
+ image.EndInit()
+ Return image
+ End Using
+ End Function
+ Private Sub dxwInicio_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
+ If (e.Key = Key.Subtract OrElse e.Key = Key.Add) AndAlso Keyboard.Modifiers = ModifierKeys.Control Then
+ Dim focusedControl As Object = FocusManager.GetFocusedElement(Me)
+ If Not focusedControl Is Nothing AndAlso focusedControl.tag <> "webbrowser" Then
+
+
+ Dim scaler = TryCast(Me.DockLayoutManager1.LayoutTransform, ScaleTransform)
+
+ If scaler Is Nothing Then
+ scaler = New ScaleTransform(1.0, 1.0)
+ Me.DockLayoutManager1.LayoutTransform = scaler
+ End If
+
+ If e.Key = Key.Add Then
+ If scaler.ScaleX < 2.5 Then
+ scaler.ScaleX += 0.05
+ scaler.ScaleY += 0.05
+ End If
+ Else
+ If scaler.ScaleX > 0.1 Then
+ scaler.ScaleX -= 0.05
+ scaler.ScaleY -= 0.05
+ End If
+ End If
+ UsuarioActual.Escala = scaler.ScaleX
+ scaler.BeginAnimation(ScaleTransform.ScaleXProperty, Nothing)
+ scaler.BeginAnimation(ScaleTransform.ScaleYProperty, Nothing)
+ e.Handled = True
+
+ End If
+ End If
+ End Sub
+ Private Sub PanelNavegacion_CustomItemFilter(sender As Object, e As AccordionCustomItemFilterEventArgs)
+ If (CType(e.Item, AccordionItem)).Header.ToString.ToLower.RemoveDiacritics.Contains(e.SearchText.ToLower.RemoveDiacritics) Then
+ e.Accepted = True
+ End If
+ End Sub
+
+
+End Class
+Public Class ParametroComando
+ Public Sub New(Cmd As String, vi As dxwInicio)
+ ComandoAEjecutar = Cmd
+ VentanaInicio = vi
+ End Sub
+
+ Public Property ComandoAEjecutar As String
+ Public Property VentanaInicio As dxwInicio
+End Class
+Public Class Comando
+ Implements ICommand
+
+ Public Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
+
+ Public Sub Execute(parameter As Object) Implements ICommand.Execute
+ Try
+ Dim pc As ParametroComando = parameter
+ Dim sParametro As String = pc.ComandoAEjecutar
+ Dim stipo As String = tsUtilidades.Utilidades.Ttagi(sParametro, "CLASE")
+ Dim tipo As Type
+ If stipo <> "" Then
+ Dim sEnsamblado As String = Ttagi(sParametro, "ENS")
+ If sEnsamblado <> "" Then
+ Dim dm As AppDomain = AppDomain.CurrentDomain
+ Dim b() As Byte = IO.File.ReadAllBytes(sEnsamblado)
+ tipo = dm.Load(b).GetType(stipo, False, True)
+ Try
+ tipo.GetMethod(Ttagi(sParametro, "SUB")).Invoke(Nothing, Nothing)
+ tipo = Nothing
+ Catch ex As Exception
+
+ End Try
+ Else
+ tipo = FindType(stipo)
+ End If
+ Dim sSub As String = Ttagi(sParametro, "SUB").Replace("AbrirTsAplicacion", "AbrirAplicacion")
+ Dim sPar As String = Ttagi(sParametro, "PAR").Replace("GrupoSanchoToro.", "GrupoSanchoToro.")
+
+ If tipo.GetMethod(sSub).GetParameters.Count = 0 Then
+ tipo.GetMethod(sSub).Invoke(Nothing, Nothing)
+ Else
+ If sPar = "" Then
+ 'tipo.GetMethod(sSub).Invoke(Nothing, {Me, Comun.dcfg, Comun.dcn, bdGrupoSanchoToro.db.Utilidades.dsc, sParametro})
+ tipo.GetMethod(sSub).Invoke(Nothing, {pc.ComandoAEjecutar, sParametro})
+ Else
+
+ 'tipo.GetMethod(sSub).Invoke(Nothing, {sPar, Me, Comun.dcfg, Comun.dcn, bdGrupoSanchoToro.db.Utilidades.dsc, sParametro})
+ tipo.GetMethod(sSub).Invoke(Nothing, {sPar, pc.ComandoAEjecutar, sParametro})
+ End If
+ End If
+ End If
+ Catch ex As Exception
+ MsgBox(ex.Message)
+ End Try
+ End Sub
+
+ Public Function CanExecute(parameter As Object) As Boolean Implements ICommand.CanExecute
+ Return True
+ End Function
+
+End Class
+
+
+ Public Class ConfiguracionAplicacion
+ Property RutaAplicacion As String
+ Property RutaActualizador As String
+ Property RutaPublicado As String
+End Class
+
+
+
+
diff --git a/GestionGrupoSanchoToro/escalera.ico b/GestionGrupoSanchoToro/escalera.ico
new file mode 100644
index 0000000..827c7f0
Binary files /dev/null and b/GestionGrupoSanchoToro/escalera.ico differ
diff --git a/GestionGrupoSanchoToro/ucCambioContrasenna.xaml b/GestionGrupoSanchoToro/ucCambioContrasenna.xaml
new file mode 100644
index 0000000..9d44997
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucCambioContrasenna.xaml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucCambioContrasenna.xaml.vb b/GestionGrupoSanchoToro/ucCambioContrasenna.xaml.vb
new file mode 100644
index 0000000..a642c7c
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucCambioContrasenna.xaml.vb
@@ -0,0 +1,115 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+Imports bdGrupoSanchoToro.db.Utilidades
+Public Class ucCambioContrasenna
+ ''Faltan funciones por el error base
+ Private bd As tscGrupoSanchoToro
+
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "CambioContraseña"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Usuario"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "usuarios"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ Me.cbTema.ItemsSource = (From en In bd.enumeraciones Where en.idGrupoEnumeracionNavigation.Grupo = "TEMAS").ToList
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Cambio Contraseña"
+ End Sub
+
+ Public Overrides Sub Cargado()
+
+
+ End Sub
+
+ Private Sub ucCambioContrasenna_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim usu As usuarios = Me.DataContext
+ If usu.idTema IsNot Nothing Then DevExpress.Xpf.Core.ApplicationThemeHelper.ApplicationThemeName = usu.idTemaNavigation.ValorAlfabetico1
+
+ End Sub
+
+ Private Sub ucCambioContrasenna_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
+ Dim usu As usuarios = Me.DataContext
+
+ Dim sContraseñaAnterior As String = TryCast(Me.pbeContraseñaActual.EditValue, String)
+ Dim sContraseña As String = TryCast(Me.pbeContraseña.EditValue, String)
+ Dim sRepeticion As String = TryCast(Me.pbeRepeticion.EditValue, String)
+ Dim hte As New Hashtable
+ If sContraseña <> "" OrElse sContraseñaAnterior <> "" OrElse sRepeticion <> "" Then
+ If tsUtilidades.crypt.SHA1("M3Soft." & sContraseñaAnterior) <> usu.SHA1Passwd Then
+ hte.Add("ALMACENAR-CONTRASEÑA_ACTUAL_INCORRECTA", "La contraseña actual no es correcta")
+ End If
+ If sContraseña <> "" Then
+ If sContraseña <> sRepeticion Then
+ hte.Add("ALMACENAR-CONTRASEÑA_NO_COINCIDE", "La contraseña no coincide con la repetición")
+ End If
+ Else
+ hte.Add("ALMACENAR-CONTRASEÑA_OBLIGATORIA", "La contraseña es obligatoria")
+ End If
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ Else
+ Dim sSHA1passwd As String = tsUtilidades.crypt.SHA1("M3Soft." & sContraseña)
+ usu.SHA1Passwd = sSHA1passwd
+ End If
+ End If
+ Dim vp As dxwInicio = Comun.dwi
+ Dim scaler = TryCast(vp.DockLayoutManager1.LayoutTransform, ScaleTransform)
+
+ If scaler IsNot Nothing Then usu.Escala = scaler.ScaleX
+ End Sub
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim usu As usuarios
+ usu = (From p In bd.usuarios Select p Where p.idUsuario = idUsuario).First
+ Me.DataContext = usu
+ Return tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim PER = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ PER.Nuevos = False
+ Return PER
+ End Function
+
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucConciliacionBancaria.xaml b/GestionGrupoSanchoToro/ucConciliacionBancaria.xaml
new file mode 100644
index 0000000..c3a082d
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConciliacionBancaria.xaml
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucConciliacionBancaria.xaml.vb b/GestionGrupoSanchoToro/ucConciliacionBancaria.xaml.vb
new file mode 100644
index 0000000..597ce3d
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConciliacionBancaria.xaml.vb
@@ -0,0 +1,404 @@
+Imports DevExpress.Xpf.Editors
+Imports tsWPFCore
+Imports System.Data
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports Microsoft.EntityFrameworkCore
+Imports DevExpress.Xpf.Bars
+
+Imports DevExpress.Xpf.Grid
+Imports bdGrupoSanchoToro.db
+Imports bdGrupoSanchoToro.db.Utilidades
+
+Public Class ucConciliacionBancaria
+
+
+ Private bd As tscGrupoSanchoToro
+ Friend _idConciliacion As Nullable(Of Integer)
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+ Dim ra As conciliacionesbancarias
+ Dim cajas = bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja.HasValue = False AndAlso x.IBAN IsNot Nothing).OrderBy(Function(x) x.Descripcion).ToList
+ cbCaja.ItemsSource = cajas
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo OrElse _idConciliacion Is Nothing OrElse FuerzaNuevo Then
+ ra = New conciliacionesbancarias
+ Me.DataContext = ra
+ ' ra.FechaInicio = Date.Today
+ ' ra.FechaFin = Date.Today
+ ra.FechaConciliacion = Now
+ Dim TipoCajaBanco = CInt(db.cajas.TipoCajaEnum.BANCO)
+ ra.idCaja = cajas.First(Function(x) x.IBAN IsNot Nothing AndAlso x.Tipo = TipoCajaBanco).idCaja
+ ra.idUsuarioNavigation = bd.usuarios.First(Function(x) x.idUsuario = idUsuario)
+ _idConciliacion = Nothing
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ ra = bd.conciliacionesbancarias.First(Function(x) x.idConciliacion = _idConciliacion.Value)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ Me.DataContext = ra
+ ObtieneExtractosYApuntes(ra)
+ Return NuevoEstado
+
+ End Function
+
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "conciliacionesbancarias"
+ End Get
+ End Property
+
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "ConciliacionBancaria.Nuevo"
+ Else
+ Return "ConciliacionBancaria." & DirectCast(Me.DataContext, conciliacionesbancarias).idConciliacion.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Conciliación Bancaria"
+ End Get
+ End Property
+
+ Public Sub New(Optional idConciliacion As Integer? = Nothing)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ _idConciliacion = idConciliacion
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Dim Acciones As New List(Of tsWPFCore.Accion)
+ Acciones.Add(New Accion With {
+ .idAccion = 1,
+ .Descripcion = "CONCILIACIÓN AUTOMÁTICA"})
+ Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
+ If Acciones.Count > 0 Then Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
+
+ 'Dim plantillas As List(Of tsWPFCore.Plantilla) = Comun.ObtienePlantillasPorCodigo(bd, {"CONBAN"})
+ 'Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = plantillas
+ 'If plantillas.Count > 0 Then
+ ' Me.ContenedorAplicacion.bePlantilla.EditValue = plantillas.First.idPlantilla
+ 'End If
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Dim ext As conciliacionesbancarias = Me.DataContext
+ Me.docpanel.Caption = "Conciliación Bancaria " & ext.idConciliacion.ToString
+ Me.docpanel.Tag = "Conciliacion Bancaria." & ext.idConciliacion.ToString
+ Else
+ Me.docpanel.Caption = "Conciliación Bancaria Nueva"
+ Me.docpanel.Tag = "Conciliacion Bancaria.Nueva"
+ End If
+ End Sub
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRATIVOS", idUsuario)
+ End Function
+
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucExtractosBancarios)
+ Me.cbMes.ItemsSource = tsUtilidades.Utilidades.Meses
+ End Sub
+
+
+ Private Sub ObtieneExtractosYApuntes(ra As conciliacionesbancarias)
+ Try
+ If ra.FechaInicio <> DateOnly.MinValue Then
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Obteniendo Extractos Bancarios y Movimientos de caja, por favor espere ...")
+ ' Dim fechainicio As New Date(2020, 1, 1)
+ Dim iban = bd.cajas.First(Function(x) x.idCaja = ra.idCaja).IBAN
+ ' Dim aps = bd.movimientoscaja.Include(Function(x) x.conciliacionesbancarias).Include(Function(x) x.facturas).Include(Function(x) x.albaranes).Include(Function(x) x.facturasrecibidas).Where(Function(x) x.Fecha >= fechainicio AndAlso x.Tipo <> bdGrupoSanchoToro.db.TipoMovimientoEnum.CIERRE_CAJA AndAlso x.cajas.IBAN = iban AndAlso ((x.idConciliacion.HasValue = False OrElse x.Fecha <= ra.FechaFin) OrElse (x.Fecha >= ra.FechaInicio AndAlso x.Fecha <= ra.FechaFin) OrElse (x.idConciliacion = ra.idConciliacion))).ToList
+ ' Dim exts = bd.movimientosbancarios.Include(Function(x) x.conciliacionesbancarias).Where(Function(x) x.extractosbancarios.cajas.IBAN = iban AndAlso ((x.idConciliacion.HasValue = False OrElse x.FechaOperacion <= ra.FechaFin) OrElse (x.FechaOperacion >= ra.FechaInicio AndAlso x.FechaOperacion <= ra.FechaFin) OrElse (x.idConciliacion.HasValue = False OrElse x.FechaValor <= ra.FechaFin) OrElse (x.FechaValor >= ra.FechaInicio AndAlso x.FechaValor <= ra.FechaFin) OrElse (x.idConciliacion = ra.idConciliacion))).ToList
+ Dim fi As DateOnly = ra.FechaInicio
+ Dim ff = ra.FechaFin.AddDays(1)
+ Dim dfi As Date = New Date(fi.Year, fi.Month, fi.Day)
+ Dim dff As Date = New Date(ff.Year, ff.Month, ff.Day)
+ Dim aps = bd.movimientoscaja.Include(Function(x) x.idConciliacionNavigation).Include(Function(x) x.idFacturaNavigation).Include(Function(x) x.idFacturaRecibidaNavigation).Where(Function(x) x.Fecha >= dfi AndAlso x.Fecha < dff AndAlso x.Tipo <> bdGrupoSanchoToro.db.TipoMovimientoEnum.CIERRE_CAJA AndAlso x.Tipo <> bdGrupoSanchoToro.db.TipoMovimientoEnum.REGULARIZACION_CAJA AndAlso x.idCajaNavigation.IBAN = iban).ToList
+ Dim exts = bd.movimientosbancarios.Include(Function(x) x.idConciliacionNavigation).Where(Function(x) x.idExtractoBancarioNavigation.idCajaNavigation.IBAN = iban AndAlso x.FechaOperacion >= fi AndAlso x.FechaOperacion < ff).ToList
+
+ For Each ap In aps
+ ap.ConciliacionActual_TMP = ra
+ Next
+ For Each ext In exts
+ ext.ConciliacionActual_TMP = ra
+ Next
+
+ 'Dim exts = bd.movimientosbancarios.Where(Function(x) x.extractosbancarios.idCaja = ra.idCaja AndAlso ((x.idConciliacion.HasValue = False OrElse x.FechaOperacion <= ra.FechaFin) OrElse (x.FechaOperacion >= ra.FechaInicio AndAlso x.FechaOperacion <= ra.FechaFin) OrElse (x.FechaOperacion >= ra.FechaInicio AndAlso x.FechaOperacion <= ra.FechaFin) OrElse (x.idConciliacion = ra.idConciliacion))).ToList
+ gcApuntes.ItemsSource = aps
+ gcMovimientos.ItemsSource = exts
+ End If
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ Private Sub ucConciliacionBancaria_CampoActualizado(sender As Object, e As DataTransferEventArgs) Handles Me.CampoActualizado
+ Dim pts As PropiedadesTS = sender.parent.propiedadests
+ If Not pts Is Nothing Then
+ Dim ra As conciliacionesbancarias = Me.DataContext
+ Select Case pts.NombreCampo.ToLower
+ Case "año", "mes", "idcaja"
+
+ ObtieneExtractosYApuntes(ra)
+ End Select
+ End If
+ End Sub
+ Private Sub ConciliacionAutomatica()
+ Try
+ If Me.gcApuntes.ItemsSource IsNot Nothing AndAlso Me.gcMovimientos.ItemsSource IsNot Nothing Then
+ Dim ra As conciliacionesbancarias = Me.DataContext
+
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Conciliando automáticamente extractos bancarios y movimientos de caja, por favor espere ...")
+ Dim apu As List(Of movimientoscaja) = Me.gcApuntes.ItemsSource
+ Dim mov As List(Of movimientosbancarios) = Me.gcMovimientos.ItemsSource
+
+ Dim dfi = New Date(ra.FechaInicio.Year, ra.FechaInicio.Month, ra.FechaInicio.Day)
+ Dim dff = New Date(ra.FechaFin.Year, ra.FechaFin.Month, ra.FechaFin.Day).AddDays(1)
+ Dim doff = ra.FechaFin.AddDays(1)
+ Dim app = apu.Where(Function(x) x.Conciliado = False AndAlso x.Fecha >= dfi AndAlso x.Fecha < dfi).ToList
+ Dim mop = mov.Where(Function(x) x.Conciliado = False AndAlso x.FechaOperacion >= ra.FechaInicio AndAlso x.FechaOperacion < doff).ToList
+
+ If Math.Round(app.Sum(Function(x) x.Importe), 2, MidpointRounding.AwayFromZero) = Math.Round(mop.Sum(Function(x) x.Importe), 2, MidpointRounding.AwayFromZero) Then
+ For Each m In mop
+ m.Conciliado = True
+ Next
+ For Each ap In app
+ ap.Conciliado = True
+ Next
+ CalculaTotalesApuntes()
+ CalculaTotalesMovimientos()
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show("Se han conciliado todos los movimientos del mes de apuntes y movimientos bancarios", "Conciliación Automática")
+ Else
+ Dim f As DateOnly = ra.FechaInicio
+ Dim NumeroConciliados As Integer = 0
+
+ Do Until f = ra.FechaFin
+ Dim df As New Date(f.Year, f.Month, f.Day)
+ Dim apd = apu.Where(Function(x) x.Conciliado = False AndAlso x.Fecha = df).ToList
+ Dim movd = mov.Where(Function(x) x.Conciliado = False AndAlso x.FechaOperacion = f).ToList
+ Dim apdag = apd.GroupBy(Function(x) x.Importe)
+ Dim movdag = movd.GroupBy(Function(x) x.Importe)
+
+ For Each g In apdag
+ Dim ma = movdag.FirstOrDefault(Function(x) x.Count = g.Count AndAlso x.Sum(Function(y) y.Importe) = g.Sum(Function(z) z.Importe))
+ If ma IsNot Nothing Then
+ NumeroConciliados += g.Count
+ For Each m In ma
+ m.Conciliado = True
+ Next
+ For Each ap In g
+ ap.Conciliado = True
+ Next
+ End If
+ Next
+ f = f.AddDays(1)
+ Loop
+
+ Dim apm = apu.Where(Function(x) x.Conciliado = False AndAlso x.Fecha >= dfi AndAlso x.Fecha < dff).ToList
+ Dim movm = mov.Where(Function(x) x.Conciliado = False AndAlso x.FechaOperacion >= ra.FechaInicio AndAlso x.FechaOperacion < doff).ToList
+
+ Dim apsag = apm.Where(Function(x) x.Conciliado = False).GroupBy(Function(x) x.Importe)
+ Dim movsag = movm.Where(Function(x) x.Conciliado = False).GroupBy(Function(x) x.Importe)
+ For Each g In apsag
+ Dim ma = movsag.FirstOrDefault(Function(x) x.Count = g.Count AndAlso x.Sum(Function(y) y.Importe) = g.Sum(Function(z) z.Importe))
+ If ma IsNot Nothing Then
+ NumeroConciliados += g.Count
+ For Each m In ma
+ m.Conciliado = True
+ Next
+ For Each ap In g
+ ap.Conciliado = True
+ Next
+ End If
+ Next
+
+ Dim aprag = apm.Where(Function(x) x.Conciliado = False).GroupBy(Function(x) x.Importe)
+ Dim movrag = movm.Where(Function(x) x.Conciliado = False).GroupBy(Function(x) x.Importe)
+ For Each g In aprag
+ Dim ma = movrag.FirstOrDefault(Function(x) x.Count = g.Count AndAlso x.Sum(Function(y) y.Importe) = g.Sum(Function(z) z.Importe))
+ If ma IsNot Nothing Then
+ NumeroConciliados += g.Count
+ For Each m In ma
+ m.Conciliado = True
+ Next
+ For Each ap In g
+ ap.Conciliado = True
+ Next
+ End If
+ Next
+ CalculaTotalesApuntes()
+ CalculaTotalesMovimientos()
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show("Se han conciliado " & NumeroConciliados.ToString & " apuntes y movimientos bancarios", "Conciliación Automática")
+ End If
+ gcApuntes.RefreshData()
+ gcMovimientos.RefreshData()
+ Else
+ DXMessageBox.Show("No existen movimientos caja o bancarios que conciliar", "Atención")
+ End If
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ Private Sub ucConciliacionBancaria_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
+ Select Case idAccion
+ Case 1 ' CONCILIACION AUTOMÁTICA
+ ConciliacionAutomatica()
+ End Select
+ End Sub
+
+ Private Sub tvApuntes_ValidateRow(sender As Object, e As GridRowValidationEventArgs) Handles tvApuntes.ValidateRow
+ CalculaTotalesApuntes()
+ End Sub
+ Private Sub CalculaTotalesApuntes()
+ Dim ra As conciliacionesbancarias = Me.DataContext
+ Dim apuntes As List(Of movimientoscaja) = gcApuntes.ItemsSource
+ ra.TotalMovimientosCaja = apuntes.Where(Function(x) x.Conciliado).Sum(Function(x) x.Importe)
+ End Sub
+ Private Sub CalculaTotalesMovimientos()
+ Dim ra As conciliacionesbancarias = Me.DataContext
+ Dim movs As List(Of movimientosbancarios) = gcMovimientos.ItemsSource
+ ra.TotalMovimientosBancarios = movs.Where(Function(x) x.Conciliado).Sum(Function(x) x.Importe)
+ End Sub
+
+ Private Sub tvApuntes_CellValueChanging(sender As Object, e As CellValueChangedEventArgs) Handles tvApuntes.CellValueChanging
+ tvApuntes.CommitEditing()
+ CalculaTotalesApuntes()
+ End Sub
+
+ Private Sub tvMovimientos_CellValueChanging(sender As Object, e As CellValueChangedEventArgs) Handles tvMovimientos.CellValueChanging
+ tvMovimientos.CommitEditing()
+ CalculaTotalesMovimientos()
+ End Sub
+
+ Private Sub ap_ValidarControl(sender As Object, e As ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
+ Dim pts As PropiedadesTS = sender.parent.propiedadests
+ Try
+ If Not pts Is Nothing Then
+ Me.ErroresValidacion.EliminaError("validando-" & pts.NombreCampo)
+ Dim ra As conciliacionesbancarias = Me.DataContext
+ Select Case pts.NombreCampo.ToLower
+ Case "año"
+ If Not e.Value Is Nothing Then
+ Dim Valor = CInt(e.Value)
+ If Valor < 2019 OrElse Valor > 2100 Then
+ Throw New Exception("Valor del año incorrecto")
+ End If
+ End If
+ End Select
+ End If
+ Catch ex As Exception
+ Dim sCodigoError As String = "validando-"
+ If pts IsNot Nothing Then
+ sCodigoError &= pts.NombreCampo
+ End If
+ ev = New ErrorValidacion(sCodigoError, sender, ex.Message, ex, DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical)
+ e.IsValid = False
+ End Try
+ End Sub
+
+ Private Sub tvMovimientos_ShowingEditor(sender As Object, e As ShowingEditorEventArgs)
+ Dim mov As movimientosbancarios = gcMovimientos.GetRow(e.RowHandle)
+ If e.Column.FieldName.ToLower = "conciliado" Then
+ If mov.ConciliadoEn <> "" Then
+ e.Cancel = True
+ e.Handled = True
+ End If
+ End If
+ End Sub
+ 'Private Sub tvApuntes_ShowingEditor(sender As Object, e As ShowingEditorEventArgs)
+ ' Dim ap As movimientoscaja = gcApuntes.GetRow(e.RowHandle)
+ ' If e.Column.FieldName.ToLower = "conciliado" Then
+ ' If ap.ConciliadoEn <> "" Then
+ ' e.Cancel = True
+ ' e.Handled = True
+ ' End If
+ ' End If
+ 'End Sub
+
+ Private Sub ucConciliacionBancaria_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Select Case Celda.View.Name.ToLower
+ Case "tvapuntes"
+ Dim ra As movimientoscaja = Me.gcApuntes.CurrentItem
+ Dim id As Integer = ra.idConciliacionNavigation.idConciliacion
+ FuncionesDinamicas.AbrirAP(New ucConciliacionBancaria(id), OtrosParametros)
+ Case Else
+ Dim ra As movimientosbancarios = Me.gcMovimientos.CurrentItem
+ Dim id As Integer = ra.idConciliacionNavigation.idConciliacion
+ FuncionesDinamicas.AbrirAP(New ucConciliacionBancaria(id), OtrosParametros)
+ End Select
+ End Sub
+
+ Private Sub ucConciliacionBancaria_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
+ Dim ra As conciliacionesbancarias = Me.DataContext
+ Dim hte As New Hashtable
+ If Math.Round(ra.TotalMovimientosCaja, 2, MidpointRounding.AwayFromZero) <> Math.Round(ra.TotalMovimientosBancarios, 2, MidpointRounding.AwayFromZero) Then
+ If DXMessageBox.Show("La suma de los movimientos de caja no coincide con la de los extractos bancarios. ¿Desea continuar?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.No Then
+ hte.Add("Almacenar-SUMA", "La suma de los movimientos de caja debe coincidir con la de los extractos bancarios")
+ End If
+ End If
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ End If
+ End Sub
+
+ Private Sub ucConciliacionBancaria_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
+ 'Try
+ ' Dim pl = bd.plantillas.First(Function(x) x.idPlantilla = idPlantilla)
+ ' Select Case pl.Codigo
+ ' Case "CONBAN"
+ ' Dim ra As conciliacionesbancarias = Me.DataContext
+ ' Dim ds As New List(Of bdGrupoSanchoToro.db.InformeConciliacionBancaria)
+ ' Dim inf = New bdGrupoSanchoToro.db.InformeConciliacionBancaria(bd, ra.cajas.CuentaContable, ra.FechaFin)
+ ' ds.Add(inf)
+ ' Comun.ImprimirPlantilla(bd, idPlantilla, ds, False, 1)
+ ' End Select
+ 'Catch ex As Exception
+ ' DXMessageBox.Show(ex.Message, "Error")
+ 'End Try
+ End Sub
+
+ Private Sub ucConciliacionBancaria_DespuesEliminar(sender As Object) Handles Me.DespuesEliminar
+ If docpanel IsNot Nothing AndAlso tsWPFCore.Comun.dm IsNot Nothing Then tsWPFCore.Comun.dm.DockController.RemovePanel(docpanel)
+ End Sub
+
+ Private Sub ucConciliacionBancaria_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim con As conciliacionesbancarias = Me.DataContext
+ _idConciliacion = con.idConciliacion
+ End Sub
+
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucConciliacionBancariaant.xaml b/GestionGrupoSanchoToro/ucConciliacionBancariaant.xaml
new file mode 100644
index 0000000..028ae5d
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConciliacionBancariaant.xaml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucConciliacionBancariaant.xaml.vb b/GestionGrupoSanchoToro/ucConciliacionBancariaant.xaml.vb
new file mode 100644
index 0000000..c92a1e5
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConciliacionBancariaant.xaml.vb
@@ -0,0 +1,648 @@
+
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore
+Imports System.Collections
+Imports DevExpress.Xpf.Bars
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports tsEFCore8.Extensiones
+Imports Microsoft.EntityFrameworkCore
+
+Public Class ucConciliacionBancariaant
+
+ Private bd As tscGrupoSanchoToro
+
+
+
+
+ Public Overrides Sub Cargado()
+ ContenedorAplicacion.btGuardar.IsVisible = True
+ ContenedorAplicacion.btGuardar.Hint = "Conciliar movimientos seleccionados"
+ End Sub
+
+
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim cjs = bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja.HasValue = False AndAlso (x.Tipo = cajas.TipoCajaEnum.BANCO)).OrderBy(Function(x) x.Descripcion).ToList
+ Me.cbCajas.ItemsSource = cjs
+
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Conciliación Bancaria"
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "ConciliacionBancaria"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "movimientoscaja"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Conciliación Bancaria"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+
+
+ Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+
+ Dim ra = DirectCast(Me.gc.CurrentItem, movimientoscaja)
+ Select Case Celda.Column.FieldName.ToLower
+ Case "referenciadocumento"
+ Dim id As Integer
+ If ra.idFactura.HasValue Then
+ 'id = ra.idFactura
+ 'FuncionesDinamicas.AbrirAP(New ucFacturaEmitida(id), OtrosParametros)
+ Else
+ id = ra.idFacturaRecibida
+ FuncionesDinamicas.AbrirAP(New ucFacturaRecibida(id), OtrosParametros)
+
+ End If
+ Case "razonsocial"
+ Dim id As Integer
+ If ra.idFactura.HasValue Then
+ id = ra.idFacturaNavigation.idCliente
+ ElseIf ra.idFacturaRecibida.HasValue Then
+ id = ra.idFacturaRecibidaNavigation.idProveedor
+ End If
+ FuncionesDinamicas.AbrirAP(New ucEntidad(id), OtrosParametros)
+ Case "idmovimiento"
+ Dim id As Integer
+ id = ra.idMovimiento
+ FuncionesDinamicas.AbrirAP(New ucMovimientoCaja(id), OtrosParametros)
+ End Select
+
+ End Sub
+
+ Private Sub ap_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
+ tv.CommitEditing()
+
+ ' Dim aps As List(Of Apuntes) = Me.gc.ItemsSource
+ Dim ahora As DateTime = bd.AhoraMySql
+ gc.FilterCriteria = Nothing
+
+ For i = 0 To Me.gc.VisibleRowCount - 1
+ Dim rw = gc.GetRowHandleByVisibleIndex(i)
+ If Not gc.IsGroupRowHandle(rw) Then
+ EstableceConciliacion(rw, ahora)
+ Else
+ For j = 0 To gc.GetChildRowCount(rw) - 1
+ EstableceConciliacion(gc.GetChildRowHandle(rw, j), ahora)
+ Next
+ End If
+ Next
+ 'bd.GuardarCambios()
+ 'Cancelar = True
+
+ End Sub
+
+ Private Sub EstableceConciliacion(rw As Integer, ahora As DateTime)
+ Dim m As movimientoscaja
+ If Not gc.IsGroupRowHandle(rw) Then
+ m = gc.GetRow(rw)
+ If Me.tv.IsRowSelected(rw) Then
+ If m.FechaSupervision.HasValue = False Then
+ m.FechaSupervision = Now
+ End If
+ Else
+ If m.FechaSupervision.HasValue Then
+ m.FechaSupervision = Nothing
+ End If
+ End If
+ End If
+ End Sub
+ Private Sub ObtieneMovimientosCaja()
+ Try
+ Dim cjs As New List(Of Integer)
+ If cbCajas.EditValue IsNot Nothing Then
+ If cbCajas.EditValue.GetType Is GetType(List(Of Object)) Then
+ Dim locj As List(Of Object) = cbCajas.EditValue
+ For Each cj In locj
+ cjs.Add(CType(cj, Integer))
+ Next
+ Else
+ cjs = TryCast(cbCajas.EditValue, List(Of Integer))
+ End If
+ End If
+ Dim iqmv = bd.movimientoscaja.Include(Function(x) x.idUsuarioNavigation).Include(Function(x) x.idCajaNavigation).Include(Function(x) x.idFacturaNavigation.idClienteNavigation).Include(Function(x) x.idFacturaRecibidaNavigation.idProveedorNavigation).AsQueryable
+ If Not Me.cbIncluirSupervisados.IsChecked Then
+ iqmv = iqmv.Where(Function(x) x.FechaSupervision.HasValue = False)
+ End If
+ If Me.teFechaInicial.EditValue IsNot Nothing Then
+ Dim dFi As Date = Me.teFechaInicial.EditValue
+ Dim fi As New DateTime(dFi.Year, dFi.Month, dFi.Day, 0, 0, 0)
+ iqmv = iqmv.Where(Function(x) x.Fecha >= dFi)
+ End If
+ If Me.teFechaInicial.EditValue IsNot Nothing Then
+ Dim dFf As Date = Me.teFechaFinal.EditValue
+ Dim fi As New DateTime(dFf.Year, dFf.Month, dFf.Day, 0, 0, 0)
+ iqmv = iqmv.Where(Function(x) x.Fecha >= dFf)
+ End If
+ Me.gc.ItemsSource = iqmv.Where(Function(x) cjs.Contains(x.idCaja)).ToList
+ Me.DataContext = Me.gc.ItemsSource
+
+ If Me.cbIncluirSupervisados.IsChecked Then
+ For i = 0 To Me.gc.VisibleRowCount - 1
+ Dim rw = gc.GetRowHandleByVisibleIndex(i)
+ MarcaSeleccionados(rw)
+ Next
+ End If
+ Catch ex As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub MarcaSeleccionados(rw As Integer)
+ If Not gc.IsGroupRowHandle(rw) Then
+ Dim ap As movimientoscaja = gc.GetRow(rw)
+ If ap.FechaSupervision.HasValue Then
+ gc.SelectItem(rw)
+ End If
+ Else
+ For i = 0 To gc.GetChildRowCount(rw) - 1
+ MarcaSeleccionados(gc.GetChildRowHandle(rw, i))
+ Next
+ End If
+ End Sub
+
+
+ Private Sub btBuscar_Click(sender As Object, e As RoutedEventArgs)
+ ObtieneMovimientosCaja()
+ End Sub
+End Class
+
+'Public Class ucConciliacionBancaria
+'
+
+' Dim bd As tscGrupoSanchoToro
+' Private WithEvents ApLineas As tsWPFCore.ApLineas
+' ' Private ListadoCajas As List(Of Integer)
+' Private DatosCargados As Boolean
+' Private TotalPagado As Double
+' Private TotalDevuelto As Double
+' Private TotalPagadoAgrupado As Double
+' Private TotalDevueltoAgrupado As Double
+' Private ApuntesAGuardar As List(Of Integer)
+' Private idCajs() As Integer
+' Private cajs As List(Of cajas)
+
+
+' Private Sub ApLineas_Cargado() Handles ApLineas.Cargado
+' Me.tv.AllowEditing = True
+' ' Me.gcSupervisado.AllowEditing = DevExpress.Utils.DefaultBoolean.True
+' Me.ApLineas.ContenedorL.btEliminar.IsVisible = False
+' Me.ApLineas.ContenedorL.btNuevo.IsVisible = False
+' Me.ApLineas.ContenedorL.btInvertir.IsVisible = False
+' Me.ApLineas.ContenedorL.btSeleccionar.IsVisible = False
+' Dim biguardar As DevExpress.Xpf.Bars.BarButtonItem
+' biguardar = New DevExpress.Xpf.Bars.BarButtonItem
+' biguardar.Name = "btGuardarConciliacion"
+' biguardar.Glyph = New BitmapImage(New Uri("pack://application:,,,/DevExpress.Images.v16.2;component/GrayScaleImages/Save/Save_16x16.png"))
+' biguardar.Hint = "Guardar"
+' biguardar.IsEnabled = True
+' Me.ApLineas.ContenedorL.BarraBotones.Items.Add(biguardar)
+' Dim ilGuardar As New DevExpress.Xpf.Bars.BarButtonItemLink()
+' ilGuardar.Name = "ilGuardar"
+' ilGuardar.BarItemName = biguardar.Name
+' Me.ApLineas.ContenedorL.BarraBotones.Bars(0).ItemLinks.Insert(0, ilGuardar)
+' AddHandler biguardar.ItemClick, AddressOf Guardar_ItemClick
+
+' End Sub
+
+
+' Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles ApLineas.Enlazar
+' 'Select Case Celda.Column.FieldName.ToLower
+' ' Case "numerorecibo"
+' Dim rec As Apuntes = Celda.RowData.Row
+' Dim ucf As New ucFactura
+' Dim dwi As dxwInicio = Window.GetWindow(Me)
+' If rec.NumeroRecibo IsNot Nothing Then
+' Comun.AbrirUcCL(ucf, dwi.grupodoc, Nothing, Me.ApLineas.dcfg, Me.ApLineas.dcn, 0, Me.ApLineas.dsc, Me.ApLineas.OtrosParametros, bd.recibos.First(Function(x) x.idrecibo = rec.NumeroRecibo).idFactura)
+' End If
+' ' End Select
+' End Sub
+
+
+' Public Sub EstableceDataContext(ByRef DataContext As Object, Optional BackGround As Boolean = False) Implements tsWPFCore.IApLineas.EstableceDataContext
+' Try
+' If Not DatosCargados Then
+' cajs = (From c In bd.cajas Where c.FechaBaja Is Nothing AndAlso c.enumeraciones.Codigo <> "TIPCAJ.METALICO" Order By c.Descripcion).ToList
+' For i = cajs.Count - 1 To 0 Step -1
+' If Comun.ObtienePermisos(bd, cajs(i).idPermiso, ApLineas.dsc.idUsuario).Otros = False Then
+' cajs.Remove(cajs(i))
+' End If
+' Next
+' If cajs.Count > 0 Then
+' If Comun.idCajaPredeterminada Is Nothing Then
+' If cajs.Count = 1 Then Comun.idCajaPredeterminada = cajs.First.idCaja
+' Else
+' If cajs.Where(Function(c) c.idCaja = Comun.idCajaPredeterminada).Count = 0 Then
+' Comun.idCajaPredeterminada = cajs.First.idCaja
+' End If
+' End If
+' Dim cj As cajas = (From c In bd.cajas Select c Where c.idCaja = Comun.idCajaPredeterminada).First
+' End If
+' idCajs = cajs.Select(Function(x) x.idCaja).ToArray
+' ' Me.cbCaja.ItemsSource = cajs
+' ' ListadoCajas = (From c In cajs Select c.idCaja).ToList
+' 'If Comun.idCajaPredeterminada IsNot Nothing Then
+' ' Me.cbCaja.EditValue = Comun.idCajaPredeterminada
+' 'Else
+' ' Me.cbCaja.EditValue = cajs.First
+' 'End If
+' End If
+' ' Me.teFechaFinal.EditValue = Now
+' ' Me.teFechaInicial.EditValue = Now
+
+' DatosCargados = True
+' ObtieneApuntes()
+
+' DataContext = Me.gc.DataContext
+
+' Catch ex As Exception
+' DXMessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
+' End Try
+' End Sub
+
+' Public ReadOnly Property NombreTablaBase As String Implements tsWPFCore.IApLineas.NombreTablaBase
+' Get
+' Return ""
+' End Get
+' End Property
+
+' Public ReadOnly Property CampoIndice As String Implements IAplicacion.CampoIndice
+' Get
+' Throw New NotImplementedException()
+' End Get
+' End Property
+
+' Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+' Get
+' Throw New NotImplementedException()
+' End Get
+' End Property
+
+' Public Overrides ReadOnly Property DescripcionRegistro As String
+' Get
+' Throw New NotImplementedException()
+' End Get
+' End Property
+
+' Private ReadOnly Property IAplicacion_NombreTablaBase As String Implements IAplicacion.NombreTablaBase
+' Get
+' Throw New NotImplementedException()
+' End Get
+' End Property
+
+' Public Sub Nuevo() Implements tsWPFCore.IApLineas.Nuevo
+
+
+' End Sub
+
+
+' Public Function ObtieneRejilla() As tsWPFCore.tsGridControl Implements tsWPFCore.IApLineas.ObtieneRejilla
+' Return Me.gc
+' End Function
+
+' Public Sub EstableceApLin(ApLin As tsWPFCore.ApLineas) Implements tsWPFCore.IApLineas.EstableceApLin
+' Me.ApLineas = ApLin
+' End Sub
+
+' Public Function ObtieneContexto(dcn As tsUtilidades.Datos.DatosConexionCliente) As System.Data.Objects.ObjectContext Implements tsWPFCore.IApLineas.ObtieneContexto
+' bd = bdM3Academy.Utilidades.NuevaConexion(dcn.BasesDatos(0))
+' Return bd
+' End Function
+
+' Public Function ObtienePermisos() As tsUtilidades.Permisos Implements tsWPFCore.IApLineas.ObtienePermisos
+' Return Comun.ObtienePermisos(Me.bd, "AP.CONCILIACIONBANCARIA", Me.ApLineas.dsc.idUsuario)
+' End Function
+
+' Public Function ObtieneCampoIndice() As String Implements tsWPFCore.IApLineas.ObtieneCampoIndice
+' Return ""
+' End Function
+
+
+' 'Private Sub ApLineas_ImprimirPlantilla(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs, idPlantilla As Integer) Handles ApLineas.ImprimirPlantilla
+' ' Try
+' ' Dim ds As Object = ObtieneDataSource()
+' ' Informes.MuestraImpresos(bd, idPlantilla, ds, Me.ApLineas.GrupoDocumentos, tsWPFCore.ApCabLin.dm.DockController)
+' ' Catch EX As Exception
+' ' DXMessageBox.Show(EX.Message, "Atención", MessageBoxButton.OK)
+' ' End Try
+' 'End Sub
+
+' Private Sub ObtieneApuntes()
+' Try
+' If DatosCargados Then
+' ApuntesAGuardar = New List(Of Integer)
+' Dim iNumeroApuntes As Integer
+' Dim ierecs As IEnumerable(Of recibos)
+' Dim recs As List(Of recibos)
+
+' Dim lm As New List(Of Apuntes)
+
+' Dim m As Apuntes
+' ' Dim idCaja As Integer? = DirectCast(Me.cbCaja.EditValue, Integer)
+' Dim dIngresosp, dGastosp As Double
+' If idCajs.Count > 0 Then
+' ierecs = (From r In bd.recibos Where idCajs.Contains(r.idCaja))
+' If Me.teFechaInicial.EditValue IsNot Nothing Then
+' Dim dFi As Date = Me.teFechaInicial.EditValue
+' Dim fi As New DateTime(dFi.Year, dFi.Month, dFi.Day, 0, 0, 0)
+' ierecs = (From r In ierecs Where r.FechaPago >= dFi)
+' End If
+' If Me.teFechaFinal.EditValue IsNot Nothing Then
+' Dim dFf As Date = Me.teFechaFinal.EditValue
+' Dim ff As New DateTime(dFf.Year, dFf.Month, dFf.Day, 23, 59, 59)
+' ierecs = (From r In ierecs Where r.FechaPago <= dFf)
+' End If
+' If Not Me.cbIncluirSupervisados.IsChecked Then
+' ierecs = (From r In ierecs Where r.Supervisado = False)
+' End If
+' recs = ierecs.ToList
+' For Each r In recs
+' iNumeroApuntes += 1
+' m = New Apuntes
+' m.Caja = cajs.First(Function(x) x.idCaja = r.idCaja).Descripcion
+' If r.facturas.Mes IsNot Nothing Then
+' m.Descripcion = "Recibo de " & r.facturas.RazonSocial & " Mensualidad: " & tsUtilidades.Utilidades.MesCastellano(r.facturas.Mes Mod 100) & " " & (r.facturas.Mes \ 100).ToString
+' Else
+' m.Descripcion = "Recibo de " & r.facturas.RazonSocial
+' End If
+' m.Fecha = r.FechaPago.Date
+' m.ImporteEntrada = r.Importe
+' m.ImporteSalida = 0
+' m.NumeroRecibo = r.idrecibo
+' m.Tipo = TipoMovimiento.RECIBO
+' m.Usuario = If(r.usuarios Is Nothing, "", r.usuarios.Nombre)
+' m.idApunte = iNumeroApuntes
+' ' m.Supervisado = r.Supervisado
+' m.FechaSupervision = r.FechaSupervision
+' m.idMovimientoORecibo = r.idrecibo
+' lm.Add(m)
+' Next
+' dIngresosp = recs.Sum(Function(x) x.Importe)
+
+
+' ierecs = (From r In bd.recibos Where idCajs.Contains(r.idCaja) AndAlso r.FechaDevolucion IsNot Nothing)
+' If Me.teFechaInicial.EditValue IsNot Nothing Then
+' Dim dFi As Date = Me.teFechaInicial.EditValue
+' Dim fi As New DateTime(dFi.Year, dFi.Month, dFi.Day, 0, 0, 0)
+' ierecs = (From r In ierecs Where r.FechaDevolucion >= dFi)
+' End If
+' If Me.teFechaFinal.EditValue IsNot Nothing Then
+' Dim dFf As Date = Me.teFechaFinal.EditValue
+' Dim ff As New DateTime(dFf.Year, dFf.Month, dFf.Day, 23, 59, 59)
+' ierecs = (From r In ierecs Where r.FechaDevolucion <= dFf)
+' End If
+' If Not Me.cbIncluirSupervisados.IsChecked Then
+' ierecs = (From r In ierecs Where r.DevolucionSupervisada = False)
+' End If
+' recs = ierecs.ToList
+' For Each r In recs
+' iNumeroApuntes += 1
+' m = New Apuntes
+' m.Caja = cajs.First(Function(x) x.idCaja = r.idCaja).Descripcion
+' If r.facturas.Mes IsNot Nothing Then
+' m.Descripcion = "Devolución Recibo de " & r.facturas.RazonSocial & " Mensualidad: " & tsUtilidades.Utilidades.MesCastellano(r.facturas.Mes Mod 100) & " " & (r.facturas.Mes \ 100).ToString
+' Else
+' m.Descripcion = "Devolución Recibo de " & r.facturas.RazonSocial
+' End If
+' m.Fecha = r.FechaDevolucion.Value.Date
+' m.ImporteEntrada = 0
+' m.ImporteSalida = r.Importe
+' m.NumeroRecibo = r.idrecibo
+' m.Tipo = TipoMovimiento.DEVOLUCION_RECIBO
+' m.Usuario = If(r.usuarios1 Is Nothing, "", r.usuarios1.Nombre)
+' m.idApunte = iNumeroApuntes
+' ' m.Supervisado = r.DevolucionSupervisada
+' m.FechaSupervision = r.FechaSupervisionDevolucion
+' m.idMovimientoORecibo = r.idrecibo
+' lm.Add(m)
+' Next
+' dGastosp = recs.Sum(Function(x) x.Importe)
+
+' Dim iemovs As IEnumerable(Of movimientoscaja)
+' Dim movs As List(Of movimientoscaja)
+' iemovs = (From mv In bd.movimientoscaja Where idCajs.Contains(mv.idCaja) AndAlso mv.Tipo <> TipoMovimiento.APERTURA AndAlso mv.Tipo <> TipoMovimiento.CIERRE)
+
+' ' ierecs = (From r In bd.recibos Where r.idCaja = idCaja AndAlso r.FechaDevolucion IsNot Nothing)
+' If Me.teFechaInicial.EditValue IsNot Nothing Then
+' Dim dFi As Date = Me.teFechaInicial.EditValue
+' Dim fi As New DateTime(dFi.Year, dFi.Month, dFi.Day, 0, 0, 0)
+' iemovs = (From mv In iemovs Where mv.Fecha >= dFi)
+' End If
+' If Me.teFechaFinal.EditValue IsNot Nothing Then
+' Dim dFf As Date = Me.teFechaFinal.EditValue
+' Dim ff As New DateTime(dFf.Year, dFf.Month, dFf.Day, 23, 59, 59)
+' iemovs = (From mv In iemovs Where mv.Fecha <= dFf)
+' End If
+' If Not Me.cbIncluirSupervisados.IsChecked Then
+' iemovs = (From mv In iemovs Where mv.Supervisado = False)
+' End If
+' movs = iemovs.ToList
+' For Each mc In movs
+' iNumeroApuntes += 1
+' m = New Apuntes
+' m.Caja = cajs.First(Function(x) x.idCaja = mc.idCaja).Descripcion
+' m.Descripcion = mc.Descripcion
+' m.Fecha = mc.Fecha.Value.Date
+' m.ImporteSalida = mc.ImporteSalida
+' m.ImporteEntrada = mc.ImporteEntrada
+' m.Tipo = mc.Tipo
+' 'Select Case mc.Tipo
+' ' Case "INGRESO"
+' ' m.Tipo = TipoMovimiento.INGRESO
+' ' Case "GASTO"
+' ' m.Tipo = TipoMovimiento.GASTO
+' ' Case "APERTURA"
+' ' m.Tipo = TipoMovimiento.APERTURA
+' ' Case "CIERRE"
+' ' m.Tipo = TipoMovimiento.CIERRE
+' ' Case "DEVOLUCION RECIBO"
+' ' m.Tipo = TipoMovimiento.DEVOLUCION_RECIBO
+' ' Case "TRASPASO"
+' ' m.Tipo = TipoMovimiento.TRASPASO
+' 'End Select
+' m.Usuario = mc.usuarios.Nombre
+' m.idApunte = iNumeroApuntes
+' ' m.Supervisado = mc.Supervisado
+' m.FechaSupervision = mc.FechaSupervision
+' m.idMovimientoORecibo = mc.idMovimiento
+' lm.Add(m)
+' Next
+' dIngresosp += movs.Sum(Function(x) x.ImporteEntrada)
+' dGastosp += movs.Sum(Function(x) x.ImporteSalida)
+' If idCajs.Count > 0 Then
+' recs = (From r In bd.recibos Where idCajs.Contains(r.idCaja) AndAlso r.idMovimientoCierre Is Nothing).ToList
+' Dim imprecs As Double? = recs.Sum(Function(r) r.Importe)
+' Dim recdevs = (From r In bd.recibos Where idCajs.Contains(r.idCaja) AndAlso r.idMovimientoCierreDevolucion Is Nothing AndAlso r.FechaDevolucion IsNot Nothing).ToList
+' Dim imprecdevs As Double? = recdevs.Sum(Function(r) r.Importe)
+' Dim mvs = (From mv In bd.movimientoscaja Where idCajs.Contains(mv.idCaja) AndAlso mv.idMovimientoCierre Is Nothing AndAlso mv.Tipo <> TipoMovimiento.CIERRE)
+' Dim dImporteMovEnt As Double? = mvs.Sum(Function(mv) mv.ImporteEntrada)
+' Dim dImporteMovSal As Double? = mvs.Sum(Function(mv) mv.ImporteSalida)
+' Dim dIngresos As Double = If(dImporteMovEnt, 0) + If(imprecs, 0)
+' Dim dGastos As Double = If(dImporteMovSal, 0) + If(imprecdevs, 0)
+' 'Me.teSaldoActual.EditValue = dIngresos - dGastos
+' 'Me.teIngresos.EditValue = dIngresosp
+' 'Me.teGastos.EditValue = dGastosp
+' Else
+' 'Me.teSaldoActual.EditValue = 0
+' 'Me.teIngresos.EditValue = 0
+' 'Me.teGastos.EditValue = 0
+' End If
+' lm = lm.OrderBy(Function(x) x.Fecha).ThenBy(Function(x) x.idApunte).ToList
+' Else
+' Throw New Exception("Seleccione primero la caja")
+' End If
+' Me.gc.ItemsSource = lm
+
+
+
+' For i = 0 To Me.gc.VisibleRowCount - 1
+' Dim rw = gc.GetRowHandleByVisibleIndex(i)
+' MarcaSeleccionados(rw)
+' Next
+
+' End If
+' Catch ex As Exception
+' Throw New Exception(ex.Message, ex)
+' End Try
+' End Sub
+' Private Sub MarcaSeleccionados(rw As Integer)
+' If Not gc.IsGroupRowHandle(rw) Then
+' Dim ap As Apuntes = gc.GetRow(rw)
+' If ap.FechaSupervision.HasValue Then
+' gc.SelectItem(rw)
+' End If
+' Else
+' For i = 0 To gc.GetChildRowCount(rw) - 1
+' MarcaSeleccionados(gc.GetChildRowHandle(rw, i))
+' Next
+' End If
+' End Sub
+
+' Private Sub teFechaInicial_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs) Handles teFechaInicial.EditValueChanged
+' ObtieneApuntes()
+' Me.DataContext = Me.gc.ItemsSource
+' End Sub
+
+' Private Sub teFechaFinal_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs) Handles teFechaFinal.EditValueChanged
+' ObtieneApuntes()
+' Me.DataContext = Me.gc.ItemsSource
+' End Sub
+
+
+
+' Private Sub cbIncluirSupervisados_Checked(sender As Object, e As RoutedEventArgs)
+' ObtieneApuntes()
+' Me.DataContext = Me.gc.ItemsSource
+' End Sub
+
+' Private Sub cbIncluirSupervisados_Unchecked(sender As Object, e As RoutedEventArgs)
+' ObtieneApuntes()
+' Me.DataContext = Me.gc.ItemsSource
+' End Sub
+
+' Private Sub Guardar_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
+' tv.CommitEditing()
+
+' ' Dim aps As List(Of Apuntes) = Me.gc.ItemsSource
+' Dim ahora As DateTime = Comun.AhoraMysql(bd)
+' gc.FilterCriteria = Nothing
+
+' For i = 0 To Me.gc.VisibleRowCount - 1
+' Dim rw = gc.GetRowHandleByVisibleIndex(i)
+' If Not gc.IsGroupRowHandle(rw) Then
+' EstableceConciliacion(rw, ahora)
+' Else
+' For j = 0 To gc.GetChildRowCount(rw) - 1
+' EstableceConciliacion(gc.GetChildRowHandle(rw, j), ahora)
+' Next
+' End If
+' Next
+
+
+
+' bd.GuardarCambios()
+' EstableceDataContext(Me.DataContext)
+' End Sub
+
+' Private Sub EstableceConciliacion(rw As Integer, ahora As DateTime)
+' Dim ap As Apuntes
+' Dim r As recibos
+' Dim m As movimientoscaja
+
+' If Not gc.IsGroupRowHandle(rw) Then
+' ap = gc.GetRow(rw)
+' Select Case ap.Tipo
+' Case TipoMovimiento.RECIBO
+' r = bd.recibos.First(Function(x) x.idrecibo = ap.idMovimientoORecibo)
+' If Me.tv.IsRowSelected(rw) Then
+' If Not r.Supervisado Then
+' r.Supervisado = True
+' r.FechaSupervision = ahora
+' End If
+' Else
+' If r.Supervisado Then
+' r.Supervisado = False
+' r.FechaSupervision = Nothing
+' End If
+' End If
+' Case TipoMovimiento.DEVOLUCION_RECIBO
+' r = bd.recibos.First(Function(x) x.idrecibo = ap.idMovimientoORecibo)
+' If Me.tv.IsRowSelected(rw) Then
+' If Not r.DevolucionSupervisada Then
+' r.DevolucionSupervisada = True
+' r.FechaSupervisionDevolucion = ahora
+' End If
+' Else
+' If r.DevolucionSupervisada Then
+' r.DevolucionSupervisada = False
+' r.FechaSupervisionDevolucion = Nothing
+' End If
+' End If
+' Case Else
+' m = bd.movimientoscaja.First(Function(x) x.idMovimiento = ap.idMovimientoORecibo)
+' If Me.tv.IsRowSelected(rw) Then
+' If Not m.Supervisado Then
+' m.Supervisado = True
+' m.FechaSupervision = ahora
+' End If
+' Else
+' If m.Supervisado Then
+' m.Supervisado = False
+' m.FechaSupervision = Nothing
+' End If
+' End If
+' End Select
+
+
+' End If
+' End Sub
+
+'End Class
diff --git a/GestionGrupoSanchoToro/ucConciliacionesBancaria.xaml b/GestionGrupoSanchoToro/ucConciliacionesBancaria.xaml
new file mode 100644
index 0000000..a177180
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConciliacionesBancaria.xaml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucConciliacionesBancaria.xaml.vb b/GestionGrupoSanchoToro/ucConciliacionesBancaria.xaml.vb
new file mode 100644
index 0000000..410698f
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConciliacionesBancaria.xaml.vb
@@ -0,0 +1,170 @@
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core.ServerMode
+Imports bdGrupoSanchoToro.db
+
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports DevExpress.Xpf.Grid
+Imports DevExpress.Xpf.Core
+Imports System.Linq.Dynamic
+Imports tsUtilidades.Datos
+Imports tsWPFCore
+Imports DevExpress.Xpf.Bars
+Imports System.Linq.Dynamic.Core
+Public Class ucConciliacionesBancarias
+
+ Dim bd As tscGrupoSanchoToro
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Conciliaciones Bancarias"
+ End Sub
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "ConciliacionesBancarias"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Conciliación Bancaria"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "conciliacionesbancarias"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+
+
+ Public Overrides Sub Cargado()
+ Me.HabilitarRefresco = True
+ deFechaInicio.EditValue = Now.AddMonths(-4)
+ deFechaFin.EditValue = Now
+ GridBusqueda = Me.gc
+ End Sub
+
+
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ If Refrescar OrElse Background Then ObtieneConciliacionesAsync(bd, Background)
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+ 'Public Overrides Function ObtieneConexionBD() As BBDD
+ ' Return bdGrupoSanchoToro.db.tscGrupoSanchoToro.bdga
+ 'End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+
+
+ Public Sub New()
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+
+
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+ Public Function ObtieneConciliaciones(ByRef DataContext As Object, BackGround As Boolean, TextoBusqueda As String, FechaInicio As DateOnly?, FechaFin As DateOnly?) As List(Of conciliacionesbancarias)
+ Dim rs As IQueryable(Of conciliacionesbancarias)
+ Dim iNumExc As Integer = 0
+
+ Do
+ Try
+ rs = bd.conciliacionesbancarias.Include(Function(x) x.idCajaNavigation).AsQueryable
+ If TextoBusqueda <> "" Then
+ Dim parametros(0) As Object
+ Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, {"idConciliacion"}, {"idCajaNavigation.Descripcion", "idCajaNavigation.IBAN"}, Nothing)
+ rs = rs.Where(ExpresionBusqueda)
+ End If
+ If FechaInicio.HasValue Then
+ rs = rs.Where(Function(x) x.FechaFin >= FechaInicio.Value)
+ End If
+ If FechaFin.HasValue Then
+ Dim ff As DateOnly = FechaFin.Value.AddDays(1)
+ 'Dim ff As DateTime = Now
+ rs = rs.Where(Function(x) x.FechaInicio < ff)
+ End If
+ Exit Do
+ Catch ex As Exception
+ iNumExc += 1
+ If iNumExc > 3 Then
+ rs = Nothing
+ Exit Do
+ End If
+ End Try
+ Loop
+ If rs IsNot Nothing Then
+ Return rs.ToList
+ Else
+ Return Nothing
+ End If
+ End Function
+
+ Public Async Sub ObtieneConciliacionesAsync(bd As tscGrupoSanchoToro, Background As Boolean)
+ Try
+
+
+ Dim rs As New List(Of conciliacionesbancarias)
+ Dim fi, ff As DateOnly?
+ Dim Busqueda As String
+
+ Busqueda = Me.teBusqueda.Text.Trim
+ fi = If(deFechaInicio.EditValue Is Nothing, Nothing, DateOnly.FromDateTime(deFechaInicio.EditValue))
+ ff = If(deFechaFin.EditValue Is Nothing, Nothing, DateOnly.FromDateTime(deFechaFin.EditValue))
+
+ If Background Then
+ Me.ContenedorAplicacion.IsEnabled = False
+ Await Task.Run(Sub()
+ rs = ObtieneConciliaciones(bd, Background, Busqueda, fi, ff)
+ End Sub)
+ Else
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Buscando Extractos ...")
+ rs = ObtieneConciliaciones(bd, Background, Busqueda, fi, ff)
+ End If
+
+ gc.ItemsSource = rs
+ DataContext = rs
+
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ Me.ContenedorAplicacion.IsEnabled = True
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+ Private Sub Nuevo() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucConciliacionBancaria, OtrosParametros)
+ End Sub
+ Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim id As Integer = DirectCast(Me.gc.CurrentItem, conciliacionesbancarias).idConciliacion
+ FuncionesDinamicas.AbrirAP(New ucConciliacionBancaria(id), OtrosParametros)
+ End Sub
+
+ Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
+ ObtieneConciliacionesAsync(bd, False)
+ End Sub
+
+
+End Class
+
diff --git a/GestionGrupoSanchoToro/ucConfiguracion.xaml b/GestionGrupoSanchoToro/ucConfiguracion.xaml
new file mode 100644
index 0000000..be555c2
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConfiguracion.xaml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucConfiguracion.xaml.bak b/GestionGrupoSanchoToro/ucConfiguracion.xaml.bak
new file mode 100644
index 0000000..91f58f1
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConfiguracion.xaml.bak
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucConfiguracion.xaml.vb b/GestionGrupoSanchoToro/ucConfiguracion.xaml.vb
new file mode 100644
index 0000000..588f262
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucConfiguracion.xaml.vb
@@ -0,0 +1,90 @@
+Imports tsWPFCore
+Imports bdGrupoSanchoToro.db
+Imports System.Collections
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports DevExpress.Xpf.Bars
+
+Public Class ucConfiguracion
+
+
+ Private bd As tscGrupoSanchoToro
+ Public Overrides Sub Cargado()
+ Dim kk As New ucConfiguracion
+ End Sub
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim enIVA = bd.enumeraciones.First(Function(X) X.Codigo = "PIVA.DEFECTO")
+ Dim enEAS = bd.enumeraciones.First(Function(x) x.Codigo = "CONF.EMAILASESORIA")
+ Dim enECO = bd.enumeraciones.First(Function(x) x.Codigo = "CONF.EMAILCOPIAOCULTA")
+ Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ 'ilIVA.DataContext = enIVA
+ liEmailAsesoria.DataContext = enEAS
+ liEmailCopiaOculta.DataContext = enECO
+ DataContext = cta
+ Return tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+
+ Me.docpanel.Caption = "Configuración"
+ Me.docpanel.Tag = "Configuración"
+
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "Configuracion"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "enumeraciones"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Configuración"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim per = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ per.Nuevos = False
+ per.Exportar = False
+ per.Eliminar = False
+ per.Impresion = False
+ Return per
+ End Function
+
+
+
+
+
+ Public Sub New()
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+ Private Sub ucConfiguracion_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ ' bdGrupoSanchoToro.db.Utilidades.PorcentajeIva = bd.enumeraciones.First(Function(x) x.Codigo = "PIVA.DEFECTO").ValorNumerico1.Value
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucCorreos.xaml b/GestionGrupoSanchoToro/ucCorreos.xaml
new file mode 100644
index 0000000..3d50bef
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucCorreos.xaml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucCorreos.xaml.vb b/GestionGrupoSanchoToro/ucCorreos.xaml.vb
new file mode 100644
index 0000000..c0d4d69
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucCorreos.xaml.vb
@@ -0,0 +1,202 @@
+
+Imports bdGrupoSanchoToro.db
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore
+Imports System.Collections
+Imports DevExpress.Xpf.Bars
+Imports System.Threading.Tasks
+Imports System.Linq.Dynamic
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+
+
+Public Class ucCorreos
+
+ Private bd As tscGrupoSanchoToro
+
+
+
+
+ 'Public Sub New(ListadoFiltrado As List(Of v_albaranesextendido), TextoBusqueda As String, TituloCamposBusqueda As String, CamposBusquedaAlfabeticos() As String, CamposBusquedaNumericos() As String)
+
+ ' InitializeComponent()
+ ' _ListadoFiltrado = ListadoFiltrado
+ ' Me.BusquedaRapida.Visibility = Visibility.Visible
+ ' 'Me.FiltrosAvanzados.Visibility = Visibility.Collapsed
+ ' Me.teBusqueda.Text = TextoBusqueda
+ ' Me.tbCamposBusqueda.Text = TituloCamposBusqueda
+ ' _CamposBusquedaAlfabeticos = CamposBusquedaAlfabeticos
+ ' _CamposBusquedaNumericos = CamposBusquedaNumericos
+ ' _TextoBusqueda = TextoBusqueda
+
+ 'End Sub
+
+ Public Sub New()
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+ ' Me.BusquedaRapida.Visibility = Visibility.Collapsed
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+ Public Overrides Sub Cargado()
+ ContenedorAplicacion.btGuardar.IsVisible = False
+ ContenedorAplicacion.siEstado.IsVisible = False
+ GridBusqueda = Me.gcCorreos
+ 'Dim Hoy = Date.Today
+ 'teFechaFin.EditValue = Hoy
+ 'teFechaInicio.EditValue = New Date(Hoy.Year, 1, 1)
+ End Sub
+
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Try
+ If Background OrElse Refrescar Then ObtieneCorreosAsync(bd, Background)
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ Catch ex As Exception
+ Throw New Exception(ex.Message, ex)
+ End Try
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Correos"
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "Correos"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "correos"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "correos"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+
+ Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim ra = DirectCast(Me.gcCorreos.CurrentItem, correos)
+ Select Case Celda.Column.FieldName.ToLower
+ Case "ficheroadjunto"
+ Dim co As correos = gcCorreos.CurrentItem
+ Dim b() = co.idFicheroAdjuntoNavigation.Fichero
+ Dim nf = tsUtilidades.Utilidades.ObtieneFicheroAleatorio(IO.Path.GetExtension(co.idFicheroAdjuntoNavigation.NombreFichero))
+ IO.File.WriteAllBytes(nf, b)
+ tsUtilidades.Sistema.EjecutaFichero(nf)
+ End Select
+ End Sub
+
+ Public Function ObtieneCorreos(ByRef DataContext As Object, TextoBusqueda As String, FechaInicio As Date?, FechaFin As Date?) As List(Of correos)
+ Dim rs As IQueryable(Of correos)
+ Dim la As New List(Of correos)
+ Dim iNumExc As Integer = 0
+ Do
+ Try
+ If TextoBusqueda <> "" Then
+ Dim parametros(0) As Object
+ Dim CamposBusquedaAlfabeticos() As String = {"Destinatario", "Asunto", "Cuerpo"}
+ Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Nothing, CamposBusquedaAlfabeticos, Nothing)
+ rs = bd.correos.Where(ExpresionBusqueda)
+ Else
+ rs = bd.correos.AsQueryable
+ End If
+
+ If FechaInicio.HasValue Then
+ rs = rs.Where(Function(x) x.FechaCreacion >= FechaInicio.Value)
+ End If
+ If FechaFin.HasValue Then
+ FechaFin = FechaFin.Value.AddDays(1)
+ rs = rs.Where(Function(x) x.FechaCreacion < FechaFin.Value)
+ End If
+ la = rs.Include(Function(x) x.idUsuarioNavigation).OrderByDescending(Function(x) x.FechaCreacion).ToList
+ Exit Do
+ Catch ex As Exception
+ iNumExc += 1
+ If iNumExc > 3 Then
+ rs = Nothing
+ Exit Do
+ End If
+ End Try
+ Loop
+ Return la
+ End Function
+
+ Public Async Sub ObtieneCorreosAsync(bd As tscGrupoSanchoToro, Background As Boolean)
+ Try
+ Dim rs As New List(Of correos)
+ Dim Busqueda = tsEFCore8.Extensiones.ObjetoNothingAVacio(Me.teBusqueda.EditValue)
+ Dim fi As Date? = teFechaInicio.EditValue
+ Dim ff As Date? = teFechaFin.EditValue
+ If Background Then
+ Me.ContenedorAplicacion.IsEnabled = False
+ Await Task.Run(Sub()
+ rs = ObtieneCorreos(bd, Busqueda, fi, ff)
+ End Sub)
+ Else
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Buscando Correos ...")
+ rs = ObtieneCorreos(bd, Busqueda, fi, ff)
+ End If
+
+ gcCorreos.ItemsSource = rs
+ DataContext = rs
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ Me.ContenedorAplicacion.IsEnabled = True
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+ Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
+ ObtieneCorreosAsync(bd, False)
+ End Sub
+
+ Private Sub ucalbaranes_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ teBusqueda.SelectAll()
+ End Sub
+
+ Private Sub cbIncluirTodos_Checked(sender As Object, e As RoutedEventArgs)
+ Dim Hoy = Date.Today
+ If teFechaFin.EditValue Is Nothing Then teFechaFin.EditValue = Hoy
+ If teFechaInicio.EditValue Is Nothing Then teFechaInicio.EditValue = New Date(Hoy.Year, 1, 1)
+ End Sub
+
+ 'Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles ImprimirPlantilla
+ ' Dim ds As List(Of albaranes)
+ ' Dim pl As plantillas = (From p In bd.plantillas Where p.idPlantilla = idPlantilla).First
+ ' Dim sTipo As String = pl.enumeraciones.Codigo
+ ' Dim al As albaranes = Me.DataContext
+ ' ds = New List(Of albaranes)
+ ' ds.Add(al)
+ ' Select Case sTipo
+ ' Case "GRUPLA.AV-ALBARANES"
+ ' Informes.ImprimirPlantilla(bd, idPlantilla, ds, False)
+ ' End Select
+ 'End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucEntidad.xaml b/GestionGrupoSanchoToro/ucEntidad.xaml
new file mode 100644
index 0000000..2819f71
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucEntidad.xaml
@@ -0,0 +1,400 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucEntidad.xaml.bak b/GestionGrupoSanchoToro/ucEntidad.xaml.bak
new file mode 100644
index 0000000..6342af4
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucEntidad.xaml.bak
@@ -0,0 +1,564 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucEntidad.xaml.vb b/GestionGrupoSanchoToro/ucEntidad.xaml.vb
new file mode 100644
index 0000000..0662898
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucEntidad.xaml.vb
@@ -0,0 +1,684 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports Microsoft.Win32
+Imports System.IO
+
+Imports tsEFCore8.Extensiones
+Imports DevExpress.Spreadsheet
+Imports tsUtilidades.Enumeraciones
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports tsUtilidades
+
+Public Class ucEntidad
+
+ Private bd As tscGrupoSanchoToro
+ Friend _idEntidad As Nullable(Of Integer)
+
+ Friend idLog As Integer?
+
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucEntidades)
+ End Sub
+
+
+ Dim ra As entidades
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+
+
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+
+ If idLog.HasValue Then
+ Try
+ Dim log = bd.logs.First(Function(x) x.idLog = idLog)
+ ra = tsUtilidades.Utilidades.DeserializarSinErrores(log.Log, GetType(entidades))
+ If ra.idUsuarioCreador.HasValue Then ra.idUsuarioCreadorNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuarioCreador.Value)
+ If ra.idUsuarioModificador.HasValue Then ra.idUsuarioModificadorNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuarioModificador.Value)
+ If bd.logs.Any(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "OBRAS") Then
+ Dim entspol = bd.logs.First(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "OBRAS")
+ Dim ld = tsUtilidades.Utilidades.deserializarsinerrores(entspol.Log, GetType(List(Of eventos)))
+ For Each d In ld
+ ra.eventos.Add(d)
+ Next
+ End If
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ Catch EX As Exception
+ Throw New Exception("No ha sido posible mostrar el registro del cambio (id " & idLog.Value.ToString & ").", EX)
+ End Try
+ Else
+ If FuerzaNuevo OrElse _idEntidad Is Nothing Then
+ ra = New entidades
+ ra.idEmpresa = db.Utilidades.EmpresaActual.idEmpresa
+ ra.FechaAlta = DateOnly.FromDateTime(Now)
+ _idEntidad = Nothing
+ ' ra.EsCliente = True
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ ra = bd.entidades.First(Function(x) x.idEntidad = _idEntidad)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ End If
+
+ gcFacturasEmitidas.ItemsSource = bd.facturas.Include(Function(x) x.idEventoNavigation.CodigoMunicipioNavigation.CodigoProvinciaNavigation).Include(Function(x) x.movimientoscaja).Where(Function(x) x.idCliente = ra.idEntidad).OrderByDescending(Function(x) x.FechaFactura).ThenByDescending(Function(x) x.NumeroFactura).ToList
+ gcFacturasRecibidas.ItemsSource = bd.facturasrecibidas.Where(Function(x) x.idProveedor = ra.idEntidad).OrderByDescending(Function(x) x.FechaFactura).ToList
+ gcExpediente.ItemsSource = ra.expedientesentidades
+ Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idEntidad AndAlso x.Aplicacion = "ENTIDADES" AndAlso x.idRelacionado Is Nothing).OrderByDescending(Function(x) x.idLog).ToList
+ Me.gcCorreos.ItemsSource = bd.correos.Where(Function(x) x.idEntidad = ra.idEntidad).OrderByDescending(Function(x) x.FechaCreacion).ToList
+ Me.DataContext = ra
+ EstableceItemsSourceProductos()
+ Return NuevoEstado
+ End Function
+
+ Private Sub EstableceItemsSourceProductos()
+ 'Try
+ ' Dim ra As entidades = Me.DataContext
+ ' Dim iqda = bd.detallesalbaranes.Include("productos").Include("albaranes").Include("facturas").Include("articulos").Include("albaranesrecogida").Where(Function(x) x.albaranes.idCliente = ra.idEntidad)
+ ' If cbSoloProductosPE.IsChecked Then
+ ' iqda = iqda.Where(Function(x) x.EsVenta = False AndAlso x.idAlbaranRecogida Is Nothing AndAlso x.FechaCancelacion.HasValue = False)
+ ' End If
+
+ ' Dim ld = iqda.OrderByDescending(Function(x) x.albaranes.Fecha).ToList
+ ' gcProductosAoV.ItemsSource = ld
+ ' gcProductosAoV.ExpandAllGroups()
+ 'Catch ex As Exception
+ ' FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ ' If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ ' DXMessageBox.Show(ex.Message, "Error")
+ 'End Try
+ End Sub
+
+ Public Overrides Function ObtieneBD() As ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "entidades"
+ End Get
+ End Property
+
+
+ 'Public Overrides ReadOnly Property CampoIndice As String
+ ' Get
+ ' Return "idEntidad"
+ ' End Get
+ 'End Property
+
+ 'Private ReadOnly Property IAplicacion_Titulo As String Implements IAplicacion.Titulo
+ ' Get
+ ' Return "Entidad"
+ ' End Get
+ 'End Property
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If idLog.HasValue Then
+ Return "Entidad. R.C.:" & idLog.ToString
+ Else
+ If Me.Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "Entidad.Nuevo"
+ Else
+ Return "Entidad." & DirectCast(Me.DataContext, entidades).idEntidad.ToString
+ End If
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Cliente/Proveedor"
+ End Get
+ End Property
+
+ Public Sub New(Optional idEntidad As Integer? = Nothing)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ _idEntidad = idEntidad
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Try
+ Me.cbTipoPago.ItemsSource = bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "TIPP").ToList
+ Dim tipdir = bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "TIPDIR").ToList
+ 'Me.cbTarifa.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(Enums.TarifasEnum))
+ Dim Acciones As New List(Of tsWPFCore.Accion)
+ Acciones.Add(New Accion With {
+ .idAccion = 1,
+ .Descripcion = "ENVIA FACTURAS SELECCIONADAS Y SUS ALBARANES POR EMAIL"})
+ Acciones.Add(New Accion With {
+ .idAccion = 2,
+ .Descripcion = "ENVIA FACTURAS SELECCIONADAS POR EMAIL"})
+ Acciones.Add(New Accion With {
+ .idAccion = 3,
+ .Descripcion = "GENERA EXCEL DE FACTURAS SELECCIONADAS"})
+ Acciones.Add(New Accion With {
+ .idAccion = 4,
+ .Descripcion = "ENVIA EXCEL DE FACTURAS SELECCIONADAS POR EMAIL"})
+ Acciones.Add(New Accion With {
+ .idAccion = 5,
+ .Descripcion = "GENERA UN PDF DE FACTURAS SELECCIONADAS"})
+ Acciones.Add(New Accion With {
+ .idAccion = 6,
+ .Descripcion = "GENERA FACTURAS SELECCIONADAS Y SUS ALBARANES EN PDF"})
+
+ Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
+ Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
+ Catch ex As Exception
+ Throw New Exception(ex.Message, ex)
+ End Try
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ 'If Me.docpanel Is Nothing Then
+ ' Dim w As dxwGenerica = Window.GetWindow(Me)
+ ' w.Title = "Agregar nuevo Cliente/Proveedor"
+ 'Else
+ If idLog.HasValue Then
+ Dim ent As entidades = Me.DataContext
+ Me.docpanel.Caption = "R.C. Cliente/Proveedor " & ent.RazonSocial
+ Else
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Dim ent As entidades = Me.DataContext
+ Me.docpanel.Caption = "Cliente/Proveedor " & ent.RazonSocial
+ Me.docpanel.Tag = "Entidad." & ent.idEntidad
+ Else
+ Me.docpanel.Caption = "Cliente/Proveedor Nuevo"
+ Me.docpanel.Tag = "Entidad.Nueva"
+ End If
+ End If
+ ' End If
+ End Sub
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", bdGrupoSanchoToro.db.Utilidades.idUsuario)
+ End Function
+
+
+
+ Private Sub ap_ValidarControl(sender As Object, e As ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
+
+ Dim pts As PropiedadesTS = sender.parent.propiedadests
+ Try
+ If Not pts Is Nothing Then
+ ErroresValidacion.EliminaError("validando-" & pts.NombreCampo)
+ Dim ra As entidades = Me.DataContext
+ Select Case pts.NombreCampo.ToLower
+ Case "email"
+ If e.Value IsNot Nothing AndAlso e.Value.ToString <> "" Then
+ If Not e.Value.ToString.Trim.ToLower.EsEmailValido Then Throw New Exception("El email es incorrecto")
+ End If
+ Case "email2"
+ If e.Value IsNot Nothing AndAlso e.Value.ToString <> "" Then
+ If Not e.Value.ToString.Trim.ToLower.EsEmailValido Then Throw New Exception("El email es incorrecto")
+ End If
+ Case "nif"
+ 'If Not e.Value Is Nothing Then
+ ' Dim sDNI As String = tsUtilidades.Utilidades.CalculoLetraCif(e.Value) ' tsUtilidades.Utilidades.RecalculaNIF(e.Value)
+ ' If sDNI <> e.Value.ToString.ToUpper Then
+ ' ra.NIF = sDNI
+ ' ValorOriginalCambiado = sDNI
+ ' End If
+ 'End If
+ Case "codigopostal"
+ If Not e.Value Is Nothing AndAlso e.Value.ToString <> "" AndAlso e.Value.ToString <> ra.CodigoPostal Then
+
+ Dim sCpo As String = e.Value.ToString
+ If sCpo.Length <> 5 Then Throw New Exception("El código postal no es correcto")
+ Dim sCodigoprovincia As String = sCpo.Substring(0, 2)
+ If Not bd.provincias.Any(Function(x) x.CodigoProvincia = sCodigoprovincia) Then Throw New Exception("El código postal no es correcto")
+ Select Case bd.codigospostales.Where(Function(x) x.CodigoPostal = sCpo).Count
+ Case 0
+ Dim vncp As New dxwAgregarNuevoCodigoPostal(sCpo, bd)
+ If vncp.ShowDialog Then
+ Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
+ ra.CodigoMunicipio = pob.CodigoMunicipio
+ Else
+ Throw New Exception("El código postal no es correcto")
+ End If
+ Case 1
+ Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
+ ra.CodigoMunicipio = pob.CodigoMunicipio
+
+ Case Else
+ Dim wMunicipios As New dxwCodigosPostales(bd, sCpo)
+ If wMunicipios.ShowDialog Then
+ ra.CodigoMunicipio = wMunicipios.CodigoMunicipio
+ Else
+ Throw New Exception("El código postal no es correcto")
+ End If
+ End Select
+ End If
+
+ Case "iban"
+ ' Me.ErroresValidacion.EliminaError("iban")
+ If Not e.Value Is Nothing AndAlso e.Value <> "" Then
+ Dim sIBAN As String = e.Value
+ If sIBAN <> "" Then
+ If sIBAN.Length <> 24 Then
+ ' e.IsValid = False
+ If sIBAN.Length <> 20 Then
+ Throw New Exception("La longitud del codigo IBAN debe ser 24 caracteres (o 20 y se calculará el IBAN).")
+ Else
+ Dim sDC As String = tsUtilidades.Bancos.Genericas.CalcularDigitoControlBancario(sIBAN.Substring(0, 4), sIBAN.Substring(4, 4), sIBAN.Substring(10, 10))
+ If sDC <> sIBAN.Substring(8, 2) Then
+ Throw New Exception("El dígito de control bancario es erroneo.")
+ Else
+ Dim sIBANCalculado As String = tsUtilidades.Bancos.Genericas.CalcularIBAN("ES", sIBAN.Substring(0, 4), sIBAN.Substring(4, 4), sIBAN.Substring(8, 2), sIBAN.Substring(10, 10))
+ ra.IBAN = sIBANCalculado
+ ValorOriginalCambiado = True
+ End If
+ End If
+ Else
+ Dim sDC As String = tsUtilidades.Bancos.Genericas.CalcularDigitoControlBancario(sIBAN.Substring(4, 4), sIBAN.Substring(8, 4), sIBAN.Substring(14, 10))
+ If sDC <> sIBAN.Substring(12, 2) Then
+ Throw New Exception("El dígito de control bancario es erroneo.")
+ Else
+ Dim sIBANCalculado As String = tsUtilidades.Bancos.Genericas.CalcularIBAN(sIBAN.Substring(0, 2), sIBAN.Substring(4, 4), sIBAN.Substring(8, 4), sIBAN.Substring(12, 2), sIBAN.Substring(14, 10))
+ If sIBANCalculado.Substring(2, 2) <> sIBAN.Substring(2, 2) Then
+ ' e.IsValid = False
+ Throw New Exception("Los digitos bancarios no son válidos.")
+ End If
+ End If
+ End If
+ End If
+ End If
+ 'Case "telefono1", "telefono2"
+ ' If e.Value IsNot Nothing AndAlso e.Value.ToString <> "" Then
+ ' Dim tlf = e.Value.ToString
+ ' If tlf.Length <> 9 AndAlso tlf.Length <> 11 AndAlso tlf.Length <> 12 Then
+ ' Throw New Exception("Nº de teléfono incorrecto")
+ ' Else
+ ' If tlf.Length = 12 AndAlso tlf.StartsWith("+") = False Then
+ ' Throw New Exception("Nº de teléfono incorrecto")
+ ' End If
+ ' tlf = tlf.TrimStart("+")
+ ' For i = 0 To tlf.Length - 1
+ ' If "0123456789".Contains(tlf.Substring(i, 1)) = False Then Throw New Exception("Nº de teléfono incorrecto")
+ ' Next
+ ' End If
+ ' End If
+ End Select
+ End If
+ Catch ex As Exception
+ Dim sCodigoError As String = "validando-"
+ If pts IsNot Nothing Then
+ sCodigoError &= pts.NombreCampo
+ End If
+ ev = New ErrorValidacion(sCodigoError, sender, ex.Message, ex, DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical)
+ e.IsValid = False
+ End Try
+ End Sub
+
+
+ Private Sub ap_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ _idEntidad = DirectCast(Me.DataContext, entidades).idEntidad
+ If docpanel IsNot Nothing Then
+ 'If Refrescar Then ap.RefrescaUC()
+ 'Refrescar = False
+ Dim ra As entidades = Me.DataContext
+ Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idEntidad AndAlso x.Aplicacion = "ENTIDADES" AndAlso x.idRelacionado Is Nothing).OrderByDescending(Function(x) x.idLog).ToList
+ Else
+ Dim w = Window.GetWindow(Me)
+ w.DialogResult = True
+ w.Close()
+ End If
+ End Sub
+
+
+ Private Sub ap_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim ra As entidades = Me.DataContext
+ Select Case Celda.View.Name.ToLower
+ Case Else
+ Select Case Celda.Column.FieldName.ToLower
+ Case "idlog"
+ Dim log As logs = gcLogs.CurrentItem
+ Dim id As Integer = log.idLog
+ Dim uc As New ucEntidad()
+ uc.idLog = log.idLog
+ FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
+
+ Case "contineficheroadjunto"
+ Dim correo As correos = gcCorreos.CurrentItem
+ Dim sDirAleatorio As String = tsUtilidades.Utilidades.ObtieneDirectorioAleatorio("GrupoSanchoToro")
+ Dim sftmp As String = sDirAleatorio & "\" & correo.idFicheroAdjuntoNavigation.NombreFichero
+ tsUtilidades.Utilidades.ByteArrayAFichero(correo.idFicheroAdjuntoNavigation.Fichero, sftmp, True)
+ tsUtilidades.Sistema.EjecutaFichero(sftmp)
+ Case "numerofactura"
+ Dim fe As facturas = gcFacturasEmitidas.CurrentItem
+ Dim id As Integer = fe.idFactura
+ ' Dim uc As New ucFacturaEmitida(id)
+ ' FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
+ Case "idfactura"
+ Dim fe As facturasrecibidas = gcFacturasRecibidas.CurrentItem
+ Dim id As Integer = fe.idFactura
+ Dim uc As New ucFacturaRecibida(id)
+ FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
+
+ Case "ficheroadjunto"
+ Dim co As correos = gcCorreos.CurrentItem
+ Dim b() = co.idFicheroAdjuntoNavigation.Fichero
+ Dim nf = tsUtilidades.Utilidades.ObtieneFicheroAleatorio(IO.Path.GetExtension(co.idFicheroAdjuntoNavigation.NombreFichero))
+ IO.File.WriteAllBytes(nf, b)
+ tsUtilidades.Sistema.EjecutaFichero(nf)
+ End Select
+ End Select
+ End Sub
+
+ Private Sub BeCodigoPostal_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
+ Dim ra As entidades = Me.DataContext
+ Dim dxw As New dxwCodigosPostales(bd, "")
+ If dxw.ShowDialog Then
+ ra.CodigoMunicipio = dxw.CodigoMunicipio
+ ra.CodigoPostal = dxw.CodigoPostal
+ ra.RefrescaCamposSoloLectura()
+ beCodigoPostal.Text = ra.CodigoPostal
+ End If
+ End Sub
+
+ Private Sub BtCancelarCodigoPostal_Click(sender As Object, e As RoutedEventArgs)
+ Dim ra As entidades = Me.DataContext
+ ra.CodigoMunicipio = ""
+ End Sub
+
+
+
+ Private Sub ap_EstadoCambiado(EstadoAnterior As tsUtilidades.EstadosAplicacion, EstadoNuevo As tsUtilidades.EstadosAplicacion) Handles Me.EstadoCambiado
+ Select Case EstadoNuevo
+ Case EstadosAplicacion.ModificandoRegistro
+ If Me.idLog.HasValue Then
+ Me.EstableceSoloLectura()
+ Else
+ Dim ra As entidades = Me.DataContext
+ If ra.facturas.Any OrElse ra.facturasrecibidas.Any OrElse ra.presupuestos.Any Then
+ Me.ContenedorAplicacion.btEliminar.IsEnabled = False
+ End If
+ End If
+ End Select
+ If idLog.HasValue Then EstableceSoloLectura()
+ End Sub
+
+ Private Sub CbSoloProductosPE_EditValueChanged(sender As Object, e As EditValueChangedEventArgs)
+ EstableceItemsSourceProductos()
+ End Sub
+
+
+
+ Private Sub tvExpediente_ValidateRow(sender As Object, e As GridRowValidationEventArgs) Handles tvExpediente.ValidateRow
+ Dim ges As expedientesentidades = gcExpediente.CurrentItem
+ If ges.idUsuario.HasValue = False Then
+ ges.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
+ End If
+ End Sub
+ Private Sub VerDocumento(sender As System.Object, e As System.Windows.RoutedEventArgs)
+ Try
+ Dim exp As expedientesentidades = gcExpediente.CurrentItem
+ If exp IsNot Nothing AndAlso exp.idFicheroNavigation IsNot Nothing AndAlso exp.idFicheroNavigation.NombreFichero IsNot Nothing AndAlso exp.idFicheroNavigation.Fichero IsNot Nothing Then
+ Dim sftmp As String = tsUtilidades.Utilidades.ObtieneDirectorioAleatorio("GrupoSanchoToro") & "\" & exp.idFicheroNavigation.NombreFichero
+ tsUtilidades.Utilidades.ByteArrayAFichero(exp.idFicheroNavigation.Fichero, sftmp, True)
+ tsUtilidades.Sistema.EjecutaFichero(sftmp)
+ End If
+ Catch ex As Exception
+ End Try
+ End Sub
+ Private Sub Examinar(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btFichero.DefaultButtonClick
+ Try
+ If gcExpediente.CurrentItem Is Nothing Then tvExpediente.AddNewRow()
+ Dim exp As expedientesentidades = gcExpediente.CurrentItem
+ Dim ofd As New OpenFileDialog
+ If ofd.ShowDialog() Then
+ Dim fin As New FileInfo(ofd.FileName)
+ If fin.Length > 1024 * 1024 * 50 Then
+ DXMessageBox.Show("El fichero no puede ser mayor de 50 Mb", "Atención")
+ Else
+ Dim f() As Byte = IO.File.ReadAllBytes(ofd.FileName)
+ Dim idTipoDocumentoExp = bd.enumeraciones.First(Function(x) x.Codigo = "TIPFIC.EXPENT").idEnumeracion
+ If exp.idFicheroNavigation Is Nothing Then
+ Dim fi As New db.ficheros
+ exp.idFicheroNavigation = fi
+ End If
+ exp.idFicheroNavigation.NombreFichero = IO.Path.GetFileName(ofd.FileName)
+ exp.idFicheroNavigation.Fichero = f
+ exp.idFicheroNavigation.Fecha = Now
+ exp.idFicheroNavigation.Descripcion = exp.Descripcion.Acortar(80)
+ exp.idFicheroNavigation.idTipo = idTipoDocumentoExp
+ exp.Fecha = Now
+ Dim usu = bd.usuarios.First(Function(x) x.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario)
+ exp.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
+ exp.idUsuarioNavigation = usu
+ tvExpediente.MoveNextCell()
+ gcExpediente.RefreshRow(tvExpediente.FocusedRowHandle)
+ End If
+ End If
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub TvExpediente_PreviewKeyDown(sender As Object, e As KeyEventArgs)
+ If e.Key = Key.F6 AndAlso gcExpediente.CurrentColumn.FieldName.ToLower = "ficheros.nombrefichero" Then
+ Examinar(Nothing, Nothing)
+ End If
+ End Sub
+
+ Private Sub tvExpediente_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvExpediente.InitNewRow
+ gcExpediente.SetCellValue(e.RowHandle, "Fecha", Date.Today)
+ End Sub
+
+ Private Sub ucEntidad_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
+ Try
+ Dim ra As entidades = Me.DataContext
+ Dim fras = gcFacturasEmitidas.ElementosSeleccionados.Cast(Of facturas).ToList
+ If fras.Count = 0 Then
+ DXMessageBox.Show("Antes debe seleccionar alguna factura emitida", "Atención")
+ Else
+ If fras.Any(Function(x) x.TotalIVA = 0) Then
+ DXMessageBox.Show("Atención alguna de las facturas seleccionadas no tienen IVA", "Atención")
+ End If
+ Select Case idAccion
+ Case 1, 2
+ If Not Guardar(Nothing, Nothing) Then
+ Dim sFacturas As String = ""
+ For Each f In fras
+ sFacturas &= f.NumeroFactura & vbCrLf
+ Next
+ Dim dxnc As dxwEnvioCorreo
+ If idAccion = 2 Then
+ dxnc = New dxwEnvioCorreo(ra.Email, ra.Email2.NothingAVacio, "", EmpresaActual.RazonSocial & " - Adjunto le remitimos facturas solicitadas", "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos las siguientes facturas:" & vbNewLine & sFacturas, "Facturas.zip")
+ Else
+ dxnc = New dxwEnvioCorreo(ra.Email, ra.Email2.NothingAVacio, "", EmpresaActual.RazonSocial & " - Adjunto le remitimos facturas y albaranes solicitados", "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos las siguientes facturas y sus albaranes relacionados:" & vbNewLine & sFacturas, "Facturas.zip")
+ End If
+ If dxnc.ShowDialog Then
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Generando correo, por favor espere ...")
+ Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ Dim dArchivos As Dictionary(Of String, Byte()) = Nothing
+ For Each fe In fras
+ DXSplashScreen.SetState("Generando archivos de la factura " & fe.NumeroFactura & ", por favor espere ...")
+ ' ucFacturaEmitida.GeneraPdfFacturasYAlbaranes(bd, fe, idAccion = 1, dArchivos, True)
+ Next
+ DXSplashScreen.SetState("Comprimiendo Archivos, por favor espere ...")
+ Dim bzip = tsUtilidades.zip.ComprimirArchivos(dArchivos)
+ correos.GeneraRegistroCorreon(bd, dxnc._Asunto, dxnc._Cuerpo, cta, dxnc._Destinatarios, dxnc._CC, dxnc._BCC, bzip, dxnc._Adjunto, ra.idEntidad, "ENTIDAD", ra.idEntidad)
+ End If
+ End If
+ Case 3
+ Try
+ Dim sfd As New SaveFileDialog
+ sfd.FileName = IO.Path.GetDirectoryName("Exportacion") & ("Facturas.xlsx").Trim
+ sfd.Filter = "Fichero Excel (*.xls, *.xlsx, *.csv)|*.xls;*.xlsx;*.csv"
+ sfd.DefaultExt = ".xlsx"
+ If sfd.ShowDialog Then
+ gcFacturasEmitidas.ItemsSource = fras
+ Dim ms As New MemoryStream
+ Dim bFacturas As Byte() = Nothing
+ Select Case IO.Path.GetExtension(sfd.FileName).ToLower
+ Case ".xls"
+ tvFacturasEmitidas.ExportToXls(ms)
+ bFacturas = InsertaLogoEnXLSX(ms, DevExpress.Spreadsheet.DocumentFormat.Xls)
+ Case ".xlsx"
+ tvFacturasEmitidas.ExportToXlsx(ms)
+ bFacturas = InsertaLogoEnXLSX(ms, DevExpress.Spreadsheet.DocumentFormat.Xlsx)
+ Case ".csv"
+ tvFacturasEmitidas.ExportToCsv(ms)
+ bFacturas = InsertaLogoEnXLSX(ms, DevExpress.Spreadsheet.DocumentFormat.Csv)
+ Case Else
+ Throw New Exception("Formato no soportado")
+ End Select
+ IO.File.WriteAllBytes(sfd.FileName, bFacturas)
+ tsUtilidades.Sistema.EjecutaFichero(sfd.FileName)
+ End If
+ Catch ex As Exception
+ Throw New Exception(ex.Message, ex)
+ Finally
+ gcFacturasEmitidas.ItemsSource = ra.facturas.OrderByDescending(Function(x) x.FechaFactura).ToList
+ End Try
+ Case 4
+ If Not Guardar(Nothing, Nothing) Then
+ Try
+ Dim dxnc = New dxwEnvioCorreo(ra.Email, ra.Email2.NothingAVacio, "", EmpresaActual.RazonSocial & " - Adjunto le remitimos listado de facturas solicitadas", "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos listado de facturas solicitadas", "Facturas.xlsx")
+ If dxnc.ShowDialog Then
+ Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ gcFacturasEmitidas.ItemsSource = fras
+ Dim ms As New MemoryStream
+ tvFacturasEmitidas.ExportToXlsx(ms)
+ Dim bFacturas = InsertaLogoEnXLSX(ms, DevExpress.Spreadsheet.DocumentFormat.Xlsx)
+ gcFacturasEmitidas.ItemsSource = ra.facturas.OrderByDescending(Function(x) x.FechaFactura).ToList
+ bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, dxnc._Asunto, dxnc._Cuerpo, cta, dxnc._Destinatarios, dxnc._CC, dxnc._BCC, bFacturas, dxnc._Adjunto, ra.idEntidad, "ENTIDAD", ra.idEntidad)
+ End If
+ Catch ex As Exception
+ Throw New Exception(ex.Message, ex)
+ Finally
+ gcFacturasEmitidas.ItemsSource = ra.facturas.OrderByDescending(Function(x) x.FechaFactura).ToList
+ End Try
+ End If
+ Case 5
+ Dim sfd As New SaveFileDialog
+ sfd.FileName = "Facturas " & ra.RazonSocial.Trim & ".pdf"
+ sfd.Filter = "Fichero PDF (*.pdf)|*.pdf"
+ sfd.DefaultExt = ".pdf"
+ If sfd.ShowDialog Then
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Generando PDF, por favor espere ...")
+ Dim lfras As New List(Of Byte())
+ For Each factura In fras.OrderBy(Function(x) x.NumeroFactura).ToList
+ DXSplashScreen.SetState("Procesando factura " & factura.NumeroFactura & ", por favor espere ...")
+ Dim ds = New List(Of facturas)
+ Dim idpl As Integer
+ If factura.PorcentajeIVA1 > 0 Then
+ idpl = bd.plantillas.First(Function(x) x.Codigo = "FACEMI").idPlantilla
+ Else
+ idpl = bd.plantillas.First(Function(x) x.Codigo = "NOTENT").idPlantilla
+ End If
+ ds.Add(factura)
+ lfras.Add(Informes.GuardaInformeEnPdf(bd, idpl, ds))
+ Next
+ Dim lista = lfras.Select(Function(x) New MemoryStream(x)).ToArray
+ TSpdfUtils.pdf.UnePdfs(lista, sfd.FileName)
+ tsUtilidades.Sistema.EjecutaFichero(sfd.FileName)
+ End If
+
+ Case 6
+ Dim sfd As New SaveFileDialog
+ sfd.FileName = "Facturas y Albaranes " & ra.RazonSocial.Trim & ".pdf"
+ sfd.Filter = "Fichero Pdf (*.pdf|*.pdf"
+ sfd.DefaultExt = ".pdf"
+ If sfd.ShowDialog Then
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Generando PDF, por favor espere ...")
+ Dim dArchivos As Dictionary(Of String, Byte()) = Nothing
+ For Each fe In fras
+ DXSplashScreen.SetState("Generando archivos de la factura " & fe.NumeroFactura & ", por favor espere ...")
+ ' ucFacturaEmitida.GeneraPdfFacturasYAlbaranes(bd, fe, True, dArchivos, True)
+ Next
+ Dim aArchivos = dArchivos.Select(Function(x) x.Value).ToArray
+ Dim lista = aArchivos.Select(Function(x) New MemoryStream(x)).ToArray
+ TSpdfUtils.pdf.UnePdfs(lista, sfd.FileName)
+ tsUtilidades.Sistema.EjecutaFichero(sfd.FileName)
+ End If
+ End Select
+ End If
+ Catch ex As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show("Error " & ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+ Private Function InsertaLogoEnXLSX(ms As MemoryStream, Formato As DevExpress.Spreadsheet.DocumentFormat) As Byte()
+ ms.Position = 0
+ Dim wb As New Workbook
+ wb.LoadDocument(ms, Formato)
+ If Formato <> DevExpress.Spreadsheet.DocumentFormat.Csv Then
+ wb.Worksheets(0).Rows.Insert(0, 6)
+ wb.Worksheets(0).MergeCells(wb.Worksheets(0).Range("A1:C4"))
+ Dim memStream As System.IO.MemoryStream = New MemoryStream(bd.ficherosconfiguracion.First(Function(X) X.Codigo = "LOGO").Configuracion)
+ Dim chartControl1ImageSource = SpreadsheetImageSource.FromStream(memStream)
+ wb.Worksheets(0).Pictures.AddPicture(chartControl1ImageSource, wb.Worksheets(0).Range("A1:C4"), True)
+ wb.Worksheets(0).Cells("A5").Value = "IBAN: "
+ wb.Worksheets(0).Cells("A5").FillColor = System.Drawing.Color.LightGray
+ wb.Worksheets(0).Cells("A5").Font.Bold = True
+ wb.Worksheets(0).Cells("B5").Value = bd.cajas.FirstOrDefault(Function(X) X.FechaBaja.HasValue = False AndAlso (X.IBAN IsNot Nothing AndAlso X.IBAN <> "")).IBAN
+ wb.Worksheets(0).Cells("B5").Font.Color = System.Drawing.Color.Orange
+ End If
+ Dim b = wb.SaveDocument(Formato)
+ Return b
+ End Function
+
+
+ Private Sub ucEntidad_CampoActualizado(sender As Object, e As DataTransferEventArgs) Handles Me.CampoActualizado
+ Dim pts As PropiedadesTS = sender.parent.propiedadests
+ If Not pts Is Nothing Then
+ Select Case pts.NombreCampo.ToLower
+ Case "codigopostal"
+ ra.RefrescaCamposSoloLectura()
+ End Select
+ End If
+ End Sub
+
+ Private Sub ucEntidad_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
+ Dim hte As New Hashtable
+ If ra.EsCliente = False AndAlso ra.EsProveedor = False Then
+ hte.Add("ALMACENAR-CLIENTE_O_PROVEEDOR_OBLIGATORIO", "Debe seleccionar al menos alguna opción de si es cliente o proveedor")
+ End If
+ Dim vd = New tsUtilidades.ValidarDocumentoIdentidad(ra.NIF)
+ If vd.EsCorrecto = False Then
+ hte.Add("ALMACENAR-NIF INCORRECTO", "El documento de identidad es inválido")
+ Else
+ ra.NIF = vd.ToString
+ End If
+ If hte.Count = 0 Then
+ Dim cifexi = bd.entidades.FirstOrDefault(Function(x) x.idEntidad <> ra.idEntidad AndAlso x.NIF = ra.NIF AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ If cifexi IsNot Nothing AndAlso cifexi.RazonSocial = ra.RazonSocial Then
+ hte.Add("ALMACENAR-ENTIDAD_DUPLICADA", "Entidad Duplicada")
+ ElseIf cifexi IsNot Nothing Then
+ If DXMessageBox.Show("Ya existe una entidad con el mismo NIF (" & cifexi.RazonSocial & ") ¿Desea añadir de todas formas ya que es una sucursal?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.No Then
+ hte.Add("ALMACENAR-ENTIDAD_DUPLICADA", "Entidad Duplicada")
+ End If
+ End If
+ End If
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ End If
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucEntidades.xaml b/GestionGrupoSanchoToro/ucEntidades.xaml
new file mode 100644
index 0000000..42bff0c
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucEntidades.xaml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucEntidades.xaml.vb b/GestionGrupoSanchoToro/ucEntidades.xaml.vb
new file mode 100644
index 0000000..77506d9
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucEntidades.xaml.vb
@@ -0,0 +1,157 @@
+
+
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore
+Imports DevExpress.Xpf.Bars
+Imports bdGrupoSanchoToro.db
+Imports bdGrupoSanchoToro
+Imports tsUtilidades
+Imports System.Linq.Dynamic.Core
+Imports bdGrupoSanchoToro.db.Utilidades
+
+Public Class ucEntidades
+ Private bd As tscGrupoSanchoToro
+ Private _CamposBusquedaNumericos() As String = {"idEntidad"}
+ Private _CamposBusquedaAlfabeticos() As String = {"RazonSocial", "NIF", "Telefono1", "Telefono2", "Email"}
+ ' Private _TextoBusqueda As String
+
+
+ Public Sub New()
+
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Public Overrides Sub Cargado()
+ ContenedorAplicacion.btGuardar.IsVisible = False
+ ContenedorAplicacion.siEstado.IsVisible = False
+ Me.GridSeleccion = Me.gc
+ End Sub
+
+
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ If Background Then ObtieneEntidadesAsync(bd, Background)
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Clientes/Proveedores"
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "Entidades"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "entidades"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Clientes / Proveedores"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", bdGrupoSanchoToro.db.Utilidades.idUsuario)
+ End Function
+
+ Private Sub Nuevo() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucEntidad, OtrosParametros)
+ End Sub
+
+ Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ If Defecto = False AndAlso Celda.Column.FieldName.ToLower = "email" Then
+ tsUtilidades.Sistema.EjecutaFichero("mailto:" & DirectCast(Me.gc.CurrentItem, entidades).Email)
+ Else
+ Dim id As Integer = DirectCast(Me.gc.CurrentItem, entidades).idEntidad
+ FuncionesDinamicas.AbrirAP(New ucEntidad(id), OtrosParametros)
+ End If
+ End Sub
+
+ Public Function ObtieneEntidades(ByRef DataContext As Object, BackGround As Boolean, TextoBusqueda As String) As List(Of entidades)
+ Dim rs As New List(Of entidades)
+ Dim iqent = bd.entidades.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.NIF IsNot Nothing AndAlso x.NIF <> "").Include(Function(x) x.CodigoMunicipioNavigation.CodigoProvinciaNavigation).AsQueryable
+ If TextoBusqueda <> "" Then
+ Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Me._CamposBusquedaNumericos, Me._CamposBusquedaAlfabeticos, Nothing)
+ iqent = iqent.Where(ExpresionBusqueda).ToList.OrderBy(Function(x) x.RazonSocial).AsQueryable
+ End If
+
+ Dim inumExc As Integer = 0
+ Do
+
+ Try
+ rs = iqent.ToList
+ Exit Do
+ Catch ex As Exception
+ iNumExc += 1
+ If iNumExc > 3 Then
+ rs = Nothing
+ Exit Do
+ End If
+ End Try
+ Loop
+ Return rs
+ End Function
+
+ Public Async Sub ObtieneEntidadesAsync(bd As tscGrupoSanchoToro, Background As Boolean)
+ Try
+ Dim rs As New List(Of entidades)
+ Dim Busqueda = tsEFCore8.Extensiones.ObjetoNothingAVacio(Me.teBusqueda.EditValue)
+ If Background Then
+ Me.ContenedorAplicacion.IsEnabled = False
+ Await Task.Run(Sub()
+ rs = ObtieneEntidades(bd, Background, Busqueda)
+ End Sub)
+ Else
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Buscando Entidades ...")
+ rs = ObtieneEntidades(bd, Background, Busqueda)
+ End If
+
+ gc.ItemsSource = rs
+ DataContext = rs
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ Me.ContenedorAplicacion.IsEnabled = True
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+ Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
+ ObtieneEntidadesAsync(bd, False)
+ End Sub
+
+ Private Sub ucEntidades_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ teBusqueda.SelectAll()
+ End Sub
+
+ Private Sub gc_KeyDown(sender As Object, e As KeyEventArgs) Handles gc.KeyDown
+ Select Case e.Key
+ Case Key.Enter, Key.Space
+ If gc.CurrentItem IsNot Nothing Then ap_Enlazar(Nothing, True)
+ End Select
+ End Sub
+
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucExtractoBancario.xaml b/GestionGrupoSanchoToro/ucExtractoBancario.xaml
new file mode 100644
index 0000000..0ac6467
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucExtractoBancario.xaml
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucExtractoBancario.xaml.vb b/GestionGrupoSanchoToro/ucExtractoBancario.xaml.vb
new file mode 100644
index 0000000..6cbb69b
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucExtractoBancario.xaml.vb
@@ -0,0 +1,121 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports System.Collections.ObjectModel
+Imports DevExpress.Xpf.Grid
+Imports bdGrupoSanchoToro.db
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+
+Public Class ucExtractoBancario
+
+
+ Private bd As tscGrupoSanchoToro
+ Friend _idExtracto As Nullable(Of Integer)
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+
+
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+ Dim ra As extractosbancarios
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo OrElse _idExtracto Is Nothing OrElse FuerzaNuevo Then
+ ra = New extractosbancarios
+ Me.DataContext = ra
+ _idExtracto = Nothing
+ ra.idUsuarioNavigation = bd.usuarios.First(Function(x) x.idUsuario = idUsuario)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ ra = bd.extractosbancarios.First(Function(x) x.idExtracto = _idExtracto.Value)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ Me.DataContext = ra
+ Me.gcMovimientos.ItemsSource = ra.movimientosbancarios
+
+ Return NuevoEstado
+
+ End Function
+
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "extractosbancarios"
+ End Get
+ End Property
+
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "ExtractoBancario.Nuevo"
+ Else
+ Return "ExtractoBancario." & DirectCast(Me.DataContext, extractosbancarios).idExtracto.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Extracto Bancario"
+ End Get
+ End Property
+
+ Public Sub New(Optional idExtracto As Integer? = Nothing)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ _idExtracto = idExtracto
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Dim ext As extractosbancarios = Me.DataContext
+ Me.docpanel.Caption = "Extracto Bancario " & ext.idExtracto.ToString
+ Me.docpanel.Tag = "Extracto Bancario." & ext.idExtracto.ToString
+ Else
+ Me.docpanel.Caption = "Movimiento Bancario Nuevo"
+ Me.docpanel.Tag = "Movimiento Bancario.Nuevo"
+ End If
+ End Sub
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim per = Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRATIVOS", idUsuario)
+ per.Nuevos = False
+ per.Modificar = False
+ Return per
+ End Function
+
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucExtractosBancarios)
+ End Sub
+
+ Private Sub ucExtractoBancario_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim ext As extractosbancarios = Me.DataContext
+ _idExtracto = ext.idExtracto
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucExtractosBancarios.xaml b/GestionGrupoSanchoToro/ucExtractosBancarios.xaml
new file mode 100644
index 0000000..ce157a3
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucExtractosBancarios.xaml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucExtractosBancarios.xaml.vb b/GestionGrupoSanchoToro/ucExtractosBancarios.xaml.vb
new file mode 100644
index 0000000..bf1b9f7
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucExtractosBancarios.xaml.vb
@@ -0,0 +1,342 @@
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core.ServerMode
+Imports bdGrupoSanchoToro.db
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports DevExpress.Xpf.Grid
+Imports DevExpress.Xpf.Core
+Imports System.Linq.Dynamic
+Imports tsUtilidades.Datos
+Imports tsWPFCore
+Imports DevExpress.Xpf.Bars
+Imports System.IO
+Imports Microsoft.Win32
+Imports System.Threading.Tasks
+Imports System.Linq.Dynamic.Core
+Imports tsUtilidades.Enumeraciones
+
+Public Class ucExtractosBancarios
+
+ Dim bd As tscGrupoSanchoToro
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Extractos Bancarios"
+ End Sub
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "ExtractosBancarios"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Extracto Bancario"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "extractosbancarios"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Dim Acciones As New List(Of tsWPFCore.Accion)
+ Acciones.Add(New Accion With {
+ .idAccion = 1,
+ .Descripcion = "LEE FICHERO DE EXTRACTO"})
+ Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
+ If Acciones.Count > 0 Then Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
+ End Sub
+
+
+
+ Public Overrides Sub Cargado()
+ Me.HabilitarRefresco = True
+ deFechaInicio.EditValue = New Date(Now.AddMonths(-6).Year, Now.AddMonths(-6).Month, 1)
+ deFechaFin.EditValue = Now
+ GridBusqueda = Me.gc
+ End Sub
+
+
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ ' ObtieneAsientosAsync(bd, Background)
+ If Refrescar OrElse Background Then ObtieneExtractosAsync(bd, Background)
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+ 'Public Overrides Function ObtieneConexionBD() As BBDD
+ ' Return bdGrupoSanchoToro.db.tscGrupoSanchoToro.bdga
+ 'End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim per = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ per.Nuevos = False
+ Return per
+ End Function
+
+
+
+ Public Sub New()
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+
+
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+ Public Function ObtieneExtractos(ByRef DataContext As Object, BackGround As Boolean, TextoBusqueda As String, FechaInicio As DateOnly?, FechaFin As DateOnly?) As List(Of extractosbancarios)
+ Dim rs As IQueryable(Of extractosbancarios)
+ Dim iNumExc As Integer = 0
+
+ Do
+ Try
+ rs = bd.extractosbancarios.Include(Function(x) x.idCajaNavigation).AsQueryable
+ If TextoBusqueda <> "" Then
+
+ Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, {"idExtracto"}, {"idCajaNavigation.Descripcion", "idCajaNavigation.IBAN"}, Nothing)
+ rs = rs.Where(ExpresionBusqueda)
+ End If
+ If FechaInicio.HasValue Then
+ Dim fi As DateOnly = FechaInicio.Value
+ rs = rs.Where(Function(x) x.FechaInicial >= fi)
+ End If
+ If FechaFin.HasValue Then
+ Dim ff As DateOnly = FechaFin.Value
+ rs = rs.Where(Function(x) x.FechaInicial < ff)
+ End If
+ Exit Do
+ Catch ex As Exception
+ iNumExc += 1
+ If iNumExc > 3 Then
+ rs = Nothing
+ Exit Do
+ End If
+ End Try
+ Loop
+ If rs IsNot Nothing Then
+ Return rs.ToList
+ Else
+ Return Nothing
+ End If
+ End Function
+
+ Public Async Sub ObtieneExtractosAsync(bd As tscGrupoSanchoToro, Background As Boolean)
+ Try
+
+
+ Dim rs As New List(Of extractosbancarios)
+ Dim fi = If(deFechaInicio.EditValue Is Nothing, Nothing, DateOnly.FromDateTime(deFechaInicio.EditValue))
+ Dim ff = If(deFechaFin.EditValue Is Nothing, Nothing, DateOnly.FromDateTime(deFechaFin.EditValue))
+
+ Dim Busqueda As String
+
+ Busqueda = Me.teBusqueda.Text.Trim
+ If Background Then
+ Me.ContenedorAplicacion.IsEnabled = False
+ Await Task.Run(Sub()
+ rs = ObtieneExtractos(bd, Background, Busqueda, fi, ff)
+ End Sub)
+ Else
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Buscando Extractos ...")
+ rs = ObtieneExtractos(bd, Background, Busqueda, fi, ff)
+ End If
+
+ gc.ItemsSource = rs
+ DataContext = rs
+
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ Me.ContenedorAplicacion.IsEnabled = True
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim id As Integer = DirectCast(Me.gc.CurrentItem, extractosbancarios).idExtracto
+ FuncionesDinamicas.AbrirAP(New ucExtractoBancario(id), OtrosParametros)
+ End Sub
+
+ Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
+ ObtieneExtractosAsync(bd, False)
+ End Sub
+
+ Private Sub ucExtractosBancarios_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
+ Try
+ Select Case idAccion
+ Case 1 ' LECTURA DE FICHEROS
+ Dim bdtmp = tscGrupoSanchoToro.NuevoContexto()
+ Dim NumLinea As Integer
+ Dim reader As TextReader = Nothing
+ Try
+ Dim ofd As New OpenFileDialog
+ ofd.CheckPathExists = True
+ ofd.Filter = "Archivos|*.*"
+ If ofd.ShowDialog Then
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Leyendo Extractos ...")
+ Dim ne As extractosbancarios = Nothing
+ Dim nm As movimientosbancarios = Nothing
+ reader = New StreamReader(ofd.FileName)
+ Dim linea As String = reader.ReadLine
+ NumLinea = 1
+ Dim SaldoSumado As Double = 0
+ Dim sBanco As String = ""
+ Do Until linea Is Nothing
+ If linea.Trim <> "" Then
+ Dim Tipo As String = linea.Substring(0, 2)
+ Select Case Tipo
+ Case "11" 'REGISTRO DE CABECERA DE CUENTA
+ linea = linea.PadRight(80, " ")
+ sBanco = linea.Substring(2, 4).Trim.PadLeft(4, "0")
+ Dim sOficina = linea.Substring(6, 4).Trim.PadLeft(4, "0")
+ Dim sCta = linea.Substring(10, 10).Trim.PadLeft(10, "0")
+ Dim sFechaInicial = linea.Substring(20, 6)
+ Dim sFechaFinal = linea.Substring(26, 6)
+ Dim fi As DateOnly = DateOnly.FromDateTime(tsUtilidades.Extensiones.FechaStringADate("20" & sFechaInicial))
+ Dim ff As DateOnly = DateOnly.FromDateTime(tsUtilidades.Extensiones.FechaStringADate("20" & sFechaFinal))
+ Dim sDoH = linea.Substring(32, 1)
+ Dim sSaldoAnterior = linea.Substring(33, 14)
+ Dim sDivisa = linea.Substring(47, 3)
+ Dim sModalidad = linea.Substring(50, 1)
+ Dim sNombreAbreviado = linea.Substring(51, 26)
+ Dim sLibre = linea.Substring(77, 3)
+ Dim sDC = tsUtilidades.Bancos.Genericas.CalcularDigitoControlBancario(sBanco, sOficina, sCta)
+ Dim sIBAN = tsUtilidades.Bancos.Genericas.CalcularIBAN("ES", sBanco, sOficina, sDC, sCta)
+ Dim cj = bd.cajas.FirstOrDefault(Function(x) x.IBAN = sIBAN)
+ If cj Is Nothing Then Throw New Exception("La caja con el IBAN " & sIBAN & " no está dada de alta.")
+ If bd.movimientosbancarios.Any(Function(x) x.FechaOperacion >= fi AndAlso x.FechaOperacion <= ff AndAlso x.idExtractoBancarioNavigation.idCajaNavigation.IBAN = sIBAN) Then Throw New Exception("Ya existen extractos bancarios entre las fechas de inicio y fin del fichero seleccionado")
+ Dim idcaja = cj.idCaja
+
+ ne = New extractosbancarios
+ bdtmp.extractosbancarios.Add(ne)
+ With ne
+ ne.idCaja = idcaja
+ ne.FechaInicial = fi
+ ne.FechaFinal = ff
+ ne.FechaLectura = Now
+ ne.SaldoAnterior = Math.Round(Double.Parse(sSaldoAnterior) / 100, 2)
+ ne.idUsuario = idUsuario
+ End With
+ Case "22"
+ linea = linea.PadRight(80, " ")
+ Select Case sBanco
+ Case "0182"
+ Dim sLibre = linea.Substring(2, 4)
+ Dim sOficina = linea.Substring(6, 4)
+ Dim sFechaOperacion = linea.Substring(10, 6)
+ Dim sFechaValor = linea.Substring(16, 6)
+ Dim sConceptoComun = linea.Substring(22, 2)
+ Dim sConceptoPropio = linea.Substring(24, 3)
+ Dim sDoH = linea.Substring(27, 1)
+ Dim sImporte = linea.Substring(28, 14)
+ Dim sNumeroDocumento = linea.Substring(42, 10)
+ Dim sReferencia1 = linea.Substring(52).Trim
+ nm = New movimientosbancarios
+ ne.movimientosbancarios.Add(nm)
+ With nm
+ .FechaOperacion = DateOnly.FromDateTime(tsUtilidades.Extensiones.FechaStringADate("20" & sFechaOperacion))
+ .FechaValor = DateOnly.FromDateTime(tsUtilidades.Extensiones.FechaStringADate("20" & sFechaValor))
+ .CodigoConcepto = sConceptoComun
+ .ConceptoPropio = sConceptoPropio
+ .Importe = Math.Round(Double.Parse(sImporte) / 100, 2) * If(sDoH = "1", -1, 1)
+ SaldoSumado += .Importe
+ .NumeroDocumento = sNumeroDocumento
+ .Detalle = ""
+ .ReferenciaBanco = sReferencia1
+ End With
+
+ Case Else
+ Dim sLibre = linea.Substring(2, 4)
+ Dim sOficina = linea.Substring(6, 4)
+ Dim sFechaOperacion = linea.Substring(10, 6)
+ Dim sFechaValor = linea.Substring(16, 6)
+ Dim sConceptoComun = linea.Substring(22, 2)
+ Dim sConceptoPropio = linea.Substring(24, 3)
+ Dim sDoH = linea.Substring(27, 1)
+ Dim sImporte = linea.Substring(28, 14)
+ Dim sNumeroDocumento = linea.Substring(42, 10)
+ Dim sReferencia1 = linea.Substring(52, 12)
+ Dim sReferencia2 = linea.Substring(64, 16)
+ nm = New movimientosbancarios
+ ne.movimientosbancarios.Add(nm)
+ With nm
+ .FechaOperacion = DateOnly.FromDateTime(tsUtilidades.Extensiones.FechaStringADate("20" & sFechaOperacion))
+ .FechaValor = DateOnly.FromDateTime(tsUtilidades.Extensiones.FechaStringADate("20" & sFechaValor))
+ .CodigoConcepto = sConceptoComun
+ .ConceptoPropio = sConceptoPropio
+ .Importe = Math.Round(Double.Parse(sImporte) / 100, 2) * If(sDoH = "1", -1, 1)
+ SaldoSumado += .Importe
+ .NumeroDocumento = sNumeroDocumento
+ .Detalle = sReferencia2.Trim
+ .ReferenciaBanco = sReferencia1
+ End With
+ End Select
+ Case "23"
+ Select Case sBanco
+ Case "0182"
+ Dim sCodigoDato = linea.Substring(2, 2)
+ Dim sConcepto1 = linea.Substring(4, 38).Trim
+ Dim sConcepto2 = linea.Substring(42, 38).Trim
+ With nm
+ .Detalle &= (" " & sConcepto1 & " " & sConcepto2).Trim
+ If .Detalle = "" Then .Detalle = .ReferenciaBanco
+ End With
+ Case Else
+ Dim sCodigoDato = linea.Substring(2, 2)
+ Dim sConcepto1 = linea.Substring(4, 38).Trim
+ Dim sConcepto2 = linea.Substring(42, 38).Trim
+ With nm
+ .Detalle &= (" " & sConcepto1 & " " & sConcepto2).Trim
+
+ End With
+ End Select
+
+ Case "33"
+ Dim sDoH = linea.Substring(58, 1)
+ Dim sSaldoFinal = linea.Substring(59, 14)
+ Dim dSaldo = Math.Round(Double.Parse(sSaldoFinal) / 100, 2) * If(sDoH = "1", -1, 1)
+ ne.SaldoFinal = dSaldo
+ End Select
+ End If
+ linea = reader.ReadLine
+ NumLinea += 1
+ Loop
+ If Math.Round(ne.SaldoFinal, 2) <> Math.Round(ne.SaldoAnterior + SaldoSumado, 2) Then Throw New Exception("El saldo final no corresponde con las suma de los apuntes en el fichero y el saldo anterior")
+ bdtmp.GuardarCambios()
+ reader.Close()
+ ObtieneExtractosAsync(bd, False)
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End If
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ Try
+ reader.Close()
+ Catch
+ End Try
+ DXMessageBox.Show(ex.Message, "Error")
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ Throw New Exception("Error en la Línea " & NumLinea.ToString & " " & ex.Message, ex)
+ End Try
+ End Select
+ Catch ex As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+End Class
+
diff --git a/GestionGrupoSanchoToro/ucFiesta.xaml b/GestionGrupoSanchoToro/ucFiesta.xaml
new file mode 100644
index 0000000..b3710cd
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucFiesta.xaml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucFiesta.xaml.bak b/GestionGrupoSanchoToro/ucFiesta.xaml.bak
new file mode 100644
index 0000000..81d22e8
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucFiesta.xaml.bak
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucFiesta.xaml.vb b/GestionGrupoSanchoToro/ucFiesta.xaml.vb
new file mode 100644
index 0000000..48df7b4
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucFiesta.xaml.vb
@@ -0,0 +1,116 @@
+Imports tsWPFCore
+Imports bdGrupoSanchoToro.db
+Imports System.Collections
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports DevExpress.Xpf.Bars
+
+Public Class ucFiesta
+
+
+ Private bd As tscGrupoSanchoToro
+
+ Dim _idFiesta As Integer?
+
+
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucFiestas)
+ End Sub
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+ Dim ra As fiestas
+ If FuerzaNuevo OrElse _idFiesta Is Nothing Then
+ ra = New fiestas
+ ra.Fecha = DateOnly.FromDateTime(Today)
+ Me.DataContext = ra
+ _idFiesta = Nothing
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ ra = bd.fiestas.First(Function(x) x.idFiesta = _idFiesta.Value)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ Me.DataContext = ra
+ Return NuevoEstado
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Dim ra As fiestas = CType(Me.DataContext, fiestas)
+ Me.docpanel.Caption = "fiesta " & ra.Fecha.ToShortDateString
+ Me.docpanel.Tag = "fiesta." & ra.idFiesta.ToString
+ Else
+ Me.docpanel.Caption = "Fiesta nueva"
+ Me.docpanel.Tag = "Fiesta.Nuevo"
+ End If
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "Fiesta.Nuevo"
+ Else
+ Return "Fiesta." & DirectCast(Me.DataContext, fiestas).idFiesta.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "fiestas"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "fiesta"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+
+
+
+
+ Public Sub New(Optional idFiesta As Integer? = Nothing)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ _idFiesta = idFiesta
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+ Private Sub ucFiesta_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
+ Dim hte As New Hashtable
+ Dim bdtmp = tscGrupoSanchoToro.NuevoContexto()
+ Dim ra As fiestas = Me.DataContext
+ If bdtmp.fiestas.Any(Function(x) x.Fecha = ra.Fecha AndAlso x.idFiesta <> ra.idFiesta) Then
+ hte.Add("ALMACENAR-FECHA_YA_EXISTENTE", "La fecha introducida ya estaba dada de alta")
+ End If
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ End If
+ End Sub
+
+ Private Sub ucFiesta_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim fi As fiestas = Me.DataContext
+ _idFiesta = fi.idFiesta
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucFiestas.xaml b/GestionGrupoSanchoToro/ucFiestas.xaml
new file mode 100644
index 0000000..e5dd28d
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucFiestas.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucFiestas.xaml.vb b/GestionGrupoSanchoToro/ucFiestas.xaml.vb
new file mode 100644
index 0000000..1aedada
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucFiestas.xaml.vb
@@ -0,0 +1,75 @@
+Imports tsWPFCore
+Imports bdGrupoSanchoToro.db
+Imports System.CodeDom.Compiler
+Imports DevExpress.Xpf.Core
+Imports System.Reflection
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports bdGrupoSanchoToro.db.Utilidades
+
+
+Public Class ucFiestas
+
+
+ Private bd As tscGrupoSanchoToro
+
+
+
+ Public Overrides Sub Cargado()
+
+ End Sub
+
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ gcFiestas.ItemsSource = bd.fiestas.OrderByDescending(Function(x) x.Fecha).ToList
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Fiestas"
+
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "Fiestas"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "fiestas"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Fiestas"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+
+
+ Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim id As Integer = DirectCast(Me.gcFiestas.CurrentItem, fiestas).idFiesta
+ FuncionesDinamicas.AbrirAP(New ucFiesta(id), OtrosParametros)
+ End Sub
+
+ Private Sub ucFiestas_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucFiesta, OtrosParametros)
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucGrupoEnumeraciones.xaml b/GestionGrupoSanchoToro/ucGrupoEnumeraciones.xaml
new file mode 100644
index 0000000..1229882
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucGrupoEnumeraciones.xaml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucGrupoEnumeraciones.xaml.vb b/GestionGrupoSanchoToro/ucGrupoEnumeraciones.xaml.vb
new file mode 100644
index 0000000..6efd5e3
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucGrupoEnumeraciones.xaml.vb
@@ -0,0 +1,124 @@
+
+Imports bdGrupoSanchoToro.db
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore
+Imports System.Collections
+Imports DevExpress.Xpf.Bars
+Imports System.Threading.Tasks
+Imports System.Linq.Dynamic
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports tsUtilidades
+
+Public Class ucGrupoEnumeraciones
+ ''Faltan funciones que no me deja crear (ej EstadoCambiado) cuando se arregle reviso
+
+ Private bd As tscGrupoSanchoToro
+ Private _idGrupo As Integer?
+
+ Public Sub New(Optional idGrupo As Integer? = Nothing)
+
+ ' Esta llamada es exigida por el diseñador.
+ _idGrupo = idGrupo
+ InitializeComponent()
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "GrupoEnumeraciones.Nuevo"
+ Else
+ Return "GrupoEnumeraciones." & DirectCast(Me.DataContext, gruposenumeraciones).idGrupoEnumeracion.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Grupo Enumeraciones"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "gruposenumeraciones"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Dim mv As gruposenumeraciones = Me.DataContext
+ Me.docpanel.Caption = "Grupo Enumeraciones " & mv.Grupo.ToString
+ Else
+ Me.docpanel.Caption = "Grupo Enumeraciones. Nuevo"
+
+ End If
+ End Sub
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucGruposEnumeraciones)
+ End Sub
+
+ Private Sub ucGrupoEnumeraciones_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim gr As gruposenumeraciones = Me.DataContext
+ _idGrupo = gr.idGrupoEnumeracion
+ End Sub
+
+ Dim ra As gruposenumeraciones
+ ' Private WithEvents blenumeraciones As ComponentModel.BindingList(Of db.enumeraciones)
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+
+ If FuerzaNuevo OrElse _idGrupo Is Nothing Then
+ ra = New gruposenumeraciones
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ Dim id As Integer = _idGrupo
+ ra = bd.gruposenumeraciones.First(Function(X) X.idGrupoEnumeracion = id)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ Me.DataContext = ra
+ ' blenumeraciones = tsWPFCore.tsUserControl.Obtienebl(ra.enumeraciones.ToList)
+ Me.gcEnumeraciones.ItemsSource = ra.enumeraciones ' blenumeraciones
+
+ Return NuevoEstado
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRADOR", idUsuario)
+ End Function
+
+ Public Overrides Function ObtieneBD() As ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ Private Sub tvEnumeraciones_CellValueChanged(sender As Object, e As DevExpress.Xpf.Grid.CellValueChangedEventArgs) Handles tvEnumeraciones.CellValueChanged
+ Select Case e.Column.FieldName.ToLower
+ Case "codigo"
+ If e.Value.ToString.Length > 0 AndAlso ra.Grupo.Length > 0 Then
+ If Not e.Value.ToString.StartsWith(ra.Grupo & ".") Then
+ Dim enu As bdGrupoSanchoToro.db.enumeraciones = e.Row
+ enu.Codigo = ra.Grupo & "." & e.Value.ToString
+
+ End If
+ End If
+ End Select
+ End Sub
+
+ Private Sub gcEnumeraciones_AntesEliminar(gc As tsGridControl, ByRef Cancelar As Boolean) Handles gcEnumeraciones.AntesEliminar
+ Dim enu As enumeraciones = gcEnumeraciones.CurrentItem
+ ' enu.idEnumeracion = 1
+ Debug.Write("aqui")
+ End Sub
+End Class
+
diff --git a/GestionGrupoSanchoToro/ucGrupoUsuarios.xaml b/GestionGrupoSanchoToro/ucGrupoUsuarios.xaml
new file mode 100644
index 0000000..6519a4a
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucGrupoUsuarios.xaml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucGrupoUsuarios.xaml.vb b/GestionGrupoSanchoToro/ucGrupoUsuarios.xaml.vb
new file mode 100644
index 0000000..10d3fce
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucGrupoUsuarios.xaml.vb
@@ -0,0 +1,108 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports System.Data.Objects.DataClasses
+
+
+Public Class ucGrupoUsuarios
+ ''Faltan funciones que no me deja crear (ej EstadoCambiado) cuando se arregle reviso
+
+ Private bd As tscGrupoSanchoToro
+ Private _idGrupo As Integer?
+
+ Public Sub New(idGrupo As Integer?)
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+ _idGrupo = idGrupo
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "GrupoUsuario.Nuevo"
+ Else
+ Return "GrupoUsuario." & DirectCast(Me.DataContext, gruposusuarios).idGrupo.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Grupo Usuarios"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "gruposusuarios"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Grupo Usuarios"
+ End Sub
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucGruposUsuarios)
+ End Sub
+
+ Private Sub ucGrupoUsuarios_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim gr As gruposusuarios = Me.DataContext
+ _idGrupo = gr.idGrupo
+ End Sub
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+ Dim ra As gruposusuarios
+ If FuerzaNuevo OrElse _idGrupo Is Nothing Then
+ ra = New gruposusuarios
+ Me.DataContext = ra
+ _idGrupo = Nothing
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ ra = bd.gruposusuarios.First(Function(x) x.idGrupo = _idGrupo.Value)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ gcusuarios.ItemsSource = ra.usuarios.ToList
+ Me.DataContext = ra
+ Return NuevoEstado
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ 'Public Overrides Function ObtieneConexionBD() As BBDD
+ ' Return bdGrupoSanchoToro.db.tscGrupoSanchoToro.bdga
+ 'End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRADORES", idUsuario)
+ End Function
+
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucGruposEnumeraciones.xaml b/GestionGrupoSanchoToro/ucGruposEnumeraciones.xaml
new file mode 100644
index 0000000..dffcb0d
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucGruposEnumeraciones.xaml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucGruposEnumeraciones.xaml.vb b/GestionGrupoSanchoToro/ucGruposEnumeraciones.xaml.vb
new file mode 100644
index 0000000..18d27c3
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucGruposEnumeraciones.xaml.vb
@@ -0,0 +1,155 @@
+
+Imports bdGrupoSanchoToro.db
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore
+Imports System.Collections
+Imports DevExpress.Xpf.Bars
+Imports System.Threading.Tasks
+Imports System.Linq.Dynamic
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports DevExpress.Xpf.Grid
+Imports tsUtilidades
+
+Public Class ucGruposEnumeraciones
+
+
+ Dim bd As tscGrupoSanchoToro
+
+ Public Overrides Sub Cargado()
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "GruposEnumeraciones"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Grupos Enumeraciones"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "gruposenumeraciones"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Grupos de Enumeraciones"
+ End Sub
+
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Try
+ Dim grs = (From g In bd.gruposenumeraciones Select g Where g.Oculto = False)
+ DataContext = grs
+ Me.gc.ItemsSource = grs
+
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ 'Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ ' bd = tscGrupoSanchoToro.NuevoContexto
+ ' Return bd
+ 'End Function
+
+ 'Public Overrides Function ObtieneConexionBD() As BBDD
+ ' Return bdGrupoSanchoToro.db.tscGrupoSanchoToro.bdga
+ 'End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRADOR", idUsuario)
+ End Function
+
+ Private Sub ucGruposEnumeraciones_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim ra = DirectCast(Me.gc.CurrentItem, gruposenumeraciones)
+ Dim id As Integer = ra.idGrupoEnumeracion
+ FuncionesDinamicas.AbrirAP(New ucGrupoEnumeraciones(id), OtrosParametros)
+ End Sub
+
+ Public Overrides Function ObtieneBD() As ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ Private Sub ucGruposEnumeraciones_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucGrupoEnumeraciones, OtrosParametros)
+ End Sub
+
+ 'Private WithEvents ApLineas As tsWPFCore.ApLineas
+ 'Public ReadOnly Property Titulo As String Implements tsWPFCore.IApLineas.Titulo
+ ' Get
+ ' Return "Grupos de Enumeraciones"
+ ' End Get
+ 'End Property
+
+
+ 'Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles ApLineas.Enlazar
+ ' If Defecto Then
+ ' Dim id As Integer = Me.gc.SelectedItems(0).idGrupoEnumeracion
+ ' Dim ucgrupo As New ucGrupoEnumeraciones
+ ' FuncionesDinamicas.AbrirUcCL(ucgrupo, Comun.dwi.grupodoc, Nothing, ApLineas.dcfg, ApLineas.dcn, 0, ApLineas.dsc, ApLineas.OtrosParametros, id)
+ ' Else
+ ' Dim grupo As gruposenumeraciones = Celda.RowData.Row
+ ' Dim gr As New ucGrupoEnumeraciones
+ ' FuncionesDinamicas.AbrirUcCL(gr, Comun.dwi.grupodoc, Nothing, ApLineas.dcfg, ApLineas.dcn, 0, ApLineas.dsc, ApLineas.OtrosParametros, grupo.idGrupoEnumeracion)
+ ' End If
+ 'End Sub
+
+ 'Public Sub EstableceDataContext(ByRef DataContext As Object, Optional BackGround As Boolean = False) Implements tsWPFCore.IApLineas.EstableceDataContext
+ ' Try
+ ' Dim grs = (From g In bd.gruposenumeraciones Select g Where g.Oculto = False)
+ ' DataContext = grs
+ ' Me.gc.ItemsSource = grs
+ ' Catch ex As Exception
+ ' If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ ' DXMessageBox.Show(ex.Message, "Error")
+ ' End Try
+ 'End Sub
+
+ 'Public ReadOnly Property NombreTablaBase As String Implements tsWPFCore.IApLineas.NombreTablaBase
+ ' Get
+ ' Return "gruposenumeraciones"
+ ' End Get
+ 'End Property
+
+ 'Public Sub Nuevo() Implements tsWPFCore.IApLineas.Nuevo
+
+ ' Dim ucGrupo As New ucGrupoEnumeraciones
+ ' FuncionesDinamicas.AbrirUcCL(ucGrupo, Comun.dwi.grupodoc, Nothing, ApLineas.dcfg, ApLineas.dcn, 0, ApLineas.dsc, ApLineas.OtrosParametros, Nothing)
+ 'End Sub
+
+
+
+ 'Public Sub EstableceApLin(ApLin As tsWPFCore.ApLineas) Implements tsWPFCore.IApLineas.EstableceApLin
+ ' Me.ApLineas = ApLin
+ 'End Sub
+
+ 'Public Function ObtieneContexto(dcn As tsUtilidades.Datos.DatosConexionCliente) As System.Data.Objects.ObjectContext Implements tsWPFCore.IApLineas.ObtieneContexto
+ ' bd = tscGrupoSanchoToro.NuevoContexto
+ ' Return bd
+ 'End Function
+
+ 'Public Function ObtienePermisos() As tsUtilidades.Permisos Implements tsWPFCore.IApLineas.ObtienePermisos
+ ' Return Comun.ObtienePermisos(Me.bd, "AP.GRUPOSENUMERACIONES", Me.ApLineas.dsc.idUsuario)
+ 'End Function
+
+ 'Public Function ObtieneRejilla() As tsWPFCore.tsGridControl Implements tsWPFCore.IApLineas.ObtieneRejilla
+ ' Return Me.gc
+ 'End Function
+
+ 'Public Function ObtieneCampoIndice() As String Implements tsWPFCore.IApLineas.ObtieneCampoIndice
+ ' Return "idGrupoEnumeracion"
+ 'End Function
+End Class
diff --git a/GestionGrupoSanchoToro/ucGruposUsuarios.xaml b/GestionGrupoSanchoToro/ucGruposUsuarios.xaml
new file mode 100644
index 0000000..4994d52
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucGruposUsuarios.xaml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucGruposUsuarios.xaml.vb b/GestionGrupoSanchoToro/ucGruposUsuarios.xaml.vb
new file mode 100644
index 0000000..a77b8c2
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucGruposUsuarios.xaml.vb
@@ -0,0 +1,90 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports System.Data.Objects.DataClasses
+
+
+
+Public Class ucGruposUsuarios
+
+
+ Dim bd As tscGrupoSanchoToro
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "GruposUsuarios"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Grupos Usuarios"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "gruposusuarios"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Grupos de usuarios"
+ End Sub
+
+ Public Overrides Sub Cargado()
+ End Sub
+
+ Private Sub ucGruposUsuarios_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim id As Integer = DirectCast(Me.gc.CurrentItem, gruposusuarios).idGrupo
+ FuncionesDinamicas.AbrirAP(New ucGrupoUsuarios(id), OtrosParametros)
+ End Sub
+
+ Private Sub ucGruposUsuarios_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucGrupoUsuarios(Nothing), OtrosParametros)
+ End Sub
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Try
+ Dim gusus = (From g In bd.gruposusuarios Select g).ToList
+ DataContext = gusus
+ Me.gc.ItemsSource = gusus
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRADORES", idUsuario)
+ End Function
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucModelo347.xaml b/GestionGrupoSanchoToro/ucModelo347.xaml
new file mode 100644
index 0000000..8c9dcf5
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucModelo347.xaml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucModelo347.xaml.vb b/GestionGrupoSanchoToro/ucModelo347.xaml.vb
new file mode 100644
index 0000000..164875c
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucModelo347.xaml.vb
@@ -0,0 +1,247 @@
+Imports bdGrupoSanchoToro.db.Utilidades
+
+Imports DevExpress.Xpf.Grid
+Imports DevExpress.Xpf.Core
+Imports System.Linq.Dynamic
+Imports tsUtilidades.Datos
+Imports tsWPFCore
+Imports DevExpress.Xpf.Bars
+Imports System.IO
+Imports Microsoft.Win32
+Imports System.Threading.Tasks
+
+Imports tsUtilidades.Extensiones
+
+Public Class ucModelo347
+
+ Dim bd As tscGrupoSanchoToro
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Modelo 347"
+ End Sub
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "Modelo347"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Modelo347"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return ""
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Dim Acciones As New List(Of tsWPFCore.Accion)
+ Acciones.Add(New Accion With {
+ .idAccion = 1,
+ .Descripcion = "ENVIA LISTADO A ASESORÍA"})
+ Acciones.Add(New Accion With {
+ .idAccion = 2,
+ .Descripcion = "ENVIA EMAIL CON LISTADO DE FACTURAS A CLIENTES SELECCIONADOS"})
+ Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
+ If Acciones.Count > 0 Then Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
+ End Sub
+
+
+
+ Public Overrides Sub Cargado()
+ Me.HabilitarRefresco = True
+ teAnno.EditValue = Now.Year - 1
+ GridBusqueda = Me.gc
+ GridSeleccion = gc
+ Me.ContenedorAplicacion.btSeleccionar.IsChecked = True
+ End Sub
+
+
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ ' ObtieneAsientosAsync(bd, Background)
+ If Refrescar OrElse Background Then Obtiene347Async(bd, Background)
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+ 'Public Overrides Function ObtieneConexionBD() As BBDD
+ ' Return bdGrupoSanchoToro.db.tscGrupoSanchoToro.bdga
+ 'End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim per = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ per.Nuevos = False
+ Return per
+ End Function
+
+
+
+ Public Sub New()
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+
+
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+ Public Function Obtiene347(ByRef DataContext As Object, BackGround As Boolean, año As Integer) As List(Of Mod347)
+ Dim rs As List(Of Mod347)
+ Dim iNumExc As Integer = 0
+ Do
+ Try
+ Dim fi As New DateOnly(año, 1, 1)
+ Dim ff As New DateOnly(año, 12, 31)
+ 'rs = bd.facturas.Include(Function(x) x.idClienteNavigation).Where(Function(x) x.FechaFactura >= fi AndAlso x.FechaFactura <= ff).GroupBy(Function(x) x.idCliente).Where(Function(x) x.Sum(Function(y) y.TotalFactura) > 3005.06).ToList _
+ '.Select(Function(x) New Mod347 With {.Año = año,
+ ' .CIF = x.FirstOrDefault.idClienteNavigation.NIF,
+ ' .RazonSocial = x.FirstOrDefault.idClienteNavigation.RazonSocial,
+ ' .BaseImponible = Math.Round(x.Sum(Function(y) y.ImporteBruto), 2, MidpointRounding.AwayFromZero),
+ ' .IVA = Math.Round(x.Sum(Function(y) y.TotalIVA), 2, MidpointRounding.AwayFromZero),
+ ' .TotalFacturado = Math.Round(x.Sum(Function(y) y.TotalFactura), 2, MidpointRounding.AwayFromZero)}).ToList
+ rs = bd.facturas.Include(Function(x) x.idClienteNavigation).Where(Function(x) x.FechaFactura >= fi AndAlso x.FechaFactura <= ff).ToList.GroupBy(Function(x) x.idCliente).Where(Function(x) x.Sum(Function(y) y.TotalFactura) > 3005.06).ToList _
+ .Select(Function(x) New Mod347 With {.Año = año,
+ .CIF = x.FirstOrDefault.idClienteNavigation.NIF,
+ .RazonSocial = x.FirstOrDefault.idClienteNavigation.RazonSocial,
+ .BaseImponible = Math.Round(x.Sum(Function(y) y.TotalBaseImponible), 2, MidpointRounding.AwayFromZero),
+ .IVA = Math.Round(x.Sum(Function(y) y.TotalIVA), 2, MidpointRounding.AwayFromZero),
+ .TotalFacturado = Math.Round(x.Sum(Function(y) y.TotalFactura), 2, MidpointRounding.AwayFromZero)}).ToList
+ Exit Do
+ Catch ex As Exception
+ If Not BackGround Then Throw New Exception(ex.Message, ex)
+ iNumExc += 1
+ If iNumExc > 3 Then
+ Throw New Exception(ex.Message, ex)
+ End If
+ End Try
+ Loop
+ Return rs
+ End Function
+
+ Public Async Sub Obtiene347Async(bd As tscGrupoSanchoToro, Background As Boolean)
+ Try
+
+
+ Dim rs As New List(Of Mod347)
+
+ Dim Anno As Integer = Integer.Parse(Me.teAnno.Text.Trim)
+ If Background Then
+ Me.ContenedorAplicacion.IsEnabled = False
+ Await Task.Run(Sub()
+ rs = Obtiene347(bd, Background, Anno)
+ End Sub)
+ Else
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Buscando Facturas ...")
+ rs = Obtiene347(bd, Background, Anno)
+ End If
+
+ gc.ItemsSource = rs
+ DataContext = rs
+ gc.SelectAll()
+
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ Me.ContenedorAplicacion.IsEnabled = True
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+
+ Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim cif As String = DirectCast(Me.gc.CurrentItem, Mod347).CIF
+ Dim id = bd.entidades.First(Function(x) x.NIF = cif).idEntidad
+ FuncionesDinamicas.AbrirAP(New ucEntidad(id), Me.OtrosParametros)
+ End Sub
+
+ Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
+ Obtiene347Async(bd, False)
+ End Sub
+
+ Private Sub uc_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
+ Try
+ Dim tc As List(Of Mod347) = gc.ItemsSource
+ Select Case idAccion
+ Case 1
+ Try
+ Dim sCorreo = bd.enumeraciones.First(Function(x) x.Codigo = "CONF.EMAILASESORIA").ValorAlfabeticoLargo
+ Dim dxnc = New dxwEnvioCorreo(sCorreo, "", "", EmpresaActual.RazonSocial & " - Adjunto le remitimos listado Modelo 347", "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos listado Modelo 347", "Modelo347.xlsx")
+ If dxnc.ShowDialog Then
+ Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ gc.ItemsSource = tc
+ Dim ms As New MemoryStream
+ tv.ExportToXlsx(ms)
+ Dim bListado = ms.ToArray
+ bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, dxnc._Asunto, dxnc._Cuerpo, cta, dxnc._Destinatarios, dxnc._CC, dxnc._BCC, bListado, dxnc._Adjunto,, "MODELO347")
+ End If
+ Catch ex As Exception
+ Throw New Exception(ex.Message, ex)
+ End Try
+ Case 2
+ Dim clis = gc.ElementosSeleccionados.Cast(Of Mod347).ToList
+ If clis.Count = 0 Then
+ DXMessageBox.Show("Antes debe seleccionar algún cliente", "Atención")
+ Else
+
+ Dim sFacturas As String = ""
+ Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ Dim sMensaje As String = ""
+ Dim NumCorreos As Integer = 0
+ If DXMessageBox.Show("Atención se van a enviar " & clis.Count.ToString & " correos. ¿Desea Continuar?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.Yes Then
+ DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Generando correos, por favor espere ...")
+ For Each cl In clis
+ Dim ent = bd.entidades.First(Function(x) x.NIF = cl.CIF)
+ If ent.Email.NothingAVacio = "" Then
+ sMensaje &= ent.RazonSocial & vbCrLf
+ Else
+ NumCorreos += 1
+ Dim Asunto, Cuerpo As String
+ Asunto = EmpresaActual.RazonSocial & " - Adjunto le remitimos Listados de facturas correspondientes al modelo 347"
+ Cuerpo = "Distinguidos Sres., adjunto le remitimos Listados de facturas correspondientes al modelo 347, que suman un total de " & cl.TotalFacturado.ToString("c2")
+ Dim fras = bd.facturas.Where(Function(x) x.idClienteNavigation.NIF = cl.CIF AndAlso x.FechaFactura.Year = cl.Año).Select(Function(x) New With {.NumeroFactura = x.NumeroFactura, .FechaFactura = x.FechaFactura, .BaseImponible = x.TotalBaseImponible, .IVA = x.TotalIVA, .TotalFactura = x.TotalFactura}).OrderBy(Function(x) x.FechaFactura).ToList
+ Dim b() As Byte = tsWPFCore.Utilidades.Varias.IEnumerableAExcel(fras)
+ bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, Asunto, Cuerpo, cta, ent.Email, ent.Email2, cta.Remitente, b, "Facturas-" & cl.Año.ToString & ".xlsx", ent.idEntidad, "ENTIDAD", ent.idEntidad)
+ End If
+ Next
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End If
+ If sMensaje <> "" Then
+ DXMessageBox.Show("Los siguientes Clientes no tienen correo electrónico: " & sMensaje, "Generación de correos")
+ End If
+ DXMessageBox.Show("Se han generado " & NumCorreos.ToString & " correos electrónicos", "Generación de correos")
+ End If
+ End Select
+ Catch ex As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
+ 'Comun.GeneraRegistroCorreoExcepcion(bd, ex, "ucMod347_EjecutarAccion")
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show("Error " & ex.Message, "Error")
+ Finally
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+End Class
+
+Public Class Mod347
+ Property Año As Integer
+ Property CIF As String
+ Property RazonSocial As String
+ Property BaseImponible As Double
+ Property IVA As Double
+ Property TotalFacturado As Double
+End Class
+
diff --git a/GestionGrupoSanchoToro/ucMovimientoCaja.xaml b/GestionGrupoSanchoToro/ucMovimientoCaja.xaml
new file mode 100644
index 0000000..221ed43
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucMovimientoCaja.xaml
@@ -0,0 +1,218 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gastos = Importe Negativo
+ Ingresos = Importe Positivo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucMovimientoCaja.xaml.bak b/GestionGrupoSanchoToro/ucMovimientoCaja.xaml.bak
new file mode 100644
index 0000000..67086dc
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucMovimientoCaja.xaml.bak
@@ -0,0 +1,218 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gastos = Importe Negativo
+ Ingresos = Importe Positivo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucMovimientoCaja.xaml.vb b/GestionGrupoSanchoToro/ucMovimientoCaja.xaml.vb
new file mode 100644
index 0000000..51a0418
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucMovimientoCaja.xaml.vb
@@ -0,0 +1,328 @@
+Imports System.Data
+Imports DevExpress.Xpf.Core
+Imports bdGrupoSanchoToro.db
+Imports DevExpress.Xpf.Bars
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports DevExpress.Xpf.Grid
+Imports tsEFCore8.Extensiones
+Imports Microsoft.Win32
+Imports tsUtilidades
+
+Public Class ucMovimientoCaja
+
+
+ Private bd As tscGrupoSanchoToro
+ Friend _idMovimiento As Nullable(Of Integer)
+ Friend idLog As Integer?
+ Dim ra As movimientoscaja
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
+
+
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+
+ If idLog.HasValue Then
+ Try
+ Dim log = bd.logs.First(Function(x) x.idLog = idLog)
+ ra = tsUtilidades.Utilidades.DeserializarSinErrores(log.Log, GetType(movimientoscaja))
+ If ra.idUsuario.HasValue Then ra.idUsuarioNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuario.Value)
+ If ra.idFactura.HasValue Then
+ ra.idFacturaNavigation = bd.facturas.FirstOrDefault(Function(x) x.idFactura = ra.idFactura)
+ End If
+
+ If ra.idFacturaRecibida.HasValue Then
+ ra.idFacturaRecibidaNavigation = bd.facturasrecibidas.FirstOrDefault(Function(x) x.idFactura = ra.idFacturaRecibida)
+ End If
+ Dim lfic = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "FICHEROS")
+ If lfic IsNot Nothing Then
+ Dim fic As db.ficheros = tsUtilidades.Utilidades.DeserializarSinErrores(lfic.Log, GetType(db.ficheros))
+ ra.idFicheroNavigation = fic
+ End If
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ Catch EX As Exception
+ Throw New Exception("No ha sido posible mostrar el registro del cambio (id " & idLog.Value.ToString & ").", EX)
+ End Try
+ Else
+ If _idMovimiento.HasValue Then ra = bd.movimientoscaja.FirstOrDefault(Function(x) x.idMovimiento = _idMovimiento.Value)
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo OrElse _idMovimiento Is Nothing OrElse FuerzaNuevo OrElse ra Is Nothing Then
+ ra = New movimientoscaja
+ ra.Tipo = bdGrupoSanchoToro.db.TipoMovimientoEnum.OTROS_GASTOS_O_INGRESOS
+ Me.DataContext = ra
+ _idMovimiento = Nothing
+ ra.idUsuarioNavigation = bd.usuarios.First(Function(x) x.idUsuario = idUsuario)
+ ra.FechaCreacion = bd.AhoraMySql
+ ra.Fecha = ra.FechaCreacion
+ If bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja.HasValue = False).Count = 1 Then
+ ra.idCaja = bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja.HasValue = False).First.idCaja
+ End If
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+
+ Select Case DirectCast(ra.Tipo, TipoMovimientoEnum)
+ Case TipoMovimientoEnum.RECIBO_CLIENTE
+ Dim plantillas As New List(Of tsWPFCore.Plantilla)
+ plantillas.Add(New tsWPFCore.Plantilla With {.idPlantilla = 0, .Descripcion = "RECIBO"})
+ Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = plantillas
+ Me.ContenedorAplicacion.bePlantilla.EditValue = plantillas.First.idPlantilla
+
+ Case TipoMovimientoEnum.CIERRE_CAJA
+ Dim plantillas As New List(Of tsWPFCore.Plantilla)
+ plantillas.Add(New tsWPFCore.Plantilla With {.idPlantilla = 0, .Descripcion = "IMPRIMIR CIERRE CAJA"})
+ Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = plantillas
+ Me.ContenedorAplicacion.bePlantilla.EditValue = plantillas.First.idPlantilla
+ Case Else
+ Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = Nothing
+ End Select
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ End If
+ Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idMovimiento AndAlso x.Aplicacion = "MOVIMIENTOSCAJA").ToList
+ Me.DataContext = ra
+ Return NuevoEstado
+
+ End Function
+
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "movimientoscaja"
+ End Get
+ End Property
+
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If idLog.HasValue Then
+ Return "MovimientosCaja R.C.:" & idLog.ToString
+ Else
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "MovimientosCaja.Nuevo"
+ Else
+ Return "MovimientosCaja." & DirectCast(Me.DataContext, movimientoscaja).idMovimiento.ToString
+ End If
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Movimiento Caja"
+ End Get
+ End Property
+
+ Public Sub New(Optional idMovimiento As Integer? = Nothing)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ _idMovimiento = idMovimiento
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Me.cbTipo.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(TipoMovimientoEnum))
+ Me.cbCaja.ItemsSource = bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja.HasValue = False OrElse x.idCaja = ra.idCaja).OrderBy(Function(x) x.Descripcion).ToList
+
+ 'Dim plantillas As New List(Of tsWPFCore.Plantilla)
+ 'plantillas.Add(New tsWPFCore.Plantilla With {.idPlantilla = 0, .Descripcion = "RECIBO"})
+ 'Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = plantillas
+ 'If plantillas.Count > 0 Then
+ ' Me.ContenedorAplicacion.bePlantilla.EditValue = plantillas.First.idPlantilla
+ 'End If
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+
+ If idLog.HasValue Then
+ Dim mv As movimientoscaja = Me.DataContext
+ Me.docpanel.Caption = "R.C. Movimiento Caja " & mv.idMovimiento.ToString
+ Me.docpanel.Tag = "R.C. Movimiento Caja." & mv.idMovimiento.ToString
+ Else
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Dim mv As movimientoscaja = Me.DataContext
+ Me.docpanel.Caption = "Movimiento Caja " & mv.idMovimiento.ToString
+ Me.docpanel.Tag = "MovimientoCaja." & mv.idMovimiento.ToString
+ Else
+ Me.docpanel.Caption = "Movimiento Caja Nuevo"
+ Me.docpanel.Tag = "MovimientoCaja.Nuevo"
+ End If
+ End If
+ End Sub
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim per = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ per.Eliminar = False
+ Return per
+ End Function
+
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucCajas)
+ End Sub
+
+ Private Sub HlMovimientoCierre_Click(sender As Object, e As RoutedEventArgs)
+
+ FuncionesDinamicas.AbrirAP(New ucMovimientoCaja(ra.idMovimientoCierre), OtrosParametros)
+ End Sub
+
+ Private Sub HlAlbaranEntrega_Click(sender As Object, e As RoutedEventArgs)
+
+
+ End Sub
+
+ Private Sub HlFacturaRecibida_Click(sender As Object, e As RoutedEventArgs)
+
+ FuncionesDinamicas.AbrirAP(New ucFacturaRecibida(ra.idFacturaRecibida), OtrosParametros)
+ End Sub
+
+ Private Sub HlFacturaEmitida_Click(sender As Object, e As RoutedEventArgs)
+ 'Dim ra As movimientoscaja = Me.DataContext
+ 'FuncionesDinamicas.AbrirAP(New ucFacturaEmitida(ra.idFactura), OtrosParametros)
+ End Sub
+
+ Private Sub ucMovimientoCaja_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
+
+ Dim hte As New Hashtable
+ If ra.Observaciones.NothingAVacio = "" AndAlso Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ hte.Add("ALMACENAR-OBSERVACIONES_OBLIGATORIAS", "Las observaciones son obligatorias en caso de Movimientos Nuevos")
+ End If
+ If ra.Importe = 0 Then
+ hte.Add("ALMACENAR-IMPORTE_DISTINTO_0", "El importe no puede ser 0")
+ End If
+
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ End If
+ End Sub
+
+ Private Sub ucMovimientoCaja_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
+ Dim rec As movimientoscaja = Me.DataContext
+
+ Select Case DirectCast(rec.Tipo, TipoMovimientoEnum)
+ Case TipoMovimientoEnum.RECIBO_CLIENTE
+
+ If Not Guardar(Nothing, Nothing) Then
+ Dim lr As New List(Of movimientoscaja)
+ If rec.Fecha = Date.MinValue Then
+ rec.Fecha = bd.AhoraMySql
+ rec.FechaCreacion = rec.Fecha
+ End If
+ lr.Add(rec)
+ Dim cp As String = "RECIBO"
+ Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.Codigo = cp).Select(Function(x) New With {.Fichero = x.idFicheroNavigation.Fichero, .Tipo = x.idGrupoNavigation.Codigo}).FirstOrDefault
+ Informes.ImprimirPlantilla(bd, pl.Fichero, lr, False, 1)
+
+ End If
+ Case TipoMovimientoEnum.CIERRE_CAJA
+ Dim lm As New List(Of movimientoscaja)
+ lm.Add(rec)
+ Dim xr As New xrCierreCaja
+ Informes.ImprimeInforme(xr, False, 1, bd.AhoraMySql, lm)
+ End Select
+ End Sub
+
+ Private Sub ap_EstadoCambiado(EstadoAnterior As tsUtilidades.EstadosAplicacion, EstadoNuevo As tsUtilidades.EstadosAplicacion) Handles Me.EstadoCambiado
+ Select Case EstadoNuevo
+ Case EstadosAplicacion.ModificandoRegistro
+
+ If Me.ObtienePermisos.Modificar Then
+ If ra.FechaSupervision.HasValue OrElse ra.idMovimientoCierre.HasValue OrElse ra.Tipo = bdGrupoSanchoToro.db.TipoMovimientoEnum.CIERRE_CAJA Then
+ Dim per = Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRATIVOS", idUsuario)
+ If Not per.Modificar Then
+ Me.EstableceSoloLectura()
+ End If
+ ' Me.ContenedorAplicacion.btGuardar.IsEnabled = True
+ ' Me.ContenedorAplicacion.btGuardarYBuscar.IsEnabled = True
+ End If
+ End If
+ End Select
+ If idLog.HasValue Then EstableceSoloLectura()
+
+ End Sub
+
+ Private Sub ucMovimientoCaja_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+
+ Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idMovimiento AndAlso x.Aplicacion = "MOVIMIENTOSCAJA").ToList
+ _idMovimiento = ra.idMovimiento
+ End Sub
+
+ Private Sub ucMovimientoCaja_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Select Case Celda.Column.FieldName.ToLower
+ Case "idlog"
+ Dim log As logs = gcLogs.CurrentItem
+ Dim id As Integer = log.idLog
+ Dim uc As New ucMovimientoCaja
+ uc.idLog = log.idLog
+ FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
+ End Select
+ End Sub
+
+ Private Sub hlConciliacion_Click(sender As Object, e As RoutedEventArgs)
+
+ FuncionesDinamicas.AbrirAP(New ucConciliacionBancaria(ra.idConciliacion), OtrosParametros)
+ End Sub
+ Private Sub BeDocumentoAdjunto_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
+ Try
+ Dim ofd As New OpenFileDialog
+ If ofd.ShowDialog Then
+
+ If ra.idFicheroNavigation Is Nothing Then
+ ra.idFicheroNavigation = New db.ficheros
+ End If
+ ra.idFicheroNavigation.NombreFichero = IO.Path.GetFileName(ofd.FileName)
+ ra.idFicheroNavigation.Fichero = IO.File.ReadAllBytes(ofd.FileName)
+ ra.idFicheroNavigation.idTipo = bd.enumeraciones.First(Function(x) x.Codigo = "TIPFIC.MC").idEnumeracion
+ ra.FicheroAdjuntoTMP = ra.idFicheroNavigation.NombreFichero
+ End If
+ Catch EX As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, EX)
+ DXMessageBox.Show(EX.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub BiEliminar_Click(sender As Object, e As RoutedEventArgs)
+ Try
+
+ If ra.idFicheroNavigation Is Nothing OrElse ra.idFicheroNavigation.Fichero Is Nothing Then
+ DXMessageBox.Show("La factura actual no tiene ningún documento adjunto.", "Atención")
+ Else
+ Try
+ bd.ficheros.Remove(ra.idFicheroNavigation)
+ Catch ex As Exception
+ End Try
+ ra.idFicheroNavigation = Nothing
+ ra.FicheroAdjuntoTMP = ""
+ End If
+ Catch EX As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, EX)
+ DXMessageBox.Show(EX.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub BiVer_Click(sender As Object, e As RoutedEventArgs)
+ Try
+
+ If ra.idFicheroNavigation Is Nothing OrElse ra.idFicheroNavigation.Fichero Is Nothing Then
+ DXMessageBox.Show("La factura actual no tiene ningún documento adjunto.", "Atención")
+ Else
+ Dim sFicAleatorio As String = tsUtilidades.Utilidades.ObtieneDirectorioAleatorio("GrupoSanchoToro") & ra.idFicheroNavigation.NombreFichero
+ IO.File.WriteAllBytes(sFicAleatorio, ra.idFicheroNavigation.Fichero)
+ tsUtilidades.Sistema.EjecutaFichero(sFicAleatorio)
+ End If
+ Catch EX As Exception
+ FuncionesDinamicas.ErrorNoControladoAp(Me, EX)
+ DXMessageBox.Show(EX.Message, "Error")
+ End Try
+ End Sub
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucMovimientosCaja.xaml b/GestionGrupoSanchoToro/ucMovimientosCaja.xaml
new file mode 100644
index 0000000..65bf9f7
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucMovimientosCaja.xaml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucMovimientosCaja.xaml.vb b/GestionGrupoSanchoToro/ucMovimientosCaja.xaml.vb
new file mode 100644
index 0000000..d4e82bb
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucMovimientosCaja.xaml.vb
@@ -0,0 +1,272 @@
+
+Imports bdGrupoSanchoToro.db
+Imports System.Data.Entity
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore
+Imports System.Collections
+Imports DevExpress.Xpf.Bars
+Imports System.Threading.Tasks
+Imports System.Linq.Dynamic
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports System.IO
+Imports tsEFCore8.Extensiones
+
+Public Class ucMovimientosCaja
+
+
+ Private bd As tscGrupoSanchoToro
+
+ Private _CamposBusquedaNumericos() As String = {"idAlbaranEntrega", "idMovimiento", "Importe"}
+ Private _CamposBusquedaAlfabeticos() As String = {"movimientos.entidades.RazonSocial", "movimientos.entidades.NIF", "movimientos.NumeroFactura", "movimientosrecibidas.entidades.RazonSocial", "movimientosrecibidas.entidades.NIF", "movimientosrecibidas.NumeroFactura"}
+
+
+
+ Public Sub New()
+
+ ' Esta llamada es exigida por el diseñador.
+ InitializeComponent()
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+ Public Overrides Sub Cargado()
+ ContenedorAplicacion.btGuardar.IsVisible = False
+ ContenedorAplicacion.siEstado.IsVisible = False
+ Dim Hoy = Date.Today
+ teFechaFin.EditValue = Hoy
+ teFechaInicio.EditValue = Hoy.AddDays(-30)
+ Me.GridSeleccion = Me.gc
+ End Sub
+
+
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ If Background OrElse Refrescar Then ObtienemovimientosAsync(bd, Background)
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Dim Acciones As New List(Of tsWPFCore.Accion)
+ Acciones.Add(New Accion With {
+ .idAccion = 1,
+ .Descripcion = "ENVIA EXCEL DE MOVIMIENTOS SELECCIONADOS A ASESORIA"})
+ Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
+ Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Movimientos Caja"
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "movimientoscaja"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "movimientoscaja"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Movimientos Caja"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+ Private Sub Nuevo() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucMovimientoCaja, OtrosParametros)
+ End Sub
+
+ Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim ra = DirectCast(Me.gc.CurrentItem, movimientoscaja)
+ Select Case Celda.Column.FieldName.ToLower
+ Case "referenciadocumento"
+ Dim id As Integer
+ If ra.idFactura.HasValue Then
+ id = ra.idFactura
+ ' FuncionesDinamicas.AbrirAP(New ucFacturaEmitida(id), OtrosParametros)
+ Else
+ id = ra.idFacturaRecibida
+ FuncionesDinamicas.AbrirAP(New ucFacturaRecibida(id), OtrosParametros)
+ End If
+ Case "razonsocial"
+ Dim id As Integer
+ If ra.idFactura.HasValue Then
+ id = ra.idFacturaNavigation.idCliente
+ Else
+ id = ra.idFacturaRecibidaNavigation.idProveedor
+ End If
+ FuncionesDinamicas.AbrirAP(New ucEntidad(id), OtrosParametros)
+ Case "idmovimiento"
+ Dim id As Integer
+ id = ra.idMovimiento
+ FuncionesDinamicas.AbrirAP(New ucMovimientoCaja(id), OtrosParametros)
+ Case "impresion"
+ Select Case DirectCast(ra.Tipo, TipoMovimientoEnum)
+ Case TipoMovimientoEnum.CIERRE_CAJA
+ Dim lm As New List(Of movimientoscaja)
+ lm.Add(ra)
+ Dim xr As New xrCierreCaja
+ Informes.ImprimeInforme(xr, False, 1, bd.AhoraMySql, lm)
+ Case TipoMovimientoEnum.RECIBO_CLIENTE
+
+
+ Dim ds As List(Of movimientoscaja)
+ Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.Codigo = "RECIBO").Select(Function(x) New With {.Fichero = x.idFicheroNavigation.Fichero, .Tipo = x.idGrupoNavigation.Codigo}).FirstOrDefault
+ If pl IsNot Nothing Then
+ ds = New List(Of movimientoscaja)
+ ds.Add(ra)
+ Informes.ImprimirPlantilla(bd, pl.Fichero, ds, False, 1)
+ End If
+
+ End Select
+ End Select
+ End Sub
+
+
+ Public Function ObtieneMovimientosCaja(ByRef DataContext As Object, BackGround As Boolean, TextoBusqueda As String) As List(Of movimientoscaja)
+ Dim rs As IQueryable(Of movimientoscaja)
+ Dim lf As New List(Of movimientoscaja)
+ Dim iNumExc As Integer = 0
+ Do
+ Try
+ If TextoBusqueda <> "" Then
+ Dim parametros(0) As Object
+ Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Me._CamposBusquedaNumericos, Me._CamposBusquedaAlfabeticos, Nothing)
+ rs = bd.movimientoscaja.Include(Function(x) x.idFacturaNavigation.idClienteNavigation).Include(Function(x) x.idFacturaRecibidaNavigation.idProveedorNavigation).Include(Function(x) x.idCajaNavigation).Include(Function(x) x.idUsuarioNavigation).Where(ExpresionBusqueda)
+ Else
+ rs = bd.movimientoscaja.Include(Function(x) x.idFacturaNavigation.idClienteNavigation).Include(Function(x) x.idFacturaRecibidaNavigation.idProveedorNavigation).Include(Function(x) x.idCajaNavigation).Include(Function(x) x.idUsuarioNavigation).OrderByDescending(Function(x) x.Fecha)
+ End If
+ Dim fi As Date? = teFechaInicio.EditValue
+ If fi.HasValue Then
+ rs = rs.Where(Function(x) x.Fecha >= fi.Value)
+ End If
+ Dim ff As Date? = teFechaFin.EditValue
+ If ff.HasValue Then
+ ff = ff.Value.AddDays(1)
+ rs = rs.Where(Function(x) x.Fecha < ff.Value)
+ End If
+ If cbIncluirTodos.IsChecked = False Then
+ rs = rs.Where(Function(x) x.idMovimientoCierre Is Nothing)
+ End If
+ lf = rs.OrderBy(Function(x) x.FechaCreacion).ToList
+ Exit Do
+ Catch ex As Exception
+ iNumExc += 1
+ If iNumExc > 3 Then
+ rs = Nothing
+ Exit Do
+ End If
+ End Try
+ Loop
+ Return lf
+ End Function
+
+ Public Async Sub ObtienemovimientosAsync(bd As tscGrupoSanchoToro, Background As Boolean)
+ Try
+ Dim rs As New List(Of movimientoscaja)
+ Dim Busqueda = tsEFCore8.Extensiones.ObjetoNothingAVacio(Me.teBusqueda.EditValue)
+ If Background Then
+ Me.ContenedorAplicacion.IsEnabled = False
+ Await Task.Run(Sub()
+ rs = ObtieneMovimientosCaja(bd, Background, Busqueda)
+ End Sub)
+ Else
+ If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
+ DXSplashScreen.SetState("Buscando Movimientos Caja ...")
+ rs = ObtieneMovimientosCaja(bd, Background, Busqueda)
+ End If
+
+ gc.ItemsSource = rs
+ DataContext = rs
+ Catch ex As Exception
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ DXMessageBox.Show(ex.Message, "Error")
+ Finally
+ Me.ContenedorAplicacion.IsEnabled = True
+ If DXSplashScreen.IsActive Then DXSplashScreen.Close()
+ End Try
+ End Sub
+ Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
+ ObtienemovimientosAsync(bd, False)
+ End Sub
+
+ Private Sub ucMovimientosCaja_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
+ Select Case idAccion
+ Case 1
+ Dim tm As List(Of movimientoscaja) = gc.ItemsSource
+ Try
+
+ Dim movs = gc.ElementosSeleccionados.Cast(Of movimientoscaja).ToList
+ Dim sCorreo = bd.enumeraciones.First(Function(x) x.Codigo = "CONF.EMAILASESORIA").ValorAlfabeticoLargo
+ Dim dxnc = New dxwEnvioCorreo(sCorreo, "", "", EmpresaActual.RazonSocial & " - Adjunto le remitimos listado de movimientos de caja", "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos listado de movimientos de caja", "MovimientosCaja.xlsx")
+ If dxnc.ShowDialog Then
+ Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
+ gc.ItemsSource = movs
+ Dim ms As New MemoryStream
+ tv.ExportToXlsx(ms)
+ ' gc.ItemsSource = tf
+ Dim bFacturas = ms.ToArray
+ bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, dxnc._Asunto, dxnc._Cuerpo, cta, dxnc._Destinatarios, dxnc._CC, dxnc._BCC, bFacturas, dxnc._Adjunto,, "MOVIMIENTOSCAJA")
+ End If
+ Catch ex As Exception
+ Throw New Exception(ex.Message, ex)
+ Finally
+ gc.ItemsSource = tm
+ End Try
+ End Select
+ End Sub
+
+ 'Private Sub ucMovimientosCaja_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
+ ' Select Case idPlantilla
+ ' Case 0
+ ' If Me.DataContext IsNot Nothing Then
+ ' Dim recs = gc.ElementosSeleccionados.Cast(Of movimientoscaja).ToList
+ ' If recs Is Nothing OrElse recs.Count = 0 Then
+ ' DXMessageBox.Show("Seleccione primero algún recibo a imprimir", "Atención")
+ ' Else
+ ' If recs.Any(Function(x) x.Tipo <> TipoMovimientoEnum.RECIBO_CLIENTE) Then
+ ' DXMessageBox.Show("Solo se pueden imprimir recibos de cliente", "Atención")
+ ' Else
+ ' Dim lr As New List(Of movimientoscaja)
+ ' Dim cp As String = "RECIBO"
+ ' If rec.idFactura.HasValue AndAlso rec.facturas.PorcentajeIVA = 0 Then cp = "RECIBOSC"
+ ' Dim idPl = bd.plantillas.First(Function(x) x.Codigo = cp).idPlantilla
+ ' Informes.ImprimirPlantilla(bd, idPlantilla, lr, False, 1)
+ ' End If
+ ' End If
+ ' End If
+ ' End If
+ ' End Select
+ 'End Sub
+
+ 'Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles me.ImprimirPlantilla
+ ' Dim ds As List(Of movimientos)
+ ' Dim pl As plantillas = (From p In bd.plantillas Where p.idPlantilla = idPlantilla).First
+ ' Dim sTipo As String = pl.enumeraciones.Codigo
+ ' Dim al As movimientos = Me.DataContext
+ ' ds = New List(Of movimientos)
+ ' ds.Add(al)
+ ' Select Case sTipo
+ ' Case "GRUPLA.AV-ALBARANES"
+ ' Informes.ImprimirPlantilla(bd, idPlantilla, ds, False)
+ ' End Select
+ 'End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucPermiso.xaml b/GestionGrupoSanchoToro/ucPermiso.xaml
new file mode 100644
index 0000000..de0356f
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucPermiso.xaml
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucPermiso.xaml.vb b/GestionGrupoSanchoToro/ucPermiso.xaml.vb
new file mode 100644
index 0000000..fa73f76
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucPermiso.xaml.vb
@@ -0,0 +1,125 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports System.Data.Objects.DataClasses
+Public Class ucPermiso
+ ''faltan cosas que pasar (ej: init row) no me dejan po el error base
+ Private bd As tscGrupoSanchoToro
+ Private _idPermiso As Integer?
+
+ Public Sub New(idPermiso As Integer?)
+
+ ' Esta llamada es exigida por el diseñador.
+ _idPermiso = idPermiso
+ InitializeComponent()
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "Permiso.Nuevo"
+ Else
+ Return "Permiso." & DirectCast(Me.DataContext, bdGrupoSanchoToro.db.permisos).idPermiso.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Permisos"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "permisos"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Dim listagru = (From gru In bd.gruposusuarios Select gru).ToList
+ Me.cbGrupo.ItemsSource = listagru
+
+ Dim listausu = (From usu In bd.usuarios Select usu).ToList
+ Me.cbUsuario.ItemsSource = listausu
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Permiso"
+ End Sub
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucPermisos)
+ End Sub
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+ Dim ra As bdGrupoSanchoToro.db.permisos
+ If FuerzaNuevo OrElse _idPermiso Is Nothing Then
+ ra = New bdGrupoSanchoToro.db.permisos
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ Dim id As Integer = _idPermiso
+ ra = bd.permisos.First(Function(X) X.idPermiso = id)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ Me.DataContext = ra
+ Me.AutorizacionesGruposGridControl.ItemsSource = ra.autorizacionesgrupos
+ Me.AutorizacionesUsuariosGridControl.ItemsSource = ra.autorizacionesusuarios
+ Return NuevoEstado
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ 'Public Overrides Function ObtieneConexionBD() As BBDD
+ ' Return bdGrupoSanchoToro.db.tscGrupoSanchoToro.bdga
+ 'End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRADORES", idUsuario)
+ End Function
+
+ Private Sub tvAutorizacionesGrupos_InitNewRow(sender As Object, e As DevExpress.Xpf.Grid.InitNewRowEventArgs) Handles tvAutorizacionesGrupos.InitNewRow
+ AutorizacionesGruposGridControl.SetCellValue(e.RowHandle, "PermitirConsultas", False)
+ AutorizacionesGruposGridControl.SetCellValue(e.RowHandle, "PermitirNuevos", False)
+ AutorizacionesGruposGridControl.SetCellValue(e.RowHandle, "PermitirModificaciones", False)
+ AutorizacionesGruposGridControl.SetCellValue(e.RowHandle, "PermitirEliminaciones", False)
+ AutorizacionesGruposGridControl.SetCellValue(e.RowHandle, "PermitirExportar", False)
+ AutorizacionesGruposGridControl.SetCellValue(e.RowHandle, "PermitirImpresiones", False)
+ AutorizacionesGruposGridControl.SetCellValue(e.RowHandle, "OtrosPermisos", False)
+ End Sub
+
+ Private Sub tvAutorizacionesUsuarios_InitNewRow(sender As Object, e As DevExpress.Xpf.Grid.InitNewRowEventArgs) Handles tvAutorizacionesUsuarios.InitNewRow
+ AutorizacionesUsuariosGridControl.SetCellValue(e.RowHandle, "PermitirConsultas", False)
+ AutorizacionesUsuariosGridControl.SetCellValue(e.RowHandle, "PermitirNuevos", False)
+ AutorizacionesUsuariosGridControl.SetCellValue(e.RowHandle, "PermitirModificaciones", False)
+ AutorizacionesUsuariosGridControl.SetCellValue(e.RowHandle, "PermitirEliminaciones", False)
+ AutorizacionesUsuariosGridControl.SetCellValue(e.RowHandle, "PermitirExportar", False)
+ AutorizacionesUsuariosGridControl.SetCellValue(e.RowHandle, "PermitirImpresiones", False)
+ AutorizacionesUsuariosGridControl.SetCellValue(e.RowHandle, "OtrosPermisos", False)
+ End Sub
+
+
+End Class
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucPermisos.xaml b/GestionGrupoSanchoToro/ucPermisos.xaml
new file mode 100644
index 0000000..215adf2
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucPermisos.xaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucPermisos.xaml.vb b/GestionGrupoSanchoToro/ucPermisos.xaml.vb
new file mode 100644
index 0000000..ca7cea0
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucPermisos.xaml.vb
@@ -0,0 +1,80 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports System.Data.Objects.DataClasses
+Public Class ucPermisos
+
+
+ Dim bd As tscGrupoSanchoToro
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "Permisos"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Permisos"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "permisos"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Permisos"
+ End Sub
+
+ Public Overrides Sub Cargado()
+
+ End Sub
+
+ Private Sub uc_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim id As Integer = DirectCast(Me.gc.CurrentItem, bdGrupoSanchoToro.db.permisos).idPermiso
+ FuncionesDinamicas.AbrirAP(New ucPermiso(id), OtrosParametros)
+ End Sub
+
+ Private Sub ucPermisos_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucPermiso(Nothing), OtrosParametros)
+ End Sub
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim pers = bd.permisos.OrderBy(Function(x) x.CodigoPermiso).ToList
+ DataContext = pers
+ Me.gc.ItemsSource = pers
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRADORES", idUsuario)
+ End Function
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucProceso.xaml b/GestionGrupoSanchoToro/ucProceso.xaml
new file mode 100644
index 0000000..02f1c4b
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucProceso.xaml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucProceso.xaml.bak b/GestionGrupoSanchoToro/ucProceso.xaml.bak
new file mode 100644
index 0000000..44c5350
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucProceso.xaml.bak
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucProceso.xaml.vb b/GestionGrupoSanchoToro/ucProceso.xaml.vb
new file mode 100644
index 0000000..008f83d
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucProceso.xaml.vb
@@ -0,0 +1,128 @@
+Imports tsWPFCore
+Imports bdGrupoSanchoToro.db
+Imports System.Collections
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports bdGrupoSanchoToro.db.Utilidades
+
+Public Class ucProceso
+
+
+ Private bd As tscGrupoSanchoToro
+
+ Dim _idProceso As Integer?
+
+
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucProcesos)
+ End Sub
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+ Dim ra As procesos
+ If FuerzaNuevo OrElse _idProceso Is Nothing Then
+ ra = New procesos
+
+ Dim fi As New ficheros
+ fi.idTipo = bd.enumeraciones.First(Function(x) x.Codigo = "TIPFIC.RUTINA").idEnumeracion
+ ra.idFicheroNavigation = fi
+ Me.DataContext = ra
+ _idProceso = Nothing
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ ra = bd.procesos.First(Function(x) x.idProceso = _idProceso.Value)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ If ra.idFichero.HasValue = False Then
+ Dim fi As New ficheros
+ fi.idTipo = bd.enumeraciones.First(Function(x) x.Codigo = "TIPFIC.RUTINA").idEnumeracion
+ ra.idFicheroNavigation = fi
+ End If
+ If ra.idFicheroNavigation.Fichero IsNot Nothing Then Me.teRutina.EditValue = System.Text.Encoding.UTF8.GetString(ra.idFicheroNavigation.Fichero)
+ End If
+ Me.DataContext = ra
+ Return NuevoEstado
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Dim tipo = (From enumeracion In bd.enumeraciones Select enumeracion Where enumeracion.idGrupoEnumeracionNavigation.Grupo = "TIPPROC").ToList
+ cbTipo.ItemsSource = tipo
+ Dim permisos = (From permiso In bd.permisos Select permiso).ToList
+ cbPermiso.ItemsSource = permisos
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Dim ra As procesos = CType(Me.DataContext, procesos)
+ Me.docpanel.Caption = "Proceso " & ra.idProceso.ToString
+ Me.docpanel.Tag = "Proceso." & ra.idProceso.ToString
+ Else
+ Me.docpanel.Caption = "Proceso Nuevo"
+ Me.docpanel.Tag = "Proceso.Nuevo"
+ End If
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "Proceso.Nuevo"
+ Else
+ Return "Proceso." & DirectCast(Me.DataContext, procesos).idProceso.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "procesos"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Proceso"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+
+
+
+
+ Public Sub New(Optional idProceso As Integer? = Nothing)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ _idProceso = idProceso
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+ Private Sub ap_AntesGuardar(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
+ Dim ra As procesos = CType(Me.DataContext, procesos)
+ If teRutina.EditValue IsNot Nothing Then
+ ra.idFicheroNavigation.Fichero = System.Text.Encoding.UTF8.GetBytes(teRutina.EditValue.ToString)
+ Else
+ ra.idFicheroNavigation.Fichero = Nothing
+ End If
+ ra.idFicheroNavigation.Fecha = Now
+ End Sub
+
+ Private Sub ap_DespuesGuardar(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim ra As procesos = CType(Me.DataContext, procesos)
+ ra.idFicheroNavigation.NombreFichero = "RUTINA" & ra.idProceso.ToString & ".vb"
+ bd.GuardarCambios()
+ _idProceso = ra.idProceso
+ End Sub
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucProcesos.xaml b/GestionGrupoSanchoToro/ucProcesos.xaml
new file mode 100644
index 0000000..a679864
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucProcesos.xaml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucProcesos.xaml.vb b/GestionGrupoSanchoToro/ucProcesos.xaml.vb
new file mode 100644
index 0000000..3b6f5b0
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucProcesos.xaml.vb
@@ -0,0 +1,179 @@
+Imports tsWPFCore
+Imports bdGrupoSanchoToro.db
+Imports System.CodeDom.Compiler
+Imports DevExpress.Xpf.Core
+Imports System.Reflection
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports bdGrupoSanchoToro.db.Utilidades
+
+
+Public Class ucProcesos
+
+
+ Private bd As tscGrupoSanchoToro
+
+
+
+ Public Overrides Sub Cargado()
+
+ End Sub
+
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ gcProcesos.ItemsSource = bd.procesos.ToList
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Procesos"
+
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "Procesos"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "procesos"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Procesos"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+ Private Sub btEjecutar_Click(sender As Object, e As RoutedEventArgs)
+
+ Try
+ Dim dwi As dxwInicio = CType(Window.GetWindow(Me), dxwInicio)
+ Dim pr As bdGrupoSanchoToro.db.procesos = CType(Me.gcProcesos.CurrentItem, procesos)
+
+ If pr.Accion <> "" Then
+
+ Dim stipo As String = tsUtilidades.Utilidades.Ttagi(pr.Accion, "CLASE")
+ Dim tipo As Type
+ If stipo <> "" Then
+ Dim sEnsamblado As String = tsUtilidades.Utilidades.Ttagi(pr.Accion, "ENS")
+ If sEnsamblado <> "" Then
+ Dim dm As AppDomain = AppDomain.CurrentDomain
+ Dim b() As Byte = IO.File.ReadAllBytes(sEnsamblado)
+ tipo = dm.Load(b).GetType(stipo, False, True)
+ Try
+ tipo.GetMethod(tsUtilidades.Utilidades.Ttagi(pr.Accion, "SUB")).Invoke(Nothing, Nothing)
+ tipo = Nothing
+ Catch ex As Exception
+
+ End Try
+ Else
+ tipo = tsUtilidades.Utilidades.FindType(stipo)
+ End If
+ Dim sSub As String = tsUtilidades.Utilidades.Ttagi(pr.Accion, "SUB")
+ Dim sPar As String = tsUtilidades.Utilidades.Ttagi(pr.Accion, "PAR")
+
+ If tipo.GetMethod(sSub).GetParameters.Count = 0 Then
+ tipo.GetMethod(sSub).Invoke(Nothing, Nothing)
+ Else
+ If sPar = "" Then
+ ' tipo.GetMethod(sSub).Invoke(Nothing, {dwi, Comun.dcfg, Comun.dcn, bdGrupoSanchoToro.db.Utilidades.dsc, pr.Accion})
+ tipo.GetMethod(sSub).Invoke(Nothing, {dwi, pr.Accion})
+ Else
+ 'tipo.GetMethod(sSub).Invoke(Nothing, {sPar, dwi, Comun.dcfg, Comun.dcn, bdGrupoSanchoToro.db.Utilidades.dsc, pr.Accion})
+ tipo.GetMethod(sSub).Invoke(Nothing, {sPar, dwi, pr.Accion})
+ End If
+ End If
+ End If
+ Else
+
+
+ Dim oCProvider As New VBCodeProvider
+ Dim oCompiler As CodeDomProvider = oCProvider
+ Dim oCParam As New CompilerParameters
+ oCParam.GenerateInMemory = True
+ ' oCParam.CompilerOptions = [String].Format("/lib:""{0}""", IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Reference Assemblies\Microsoft\Framework\v4.0")) + [String].Format(" /lib:""{0}""", IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Reference Assemblies\Microsoft\Framework\v4.5"))
+
+
+ ' Dim a As Assembly = Assembly.GetExecutingAssembly
+
+ 'For Each ra In a.GetReferencedAssemblies
+ ' oCParam.ReferencedAssemblies.Add(ra.Name)
+ 'Next
+ oCParam.ReferencedAssemblies.AddRange(AppDomain.CurrentDomain.GetAssemblies.Where(Function(x) x.IsDynamic = False).Select(Function(x) x.Location).ToArray)
+
+
+
+ 'oCParam.ReferencedAssemblies.Add("System.dll")
+ 'oCParam.ReferencedAssemblies.Add("System.Data.dll")
+ 'oCParam.ReferencedAssemblies.Add("Microsoft.VisualBasic.dll")
+ 'oCParam.ReferencedAssemblies.Add("PresentationFramework.dll")
+ 'oCParam.ReferencedAssemblies.Add("GestionParlamento.exe")
+
+ 'Creamos un objeto CompilerResult que obtendrá los resultados de la compilación
+ Dim oCResult As CompilerResults
+
+ Dim sRutina As String = System.Text.Encoding.UTF8.GetString(pr.idFicheroNavigation.Fichero)
+ oCResult = oCompiler.CompileAssemblyFromSource(oCParam, sRutina)
+
+ 'Comprobamos que no existan errores de compilación.
+ Dim oCError As CompilerError
+ Dim sErrores As String = ""
+ If oCResult.Errors.Count > 0 Then
+ 'Si existen errores los mostramos.
+ 'Si bien, podriamos implementar un mejor método para visualizar
+ 'los errores de compilación, este nos servirá por los momentos.
+ For Each oCError In oCResult.Errors
+ sErrores &= oCError.ErrorText.ToString & " --- "
+ 'MsgBox(oCError.ErrorText.ToString)
+ Next
+ Throw New Exception(sErrores)
+ Else
+ 'Como el ensamblado se generó en memoria, debemos obtener
+ 'una referencia al ensamblado generado, para esto usamos
+ 'la propiedad CompiledAssembly
+ Dim oEnsamblado As System.Reflection.Assembly
+ oEnsamblado = oCResult.CompiledAssembly
+ Dim oClass As Type = oEnsamblado.GetType("RutinasTecnosis")
+ oClass.GetMethod("Ejecutar").Invoke(Nothing, Nothing)
+ End If
+
+ End If
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Error")
+ End Try
+ End Sub
+
+ Private Sub Nuevo(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
+ FuncionesDinamicas.AbrirAP(New ucProceso, OtrosParametros)
+ End Sub
+
+ Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim P = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRADOR", idUsuario)
+ If P.Consultar Then
+ Dim id As Integer = DirectCast(Me.gcProcesos.CurrentItem, procesos).idProceso
+ FuncionesDinamicas.AbrirAP(New ucProceso(id), OtrosParametros)
+ Else
+ btEjecutar_Click(Nothing, Nothing)
+ End If
+ End Sub
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucSerieFactura.xaml b/GestionGrupoSanchoToro/ucSerieFactura.xaml
new file mode 100644
index 0000000..6c2f765
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucSerieFactura.xaml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucSerieFactura.xaml.vb b/GestionGrupoSanchoToro/ucSerieFactura.xaml.vb
new file mode 100644
index 0000000..da41a28
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucSerieFactura.xaml.vb
@@ -0,0 +1,132 @@
+Imports tsWPFCore
+Imports bdGrupoSanchoToro.db
+Imports System.Collections
+
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports DevExpress.Xpf.Bars
+
+Public Class ucSerieFactura
+
+
+ Private bd As tscGrupoSanchoToro
+
+ Dim _idSerie As Integer?
+
+
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucSeriesFacturas)
+
+ End Sub
+
+ Dim ra As seriesfacturas
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim NuevoEstado As tsUtilidades.EstadosAplicacion
+
+ If FuerzaNuevo OrElse _idSerie Is Nothing Then
+ ra = New seriesfacturas
+ ra.idEmpresa = EmpresaActual.idEmpresa
+ Me.DataContext = ra
+ _idSerie = Nothing
+ NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
+ Else
+ ra = bd.seriesfacturas.First(Function(x) x.idSerieFactura = _idSerie.Value)
+ NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ Me.DataContext = ra
+ Return NuevoEstado
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ cbTipo.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.seriesfacturas.TipoSerieFacturaEnum)).OrderBy(Function(x) x.Descripcion)
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ Me.docpanel.Caption = "Serie " & ra.Serie
+ Me.docpanel.Tag = "Serie." & ra.Serie.ToString
+ Else
+ Me.docpanel.Caption = "Serie nueva"
+ Me.docpanel.Tag = "Serie.Nuevo"
+ End If
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "Serie.Nuevo"
+ Else
+ Return "Serie." & ra.Serie.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "seriesfacturas"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Serie"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+
+
+
+
+ Public Sub New(Optional idSerie As Integer? = Nothing)
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+ _idSerie = idSerie
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+ Private Sub ucSerie_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
+ Dim hte As New Hashtable
+ If Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
+ If bd.seriesfacturas.Any(Function(x) x.idSerieFactura <> ra.idSerieFactura AndAlso x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.Serie = ra.Serie) Then
+ hte.Add("ALMACENAR-SERIE_YA_EXISTENTE", "Ya existe esa serie de factura.")
+ End If
+ If ra.NumeroDigitos > 18 Or ra.NumeroDigitos < 4 Then
+ hte.Add("ALMACENAR-NUMERO_DIGITOS_INVÁLIDOS", "Los nº de dígitos deben estar entre 4 y 18")
+ End If
+ End If
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ End If
+ End Sub
+
+ Private Sub ucSerie_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim fi As seriesfacturas = Me.DataContext
+ _idSerie = fi.idSerieFactura
+ End Sub
+
+ Private Sub ucSerieFactura_AntesEliminar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, ByRef OmitirPreguntaContinuar As Boolean) Handles Me.AntesEliminar
+ Dim hte As New Hashtable
+ If bd.facturas.Any(Function(x) x.idSerieFactura = ra.idSerieFactura) Then
+ hte.Add("ALMACENAR-SERIE_CON_FACTURAS", "No se puede eliminar una serie si ya tiene facturas.")
+ End If
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ End If
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucSeriesFacturas.xaml b/GestionGrupoSanchoToro/ucSeriesFacturas.xaml
new file mode 100644
index 0000000..f50fce1
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucSeriesFacturas.xaml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucSeriesFacturas.xaml.vb b/GestionGrupoSanchoToro/ucSeriesFacturas.xaml.vb
new file mode 100644
index 0000000..099b16d
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucSeriesFacturas.xaml.vb
@@ -0,0 +1,69 @@
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports DevExpress.Xpf.Grid
+Public Class ucSeriesFacturas
+ Private bd As tscGrupoSanchoToro
+ Public Overrides Sub Cargado()
+
+ End Sub
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ If cbIncluirBajas.IsChecked Then
+ gcSeries.ItemsSource = bd.seriesfacturas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa).OrderBy(Function(x) x.idSerieFactura).ToList
+ Else
+ gcSeries.ItemsSource = bd.seriesfacturas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja Is Nothing).OrderBy(Function(x) x.idSerieFactura).ToList
+ End If
+
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Series de Facturas"
+
+ End Sub
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "SeriesFacturas"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "seriesfacturas"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Serie de Factura"
+ End Get
+ End Property
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ End Function
+
+ Private Sub cbIncluirBajas_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs)
+ EstablecedcPrincipal()
+ End Sub
+
+ Private Sub ucSeriesFacturas_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucSerieFactura(), Me.OtrosParametros)
+
+ End Sub
+
+ Private Sub ucSeriesFacturas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim sf As db.seriesfacturas = gcSeries.CurrentItem
+ FuncionesDinamicas.AbrirAP(New ucSerieFactura(sf.idSerieFactura), Me.OtrosParametros)
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucTraspasoCaja.xaml b/GestionGrupoSanchoToro/ucTraspasoCaja.xaml
new file mode 100644
index 0000000..d4c706c
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucTraspasoCaja.xaml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucTraspasoCaja.xaml.bak b/GestionGrupoSanchoToro/ucTraspasoCaja.xaml.bak
new file mode 100644
index 0000000..0bec163
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucTraspasoCaja.xaml.bak
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucTraspasoCaja.xaml.vb b/GestionGrupoSanchoToro/ucTraspasoCaja.xaml.vb
new file mode 100644
index 0000000..ce17f26
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucTraspasoCaja.xaml.vb
@@ -0,0 +1,157 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports System.Collections.ObjectModel
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+
+Public Class ucTraspasoCaja
+
+
+ Private bd As tscGrupoSanchoToro
+
+ Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim cjs = bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja.HasValue = False).OrderBy(Function(x) x.Descripcion).ToList
+
+ Me.cbCajaOrigen.ItemsSource = cjs
+ Me.cbCajaDestino.ItemsSource = cjs
+ Me.teImporte.EditValue = 0
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto()
+ Return bd
+ End Function
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "movimientoscaja"
+ End Get
+ End Property
+
+
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "TraspasoCaja"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Traspaso Entre Cajas"
+ End Get
+ End Property
+
+ Public Sub New()
+
+ ' Llamada necesaria para el diseñador.
+ InitializeComponent()
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Traspaso Entre Cajas"
+ Me.docpanel.Tag = "Traspaso Entre Cajas"
+ End Sub
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Dim per = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
+ per.Eliminar = False
+ per.Nuevos = False
+ per.Impresion = False
+ per.Exportar = False
+ per.Modificar = False
+ Return per
+ End Function
+
+
+ Public Overrides Sub Cargado()
+
+ End Sub
+
+ Private Sub HlMovimientoCierre_Click(sender As Object, e As RoutedEventArgs)
+ Dim ra As movimientoscaja = Me.DataContext
+ FuncionesDinamicas.AbrirAP(New ucMovimientoCaja(ra.idMovimientoCierre), OtrosParametros)
+ End Sub
+
+
+
+ Private Sub HlFacturaRecibida_Click(sender As Object, e As RoutedEventArgs)
+ Dim ra As movimientoscaja = Me.DataContext
+ FuncionesDinamicas.AbrirAP(New ucFacturaRecibida(ra.idFacturaRecibida), OtrosParametros)
+ End Sub
+
+ Private Sub HlFacturaEmitida_Click(sender As Object, e As RoutedEventArgs)
+ Dim ra As movimientoscaja = Me.DataContext
+ ' FuncionesDinamicas.AbrirAP(New ucFacturaEmitida(ra.idFacturaRecibida), OtrosParametros)
+ End Sub
+
+
+ Private Sub btTraspaso_Click(sender As Object, e As RoutedEventArgs)
+ Try
+ If Me.teImporte.EditValue Is Nothing OrElse Me.cbCajaOrigen.EditValue Is Nothing OrElse Me.cbCajaDestino.EditValue Is Nothing Then DXMessageBox.Show("La caja de origen, de destino e importe son obligatorios")
+ Dim Importe As Double = Me.teImporte.EditValue
+ If Importe = 0 Then Throw New Exception("El importe no puede ser 0")
+ Dim idCajaOrigen As Integer = Me.cbCajaOrigen.EditValue
+ Dim idCajaDestino As Integer = Me.cbCajaDestino.EditValue
+ Dim Observaciones As String = Me.teObservaciones.EditValue
+ If idCajaOrigen = idCajaDestino Then Throw New Exception("La caja destino no puede ser la misma que la caja de origen")
+ Dim movcajori As New movimientoscaja
+ With movcajori
+ .Importe = -Importe
+ .idCaja = idCajaOrigen
+ .Tipo = bdGrupoSanchoToro.db.TipoMovimientoEnum.TRASPASO_CAJA
+ .Fecha = bd.AhoraMysql
+ .FechaCreacion = .Fecha
+ .idUsuario = idUsuario
+ .Observaciones = ("TRASPASO A CAJA " & cbCajaDestino.DisplayText & ". " & Observaciones).Acortar(200)
+ End With
+ bd.movimientoscaja.Add(movcajori)
+ Dim movcajdes As New movimientoscaja
+ With movcajdes
+ .Importe = Importe
+ .idCaja = idCajaDestino
+ .Tipo = bdGrupoSanchoToro.db.TipoMovimientoEnum.TRASPASO_CAJA
+ .Fecha = bd.AhoraMysql
+ .FechaCreacion = .Fecha
+ .idUsuario = idUsuario
+ .Observaciones = ("TRASPASO DE CAJA " & cbCajaOrigen.DisplayText & ". " & Observaciones).Acortar(200)
+ End With
+ bd.movimientoscaja.Add(movcajdes)
+ bd.GuardarCambios()
+ DXMessageBox.Show("Traspaso de caja " & cbCajaOrigen.DisplayText & " a " & cbCajaDestino.DisplayText & " de " & Importe.ToString("c2") & " realizado correctamente.")
+ teImporte.EditValue = 0
+ cbCajaDestino.EditValue = Nothing
+ cbCajaOrigen.EditValue = Nothing
+ teObservaciones.EditValue = ""
+ Catch ex As Exception
+ DXMessageBox.Show(ex.Message, "Atención")
+ End Try
+ End Sub
+End Class
diff --git a/GestionGrupoSanchoToro/ucUsuario.xaml b/GestionGrupoSanchoToro/ucUsuario.xaml
new file mode 100644
index 0000000..7edb9e4
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucUsuario.xaml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GestionGrupoSanchoToro/ucUsuario.xaml.vb b/GestionGrupoSanchoToro/ucUsuario.xaml.vb
new file mode 100644
index 0000000..59cae26
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucUsuario.xaml.vb
@@ -0,0 +1,129 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports System.Data.Objects.DataClasses
+Imports tsUtilidades
+
+Public Class ucUsuario
+ ''Faltan funciones por el error base
+ Private bd As tscGrupoSanchoToro
+ Private _idUsuario As Integer?
+
+ Public Sub New(Optional idUsuario As Integer? = Nothing)
+
+ ' Esta llamada es exigida por el diseñador.
+ _idUsuario = idUsuario
+ InitializeComponent()
+
+ ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+ End Sub
+
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
+ Return "Usuario.Nuevo"
+ Else
+ Return "Usuario." & DirectCast(Me.DataContext, usuarios).idUsuario.ToString
+ End If
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Usuario"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "usuarios"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ Dim gr = (From g In bd.gruposusuarios Select g).ToList
+ leGrupo.ItemsSource = gr
+ Me.cbTema.ItemsSource = (From en In bd.enumeraciones Where en.idGrupoEnumeracionNavigation.Grupo = "TEMAS").ToList
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Usuario"
+ End Sub
+
+ Public Overrides Sub Cargado()
+ Me.Tipo_ucControlBusqueda = GetType(ucUsuarios)
+
+ End Sub
+
+ Private Sub ucUsuario_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
+ Dim usu As usuarios = Me.DataContext
+ Dim sContraseña As String = TryCast(Me.pbeContraseña.EditValue, String)
+ Dim hte As New Hashtable
+ If Me.Estado = EstadosAplicacion.Nuevo Then
+ If sContraseña = "" Then
+ hte.Add("ALMACENAR-CONTRASEÑA_OBLIGATORIA", "La contraseña es obligatoria")
+ End If
+ End If
+ Dim sRepeticion As String = TryCast(Me.pbeRepeticion.EditValue, String)
+ If sContraseña <> "" OrElse sRepeticion <> "" Then
+ If sContraseña <> sRepeticion Then
+ hte.Add("ALMACENAR-CONTRASEÑA_OBLIGATORIA", "La contraseña no coincide con la repetición")
+ End If
+ If hte.Count > 0 Then
+ MensajesError = hte
+ Cancelar = True
+ Else
+ Dim sSHA1passwd As String = tsUtilidades.crypt.SHA1("M3Soft." & sContraseña)
+ usu.SHA1Passwd = sSHA1passwd
+ End If
+ End If
+ End Sub
+
+ Private Sub ucUsuario_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
+ Dim usu As usuarios = Me.DataContext
+ _idUsuario = usu.idUsuario
+ End Sub
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim usu As usuarios
+ Dim EstadoNuevo = tsUtilidades.EstadosAplicacion.Nuevo
+ If FuerzaNuevo OrElse _idUsuario Is Nothing Then
+ usu = New usuarios
+ Else
+ usu = (From p In bd.usuarios Select p Where p.idUsuario = _idUsuario.Value).First
+ EstadoNuevo = tsUtilidades.EstadosAplicacion.ModificandoRegistro
+ End If
+ Me.DataContext = usu
+ Return EstadoNuevo
+
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.USUARIOS", idUsuario)
+ End Function
+
+
+End Class
diff --git a/GestionGrupoSanchoToro/ucUsuarios.xaml b/GestionGrupoSanchoToro/ucUsuarios.xaml
new file mode 100644
index 0000000..b0947e7
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucUsuarios.xaml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GestionGrupoSanchoToro/ucUsuarios.xaml.vb b/GestionGrupoSanchoToro/ucUsuarios.xaml.vb
new file mode 100644
index 0000000..d981f22
--- /dev/null
+++ b/GestionGrupoSanchoToro/ucUsuarios.xaml.vb
@@ -0,0 +1,79 @@
+Imports DevExpress.Xpf.Editors
+Imports DevExpress.Xpf.LayoutControl
+Imports tsWPFCore
+Imports System.ComponentModel
+Imports System.Data
+Imports DevExpress.Xpf.Editors.Validation
+Imports DevExpress.Xpf.Editors.Helpers
+Imports DevExpress.Xpf.Core
+Imports tsWPFCore.modExtensiones
+Imports System.Data.Common
+Imports System.Data.Entity
+Imports bdGrupoSanchoToro.db
+Imports tsUtilidades.Datos
+Imports DevExpress.Xpf.Bars
+Imports DevExpress.Xpf.Grid
+Imports System.Collections
+Imports tsEFCore8.Extensiones
+Imports bdGrupoSanchoToro.db.Utilidades
+Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
+Imports System.Data.Objects.DataClasses
+Public Class ucUsuarios
+
+
+ Dim bd As tscGrupoSanchoToro
+
+ Public Overrides ReadOnly Property idRegistroAplicacionActual As String
+ Get
+ Return "Usuarios"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property DescripcionRegistro As String
+ Get
+ Return "Usuarios"
+ End Get
+ End Property
+
+ Public Overrides ReadOnly Property NombreTablaBase As String
+ Get
+ Return "usuarios"
+ End Get
+ End Property
+
+ Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
+ End Sub
+
+ Public Overrides Sub EstableceTitulo()
+ Me.docpanel.Caption = "Usuarios"
+ End Sub
+
+ Public Overrides Sub Cargado()
+ End Sub
+
+ Private Sub uc_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
+ Dim id As Integer = DirectCast(Me.gc.CurrentItem, usuarios).idUsuario
+ FuncionesDinamicas.AbrirAP(New ucUsuario(id), OtrosParametros)
+ End Sub
+
+ Private Sub ucUsuarios_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
+ FuncionesDinamicas.AbrirAP(New ucUsuario(Nothing), OtrosParametros)
+ End Sub
+
+ Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
+ Dim usus = (From u In bd.usuarios Select u).ToList
+ DataContext = usus
+ Me.gc.ItemsSource = usus
+ Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
+ End Function
+
+ Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
+ bd = tscGrupoSanchoToro.NuevoContexto
+ Return bd
+ End Function
+
+ Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
+ Return Comun.ObtienePermisos(Me.bd, "AP.USUARIOS", idUsuario)
+ End Function
+
+End Class
diff --git a/GrupoSanchoToro.sln b/GrupoSanchoToro.sln
new file mode 100644
index 0000000..968202a
--- /dev/null
+++ b/GrupoSanchoToro.sln
@@ -0,0 +1,44 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.5.33530.505
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bdGrupoSanchoToro", "bdGrupoSanchoToro\bdGrupoSanchoToro.csproj", "{747EDA0C-CF88-4F3A-88C2-9CE2F23B5D56}"
+EndProject
+Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "GestionGrupoSanchoToro", "GestionGrupoSanchoToro\GestionGrupoSanchoToro.vbproj", "{3EE5C48D-30D7-44A6-B2FA-3BF088384075}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServicioGrupoSanchoToro", "ServicioGrupoSanchoToro\ServicioGrupoSanchoToro.csproj", "{B5C14166-BE3A-4F61-BD9A-11894BC45C1F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ All|Any CPU = All|Any CPU
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {747EDA0C-CF88-4F3A-88C2-9CE2F23B5D56}.All|Any CPU.ActiveCfg = Release|Any CPU
+ {747EDA0C-CF88-4F3A-88C2-9CE2F23B5D56}.All|Any CPU.Build.0 = Release|Any CPU
+ {747EDA0C-CF88-4F3A-88C2-9CE2F23B5D56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {747EDA0C-CF88-4F3A-88C2-9CE2F23B5D56}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {747EDA0C-CF88-4F3A-88C2-9CE2F23B5D56}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {747EDA0C-CF88-4F3A-88C2-9CE2F23B5D56}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3EE5C48D-30D7-44A6-B2FA-3BF088384075}.All|Any CPU.ActiveCfg = Release|Any CPU
+ {3EE5C48D-30D7-44A6-B2FA-3BF088384075}.All|Any CPU.Build.0 = Release|Any CPU
+ {3EE5C48D-30D7-44A6-B2FA-3BF088384075}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3EE5C48D-30D7-44A6-B2FA-3BF088384075}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3EE5C48D-30D7-44A6-B2FA-3BF088384075}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3EE5C48D-30D7-44A6-B2FA-3BF088384075}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B5C14166-BE3A-4F61-BD9A-11894BC45C1F}.All|Any CPU.ActiveCfg = Debug|Any CPU
+ {B5C14166-BE3A-4F61-BD9A-11894BC45C1F}.All|Any CPU.Build.0 = Debug|Any CPU
+ {B5C14166-BE3A-4F61-BD9A-11894BC45C1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B5C14166-BE3A-4F61-BD9A-11894BC45C1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B5C14166-BE3A-4F61-BD9A-11894BC45C1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B5C14166-BE3A-4F61-BD9A-11894BC45C1F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3F6A9487-A542-47B3-8B79-A750EA7DB02D}
+ EndGlobalSection
+EndGlobal
diff --git a/ServicioGrupoSanchoToro/Comprobaciones.cs b/ServicioGrupoSanchoToro/Comprobaciones.cs
new file mode 100644
index 0000000..edde106
--- /dev/null
+++ b/ServicioGrupoSanchoToro/Comprobaciones.cs
@@ -0,0 +1,164 @@
+using bdGrupoSanchoToro;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.VisualBasic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using tsEFCore8.Extensiones;
+using System.Runtime.CompilerServices;
+using System.Data.SqlClient;
+
+
+namespace ServicioGrupoSanchoToro
+{
+ internal class Comprobaciones
+ {
+ public static void CompruebaReplica(string NombreConexion = "replica")
+ {
+
+ try
+ {
+ if (string.IsNullOrEmpty(NombreConexion))
+ {
+ if (DateAndTime.Today.Day == 1)
+ {
+ switch (DateAndTime.Today.Month)
+ {
+ case 1:
+ {
+ NombreConexion = "enero";
+ break;
+ }
+
+ case 2:
+ {
+ NombreConexion = "febrero";
+ break;
+ }
+
+ case 3:
+ {
+ NombreConexion = "marzo";
+ break;
+ }
+
+ case 4:
+ {
+ NombreConexion = "abril";
+ break;
+ }
+
+ case 5:
+ {
+ NombreConexion = "mayo";
+ break;
+ }
+
+ case 6:
+ {
+ NombreConexion = "junio";
+ break;
+ }
+
+ case 7:
+ {
+ NombreConexion = "julio";
+ break;
+ }
+
+ case 8:
+ {
+ NombreConexion = "agosto";
+ break;
+ }
+
+ case 9:
+ {
+ NombreConexion = "septiembre";
+ break;
+ }
+
+ case 10:
+ {
+ NombreConexion = "octubre";
+ break;
+ }
+
+ case 11:
+ {
+ NombreConexion = "noviembre";
+ break;
+ }
+
+ case 12:
+ {
+ NombreConexion = "diciembre";
+ break;
+ }
+ }
+ }
+ else
+ switch (DateAndTime.Today.DayOfWeek)
+ {
+ case DayOfWeek.Monday:
+ {
+ NombreConexion = "lunes";
+ break;
+ }
+
+ case DayOfWeek.Tuesday:
+ {
+ NombreConexion = "martes";
+ break;
+ }
+
+ case DayOfWeek.Wednesday:
+ {
+ NombreConexion = "miercoles";
+ break;
+ }
+
+ case DayOfWeek.Thursday:
+ {
+ NombreConexion = "jueves";
+ break;
+ }
+
+ case DayOfWeek.Friday:
+ {
+ NombreConexion = "viernes";
+ break;
+ }
+
+ case DayOfWeek.Saturday:
+ {
+ NombreConexion = "sabado";
+ break;
+ }
+
+ case DayOfWeek.Sunday:
+ {
+ NombreConexion = "domingo";
+ break;
+ }
+ }
+
+ }
+ tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
+ tscGrupoSanchoToro bdr = tscGrupoSanchoToro.NuevoContexto(NombreConexion);
+ int nr = bd.Database.SqlQueryRaw("CALL totalregistrosbd()").ToList().FirstOrDefault();
+ int nrr = bdr.Database.SqlQueryRaw("CALL totalregistrosbd()").ToList().FirstOrDefault();
+
+ if (nr != nrr)
+ throw new Exception("No coinciden los nº de registro de la réplica con los de producción");
+ }
+ catch (Exception ex)
+ {
+ Logs.AñadeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, "Error en CompruebaReplica", "Detalle del error: " + Constants.vbCrLf + ex.Message, ex);
+ }
+ }
+
+ }
+}
diff --git a/ServicioGrupoSanchoToro/Configuracion.cs b/ServicioGrupoSanchoToro/Configuracion.cs
new file mode 100644
index 0000000..22f443f
--- /dev/null
+++ b/ServicioGrupoSanchoToro/Configuracion.cs
@@ -0,0 +1,18 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ServicioGrupoSanchoToro
+{
+ public class Configuracion
+ {
+ public int SegundosMinimosEntreProcesos { get; set; }
+ public string? DirectorioLogs { get; set; }
+ public string? HoraProcesosDiarios { get; set; }
+ public string? NombreConexionBD { get; set; }
+ }
+}
+
diff --git a/ServicioGrupoSanchoToro/Logs.cs b/ServicioGrupoSanchoToro/Logs.cs
new file mode 100644
index 0000000..b66dc7f
--- /dev/null
+++ b/ServicioGrupoSanchoToro/Logs.cs
@@ -0,0 +1,116 @@
+using Microsoft.VisualBasic;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ServicioGrupoSanchoToro
+{
+ internal class Logs
+ {
+ private static object oBloqueoLog;
+ private static EventLog el;
+ public static void AñadeLog(tsUtilidades.Enumeraciones.TipoLog Tipo, string Asunto, string Mensaje, Exception e = null)
+ {
+ // ----------------------------------------------------------------------------------------------------
+ // Descripción Sub: Gestión de logs de la aplicación
+ // Fecha. Creacion: ???
+ // Creada por: manmog
+ // Ultima Modificacion: 24/11/2010
+ //
+ // Modificaciones:
+ // ===============
+ if (oBloqueoLog == null) oBloqueoLog = new object();
+ lock (oBloqueoLog)
+ {
+ string sFicheroLog = Procesos.Conf.DirectorioLogs + "Log-" + DateTime.UtcNow.Year.ToString() + DateTime.UtcNow.Month.ToString() + ".txt";
+ try
+ {
+ if (e != null)
+ {
+ if (el != null)
+ el.WriteEntry(e.Message + Constants.vbCrLf + e.StackTrace, EventLogEntryType.Error);
+ string sStackTrace = "Tipo excepción: " + e.ToString() + Constants.vbCrLf;
+ Exception exError = e;
+ do
+ {
+ sStackTrace += exError.StackTrace + Constants.vbCrLf;
+ exError = exError.InnerException;
+ }
+ while (!Information.IsNothing(exError));
+ if (sStackTrace != "")
+ Mensaje += Constants.vbCrLf + "StackTrace: " + sStackTrace;
+ }
+ if (Tipo == tsUtilidades.Enumeraciones.TipoLog.Fallo)
+ {
+ sFicheroLog = Procesos.Conf.DirectorioLogs + "Errores-" + DateTime.UtcNow.Year.ToString() + DateTime.UtcNow.Month.ToString().PadLeft(2, '0') + ".txt";
+ Asunto = "Error GrupoSanchoToro. " + ". Version:" + bdGrupoSanchoToro.db.Utilidades.VersionPrograma + ". " + Asunto;
+ Mensaje = "Error GrupoSanchoToro. " + DateTime.UtcNow.ToString("yyyy-MM-dd hh:mm:ss") + " Enviado desde " + Environment.MachineName + ". Version:" + bdGrupoSanchoToro.db.Utilidades.VersionPrograma + ". Mensaje: " + Mensaje;
+ }
+ else
+ {
+ Asunto = "Advertencia GrupoSanchoToro. " + ". Version:" + bdGrupoSanchoToro.db.Utilidades.VersionPrograma + ". " + Asunto;
+ Mensaje = "Advertencia GrupoSanchoToro. " + DateTime.UtcNow.ToString("yyyy-MM-dd hh:mm:ss") + " Enviado desde " + Environment.MachineName + ". Version:" + bdGrupoSanchoToro.db.Utilidades.VersionPrograma + ". " + Mensaje;
+ }
+ string sDireccionesEnvio = "manmog@gmail.com";
+ string sServidorSMTP = "smtp.gmail.com";
+ var sRemitente = "administracion@english-skills.net";
+ tsCorreos.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, Asunto, Mensaje,null,null,"","", sRemitente, "", 587, true); // ant: ksswsleqfvmzzbig
+
+ Anadelogtxt(Mensaje + " --- " + ((e==null) ? "" : e.StackTrace), sFicheroLog);
+ }
+ catch (Exception ex)
+ {
+ sFicheroLog = Procesos.Conf.DirectorioLogs + @"Errores\Errores-" + DateTime.UtcNow.Year.ToString() + DateTime.UtcNow.Month.ToString().PadLeft(2, '0') + ".txt";
+ if (e != null)
+ Mensaje += " --- " + e.StackTrace;
+ Anadelogtxt(Mensaje + " ---" + ex.Message + " --- " + ex.StackTrace, sFicheroLog);
+ }
+ }
+ }
+ public static void Anadelogtxt(string Mensaje, string FicheroLog)
+ {
+ System.IO.StreamWriter sw = null;
+ try
+ {
+ Mensaje = Mensaje.Replace(Constants.vbCrLf, "---");
+ if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(FicheroLog)))
+ tsUtilidades.Utilidades.CreaEstructuraDirectorio(System.IO.Path.GetDirectoryName(FicheroLog));
+ if (System.IO.File.Exists(FicheroLog))
+ sw = System.IO.File.AppendText(FicheroLog);
+ else
+ sw = System.IO.File.CreateText(FicheroLog);
+ Mensaje = DateTime.UtcNow.ToString() + "|" + Mensaje;
+
+ sw.WriteLine(Mensaje);
+ }
+ catch (Exception ex)
+ {
+ try
+ {
+ string sDireccionesEnvio = "manmog@gmail.com";
+ string sServidorSMTP = "smtp.gmail.com";
+ var sRemitente = "administracion@english-skills.net";
+ tsCorreos.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, "Error Anadelogtxt. " + Mensaje, Environment.MachineName + ".- " + ex.Message + Constants.vbCrLf + ex.StackTrace + Constants.vbCrLf + ex.Source, null,null,"","", sRemitente, "", 587, true);
+ }
+ catch (Exception ex2)
+ {
+ }
+ }
+ finally
+ {
+ try
+ {
+ sw.Close();
+ }
+ catch
+ {
+ }
+ }
+ }
+ }
+}
+
diff --git a/ServicioGrupoSanchoToro/Procesos.cs b/ServicioGrupoSanchoToro/Procesos.cs
new file mode 100644
index 0000000..6493ddd
--- /dev/null
+++ b/ServicioGrupoSanchoToro/Procesos.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+
+namespace ServicioGrupoSanchoToro
+{
+ public class Procesos
+ {
+ public static Configuracion Conf;
+
+ public static DateTime? HoraUtcUltimaEjecucionProcesos = null;
+ public static bool Procesando;
+
+ public static void Procesar()
+ {
+ if (!Procesando && (HoraUtcUltimaEjecucionProcesos.HasValue == false || DateTime.UtcNow.Subtract(HoraUtcUltimaEjecucionProcesos.Value).TotalSeconds > Conf.SegundosMinimosEntreProcesos));
+ {
+ Procesando = true;
+ HoraUtcUltimaEjecucionProcesos = DateTime.UtcNow;
+ try
+ {
+ ProcesosCorreos.EnviaCorreos();
+ //Comprobaciones.CompruebaReplica();
+
+ }
+ catch (Exception ex)
+ {
+
+ Debug.WriteLine(@"Procesar: EXCEPCIÓN: " + ex.Message + " " + ex.StackTrace);
+ }
+ finally
+ {
+ Procesando = false;
+ }
+
+ }
+
+ }
+ }
+}
diff --git a/ServicioGrupoSanchoToro/ProcesosCorreos.cs b/ServicioGrupoSanchoToro/ProcesosCorreos.cs
new file mode 100644
index 0000000..1dd0638
--- /dev/null
+++ b/ServicioGrupoSanchoToro/ProcesosCorreos.cs
@@ -0,0 +1,122 @@
+using bdGrupoSanchoToro;
+using Microsoft.VisualBasic;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Mail;
+using System.Net.Mime;
+using System.Text;
+using System.Threading.Tasks;
+using tsUtilidades.Extensiones;
+
+namespace ServicioGrupoSanchoToro
+{
+ internal class ProcesosCorreos
+ {
+ internal static void EnviaCorreos()
+ {
+ try
+ {
+ var bd = tscGrupoSanchoToro.NuevoContexto();
+ var correospendientes = bd.correos.Where(x => x.FechaAnulacion == null && x.FechaEnvio == null && x.idcuenta != null).ToList();
+ ArrayList ficherosadjuntos = null/* TODO Change to default(_) if this is not a reference type */;
+ bool bIntentar;
+ var EmailEnPruebas = bd.enumeraciones.First(x => x.Codigo == "CONF.EMAILENPRUEBAS").ValorAlfabeticoLargo;
+ var EmailCopiaOculta = bd.enumeraciones.First(x => x.Codigo == "CONF.EMAILCOPIAOCULTA").ValorAlfabeticoLargo;
+ try
+ {
+ foreach (var email in correospendientes)
+ {
+ email.Asunto = email.Asunto.Replace(Environment.NewLine, " ");
+ bIntentar = false;
+ if (email.FechaUltimoIntento == null)
+ bIntentar = true;
+ else if (DateTime.UtcNow.Subtract(email.FechaUltimoIntento.Value).TotalHours > 1)
+ bIntentar = true;
+ if (bIntentar)
+ {
+ try
+ {
+ string sPasswd = email.idcuentaNavigation.Password;
+ if (System.IO.Directory.Exists(@"c:\tecnosis.tfs"))
+ email.Destinatario = "manmog@gmail.com";
+ else if (!string.IsNullOrEmpty(EmailEnPruebas))
+ {
+ email.Destinatario = EmailEnPruebas;
+ email.CopiaOculta = "manmog@gmail.com";
+ }
+ else if (EmailCopiaOculta != null && EmailCopiaOculta != "" && email.CodigoAplicacion != "ERRORES")
+ {
+ if (string.IsNullOrEmpty(email.CopiaOculta))
+ email.CopiaOculta = EmailCopiaOculta;
+ else
+ email.CopiaOculta = EmailCopiaOculta + ";" + EmailCopiaOculta;
+ }
+ // End If
+ List attachments = new List();
+ string sCuerpoHtml = System.Text.Encoding.UTF8.GetString(bd.ficherosconfiguracion.Where(x => x.Codigo == "PLANTILLA_CORREOS_EMP_" + email.idcuentaNavigation.idEmpresa.ToString()).First().Configuracion);
+ // Dim sCuerpoHtml As String = System.Text.Encoding.UTF8.GetString(IO.File.ReadAllBytes("c:\tmp\PlantillaCorreos.html"))
+ sCuerpoHtml = sCuerpoHtml.Replace("$cuerpo$", email.Cuerpo).Replace(Constants.vbCrLf, "
");
+
+ AlternateView avHtml = AlternateView.CreateAlternateViewFromString(sCuerpoHtml, null/* TODO Change to default(_) if this is not a reference type */, MediaTypeNames.Text.Html);
+ List ats = null;
+ if (!string.IsNullOrEmpty(email.RutaFicheroAdjunto))
+ {
+ ats = new List();
+ Attachment at = new Attachment(new MemoryStream(File.ReadAllBytes(email.RutaFicheroAdjunto)), System.IO.Path.GetFileName(email.RutaFicheroAdjunto));
+ ats.Add(at);
+ }
+ if (email.idFicheroAdjunto.HasValue)
+ {
+ if (ats == null)
+ ats = new List();
+ Attachment at = new Attachment(new MemoryStream(email.idFicheroAdjuntoNavigation.Fichero), System.IO.Path.GetFileName(email.idFicheroAdjuntoNavigation.NombreFichero));
+ ats.Add(at);
+ }
+ foreach (var fad in email.ficherosadjuntos)
+ {
+ if (ats == null)
+ ats = new List();
+ Attachment at = new Attachment(new MemoryStream(fad.idFicheroNavigation.Fichero), System.IO.Path.GetFileName(fad.idFicheroNavigation.NombreFichero));
+ ats.Add(at);
+ }
+ List avs = new List();
+ avs.Add(avHtml);
+ tsCorreos.Funciones.EnviaCorreo(email.idcuentaNavigation.ServidorSMTP, email.Remitente, email.Destinatario, email.Asunto, sCuerpoHtml, ats, avs, email.Copia, email.CopiaOculta, email.idcuentaNavigation.CuentaCorreo, email.idcuentaNavigation.Password, (int)email.idcuentaNavigation.Puerto, email.idcuentaNavigation.SSL, true, email.idcuentaNavigation.ResponderA);
+ // tsl5.Correo.Funciones.EnviaCorreo(email.cuentascorreo.ServidorSMTP, email.Remitente, email.Destinatario, email.Asunto, email.Cuerpo, attachments, avs, , , email.cuentascorreo.CuentaCorreo, sPasswd, email.cuentascorreo.Puerto, email.cuentascorreo.SSL, True)
+ email.FechaEnvio = DateTime.UtcNow;
+ }
+ catch (Exception ex)
+ {
+ // Call AñadeLog(Enumeraciones.TipoLog.Advertencia, "El correo para el destinatario " & email.DESTINATARIO & " ha sido rechazado durante 48 horas y será marcado como anulado.", "Detalle del error: " & vbCrLf & ex.Message, ex)
+ email.FechaUltimoIntento = DateTime.UtcNow;
+ email.MensajeError = ex.Message.Acortar(512);
+ if (DateTime.UtcNow.Subtract(email.FechaCreacion.Value).TotalHours > 48)
+ {
+ email.FechaAnulacion = DateTime.UtcNow;
+ // GeneraRegistroCorreoExcepcion(Nothing, ex, "Procesar")
+ Logs.AñadeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, "El correo para el destinatario " + email.Destinatario + " ha sido rechazado durante 48 horas y será marcado como anulado.", "Detalle del error: " + Constants.vbCrLf + ex.Message, ex);
+ }
+ else
+ {
+ string sFicheroLog = Procesos.Conf.DirectorioLogs + @"Errores\Errores-" + DateTime.UtcNow.Year.ToString() + DateTime.UtcNow.Month.ToString() + ".txt";
+ Logs.Anadelogtxt("Error en EnviaCorreo. " + ex.Message + Constants.vbCrLf + ex.StackTrace, sFicheroLog);
+ }
+ }
+ }
+ bd.SaveChanges();
+ }
+ }
+ finally
+ {
+ }
+ }
+ catch (Exception ex)
+ {
+ // Dim sFicheroLog = DirectorioLogs & "Errores-" & Now.Year.ToString & Now.Month.ToString.PadLeft(2, "0") & ".txt"
+ Logs.AñadeLog(tsUtilidades.Enumeraciones.TipoLog.Fallo, ex.Message, "Detalle del error: " + Constants.vbCrLf + ex.Message, ex);
+ }
+ }
+ }
+}
diff --git a/ServicioGrupoSanchoToro/Program.cs b/ServicioGrupoSanchoToro/Program.cs
new file mode 100644
index 0000000..93360cf
--- /dev/null
+++ b/ServicioGrupoSanchoToro/Program.cs
@@ -0,0 +1,46 @@
+using Microsoft.Extensions.Logging.Configuration;
+using Microsoft.Extensions.Logging.EventLog;
+using ServicioGrupoSanchoToro;
+using System.Reflection;
+
+
+
+//HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
+//builder.Services.AddWindowsService(options =>
+//{
+// options.ServiceName = ".NET Joke Service";
+//});
+
+//LoggerProviderOptions.RegisterProviderOptions<
+// EventLogSettings, EventLogLoggerProvider>(builder.Services);
+
+//builder.Services.AddSingleton();
+//builder.Services.AddHostedService();
+
+//IHost host = builder.Build();
+//host.Run();
+
+
+public class Program
+{
+ public static void Main(string[] args)
+ {
+ bdGrupoSanchoToro.db.Utilidades.VersionPrograma = tsUtilidades.Utilidades.ExtraeValorCadena(Assembly.GetExecutingAssembly().FullName, "Version");
+ var host = CreateHostBuilder(args).Build();
+ host.Run();
+ }
+
+ public static IHostBuilder CreateHostBuilder(string[] args) =>
+ Host.CreateDefaultBuilder(args)
+ .ConfigureServices((hostContext, services) =>
+ {
+ IConfiguration configuration = hostContext.Configuration;
+
+ Configuracion options = configuration.GetSection("Configuracion").Get();
+
+ services.AddSingleton(options);
+ services.AddWindowsService(options=>options.ServiceName="Servicio GrupoSanchoToro");
+
+ services.AddHostedService();
+ });
+}
diff --git a/ServicioGrupoSanchoToro/Properties/launchSettings.json b/ServicioGrupoSanchoToro/Properties/launchSettings.json
new file mode 100644
index 0000000..4647ead
--- /dev/null
+++ b/ServicioGrupoSanchoToro/Properties/launchSettings.json
@@ -0,0 +1,19 @@
+{
+ "profiles": {
+ "ServicioGrupoSanchoToro": {
+ "commandName": "Project",
+ "environmentVariables": {
+ "DOTNET_ENVIRONMENT": "Development"
+ },
+ "dotnetRunMessages": true
+ },
+ "WSL": {
+ "commandName": "WSL2",
+ "environmentVariables": {
+ "DOTNET_ENVIRONMENT": "Development"
+ },
+ "distributionName": ""
+ }
+ },
+ "$schema": "http://json.schemastore.org/launchsettings.json"
+}
\ No newline at end of file
diff --git a/ServicioGrupoSanchoToro/ServicioGrupoSanchoToro.csproj b/ServicioGrupoSanchoToro/ServicioGrupoSanchoToro.csproj
new file mode 100644
index 0000000..6b28ac1
--- /dev/null
+++ b/ServicioGrupoSanchoToro/ServicioGrupoSanchoToro.csproj
@@ -0,0 +1,23 @@
+
+
+
+ 1.0.0.0
+ net8.0
+ enable
+ enable
+ dotnet-ServicioGrupoSanchoToro-2a4f24d8-0048-43c3-b44a-f4f5ce65c028
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ServicioGrupoSanchoToro/Worker.cs b/ServicioGrupoSanchoToro/Worker.cs
new file mode 100644
index 0000000..35ece48
--- /dev/null
+++ b/ServicioGrupoSanchoToro/Worker.cs
@@ -0,0 +1,111 @@
+using Microsoft.Extensions.Logging;
+using Quartz.Impl;
+using Quartz;
+using System.Drawing.Text;
+using bdGrupoSanchoToro.db;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.VisualBasic;
+using System.Reflection;
+using bdGrupoSanchoToro;
+
+namespace ServicioGrupoSanchoToro
+{
+
+ public class Worker : BackgroundService
+ {
+ private readonly ILogger _logger;
+
+ public Worker(ILogger logger, Configuracion Conf)
+ {
+ _logger = logger;
+ Procesos.Conf = Conf;
+ var bd = tscGrupoSanchoToro.NuevoContexto(Conf.NombreConexionBD);
+ var ctasgmail = bd.cuentascorreo.Where(x => x.ServidorSMTP == "smtp.gmail.com").AsEnumerable().GroupBy(x => x.Remitente).Select(x => x.FirstOrDefault()).ToList();
+ List lt = new List();
+ foreach (var cta in ctasgmail)
+ {
+ tsCorreos.TokenGmail tg = new tsCorreos.TokenGmail();
+ var Config = new GmailConfig() { ClientSecret = bd.ficherosconfiguracion.First(x => x.Codigo == cta.Remitente).Configuracion, TokenFolder = @"C:\ProgramData\Gmail\TokenGmail", Usuario = cta.Remitente, Remitente = cta.Remitente, NombreRemitente = cta.Remitente };
+ tg.Config = Config;
+ tg.id = cta.Remitente;
+ lt.Add(tg);
+ }
+ tsCorreos.TokenGmail.ListaTokens = lt;
+ }
+
+
+ protected override async System.Threading.Tasks.Task ExecuteAsync(CancellationToken stoppingToken)
+ {
+ string Mensaje = "Servicio GrupoSanchoToro Iniciado. Versin: " + tsUtilidades.Utilidades.ExtraeValorCadena(Assembly.GetExecutingAssembly().FullName, "Version");
+ try
+ {
+
+
+ ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
+ IScheduler scheduler = schedulerFactory.GetScheduler().Result;
+ scheduler.Start().Wait();
+ // Crear un trabajo
+ IJobDetail job = JobBuilder.Create()
+ .WithIdentity("TareasProgramadas", "Grupo1")
+ .Build();
+ // Crear un trigger que se ejecute diariamente a una hora especfica
+ if (Procesos.Conf.HoraProcesosDiarios != null)
+ {
+ Mensaje += " Hora Procesos Programados: " + Procesos.Conf.HoraProcesosDiarios;
+ int Hora = int.Parse(Procesos.Conf.HoraProcesosDiarios.Split(":")[0]);
+ int Minutos = int.Parse(Procesos.Conf.HoraProcesosDiarios.Split(":")[1]);
+ ITrigger trigger = TriggerBuilder.Create()
+ .WithIdentity("MiTareaDiaria", "Grupo1")
+ .StartAt(DateBuilder.TodayAt(Hora, Minutos, 0))
+ .WithSimpleSchedule(x => x
+ .WithIntervalInHours(24)
+ .RepeatForever())
+ .Build();
+
+ // Programar el trabajo con el trigger
+ scheduler.ScheduleJob(job, trigger).Wait();
+
+ Console.WriteLine("Tarea diaria programada creada.");
+ }
+
+ Logs.AadeLog(tsUtilidades.Enumeraciones.TipoLog.InicioServicio, Mensaje, Mensaje);
+ Comprobaciones.CompruebaReplica("replica");
+ while (!stoppingToken.IsCancellationRequested)
+ {
+ if (_logger.IsEnabled(LogLevel.Information))
+ {
+ _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
+ }
+ Procesos.Procesar();
+ await System.Threading.Tasks.Task.Delay(1000, stoppingToken);
+ }
+ Logs.AadeLog(tsUtilidades.Enumeraciones.TipoLog.FinServicio, "Detencin " + Mensaje, "Detencin " + Mensaje);
+ }
+ catch (OperationCanceledException)
+ {
+ Logs.AadeLog(tsUtilidades.Enumeraciones.TipoLog.FinServicio, "Detencin " + Mensaje, "Detencin " + Mensaje);
+ // When the stopping token is canceled, for example, a call made from services.msc,
+ // we shouldn't exit with a non-zero exit code. In other words, this is expected...
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "{Message}", ex.Message);
+ Environment.Exit(1);
+ }
+
+ }
+ }
+
+
+ public class TareasProgramadas : IJob
+ {
+ public Task Execute(IJobExecutionContext context)
+ {
+ Comprobaciones.CompruebaReplica();
+ return Task.CompletedTask;
+ }
+ }
+
+
+
+}
diff --git a/ServicioGrupoSanchoToro/appsettings.json b/ServicioGrupoSanchoToro/appsettings.json
new file mode 100644
index 0000000..5f18b18
--- /dev/null
+++ b/ServicioGrupoSanchoToro/appsettings.json
@@ -0,0 +1,14 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ },
+ "Configuracion": {
+ "SegundosMinimosEntreProcesos": "60",
+ "DirectorioLogs": "c:\\m3soft\\logs\\",
+ "HoraProcesosDiarios": "06:30",
+ "NombreConexionBD": "Producción VPN"
+ }
+}
diff --git a/bdGrupoSanchoToro/CalculosDinamicos.cs b/bdGrupoSanchoToro/CalculosDinamicos.cs
new file mode 100644
index 0000000..21362b0
--- /dev/null
+++ b/bdGrupoSanchoToro/CalculosDinamicos.cs
@@ -0,0 +1,242 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using bdGrupoSanchoToro;
+using bdGrupoSanchoToro.db;
+using Microsoft.VisualBasic;
+using Microsoft.VisualBasic.CompilerServices;
+
+namespace bdGrupoSanchoToro
+{
+
+ public class CalculosDinamicos
+ {
+
+ private System.Reflection.Assembly oEnsamblado;
+ public bool PrecompilarFuncion(string Funcion, List ListaEnsamblados, List ListaParametros, List ListaEspacioNombres, List AccionesIniciales = null)
+ {
+ try
+ {
+ string mStrings;
+ string mParametros = "";
+ // Definimos un objeto de tipo StringBuilder que contendra el código a compilar
+ var CodigoFuente = new StringBuilder();
+
+ // Agregamos los Imports necesarios a nuestro codigo fuente
+ // CodigoFuente.Append("Option Explicit Off" & vbCr)
+ foreach (var currentMStrings in ListaEspacioNombres)
+ {
+ mStrings = currentMStrings;
+ CodigoFuente.Append("Imports " + mStrings + Constants.vbCr);
+ }
+
+ // Preparamos un string con los parametros que usará el metodo Eval
+ // de de la clase EvalClase
+ if (ListaParametros is not null)
+ {
+ foreach (var currentMStrings1 in ListaParametros)
+ {
+ mStrings = currentMStrings1;
+ mParametros += ", " + mStrings;
+ }
+ }
+
+ mParametros = Strings.Trim(mParametros);
+ if (mParametros.Length > 0)
+ {
+ mParametros = Strings.Trim(Strings.Mid(mParametros, 2));
+ }
+
+ // Terminamos de construir la clase a compilar
+ CodigoFuente.Append("Public Class EvalClase" + Constants.vbCr);
+ CodigoFuente.Append(" Public Shared Function Eval(" + mParametros + ") as Double" + Constants.vbCr);
+ CodigoFuente.Append("Try" + Constants.vbCr);
+ if (!(AccionesIniciales == null))
+ {
+ foreach (var currentMStrings2 in AccionesIniciales)
+ {
+ mStrings = currentMStrings2;
+ CodigoFuente.Append(mStrings + Constants.vbCr);
+ }
+ }
+ CodigoFuente.Append(" Return " + Funcion + Constants.vbCr);
+ CodigoFuente.Append("Catch ex as Exception" + Constants.vbCr);
+ CodigoFuente.Append(" Throw New Exception(ex.Message, ex)" + Constants.vbCr);
+ CodigoFuente.Append("End Try" + Constants.vbCr);
+ CodigoFuente.Append("End Function " + Constants.vbCr);
+ CodigoFuente.Append("End Class " + Constants.vbCr);
+
+ var oCProvider = new VBCodeProvider();
+ CodeDomProvider oCompiler = oCProvider;
+ var oCParam = new CompilerParameters();
+ oCParam.GenerateInMemory = true;
+
+ foreach (var ens in ListaEnsamblados)
+ oCParam.ReferencedAssemblies.Add(ens);
+
+ // oCParam.ReferencedAssemblies.Add("Cablin.dll")
+ // oCParam.ReferencedAssemblies.Add("FuncionesTsl4.dll")
+ // oCParam.ReferencedAssemblies.Add("System.dll")
+ // oCParam.ReferencedAssemblies.Add("System.Data.dll")
+ // oCParam.ReferencedAssemblies.Add("Microsoft.VisualBasic.dll")
+
+ // Creamos un objeto CompilerResult que obtendrá los resultados de la compilación
+ CompilerResults oCResult;
+
+
+ // Comprobamos que no existan errores de compilación.
+ oCResult = oCompiler.CompileAssemblyFromSource(oCParam, CodigoFuente.ToString());
+ string sErrores = "";
+ if (oCResult.Errors.Count > 0)
+ {
+ // Si existen errores los mostramos.
+ // Si bien, podriamos implementar un mejor método para visualizar
+ // los errores de compilación, este nos servirá por los momentos.
+ foreach (CompilerError oCError in oCResult.Errors)
+ // MsgBox(oCError.ErrorText.ToString)
+ sErrores += oCError.ErrorText.ToString() + " --- ";
+ throw new Exception(sErrores);
+ }
+ else
+ {
+ // Como el ensamblado se generó en memoria, debemos obtener
+ // una referencia al ensamblado generado, para esto usamos
+ // la propiedad CompiledAssembly
+ oEnsamblado = oCResult.CompiledAssembly;
+ return true;
+ }
+ }
+ catch (Exception EX)
+ {
+ throw new Exception("Errores en Compilacion:" + EX.Message, EX);
+ }
+ }
+ public double Evaluar(params object[] Parametros)
+ {
+ if (oEnsamblado is null)
+ {
+ throw new Exception("La función no está compilada");
+ }
+ else
+ {
+ var oClass = oEnsamblado.GetType("EvalClase");
+ return Conversions.ToDouble(oClass.GetMethod("Eval").Invoke(null, Parametros));
+ }
+ }
+ //public static double FNTabla(tscGrupoSanchoToro bd, string CodigoTabla, double Valor, int? ParametroNumerico = default, string ParametroAlfabetico = "")
+ //{
+ // valorestablas vt;
+ // var iqvt = bd.valorestablas.Where(x => (x.idTablaNavigation.Codigo ?? "") == (CodigoTabla ?? "") && x.ValorInicial <= Valor && x.ValorFinal >= Valor);
+ // if (ParametroNumerico.HasValue)
+ // {
+ // iqvt = iqvt.Where(x => x.ParametroNumerico == ParametroNumerico.Value);
+ // }
+ // if (!string.IsNullOrEmpty(ParametroAlfabetico))
+ // {
+ // iqvt = iqvt.Where(x => (x.ParametroAlfabetico ?? "") == (ParametroAlfabetico ?? ""));
+ // }
+ // vt = iqvt.FirstOrDefault();
+ // if (vt is null)
+ // {
+ // return 0d;
+ // }
+ // else
+ // {
+ // return vt.Factor;
+ // }
+ //}
+ //public static double CalculaPrecioServicio(tscGrupoSanchoToro bd, presupuestos Presupuesto, detallepresupuesto DetPresupuesto, productos servicio, ref double cantidad)
+ //{
+ // preciosservicio precio;
+ // switch (DetPresupuesto.productos.Tipo) // servicio.Tipo
+ // {
+ // case (int)productos.TipoProductoEnum.TRIBUNA:
+ // {
+ // int NumFilas = (int)Math.Round((double)DetPresupuesto.Bloques.Sum(x => x.productos.NumeroFilas) / (double)DetPresupuesto.Bloques.Count);
+ // // precio = servicio.preciosservicioidProductoNavigation.FirstOrDefault(x => x.KmsDesde <= Presupuesto.Kilometros && x.KmsHasta >= Presupuesto.Kilometros && x.NumeroFilasDesde >= NumFilas && x.NumeroFilasHasta <= NumFilas && x.NumeroAsientosDesde <= DetPresupuesto.NumeroAsientos.Value && x.NumeroAsientosHasta >= DetPresupuesto.NumeroAsientos.Value && x.DiasAlquilerDesde <= Presupuesto.DiasAlquiler && x.DiasAlquilerHasta >= Presupuesto.DiasAlquiler && x.MesDesde <= Presupuesto.MesAlquiler && x.MesHasta >= Presupuesto.MesAlquiler && x.idProducto == DetPresupuesto.idProducto);
+ // precio = servicio.preciosservicioidProductoServicioNavigation.FirstOrDefault(x => x.KmsDesde <= Presupuesto.Kilometros && x.KmsHasta >= Presupuesto.Kilometros && x.NumeroFilasDesde <= NumFilas && x.NumeroFilasHasta >= NumFilas && x.NumeroAsientosDesde <= DetPresupuesto.NumeroAsientos.Value && x.NumeroAsientosHasta >= DetPresupuesto.NumeroAsientos.Value && x.idProducto == DetPresupuesto.idProductoNavigation.idProducto);
+ // break;
+ // }
+
+ // default:
+ // {
+ // int Ancho = DetPresupuesto.productos.Ancho;
+ // int Largo = DetPresupuesto.productos.Largo;
+ // //precio = servicio.preciosservicioidProductoNavigation.FirstOrDefault(x => x.AnchoDesde <= Ancho && x.AnchoHasta >= Ancho && x.LargoDesde <= Ancho && x.LargoHasta >= Ancho && x.KmsDesde <= Presupuesto.Kilometros && x.KmsHasta >= Presupuesto.Kilometros && x.DiasAlquilerDesde <= Presupuesto.DiasAlquiler && x.DiasAlquilerHasta >= Presupuesto.DiasAlquiler && x.MesDesde <= Presupuesto.MesAlquiler && x.MesHasta >= Presupuesto.MesAlquiler && x.idProducto == DetPresupuesto.idProducto);
+ // string Codigo = DetPresupuesto.idProductoNavigation.Codigo.Split(".")[0];
+ // precio = servicio.preciosservicioidProductoServicioNavigation.FirstOrDefault(x => x.AnchoDesde <= Ancho && x.AnchoHasta >= Ancho && x.LargoDesde <= Ancho && x.LargoHasta >= Ancho && x.KmsDesde <= Presupuesto.Kilometros && x.KmsHasta >= Presupuesto.Kilometros && x.idProductoNavigation.Codigo == Codigo);
+ // break;
+ // }
+ // }
+ // // If precio Is Nothing Then Throw New Exception("No existen precios del servicio " & servicio.Descripcion & " con los datos indicados")
+ // if (precio is not null)
+ // {
+ // cantidad = precio.CantidadCalculada;
+ // double pr = precio.PrecioFijo;
+ // if (servicio.PrecioPorDia)
+ // pr = pr * (double)Presupuesto.DiasAlquiler;
+ // if (servicio.PrecioPorKm)
+ // pr = pr * Presupuesto.Kilometros;
+ // if (servicio.PrecioPorAsiento)
+ // pr = (double)(pr * DetPresupuesto.NumeroAsientos);
+ // return Math.Max(servicio.PrecioMinimo, pr);
+ // }
+ // else
+ // {
+ // // PENDIENTE DE ADVERTENCIA
+ // cantidad = 1d;
+ // return servicio.PrecioMinimo;
+ // }
+
+ //}
+ //private static double CalculaPrecioProducto(tscGrupoSanchoToro bd, detallepresupuesto DetPresupuesto, desgloseproductos dproServicio)
+ //{
+ // string formula = dproServicio.idFormulaNavigation.Formula;
+ // var parametros = DetPresupuesto.parametrosdetallepresupuesto;
+ // foreach (var p in parametros)
+ // formula = formula.Replace("!P(" + p.idParametroNavigation.Codigo + ")", p.Valor.ToString());
+ // formula = formula.Replace("!T(", "CalculosDinamicos.FNTabla(bd,");
+ // formula = formula.Replace("!TF(", "CalculosDinamicos.FNTablaPorFilas(bd,");
+ // // formula = formula.Replace("!V(NUMFIL)", DetPresupuesto.productos.NumeroFilas.ToString)
+ // formula = formula.Replace("!V(NUMASI)", DetPresupuesto.NumeroAsientos.Value.ToString());
+ // formula = formula.Replace("!V(KM)", DetPresupuesto.idPresupuestoNavigation.Kilometros.ToString());
+ // formula = formula.Replace("!V(CPR)", '"' + dproServicio.idProductoNavigation.Codigo.ToString() + '"');
+ // var cd = new CalculosDinamicos();
+ // var las = new List();
+ // las.Add("System.dll");
+ // las.Add("System.Data.dll");
+ // las.Add("System.Data.Entity.dll");
+ // las.Add("dll");
+ // las.Add("tsWPF.dll");
+ // las.Add("tsl5.dll");
+ // var lp = new List();
+ // lp.Add("bd As tscGrupoSanchoToro");
+ // // For Each p In parametros
+ // // Dim spar As String = p.parametros.Codigo & " as "
+ // // Select Case p.parametros.Tipo
+ // // Case TipoParametroEnum.ENTERO
+
+ // // End Select
+
+ // // lp.Add(p.parametros.Codigo) & " as "
+
+ // // Next
+ // var le = new List();
+ // le.Add("System");
+ // le.Add("System.Text");
+ // le.Add("bdGrupoSanchoToro");
+ // le.Add("tscGrupoSanchoToro");
+ // le.Add("Utilidades");
+ // cd.PrecompilarFuncion(formula, las, lp, le);
+ // var pars = new object[1];
+ // pars[0] = bd;
+ // return cd.Evaluar(pars);
+ //}
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/bdGrupoSanchoToro/CodeTemplates/EFCore/DbContext.t4 b/bdGrupoSanchoToro/CodeTemplates/EFCore/DbContext.t4
new file mode 100644
index 0000000..a0a6c10
--- /dev/null
+++ b/bdGrupoSanchoToro/CodeTemplates/EFCore/DbContext.t4
@@ -0,0 +1,353 @@
+<#@ template hostSpecific="true" #>
+<#@ assembly name="Microsoft.EntityFrameworkCore" #>
+<#@ assembly name="Microsoft.EntityFrameworkCore.Design" #>
+<#@ assembly name="Microsoft.EntityFrameworkCore.Relational" #>
+<#@ assembly name="Microsoft.Extensions.DependencyInjection.Abstractions" #>
+<#@ parameter name="Model" type="Microsoft.EntityFrameworkCore.Metadata.IModel" #>
+<#@ parameter name="Options" type="Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions" #>
+<#@ parameter name="NamespaceHint" type="System.String" #>
+<#@ import namespace="System.Collections.Generic" #>
+<#@ import namespace="System.Linq" #>
+<#@ import namespace="System.Text" #>
+<#@ import namespace="Microsoft.EntityFrameworkCore" #>
+<#@ import namespace="Microsoft.EntityFrameworkCore.Design" #>
+<#@ import namespace="Microsoft.EntityFrameworkCore.Infrastructure" #>
+<#@ import namespace="Microsoft.EntityFrameworkCore.Scaffolding" #>
+<#@ import namespace="Microsoft.Extensions.DependencyInjection" #>
+<#
+ // Template version: 800 - please do NOT remove this line
+ if (!ProductInfo.GetVersion().StartsWith("8.0"))
+ {
+ Warning("Your templates were created using an older version of Entity Framework. Additional features and bug fixes may be available. See https://aka.ms/efcore-docs-updating-templates for more information.");
+ }
+
+ var services = (IServiceProvider)Host;
+ var providerCode = services.GetRequiredService();
+ var annotationCodeGenerator = services.GetRequiredService();
+ var code = services.GetRequiredService();
+
+ var usings = new List
+ {
+ "System",
+ "System.Collections.Generic",
+ "Microsoft.EntityFrameworkCore"
+ };
+
+ if (NamespaceHint != Options.ModelNamespace
+ && !string.IsNullOrEmpty(Options.ModelNamespace))
+ {
+ usings.Add(Options.ModelNamespace);
+ }
+
+ if (!string.IsNullOrEmpty(NamespaceHint))
+ {
+#>
+namespace <#= NamespaceHint #>;
+
+<#
+ }
+#>
+public partial class <#= Options.ContextName #> : DbContext
+{
+<#
+ if (!Options.SuppressOnConfiguring)
+ {
+#>
+ public <#= Options.ContextName #>()
+ {
+ }
+
+<#
+ }
+#>
+ public <#= Options.ContextName #>(DbContextOptions<<#= Options.ContextName #>> options)
+ : base(options)
+ {
+ }
+
+<#
+ foreach (var entityType in Model.GetEntityTypes().Where(e => !e.IsSimpleManyToManyJoinEntityType()))
+ {
+#>
+ public virtual DbSet<<#= entityType.Name #>> <#= entityType.GetDbSetName() #> { get; set; }
+
+<#
+ }
+
+ if (!Options.SuppressOnConfiguring)
+ {
+#>
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+<#
+ if (!Options.SuppressConnectionStringWarning)
+ {
+#>
+#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
+<#
+ }
+#>
+ => optionsBuilder<#= code.Fragment(providerCode.GenerateUseProvider(Options.ConnectionString), indent: 3) #>;
+
+<#
+ }
+
+#>
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+<#
+ var anyConfiguration = false;
+
+ var modelFluentApiCalls = Model.GetFluentApiCalls(annotationCodeGenerator);
+ if (modelFluentApiCalls != null)
+ {
+ usings.AddRange(modelFluentApiCalls.GetRequiredUsings());
+#>
+ modelBuilder<#= code.Fragment(modelFluentApiCalls, indent: 3) #>;
+<#
+ anyConfiguration = true;
+ }
+
+ StringBuilder mainEnvironment;
+ foreach (var entityType in Model.GetEntityTypes().Where(e => !e.IsSimpleManyToManyJoinEntityType()))
+ {
+ // Save all previously generated code, and start generating into a new temporary environment
+ mainEnvironment = GenerationEnvironment;
+ GenerationEnvironment = new StringBuilder();
+
+ if (anyConfiguration)
+ {
+ WriteLine("");
+ }
+
+ var anyEntityTypeConfiguration = false;
+#>
+ modelBuilder.Entity<<#= entityType.Name #>>(entity =>
+ {
+<#
+ var key = entityType.FindPrimaryKey();
+ if (key != null)
+ {
+ var keyFluentApiCalls = key.GetFluentApiCalls(annotationCodeGenerator);
+ if (keyFluentApiCalls != null
+ || (!key.IsHandledByConvention() && !Options.UseDataAnnotations))
+ {
+ if (keyFluentApiCalls != null)
+ {
+ usings.AddRange(keyFluentApiCalls.GetRequiredUsings());
+ }
+#>
+ entity.HasKey(<#= code.Lambda(key.Properties, "e") #>)<#= code.Fragment(keyFluentApiCalls, indent: 4) #>;
+<#
+ anyEntityTypeConfiguration = true;
+ }
+ }
+
+ var entityTypeFluentApiCalls = entityType.GetFluentApiCalls(annotationCodeGenerator)
+ ?.FilterChain(c => !(Options.UseDataAnnotations && c.IsHandledByDataAnnotations));
+ if (entityTypeFluentApiCalls != null)
+ {
+ usings.AddRange(entityTypeFluentApiCalls.GetRequiredUsings());
+
+ if (anyEntityTypeConfiguration)
+ {
+ WriteLine("");
+ }
+#>
+ entity<#= code.Fragment(entityTypeFluentApiCalls, indent: 4) #>;
+<#
+ anyEntityTypeConfiguration = true;
+ }
+
+ foreach (var index in entityType.GetIndexes()
+ .Where(i => !(Options.UseDataAnnotations && i.IsHandledByDataAnnotations(annotationCodeGenerator))))
+ {
+ if (anyEntityTypeConfiguration)
+ {
+ WriteLine("");
+ }
+
+ var indexFluentApiCalls = index.GetFluentApiCalls(annotationCodeGenerator);
+ if (indexFluentApiCalls != null)
+ {
+ usings.AddRange(indexFluentApiCalls.GetRequiredUsings());
+ }
+#>
+ entity.HasIndex(<#= code.Lambda(index.Properties, "e") #>, <#= code.Literal(index.GetDatabaseName()) #>)<#= code.Fragment(indexFluentApiCalls, indent: 4) #>;
+<#
+ anyEntityTypeConfiguration = true;
+ }
+
+ var firstProperty = true;
+ foreach (var property in entityType.GetProperties())
+ {
+ var propertyFluentApiCalls = property.GetFluentApiCalls(annotationCodeGenerator)
+ ?.FilterChain(c => !(Options.UseDataAnnotations && c.IsHandledByDataAnnotations)
+ && !(c.Method == "IsRequired" && Options.UseNullableReferenceTypes && !property.ClrType.IsValueType));
+ if (propertyFluentApiCalls == null)
+ {
+ continue;
+ }
+
+ usings.AddRange(propertyFluentApiCalls.GetRequiredUsings());
+
+ if (anyEntityTypeConfiguration && firstProperty)
+ {
+ WriteLine("");
+ }
+#>
+ entity.Property(e => e.<#= property.Name #>)<#= code.Fragment(propertyFluentApiCalls, indent: 4) #>;
+<#
+ anyEntityTypeConfiguration = true;
+ firstProperty = false;
+ }
+
+ foreach (var foreignKey in entityType.GetForeignKeys())
+ {
+ var foreignKeyFluentApiCalls = foreignKey.GetFluentApiCalls(annotationCodeGenerator)
+ ?.FilterChain(c => !(Options.UseDataAnnotations && c.IsHandledByDataAnnotations));
+ if (foreignKeyFluentApiCalls == null)
+ {
+ continue;
+ }
+
+ usings.AddRange(foreignKeyFluentApiCalls.GetRequiredUsings());
+
+ if (anyEntityTypeConfiguration)
+ {
+ WriteLine("");
+ }
+#>
+ entity.HasOne(d => d.<#= foreignKey.DependentToPrincipal.Name #>).<#= foreignKey.IsUnique ? "WithOne" : "WithMany" #>(<#= foreignKey.PrincipalToDependent != null ? $"p => p.{foreignKey.PrincipalToDependent.Name}" : "" #>)<#= code.Fragment(foreignKeyFluentApiCalls, indent: 4) #>;
+<#
+ anyEntityTypeConfiguration = true;
+ }
+
+ foreach (var skipNavigation in entityType.GetSkipNavigations().Where(n => n.IsLeftNavigation()))
+ {
+ if (anyEntityTypeConfiguration)
+ {
+ WriteLine("");
+ }
+
+ var left = skipNavigation.ForeignKey;
+ var leftFluentApiCalls = left.GetFluentApiCalls(annotationCodeGenerator, useStrings: true);
+ var right = skipNavigation.Inverse.ForeignKey;
+ var rightFluentApiCalls = right.GetFluentApiCalls(annotationCodeGenerator, useStrings: true);
+ var joinEntityType = skipNavigation.JoinEntityType;
+
+ if (leftFluentApiCalls != null)
+ {
+ usings.AddRange(leftFluentApiCalls.GetRequiredUsings());
+ }
+
+ if (rightFluentApiCalls != null)
+ {
+ usings.AddRange(rightFluentApiCalls.GetRequiredUsings());
+ }
+#>
+ entity.HasMany(d => d.<#= skipNavigation.Name #>).WithMany(p => p.<#= skipNavigation.Inverse.Name #>)
+ .UsingEntity>(
+ <#= code.Literal(joinEntityType.Name) #>,
+ r => r.HasOne<<#= right.PrincipalEntityType.Name #>>().WithMany()<#= code.Fragment(rightFluentApiCalls, indent: 6) #>,
+ l => l.HasOne<<#= left.PrincipalEntityType.Name #>>().WithMany()<#= code.Fragment(leftFluentApiCalls, indent: 6) #>,
+ j =>
+ {
+<#
+ var joinKey = joinEntityType.FindPrimaryKey();
+ var joinKeyFluentApiCalls = joinKey.GetFluentApiCalls(annotationCodeGenerator);
+
+ if (joinKeyFluentApiCalls != null)
+ {
+ usings.AddRange(joinKeyFluentApiCalls.GetRequiredUsings());
+ }
+#>
+ j.HasKey(<#= code.Arguments(joinKey.Properties.Select(e => e.Name)) #>)<#= code.Fragment(joinKeyFluentApiCalls, indent: 7) #>;
+<#
+ var joinEntityTypeFluentApiCalls = joinEntityType.GetFluentApiCalls(annotationCodeGenerator);
+ if (joinEntityTypeFluentApiCalls != null)
+ {
+ usings.AddRange(joinEntityTypeFluentApiCalls.GetRequiredUsings());
+#>
+ j<#= code.Fragment(joinEntityTypeFluentApiCalls, indent: 7) #>;
+<#
+ }
+
+ foreach (var index in joinEntityType.GetIndexes())
+ {
+ var indexFluentApiCalls = index.GetFluentApiCalls(annotationCodeGenerator);
+ if (indexFluentApiCalls != null)
+ {
+ usings.AddRange(indexFluentApiCalls.GetRequiredUsings());
+ }
+#>
+ j.HasIndex(<#= code.Literal(index.Properties.Select(e => e.Name).ToArray()) #>, <#= code.Literal(index.GetDatabaseName()) #>)<#= code.Fragment(indexFluentApiCalls, indent: 7) #>;
+<#
+ }
+
+ foreach (var property in joinEntityType.GetProperties())
+ {
+ var propertyFluentApiCalls = property.GetFluentApiCalls(annotationCodeGenerator);
+ if (propertyFluentApiCalls == null)
+ {
+ continue;
+ }
+
+ usings.AddRange(propertyFluentApiCalls.GetRequiredUsings());
+#>
+ j.IndexerProperty<<#= code.Reference(property.ClrType) #>>(<#= code.Literal(property.Name) #>)<#= code.Fragment(propertyFluentApiCalls, indent: 7) #>;
+<#
+ }
+#>
+ });
+<#
+ anyEntityTypeConfiguration = true;
+ }
+#>
+ });
+<#
+ // If any signicant code was generated, append it to the main environment
+ if (anyEntityTypeConfiguration)
+ {
+ mainEnvironment.Append(GenerationEnvironment);
+ anyConfiguration = true;
+ }
+
+ // Resume generating code into the main environment
+ GenerationEnvironment = mainEnvironment;
+ }
+
+ foreach (var sequence in Model.GetSequences())
+ {
+ var needsType = sequence.Type != typeof(long);
+ var needsSchema = !string.IsNullOrEmpty(sequence.Schema) && sequence.Schema != sequence.Model.GetDefaultSchema();
+ var sequenceFluentApiCalls = sequence.GetFluentApiCalls(annotationCodeGenerator);
+#>
+ modelBuilder.HasSequence<#= needsType ? $"<{code.Reference(sequence.Type)}>" : "" #>(<#= code.Literal(sequence.Name) #><#= needsSchema ? $", {code.Literal(sequence.Schema)}" : "" #>)<#= code.Fragment(sequenceFluentApiCalls, indent: 3) #>;
+<#
+ }
+
+ if (anyConfiguration)
+ {
+ WriteLine("");
+ }
+#>
+ OnModelCreatingPartial(modelBuilder);
+ }
+
+ partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
+}
+<#
+ mainEnvironment = GenerationEnvironment;
+ GenerationEnvironment = new StringBuilder();
+
+ foreach (var ns in usings.Distinct().OrderBy(x => x, new NamespaceComparer()))
+ {
+#>
+using <#= ns #>;
+<#
+ }
+
+ WriteLine("");
+
+ GenerationEnvironment.Append(mainEnvironment);
+#>
diff --git a/bdGrupoSanchoToro/CodeTemplates/EFCore/EntityType.t4 b/bdGrupoSanchoToro/CodeTemplates/EFCore/EntityType.t4
new file mode 100644
index 0000000..5985ee7
--- /dev/null
+++ b/bdGrupoSanchoToro/CodeTemplates/EFCore/EntityType.t4
@@ -0,0 +1,176 @@
+<#@ template hostSpecific="true" #>
+<#@ assembly name="Microsoft.EntityFrameworkCore" #>
+<#@ assembly name="Microsoft.EntityFrameworkCore.Design" #>
+<#@ assembly name="Microsoft.EntityFrameworkCore.Relational" #>
+<#@ assembly name="Microsoft.Extensions.DependencyInjection.Abstractions" #>
+<#@ parameter name="EntityType" type="Microsoft.EntityFrameworkCore.Metadata.IEntityType" #>
+<#@ parameter name="Options" type="Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions" #>
+<#@ parameter name="NamespaceHint" type="System.String" #>
+<#@ import namespace="System.Collections.Generic" #>
+<#@ import namespace="System.ComponentModel.DataAnnotations" #>
+<#@ import namespace="System.Linq" #>
+<#@ import namespace="System.Text" #>
+<#@ import namespace="Microsoft.EntityFrameworkCore" #>
+<#@ import namespace="Microsoft.EntityFrameworkCore.Design" #>
+<#@ import namespace="Microsoft.Extensions.DependencyInjection" #>
+<#
+ // Template version: 800 - please do NOT remove this line
+ if (EntityType.IsSimpleManyToManyJoinEntityType())
+ {
+ // Don't scaffold these
+ return "";
+ }
+
+ var services = (IServiceProvider)Host;
+ var annotationCodeGenerator = services.GetRequiredService();
+ var code = services.GetRequiredService();
+
+ var usings = new List
+ {
+ "System",
+ "System.Collections.Generic",
+ "PropertyChanged"
+ };
+
+ if (Options.UseDataAnnotations)
+ {
+ usings.Add("System.ComponentModel.DataAnnotations");
+ usings.Add("System.ComponentModel.DataAnnotations.Schema");
+ usings.Add("Microsoft.EntityFrameworkCore");
+ }
+
+ if (!string.IsNullOrEmpty(NamespaceHint))
+ {
+#>
+namespace <#= NamespaceHint #>;
+
+<#
+ }
+
+ if (!string.IsNullOrEmpty(EntityType.GetComment()))
+ {
+#>
+///
+/// <#= code.XmlComment(EntityType.GetComment()) #>
+///
+<#
+ }
+
+ if (Options.UseDataAnnotations)
+ {
+ foreach (var dataAnnotation in EntityType.GetDataAnnotations(annotationCodeGenerator))
+ {
+#>
+<#= code.Fragment(dataAnnotation) #>
+<#
+ }
+ }
+#>
+[AddINotifyPropertyChangedInterface]
+public partial class <#= EntityType.Name #>
+{
+<#
+ var firstProperty = true;
+ foreach (var property in EntityType.GetProperties().OrderBy(p => p.GetColumnOrder() ?? -1))
+ {
+ if (!firstProperty)
+ {
+ WriteLine("");
+ }
+
+ if (!string.IsNullOrEmpty(property.GetComment()))
+ {
+#>
+ ///
+ /// <#= code.XmlComment(property.GetComment(), indent: 1) #>
+ ///
+<#
+ }
+
+ if (Options.UseDataAnnotations)
+ {
+ var dataAnnotations = property.GetDataAnnotations(annotationCodeGenerator)
+ .Where(a => !(a.Type == typeof(RequiredAttribute) && Options.UseNullableReferenceTypes && !property.ClrType.IsValueType));
+ foreach (var dataAnnotation in dataAnnotations)
+ {
+#>
+ <#= code.Fragment(dataAnnotation) #>
+<#
+ }
+ }
+
+ usings.AddRange(code.GetRequiredUsings(property.ClrType));
+
+ var needsNullable = Options.UseNullableReferenceTypes && property.IsNullable && !property.ClrType.IsValueType;
+ var needsInitializer = Options.UseNullableReferenceTypes && !property.IsNullable && !property.ClrType.IsValueType;
+#>
+ public <#= code.Reference(property.ClrType) #><#= needsNullable ? "?" : "" #> <#= property.Name #> { get; set; }<#= needsInitializer ? " = null!;" : "" #>
+<#
+ firstProperty = false;
+ }
+
+ foreach (var navigation in EntityType.GetNavigations())
+ {
+ WriteLine("");
+
+ if (Options.UseDataAnnotations)
+ {
+ foreach (var dataAnnotation in navigation.GetDataAnnotations(annotationCodeGenerator))
+ {
+#>
+ <#= code.Fragment(dataAnnotation) #>
+<#
+ }
+ }
+
+ var targetType = navigation.TargetEntityType.Name;
+ if (navigation.IsCollection)
+ {
+#>
+ public virtual ICollection<<#= targetType #>> <#= navigation.Name #> { get; set; } = new List<<#= targetType #>>();
+<#
+ }
+ else
+ {
+ var needsNullable = Options.UseNullableReferenceTypes && !(navigation.ForeignKey.IsRequired && navigation.IsOnDependent);
+ var needsInitializer = Options.UseNullableReferenceTypes && navigation.ForeignKey.IsRequired && navigation.IsOnDependent;
+#>
+ public virtual <#= targetType #><#= needsNullable ? "?" : "" #> <#= navigation.Name #> { get; set; }<#= needsInitializer ? " = null!;" : "" #>
+<#
+ }
+ }
+
+ foreach (var skipNavigation in EntityType.GetSkipNavigations())
+ {
+ WriteLine("");
+
+ if (Options.UseDataAnnotations)
+ {
+ foreach (var dataAnnotation in skipNavigation.GetDataAnnotations(annotationCodeGenerator))
+ {
+#>
+ <#= code.Fragment(dataAnnotation) #>
+<#
+ }
+ }
+#>
+ public virtual ICollection<<#= skipNavigation.TargetEntityType.Name #>> <#= skipNavigation.Name #> { get; set; } = new List<<#= skipNavigation.TargetEntityType.Name #>>();
+<#
+ }
+#>
+}
+<#
+ var previousOutput = GenerationEnvironment;
+ GenerationEnvironment = new StringBuilder();
+
+ foreach (var ns in usings.Distinct().OrderBy(x => x, new NamespaceComparer()))
+ {
+#>
+using <#= ns #>;
+<#
+ }
+
+ WriteLine("");
+
+ GenerationEnvironment.Append(previousOutput);
+#>
diff --git a/bdGrupoSanchoToro/Connected Services/ServiceReference1/ConnectedService.json b/bdGrupoSanchoToro/Connected Services/ServiceReference1/ConnectedService.json
new file mode 100644
index 0000000..6646636
--- /dev/null
+++ b/bdGrupoSanchoToro/Connected Services/ServiceReference1/ConnectedService.json
@@ -0,0 +1,104 @@
+{
+ "ExtendedData": {
+ "inputs": [
+ "https://prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/SistemaFacturacion.wsdl"
+ ],
+ "collectionTypes": [
+ "System.Array",
+ "System.Collections.Generic.Dictionary`2"
+ ],
+ "namespaceMappings": [
+ "*, ServiceReference1"
+ ],
+ "references": [
+ "C:\\m3soft\\vs.net\\GrupoSanchoToro\\bdGrupoSanchoToro\\bin\\Debug\\net8.0\\tsEFCore8.dll",
+ "C:\\m3soft\\vs.net\\GrupoSanchoToro\\bdGrupoSanchoToro\\bin\\Debug\\net8.0\\tsUtilidades.dll",
+ "Castle.Core, {Castle.Core, 5.1.1}",
+ "Google.Protobuf, {Google.Protobuf, 3.25.2}",
+ "IbanNet, {IbanNet, 5.14.0}",
+ "K4os.Compression.LZ4, {K4os.Compression.LZ4, 1.3.6}",
+ "K4os.Compression.LZ4.Streams, {K4os.Compression.LZ4.Streams, 1.3.6}",
+ "K4os.Hash.xxHash, {K4os.Hash.xxHash, 1.0.8}",
+ "Microsoft.Bcl.AsyncInterfaces, {Microsoft.Bcl.AsyncInterfaces, 6.0.0}",
+ "Microsoft.EntityFrameworkCore, {Microsoft.EntityFrameworkCore, 8.0.10}",
+ "Microsoft.EntityFrameworkCore.Abstractions, {Microsoft.EntityFrameworkCore.Abstractions, 8.0.10}",
+ "Microsoft.EntityFrameworkCore.DynamicLinq, {Microsoft.EntityFrameworkCore.DynamicLinq, 8.3.8}",
+ "Microsoft.EntityFrameworkCore.Proxies, {Microsoft.EntityFrameworkCore.Proxies, 8.0.1}",
+ "Microsoft.EntityFrameworkCore.Relational, {Microsoft.EntityFrameworkCore.Relational, 8.0.10}",
+ "Microsoft.Extensions.Caching.Abstractions, {Microsoft.Extensions.Caching.Abstractions, 8.0.0}",
+ "Microsoft.Extensions.Caching.Memory, {Microsoft.Extensions.Caching.Memory, 8.0.1}",
+ "Microsoft.Extensions.Configuration.Abstractions, {Microsoft.Extensions.Configuration.Abstractions, 8.0.0}",
+ "Microsoft.Extensions.DependencyInjection, {Microsoft.Extensions.DependencyInjection, 8.0.1}",
+ "Microsoft.Extensions.DependencyInjection.Abstractions, {Microsoft.Extensions.DependencyInjection.Abstractions, 8.0.2}",
+ "Microsoft.Extensions.Logging, {Microsoft.Extensions.Logging, 8.0.1}",
+ "Microsoft.Extensions.Logging.Abstractions, {Microsoft.Extensions.Logging.Abstractions, 8.0.2}",
+ "Microsoft.Extensions.ObjectPool, {Microsoft.Extensions.ObjectPool, 6.0.16}",
+ "Microsoft.Extensions.Options, {Microsoft.Extensions.Options, 8.0.2}",
+ "Microsoft.Extensions.Primitives, {Microsoft.Extensions.Primitives, 8.0.0}",
+ "Microsoft.IdentityModel.Logging, {Microsoft.IdentityModel.Logging, 6.8.0}",
+ "Microsoft.IdentityModel.Protocols.WsTrust, {Microsoft.IdentityModel.Protocols.WsTrust, 6.8.0}",
+ "Microsoft.IdentityModel.Tokens, {Microsoft.IdentityModel.Tokens, 6.8.0}",
+ "Microsoft.IdentityModel.Tokens.Saml, {Microsoft.IdentityModel.Tokens.Saml, 6.8.0}",
+ "Microsoft.IdentityModel.Xml, {Microsoft.IdentityModel.Xml, 6.8.0}",
+ "Microsoft.Win32.Registry.AccessControl, {Microsoft.Win32.Registry.AccessControl, 8.0.0}",
+ "Microsoft.Win32.SystemEvents, {Microsoft.Win32.SystemEvents, 8.0.0}",
+ "MySqlConnector, {MySqlConnector, 2.3.1}",
+ "Newtonsoft.Json, {Newtonsoft.Json, 13.0.3}",
+ "Pomelo.EntityFrameworkCore.MySql, {Pomelo.EntityFrameworkCore.MySql, 8.0.0-beta.2}",
+ "PropertyChanged, {PropertyChanged.Fody, 4.1.0}",
+ "Renci.SshNet, {SSH.NET, 2023.0.1}",
+ "SshNet.Security.Cryptography, {SshNet.Security.Cryptography, 1.3.0}",
+ "System.CodeDom, {System.CodeDom, 8.0.0}",
+ "System.ComponentModel.Annotations, {System.ComponentModel.Annotations, 5.0.0}",
+ "System.ComponentModel.Composition, {System.ComponentModel.Composition, 8.0.0}",
+ "System.ComponentModel.Composition.Registration, {System.ComponentModel.Composition.Registration, 8.0.0}",
+ "System.Configuration.ConfigurationManager, {System.Configuration.ConfigurationManager, 8.0.0}",
+ "System.Data.DataSetExtensions, {System.Data.DataSetExtensions, 4.5.0}",
+ "System.Data.Odbc, {System.Data.Odbc, 8.0.0}",
+ "System.Data.OleDb, {System.Data.OleDb, 8.0.0}",
+ "System.Data.SqlClient, {System.Data.SqlClient, 4.8.5}",
+ "System.Diagnostics.EventLog, {System.Diagnostics.EventLog, 8.0.0}",
+ "System.Diagnostics.PerformanceCounter, {System.Diagnostics.PerformanceCounter, 8.0.0}",
+ "System.DirectoryServices, {System.DirectoryServices, 8.0.0}",
+ "System.DirectoryServices.AccountManagement, {System.DirectoryServices.AccountManagement, 8.0.0}",
+ "System.DirectoryServices.Protocols, {System.DirectoryServices.Protocols, 8.0.0}",
+ "System.Drawing.Common, {System.Drawing.Common, 8.0.1}",
+ "System.Formats.Asn1, {System.Formats.Asn1, 8.0.0}",
+ "System.IO, {System.IO, 4.3.0}",
+ "System.IO.Packaging, {System.IO.Packaging, 8.0.0}",
+ "System.IO.Pipelines, {System.IO.Pipelines, 6.0.3}",
+ "System.IO.Ports, {System.IO.Ports, 8.0.0}",
+ "System.Linq.Dynamic.Core, {System.Linq.Dynamic.Core, 1.4.6}",
+ "System.Management, {System.Management, 8.0.0}",
+ "System.Reflection.Context, {System.Reflection.Context, 8.0.0}",
+ "System.Reflection.DispatchProxy, {System.Reflection.DispatchProxy, 4.7.1}",
+ "System.Runtime, {System.Runtime, 4.3.0}",
+ "System.Runtime.Caching, {System.Runtime.Caching, 8.0.0}",
+ "System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 4.5.0}",
+ "System.Security.Cryptography.Pkcs, {System.Security.Cryptography.Pkcs, 8.0.0}",
+ "System.Security.Cryptography.ProtectedData, {System.Security.Cryptography.ProtectedData, 8.0.0}",
+ "System.Security.Cryptography.Xml, {System.Security.Cryptography.Xml, 8.0.0}",
+ "System.Security.Permissions, {System.Security.Permissions, 8.0.0}",
+ "System.Security.Principal.Windows, {System.Security.Principal.Windows, 5.0.0}",
+ "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.0}",
+ "System.ServiceModel.Federation, {System.ServiceModel.Federation, 8.0.0}",
+ "System.ServiceModel.Http, {System.ServiceModel.Http, 8.0.0}",
+ "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.0}",
+ "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 8.0.0}",
+ "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.0}",
+ "System.ServiceModel.Syndication, {System.ServiceModel.Syndication, 8.0.0}",
+ "System.ServiceProcess.ServiceController, {System.ServiceProcess.ServiceController, 8.0.0}",
+ "System.Speech, {System.Speech, 8.0.0}",
+ "System.Text.Encoding, {System.Text.Encoding, 4.3.0}",
+ "System.Text.Encoding.CodePages, {System.Text.Encoding.CodePages, 8.0.0}",
+ "System.Threading.AccessControl, {System.Threading.AccessControl, 8.0.0}",
+ "System.Threading.Tasks, {System.Threading.Tasks, 4.3.0}",
+ "System.Web.Services.Description, {System.Web.Services.Description, 4.10.0}",
+ "System.Windows.Extensions, {System.Windows.Extensions, 8.0.0}",
+ "System.Xml.ReaderWriter, {System.Xml.ReaderWriter, 4.3.0}",
+ "System.Xml.XmlDocument, {System.Xml.XmlDocument, 4.3.0}"
+ ],
+ "targetFramework": "net8.0",
+ "typeReuseMode": "All"
+ }
+}
\ No newline at end of file
diff --git a/bdGrupoSanchoToro/Connected Services/ServiceReference1/Reference.cs b/bdGrupoSanchoToro/Connected Services/ServiceReference1/Reference.cs
new file mode 100644
index 0000000..c197341
--- /dev/null
+++ b/bdGrupoSanchoToro/Connected Services/ServiceReference1/Reference.cs
@@ -0,0 +1,5099 @@
+//------------------------------------------------------------------------------
+//
+// Este código fue generado por una herramienta.
+//
+// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
+// se vuelve a generar el código.
+//
+//------------------------------------------------------------------------------
+
+namespace ServiceReference1
+{
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.ServiceModel.ServiceContractAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SistemaFacturacion.wsdl", ConfigurationName="ServiceReference1.sfPortTypeVerifactu")]
+ public interface sfPortTypeVerifactu
+ {
+
+ [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
+ [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
+ [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RespuestaBaseType))]
+ System.Threading.Tasks.Task RegFactuSistemaFacturacionAsync(ServiceReference1.RegFactuSistemaFacturacionRequest request);
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroLR.xsd")]
+ public partial class RegFactuSistemaFacturacion
+ {
+
+ private CabeceraType cabeceraField;
+
+ private RegistroFacturaType[] registroFacturaField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public CabeceraType Cabecera
+ {
+ get
+ {
+ return this.cabeceraField;
+ }
+ set
+ {
+ this.cabeceraField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("RegistroFactura", Order=1)]
+ public RegistroFacturaType[] RegistroFactura
+ {
+ get
+ {
+ return this.registroFacturaField;
+ }
+ set
+ {
+ this.registroFacturaField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class CabeceraType
+ {
+
+ private PersonaFisicaJuridicaESType obligadoEmisionField;
+
+ private PersonaFisicaJuridicaESType representanteField;
+
+ private CabeceraTypeRemisionVoluntaria remisionVoluntariaField;
+
+ private CabeceraTypeRemisionRequerimiento remisionRequerimientoField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public PersonaFisicaJuridicaESType ObligadoEmision
+ {
+ get
+ {
+ return this.obligadoEmisionField;
+ }
+ set
+ {
+ this.obligadoEmisionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public PersonaFisicaJuridicaESType Representante
+ {
+ get
+ {
+ return this.representanteField;
+ }
+ set
+ {
+ this.representanteField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public CabeceraTypeRemisionVoluntaria RemisionVoluntaria
+ {
+ get
+ {
+ return this.remisionVoluntariaField;
+ }
+ set
+ {
+ this.remisionVoluntariaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public CabeceraTypeRemisionRequerimiento RemisionRequerimiento
+ {
+ get
+ {
+ return this.remisionRequerimientoField;
+ }
+ set
+ {
+ this.remisionRequerimientoField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class PersonaFisicaJuridicaESType
+ {
+
+ private string nombreRazonField;
+
+ private string nIFField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string NombreRazon
+ {
+ get
+ {
+ return this.nombreRazonField;
+ }
+ set
+ {
+ this.nombreRazonField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public string NIF
+ {
+ get
+ {
+ return this.nIFField;
+ }
+ set
+ {
+ this.nIFField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class RegistroDuplicadoType
+ {
+
+ private string idPeticionRegistroDuplicadoField;
+
+ private EstadoRegistroSFType estadoRegistroDuplicadoField;
+
+ private string codigoErrorRegistroField;
+
+ private string descripcionErrorRegistroField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string IdPeticionRegistroDuplicado
+ {
+ get
+ {
+ return this.idPeticionRegistroDuplicadoField;
+ }
+ set
+ {
+ this.idPeticionRegistroDuplicadoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public EstadoRegistroSFType EstadoRegistroDuplicado
+ {
+ get
+ {
+ return this.estadoRegistroDuplicadoField;
+ }
+ set
+ {
+ this.estadoRegistroDuplicadoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="integer", Order=2)]
+ public string CodigoErrorRegistro
+ {
+ get
+ {
+ return this.codigoErrorRegistroField;
+ }
+ set
+ {
+ this.codigoErrorRegistroField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public string DescripcionErrorRegistro
+ {
+ get
+ {
+ return this.descripcionErrorRegistroField;
+ }
+ set
+ {
+ this.descripcionErrorRegistroField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum EstadoRegistroSFType
+ {
+
+ ///
+ Correcta,
+
+ ///
+ AceptadaConErrores,
+
+ ///
+ Anulada,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class OperacionType
+ {
+
+ private TipoOperacionType tipoOperacionField;
+
+ private SubsanacionType subsanacionField;
+
+ private bool subsanacionFieldSpecified;
+
+ private RechazoPrevioType rechazoPrevioField;
+
+ private bool rechazoPrevioFieldSpecified;
+
+ private SinRegistroPrevioType sinRegistroPrevioField;
+
+ private bool sinRegistroPrevioFieldSpecified;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public TipoOperacionType TipoOperacion
+ {
+ get
+ {
+ return this.tipoOperacionField;
+ }
+ set
+ {
+ this.tipoOperacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public SubsanacionType Subsanacion
+ {
+ get
+ {
+ return this.subsanacionField;
+ }
+ set
+ {
+ this.subsanacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool SubsanacionSpecified
+ {
+ get
+ {
+ return this.subsanacionFieldSpecified;
+ }
+ set
+ {
+ this.subsanacionFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public RechazoPrevioType RechazoPrevio
+ {
+ get
+ {
+ return this.rechazoPrevioField;
+ }
+ set
+ {
+ this.rechazoPrevioField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool RechazoPrevioSpecified
+ {
+ get
+ {
+ return this.rechazoPrevioFieldSpecified;
+ }
+ set
+ {
+ this.rechazoPrevioFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public SinRegistroPrevioType SinRegistroPrevio
+ {
+ get
+ {
+ return this.sinRegistroPrevioField;
+ }
+ set
+ {
+ this.sinRegistroPrevioField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool SinRegistroPrevioSpecified
+ {
+ get
+ {
+ return this.sinRegistroPrevioFieldSpecified;
+ }
+ set
+ {
+ this.sinRegistroPrevioFieldSpecified = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum TipoOperacionType
+ {
+
+ ///
+ Alta,
+
+ ///
+ Anulacion,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum SubsanacionType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum RechazoPrevioType
+ {
+
+ ///
+ N,
+
+ ///
+ S,
+
+ ///
+ X,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum SinRegistroPrevioType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/RespuestaSuministro.xsd")]
+ public partial class RespuestaExpedidaType
+ {
+
+ private IDFacturaExpedidaType iDFacturaField;
+
+ private OperacionType operacionField;
+
+ private string refExternaField;
+
+ private EstadoRegistroType estadoRegistroField;
+
+ private string codigoErrorRegistroField;
+
+ private string descripcionErrorRegistroField;
+
+ private RegistroDuplicadoType registroDuplicadoField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public IDFacturaExpedidaType IDFactura
+ {
+ get
+ {
+ return this.iDFacturaField;
+ }
+ set
+ {
+ this.iDFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public OperacionType Operacion
+ {
+ get
+ {
+ return this.operacionField;
+ }
+ set
+ {
+ this.operacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string RefExterna
+ {
+ get
+ {
+ return this.refExternaField;
+ }
+ set
+ {
+ this.refExternaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public EstadoRegistroType EstadoRegistro
+ {
+ get
+ {
+ return this.estadoRegistroField;
+ }
+ set
+ {
+ this.estadoRegistroField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="integer", Order=4)]
+ public string CodigoErrorRegistro
+ {
+ get
+ {
+ return this.codigoErrorRegistroField;
+ }
+ set
+ {
+ this.codigoErrorRegistroField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=5)]
+ public string DescripcionErrorRegistro
+ {
+ get
+ {
+ return this.descripcionErrorRegistroField;
+ }
+ set
+ {
+ this.descripcionErrorRegistroField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=6)]
+ public RegistroDuplicadoType RegistroDuplicado
+ {
+ get
+ {
+ return this.registroDuplicadoField;
+ }
+ set
+ {
+ this.registroDuplicadoField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class IDFacturaExpedidaType
+ {
+
+ private string iDEmisorFacturaField;
+
+ private string numSerieFacturaField;
+
+ private string fechaExpedicionFacturaField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string IDEmisorFactura
+ {
+ get
+ {
+ return this.iDEmisorFacturaField;
+ }
+ set
+ {
+ this.iDEmisorFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public string NumSerieFactura
+ {
+ get
+ {
+ return this.numSerieFacturaField;
+ }
+ set
+ {
+ this.numSerieFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string FechaExpedicionFactura
+ {
+ get
+ {
+ return this.fechaExpedicionFacturaField;
+ }
+ set
+ {
+ this.fechaExpedicionFacturaField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/RespuestaSuministro.xsd")]
+ public enum EstadoRegistroType
+ {
+
+ ///
+ Correcto,
+
+ ///
+ AceptadoConErrores,
+
+ ///
+ Incorrecto,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class DatosPresentacionType
+ {
+
+ private string nIFPresentadorField;
+
+ private System.DateTime timestampPresentacionField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string NIFPresentador
+ {
+ get
+ {
+ return this.nIFPresentadorField;
+ }
+ set
+ {
+ this.nIFPresentadorField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public System.DateTime TimestampPresentacion
+ {
+ get
+ {
+ return this.timestampPresentacionField;
+ }
+ set
+ {
+ this.timestampPresentacionField = value;
+ }
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(RespuestaRegFactuSistemaFacturacionType))]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/RespuestaSuministro.xsd")]
+ public partial class RespuestaBaseType
+ {
+
+ private string cSVField;
+
+ private DatosPresentacionType datosPresentacionField;
+
+ private CabeceraType cabeceraField;
+
+ private string tiempoEsperaEnvioField;
+
+ private EstadoEnvioType estadoEnvioField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string CSV
+ {
+ get
+ {
+ return this.cSVField;
+ }
+ set
+ {
+ this.cSVField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public DatosPresentacionType DatosPresentacion
+ {
+ get
+ {
+ return this.datosPresentacionField;
+ }
+ set
+ {
+ this.datosPresentacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public CabeceraType Cabecera
+ {
+ get
+ {
+ return this.cabeceraField;
+ }
+ set
+ {
+ this.cabeceraField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public string TiempoEsperaEnvio
+ {
+ get
+ {
+ return this.tiempoEsperaEnvioField;
+ }
+ set
+ {
+ this.tiempoEsperaEnvioField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=4)]
+ public EstadoEnvioType EstadoEnvio
+ {
+ get
+ {
+ return this.estadoEnvioField;
+ }
+ set
+ {
+ this.estadoEnvioField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/RespuestaSuministro.xsd")]
+ public enum EstadoEnvioType
+ {
+
+ ///
+ Correcto,
+
+ ///
+ ParcialmenteCorrecto,
+
+ ///
+ Incorrecto,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/RespuestaSuministro.xsd")]
+ public partial class RespuestaRegFactuSistemaFacturacionType : RespuestaBaseType
+ {
+
+ private RespuestaExpedidaType[] respuestaLineaField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("RespuestaLinea", Order=0)]
+ public RespuestaExpedidaType[] RespuestaLinea
+ {
+ get
+ {
+ return this.respuestaLineaField;
+ }
+ set
+ {
+ this.respuestaLineaField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class IDFacturaExpedidaBajaType
+ {
+
+ private string iDEmisorFacturaAnuladaField;
+
+ private string numSerieFacturaAnuladaField;
+
+ private string fechaExpedicionFacturaAnuladaField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string IDEmisorFacturaAnulada
+ {
+ get
+ {
+ return this.iDEmisorFacturaAnuladaField;
+ }
+ set
+ {
+ this.iDEmisorFacturaAnuladaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public string NumSerieFacturaAnulada
+ {
+ get
+ {
+ return this.numSerieFacturaAnuladaField;
+ }
+ set
+ {
+ this.numSerieFacturaAnuladaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string FechaExpedicionFacturaAnulada
+ {
+ get
+ {
+ return this.fechaExpedicionFacturaAnuladaField;
+ }
+ set
+ {
+ this.fechaExpedicionFacturaAnuladaField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class RegistroFacturacionAnulacionType
+ {
+
+ private VersionType iDVersionField;
+
+ private IDFacturaExpedidaBajaType iDFacturaField;
+
+ private string refExternaField;
+
+ private SinRegistroPrevioType sinRegistroPrevioField;
+
+ private bool sinRegistroPrevioFieldSpecified;
+
+ private RechazoPrevioAnulacionType rechazoPrevioField;
+
+ private bool rechazoPrevioFieldSpecified;
+
+ private GeneradoPorType generadoPorField;
+
+ private bool generadoPorFieldSpecified;
+
+ private PersonaFisicaJuridicaType generadorField;
+
+ private RegistroFacturacionAnulacionTypeEncadenamiento encadenamientoField;
+
+ private SistemaInformaticoType sistemaInformaticoField;
+
+ private System.DateTime fechaHoraHusoGenRegistroField;
+
+ private TipoHuellaType tipoHuellaField;
+
+ private string huellaField;
+
+ private SignatureType signatureField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public VersionType IDVersion
+ {
+ get
+ {
+ return this.iDVersionField;
+ }
+ set
+ {
+ this.iDVersionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public IDFacturaExpedidaBajaType IDFactura
+ {
+ get
+ {
+ return this.iDFacturaField;
+ }
+ set
+ {
+ this.iDFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string RefExterna
+ {
+ get
+ {
+ return this.refExternaField;
+ }
+ set
+ {
+ this.refExternaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public SinRegistroPrevioType SinRegistroPrevio
+ {
+ get
+ {
+ return this.sinRegistroPrevioField;
+ }
+ set
+ {
+ this.sinRegistroPrevioField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool SinRegistroPrevioSpecified
+ {
+ get
+ {
+ return this.sinRegistroPrevioFieldSpecified;
+ }
+ set
+ {
+ this.sinRegistroPrevioFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=4)]
+ public RechazoPrevioAnulacionType RechazoPrevio
+ {
+ get
+ {
+ return this.rechazoPrevioField;
+ }
+ set
+ {
+ this.rechazoPrevioField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool RechazoPrevioSpecified
+ {
+ get
+ {
+ return this.rechazoPrevioFieldSpecified;
+ }
+ set
+ {
+ this.rechazoPrevioFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=5)]
+ public GeneradoPorType GeneradoPor
+ {
+ get
+ {
+ return this.generadoPorField;
+ }
+ set
+ {
+ this.generadoPorField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool GeneradoPorSpecified
+ {
+ get
+ {
+ return this.generadoPorFieldSpecified;
+ }
+ set
+ {
+ this.generadoPorFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=6)]
+ public PersonaFisicaJuridicaType Generador
+ {
+ get
+ {
+ return this.generadorField;
+ }
+ set
+ {
+ this.generadorField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=7)]
+ public RegistroFacturacionAnulacionTypeEncadenamiento Encadenamiento
+ {
+ get
+ {
+ return this.encadenamientoField;
+ }
+ set
+ {
+ this.encadenamientoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=8)]
+ public SistemaInformaticoType SistemaInformatico
+ {
+ get
+ {
+ return this.sistemaInformaticoField;
+ }
+ set
+ {
+ this.sistemaInformaticoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=9)]
+ public System.DateTime FechaHoraHusoGenRegistro
+ {
+ get
+ {
+ return this.fechaHoraHusoGenRegistroField;
+ }
+ set
+ {
+ this.fechaHoraHusoGenRegistroField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=10)]
+ public TipoHuellaType TipoHuella
+ {
+ get
+ {
+ return this.tipoHuellaField;
+ }
+ set
+ {
+ this.tipoHuellaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=11)]
+ public string Huella
+ {
+ get
+ {
+ return this.huellaField;
+ }
+ set
+ {
+ this.huellaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#", Order=12)]
+ public SignatureType Signature
+ {
+ get
+ {
+ return this.signatureField;
+ }
+ set
+ {
+ this.signatureField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum VersionType
+ {
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("1.0")]
+ Item10,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum RechazoPrevioAnulacionType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum GeneradoPorType
+ {
+
+ ///
+ E,
+
+ ///
+ D,
+
+ ///
+ T,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class PersonaFisicaJuridicaType
+ {
+
+ private string nombreRazonField;
+
+ private object itemField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string NombreRazon
+ {
+ get
+ {
+ return this.nombreRazonField;
+ }
+ set
+ {
+ this.nombreRazonField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("IDOtro", typeof(IDOtroType), Order=1)]
+ [System.Xml.Serialization.XmlElementAttribute("NIF", typeof(string), Order=1)]
+ public object Item
+ {
+ get
+ {
+ return this.itemField;
+ }
+ set
+ {
+ this.itemField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class IDOtroType
+ {
+
+ private CountryType2 codigoPaisField;
+
+ private bool codigoPaisFieldSpecified;
+
+ private PersonaFisicaJuridicaIDTypeType iDTypeField;
+
+ private string idField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public CountryType2 CodigoPais
+ {
+ get
+ {
+ return this.codigoPaisField;
+ }
+ set
+ {
+ this.codigoPaisField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool CodigoPaisSpecified
+ {
+ get
+ {
+ return this.codigoPaisFieldSpecified;
+ }
+ set
+ {
+ this.codigoPaisFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public PersonaFisicaJuridicaIDTypeType IDType
+ {
+ get
+ {
+ return this.iDTypeField;
+ }
+ set
+ {
+ this.iDTypeField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string ID
+ {
+ get
+ {
+ return this.idField;
+ }
+ set
+ {
+ this.idField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum CountryType2
+ {
+
+ ///
+ AF,
+
+ ///
+ AL,
+
+ ///
+ DE,
+
+ ///
+ AD,
+
+ ///
+ AO,
+
+ ///
+ AI,
+
+ ///
+ AQ,
+
+ ///
+ AG,
+
+ ///
+ SA,
+
+ ///
+ DZ,
+
+ ///
+ AR,
+
+ ///
+ AM,
+
+ ///
+ AW,
+
+ ///
+ AU,
+
+ ///
+ AT,
+
+ ///
+ AZ,
+
+ ///
+ BS,
+
+ ///
+ BH,
+
+ ///
+ BD,
+
+ ///
+ BB,
+
+ ///
+ BE,
+
+ ///
+ BZ,
+
+ ///
+ BJ,
+
+ ///
+ BM,
+
+ ///
+ BY,
+
+ ///
+ BO,
+
+ ///
+ BA,
+
+ ///
+ BW,
+
+ ///
+ BV,
+
+ ///
+ BR,
+
+ ///
+ BN,
+
+ ///
+ BG,
+
+ ///
+ BF,
+
+ ///
+ BI,
+
+ ///
+ BT,
+
+ ///
+ CV,
+
+ ///
+ KY,
+
+ ///
+ KH,
+
+ ///
+ CM,
+
+ ///
+ CA,
+
+ ///
+ CF,
+
+ ///
+ CC,
+
+ ///
+ CO,
+
+ ///
+ KM,
+
+ ///
+ CG,
+
+ ///
+ CD,
+
+ ///
+ CK,
+
+ ///
+ KP,
+
+ ///
+ KR,
+
+ ///
+ CI,
+
+ ///
+ CR,
+
+ ///
+ HR,
+
+ ///
+ CU,
+
+ ///
+ TD,
+
+ ///
+ CZ,
+
+ ///
+ CL,
+
+ ///
+ CN,
+
+ ///
+ CY,
+
+ ///
+ CW,
+
+ ///
+ DK,
+
+ ///
+ DM,
+
+ ///
+ DO,
+
+ ///
+ EC,
+
+ ///
+ EG,
+
+ ///
+ AE,
+
+ ///
+ ER,
+
+ ///
+ SK,
+
+ ///
+ SI,
+
+ ///
+ ES,
+
+ ///
+ US,
+
+ ///
+ EE,
+
+ ///
+ ET,
+
+ ///
+ FO,
+
+ ///
+ PH,
+
+ ///
+ FI,
+
+ ///
+ FJ,
+
+ ///
+ FR,
+
+ ///
+ GA,
+
+ ///
+ GM,
+
+ ///
+ GE,
+
+ ///
+ GS,
+
+ ///
+ GH,
+
+ ///
+ GI,
+
+ ///
+ GD,
+
+ ///
+ GR,
+
+ ///
+ GL,
+
+ ///
+ GU,
+
+ ///
+ GT,
+
+ ///
+ GG,
+
+ ///
+ GN,
+
+ ///
+ GQ,
+
+ ///
+ GW,
+
+ ///
+ GY,
+
+ ///
+ HT,
+
+ ///
+ HM,
+
+ ///
+ HN,
+
+ ///
+ HK,
+
+ ///
+ HU,
+
+ ///
+ IN,
+
+ ///
+ ID,
+
+ ///
+ IR,
+
+ ///
+ IQ,
+
+ ///
+ IE,
+
+ ///
+ IM,
+
+ ///
+ IS,
+
+ ///
+ IL,
+
+ ///
+ IT,
+
+ ///
+ JM,
+
+ ///
+ JP,
+
+ ///
+ JE,
+
+ ///
+ JO,
+
+ ///
+ KZ,
+
+ ///
+ KE,
+
+ ///
+ KG,
+
+ ///
+ KI,
+
+ ///
+ KW,
+
+ ///
+ LA,
+
+ ///
+ LS,
+
+ ///
+ LV,
+
+ ///
+ LB,
+
+ ///
+ LR,
+
+ ///
+ LY,
+
+ ///
+ LI,
+
+ ///
+ LT,
+
+ ///
+ LU,
+
+ ///
+ XG,
+
+ ///
+ MO,
+
+ ///
+ MK,
+
+ ///
+ MG,
+
+ ///
+ MY,
+
+ ///
+ MW,
+
+ ///
+ MV,
+
+ ///
+ ML,
+
+ ///
+ MT,
+
+ ///
+ FK,
+
+ ///
+ MP,
+
+ ///
+ MA,
+
+ ///
+ MH,
+
+ ///
+ MU,
+
+ ///
+ MR,
+
+ ///
+ YT,
+
+ ///
+ UM,
+
+ ///
+ MX,
+
+ ///
+ FM,
+
+ ///
+ MD,
+
+ ///
+ MC,
+
+ ///
+ MN,
+
+ ///
+ ME,
+
+ ///
+ MS,
+
+ ///
+ MZ,
+
+ ///
+ MM,
+
+ ///
+ NA,
+
+ ///
+ NR,
+
+ ///
+ CX,
+
+ ///
+ NP,
+
+ ///
+ NI,
+
+ ///
+ NE,
+
+ ///
+ NG,
+
+ ///
+ NU,
+
+ ///
+ NF,
+
+ ///
+ NO,
+
+ ///
+ NC,
+
+ ///
+ NZ,
+
+ ///
+ IO,
+
+ ///
+ OM,
+
+ ///
+ NL,
+
+ ///
+ BQ,
+
+ ///
+ PK,
+
+ ///
+ PW,
+
+ ///
+ PA,
+
+ ///
+ PG,
+
+ ///
+ PY,
+
+ ///
+ PE,
+
+ ///
+ PN,
+
+ ///
+ PF,
+
+ ///
+ PL,
+
+ ///
+ PT,
+
+ ///
+ PR,
+
+ ///
+ QA,
+
+ ///
+ GB,
+
+ ///
+ RW,
+
+ ///
+ RO,
+
+ ///
+ RU,
+
+ ///
+ SB,
+
+ ///
+ SV,
+
+ ///
+ WS,
+
+ ///
+ AS,
+
+ ///
+ KN,
+
+ ///
+ SM,
+
+ ///
+ SX,
+
+ ///
+ PM,
+
+ ///
+ VC,
+
+ ///
+ SH,
+
+ ///
+ LC,
+
+ ///
+ ST,
+
+ ///
+ SN,
+
+ ///
+ RS,
+
+ ///
+ SC,
+
+ ///
+ SL,
+
+ ///
+ SG,
+
+ ///
+ SY,
+
+ ///
+ SO,
+
+ ///
+ LK,
+
+ ///
+ SZ,
+
+ ///
+ ZA,
+
+ ///
+ SD,
+
+ ///
+ SS,
+
+ ///
+ SE,
+
+ ///
+ CH,
+
+ ///
+ SR,
+
+ ///
+ TH,
+
+ ///
+ TW,
+
+ ///
+ TZ,
+
+ ///
+ TJ,
+
+ ///
+ PS,
+
+ ///
+ TF,
+
+ ///
+ TL,
+
+ ///
+ TG,
+
+ ///
+ TK,
+
+ ///
+ TO,
+
+ ///
+ TT,
+
+ ///
+ TN,
+
+ ///
+ TC,
+
+ ///
+ TM,
+
+ ///
+ TR,
+
+ ///
+ TV,
+
+ ///
+ UA,
+
+ ///
+ UG,
+
+ ///
+ UY,
+
+ ///
+ UZ,
+
+ ///
+ VU,
+
+ ///
+ VA,
+
+ ///
+ VE,
+
+ ///
+ VN,
+
+ ///
+ VG,
+
+ ///
+ VI,
+
+ ///
+ WF,
+
+ ///
+ YE,
+
+ ///
+ DJ,
+
+ ///
+ ZM,
+
+ ///
+ ZW,
+
+ ///
+ QU,
+
+ ///
+ XB,
+
+ ///
+ XU,
+
+ ///
+ XN,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum PersonaFisicaJuridicaIDTypeType
+ {
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("02")]
+ Item02,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("03")]
+ Item03,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("04")]
+ Item04,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("05")]
+ Item05,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("06")]
+ Item06,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("07")]
+ Item07,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class RegistroFacturacionAnulacionTypeEncadenamiento
+ {
+
+ private object itemField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("PrimerRegistro", typeof(PrimerRegistroCadenaType), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("RegistroAnterior", typeof(EncadenamientoFacturaAnteriorType), Order=0)]
+ public object Item
+ {
+ get
+ {
+ return this.itemField;
+ }
+ set
+ {
+ this.itemField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum PrimerRegistroCadenaType
+ {
+
+ ///
+ S,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class EncadenamientoFacturaAnteriorType
+ {
+
+ private string iDEmisorFacturaField;
+
+ private string numSerieFacturaField;
+
+ private string fechaExpedicionFacturaField;
+
+ private string huellaField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string IDEmisorFactura
+ {
+ get
+ {
+ return this.iDEmisorFacturaField;
+ }
+ set
+ {
+ this.iDEmisorFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public string NumSerieFactura
+ {
+ get
+ {
+ return this.numSerieFacturaField;
+ }
+ set
+ {
+ this.numSerieFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string FechaExpedicionFactura
+ {
+ get
+ {
+ return this.fechaExpedicionFacturaField;
+ }
+ set
+ {
+ this.fechaExpedicionFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public string Huella
+ {
+ get
+ {
+ return this.huellaField;
+ }
+ set
+ {
+ this.huellaField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class SistemaInformaticoType
+ {
+
+ private string nombreRazonField;
+
+ private object itemField;
+
+ private string nombreSistemaInformaticoField;
+
+ private string idSistemaInformaticoField;
+
+ private string versionField;
+
+ private string numeroInstalacionField;
+
+ private SiNoType tipoUsoPosibleSoloVerifactuField;
+
+ private SiNoType tipoUsoPosibleMultiOTField;
+
+ private SiNoType indicadorMultiplesOTField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string NombreRazon
+ {
+ get
+ {
+ return this.nombreRazonField;
+ }
+ set
+ {
+ this.nombreRazonField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("IDOtro", typeof(IDOtroType), Order=1)]
+ [System.Xml.Serialization.XmlElementAttribute("NIF", typeof(string), Order=1)]
+ public object Item
+ {
+ get
+ {
+ return this.itemField;
+ }
+ set
+ {
+ this.itemField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string NombreSistemaInformatico
+ {
+ get
+ {
+ return this.nombreSistemaInformaticoField;
+ }
+ set
+ {
+ this.nombreSistemaInformaticoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public string IdSistemaInformatico
+ {
+ get
+ {
+ return this.idSistemaInformaticoField;
+ }
+ set
+ {
+ this.idSistemaInformaticoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=4)]
+ public string Version
+ {
+ get
+ {
+ return this.versionField;
+ }
+ set
+ {
+ this.versionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=5)]
+ public string NumeroInstalacion
+ {
+ get
+ {
+ return this.numeroInstalacionField;
+ }
+ set
+ {
+ this.numeroInstalacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=6)]
+ public SiNoType TipoUsoPosibleSoloVerifactu
+ {
+ get
+ {
+ return this.tipoUsoPosibleSoloVerifactuField;
+ }
+ set
+ {
+ this.tipoUsoPosibleSoloVerifactuField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=7)]
+ public SiNoType TipoUsoPosibleMultiOT
+ {
+ get
+ {
+ return this.tipoUsoPosibleMultiOTField;
+ }
+ set
+ {
+ this.tipoUsoPosibleMultiOTField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=8)]
+ public SiNoType IndicadorMultiplesOT
+ {
+ get
+ {
+ return this.indicadorMultiplesOTField;
+ }
+ set
+ {
+ this.indicadorMultiplesOTField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum SiNoType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum TipoHuellaType
+ {
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("01")]
+ Item01,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class SignatureType
+ {
+
+ private SignedInfoType signedInfoField;
+
+ private SignatureValueType signatureValueField;
+
+ private KeyInfoType keyInfoField;
+
+ private ObjectType[] objectField;
+
+ private string idField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public SignedInfoType SignedInfo
+ {
+ get
+ {
+ return this.signedInfoField;
+ }
+ set
+ {
+ this.signedInfoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public SignatureValueType SignatureValue
+ {
+ get
+ {
+ return this.signatureValueField;
+ }
+ set
+ {
+ this.signatureValueField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public KeyInfoType KeyInfo
+ {
+ get
+ {
+ return this.keyInfoField;
+ }
+ set
+ {
+ this.keyInfoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("Object", Order=3)]
+ public ObjectType[] Object
+ {
+ get
+ {
+ return this.objectField;
+ }
+ set
+ {
+ this.objectField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="ID")]
+ public string Id
+ {
+ get
+ {
+ return this.idField;
+ }
+ set
+ {
+ this.idField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class SignedInfoType
+ {
+
+ private CanonicalizationMethodType canonicalizationMethodField;
+
+ private SignatureMethodType signatureMethodField;
+
+ private ReferenceType[] referenceField;
+
+ private string idField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public CanonicalizationMethodType CanonicalizationMethod
+ {
+ get
+ {
+ return this.canonicalizationMethodField;
+ }
+ set
+ {
+ this.canonicalizationMethodField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public SignatureMethodType SignatureMethod
+ {
+ get
+ {
+ return this.signatureMethodField;
+ }
+ set
+ {
+ this.signatureMethodField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("Reference", Order=2)]
+ public ReferenceType[] Reference
+ {
+ get
+ {
+ return this.referenceField;
+ }
+ set
+ {
+ this.referenceField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="ID")]
+ public string Id
+ {
+ get
+ {
+ return this.idField;
+ }
+ set
+ {
+ this.idField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class CanonicalizationMethodType
+ {
+
+ private System.Xml.XmlNode[] anyField;
+
+ private string algorithmField;
+
+ ///
+ [System.Xml.Serialization.XmlTextAttribute()]
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ public System.Xml.XmlNode[] Any
+ {
+ get
+ {
+ return this.anyField;
+ }
+ set
+ {
+ this.anyField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string Algorithm
+ {
+ get
+ {
+ return this.algorithmField;
+ }
+ set
+ {
+ this.algorithmField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class SignatureMethodType
+ {
+
+ private string hMACOutputLengthField;
+
+ private System.Xml.XmlNode[] anyField;
+
+ private string algorithmField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="integer", Order=0)]
+ public string HMACOutputLength
+ {
+ get
+ {
+ return this.hMACOutputLengthField;
+ }
+ set
+ {
+ this.hMACOutputLengthField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlTextAttribute()]
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=1)]
+ public System.Xml.XmlNode[] Any
+ {
+ get
+ {
+ return this.anyField;
+ }
+ set
+ {
+ this.anyField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string Algorithm
+ {
+ get
+ {
+ return this.algorithmField;
+ }
+ set
+ {
+ this.algorithmField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class ReferenceType
+ {
+
+ private TransformType[] transformsField;
+
+ private DigestMethodType digestMethodField;
+
+ private byte[] digestValueField;
+
+ private string idField;
+
+ private string uRIField;
+
+ private string typeField;
+
+ ///
+ [System.Xml.Serialization.XmlArrayAttribute(Order=0)]
+ [System.Xml.Serialization.XmlArrayItemAttribute("Transform", IsNullable=false)]
+ public TransformType[] Transforms
+ {
+ get
+ {
+ return this.transformsField;
+ }
+ set
+ {
+ this.transformsField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public DigestMethodType DigestMethod
+ {
+ get
+ {
+ return this.digestMethodField;
+ }
+ set
+ {
+ this.digestMethodField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=2)]
+ public byte[] DigestValue
+ {
+ get
+ {
+ return this.digestValueField;
+ }
+ set
+ {
+ this.digestValueField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="ID")]
+ public string Id
+ {
+ get
+ {
+ return this.idField;
+ }
+ set
+ {
+ this.idField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string URI
+ {
+ get
+ {
+ return this.uRIField;
+ }
+ set
+ {
+ this.uRIField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string Type
+ {
+ get
+ {
+ return this.typeField;
+ }
+ set
+ {
+ this.typeField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class TransformType
+ {
+
+ private object[] itemsField;
+
+ private string[] textField;
+
+ private string algorithmField;
+
+ ///
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("XPath", typeof(string), Order=0)]
+ public object[] Items
+ {
+ get
+ {
+ return this.itemsField;
+ }
+ set
+ {
+ this.itemsField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlTextAttribute()]
+ public string[] Text
+ {
+ get
+ {
+ return this.textField;
+ }
+ set
+ {
+ this.textField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string Algorithm
+ {
+ get
+ {
+ return this.algorithmField;
+ }
+ set
+ {
+ this.algorithmField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class DigestMethodType
+ {
+
+ private System.Xml.XmlNode[] anyField;
+
+ private string algorithmField;
+
+ ///
+ [System.Xml.Serialization.XmlTextAttribute()]
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ public System.Xml.XmlNode[] Any
+ {
+ get
+ {
+ return this.anyField;
+ }
+ set
+ {
+ this.anyField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string Algorithm
+ {
+ get
+ {
+ return this.algorithmField;
+ }
+ set
+ {
+ this.algorithmField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class SignatureValueType
+ {
+
+ private string idField;
+
+ private byte[] valueField;
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="ID")]
+ public string Id
+ {
+ get
+ {
+ return this.idField;
+ }
+ set
+ {
+ this.idField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlTextAttribute(DataType="base64Binary")]
+ public byte[] Value
+ {
+ get
+ {
+ return this.valueField;
+ }
+ set
+ {
+ this.valueField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class KeyInfoType
+ {
+
+ private object[] itemsField;
+
+ private ItemsChoiceType2[] itemsElementNameField;
+
+ private string[] textField;
+
+ private string idField;
+
+ ///
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("KeyName", typeof(string), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("KeyValue", typeof(KeyValueType), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("MgmtData", typeof(string), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("PGPData", typeof(PGPDataType), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("RetrievalMethod", typeof(RetrievalMethodType), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("SPKIData", typeof(SPKIDataType), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("X509Data", typeof(X509DataType), Order=0)]
+ [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
+ public object[] Items
+ {
+ get
+ {
+ return this.itemsField;
+ }
+ set
+ {
+ this.itemsField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("ItemsElementName", Order=1)]
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public ItemsChoiceType2[] ItemsElementName
+ {
+ get
+ {
+ return this.itemsElementNameField;
+ }
+ set
+ {
+ this.itemsElementNameField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlTextAttribute()]
+ public string[] Text
+ {
+ get
+ {
+ return this.textField;
+ }
+ set
+ {
+ this.textField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="ID")]
+ public string Id
+ {
+ get
+ {
+ return this.idField;
+ }
+ set
+ {
+ this.idField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class KeyValueType
+ {
+
+ private object itemField;
+
+ private string[] textField;
+
+ ///
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("DSAKeyValue", typeof(DSAKeyValueType), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("RSAKeyValue", typeof(RSAKeyValueType), Order=0)]
+ public object Item
+ {
+ get
+ {
+ return this.itemField;
+ }
+ set
+ {
+ this.itemField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlTextAttribute()]
+ public string[] Text
+ {
+ get
+ {
+ return this.textField;
+ }
+ set
+ {
+ this.textField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class DSAKeyValueType
+ {
+
+ private byte[] pField;
+
+ private byte[] qField;
+
+ private byte[] gField;
+
+ private byte[] yField;
+
+ private byte[] jField;
+
+ private byte[] seedField;
+
+ private byte[] pgenCounterField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=0)]
+ public byte[] P
+ {
+ get
+ {
+ return this.pField;
+ }
+ set
+ {
+ this.pField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=1)]
+ public byte[] Q
+ {
+ get
+ {
+ return this.qField;
+ }
+ set
+ {
+ this.qField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=2)]
+ public byte[] G
+ {
+ get
+ {
+ return this.gField;
+ }
+ set
+ {
+ this.gField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=3)]
+ public byte[] Y
+ {
+ get
+ {
+ return this.yField;
+ }
+ set
+ {
+ this.yField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=4)]
+ public byte[] J
+ {
+ get
+ {
+ return this.jField;
+ }
+ set
+ {
+ this.jField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=5)]
+ public byte[] Seed
+ {
+ get
+ {
+ return this.seedField;
+ }
+ set
+ {
+ this.seedField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=6)]
+ public byte[] PgenCounter
+ {
+ get
+ {
+ return this.pgenCounterField;
+ }
+ set
+ {
+ this.pgenCounterField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class RSAKeyValueType
+ {
+
+ private byte[] modulusField;
+
+ private byte[] exponentField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=0)]
+ public byte[] Modulus
+ {
+ get
+ {
+ return this.modulusField;
+ }
+ set
+ {
+ this.modulusField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=1)]
+ public byte[] Exponent
+ {
+ get
+ {
+ return this.exponentField;
+ }
+ set
+ {
+ this.exponentField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class PGPDataType
+ {
+
+ private object[] itemsField;
+
+ private ItemsChoiceType1[] itemsElementNameField;
+
+ ///
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("PGPKeyID", typeof(byte[]), DataType="base64Binary", Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("PGPKeyPacket", typeof(byte[]), DataType="base64Binary", Order=0)]
+ [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
+ public object[] Items
+ {
+ get
+ {
+ return this.itemsField;
+ }
+ set
+ {
+ this.itemsField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("ItemsElementName", Order=1)]
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public ItemsChoiceType1[] ItemsElementName
+ {
+ get
+ {
+ return this.itemsElementNameField;
+ }
+ set
+ {
+ this.itemsElementNameField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#", IncludeInSchema=false)]
+ public enum ItemsChoiceType1
+ {
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("##any:")]
+ Item,
+
+ ///
+ PGPKeyID,
+
+ ///
+ PGPKeyPacket,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class RetrievalMethodType
+ {
+
+ private TransformType[] transformsField;
+
+ private string uRIField;
+
+ private string typeField;
+
+ ///
+ [System.Xml.Serialization.XmlArrayAttribute(Order=0)]
+ [System.Xml.Serialization.XmlArrayItemAttribute("Transform", IsNullable=false)]
+ public TransformType[] Transforms
+ {
+ get
+ {
+ return this.transformsField;
+ }
+ set
+ {
+ this.transformsField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string URI
+ {
+ get
+ {
+ return this.uRIField;
+ }
+ set
+ {
+ this.uRIField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string Type
+ {
+ get
+ {
+ return this.typeField;
+ }
+ set
+ {
+ this.typeField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class SPKIDataType
+ {
+
+ private object[] itemsField;
+
+ ///
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("SPKISexp", typeof(byte[]), DataType="base64Binary", Order=0)]
+ public object[] Items
+ {
+ get
+ {
+ return this.itemsField;
+ }
+ set
+ {
+ this.itemsField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class X509DataType
+ {
+
+ private object[] itemsField;
+
+ private ItemsChoiceType[] itemsElementNameField;
+
+ ///
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("X509CRL", typeof(byte[]), DataType="base64Binary", Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("X509Certificate", typeof(byte[]), DataType="base64Binary", Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("X509IssuerSerial", typeof(X509IssuerSerialType), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("X509SKI", typeof(byte[]), DataType="base64Binary", Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("X509SubjectName", typeof(string), Order=0)]
+ [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
+ public object[] Items
+ {
+ get
+ {
+ return this.itemsField;
+ }
+ set
+ {
+ this.itemsField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("ItemsElementName", Order=1)]
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public ItemsChoiceType[] ItemsElementName
+ {
+ get
+ {
+ return this.itemsElementNameField;
+ }
+ set
+ {
+ this.itemsElementNameField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class X509IssuerSerialType
+ {
+
+ private string x509IssuerNameField;
+
+ private string x509SerialNumberField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string X509IssuerName
+ {
+ get
+ {
+ return this.x509IssuerNameField;
+ }
+ set
+ {
+ this.x509IssuerNameField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(DataType="integer", Order=1)]
+ public string X509SerialNumber
+ {
+ get
+ {
+ return this.x509SerialNumberField;
+ }
+ set
+ {
+ this.x509SerialNumberField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#", IncludeInSchema=false)]
+ public enum ItemsChoiceType
+ {
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("##any:")]
+ Item,
+
+ ///
+ X509CRL,
+
+ ///
+ X509Certificate,
+
+ ///
+ X509IssuerSerial,
+
+ ///
+ X509SKI,
+
+ ///
+ X509SubjectName,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#", IncludeInSchema=false)]
+ public enum ItemsChoiceType2
+ {
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("##any:")]
+ Item,
+
+ ///
+ KeyName,
+
+ ///
+ KeyValue,
+
+ ///
+ MgmtData,
+
+ ///
+ PGPData,
+
+ ///
+ RetrievalMethod,
+
+ ///
+ SPKIData,
+
+ ///
+ X509Data,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#")]
+ public partial class ObjectType
+ {
+
+ private System.Xml.XmlNode[] anyField;
+
+ private string idField;
+
+ private string mimeTypeField;
+
+ private string encodingField;
+
+ ///
+ [System.Xml.Serialization.XmlTextAttribute()]
+ [System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
+ public System.Xml.XmlNode[] Any
+ {
+ get
+ {
+ return this.anyField;
+ }
+ set
+ {
+ this.anyField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="ID")]
+ public string Id
+ {
+ get
+ {
+ return this.idField;
+ }
+ set
+ {
+ this.idField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string MimeType
+ {
+ get
+ {
+ return this.mimeTypeField;
+ }
+ set
+ {
+ this.mimeTypeField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
+ public string Encoding
+ {
+ get
+ {
+ return this.encodingField;
+ }
+ set
+ {
+ this.encodingField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class DetalleType
+ {
+
+ private ImpuestoType impuestoField;
+
+ private bool impuestoFieldSpecified;
+
+ private IdOperacionesTrascendenciaTributariaType claveRegimenField;
+
+ private bool claveRegimenFieldSpecified;
+
+ private object itemField;
+
+ private string tipoImpositivoField;
+
+ private string baseImponibleOimporteNoSujetoField;
+
+ private string baseImponibleACosteField;
+
+ private string cuotaRepercutidaField;
+
+ private string tipoRecargoEquivalenciaField;
+
+ private string cuotaRecargoEquivalenciaField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public ImpuestoType Impuesto
+ {
+ get
+ {
+ return this.impuestoField;
+ }
+ set
+ {
+ this.impuestoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool ImpuestoSpecified
+ {
+ get
+ {
+ return this.impuestoFieldSpecified;
+ }
+ set
+ {
+ this.impuestoFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public IdOperacionesTrascendenciaTributariaType ClaveRegimen
+ {
+ get
+ {
+ return this.claveRegimenField;
+ }
+ set
+ {
+ this.claveRegimenField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool ClaveRegimenSpecified
+ {
+ get
+ {
+ return this.claveRegimenFieldSpecified;
+ }
+ set
+ {
+ this.claveRegimenFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("CalificacionOperacion", typeof(CalificacionOperacionType), Order=2)]
+ [System.Xml.Serialization.XmlElementAttribute("OperacionExenta", typeof(OperacionExentaType), Order=2)]
+ public object Item
+ {
+ get
+ {
+ return this.itemField;
+ }
+ set
+ {
+ this.itemField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public string TipoImpositivo
+ {
+ get
+ {
+ return this.tipoImpositivoField;
+ }
+ set
+ {
+ this.tipoImpositivoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=4)]
+ public string BaseImponibleOimporteNoSujeto
+ {
+ get
+ {
+ return this.baseImponibleOimporteNoSujetoField;
+ }
+ set
+ {
+ this.baseImponibleOimporteNoSujetoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=5)]
+ public string BaseImponibleACoste
+ {
+ get
+ {
+ return this.baseImponibleACosteField;
+ }
+ set
+ {
+ this.baseImponibleACosteField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=6)]
+ public string CuotaRepercutida
+ {
+ get
+ {
+ return this.cuotaRepercutidaField;
+ }
+ set
+ {
+ this.cuotaRepercutidaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=7)]
+ public string TipoRecargoEquivalencia
+ {
+ get
+ {
+ return this.tipoRecargoEquivalenciaField;
+ }
+ set
+ {
+ this.tipoRecargoEquivalenciaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=8)]
+ public string CuotaRecargoEquivalencia
+ {
+ get
+ {
+ return this.cuotaRecargoEquivalenciaField;
+ }
+ set
+ {
+ this.cuotaRecargoEquivalenciaField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum ImpuestoType
+ {
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("01")]
+ Item01,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("02")]
+ Item02,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("03")]
+ Item03,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("05")]
+ Item05,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum IdOperacionesTrascendenciaTributariaType
+ {
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("01")]
+ Item01,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("02")]
+ Item02,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("03")]
+ Item03,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("04")]
+ Item04,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("05")]
+ Item05,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("06")]
+ Item06,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("07")]
+ Item07,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("08")]
+ Item08,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("09")]
+ Item09,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("10")]
+ Item10,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("11")]
+ Item11,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("14")]
+ Item14,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("15")]
+ Item15,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("17")]
+ Item17,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("18")]
+ Item18,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("19")]
+ Item19,
+
+ ///
+ [System.Xml.Serialization.XmlEnumAttribute("20")]
+ Item20,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum CalificacionOperacionType
+ {
+
+ ///
+ S1,
+
+ ///
+ S2,
+
+ ///
+ N1,
+
+ ///
+ N2,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum OperacionExentaType
+ {
+
+ ///
+ E1,
+
+ ///
+ E2,
+
+ ///
+ E3,
+
+ ///
+ E4,
+
+ ///
+ E5,
+
+ ///
+ E6,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class DesgloseRectificacionType
+ {
+
+ private string baseRectificadaField;
+
+ private string cuotaRectificadaField;
+
+ private string cuotaRecargoRectificadoField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string BaseRectificada
+ {
+ get
+ {
+ return this.baseRectificadaField;
+ }
+ set
+ {
+ this.baseRectificadaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public string CuotaRectificada
+ {
+ get
+ {
+ return this.cuotaRectificadaField;
+ }
+ set
+ {
+ this.cuotaRectificadaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string CuotaRecargoRectificado
+ {
+ get
+ {
+ return this.cuotaRecargoRectificadoField;
+ }
+ set
+ {
+ this.cuotaRecargoRectificadoField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class IDFacturaARType
+ {
+
+ private string iDEmisorFacturaField;
+
+ private string numSerieFacturaField;
+
+ private string fechaExpedicionFacturaField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string IDEmisorFactura
+ {
+ get
+ {
+ return this.iDEmisorFacturaField;
+ }
+ set
+ {
+ this.iDEmisorFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public string NumSerieFactura
+ {
+ get
+ {
+ return this.numSerieFacturaField;
+ }
+ set
+ {
+ this.numSerieFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string FechaExpedicionFactura
+ {
+ get
+ {
+ return this.fechaExpedicionFacturaField;
+ }
+ set
+ {
+ this.fechaExpedicionFacturaField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class RegistroFacturacionAltaType
+ {
+
+ private VersionType iDVersionField;
+
+ private IDFacturaExpedidaType iDFacturaField;
+
+ private string refExternaField;
+
+ private string nombreRazonEmisorField;
+
+ private SubsanacionType subsanacionField;
+
+ private bool subsanacionFieldSpecified;
+
+ private RechazoPrevioType rechazoPrevioField;
+
+ private bool rechazoPrevioFieldSpecified;
+
+ private ClaveTipoFacturaType tipoFacturaField;
+
+ private ClaveTipoRectificativaType tipoRectificativaField;
+
+ private bool tipoRectificativaFieldSpecified;
+
+ private IDFacturaARType[] facturasRectificadasField;
+
+ private IDFacturaARType[] facturasSustituidasField;
+
+ private DesgloseRectificacionType importeRectificacionField;
+
+ private string fechaOperacionField;
+
+ private string descripcionOperacionField;
+
+ private SimplificadaCualificadaType facturaSimplificadaArt7273Field;
+
+ private bool facturaSimplificadaArt7273FieldSpecified;
+
+ private CompletaSinDestinatarioType facturaSinIdentifDestinatarioArt61dField;
+
+ private bool facturaSinIdentifDestinatarioArt61dFieldSpecified;
+
+ private MacrodatoType macrodatoField;
+
+ private bool macrodatoFieldSpecified;
+
+ private TercerosODestinatarioType emitidaPorTerceroODestinatarioField;
+
+ private bool emitidaPorTerceroODestinatarioFieldSpecified;
+
+ private PersonaFisicaJuridicaType terceroField;
+
+ private PersonaFisicaJuridicaType[] destinatariosField;
+
+ private CuponType cuponField;
+
+ private bool cuponFieldSpecified;
+
+ private DetalleType[] desgloseField;
+
+ private string cuotaTotalField;
+
+ private string importeTotalField;
+
+ private RegistroFacturacionAltaTypeEncadenamiento encadenamientoField;
+
+ private SistemaInformaticoType sistemaInformaticoField;
+
+ private System.DateTime fechaHoraHusoGenRegistroField;
+
+ private string numRegistroAcuerdoFacturacionField;
+
+ private string idAcuerdoSistemaInformaticoField;
+
+ private TipoHuellaType tipoHuellaField;
+
+ private string huellaField;
+
+ private SignatureType signatureField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public VersionType IDVersion
+ {
+ get
+ {
+ return this.iDVersionField;
+ }
+ set
+ {
+ this.iDVersionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public IDFacturaExpedidaType IDFactura
+ {
+ get
+ {
+ return this.iDFacturaField;
+ }
+ set
+ {
+ this.iDFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=2)]
+ public string RefExterna
+ {
+ get
+ {
+ return this.refExternaField;
+ }
+ set
+ {
+ this.refExternaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=3)]
+ public string NombreRazonEmisor
+ {
+ get
+ {
+ return this.nombreRazonEmisorField;
+ }
+ set
+ {
+ this.nombreRazonEmisorField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=4)]
+ public SubsanacionType Subsanacion
+ {
+ get
+ {
+ return this.subsanacionField;
+ }
+ set
+ {
+ this.subsanacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool SubsanacionSpecified
+ {
+ get
+ {
+ return this.subsanacionFieldSpecified;
+ }
+ set
+ {
+ this.subsanacionFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=5)]
+ public RechazoPrevioType RechazoPrevio
+ {
+ get
+ {
+ return this.rechazoPrevioField;
+ }
+ set
+ {
+ this.rechazoPrevioField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool RechazoPrevioSpecified
+ {
+ get
+ {
+ return this.rechazoPrevioFieldSpecified;
+ }
+ set
+ {
+ this.rechazoPrevioFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=6)]
+ public ClaveTipoFacturaType TipoFactura
+ {
+ get
+ {
+ return this.tipoFacturaField;
+ }
+ set
+ {
+ this.tipoFacturaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=7)]
+ public ClaveTipoRectificativaType TipoRectificativa
+ {
+ get
+ {
+ return this.tipoRectificativaField;
+ }
+ set
+ {
+ this.tipoRectificativaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool TipoRectificativaSpecified
+ {
+ get
+ {
+ return this.tipoRectificativaFieldSpecified;
+ }
+ set
+ {
+ this.tipoRectificativaFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlArrayAttribute(Order=8)]
+ [System.Xml.Serialization.XmlArrayItemAttribute("IDFacturaRectificada", IsNullable=false)]
+ public IDFacturaARType[] FacturasRectificadas
+ {
+ get
+ {
+ return this.facturasRectificadasField;
+ }
+ set
+ {
+ this.facturasRectificadasField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlArrayAttribute(Order=9)]
+ [System.Xml.Serialization.XmlArrayItemAttribute("IDFacturaSustituida", IsNullable=false)]
+ public IDFacturaARType[] FacturasSustituidas
+ {
+ get
+ {
+ return this.facturasSustituidasField;
+ }
+ set
+ {
+ this.facturasSustituidasField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=10)]
+ public DesgloseRectificacionType ImporteRectificacion
+ {
+ get
+ {
+ return this.importeRectificacionField;
+ }
+ set
+ {
+ this.importeRectificacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=11)]
+ public string FechaOperacion
+ {
+ get
+ {
+ return this.fechaOperacionField;
+ }
+ set
+ {
+ this.fechaOperacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=12)]
+ public string DescripcionOperacion
+ {
+ get
+ {
+ return this.descripcionOperacionField;
+ }
+ set
+ {
+ this.descripcionOperacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=13)]
+ public SimplificadaCualificadaType FacturaSimplificadaArt7273
+ {
+ get
+ {
+ return this.facturaSimplificadaArt7273Field;
+ }
+ set
+ {
+ this.facturaSimplificadaArt7273Field = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool FacturaSimplificadaArt7273Specified
+ {
+ get
+ {
+ return this.facturaSimplificadaArt7273FieldSpecified;
+ }
+ set
+ {
+ this.facturaSimplificadaArt7273FieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=14)]
+ public CompletaSinDestinatarioType FacturaSinIdentifDestinatarioArt61d
+ {
+ get
+ {
+ return this.facturaSinIdentifDestinatarioArt61dField;
+ }
+ set
+ {
+ this.facturaSinIdentifDestinatarioArt61dField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool FacturaSinIdentifDestinatarioArt61dSpecified
+ {
+ get
+ {
+ return this.facturaSinIdentifDestinatarioArt61dFieldSpecified;
+ }
+ set
+ {
+ this.facturaSinIdentifDestinatarioArt61dFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=15)]
+ public MacrodatoType Macrodato
+ {
+ get
+ {
+ return this.macrodatoField;
+ }
+ set
+ {
+ this.macrodatoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool MacrodatoSpecified
+ {
+ get
+ {
+ return this.macrodatoFieldSpecified;
+ }
+ set
+ {
+ this.macrodatoFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=16)]
+ public TercerosODestinatarioType EmitidaPorTerceroODestinatario
+ {
+ get
+ {
+ return this.emitidaPorTerceroODestinatarioField;
+ }
+ set
+ {
+ this.emitidaPorTerceroODestinatarioField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool EmitidaPorTerceroODestinatarioSpecified
+ {
+ get
+ {
+ return this.emitidaPorTerceroODestinatarioFieldSpecified;
+ }
+ set
+ {
+ this.emitidaPorTerceroODestinatarioFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=17)]
+ public PersonaFisicaJuridicaType Tercero
+ {
+ get
+ {
+ return this.terceroField;
+ }
+ set
+ {
+ this.terceroField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlArrayAttribute(Order=18)]
+ [System.Xml.Serialization.XmlArrayItemAttribute("IDDestinatario", IsNullable=false)]
+ public PersonaFisicaJuridicaType[] Destinatarios
+ {
+ get
+ {
+ return this.destinatariosField;
+ }
+ set
+ {
+ this.destinatariosField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=19)]
+ public CuponType Cupon
+ {
+ get
+ {
+ return this.cuponField;
+ }
+ set
+ {
+ this.cuponField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool CuponSpecified
+ {
+ get
+ {
+ return this.cuponFieldSpecified;
+ }
+ set
+ {
+ this.cuponFieldSpecified = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlArrayAttribute(Order=20)]
+ [System.Xml.Serialization.XmlArrayItemAttribute("DetalleDesglose", IsNullable=false)]
+ public DetalleType[] Desglose
+ {
+ get
+ {
+ return this.desgloseField;
+ }
+ set
+ {
+ this.desgloseField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=21)]
+ public string CuotaTotal
+ {
+ get
+ {
+ return this.cuotaTotalField;
+ }
+ set
+ {
+ this.cuotaTotalField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=22)]
+ public string ImporteTotal
+ {
+ get
+ {
+ return this.importeTotalField;
+ }
+ set
+ {
+ this.importeTotalField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=23)]
+ public RegistroFacturacionAltaTypeEncadenamiento Encadenamiento
+ {
+ get
+ {
+ return this.encadenamientoField;
+ }
+ set
+ {
+ this.encadenamientoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=24)]
+ public SistemaInformaticoType SistemaInformatico
+ {
+ get
+ {
+ return this.sistemaInformaticoField;
+ }
+ set
+ {
+ this.sistemaInformaticoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=25)]
+ public System.DateTime FechaHoraHusoGenRegistro
+ {
+ get
+ {
+ return this.fechaHoraHusoGenRegistroField;
+ }
+ set
+ {
+ this.fechaHoraHusoGenRegistroField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=26)]
+ public string NumRegistroAcuerdoFacturacion
+ {
+ get
+ {
+ return this.numRegistroAcuerdoFacturacionField;
+ }
+ set
+ {
+ this.numRegistroAcuerdoFacturacionField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=27)]
+ public string IdAcuerdoSistemaInformatico
+ {
+ get
+ {
+ return this.idAcuerdoSistemaInformaticoField;
+ }
+ set
+ {
+ this.idAcuerdoSistemaInformaticoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=28)]
+ public TipoHuellaType TipoHuella
+ {
+ get
+ {
+ return this.tipoHuellaField;
+ }
+ set
+ {
+ this.tipoHuellaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=29)]
+ public string Huella
+ {
+ get
+ {
+ return this.huellaField;
+ }
+ set
+ {
+ this.huellaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.w3.org/2000/09/xmldsig#", Order=30)]
+ public SignatureType Signature
+ {
+ get
+ {
+ return this.signatureField;
+ }
+ set
+ {
+ this.signatureField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum ClaveTipoFacturaType
+ {
+
+ ///
+ F1,
+
+ ///
+ F2,
+
+ ///
+ R1,
+
+ ///
+ R2,
+
+ ///
+ R3,
+
+ ///
+ R4,
+
+ ///
+ R5,
+
+ ///
+ F3,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum ClaveTipoRectificativaType
+ {
+
+ ///
+ S,
+
+ ///
+ I,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum SimplificadaCualificadaType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum CompletaSinDestinatarioType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum MacrodatoType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum TercerosODestinatarioType
+ {
+
+ ///
+ D,
+
+ ///
+ T,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum CuponType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class RegistroFacturacionAltaTypeEncadenamiento
+ {
+
+ private object itemField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("PrimerRegistro", typeof(PrimerRegistroCadenaType), Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("RegistroAnterior", typeof(EncadenamientoFacturaAnteriorType), Order=0)]
+ public object Item
+ {
+ get
+ {
+ return this.itemField;
+ }
+ set
+ {
+ this.itemField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroLR.xsd")]
+ public partial class RegistroFacturaType
+ {
+
+ private object itemField;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("RegistroAlta", typeof(RegistroFacturacionAltaType), Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd", Order=0)]
+ [System.Xml.Serialization.XmlElementAttribute("RegistroAnulacion", typeof(RegistroFacturacionAnulacionType), Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd", Order=0)]
+ public object Item
+ {
+ get
+ {
+ return this.itemField;
+ }
+ set
+ {
+ this.itemField = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class CabeceraTypeRemisionVoluntaria
+ {
+
+ private string fechaFinVeriFactuField;
+
+ private IncidenciaType incidenciaField;
+
+ private bool incidenciaFieldSpecified;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string FechaFinVeriFactu
+ {
+ get
+ {
+ return this.fechaFinVeriFactuField;
+ }
+ set
+ {
+ this.fechaFinVeriFactuField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public IncidenciaType Incidencia
+ {
+ get
+ {
+ return this.incidenciaField;
+ }
+ set
+ {
+ this.incidenciaField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool IncidenciaSpecified
+ {
+ get
+ {
+ return this.incidenciaFieldSpecified;
+ }
+ set
+ {
+ this.incidenciaFieldSpecified = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum IncidenciaType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public partial class CabeceraTypeRemisionRequerimiento
+ {
+
+ private string refRequerimientoField;
+
+ private FinRequerimientoType finRequerimientoField;
+
+ private bool finRequerimientoFieldSpecified;
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=0)]
+ public string RefRequerimiento
+ {
+ get
+ {
+ return this.refRequerimientoField;
+ }
+ set
+ {
+ this.refRequerimientoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute(Order=1)]
+ public FinRequerimientoType FinRequerimiento
+ {
+ get
+ {
+ return this.finRequerimientoField;
+ }
+ set
+ {
+ this.finRequerimientoField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ public bool FinRequerimientoSpecified
+ {
+ get
+ {
+ return this.finRequerimientoFieldSpecified;
+ }
+ set
+ {
+ this.finRequerimientoFieldSpecified = value;
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
+ public enum FinRequerimientoType
+ {
+
+ ///
+ S,
+
+ ///
+ N,
+ }
+
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
+ public partial class RegFactuSistemaFacturacionRequest
+ {
+
+ [System.ServiceModel.MessageBodyMemberAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SuministroLR.xsd", Order=0)]
+ public ServiceReference1.RegFactuSistemaFacturacion RegFactuSistemaFacturacion;
+
+ public RegFactuSistemaFacturacionRequest()
+ {
+ }
+
+ public RegFactuSistemaFacturacionRequest(ServiceReference1.RegFactuSistemaFacturacion RegFactuSistemaFacturacion)
+ {
+ this.RegFactuSistemaFacturacion = RegFactuSistemaFacturacion;
+ }
+ }
+
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
+ public partial class RegFactuSistemaFacturacionResponse
+ {
+
+ [System.ServiceModel.MessageBodyMemberAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/RespuestaSuministro.xsd", Order=0)]
+ public ServiceReference1.RespuestaRegFactuSistemaFacturacionType RespuestaRegFactuSistemaFacturacion;
+
+ public RegFactuSistemaFacturacionResponse()
+ {
+ }
+
+ public RegFactuSistemaFacturacionResponse(ServiceReference1.RespuestaRegFactuSistemaFacturacionType RespuestaRegFactuSistemaFacturacion)
+ {
+ this.RespuestaRegFactuSistemaFacturacion = RespuestaRegFactuSistemaFacturacion;
+ }
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ public interface sfPortTypeVerifactuChannel : ServiceReference1.sfPortTypeVerifactu, System.ServiceModel.IClientChannel
+ {
+ }
+
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ public partial class sfPortTypeVerifactuClient : System.ServiceModel.ClientBase, ServiceReference1.sfPortTypeVerifactu
+ {
+
+ ///
+ /// Implemente este método parcial para configurar el punto de conexión de servicio.
+ ///
+ /// El punto de conexión para configurar
+ /// Credenciales de cliente
+ static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials);
+
+ public sfPortTypeVerifactuClient(EndpointConfiguration endpointConfiguration) :
+ base(sfPortTypeVerifactuClient.GetBindingForEndpoint(endpointConfiguration), sfPortTypeVerifactuClient.GetEndpointAddress(endpointConfiguration))
+ {
+ this.Endpoint.Name = endpointConfiguration.ToString();
+ ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
+ }
+
+ public sfPortTypeVerifactuClient(EndpointConfiguration endpointConfiguration, string remoteAddress) :
+ base(sfPortTypeVerifactuClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress))
+ {
+ this.Endpoint.Name = endpointConfiguration.ToString();
+ ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
+ }
+
+ public sfPortTypeVerifactuClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
+ base(sfPortTypeVerifactuClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
+ {
+ this.Endpoint.Name = endpointConfiguration.ToString();
+ ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
+ }
+
+ public sfPortTypeVerifactuClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+ base(binding, remoteAddress)
+ {
+ }
+
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ System.Threading.Tasks.Task ServiceReference1.sfPortTypeVerifactu.RegFactuSistemaFacturacionAsync(ServiceReference1.RegFactuSistemaFacturacionRequest request)
+ {
+ return base.Channel.RegFactuSistemaFacturacionAsync(request);
+ }
+
+ public System.Threading.Tasks.Task RegFactuSistemaFacturacionAsync(ServiceReference1.RegFactuSistemaFacturacion RegFactuSistemaFacturacion)
+ {
+ ServiceReference1.RegFactuSistemaFacturacionRequest inValue = new ServiceReference1.RegFactuSistemaFacturacionRequest();
+ inValue.RegFactuSistemaFacturacion = RegFactuSistemaFacturacion;
+ return ((ServiceReference1.sfPortTypeVerifactu)(this)).RegFactuSistemaFacturacionAsync(inValue);
+ }
+
+ public virtual System.Threading.Tasks.Task OpenAsync()
+ {
+ return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
+ }
+
+ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
+ {
+ if ((endpointConfiguration == EndpointConfiguration.SistemaVerifactuPruebas))
+ {
+ System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
+ result.MaxBufferSize = int.MaxValue;
+ result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
+ result.MaxReceivedMessageSize = int.MaxValue;
+ result.AllowCookies = true;
+ result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
+ return result;
+ }
+ if ((endpointConfiguration == EndpointConfiguration.SistemaVerifactuSelloPruebas))
+ {
+ System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
+ result.MaxBufferSize = int.MaxValue;
+ result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
+ result.MaxReceivedMessageSize = int.MaxValue;
+ result.AllowCookies = true;
+ result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
+ return result;
+ }
+ throw new System.InvalidOperationException(string.Format("No se pudo encontrar un punto de conexión con el nombre \"{0}\".", endpointConfiguration));
+ }
+
+ private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration)
+ {
+ if ((endpointConfiguration == EndpointConfiguration.SistemaVerifactuPruebas))
+ {
+ return new System.ServiceModel.EndpointAddress("https://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP");
+ }
+ if ((endpointConfiguration == EndpointConfiguration.SistemaVerifactuSelloPruebas))
+ {
+ return new System.ServiceModel.EndpointAddress("https://prewww10.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP");
+ }
+ throw new System.InvalidOperationException(string.Format("No se pudo encontrar un punto de conexión con el nombre \"{0}\".", endpointConfiguration));
+ }
+
+ public enum EndpointConfiguration
+ {
+
+ SistemaVerifactuPruebas,
+
+ SistemaVerifactuSelloPruebas,
+ }
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ [System.ServiceModel.ServiceContractAttribute(Namespace="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicacion" +
+ "es/es/aeat/tike/cont/ws/SistemaFacturacion.wsdl", ConfigurationName="ServiceReference1.sfPortTypePorRequerimiento")]
+ public interface sfPortTypePorRequerimiento
+ {
+
+ [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
+ [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
+ [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RespuestaBaseType))]
+ System.Threading.Tasks.Task RegFactuSistemaFacturacionAsync(ServiceReference1.RegFactuSistemaFacturacionRequest request);
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ public interface sfPortTypePorRequerimientoChannel : ServiceReference1.sfPortTypePorRequerimiento, System.ServiceModel.IClientChannel
+ {
+ }
+
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
+ public partial class sfPortTypePorRequerimientoClient : System.ServiceModel.ClientBase, ServiceReference1.sfPortTypePorRequerimiento
+ {
+
+ public sfPortTypePorRequerimientoClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+ base(binding, remoteAddress)
+ {
+ }
+
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ System.Threading.Tasks.Task ServiceReference1.sfPortTypePorRequerimiento.RegFactuSistemaFacturacionAsync(ServiceReference1.RegFactuSistemaFacturacionRequest request)
+ {
+ return base.Channel.RegFactuSistemaFacturacionAsync(request);
+ }
+
+ public System.Threading.Tasks.Task RegFactuSistemaFacturacionAsync(ServiceReference1.RegFactuSistemaFacturacion RegFactuSistemaFacturacion)
+ {
+ ServiceReference1.RegFactuSistemaFacturacionRequest inValue = new ServiceReference1.RegFactuSistemaFacturacionRequest();
+ inValue.RegFactuSistemaFacturacion = RegFactuSistemaFacturacion;
+ return ((ServiceReference1.sfPortTypePorRequerimiento)(this)).RegFactuSistemaFacturacionAsync(inValue);
+ }
+
+ public virtual System.Threading.Tasks.Task OpenAsync()
+ {
+ return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
+ }
+ }
+}
diff --git a/bdGrupoSanchoToro/FodyWeavers.xml b/bdGrupoSanchoToro/FodyWeavers.xml
new file mode 100644
index 0000000..d5abfed
--- /dev/null
+++ b/bdGrupoSanchoToro/FodyWeavers.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/bdGrupoSanchoToro/Utilidades.cs b/bdGrupoSanchoToro/Utilidades.cs
new file mode 100644
index 0000000..6d2661d
--- /dev/null
+++ b/bdGrupoSanchoToro/Utilidades.cs
@@ -0,0 +1,144 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using Microsoft.VisualBasic;
+using bdGrupoSanchoToro.db;
+using bdGrupoSanchoToro.dbcontext;
+
+namespace bdGrupoSanchoToro.db
+{
+
+
+ public class Utilidades
+ {
+ public static empresas? EmpresaActual;
+ public static string Usuario;
+
+ public static int idUsuario;
+ public static usuarios UsuarioActual;
+ public static string VersionPrograma { get; set; }
+ // public static double PorcentajeIva { get; set; }
+
+
+
+ public static EventLog el;
+ public static string DirectorioLogs;
+ private static object oBloqueoLog = new object();
+ public static void AñadeLog(tsUtilidades.Enumeraciones.TipoLog Tipo, string Asunto, string Mensaje, Exception e = null)
+ {
+ // ----------------------------------------------------------------------------------------------------
+ // Descripción Sub: Gestión de logs de la aplicación
+ // Fecha. Creacion: ???
+ // Creada por: manmog
+ // Ultima Modificacion: 24/11/2010
+ //
+ // Modificaciones:
+ // ===============
+
+ lock (oBloqueoLog)
+ {
+ GrupoSanchoToroContext ctx;
+
+ string sFicheroLog = DirectorioLogs + "Log-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + ".txt";
+ try
+ {
+ if (!(e == null))
+ {
+ if (el is not null)
+ el.WriteEntry(e.Message + Constants.vbCrLf + e.StackTrace, EventLogEntryType.Error);
+ string sStackTrace = "Tipo excepción: " + e.ToString() + Constants.vbCrLf;
+ var exError = e;
+ do
+ {
+ sStackTrace += exError.StackTrace + Constants.vbCrLf;
+ exError = exError.InnerException;
+ }
+ while (exError != null);
+ if (!string.IsNullOrEmpty(sStackTrace))
+ Mensaje += Constants.vbCrLf + "StackTrace: " + sStackTrace;
+ }
+ switch (Tipo)
+ {
+ case tsUtilidades.Enumeraciones.TipoLog.Fallo:
+ case tsUtilidades.Enumeraciones.TipoLog.Advertencia:
+ {
+ if (Tipo == tsUtilidades.Enumeraciones.TipoLog.Fallo)
+ {
+ sFicheroLog = DirectorioLogs + "Errores-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0') + ".txt";
+ Asunto = "Error GrupoSanchoToro. " + ". Version:" + VersionPrograma + ". " + Asunto;
+ Mensaje = "Error GrupoSanchoToro. " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + " Enviado desde " + Environment.MachineName + ". Version:" + VersionPrograma + ". Mensaje: " + Mensaje;
+ }
+ else
+ {
+ Asunto = "Advertencia GrupoSanchoToro. " + ". Version:" + VersionPrograma + ". " + Asunto;
+ Mensaje = "Advertencia GrupoSanchoToro. " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + " Enviado desde " + Environment.MachineName + ". Version:" + VersionPrograma + ". " + Mensaje;
+ }
+ string sDireccionesEnvio = "manmog@gmail.com";
+ string sServidorSMTP = "smtp.gmail.com";
+ string sRemitente = "administracion@english-skills.net";
+ tsCorreos.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, Asunto, Mensaje, null,null, "", "", sRemitente, "", 587, true);
+ break;
+ }
+ }
+ Anadelogtxt(Mensaje + " --- " + e.StackTrace, sFicheroLog);
+ }
+ catch (Exception ex)
+ {
+ sFicheroLog = DirectorioLogs + @"Errores\Errores-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0') + ".txt";
+ if (e is not null)
+ Mensaje += " --- " + e.StackTrace;
+ Anadelogtxt(Mensaje + " ---" + ex.Message + " --- " + ex.StackTrace, sFicheroLog);
+ }
+ }
+ }
+ public static void Anadelogtxt(string Mensaje, string FicheroLog)
+ {
+ System.IO.StreamWriter sw = null;
+ try
+ {
+ Mensaje = Mensaje.Replace(Constants.vbCrLf, "---");
+ if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(FicheroLog)))
+ tsUtilidades.Utilidades.CreaEstructuraDirectorio(System.IO.Path.GetDirectoryName(FicheroLog));
+ if (System.IO.File.Exists(FicheroLog))
+ {
+ sw = System.IO.File.AppendText(FicheroLog);
+ }
+ else
+ {
+ sw = System.IO.File.CreateText(FicheroLog);
+ }
+ Mensaje = DateTime.Now.ToString() + "|" + "Ws: " + Process.GetCurrentProcess().WorkingSet64.ToString().PadLeft(20) + " PMS: " + Process.GetCurrentProcess().PrivateMemorySize64.ToString().PadLeft(20) + "|" + Mensaje;
+
+ sw.WriteLine(Mensaje);
+ }
+
+ catch (Exception ex)
+ {
+ try
+ {
+
+ string sDireccionesEnvio = "manmog@gmail.com";
+ string sServidorSMTP = "smtp.gmail.com";
+ string sRemitente = "administracion@english-skills.net";
+ // tsCorreos.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, Asunto, Mensaje,,,,, "se9608dc.g")
+ tsCorreos.Funciones.EnviaCorreo(sServidorSMTP, sRemitente, sDireccionesEnvio, "Error Anadelogtxt. " + Mensaje, Environment.MachineName + ".- " + ex.Message + Constants.vbCrLf + ex.StackTrace + Constants.vbCrLf + ex.Source, null,null, "", "", sRemitente, "", 587, true);
+ }
+ catch (Exception ex2)
+ {
+ }
+ }
+ finally
+ {
+ try
+ {
+ sw.Close();
+ }
+ catch
+ {
+ }
+ }
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/bdGrupoSanchoToro/bdGrupoSanchoToro.csproj b/bdGrupoSanchoToro/bdGrupoSanchoToro.csproj
new file mode 100644
index 0000000..735f755
--- /dev/null
+++ b/bdGrupoSanchoToro/bdGrupoSanchoToro.csproj
@@ -0,0 +1,33 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bdGrupoSanchoToro/db/albaranes.cs b/bdGrupoSanchoToro/db/albaranes.cs
new file mode 100644
index 0000000..3c79dfb
--- /dev/null
+++ b/bdGrupoSanchoToro/db/albaranes.cs
@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class albaranes
+{
+ public int idAlbaran { get; set; }
+
+ public DateOnly Fecha { get; set; }
+
+ public int? idPresupuesto { get; set; }
+
+ public int? idValeTransporte { get; set; }
+
+ public int Tipo { get; set; }
+
+ public DateTime? FechaCarga { get; set; }
+
+ public string? LugarCarga { get; set; }
+
+ public string? Cargadores { get; set; }
+
+ public DateTime? FechaDescarga { get; set; }
+
+ public string? LugarDescarga { get; set; }
+
+ public string? Descargadores { get; set; }
+
+ public double Peso { get; set; }
+
+ public double Volumen { get; set; }
+
+ public double PorcentajeTransporte { get; set; }
+
+ public double CostoEstimadoTransporte { get; set; }
+
+ public int idUsuario { get; set; }
+
+ public int? idAlmacenOrigen { get; set; }
+
+ public string? CodigoPostalCarga { get; set; }
+
+ public string? CodigoMunicipioCarga { get; set; }
+
+ public string? CodigoPostalDescarga { get; set; }
+
+ public string? CodigoMunicipioDescarga { get; set; }
+
+ public string? Telefono1Carga { get; set; }
+
+ public string? Telefono2Carga { get; set; }
+
+ public string? EmailCarga { get; set; }
+
+ public string? Telefono1Descarga { get; set; }
+
+ public string? Telefono2Descarga { get; set; }
+
+ public string? EmailDescarga { get; set; }
+
+ public int? idAlmacenDestino { get; set; }
+
+ public int? idEntidad { get; set; }
+
+ public int NumeroBultos { get; set; }
+
+ public bool TransporteExterno { get; set; }
+
+ public DateOnly? FechaPrevistaFinSubalquiler { get; set; }
+
+ public virtual municipios? CodigoMunicipioCargaNavigation { get; set; }
+
+ public virtual municipios? CodigoMunicipioDescargaNavigation { get; set; }
+
+ public virtual ICollection detallesalbaranes { get; set; } = new List();
+
+ public virtual almacenes? idAlmacenDestinoNavigation { get; set; }
+
+ public virtual almacenes? idAlmacenOrigenNavigation { get; set; }
+
+ public virtual entidades? idEntidadNavigation { get; set; }
+
+ public virtual presupuestos? idPresupuestoNavigation { get; set; }
+
+ public virtual usuarios idUsuarioNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/almacenes.cs b/bdGrupoSanchoToro/db/almacenes.cs
new file mode 100644
index 0000000..fc7535c
--- /dev/null
+++ b/bdGrupoSanchoToro/db/almacenes.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class almacenes
+{
+ public int idAlmacen { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public string? Direccion { get; set; }
+
+ public string? CodigoPostal { get; set; }
+
+ public string? CodigoMunicipio { get; set; }
+
+ public string? Telefono1 { get; set; }
+
+ public string? Email { get; set; }
+
+ public string? Encargados { get; set; }
+
+ public int Tipo { get; set; }
+
+ public DateOnly? FechaBaja { get; set; }
+
+ public int idEmpresa { get; set; }
+
+ public virtual municipios? CodigoMunicipioNavigation { get; set; }
+
+ public virtual ICollection albaranesidAlmacenDestinoNavigation { get; set; } = new List();
+
+ public virtual ICollection albaranesidAlmacenOrigenNavigation { get; set; } = new List();
+
+ public virtual empresas idEmpresaNavigation { get; set; } = null!;
+
+ public virtual ICollection stocks { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/articulos.cs b/bdGrupoSanchoToro/db/articulos.cs
new file mode 100644
index 0000000..b38129d
--- /dev/null
+++ b/bdGrupoSanchoToro/db/articulos.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class articulos
+{
+ public int idArticulo { get; set; }
+
+ public int? idProducto { get; set; }
+
+ public string? CodigoArticulo { get; set; }
+
+ public string? NumeroSerie { get; set; }
+
+ public int? idProveedor { get; set; }
+
+ public string? NumeroFraCompra { get; set; }
+
+ public DateOnly? FechaCompra { get; set; }
+
+ public DateOnly? FechaFinGarantia { get; set; }
+
+ public DateOnly? FechaBaja { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public double? PrecioCompra { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public string? Averias { get; set; }
+
+ public virtual ICollection detallepresupuesto { get; set; } = new List();
+
+ public virtual ICollection detallesalbaranes { get; set; } = new List();
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual productos? idProductoNavigation { get; set; }
+
+ public virtual entidades? idProveedorNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/autorizacionesgrupos.cs b/bdGrupoSanchoToro/db/autorizacionesgrupos.cs
new file mode 100644
index 0000000..61fd4cf
--- /dev/null
+++ b/bdGrupoSanchoToro/db/autorizacionesgrupos.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class autorizacionesgrupos
+{
+ public int idAutorizaciongrupo { get; set; }
+
+ public int? idGrupo { get; set; }
+
+ public int? idPermiso { get; set; }
+
+ public bool PermitirConsultas { get; set; }
+
+ public bool PermitirNuevos { get; set; }
+
+ public bool PermitirModificaciones { get; set; }
+
+ public bool PermitirEliminaciones { get; set; }
+
+ public bool PermitirImpresiones { get; set; }
+
+ public bool PermitirExportar { get; set; }
+
+ public bool OtrosPermisos { get; set; }
+
+ public virtual gruposusuarios? idGrupoNavigation { get; set; }
+
+ public virtual permisos? idPermisoNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/autorizacionesusuarios.cs b/bdGrupoSanchoToro/db/autorizacionesusuarios.cs
new file mode 100644
index 0000000..69d4101
--- /dev/null
+++ b/bdGrupoSanchoToro/db/autorizacionesusuarios.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class autorizacionesusuarios
+{
+ public int idAutorizaciones { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public int idPermiso { get; set; }
+
+ public bool PermitirConsultas { get; set; }
+
+ public bool PermitirNuevos { get; set; }
+
+ public bool PermitirModificaciones { get; set; }
+
+ public bool PermitirEliminaciones { get; set; }
+
+ public bool PermitirImpresiones { get; set; }
+
+ public bool PermitirExportar { get; set; }
+
+ public bool OtrosPermisos { get; set; }
+
+ public virtual permisos idPermisoNavigation { get; set; } = null!;
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/bancos.cs b/bdGrupoSanchoToro/db/bancos.cs
new file mode 100644
index 0000000..fef6703
--- /dev/null
+++ b/bdGrupoSanchoToro/db/bancos.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class bancos
+{
+ public string Codigo { get; set; } = null!;
+
+ public string? Nombre { get; set; }
+
+ public string? BIC { get; set; }
+
+ public bool? Obsoleto { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/cajas.cs b/bdGrupoSanchoToro/db/cajas.cs
new file mode 100644
index 0000000..510caf9
--- /dev/null
+++ b/bdGrupoSanchoToro/db/cajas.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class cajas
+{
+ public int idCaja { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public int Tipo { get; set; }
+
+ public int? idPermiso { get; set; }
+
+ public string? IBAN { get; set; }
+
+ public DateTime? FechaBaja { get; set; }
+
+ public double SaldoAlCierre { get; set; }
+
+ public DateTime? FechaCierre { get; set; }
+
+ public string? SufijoBancario { get; set; }
+
+ public int idEmpresa { get; set; }
+
+ public virtual ICollection conciliacionesbancarias { get; set; } = new List();
+
+ public virtual ICollection extractosbancarios { get; set; } = new List();
+
+ public virtual empresas idEmpresaNavigation { get; set; } = null!;
+
+ public virtual permisos? idPermisoNavigation { get; set; }
+
+ public virtual ICollection movimientoscaja { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/codigospostales.cs b/bdGrupoSanchoToro/db/codigospostales.cs
new file mode 100644
index 0000000..0b7b2f8
--- /dev/null
+++ b/bdGrupoSanchoToro/db/codigospostales.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class codigospostales
+{
+ public int idCodigoPostal { get; set; }
+
+ public string CodigoPostal { get; set; } = null!;
+
+ public string CodigoMunicipio { get; set; } = null!;
+
+ public string? DescripcionAdicional { get; set; }
+
+ public virtual municipios CodigoMunicipioNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/conciliacionesbancarias.cs b/bdGrupoSanchoToro/db/conciliacionesbancarias.cs
new file mode 100644
index 0000000..802cc18
--- /dev/null
+++ b/bdGrupoSanchoToro/db/conciliacionesbancarias.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class conciliacionesbancarias
+{
+ public int idConciliacion { get; set; }
+
+ public DateTime FechaConciliacion { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public double TotalMovimientosCaja { get; set; }
+
+ public double TotalMovimientosBancarios { get; set; }
+
+ public DateOnly FechaInicio { get; set; }
+
+ public DateOnly FechaFin { get; set; }
+
+ public int idCaja { get; set; }
+
+ public virtual cajas idCajaNavigation { get; set; } = null!;
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+
+ public virtual ICollection movimientosbancarios { get; set; } = new List();
+
+ public virtual ICollection movimientoscaja { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/correos.cs b/bdGrupoSanchoToro/db/correos.cs
new file mode 100644
index 0000000..ef013b9
--- /dev/null
+++ b/bdGrupoSanchoToro/db/correos.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class correos
+{
+ public int idcorreo { get; set; }
+
+ public int? idcuenta { get; set; }
+
+ public string? Remitente { get; set; }
+
+ public string? Destinatario { get; set; }
+
+ public string? Copia { get; set; }
+
+ public string? CopiaOculta { get; set; }
+
+ public string? DireccionRespuesta { get; set; }
+
+ public string? Asunto { get; set; }
+
+ public string? Cuerpo { get; set; }
+
+ public string? RutaFicheroAdjunto { get; set; }
+
+ public int? idFicheroAdjunto { get; set; }
+
+ public DateTime? FechaCreacion { get; set; }
+
+ public DateTime? FechaEnvio { get; set; }
+
+ public DateTime? FechaUltimoIntento { get; set; }
+
+ public DateTime? FechaAnulacion { get; set; }
+
+ public DateTime? FechaAvisoError { get; set; }
+
+ public int? idAplicacion { get; set; }
+
+ public string? CodigoAplicacion { get; set; }
+
+ public bool Reciclable { get; set; }
+
+ public int? idEntidad { get; set; }
+
+ public string? MensajeError { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public virtual ICollection ficherosadjuntos { get; set; } = new List();
+
+ public virtual entidades? idEntidadNavigation { get; set; }
+
+ public virtual ficheros? idFicheroAdjuntoNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+
+ public virtual cuentascorreo? idcuentaNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/cuentascorreo.cs b/bdGrupoSanchoToro/db/cuentascorreo.cs
new file mode 100644
index 0000000..fd98a63
--- /dev/null
+++ b/bdGrupoSanchoToro/db/cuentascorreo.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class cuentascorreo
+{
+ public int idCuenta { get; set; }
+
+ public string? Codigo { get; set; }
+
+ public string? ServidorSMTP { get; set; }
+
+ public string? Remitente { get; set; }
+
+ public string? CuentaCorreo { get; set; }
+
+ public string? Password { get; set; }
+
+ public int? Puerto { get; set; }
+
+ public bool SSL { get; set; }
+
+ public bool Deshabilitada { get; set; }
+
+ public string? ResponderA { get; set; }
+
+ public int? idEmpresa { get; set; }
+
+ public virtual ICollection correos { get; set; } = new List();
+
+ public virtual empresas? idEmpresaNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/detallepresupuesto.cs b/bdGrupoSanchoToro/db/detallepresupuesto.cs
new file mode 100644
index 0000000..282fcb6
--- /dev/null
+++ b/bdGrupoSanchoToro/db/detallepresupuesto.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class detallepresupuesto
+{
+ public int idDetallePresupuesto { get; set; }
+
+ public int idProducto { get; set; }
+
+ public int? idArticulo { get; set; }
+
+ public double Cantidad { get; set; }
+
+ public double Precio { get; set; }
+
+ public int idPresupuesto { get; set; }
+
+ public bool EsVenta { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public virtual ICollection detallesfacturas { get; set; } = new List();
+
+ public virtual articulos? idArticuloNavigation { get; set; }
+
+ public virtual presupuestos idPresupuestoNavigation { get; set; } = null!;
+
+ public virtual productos idProductoNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/detallesalbaranes.cs b/bdGrupoSanchoToro/db/detallesalbaranes.cs
new file mode 100644
index 0000000..40f72fb
--- /dev/null
+++ b/bdGrupoSanchoToro/db/detallesalbaranes.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class detallesalbaranes
+{
+ public int idDetalle { get; set; }
+
+ public int idProducto { get; set; }
+
+ public int? idArticulo { get; set; }
+
+ public int idAlbaran { get; set; }
+
+ public double Cantidad { get; set; }
+
+ public double Peso { get; set; }
+
+ public double Volumen { get; set; }
+
+ public bool EsVenta { get; set; }
+
+ public bool IncluidoEnPresupuesto { get; set; }
+
+ public virtual albaranes idAlbaranNavigation { get; set; } = null!;
+
+ public virtual articulos? idArticuloNavigation { get; set; }
+
+ public virtual productos idProductoNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/detallesfacturas.cs b/bdGrupoSanchoToro/db/detallesfacturas.cs
new file mode 100644
index 0000000..d9f6a57
--- /dev/null
+++ b/bdGrupoSanchoToro/db/detallesfacturas.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class detallesfacturas
+{
+ public int idDetalle { get; set; }
+
+ public int idFactura { get; set; }
+
+ public int idProducto { get; set; }
+
+ public int? idDetallePresupuesto { get; set; }
+
+ public double Cantidad { get; set; }
+
+ public double Precio { get; set; }
+
+ public bool EsVenta { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public int idTipoIVA { get; set; }
+
+ public double? PorcentajeIVA { get; set; }
+
+ public int? idDetalleRTF { get; set; }
+
+ public virtual detallepresupuesto? idDetallePresupuestoNavigation { get; set; }
+
+ public virtual ficheros? idDetalleRTFNavigation { get; set; }
+
+ public virtual facturas idFacturaNavigation { get; set; } = null!;
+
+ public virtual productos idProductoNavigation { get; set; } = null!;
+
+ public virtual enumeraciones idTipoIVANavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/detallesfacturasrecibidas.cs b/bdGrupoSanchoToro/db/detallesfacturasrecibidas.cs
new file mode 100644
index 0000000..b996971
--- /dev/null
+++ b/bdGrupoSanchoToro/db/detallesfacturasrecibidas.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class detallesfacturasrecibidas
+{
+ public int idDetalle { get; set; }
+
+ public int idFactura { get; set; }
+
+ public int idProducto { get; set; }
+
+ public double Cantidad { get; set; }
+
+ public double Precio { get; set; }
+
+ public int idTipoIva { get; set; }
+
+ public double? PorcentajeIVA { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public virtual facturasrecibidas idFacturaNavigation { get; set; } = null!;
+
+ public virtual productos idProductoNavigation { get; set; } = null!;
+
+ public virtual enumeraciones idTipoIvaNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/documentosfacturas.cs b/bdGrupoSanchoToro/db/documentosfacturas.cs
new file mode 100644
index 0000000..8196a32
--- /dev/null
+++ b/bdGrupoSanchoToro/db/documentosfacturas.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class documentosfacturas
+{
+ public int idDocumento { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public DateTime? Fecha { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public int? idFactura { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public int Tipo { get; set; }
+
+ public virtual facturas? idFacturaNavigation { get; set; }
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/documentosfacturasrecibidas.cs b/bdGrupoSanchoToro/db/documentosfacturasrecibidas.cs
new file mode 100644
index 0000000..b70e38e
--- /dev/null
+++ b/bdGrupoSanchoToro/db/documentosfacturasrecibidas.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class documentosfacturasrecibidas
+{
+ public int idDocumento { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public DateTime? Fecha { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public int? idFactura { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public int Tipo { get; set; }
+
+ public virtual facturasrecibidas? idFacturaNavigation { get; set; }
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/documentospresupuestos.cs b/bdGrupoSanchoToro/db/documentospresupuestos.cs
new file mode 100644
index 0000000..47ad369
--- /dev/null
+++ b/bdGrupoSanchoToro/db/documentospresupuestos.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class documentospresupuestos
+{
+ public int idDocumento { get; set; }
+
+ public int idPresupuesto { get; set; }
+
+ public int idTipoDocumento { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public DateTime? Fecha { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public int idUsuario { get; set; }
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual presupuestos idPresupuestoNavigation { get; set; } = null!;
+
+ public virtual enumeraciones idTipoDocumentoNavigation { get; set; } = null!;
+
+ public virtual usuarios idUsuarioNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/empresas.cs b/bdGrupoSanchoToro/db/empresas.cs
new file mode 100644
index 0000000..b59d4a7
--- /dev/null
+++ b/bdGrupoSanchoToro/db/empresas.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class empresas
+{
+ public int idEmpresa { get; set; }
+
+ public string RazonSocial { get; set; } = null!;
+
+ public DateOnly? FechaBaja { get; set; }
+
+ public int? idLogo1 { get; set; }
+
+ public int? idLogo2 { get; set; }
+
+ public string? Domicilio { get; set; }
+
+ public string? Poblacion { get; set; }
+
+ public string? CIF { get; set; }
+
+ public bool DescAmpliadaEnFE { get; set; }
+
+ public virtual ICollection almacenes { get; set; } = new List();
+
+ public virtual ICollection cajas { get; set; } = new List();
+
+ public virtual ICollection cuentascorreo { get; set; } = new List();
+
+ public virtual ICollection entidades { get; set; } = new List();
+
+ public virtual ficheros? idLogo1Navigation { get; set; }
+
+ public virtual ficheros? idLogo2Navigation { get; set; }
+
+ public virtual ICollection plantillas { get; set; } = new List();
+
+ public virtual ICollection productos { get; set; } = new List();
+
+ public virtual ICollection seriesfacturas { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/entidades.cs b/bdGrupoSanchoToro/db/entidades.cs
new file mode 100644
index 0000000..4113c1a
--- /dev/null
+++ b/bdGrupoSanchoToro/db/entidades.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class entidades
+{
+ public int idEntidad { get; set; }
+
+ public string? NIF { get; set; }
+
+ public string? RazonSocial { get; set; }
+
+ public string? Telefono1 { get; set; }
+
+ public string? Telefono2 { get; set; }
+
+ public string? Telefono3 { get; set; }
+
+ public string? FAX { get; set; }
+
+ public string? Email { get; set; }
+
+ public string? IBAN { get; set; }
+
+ public int? idTipoPago { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public bool EsCliente { get; set; }
+
+ public bool EsProveedor { get; set; }
+
+ public string? PersonaContacto { get; set; }
+
+ public double Descuento { get; set; }
+
+ public DateOnly? FechaAlta { get; set; }
+
+ public DateOnly? FechaBaja { get; set; }
+
+ public int? idUsuarioCreador { get; set; }
+
+ public int? idUsuarioModificador { get; set; }
+
+ public string? Codigo_Cliente_Ant { get; set; }
+
+ public string? Codigo_Proveedor_Ant { get; set; }
+
+ public string? Direccion { get; set; }
+
+ public string? CodigoPostal { get; set; }
+
+ public string? CodigoMunicipio { get; set; }
+
+ public int? idTipo { get; set; }
+
+ public int TipoImpresionAlbaranEntrega { get; set; }
+
+ public string? Email2 { get; set; }
+
+ public int idEmpresa { get; set; }
+
+ public virtual municipios? CodigoMunicipioNavigation { get; set; }
+
+ public virtual ICollection albaranes { get; set; } = new List();
+
+ public virtual ICollection articulos { get; set; } = new List();
+
+ public virtual ICollection correos { get; set; } = new List();
+
+ public virtual ICollection eventos { get; set; } = new List();
+
+ public virtual ICollection expedientesentidades { get; set; } = new List();
+
+ public virtual ICollection facturas { get; set; } = new List();
+
+ public virtual ICollection facturasrecibidas { get; set; } = new List();
+
+ public virtual empresas idEmpresaNavigation { get; set; } = null!;
+
+ public virtual enumeraciones? idTipoPagoNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioCreadorNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioModificadorNavigation { get; set; }
+
+ public virtual ICollection presupuestos { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/enumeraciones.cs b/bdGrupoSanchoToro/db/enumeraciones.cs
new file mode 100644
index 0000000..89634dc
--- /dev/null
+++ b/bdGrupoSanchoToro/db/enumeraciones.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class enumeraciones
+{
+ public int idEnumeracion { get; set; }
+
+ public int idGrupoEnumeracion { get; set; }
+
+ public string? Codigo { get; set; }
+
+ public string Descripcion { get; set; } = null!;
+
+ public string? ValorAlfabetico1 { get; set; }
+
+ public string? ValorAlfabetico2 { get; set; }
+
+ public double? ValorNumerico1 { get; set; }
+
+ public double? ValorNumerico2 { get; set; }
+
+ public int? Orden { get; set; }
+
+ public bool Oculto { get; set; }
+
+ public string? ValorAlfabetico3 { get; set; }
+
+ public string? ValorAlfabetico4 { get; set; }
+
+ public string? ValorAlfabeticoLargo { get; set; }
+
+ public double? ValorNumerico3 { get; set; }
+
+ public double? ValorNumerico4 { get; set; }
+
+ public DateTime? FechaBaja { get; set; }
+
+ public DateTime? Fecha1 { get; set; }
+
+ public DateTime? Fecha2 { get; set; }
+
+ public virtual ICollection detallesfacturas { get; set; } = new List();
+
+ public virtual ICollection detallesfacturasrecibidas { get; set; } = new List();
+
+ public virtual ICollection documentospresupuestos { get; set; } = new List();
+
+ public virtual ICollection entidades { get; set; } = new List();
+
+ public virtual ICollection facturasrecibidas { get; set; } = new List();
+
+ public virtual ICollection ficheros { get; set; } = new List();
+
+ public virtual gruposenumeraciones idGrupoEnumeracionNavigation { get; set; } = null!;
+
+ public virtual ICollection plantillas { get; set; } = new List();
+
+ public virtual ICollection procesosidSubtipoNavigation { get; set; } = new List();
+
+ public virtual ICollection procesosidTipoNavigation { get; set; } = new List();
+
+ public virtual ICollection usuarios { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/eventos.cs b/bdGrupoSanchoToro/db/eventos.cs
new file mode 100644
index 0000000..a2186d7
--- /dev/null
+++ b/bdGrupoSanchoToro/db/eventos.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class eventos
+{
+ public int idEvento { get; set; }
+
+ public string Descripcion { get; set; } = null!;
+
+ public int? idEntidad { get; set; }
+
+ public string? Telefono1 { get; set; }
+
+ public string? Telefono2 { get; set; }
+
+ public string? Email { get; set; }
+
+ public string? PersonaContacto { get; set; }
+
+ public DateOnly FechaAlta { get; set; }
+
+ public DateOnly? FechaBaja { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public string? Direccion { get; set; }
+
+ public string? CodigoPostal { get; set; }
+
+ public string? CodigoMunicipio { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public virtual municipios? CodigoMunicipioNavigation { get; set; }
+
+ public virtual ICollection facturas { get; set; } = new List();
+
+ public virtual entidades? idEntidadNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+
+ public virtual ICollection presupuestos { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/expedientesentidades.cs b/bdGrupoSanchoToro/db/expedientesentidades.cs
new file mode 100644
index 0000000..6713c55
--- /dev/null
+++ b/bdGrupoSanchoToro/db/expedientesentidades.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class expedientesentidades
+{
+ public int idExpediente { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public DateTime? Fecha { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public int? idEntidad { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public bool EsAdvertencia { get; set; }
+
+ public virtual entidades? idEntidadNavigation { get; set; }
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/extractosbancarios.cs b/bdGrupoSanchoToro/db/extractosbancarios.cs
new file mode 100644
index 0000000..ef28a0c
--- /dev/null
+++ b/bdGrupoSanchoToro/db/extractosbancarios.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class extractosbancarios
+{
+ public int idExtracto { get; set; }
+
+ public int idCaja { get; set; }
+
+ public DateOnly FechaInicial { get; set; }
+
+ public DateOnly FechaFinal { get; set; }
+
+ public double SaldoAnterior { get; set; }
+
+ public DateTime FechaLectura { get; set; }
+
+ public int idUsuario { get; set; }
+
+ public double SaldoFinal { get; set; }
+
+ public virtual cajas idCajaNavigation { get; set; } = null!;
+
+ public virtual usuarios idUsuarioNavigation { get; set; } = null!;
+
+ public virtual ICollection movimientosbancarios { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/facturas.cs b/bdGrupoSanchoToro/db/facturas.cs
new file mode 100644
index 0000000..462b243
--- /dev/null
+++ b/bdGrupoSanchoToro/db/facturas.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class facturas
+{
+ public int idFactura { get; set; }
+
+ public string NumeroFactura { get; set; } = null!;
+
+ public DateOnly FechaFactura { get; set; }
+
+ public DateTime FechaEmision { get; set; }
+
+ public int idCliente { get; set; }
+
+ public double BaseImponibleExenta { get; set; }
+
+ public double? BaseImponible1 { get; set; }
+
+ public double? BaseImponible2 { get; set; }
+
+ public double? BaseImponible3 { get; set; }
+
+ public double? PorcentajeIVA1 { get; set; }
+
+ public double? PorcentajeIVA2 { get; set; }
+
+ public double? PorcentajeIVA3 { get; set; }
+
+ public double? CuotaIVA1 { get; set; }
+
+ public double? CuotaIVA2 { get; set; }
+
+ public double? CuotaIVA3 { get; set; }
+
+ public double TotalBaseImponible { get; set; }
+
+ public double PorcentajeIRPF { get; set; }
+
+ public double IRPF { get; set; }
+
+ public double TotalIVA { get; set; }
+
+ public double TotalFactura { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public int? idDatosClienteOriginal { get; set; }
+
+ public int idSerieFactura { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public string? ObservacionesAImprimir { get; set; }
+
+ public int? idEvento { get; set; }
+
+ public double ImportePagado { get; set; }
+
+ public DateOnly? FechaPago { get; set; }
+
+ public string? NIF { get; set; }
+
+ public string? RazonSocial { get; set; }
+
+ public string? Direccion { get; set; }
+
+ public string? CodigoPostal { get; set; }
+
+ public string? CodigoMunicipio { get; set; }
+
+ public DateTime? FechaEnvioAsesoria { get; set; }
+
+ public virtual municipios? CodigoMunicipioNavigation { get; set; }
+
+ public virtual ICollection detallesfacturas { get; set; } = new List();
+
+ public virtual ICollection documentosfacturas { get; set; } = new List();
+
+ public virtual entidades idClienteNavigation { get; set; } = null!;
+
+ public virtual ficheros? idDatosClienteOriginalNavigation { get; set; }
+
+ public virtual eventos? idEventoNavigation { get; set; }
+
+ public virtual seriesfacturas idSerieFacturaNavigation { get; set; } = null!;
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+
+ public virtual ICollection movimientoscaja { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/facturasrecibidas.cs b/bdGrupoSanchoToro/db/facturasrecibidas.cs
new file mode 100644
index 0000000..08a4d58
--- /dev/null
+++ b/bdGrupoSanchoToro/db/facturasrecibidas.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class facturasrecibidas
+{
+ public int idFactura { get; set; }
+
+ public string NumeroFactura { get; set; } = null!;
+
+ public DateOnly FechaFactura { get; set; }
+
+ public DateOnly FechaRegistro { get; set; }
+
+ public int idProveedor { get; set; }
+
+ public double BaseImponibleExenta { get; set; }
+
+ public double? BaseImponible1 { get; set; }
+
+ public double? BaseImponible2 { get; set; }
+
+ public double? BaseImponible3 { get; set; }
+
+ public double? PorcentajeIVA1 { get; set; }
+
+ public double? PorcentajeIVA2 { get; set; }
+
+ public double? PorcentajeIVA3 { get; set; }
+
+ public double TotalBaseImponible { get; set; }
+
+ public double TotalIVA { get; set; }
+
+ public double PorcentajeIRPF { get; set; }
+
+ public double IRPF { get; set; }
+
+ public double TotalFactura { get; set; }
+
+ public double ImportePagado { get; set; }
+
+ public DateOnly? FechaPago { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public int? idDatosProveedorOriginal { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public double? CuotaIVA1 { get; set; }
+
+ public double? CuotaIVA2 { get; set; }
+
+ public double? CuotaIVA3 { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public string? NIF { get; set; }
+
+ public string? RazonSocial { get; set; }
+
+ public string? Direccion { get; set; }
+
+ public string? CodigoPostal { get; set; }
+
+ public string? CodigoMunicipio { get; set; }
+
+ public DateTime? FechaEnvioAsesoria { get; set; }
+
+ public int? idCategoria { get; set; }
+
+ public virtual ICollection detallesfacturasrecibidas { get; set; } = new List();
+
+ public virtual ICollection documentosfacturasrecibidas { get; set; } = new List();
+
+ public virtual enumeraciones? idCategoriaNavigation { get; set; }
+
+ public virtual ficheros? idDatosProveedorOriginalNavigation { get; set; }
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual entidades idProveedorNavigation { get; set; } = null!;
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+
+ public virtual ICollection movimientoscaja { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/ficheros.cs b/bdGrupoSanchoToro/db/ficheros.cs
new file mode 100644
index 0000000..ee573f6
--- /dev/null
+++ b/bdGrupoSanchoToro/db/ficheros.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class ficheros
+{
+ public int idFichero { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public DateTime Fecha { get; set; }
+
+ public int? idTipo { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public byte[]? Fichero { get; set; }
+
+ public string? NombreFichero { get; set; }
+
+ public int? idAplicacion { get; set; }
+
+ public virtual ICollection articulos { get; set; } = new List();
+
+ public virtual ICollection correos { get; set; } = new List();
+
+ public virtual ICollection detallesfacturas { get; set; } = new List();
+
+ public virtual ICollection documentosfacturas { get; set; } = new List();
+
+ public virtual ICollection documentosfacturasrecibidas { get; set; } = new List();
+
+ public virtual ICollection documentospresupuestos { get; set; } = new List();
+
+ public virtual ICollection empresasidLogo1Navigation { get; set; } = new List();
+
+ public virtual ICollection empresasidLogo2Navigation { get; set; } = new List();
+
+ public virtual ICollection expedientesentidades { get; set; } = new List();
+
+ public virtual ICollection facturas { get; set; } = new List();
+
+ public virtual ICollection facturasrecibidasidDatosProveedorOriginalNavigation { get; set; } = new List();
+
+ public virtual ICollection facturasrecibidasidFicheroNavigation { get; set; } = new List();
+
+ public virtual ICollection ficherosadjuntos { get; set; } = new List();
+
+ public virtual enumeraciones? idTipoNavigation { get; set; }
+
+ public virtual ICollection movimientoscaja { get; set; } = new List();
+
+ public virtual ICollection plantillas { get; set; } = new List();
+
+ public virtual ICollection presupuestos { get; set; } = new List();
+
+ public virtual ICollection procesos { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/ficherosadjuntos.cs b/bdGrupoSanchoToro/db/ficherosadjuntos.cs
new file mode 100644
index 0000000..acebe76
--- /dev/null
+++ b/bdGrupoSanchoToro/db/ficherosadjuntos.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class ficherosadjuntos
+{
+ public int idFicheroAdjunto { get; set; }
+
+ public int idFichero { get; set; }
+
+ public int idCorreo { get; set; }
+
+ public virtual correos idCorreoNavigation { get; set; } = null!;
+
+ public virtual ficheros idFicheroNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/ficherosconfiguracion.cs b/bdGrupoSanchoToro/db/ficherosconfiguracion.cs
new file mode 100644
index 0000000..30daf13
--- /dev/null
+++ b/bdGrupoSanchoToro/db/ficherosconfiguracion.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class ficherosconfiguracion
+{
+ public int idFicheroConfiguracion { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public string? Codigo { get; set; }
+
+ public byte[]? Configuracion { get; set; }
+
+ public string? Descripcion { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/fiestas.cs b/bdGrupoSanchoToro/db/fiestas.cs
new file mode 100644
index 0000000..6d67c7c
--- /dev/null
+++ b/bdGrupoSanchoToro/db/fiestas.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class fiestas
+{
+ public int idFiesta { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public DateOnly Fecha { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/formulas.cs b/bdGrupoSanchoToro/db/formulas.cs
new file mode 100644
index 0000000..ad4a39f
--- /dev/null
+++ b/bdGrupoSanchoToro/db/formulas.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class formulas
+{
+ public int idFormula { get; set; }
+
+ public string Codigo { get; set; } = null!;
+
+ public string Descripcion { get; set; } = null!;
+
+ public string? Formula { get; set; }
+
+ public int Tipo { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/gruposenumeraciones.cs b/bdGrupoSanchoToro/db/gruposenumeraciones.cs
new file mode 100644
index 0000000..c5f17cd
--- /dev/null
+++ b/bdGrupoSanchoToro/db/gruposenumeraciones.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class gruposenumeraciones
+{
+ public int idGrupoEnumeracion { get; set; }
+
+ public string Grupo { get; set; } = null!;
+
+ public string? Descripcion { get; set; }
+
+ public bool Oculto { get; set; }
+
+ public virtual ICollection enumeraciones { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/gruposusuarios.cs b/bdGrupoSanchoToro/db/gruposusuarios.cs
new file mode 100644
index 0000000..8aa1767
--- /dev/null
+++ b/bdGrupoSanchoToro/db/gruposusuarios.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class gruposusuarios
+{
+ public int idGrupo { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public virtual ICollection autorizacionesgrupos { get; set; } = new List();
+
+ public virtual ICollection usuarios { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/logs.cs b/bdGrupoSanchoToro/db/logs.cs
new file mode 100644
index 0000000..2c53a3c
--- /dev/null
+++ b/bdGrupoSanchoToro/db/logs.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class logs
+{
+ public int idLog { get; set; }
+
+ public string? Tabla { get; set; }
+
+ public string Aplicacion { get; set; } = null!;
+
+ public int id { get; set; }
+
+ public string? Usuario { get; set; }
+
+ public string? ip { get; set; }
+
+ public DateTime? FechaHora { get; set; }
+
+ public string? Log { get; set; }
+
+ public int? idConexion { get; set; }
+
+ public double? idTimeStamp { get; set; }
+
+ public string? Tipo { get; set; }
+
+ public int? idRelacionado { get; set; }
+
+ public string? VersionPrograma { get; set; }
+
+ public bool? SuperUsuario { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/menus.cs b/bdGrupoSanchoToro/db/menus.cs
new file mode 100644
index 0000000..7e9b1dd
--- /dev/null
+++ b/bdGrupoSanchoToro/db/menus.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class menus
+{
+ public int idMenus { get; set; }
+
+ public string? Texto { get; set; }
+
+ public string? Ayuda { get; set; }
+
+ public string? Accion { get; set; }
+
+ public int? Orden { get; set; }
+
+ public int? idMenuPadre { get; set; }
+
+ public bool MostrarEnPanel { get; set; }
+
+ public int? idPermiso { get; set; }
+
+ public virtual permisos? idPermisoNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/movimientosbancarios.cs b/bdGrupoSanchoToro/db/movimientosbancarios.cs
new file mode 100644
index 0000000..ef4cfeb
--- /dev/null
+++ b/bdGrupoSanchoToro/db/movimientosbancarios.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class movimientosbancarios
+{
+ public int idMovimientoBancario { get; set; }
+
+ public int idExtractoBancario { get; set; }
+
+ public DateOnly FechaOperacion { get; set; }
+
+ public DateOnly FechaValor { get; set; }
+
+ public string CodigoConcepto { get; set; } = null!;
+
+ public string ConceptoPropio { get; set; } = null!;
+
+ public double Importe { get; set; }
+
+ public string NumeroDocumento { get; set; } = null!;
+
+ public string ReferenciaBanco { get; set; } = null!;
+
+ public string Detalle { get; set; } = null!;
+
+ public int? idConciliacion { get; set; }
+
+ public virtual conciliacionesbancarias? idConciliacionNavigation { get; set; }
+
+ public virtual extractosbancarios idExtractoBancarioNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/movimientoscaja.cs b/bdGrupoSanchoToro/db/movimientoscaja.cs
new file mode 100644
index 0000000..bf9afda
--- /dev/null
+++ b/bdGrupoSanchoToro/db/movimientoscaja.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class movimientoscaja
+{
+ public int idMovimiento { get; set; }
+
+ public int idCaja { get; set; }
+
+ public double Importe { get; set; }
+
+ public int? idFactura { get; set; }
+
+ public DateTime Fecha { get; set; }
+
+ public DateTime FechaCreacion { get; set; }
+
+ public int? idMovimientoCierre { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public DateTime? FechaSupervision { get; set; }
+
+ public int? idUsuarioSupervisa { get; set; }
+
+ public string? DocumentoPago { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public string? NumeroRecibo { get; set; }
+
+ public int Tipo { get; set; }
+
+ public int? idFacturaRecibida { get; set; }
+
+ public double SaldoAntesCierre { get; set; }
+
+ public int? idConciliacion { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public virtual ICollection InverseidMovimientoCierreNavigation { get; set; } = new List();
+
+ public virtual cajas idCajaNavigation { get; set; } = null!;
+
+ public virtual conciliacionesbancarias? idConciliacionNavigation { get; set; }
+
+ public virtual facturas? idFacturaNavigation { get; set; }
+
+ public virtual facturasrecibidas? idFacturaRecibidaNavigation { get; set; }
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual movimientoscaja? idMovimientoCierreNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioSupervisaNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/municipios.cs b/bdGrupoSanchoToro/db/municipios.cs
new file mode 100644
index 0000000..54302a5
--- /dev/null
+++ b/bdGrupoSanchoToro/db/municipios.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class municipios
+{
+ public string CodigoMunicipio { get; set; } = null!;
+
+ public string? CodigoProvincia { get; set; }
+
+ public string? Nombre { get; set; }
+
+ public string? DC { get; set; }
+
+ public virtual provincias? CodigoProvinciaNavigation { get; set; }
+
+ public virtual ICollection albaranesCodigoMunicipioCargaNavigation { get; set; } = new List();
+
+ public virtual ICollection albaranesCodigoMunicipioDescargaNavigation { get; set; } = new List();
+
+ public virtual ICollection almacenes { get; set; } = new List();
+
+ public virtual ICollection codigospostales { get; set; } = new List();
+
+ public virtual ICollection entidades { get; set; } = new List();
+
+ public virtual ICollection eventos { get; set; } = new List();
+
+ public virtual ICollection facturas { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/permisos.cs b/bdGrupoSanchoToro/db/permisos.cs
new file mode 100644
index 0000000..321152c
--- /dev/null
+++ b/bdGrupoSanchoToro/db/permisos.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class permisos
+{
+ public int idPermiso { get; set; }
+
+ public string? CodigoPermiso { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public virtual ICollection autorizacionesgrupos { get; set; } = new List();
+
+ public virtual ICollection autorizacionesusuarios { get; set; } = new List();
+
+ public virtual ICollection cajas { get; set; } = new List();
+
+ public virtual ICollection menus { get; set; } = new List();
+
+ public virtual ICollection plantillas { get; set; } = new List();
+
+ public virtual ICollection procesos { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/plantillas.cs b/bdGrupoSanchoToro/db/plantillas.cs
new file mode 100644
index 0000000..4ad4c79
--- /dev/null
+++ b/bdGrupoSanchoToro/db/plantillas.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class plantillas
+{
+ public int idPlantilla { get; set; }
+
+ public string? Codigo { get; set; }
+
+ public string Descripcion { get; set; } = null!;
+
+ public int? idTipo { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public int idGrupo { get; set; }
+
+ public bool Oculta { get; set; }
+
+ public bool TipoListado { get; set; }
+
+ public int? idPermiso { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public bool? Oculto { get; set; }
+
+ public int? Orden { get; set; }
+
+ public int? idEmpresa { get; set; }
+
+ public virtual empresas? idEmpresaNavigation { get; set; }
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual enumeraciones idGrupoNavigation { get; set; } = null!;
+
+ public virtual permisos? idPermisoNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/presupuestos.cs b/bdGrupoSanchoToro/db/presupuestos.cs
new file mode 100644
index 0000000..5913289
--- /dev/null
+++ b/bdGrupoSanchoToro/db/presupuestos.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class presupuestos
+{
+ public int idPresupuesto { get; set; }
+
+ public DateOnly FechaPresupuesto { get; set; }
+
+ public DateOnly? FechaAceptacion { get; set; }
+
+ public int idCliente { get; set; }
+
+ public int? idEvento { get; set; }
+
+ public double ImporteBruto { get; set; }
+
+ public double PorcentajeIVA { get; set; }
+
+ public double IVA { get; set; }
+
+ public double TotalPresupuesto { get; set; }
+
+ public int? idUsuario { get; set; }
+
+ public int? idDatosClienteOriginal { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public DateOnly? FechaAceptacionPresupuesto { get; set; }
+
+ public int? idPersonaContacto { get; set; }
+
+ public double Kilometros { get; set; }
+
+ public DateOnly? FechaInicioEvento { get; set; }
+
+ public DateOnly? FechaFinEvento { get; set; }
+
+ public DateOnly? FechaMontaje { get; set; }
+
+ public DateOnly? FechaDesmontaje { get; set; }
+
+ public virtual ICollection albaranes { get; set; } = new List();
+
+ public virtual ICollection detallepresupuesto { get; set; } = new List();
+
+ public virtual ICollection documentospresupuestos { get; set; } = new List();
+
+ public virtual entidades idClienteNavigation { get; set; } = null!;
+
+ public virtual ficheros? idDatosClienteOriginalNavigation { get; set; }
+
+ public virtual eventos? idEventoNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/procesos.cs b/bdGrupoSanchoToro/db/procesos.cs
new file mode 100644
index 0000000..adf1bae
--- /dev/null
+++ b/bdGrupoSanchoToro/db/procesos.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class procesos
+{
+ public int idProceso { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public string? Accion { get; set; }
+
+ public int? idTipo { get; set; }
+
+ public int? idSubtipo { get; set; }
+
+ public int? idPermiso { get; set; }
+
+ public int? idFichero { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public virtual ficheros? idFicheroNavigation { get; set; }
+
+ public virtual permisos? idPermisoNavigation { get; set; }
+
+ public virtual enumeraciones? idSubtipoNavigation { get; set; }
+
+ public virtual enumeraciones? idTipoNavigation { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/productos.cs b/bdGrupoSanchoToro/db/productos.cs
new file mode 100644
index 0000000..c9b7b76
--- /dev/null
+++ b/bdGrupoSanchoToro/db/productos.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class productos
+{
+ public int idProducto { get; set; }
+
+ public string Descripcion { get; set; } = null!;
+
+ public DateTime? FechaBaja { get; set; }
+
+ public double PrecioVenta { get; set; }
+
+ public double PrecioAlquiler { get; set; }
+
+ public int? idUsuarioCreador { get; set; }
+
+ public int? idUsuarioModificador { get; set; }
+
+ public string? Observaciones { get; set; }
+
+ public bool? FacturarComoVentaPorDefecto { get; set; }
+
+ public string? Codigo { get; set; }
+
+ public double UltimoPrecioCompra { get; set; }
+
+ public double Peso { get; set; }
+
+ public double Volumen { get; set; }
+
+ public double HorasMontaje { get; set; }
+
+ public double HorasDesmontaje { get; set; }
+
+ public double TotalUnidades { get; set; }
+
+ public double UnidadesInicialesOFabricadas { get; set; }
+
+ public double UnidadesCompradas { get; set; }
+
+ public double UnidadesVendidas { get; set; }
+
+ public double UnidadesAlquiladas { get; set; }
+
+ public double UnidadesAveriadas { get; set; }
+
+ public double UnidadesDesechadas { get; set; }
+
+ public double UnidadesSubAlquiladas { get; set; }
+
+ public double PorcentajeDesgasteDiaAlquilado { get; set; }
+
+ public int NumeroAsientos { get; set; }
+
+ public int Tipo { get; set; }
+
+ public int NumeroFilas { get; set; }
+
+ public bool PrecioPorDia { get; set; }
+
+ public bool PrecioPorAsiento { get; set; }
+
+ public bool PrecioPorKm { get; set; }
+
+ public double PrecioMinimo { get; set; }
+
+ public double IncrementoGastosGenerales { get; set; }
+
+ public int Ancho { get; set; }
+
+ public int Largo { get; set; }
+
+ public bool IncluyeTarima { get; set; }
+
+ public bool IncluyeIluminacion { get; set; }
+
+ public int idEmpresa { get; set; }
+
+ public virtual ICollection articulos { get; set; } = new List();
+
+ public virtual ICollection detallepresupuesto { get; set; } = new List();
+
+ public virtual ICollection detallesalbaranes { get; set; } = new List();
+
+ public virtual ICollection detallesfacturas { get; set; } = new List();
+
+ public virtual ICollection detallesfacturasrecibidas { get; set; } = new List();
+
+ public virtual empresas idEmpresaNavigation { get; set; } = null!;
+
+ public virtual usuarios? idUsuarioCreadorNavigation { get; set; }
+
+ public virtual usuarios? idUsuarioModificadorNavigation { get; set; }
+
+ public virtual ICollection stocks { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/provincias.cs b/bdGrupoSanchoToro/db/provincias.cs
new file mode 100644
index 0000000..48a3ed3
--- /dev/null
+++ b/bdGrupoSanchoToro/db/provincias.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class provincias
+{
+ public string CodigoProvincia { get; set; } = null!;
+
+ public string? Nombre { get; set; }
+
+ public virtual ICollection municipios { get; set; } = new List();
+}
diff --git a/bdGrupoSanchoToro/db/seriesfacturas.cs b/bdGrupoSanchoToro/db/seriesfacturas.cs
new file mode 100644
index 0000000..0b45a4a
--- /dev/null
+++ b/bdGrupoSanchoToro/db/seriesfacturas.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class seriesfacturas
+{
+ public int idSerieFactura { get; set; }
+
+ public string? Descripcion { get; set; }
+
+ public DateOnly? FechaBaja { get; set; }
+
+ public string Serie { get; set; } = null!;
+
+ public int idEmpresa { get; set; }
+
+ public int Tipo { get; set; }
+
+ public int NumeroDigitos { get; set; }
+
+ public bool IRPFDespuesDeIVA { get; set; }
+
+ public virtual ICollection facturas { get; set; } = new List();
+
+ public virtual empresas idEmpresaNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/stocks.cs b/bdGrupoSanchoToro/db/stocks.cs
new file mode 100644
index 0000000..87e6e21
--- /dev/null
+++ b/bdGrupoSanchoToro/db/stocks.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class stocks
+{
+ public int idStock { get; set; }
+
+ public int idAlmacen { get; set; }
+
+ public int idProducto { get; set; }
+
+ public double Unidades { get; set; }
+
+ public virtual almacenes idAlmacenNavigation { get; set; } = null!;
+
+ public virtual productos idProductoNavigation { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/tablas.cs b/bdGrupoSanchoToro/db/tablas.cs
new file mode 100644
index 0000000..e67bd2f
--- /dev/null
+++ b/bdGrupoSanchoToro/db/tablas.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class tablas
+{
+ public int idTabla { get; set; }
+
+ public string Codigo { get; set; } = null!;
+
+ public string Descripcion { get; set; } = null!;
+}
diff --git a/bdGrupoSanchoToro/db/trabajador.cs b/bdGrupoSanchoToro/db/trabajador.cs
new file mode 100644
index 0000000..6c9ebef
--- /dev/null
+++ b/bdGrupoSanchoToro/db/trabajador.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class trabajador
+{
+ public int idTrabajador { get; set; }
+
+ public string? DocumentoIdentidad { get; set; }
+
+ public string? Apellidos { get; set; }
+
+ public string? Nombre { get; set; }
+
+ public string? CorreoElectronico { get; set; }
+
+ public string? Telefono1 { get; set; }
+
+ public string? Telefono2 { get; set; }
+
+ public DateOnly? FechaAlta { get; set; }
+
+ public DateOnly? FechaBaja { get; set; }
+}
diff --git a/bdGrupoSanchoToro/db/usuarios.cs b/bdGrupoSanchoToro/db/usuarios.cs
new file mode 100644
index 0000000..0c5863f
--- /dev/null
+++ b/bdGrupoSanchoToro/db/usuarios.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using PropertyChanged;
+
+namespace bdGrupoSanchoToro.db;
+
+[AddINotifyPropertyChangedInterface]
+public partial class usuarios
+{
+ public int idUsuario { get; set; }
+
+ public string Usuario { get; set; } = null!;
+
+ public string? Nombre { get; set; }
+
+ public string? SHA1Passwd { get; set; }
+
+ public int? idGrupo { get; set; }
+
+ public int? idTema { get; set; }
+
+ public DateOnly? FechaBaja { get; set; }
+
+ public double? Escala { get; set; }
+
+ public virtual ICollection albaranes { get; set; } = new List();
+
+ public virtual ICollection autorizacionesusuarios { get; set; } = new List();
+
+ public virtual ICollection conciliacionesbancarias { get; set; } = new List();
+
+ public virtual ICollection correos { get; set; } = new List();
+
+ public virtual ICollection documentosfacturas { get; set; } = new List