2026-01-30 03
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Imports tsl5.Extensiones
|
Imports tsUtilidades.Extensiones
|
||||||
Imports bdGrupoSanchoToro
|
Imports bdGrupoSanchoToro
|
||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Data.Entity
|
Imports System.Data.Entity
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Imports DevExpress.Xpf.Grid
|
|||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Linq.Dynamic
|
Imports System.Linq.Dynamic
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPF
|
Imports tsWPF
|
||||||
Imports tsWPF.Comun
|
Imports tsWPF.Comun
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
@@ -220,7 +220,7 @@ Public Class ApunteExtracto
|
|||||||
Property idAsiento As Integer
|
Property idAsiento As Integer
|
||||||
Property NumeroAsiento As String
|
Property NumeroAsiento As String
|
||||||
Property Concepto As String
|
Property Concepto As String
|
||||||
Property Fecha As Date?
|
Property Fecha As DateOnly?
|
||||||
Property Debe As Double
|
Property Debe As Double
|
||||||
Property Haber As Double
|
Property Haber As Double
|
||||||
Property Saldo As Double
|
Property Saldo As Double
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ Imports tsWPF.modExtensiones
|
|||||||
Imports System.Data.Common
|
Imports System.Data.Common
|
||||||
Imports System.Data.Entity
|
Imports System.Data.Entity
|
||||||
Imports DevExpress.Xpf.Grid
|
Imports DevExpress.Xpf.Grid
|
||||||
Imports tsl5.Extensiones
|
Imports tsUtilidades.Extensiones
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPF.Comun
|
Imports tsWPF.Comun
|
||||||
Imports bdGrupoSanchoToro.db
|
Imports bdGrupoSanchoToro.db
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Imports bdGrupoSanchoToro
|
|||||||
Imports DevExpress.Xpf.Grid
|
Imports DevExpress.Xpf.Grid
|
||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Linq.Dynamic
|
Imports System.Linq.Dynamic
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPFCore
|
Imports tsWPFCore
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
Imports bdGrupoSanchoToro.db
|
Imports bdGrupoSanchoToro.db
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Imports DevExpress.Xpf.Grid
|
|||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Linq.Dynamic
|
Imports System.Linq.Dynamic
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPF
|
Imports tsWPF
|
||||||
Imports DevExpress.Data
|
Imports DevExpress.Data
|
||||||
Imports tsWPF.Comun
|
Imports tsWPF.Comun
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Imports DevExpress.Xpf.Grid
|
|||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Linq.Dynamic
|
Imports System.Linq.Dynamic
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPF
|
Imports tsWPF
|
||||||
Imports DevExpress.Data
|
Imports DevExpress.Data
|
||||||
Imports tsWPF.Comun
|
Imports tsWPF.Comun
|
||||||
@@ -53,7 +53,7 @@ Public Class ucBalanceSumasYSaldos
|
|||||||
End Sub
|
End Sub
|
||||||
Private _Nivel As Integer
|
Private _Nivel As Integer
|
||||||
Public Overrides Sub Cargado()
|
Public Overrides Sub Cargado()
|
||||||
_Nivel = CInt(Rutinas.Ttagi(Me.OtrosParametros, "OPAR"))
|
_Nivel = CInt(tsUtilidades.Utilidades.Ttagi(Me.OtrosParametros, "OPAR"))
|
||||||
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
|
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
|
||||||
Dim ejab = Ejercicios.Where(Function(x) x.FechaCierre Is Nothing)
|
Dim ejab = Ejercicios.Where(Function(x) x.FechaCierre Is Nothing)
|
||||||
deFechaInicio.EditValue = ejab.OrderBy(Function(x) x.FechaInicio).First.FechaInicio
|
deFechaInicio.EditValue = ejab.OrderBy(Function(x) x.FechaInicio).First.FechaInicio
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Imports DevExpress.Xpf.Core
|
|||||||
Imports DevExpress.XtraReports.UserDesigner
|
Imports DevExpress.XtraReports.UserDesigner
|
||||||
Imports DevExpress.XtraReports.UI
|
Imports DevExpress.XtraReports.UI
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPF
|
Imports tsWPF
|
||||||
Imports tsWPF.Comun
|
Imports tsWPF.Comun
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
@@ -107,7 +107,7 @@ Public Class ucBancos
|
|||||||
' End Get
|
' End Get
|
||||||
'End Property
|
'End Property
|
||||||
|
|
||||||
'Public Function ObtieneContexto(dcn As tsl5.Datos.DatosConexionCliente) As System.Data.Objects.ObjectContext Implements tsWPF.IApCabLin.ObtieneContexto
|
'Public Function ObtieneContexto(dcn As tsUtilidades.Datos.DatosConexionCliente) As System.Data.Objects.ObjectContext Implements tsWPF.IApCabLin.ObtieneContexto
|
||||||
' bd = bdGrupoSanchoToro.gestionasegasaEntities.NuevoContexto
|
' bd = bdGrupoSanchoToro.gestionasegasaEntities.NuevoContexto
|
||||||
' Return bd
|
' Return bd
|
||||||
'End Function
|
'End Function
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ Imports DevExpress.Xpf.Editors.Helpers
|
|||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Data.Common
|
Imports System.Data.Common
|
||||||
Imports System.Data.Entity
|
Imports System.Data.Entity
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports DevExpress.Xpf.Grid
|
Imports DevExpress.Xpf.Grid
|
||||||
Imports System.Collections
|
Imports System.Collections
|
||||||
Imports tsl5.Extensiones
|
Imports tsUtilidades.Extensiones
|
||||||
Imports System.Data.Objects.DataClasses
|
Imports System.Data.Objects.DataClasses
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
Imports tsWPFCore
|
Imports tsWPFCore
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ Public Class ucConceptosApuntes
|
|||||||
Public Async Sub ObtieneConceptosApuntesAsync(Background As Boolean)
|
Public Async Sub ObtieneConceptosApuntesAsync(Background As Boolean)
|
||||||
Try
|
Try
|
||||||
Dim rs As New List(Of conceptosapuntes)
|
Dim rs As New List(Of conceptosapuntes)
|
||||||
Dim Busqueda = tsl5.Extensiones.ObjetoNothingAVacio(Me.teBusqueda.EditValue)
|
Dim Busqueda As String = Me.teBusqueda.EditValue.ToString
|
||||||
If Background Then
|
If Background Then
|
||||||
Me.ContenedorAplicacion.IsEnabled = False
|
Me.ContenedorAplicacion.IsEnabled = False
|
||||||
Await Task.Run(Sub()
|
Await Task.Run(Sub()
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ Imports System.Data.Entity
|
|||||||
Imports bdGrupoSanchoToro
|
Imports bdGrupoSanchoToro
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports DevExpress.Xpf.Grid
|
Imports DevExpress.Xpf.Grid
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsl5.Extensiones.StringExtensions
|
Imports tsUtilidades.Extensiones.StringExtensions
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
Imports tsUtilidades
|
Imports tsUtilidades
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Imports DevExpress.Xpf.Grid
|
|||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Linq.Dynamic
|
Imports System.Linq.Dynamic
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPF
|
Imports tsWPF
|
||||||
Imports tsWPF.Comun
|
Imports tsWPF.Comun
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
|
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
|
||||||
<Setter Property="Background" Value="#B0E0E6" />
|
<Setter Property="Background" Value="#B0E0E6" />
|
||||||
|
|||||||
@@ -1,25 +1,19 @@
|
|||||||
Option Strict Off
|
Option Strict Off
|
||||||
Imports DevExpress.Xpf.Editors
|
Imports DevExpress.Xpf.Editors
|
||||||
Imports DevExpress.Xpf.LayoutControl
|
Imports DevExpress.Xpf.LayoutControl
|
||||||
Imports tsWPF
|
Imports tsWPFCore
|
||||||
Imports System.ComponentModel
|
Imports System.ComponentModel
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports DevExpress.Xpf.Editors.Validation
|
|
||||||
Imports DevExpress.Xpf.Editors.Helpers
|
|
||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports tsWPF.modExtensiones
|
Imports tsWPFCore.modExtensiones
|
||||||
Imports System.Data.Common
|
Imports System.Data.Common
|
||||||
Imports System.Data.Entity
|
|
||||||
Imports bdGrupoSanchoToro
|
Imports bdGrupoSanchoToro
|
||||||
Imports DevExpress.Xpf.Grid
|
Imports DevExpress.Xpf.Grid
|
||||||
Imports tsl5.Extensiones
|
Imports tsUtilidades.Extensiones
|
||||||
Imports bdGrupoSanchoToro.apuntes
|
Imports bdGrupoSanchoToro.db.apuntes
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports tsl5.Datos
|
|
||||||
Imports System.Windows.Media.Animation
|
Imports System.Windows.Media.Animation
|
||||||
Imports tsWPF.Comun
|
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
Imports tsWPFCore
|
|
||||||
Imports tsUtilidades
|
Imports tsUtilidades
|
||||||
|
|
||||||
Imports bdGrupoSanchoToro.db
|
Imports bdGrupoSanchoToro.db
|
||||||
@@ -105,8 +99,8 @@ Public Class ucDiario
|
|||||||
If FuerzaNuevo OrElse _idAsiento Is Nothing Then
|
If FuerzaNuevo OrElse _idAsiento Is Nothing Then
|
||||||
|
|
||||||
ra = New asientos
|
ra = New asientos
|
||||||
ra.Fecha = Today ' If(uEc.FechaFin > Now.Date, Now.Date, uEc.FechaFin)
|
ra.Fecha = DateOnly.FromDateTime(Today) ' If(uEc.FechaFin > Now.Date, Now.Date, uEc.FechaFin)
|
||||||
ra.FechaIntroduccion = Now
|
ra.FechaIntroduccion = DateOnly.FromDateTime(Now)
|
||||||
Dim uEc = bd.ejercicioscontables.FirstOrDefault(Function(x) x.FechaInicio <= ra.Fecha And x.FechaFin >= ra.Fecha And x.FechaCierre Is Nothing)
|
Dim uEc = bd.ejercicioscontables.FirstOrDefault(Function(x) x.FechaInicio <= ra.Fecha And x.FechaFin >= ra.Fecha And x.FechaCierre Is Nothing)
|
||||||
If uEc Is Nothing Then
|
If uEc Is Nothing Then
|
||||||
uEc = bd.ejercicioscontables.Where(Function(x) x.FechaCierre Is Nothing).OrderByDescending(Function(x) x.FechaInicio).First
|
uEc = bd.ejercicioscontables.Where(Function(x) x.FechaCierre Is Nothing).OrderByDescending(Function(x) x.FechaInicio).First
|
||||||
@@ -117,7 +111,7 @@ Public Class ucDiario
|
|||||||
ra.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.NORMAL
|
ra.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.NORMAL
|
||||||
ra.Punteado = False
|
ra.Punteado = False
|
||||||
NuevoEstado = EstadosAplicacion.Nuevo
|
NuevoEstado = EstadosAplicacion.Nuevo
|
||||||
ra.usuarios = bd.usuarios.First(Function(x) x.idUsuario = bdGrupoSanchoToro.Utilidades.dsc.idUsuario)
|
ra.idUsuarioNavigation = bd.usuarios.First(Function(x) x.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario)
|
||||||
Else
|
Else
|
||||||
ra = bd.asientos.First(Function(x) x.idAsiento = _idAsiento)
|
ra = bd.asientos.First(Function(x) x.idAsiento = _idAsiento)
|
||||||
NuevoEstado = EstadosAplicacion.ModificandoRegistro
|
NuevoEstado = EstadosAplicacion.ModificandoRegistro
|
||||||
@@ -156,13 +150,12 @@ Public Class ucDiario
|
|||||||
If ra.apuntes.Any(Function(x) x.TipoDocumento.HasValue AndAlso (x.TipoDocumento = TiposDocumentos.FACTURA And x.NumeroDocumento.NothingAVacio = "")) Then
|
If ra.apuntes.Any(Function(x) x.TipoDocumento.HasValue AndAlso (x.TipoDocumento = TiposDocumentos.FACTURA And x.NumeroDocumento.NothingAVacio = "")) Then
|
||||||
hte.Add("Almacenar-FaltaNumeroDocumento", "Es obligatorio meter el nº de documento en los apuntes de tipo factura")
|
hte.Add("Almacenar-FaltaNumeroDocumento", "Es obligatorio meter el nº de documento en los apuntes de tipo factura")
|
||||||
End If
|
End If
|
||||||
ra.Fecha = ra.Fecha.Date
|
|
||||||
Dim ej = bd.ejercicioscontables.FirstOrDefault(Function(x) x.FechaInicio <= ra.Fecha And x.FechaFin >= ra.Fecha And x.FechaCierre.HasValue = False)
|
Dim ej = bd.ejercicioscontables.FirstOrDefault(Function(x) x.FechaInicio <= ra.Fecha And x.FechaFin >= ra.Fecha And x.FechaCierre.HasValue = False)
|
||||||
If ej Is Nothing Then
|
If ej Is Nothing Then
|
||||||
hte.Add("Almacenar-EjercicioNoAbiertooCerrado", "El ejercicio según la fecha del asiento no se ha abierto o ya se cerró")
|
hte.Add("Almacenar-EjercicioNoAbiertooCerrado", "El ejercicio según la fecha del asiento no se ha abierto o ya se cerró")
|
||||||
End If
|
End If
|
||||||
If Estado = EstadosAplicacion.Nuevo Then
|
If Estado = EstadosAplicacion.Nuevo Then
|
||||||
ra.FechaIntroduccion = tsl5.bbdd.AhoraSqlServer(bd)
|
ra.FechaIntroduccion = DateOnly.FromDateTime(Now)
|
||||||
ra.idUsuario = idUsuario
|
ra.idUsuario = idUsuario
|
||||||
End If
|
End If
|
||||||
If hte.Count > 0 Then
|
If hte.Count > 0 Then
|
||||||
@@ -190,8 +183,7 @@ Public Class ucDiario
|
|||||||
Select Case pts.NombreCampo.ToLower
|
Select Case pts.NombreCampo.ToLower
|
||||||
Case "fecha"
|
Case "fecha"
|
||||||
|
|
||||||
Dim NuevaFecha As DateOnly = e.Value
|
Dim NuevaFecha As DateOnly = DateOnly.FromDateTime(e.Value)
|
||||||
NuevaFecha = NuevaFecha.Date
|
|
||||||
If NuevaFecha <> ra.Fecha Then
|
If NuevaFecha <> ra.Fecha Then
|
||||||
Dim Ejercicios = bd.ejercicioscontables.ToList
|
Dim Ejercicios = bd.ejercicioscontables.ToList
|
||||||
Dim EjercicioNuevo = Ejercicios.FirstOrDefault(Function(x) x.FechaInicio <= NuevaFecha And x.FechaFin >= NuevaFecha And x.FechaCierre Is Nothing)
|
Dim EjercicioNuevo = Ejercicios.FirstOrDefault(Function(x) x.FechaInicio <= NuevaFecha And x.FechaFin >= NuevaFecha And x.FechaCierre Is Nothing)
|
||||||
@@ -426,13 +418,13 @@ Public Class ucDiario
|
|||||||
Case TiposDocumentos.RECIBO
|
Case TiposDocumentos.RECIBO
|
||||||
Dim rec = bd.movimientoscaja.FirstOrDefault(Function(x) x.idMovimiento = ap.idAplicacion)
|
Dim rec = bd.movimientoscaja.FirstOrDefault(Function(x) x.idMovimiento = ap.idAplicacion)
|
||||||
If rec IsNot Nothing Then
|
If rec IsNot Nothing Then
|
||||||
Dim uc As New ucMovimientoCaja(rec.idRecibo)
|
Dim uc As New ucMovimientoCaja(rec.idMovimiento)
|
||||||
FuncionesDinamicas.AbrirAP(uc)
|
FuncionesDinamicas.AbrirAP(uc, "")
|
||||||
Else
|
Else
|
||||||
DXMessageBox.Show("El recibo no se encuentra", "Atención")
|
DXMessageBox.Show("El Movimiento no se encuentra", "Atención")
|
||||||
End If
|
End If
|
||||||
Case Else
|
Case Else
|
||||||
DXMessageBox.Show("Tipo de documento no disponible", "Atención")
|
DXMessageBox.Show("Tipo Movimiento no disponible", "Atención")
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -560,9 +552,21 @@ Public Class ucDiario
|
|||||||
|
|
||||||
Private Sub ucDiario_ErrorGuardando(sender As Object, ex As Exception, OpcionGuardado As Integer) Handles Me.ErrorGuardando
|
Private Sub ucDiario_ErrorGuardando(sender As Object, ex As Exception, OpcionGuardado As Integer) Handles Me.ErrorGuardando
|
||||||
Try
|
Try
|
||||||
Dim ea = bd.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added)
|
|
||||||
Dim ee = bd.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Deleted)
|
' //IEnumerable<Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry> res = from e in this.ChangeTracker.Entries()
|
||||||
Dim em = bd.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Modified)
|
'// where e.State.HasFlag(Microsoft.EntityFrameworkCore.EntityState.Added) ||
|
||||||
|
'// e.State.HasFlag(Microsoft.EntityFrameworkCore.EntityState.Modified) ||
|
||||||
|
'// e.State.HasFlag(Microsoft.EntityFrameworkCore.EntityState.Deleted)
|
||||||
|
'// select e;
|
||||||
|
|
||||||
|
'//if (res.Any())
|
||||||
|
'// return true;
|
||||||
|
'//return false;
|
||||||
|
|
||||||
|
Dim ea = bd.ChangeTracker.Entries.Where(Function(x) x.State.HasFlag(EntityState.Added))
|
||||||
|
Dim ee = bd.ChangeTracker.Entries.Where(Function(x) x.State.HasFlag(EntityState.Deleted))
|
||||||
|
Dim em = bd.ChangeTracker.Entries.Where(Function(x) x.State.HasFlag(EntityState.Modified))
|
||||||
|
|
||||||
Dim sMensaje As String = "Entidades Añadidas: " & ea.Count.ToString
|
Dim sMensaje As String = "Entidades Añadidas: " & ea.Count.ToString
|
||||||
For Each ent In ea
|
For Each ent In ea
|
||||||
Select Case ent.Entity.GetType
|
Select Case ent.Entity.GetType
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ Imports bdGrupoSanchoToro
|
|||||||
Imports DevExpress.Xpf.Grid
|
Imports DevExpress.Xpf.Grid
|
||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Linq.Dynamic
|
Imports System.Linq.Dynamic
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPF
|
Imports tsWPF
|
||||||
Imports tsWPF.Comun
|
Imports tsWPF.Comun
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
Imports tsWPFCore
|
Imports tsWPFCore
|
||||||
Imports tsUtilidades
|
Imports tsUtilidades
|
||||||
Imports bdGrupoSanchoToro
|
|
||||||
Imports bdGrupoSanchoToro.db
|
Imports bdGrupoSanchoToro.db
|
||||||
Imports bdGrupoSanchoToro.db.Utilidades
|
Imports bdGrupoSanchoToro.db.Utilidades
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ Public Class ucDiarios
|
|||||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Public Function ObtieneAsientos(BackGround As Boolean, TextoBusqueda As String, FechaInicio As Date, FechaFin As Date) As List(Of asientos)
|
Public Function ObtieneAsientos(BackGround As Boolean, TextoBusqueda As String, FechaInicio As DateOnly, FechaFin As DateOnly) As List(Of asientos)
|
||||||
Dim rs As New List(Of asientos)
|
Dim rs As New List(Of asientos)
|
||||||
Dim parametros(0) As Object
|
Dim parametros(0) As Object
|
||||||
Dim iNumExc As Integer = 0
|
Dim iNumExc As Integer = 0
|
||||||
@@ -120,10 +120,10 @@ Public Class ucDiarios
|
|||||||
'End If
|
'End If
|
||||||
Dim Calfap() As String = {"NumeroDocumento", "Concepto"}
|
Dim Calfap() As String = {"NumeroDocumento", "Concepto"}
|
||||||
Dim Cnumap() As String = {"idAsiento", "Debe", "Haber"}
|
Dim Cnumap() As String = {"idAsiento", "Debe", "Haber"}
|
||||||
Dim ExpBusAsi As String = tsWPF.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Cnumap, Calfap, Nothing)
|
Dim ExpBusAsi As String = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Cnumap, Calfap, Nothing)
|
||||||
Dim lap = bd.apuntes.Where(ExpBusAsi, parametros).Select(Function(x) x.asientos).Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
|
Dim lap = bd.apuntes.Where(ExpBusAsi, parametros).Select(Function(x) x.idAsientoNavigation).Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
|
||||||
Dim ctas = TextoBusqueda.Split(" ").Where(Function(x) x.Length = bdGrupoSanchoToro.db.cuentas.LongitudCuentaFinal).ToArray
|
Dim ctas = TextoBusqueda.Split(" ").Where(Function(x) x.Length = bdGrupoSanchoToro.db.cuentas.LongitudCuentaFinal).ToArray
|
||||||
Dim lap2 = bd.apuntes.Where(Function(x) ctas.Contains(x.cuentas.NumeroCuenta)).Select(Function(x) x.asientos).Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
|
Dim lap2 = bd.apuntes.Where(Function(x) ctas.Contains(x.idCuentaNavigation.NumeroCuenta)).Select(Function(x) x.idAsientoNavigation).Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
|
||||||
rs = lap.Union(lap2).OrderBy(Function(x) x.Fecha).ThenBy(Function(x) x.Fecha).ToList
|
rs = lap.Union(lap2).OrderBy(Function(x) x.Fecha).ThenBy(Function(x) x.Fecha).ToList
|
||||||
Else
|
Else
|
||||||
rs = bd.asientos.Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
|
rs = bd.asientos.Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
|
||||||
@@ -145,7 +145,7 @@ Public Class ucDiarios
|
|||||||
|
|
||||||
|
|
||||||
Dim rs As New List(Of asientos)
|
Dim rs As New List(Of asientos)
|
||||||
Dim fi, ff As Date?
|
Dim fi, ff As DateOnly?
|
||||||
Dim Busqueda As String
|
Dim Busqueda As String
|
||||||
|
|
||||||
Busqueda = Me.teBusqueda.Text.Trim
|
Busqueda = Me.teBusqueda.Text.Trim
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ Public Class ucEjercicioContable
|
|||||||
|
|
||||||
If FuerzaNuevo OrElse _idEjercicio Is Nothing Then
|
If FuerzaNuevo OrElse _idEjercicio Is Nothing Then
|
||||||
ra = New bdGrupoSanchoToro.db.ejercicioscontables
|
ra = New bdGrupoSanchoToro.db.ejercicioscontables
|
||||||
ra.FechaApertura = Now.Date
|
ra.FechaApertura = DateOnly.FromDateTime(Now)
|
||||||
Dim Anno As Integer = Now.Year
|
Dim Anno As Integer = Now.Year
|
||||||
If Now.Month > 1 Then Anno += 1
|
If Now.Month > 1 Then Anno += 1
|
||||||
ra.Descripcion = Anno.ToString
|
ra.Descripcion = Anno.ToString
|
||||||
ra.FechaInicio = New Date(Anno, 1, 1)
|
ra.FechaInicio = New DateOnly(Anno, 1, 1)
|
||||||
ra.FechaFin = New Date(Anno, 12, 31)
|
ra.FechaFin = New DateOnly(Anno, 12, 31)
|
||||||
ra.idEmpresa = bd.empresas.First(Function(x) x.FechaBaja.HasValue = False).idEmpresa
|
ra.idEmpresa = bd.empresas.First(Function(x) x.FechaBaja.HasValue = False).idEmpresa
|
||||||
Me.DataContext = ra
|
Me.DataContext = ra
|
||||||
_idEjercicio = Nothing
|
_idEjercicio = Nothing
|
||||||
@@ -157,7 +157,7 @@ Public Class ucEjercicioContable
|
|||||||
If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
||||||
DXSplashScreen.SetState("Obteniendo cuentas ...")
|
DXSplashScreen.SetState("Obteniendo cuentas ...")
|
||||||
Dim Nivel As Integer = cbNivel.EditValue
|
Dim Nivel As Integer = cbNivel.EditValue
|
||||||
Dim ctas = bdGrupoSanchoToro.db.vf_cuentas.Obtiene_vf_cuentas(bd, ra.ideje, Nivel)
|
Dim ctas = bdGrupoSanchoToro.db.vf_cuentas.Obtiene_vf_cuentas(bd, ra.idEjercicio, Nivel)
|
||||||
gcCuentas.ItemsSource = ctas
|
gcCuentas.ItemsSource = ctas
|
||||||
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -435,7 +435,7 @@ Public Class ucEjercicioContable
|
|||||||
Dim ctaea = bd.cuentas.First(Function(x) x.idCuenta = cta.idCuenta)
|
Dim ctaea = bd.cuentas.First(Function(x) x.idCuenta = cta.idCuenta)
|
||||||
CopiaCuenta(bd, ejnue, ctaea, ctne)
|
CopiaCuenta(bd, ejnue, ctaea, ctne)
|
||||||
End If
|
End If
|
||||||
.cuentas = ctne
|
.idCuentaNavigation = ctne
|
||||||
'.idCuenta = ejnue.cuentas.First(Function(x) x.NumeroCuenta = cta.NumeroCuenta).idCuenta
|
'.idCuenta = ejnue.cuentas.First(Function(x) x.NumeroCuenta = cta.NumeroCuenta).idCuenta
|
||||||
'.Fecha = ejnue.FechaInicio
|
'.Fecha = ejnue.FechaInicio
|
||||||
.Concepto = "ASIENTO APERTURA"
|
.Concepto = "ASIENTO APERTURA"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</tsWPFCore:tsGridControl.PropiedadesTS>
|
</tsWPFCore:tsGridControl.PropiedadesTS>
|
||||||
<dxg:GridControl.Columns>
|
<dxg:GridControl.Columns>
|
||||||
<dxg:GridColumn FieldName="Descripcion" Header="Ejercicio" Width="150" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
<dxg:GridColumn FieldName="Descripcion" Header="Ejercicio" Width="150" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||||
<dxg:GridColumn FieldName="empresascontables.RazonSocial" Width="350" IsSmart="True" Header="Empresa" />
|
<dxg:GridColumn FieldName="empresas.RazonSocial" Width="350" IsSmart="True" Header="Empresa" />
|
||||||
<dxg:GridColumn FieldName="FechaInicio" Width="90" IsSmart="True">
|
<dxg:GridColumn FieldName="FechaInicio" Width="90" IsSmart="True">
|
||||||
<dxg:GridColumn.EditSettings>
|
<dxg:GridColumn.EditSettings>
|
||||||
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
|
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ Public Class ucEjerciciosContables
|
|||||||
Return bd
|
Return bd
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'Public Overrides Function ObtieneConexionBD() As tsl5.Datos.BBDD
|
'Public Overrides Function ObtieneConexionBD() As tsUtilidades.Datos.BBDD
|
||||||
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
|
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
|
||||||
'End Function
|
'End Function
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Imports tsWPF.modExtensiones
|
|||||||
Imports System.Data.Common
|
Imports System.Data.Common
|
||||||
Imports System.Data.Entity
|
Imports System.Data.Entity
|
||||||
Imports bdGrupoSanchoToro
|
Imports bdGrupoSanchoToro
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports DevExpress.Xpf.Grid
|
Imports DevExpress.Xpf.Grid
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
@@ -47,7 +47,7 @@ Public Class ucInformeContables
|
|||||||
'ra.Descripcion = Now.Year.ToString
|
'ra.Descripcion = Now.Year.ToString
|
||||||
'ra.FechaInicio = New Date(Now.Year, 1, 1)
|
'ra.FechaInicio = New Date(Now.Year, 1, 1)
|
||||||
'ra.FechaFin = New Date(Now.Year, 12, 31)
|
'ra.FechaFin = New Date(Now.Year, 12, 31)
|
||||||
'ra.idEmpresa = bd.empresascontables.First(Function(x) x.FechaBaja.HasValue = False).idEmpresaContable
|
'ra.idEmpresa = bd.empresas.First(Function(x) x.FechaBaja.HasValue = False).idEmpresaContable
|
||||||
Me.DataContext = ra
|
Me.DataContext = ra
|
||||||
_idInforme = Nothing
|
_idInforme = Nothing
|
||||||
' ra.idEjercicio = Nothing
|
' ra.idEjercicio = Nothing
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ Imports tsWPF.Comun
|
|||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
Imports tsWPFCore
|
Imports tsWPFCore
|
||||||
Imports tsUtilidades
|
Imports tsUtilidades
|
||||||
Imports bdGrupoSanchoToro
|
|
||||||
Imports bdGrupoSanchoToro.db
|
Imports bdGrupoSanchoToro.db
|
||||||
Imports bdGrupoSanchoToro.db.Utilidades
|
Imports bdGrupoSanchoToro.db.Utilidades
|
||||||
|
|
||||||
@@ -75,7 +74,7 @@ Public Class ucInformesContables
|
|||||||
Return bd
|
Return bd
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'Public Overrides Function ObtieneConexionBD() As tsl5.Datos.BBDD
|
'Public Overrides Function ObtieneConexionBD() As tsUtilidades.Datos.BBDD
|
||||||
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
|
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
|
||||||
'End Function
|
'End Function
|
||||||
|
|
||||||
@@ -123,20 +122,20 @@ Public Class ucInformesContables
|
|||||||
End If
|
End If
|
||||||
i += 1
|
i += 1
|
||||||
Loop Until bd.informescontables.Any(Function(x) x.Descripcion = sDesc Or x.Codigo = sCod) = False
|
Loop Until bd.informescontables.Any(Function(x) x.Descripcion = sDesc Or x.Codigo = sCod) = False
|
||||||
Dim fi As New ficheros
|
Dim fi As New bdGrupoSanchoToro.db.ficheros
|
||||||
With fi
|
With fi
|
||||||
.Descripcion = ra.ficheros.Descripcion
|
.Descripcion = ra.idFicheroNavigation.Descripcion
|
||||||
.Fecha = ra.ficheros.Fecha
|
.Fecha = ra.idFicheroNavigation.Fecha
|
||||||
.idAplicacion = ra.ficheros.idAplicacion
|
.idAplicacion = ra.idFicheroNavigation.idAplicacion
|
||||||
.idTipo = ra.ficheros.idTipo
|
.idTipo = ra.idFicheroNavigation.idTipo
|
||||||
.Observaciones = ra.ficheros.Observaciones
|
.Observaciones = ra.idFicheroNavigation.Observaciones
|
||||||
.Fichero = ra.ficheros.Fichero
|
.Fichero = ra.idFicheroNavigation.Fichero
|
||||||
.NombreFichero = ra.ficheros.NombreFichero
|
.NombreFichero = ra.idFicheroNavigation.NombreFichero
|
||||||
End With
|
End With
|
||||||
With ni
|
With ni
|
||||||
.Codigo = sCod
|
.Codigo = sCod
|
||||||
.Descripcion = sDesc
|
.Descripcion = sDesc
|
||||||
.ficheros = fi
|
.idFicheroNavigation = fi
|
||||||
End With
|
End With
|
||||||
For Each c In ra.celdasinformescontables
|
For Each c In ra.celdasinformescontables
|
||||||
Dim nc As New celdasinformescontables
|
Dim nc As New celdasinformescontables
|
||||||
@@ -149,7 +148,7 @@ Public Class ucInformesContables
|
|||||||
End With
|
End With
|
||||||
ni.celdasinformescontables.Add(nc)
|
ni.celdasinformescontables.Add(nc)
|
||||||
Next
|
Next
|
||||||
bd.informescontables.AddObject(ni)
|
bd.informescontables.Add(ni)
|
||||||
bd.SaveChanges()
|
bd.SaveChanges()
|
||||||
Me.RefrescaUC()
|
Me.RefrescaUC()
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -7,13 +7,12 @@ Imports DevExpress.Xpf.Grid
|
|||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
Imports System.Linq.Dynamic
|
Imports System.Linq.Dynamic
|
||||||
Imports DevExpress.Xpf.Bars
|
Imports DevExpress.Xpf.Bars
|
||||||
Imports tsl5.Datos
|
Imports tsUtilidades.Datos
|
||||||
Imports tsWPF
|
Imports tsWPF
|
||||||
Imports tsWPF.Comun
|
Imports tsWPF.Comun
|
||||||
Imports tsWPFCore.Comun
|
Imports tsWPFCore.Comun
|
||||||
Imports tsWPFCore
|
Imports tsWPFCore
|
||||||
Imports tsUtilidades
|
Imports tsUtilidades
|
||||||
Imports bdGrupoSanchoToro
|
|
||||||
Imports bdGrupoSanchoToro.db
|
Imports bdGrupoSanchoToro.db
|
||||||
Imports bdGrupoSanchoToro.db.Utilidades
|
Imports bdGrupoSanchoToro.db.Utilidades
|
||||||
|
|
||||||
@@ -88,7 +87,7 @@ Public Class ucListadoDiario
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function ObtieneApuntes(TextoBusqueda As String, FechaInicio As Date, FechaFin As Date) As List(Of apuntes)
|
Public Function ObtieneApuntes(TextoBusqueda As String, FechaInicio As DateOnly, FechaFin As DateOnly) As List(Of apuntes)
|
||||||
Dim rs As List(Of apuntes)
|
Dim rs As List(Of apuntes)
|
||||||
Dim parametros(0) As Object
|
Dim parametros(0) As Object
|
||||||
Dim iNumExc As Integer = 0
|
Dim iNumExc As Integer = 0
|
||||||
@@ -99,12 +98,12 @@ Public Class ucListadoDiario
|
|||||||
Dim Calfc() As String = {"cuentas.NumeroCuenta"}
|
Dim Calfc() As String = {"cuentas.NumeroCuenta"}
|
||||||
Dim ExpBus As String = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Nothing, Calf, Nothing, Calfc)
|
Dim ExpBus As String = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Nothing, Calf, Nothing, Calfc)
|
||||||
If ExpBus = "" Then
|
If ExpBus = "" Then
|
||||||
rs = bd.apuntes.Include(Function(x) x.asientos).Include(Function(x) x.cuentas).Where(Function(x) x.asientos.Fecha >= FechaInicio And x.asientos.Fecha <= FechaFin).OrderBy(Function(x) x.asientos.Fecha).ThenBy(Function(x) x.idAsiento).ThenBy(Function(x) x.idApunte).ToList
|
rs = bd.apuntes.Include(Function(x) x.idAsientoNavigation).Include(Function(x) x.idCuentaNavigation).Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicio And x.idAsientoNavigation.Fecha <= FechaFin).OrderBy(Function(x) x.idAsientoNavigation.Fecha).ThenBy(Function(x) x.idAsientoNavigation).ThenBy(Function(x) x.idApunte).ToList
|
||||||
Else
|
Else
|
||||||
rs = bd.apuntes.Include(Function(x) x.asientos).Include(Function(x) x.cuentas).Where(ExpBus, parametros).Where(Function(x) x.asientos.Fecha >= FechaInicio And x.asientos.Fecha <= FechaFin).OrderBy(Function(x) x.asientos.Fecha).ThenBy(Function(x) x.idAsiento).ThenBy(Function(x) x.idApunte).ToList
|
rs = bd.apuntes.Include(Function(x) x.idAsientoNavigation).Include(Function(x) x.idCuentaNavigation).Where(ExpBus, parametros).Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicio And x.idAsientoNavigation.Fecha <= FechaFin).OrderBy(Function(x) x.idAsientoNavigation.Fecha).ThenBy(Function(x) x.idAsiento).ThenBy(Function(x) x.idApunte).ToList
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
rs = bd.apuntes.Include(Function(x) x.asientos).Include(Function(x) x.cuentas).Where(Function(x) x.asientos.Fecha >= FechaInicio And x.asientos.Fecha <= FechaFin).OrderBy(Function(x) x.asientos.Fecha).ThenBy(Function(x) x.idAsiento).ThenBy(Function(x) x.idApunte).ToList
|
rs = bd.apuntes.Include(Function(x) x.idAsientoNavigation).Include(Function(x) x.idCuentaNavigation).Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicio And x.idAsientoNavigation.Fecha <= FechaFin).OrderBy(Function(x) x.idAsientoNavigation.Fecha).ThenBy(Function(x) x.idAsiento).ThenBy(Function(x) x.idApunte).ToList
|
||||||
End If
|
End If
|
||||||
Exit Do
|
Exit Do
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -121,7 +120,7 @@ Public Class ucListadoDiario
|
|||||||
Try
|
Try
|
||||||
|
|
||||||
Dim rs As New List(Of apuntes)
|
Dim rs As New List(Of apuntes)
|
||||||
Dim fi, ff As Date?
|
Dim fi, ff As DateOnly?
|
||||||
Dim Busqueda As String
|
Dim Busqueda As String
|
||||||
|
|
||||||
Busqueda = Me.teBusqueda.Text.Trim
|
Busqueda = Me.teBusqueda.Text.Trim
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
|
|
||||||
|
Imports System.ComponentModel
|
||||||
|
Imports System.Drawing.Printing
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports bdGrupoSanchoToro
|
Imports bdGrupoSanchoToro
|
||||||
Imports bdGrupoSanchoToro.db
|
Imports bdGrupoSanchoToro.db
|
||||||
Imports DevExpress.Xpf.Core
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
Imports DevExpress.Xpf.Printing
|
||||||
Imports DevExpress.XtraPrinting
|
Imports DevExpress.XtraPrinting
|
||||||
Imports DevExpress.XtraReports.UI
|
Imports DevExpress.XtraReports.UI
|
||||||
Imports tsEFCore8.Extensiones
|
|
||||||
Imports Microsoft.EntityFrameworkCore
|
Imports Microsoft.EntityFrameworkCore
|
||||||
Imports System.Drawing.Printing
|
Imports tsEFCore8.Extensiones
|
||||||
Imports System.ComponentModel
|
|
||||||
Imports DevExpress.Xpf.Printing
|
|
||||||
Public Class Informes
|
Public Class Informes
|
||||||
Private Shared NumeroCopias As Integer
|
Private Shared NumeroCopias As Integer
|
||||||
|
|
||||||
@@ -132,5 +133,41 @@ Public Class Informes
|
|||||||
xr.ExportToPdf(st)
|
xr.ExportToPdf(st)
|
||||||
Return st.ToArray
|
Return st.ToArray
|
||||||
End Function
|
End Function
|
||||||
|
Friend Shared Sub MuestraImpresos(bd As tscGrupoSanchoToro, idPlantilla As Integer, Datasource As Object, GrupoDocumentos As DocumentGroup, dc As DockController)
|
||||||
|
Try
|
||||||
|
|
||||||
|
If idPlantilla = 0 Then Throw New Exception("Seleccione primero la plantilla a imprimir")
|
||||||
|
Dim xr As New XtraReport
|
||||||
|
|
||||||
|
Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.idPlantilla = idPlantilla).First
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(pl.idFicheroNavigation.Fichero)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
xr = XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
End Using
|
||||||
|
Try
|
||||||
|
Dim pr As DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").First
|
||||||
|
pr.Value = Now
|
||||||
|
pr.Visible = False
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
End Try
|
||||||
|
xr.DataSource = Datasource
|
||||||
|
|
||||||
|
Dim docpanel As New DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
docpanel.Caption = pl.Descripcion
|
||||||
|
|
||||||
|
Dim vi As New tsWPFCore.ucVisualizadorInformes()
|
||||||
|
vi.Visualizador.DocumentSource = xr
|
||||||
|
xr.CreateDocument(True)
|
||||||
|
|
||||||
|
docpanel.Content = vi
|
||||||
|
docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||||
|
GrupoDocumentos.Items.Add(docpanel)
|
||||||
|
dc.Activate(docpanel)
|
||||||
|
Catch ex As Exception
|
||||||
|
DXMessageBox.Show(ex.Message, "Atención", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace ServicioGrupoSanchoToro
|
|||||||
List<AlternateView> avs = new List<AlternateView>();
|
List<AlternateView> avs = new List<AlternateView>();
|
||||||
avs.Add(avHtml);
|
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);
|
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)
|
// tsUtilidades.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;
|
email.FechaEnvio = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ namespace bdGrupoSanchoToro
|
|||||||
// las.Add("System.Data.Entity.dll");
|
// las.Add("System.Data.Entity.dll");
|
||||||
// las.Add("dll");
|
// las.Add("dll");
|
||||||
// las.Add("tsWPF.dll");
|
// las.Add("tsWPF.dll");
|
||||||
// las.Add("tsl5.dll");
|
// las.Add("tsUtilidades.dll");
|
||||||
// var lp = new List<string>();
|
// var lp = new List<string>();
|
||||||
// lp.Add("bd As tscGrupoSanchoToro");
|
// lp.Add("bd As tscGrupoSanchoToro");
|
||||||
// // For Each p In parametros
|
// // For Each p In parametros
|
||||||
|
|||||||
@@ -1078,14 +1078,14 @@ public partial class GrupoSanchoToroContext : DbContext
|
|||||||
|
|
||||||
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
||||||
|
|
||||||
entity.HasIndex(e => e.idEmpresa, "ejercicioscontables_empresascontables_idx");
|
entity.HasIndex(e => e.idEmpresa, "ejercicioscontables_empresas_idx");
|
||||||
|
|
||||||
entity.Property(e => e.Descripcion).HasMaxLength(40);
|
entity.Property(e => e.Descripcion).HasMaxLength(40);
|
||||||
entity.Property(e => e.NivelesCuentas).HasMaxLength(20);
|
entity.Property(e => e.NivelesCuentas).HasMaxLength(20);
|
||||||
|
|
||||||
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.ejercicioscontables)
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.ejercicioscontables)
|
||||||
.HasForeignKey(d => d.idEmpresa)
|
.HasForeignKey(d => d.idEmpresa)
|
||||||
.HasConstraintName("ejercicioscontables_empresascontables");
|
.HasConstraintName("ejercicioscontables_empresas");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<empresas>(entity =>
|
modelBuilder.Entity<empresas>(entity =>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
using System;
|
using Microsoft.VisualBasic.CompilerServices;
|
||||||
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
|
|
||||||
namespace bdGrupoSanchoToro.db
|
namespace bdGrupoSanchoToro.db
|
||||||
{
|
{
|
||||||
@@ -100,6 +101,7 @@ namespace bdGrupoSanchoToro.db
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[NotMapped]
|
||||||
public conciliacionesbancarias ConciliacionActual_TMP { get; set; }
|
public conciliacionesbancarias ConciliacionActual_TMP { get; set; }
|
||||||
public double Saldo
|
public double Saldo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,6 +87,26 @@ namespace bdGrupoSanchoToro.db
|
|||||||
}
|
}
|
||||||
return cuenta;
|
return cuenta;
|
||||||
}
|
}
|
||||||
|
public bool Punteado
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return FechaPunteo.HasValue;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
FechaPunteo = DateTime.Now;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FechaPunteo=null;
|
||||||
|
}
|
||||||
|
OnPropertyChanged("Punteado");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string _Ejercicio;
|
private string _Ejercicio;
|
||||||
public string EjercicioTmp
|
public string EjercicioTmp
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
using System;
|
using Microsoft.VisualBasic.CompilerServices;
|
||||||
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Microsoft.VisualBasic.CompilerServices;
|
|
||||||
using tsUtilidades.Extensiones;
|
using tsUtilidades.Extensiones;
|
||||||
|
|
||||||
namespace bdGrupoSanchoToro.db
|
namespace bdGrupoSanchoToro.db
|
||||||
@@ -17,6 +18,7 @@ namespace bdGrupoSanchoToro.db
|
|||||||
}
|
}
|
||||||
public const string CUENTA_PERDIDAS_Y_GANANCIAS = "12900000";
|
public const string CUENTA_PERDIDAS_Y_GANANCIAS = "12900000";
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
public List<apuntes> ApuntesTemporales { get; set; }
|
public List<apuntes> ApuntesTemporales { get; set; }
|
||||||
public string Descripcion
|
public string Descripcion
|
||||||
{
|
{
|
||||||
|
|||||||
167
bdGrupoSanchoToro/extensiones/ejercicioscontables.cs
Normal file
167
bdGrupoSanchoToro/extensiones/ejercicioscontables.cs
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
using bdGrupoSanchoToro;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using tsUtilidades.Extensiones;
|
||||||
|
|
||||||
|
namespace bdGrupoSanchoToro.db
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class ejercicioscontables
|
||||||
|
{
|
||||||
|
public static int ObtieneidEjercicioAbierto(DateOnly Fecha)
|
||||||
|
{
|
||||||
|
var bd = tscGrupoSanchoToro.NuevoContexto();
|
||||||
|
var ej = bd.ejercicioscontables.FirstOrDefault(x => x.FechaInicio <= Fecha & x.FechaFin >= Fecha & x.FechaCierre.HasValue == false);
|
||||||
|
if (ej is null)
|
||||||
|
{
|
||||||
|
ej = bd.ejercicioscontables.FirstOrDefault(x => x.FechaInicio <= Fecha & x.FechaFin >= Fecha & x.FechaCierre.HasValue);
|
||||||
|
if (ej is null)
|
||||||
|
{
|
||||||
|
if (DateOnly.FromDateTime(DateTime.Today).DayNumber - Fecha.DayNumber > 365d || Fecha.DayNumber - DateOnly.FromDateTime(DateTime.Today).DayNumber > 60d)
|
||||||
|
{
|
||||||
|
throw new Exception("La fecha del ejercicio " + Fecha.ToShortDateString() + " parece incorrecta");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ej = ejercicioscontables.AbreEjercicio(bd, Fecha);
|
||||||
|
return ej.idEjercicio;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("El ejercicio está cerrado");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ej.idEjercicio;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string DescripcionExtendida
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.FechaInicio.Month == 1 & this.FechaInicio.Day == 1 & this.FechaFin.Month == 12 & this.FechaFin.Day == 31)
|
||||||
|
{
|
||||||
|
return this.idEmpresaNavigation.RazonSocial + " " + this.FechaInicio.Year.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.idEmpresaNavigation.RazonSocial + " " + this.FechaInicio.ToString() + " " + this.FechaFin.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bdGrupoSanchoToro.db.asientos AsientoApertura
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.asientos.FirstOrDefault(x => x.Tipo == (int)bdGrupoSanchoToro.db.asientos.TipoAsiento.APERTURA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bdGrupoSanchoToro.db.asientos AsientoRegularizacion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.asientos.FirstOrDefault(x => x.Tipo == (int)bdGrupoSanchoToro.db.asientos.TipoAsiento.REGULARIZACION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private _CuentasPlanContable As List(Of cuentasplancontable)
|
||||||
|
// Public ReadOnly Property CuentasPlanContable As List(Of cuentasplancontable)
|
||||||
|
// Get
|
||||||
|
// If _CuentasPlanContable Is Nothing Then
|
||||||
|
// _CuentasPlanContable = Me.plancontable.gruposplancontable.SelectMany(Function(x) x.cuentasplancontable).ToList
|
||||||
|
// End If
|
||||||
|
// Return _CuentasPlanContable
|
||||||
|
// End Get
|
||||||
|
// End Property
|
||||||
|
|
||||||
|
public void CopiaCuentas()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
|
||||||
|
var ea = bd.ejercicioscontables.OrderByDescending(x => x.FechaInicio).FirstOrDefault(x => x.FechaInicio < this.FechaInicio);
|
||||||
|
if (ea is not null)
|
||||||
|
{
|
||||||
|
var ctas1 = ea.cuentas.Where(x => x.NumeroCuenta.Length == 1).ToList();
|
||||||
|
var ctas2 = ea.cuentas.Where(x => x.NumeroCuenta.Length == 2).ToList();
|
||||||
|
var ctas3 = ea.cuentas.Where(x => x.NumeroCuenta.Length == 3).ToList();
|
||||||
|
var ctas4 = ea.cuentas.Where(x => x.NumeroCuenta.Length == 4).ToList();
|
||||||
|
var ctas8 = ea.cuentas.Where(x => x.NumeroCuenta.Length == 8).ToList();
|
||||||
|
int Nc = 0;
|
||||||
|
foreach (var cta in ctas1)
|
||||||
|
Nc += this.CopiaCuenta(bd, this, cta);
|
||||||
|
foreach (var cta in ctas2)
|
||||||
|
Nc += this.CopiaCuenta(bd, this, cta);
|
||||||
|
foreach (var cta in ctas3)
|
||||||
|
Nc += this.CopiaCuenta(bd, this, cta);
|
||||||
|
foreach (var cta in ctas4)
|
||||||
|
Nc += this.CopiaCuenta(bd, this, cta);
|
||||||
|
foreach (var cta in ctas8)
|
||||||
|
Nc += this.CopiaCuenta(bd, this, cta);
|
||||||
|
bd.SaveChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private int CopiaCuenta(tscGrupoSanchoToro bd, ejercicioscontables Ejercicio, bdGrupoSanchoToro.db.cuentas CtaAnterior)
|
||||||
|
{
|
||||||
|
if (!Ejercicio.cuentas.Any(X => (X.NumeroCuenta ?? "") == (CtaAnterior.NumeroCuenta ?? "")))
|
||||||
|
{
|
||||||
|
var nc = new bdGrupoSanchoToro.db.cuentas();
|
||||||
|
nc.Denominacion = CtaAnterior.Denominacion;
|
||||||
|
nc.EsCuentaFinal = CtaAnterior.EsCuentaFinal;
|
||||||
|
nc.Mote = CtaAnterior.Mote;
|
||||||
|
nc.Observaciones = CtaAnterior.Observaciones;
|
||||||
|
nc.NumeroCuenta = CtaAnterior.NumeroCuenta;
|
||||||
|
nc.idEjercicio = Ejercicio.idEjercicio;
|
||||||
|
nc.idEmpresaAmortizacion = CtaAnterior.idEmpresaAmortizacion;
|
||||||
|
nc.PresupuestoEnero = CtaAnterior.PresupuestoEnero;
|
||||||
|
nc.PresupuestoFebrero = CtaAnterior.PresupuestoFebrero;
|
||||||
|
nc.PresupuestoMarzo = CtaAnterior.PresupuestoMarzo;
|
||||||
|
nc.PresupuestoAbril = CtaAnterior.PresupuestoAbril;
|
||||||
|
nc.PresupuestoMayo = CtaAnterior.PresupuestoMayo;
|
||||||
|
nc.PresupuestoJunio = CtaAnterior.PresupuestoJunio;
|
||||||
|
nc.PresupuestoJulio = CtaAnterior.PresupuestoJulio;
|
||||||
|
nc.PresupuestoAgosto = CtaAnterior.PresupuestoAgosto;
|
||||||
|
nc.PresupuestoSeptiembre = CtaAnterior.PresupuestoSeptiembre;
|
||||||
|
nc.PresupuestoOctubre = CtaAnterior.PresupuestoOctubre;
|
||||||
|
nc.PresupuestoNoviembre = CtaAnterior.PresupuestoNoviembre;
|
||||||
|
nc.PresupuestoDiciembre = CtaAnterior.PresupuestoDiciembre;
|
||||||
|
bd.cuentas.Add(nc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ejercicioscontables AbreEjercicio(tscGrupoSanchoToro bd, DateOnly Fecha)
|
||||||
|
{
|
||||||
|
var ej = new ejercicioscontables();
|
||||||
|
ej.FechaApertura = DateOnly.FromDateTime(DateTime.Now);
|
||||||
|
ej.FechaInicio = DateOnly.FromDateTime(new DateTime(Fecha.Year, 1, 1));
|
||||||
|
ej.FechaFin = DateOnly.FromDateTime( new DateTime(Fecha.Year, 12, 31));
|
||||||
|
ej.Descripcion = Fecha.Year.ToString();
|
||||||
|
bd.ejercicioscontables.Add(ej);
|
||||||
|
bd.SaveChanges();
|
||||||
|
ej.CopiaCuentas();
|
||||||
|
return ej;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool CompruebaEjereciciosAbiertos(tscGrupoSanchoToro bd, List<DateOnly> Fechas)
|
||||||
|
{
|
||||||
|
var ejeabiertos = bd.ejercicioscontables.Where(x => x.FechaCierre.HasValue == false).ToList();
|
||||||
|
return Fechas.All(x => ejeabiertos.Any(y => y.FechaInicio <= x & y.FechaFin >= x));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user