2026-01-30-v2

This commit is contained in:
2026-01-30 11:10:56 +01:00
parent 12039e9ae4
commit 6034845e65
46 changed files with 9717 additions and 356 deletions

View File

@@ -0,0 +1,56 @@
<dx:DXWindow x:Class="dxwAsientosModelo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione" WindowStyle="ToolWindow" WindowState="Maximized" WindowStartupLocation="CenterScreen" Width="1366" Height="768">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<tsWPFCore:tsGridControl x:Name="gc" Grid.Row="0" Grid.ColumnSpan="2" >
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Codigo" Header="Código Asiento Modelo" Width="140" />
<dxg:GridColumn FieldName="Descripcion" Header ="Descripción" Width="600" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPFCore:tsTableView x:Name="tv" ShowSearchPanelMode="Always" AllowEditing="False" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
<Grid Grid.Row="1" Grid.ColumnSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" IsDefault="True" Click="btAceptar_Click" TabIndex="0">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="1">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,54 @@

Imports bdGrupoSanchoToro
Imports bdGrupoSanchoToro.db
Imports DevExpress.Xpf.Core
Imports System.Data.Entity
Public Class dxwAsientosModelo
Friend _bd As tscGrupoSanchoToro
Public idAsientoModelo As Integer
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
If gc.CurrentItem IsNot Nothing Then
idAsientoModelo = DirectCast(gc.CurrentItem, asientosmodelos).idAsientoModelo
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
If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Cargando Datos ...")
Me.gc.ItemsSource = _bd.asientosmodelos.OrderBy(Function(x) x.Descripcion).ToList
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)
' Llamada necesaria para el diseñador.
InitializeComponent()
_bd = bd
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

View File

@@ -0,0 +1,78 @@
<dx:DXWindow x:Class="dxwConceptosPredefinidos"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione" WindowStyle="ToolWindow" WindowState="Maximized" WindowStartupLocation="CenterScreen" Width="1366" Height="768">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<dxlc:LayoutControl Grid.Row="0" Grid.ColumnSpan="2" Orientation="Vertical" >
<dxlc:LayoutGroup x:Name="FiltrosAvanzados" Header="Filtros" View="GroupBox" IsLocked="True" Orientation="Vertical" HorizontalAlignment="Stretch" IsCollapsible="True" IsCollapsed="False">
<dxlc:LayoutGroup Width="700" HorizontalAlignment="Left">
<dxlc:LayoutGroup Orientation="Vertical">
<tsWPFCore:tsLayoutItem Label="Búsqueda:">
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" FontWeight="Normal" />
</tsWPFCore:tsLayoutItem>
<dxlc:LayoutGroup ItemLabelsAlignment="Local">
<dxlc:LayoutItem Label="Campos de búsqueda:">
<Border BorderThickness="1" BorderBrush="Black">
<TextBlock x:Name="tbCamposBusqueda" Text="Código, Concepto"/>
</Border>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" Margin="20,0,0,0" VerticalAlignment="Top" />
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<dxg:GridControl x:Name="gc" >
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Codigo" Header="Código Concepto" Width="140" />
<dxg:GridColumn FieldName="Concepto" Width="600" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPFCore:tsTableView x:Name="tv" ShowSearchPanelMode="Always" AllowEditing="False" />
</dxg:GridControl.View>
</dxg:GridControl>
</dxlc:LayoutControl>
<Grid Grid.Row="1" Grid.ColumnSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" Click="btAceptar_Click" TabIndex="0">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="1">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,87 @@

Imports tsl5.Extensiones
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Core
Imports System.Data.Entity
Imports bdGrupoSanchoToro.db
Public Class dxwConceptosPredefinidos
Friend _bd As tscGrupoSanchoToro
Public idConcepto As Integer
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
If gc.CurrentItem IsNot Nothing Then
idConcepto = DirectCast(gc.CurrentItem, conceptosapuntes).idConcepto
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 dxw_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Try
teBusqueda.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)
' Llamada necesaria para el diseñador.
InitializeComponent()
_bd = bd
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
Private Sub btBuscar_Click(sender As Object, e As RoutedEventArgs)
Try
DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Cargando Datos ...")
Dim TextoBusqueda = Me.teBusqueda.Text.Trim
Dim ExpresionBusqueda As String = ""
If TextoBusqueda <> "" Then
Dim CamposBusquedaAlfabeticos() As String = {"Codigo", "Concepto"}
ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Nothing, CamposBusquedaAlfabeticos, Nothing, Nothing)
End If
Dim ctos As List(Of conceptosapuntes)
If ExpresionBusqueda <> "" Then
Dim parametros(0) As Object
ctos = _bd.conceptosapuntes.Where(ExpresionBusqueda, parametros).OrderBy(Function(x) x.Concepto).ToList
Else
ctos = _bd.conceptosapuntes.Where(Function(X) X.Concepto <> "").OrderBy(Function(x) x.Concepto).ToList
End If
DXSplashScreen.Close()
Select Case ctos.Count
Case 0
DXMessageBox.Show("No se han encontrado conceptos con los datos suministrados", "Atención")
Case 1
idConcepto = ctos.First.idConcepto
Me.DialogResult = True
Me.Close()
Case Else
Me.gc.ItemsSource = ctos
Me.gc.Focus()
End Select
Catch ex As Exception
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
End Try
End Sub
End Class

View File

@@ -0,0 +1,84 @@
<dx:DXWindow x:Class="dxwCuentas"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione" WindowStyle="ToolWindow" WindowState="Maximized" WindowStartupLocation="CenterScreen" Width="1366" Height="768">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<dxlc:LayoutControl Grid.Row="0" Grid.ColumnSpan="2" Orientation="Vertical" >
<dxlc:LayoutGroup x:Name="FiltrosAvanzados" Header="Filtros" View="GroupBox" IsLocked="True" Orientation="Vertical" HorizontalAlignment="Stretch" IsCollapsible="True" IsCollapsed="False">
<dxlc:LayoutGroup Width="700" HorizontalAlignment="Left">
<dxlc:LayoutGroup Orientation="Vertical">
<tsWPFCore:tsLayoutItem Label="Búsqueda:">
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" FontWeight="Normal" />
</tsWPFCore:tsLayoutItem>
<dxlc:LayoutGroup ItemLabelsAlignment="Local">
<dxlc:LayoutItem Label="Campos de búsqueda:">
<Border BorderThickness="1" BorderBrush="Black">
<TextBlock x:Name="tbCamposBusqueda" Text="Descripción, Nº Cuenta, Mote"/>
</Border>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" Margin="20,0,0,0" VerticalAlignment="Top" />
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" >
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="NumeroCuenta" Width="140" />
<dxg:GridColumn FieldName="Mote" Width="150" />
<dxg:GridColumn FieldName="Denominacion" Header="Denominación" Width="400" />
<dxg:GridColumn FieldName="TotalSaldo" Width="110" HorizontalHeaderContentAlignment="Right" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPFCore:tsTableView x:Name="tv" ShowSearchPanelMode="Always" AllowEditing="False" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
<Grid Grid.Row="1" Grid.ColumnSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" Click="btAceptar_Click" TabIndex="0">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="1">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,85 @@

Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Core
Imports System.Data.Entity
Public Class dxwCuentas
Friend _bd As tscGrupoSanchoToro
Private _idEjercicio As Integer
Public idCuenta As Integer
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
If gc.CurrentItem IsNot Nothing Then
idCuenta = DirectCast(gc.CurrentItem, bdGrupoSanchoToro.db.vf_cuentas).idCuenta
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
teBusqueda.Focus()
Catch ex As Exception
DXMessageBox.Show(ex.Message, "Error")
Finally
End Try
End Sub
'Public Sub New(bd As m3academiaEntities, Existentes As List(Of Integer?))
Public Sub New(bd As tscGrupoSanchoToro, idEjercicio As Integer)
' Llamada necesaria para el diseñador.
InitializeComponent()
_bd = bd
_idEjercicio = idEjercicio
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
Private Sub btBuscar_Click(sender As Object, e As RoutedEventArgs)
Dim ctas As List(Of bdGrupoSanchoToro.db.vf_cuentas)
Try
If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Cargando Datos ...")
Dim TextoBusqueda = Me.teBusqueda.Text.Trim
Dim ExpresionBusqueda As String = ""
If TextoBusqueda <> "" Then
'Dim CamposBusquedaNumericos() As String = {"TotalDebe", "TotalHaber"}
Dim CamposBusquedaAlfabeticos() As String = {"Denominacion", "Mote"}
Dim CamposBusquedaAlfabeticosPorComienzo() As String = {"NumeroCuenta"}
ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Nothing, CamposBusquedaAlfabeticos, Nothing, CamposBusquedaAlfabeticosPorComienzo)
End If
ctas = bdGrupoSanchoToro.db.vf_cuentas.Obtiene_vf_cuentas(_bd, {_idEjercicio}, 8, ExpresionBusqueda)
DXSplashScreen.Close()
Select Case ctas.Count
Case 0
DXMessageBox.Show("No se han encontrado cuentas con los datos suministrados", "Atención")
Case 1
idCuenta = ctas.First.idCuenta
Me.DialogResult = True
Me.Close()
Case Else
Me.gc.ItemsSource = ctas
Me.gc.Focus()
End Select
Catch ex As Exception
' If DXSplashScreen.IsActive Then DXSplashScreen.Close()
Throw New Exception(ex.Message, ex)
End Try
End Sub
End Class

View File

@@ -0,0 +1,98 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" x:Class="ucApuntes"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Filtros" x:Name="lgFiltrosBusquedaRapida" Width="Auto" Orientation="Vertical" HorizontalAlignment="Stretch" >
<dxlc:LayoutGroup Orientation="Vertical" Width="800" HorizontalAlignment="Left" >
<dxlc:LayoutGroup >
<tsWPFCore:tsLayoutItem Label="Fecha Inicio:" Width="250">
<dxe:DateEdit x:Name="deFechaInicio" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Fecha Fin:" Width="200">
<dxe:DateEdit x:Name="deFechaFin" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup >
<tsWPFCore:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" x:FieldModifier="public" FontWeight="Normal" />
</tsWPFCore:tsLayoutItem>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
</dxlc:LayoutGroup>
<dxlc:LayoutItem Label="Campos de búsqueda:" x:Name="liCamposBusqueda" >
<Border BorderThickness="1" BorderBrush="Black" >
<TextBlock x:Name="tbCamposBusqueda" Text="Nº Cuenta, Denominación Cuenta"/>
</Border>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" >
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Cuenta" Header="Cuenta" Width="120" IsSmart="True" GroupIndex="0"/>
<dxg:GridColumn FieldName="Fecha" Header="Fecha" Width="90" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="d"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="NumeroAsiento" Header="Nº Asiento" Width="100" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
<dxg:GridColumn FieldName="Concepto" Header="Concepto" Width="400" IsSmart="True"/>
<dxg:GridColumn FieldName="Debe" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Haber" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Saldo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<tsWPFCore:tsGridControl.GroupSummary >
<!--<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº Apuntes:{0:n0}" ShowInGroupColumnFooter="Concepto" />-->
<dxg:GridSummaryItem FieldName="Debe" SummaryType="Sum" ShowInGroupColumnFooter="Debe" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="Haber" SummaryType="Sum" ShowInGroupColumnFooter="Haber" DisplayFormat=" {0:c2}" />
<!--<dxg:GridSummaryItem FieldName="Saldo" SummaryType="Sum" ShowInGroupColumnFooter="Saldo" DisplayFormat=" {0:c2}" />-->
</tsWPFCore:tsGridControl.GroupSummary>
<tsWPFCore:tsGridControl.TotalSummary>
<!--<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº A:{0:n0}" ShowInColumn="Concepto" />-->
<dxg:GridSummaryItem FieldName="Debe" SummaryType="Sum" ShowInColumn="Debe" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="Haber" SummaryType="Sum" ShowInColumn="Haber" DisplayFormat=" {0:c2}" />
<!--<dxg:GridSummaryItem FieldName="Saldo" SummaryType="Sum" ShowInColumn="Saldo" DisplayFormat=" {0:c2}" />-->
</tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridControl.View>
<tsWPFCore:tsTableView ShowGroupFooters="True" ShowGroupPanel="True" ShowSearchPanelMode="Always" ShowTotalSummary="True" >
<tsWPFCore:tsTableView.FormatConditions>
<dxg:FormatCondition Expression="[Tipo] = 0" FieldName="{x:Null}" >
<dxg:Format Foreground="Red" />
</dxg:FormatCondition>
</tsWPFCore:tsTableView.FormatConditions>
</tsWPFCore:tsTableView>
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,231 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports System.Linq.Dynamic
Imports DevExpress.Xpf.Bars
Imports tsl5.Datos
Imports tsWPF
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucApuntes
Dim bd As tscGrupoSanchoToro
Dim EjerContables As List(Of ejercicioscontables)
' Private _Ejercicios As List(Of Integer)
' Private _NivelCuentas As Integer
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "Apuntes"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Apuntes"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "apuntes"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Extractos Cuentas"
End Sub
Public Overrides Sub Cargado()
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
Dim ejab = Ejercicios.Where(Function(x) x.FechaCierre Is Nothing)
deFechaInicio.EditValue = ejab.OrderBy(Function(x) x.FechaInicio).First.FechaInicio
deFechaFin.EditValue = ejab.OrderByDescending(Function(x) x.FechaFin).First.FechaFin
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
Return 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.CONTABILIDAD", idUsuario)
End Function
Public Sub New()
' Esta llamada es exigida por el diseñador.
InitializeComponent()
'Me.lgFiltrosBusquedaRapida.Visibility = Visibility.Collapsed
'Me.lgFiltrosBusquedaAvanzada.Visibility = Visibility.Visible
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Function ObtieneApuntes(ByRef DataContext As Object, BackGround As Boolean, TextoBusqueda As String, FechaInicio As DateOnly, FechaFin As DateOnly) As List(Of ApunteExtracto)
Dim rs As List(Of apuntes)
Dim parametros(0) As Object
Dim iNumExc As Integer = 0
Dim lae As New List(Of ApunteExtracto)
Do
Try
If TextoBusqueda <> "" Then
Dim Calf() As String = {"cuentas.Denominacion"}
Dim Calfc() As String = {"cuentas.NumeroCuenta"}
Dim ExpBus As String = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Nothing, Calf, Nothing, Calfc)
If ExpBus = "" Then
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.idCuentaNavigation.NumeroCuenta).ThenBy(Function(x) x.idAsientoNavigation.Fecha).ThenBy(Function(x) x.idAsientoNavigation.NumeroAsiento).ToList()
Else
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.idCuentaNavigation.NumeroCuenta).ThenBy(Function(x) x.idAsientoNavigation.Fecha).ThenBy(Function(x) x.idAsientoNavigation.NumeroAsiento).ToList
End If
Else
rs = bd.apuntes.Include(Function(x) x.idAsientoNavigation.idAsiento).Include(Function(x) x.idCuentaNavigation.idCuenta).Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicio And x.idAsientoNavigation.Fecha <= FechaFin).OrderBy(Function(x) x.idCuentaNavigation.NumeroCuenta).ThenBy(Function(x) x.idAsientoNavigation.Fecha).ThenBy(Function(x) x.idAsientoNavigation.NumeroAsiento).ToList()
End If
Dim rsa = rs.GroupBy(Function(x) x.idCuentaNavigation.NumeroCuenta).ToList
Dim orden As Integer
Dim SaldoAcumulado As Double = 0
For Each g In rsa
Dim ea As New ApunteExtracto
orden += 1
With ea
.Orden = orden
.Concepto = "Saldo Anterior"
.Cuenta = g.First().idCuentaNavigation.Denominacion
.Debe = g.First.DebeAnterior(bd, FechaInicio)
.Haber = g.First.HaberAnterior(bd, FechaInicio)
.Saldo = .Debe - .Haber
.Tipo = ApunteExtracto.ApunteExtractoTipoEnum.SALDO_ANTERIOR
SaldoAcumulado = .Saldo
End With
lae.Add(ea)
For Each apu In g
Dim apue As New ApunteExtracto
orden += 1
With apue
.Orden = orden
.Concepto = apu.Concepto
.Fecha = apu.idAsientoNavigation.Fecha
.Cuenta = apu.idCuentaNavigation.Denominacion
.NumeroAsiento = If(apu.idAsiento = 0, "", apu.idAsiento.ToString)
.idAsiento = apu.idAsiento
.Debe = apu.Debe
.Haber = apu.Haber
SaldoAcumulado += (apu.Debe - apu.Haber)
.Saldo = SaldoAcumulado
.Tipo = ApunteExtracto.ApunteExtractoTipoEnum.APUNTE
End With
lae.Add(apue)
Next
Next
' rs = bd.asientos.Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
Exit Do
Catch ex As Exception
iNumExc += 1
If iNumExc > 3 Then
Throw New Exception(ex.Message, ex)
End If
End Try
Loop
Return lae
End Function
Public Async Sub ObtieneApuntesAsync(bd As tscGrupoSanchoToro, Background As Boolean)
Try
Dim rs As New List(Of ApunteExtracto)
Dim fi, ff As DateOnly?
Dim Busqueda As String
Busqueda = Me.teBusqueda.Text.Trim
fi = deFechaInicio.EditValue
ff = deFechaFin.EditValue
If Background Then
Me.ContenedorAplicacion.IsEnabled = False
Await Task.Run(Sub()
rs = ObtieneApuntes(bd, Background, Busqueda, fi, ff)
End Sub)
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando Apuntes ...")
rs = ObtieneApuntes(bd, Background, Busqueda, fi, ff)
End If
gc.ItemsSource = rs
DataContext = rs
gc.ExpandAllGroups()
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, ApunteExtracto).idAsiento
If id > 0 Then
Dim uc As New ucDiario(id)
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
End If
End Sub
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
ObtieneApuntesAsync(bd, False)
End Sub
'Private Sub CbEjerciciosBA_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs)
' ObtienecuentasAsync(bd, False, True)
'End Sub
'Private Sub ApLineas_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
' Select Case idAccion
' Case 1 ' balance de situacion
' End Select
'End Sub
End Class
Public Class ApunteExtracto
Property Orden As Integer
Property Tipo As ApunteExtractoTipoEnum
Property Cuenta As String
Property idAsiento As Integer
Property NumeroAsiento As String
Property Concepto As String
Property Fecha As Date?
Property Debe As Double
Property Haber As Double
Property Saldo As Double
Public Enum ApunteExtractoTipoEnum
SALDO_ANTERIOR = 0
APUNTE = 1
End Enum
End Class

View File

@@ -0,0 +1,104 @@
<tsWPFCore:tsUserControl x:Class="ucAsientoModelo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
mc:Ignorable="d" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
<Setter Property="Background" Value="#B0E0E6" />
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
<dxlc:LayoutControl Name="LayoutControl1" Orientation="Vertical">
<dxlc:LayoutGroup Header="Datos del Asiento Modelo" Name="lgDetalle" View="GroupBox" ItemLabelsAlignment="Default" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
<tsWPFCore:tsLayoutItem Label="id Asiento Modelo:" Width="210">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding idAsientoModelo_Nulable, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" NullText="« AUTOMÁTICO »" TabIndex="200" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Código" Width="150">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Obligatorio="True" Unico="True" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding Codigo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" AllowNullInput="False" TabIndex="1" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Descripción:" Width="550">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Obligatorio="True" Unico="True" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding Descripcion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="2" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Fecha Introducción:" Width="220">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Obligatorio="True" Modificable="NoModificable" UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:DateEdit EditValue="{Binding FechaIntroduccion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" AllowNullInput="False" TabIndex="3" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gcApuntesModelos" TabIndex="4" NombreTablaBase="apuntesmodelo" >
<tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:PropiedadesTSGC CamposObligatorios="NumeroCuenta" Descripcion="Apuntes" />
</tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:tsGridControl.View>
<tsWPFCore:tsTableView x:Name="tvApuntesModelo" NewItemRowPosition="Bottom" ShowSearchPanelCloseButton="False" SearchPanelFindMode="Always" ShowTotalSummary="True" />
</tsWPFCore:tsGridControl.View >
<tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridSummaryItem SummaryType="Sum" FieldName="Debe" DisplayFormat="T. Debe:{0:c2}" ShowInColumn="Debe" />
<dxg:GridSummaryItem SummaryType="Sum" FieldName="Haber" DisplayFormat="T. Haber:{0:c2}" ShowInColumn="Haber" />
</tsWPFCore:tsGridControl.TotalSummary>
<tsWPFCore:tsGridControl.Columns>
<tsWPFCore:tsGridColumn FieldName="NumeroCuenta" Header="Número Cuenta" IsSmart="True" Width="140" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ButtonEditSettings x:Name="btCuenta">
</dxe:ButtonEditSettings>
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn Width="220" Header="Tipo Documento" FieldName="TipoDocumento" TabStop="False" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ComboBoxEditSettings ValueMember="id" x:Name="cbTipoDocumento" IncrementalFiltering="True" DisplayMember="Descripcion" AutoComplete="True"/>
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="Concepto" Header="Concepto" IsSmart="True" Width="400" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ButtonEditSettings x:Name="btConcepto" DefaultButtonClick="BtConcepto_DefaultButtonClick">
</dxe:ButtonEditSettings>
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="Debe" Header="Debe" IsSmart="True" Width="150" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="Haber" Header="Haber" IsSmart="True" Width="150" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="NumeroDocumento" Header="Nº Documento" IsSmart="True" Width="90" >
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="Orden" IsSmart="True" Width="80" SortIndex="1" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
</tsWPFCore:tsGridControl.Columns>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,260 @@
Option Strict Off
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 tsWPF.modExtensiones
Imports System.Data.Common
Imports System.Data.Entity
Imports DevExpress.Xpf.Grid
Imports tsl5.Extensiones
Imports DevExpress.Xpf.Bars
Imports tsl5.Datos
Imports tsWPF.Comun
Imports bdGrupoSanchoToro.db
Public Class ucAsientoModelo
Private bd As tscGrupoSanchoToro
Friend _idAsiento As Nullable(Of Integer)
Friend _idAsientoACopiar As Integer?
Public Sub New(Optional idAsiento As Integer? = Nothing, Optional idAsientoACopiar As Integer? = Nothing)
' Llamada necesaria para el diseñador.
InitializeComponent()
_idAsiento = idAsiento
_idAsientoACopiar = idAsientoACopiar
' 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 "AsientosModelo.Nuevo"
Else
Return "AsientosModelo." & DirectCast(Me.DataContext, asientosmodelos).Codigo.ToString
End If
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "AsientosModelo"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "asientosmodelos"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
cbTipoDocumento.ItemsSource = bdGrupoSanchoToro.db.apuntes.ListaTiposDocumentos
End Sub
Public Overrides Sub EstableceTitulo()
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
Dim asiento As asientosmodelos = Me.DataContext
Me.docpanel.Caption = "Asiento Modelo " & asiento.idAsientoModelo.ToString
Me.docpanel.Tag = "Asiento Modelo." & asiento.idAsientoModelo.ToString
Else
Me.docpanel.Caption = "Asiento Modelo Nuevo"
Me.docpanel.Tag = "Asiento Modelo.Nuevo"
End If
End Sub
Public Overrides Sub Cargado()
tvApuntesModelo.ShowSearchPanel(False)
End Sub
Dim ra As asientosmodelos
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 _idAsiento Is Nothing Then
'Dim uEc = bd.ejercicioscontables.Where(Function(x) x.FechaCierre Is Nothing).OrderByDescending(Function(x) x.FechaInicio).First
ra = New asientosmodelos
ra.FechaIntroduccion = Now
Dim usuarioprueba = bdGrupoSanchoToro.db.Utilidades.idUsuario
ra.idUsuarioNavigation = bd.usuarios.First(Function(x) x.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario)
If _idAsientoACopiar.HasValue Then
Dim asiac = bd.asientos.First(Function(x) x.idAsiento = _idAsientoACopiar)
For Each ap In asiac.apuntes
Dim napm As New apuntesmodelo
ra.apuntesmodelo.Add(napm)
With napm
.NumeroCuenta = ap.idCuentaNavigation.NumeroCuenta
.Concepto = ap.Concepto
.Debe = ap.Debe
.Haber = ap.Haber
.idConcepto = ap.idConcepto
.NumeroDocumento = ap.NumeroDocumento
.TipoDocumento = ap.TipoDocumento
End With
Next
End If
''sergio listen: preguntar EjerciciosContables a manolo
''ra.ejercicioscontables = uEc
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
Else
Dim id As Integer = _idAsiento
ra = bd.asientosmodelos.First(Function(X) X.idAsientoModelo = id)
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
End If
'sergio listen: ¿descomentar?
'ra.RellenaCuentaTmp()
Me.DataContext = ra
gcApuntesModelos.ItemsSource = ra.apuntesmodelo
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.gestionasegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRATIVOS", bdGrupoSanchoToro.db.Utilidades.idUsuario)
End Function
Private Sub ucAsientoModelo_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
Dim ra As asientosmodelos = Me.DataContext
Dim hte As New Hashtable
Dim sd = Math.Round(ra.apuntesmodelo.Sum(Function(x) x.Debe), 2, MidpointRounding.AwayFromZero)
Dim sh = Math.Round(ra.apuntesmodelo.Sum(Function(x) x.Haber), 2, MidpointRounding.AwayFromZero)
If sd <> sh Then
hte.Add("Almacenar-SUMA", "La suma del Debe no coincide con la suma del Haber")
End If
If sd = 0 Then
If ra.apuntesmodelo.Count > 0 Then
hte.Add("Almacenar-suma0", "La suma de los apuntes no puede ser 0")
Else
hte.Add("Almacenar-0Apuntes", "Es obligatorio meter al menos 2 apuntes")
End If
End If
If hte.Count > 0 Then
MensajesError = hte
Cancelar = True
End If
End Sub
Private Sub BtConcepto_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
Try
Dim asiento As asientosmodelos = Me.DataContext
If gcApuntesModelos.CurrentItem Is Nothing Then tvApuntesModelo.AddNewRow()
Dim ap As apuntesmodelo = gcApuntesModelos.CurrentItem
If tvApuntesModelo.ActiveEditor Is Nothing Then
Dispatcher.BeginInvoke(New Action(Sub() tvApuntesModelo.ShowEditor()), System.Windows.Threading.DispatcherPriority.Render)
End If
Dim dxw As New dxwConceptosPredefinidos(bd)
If dxw.ShowDialog Then
Dim con = bd.conceptosapuntes.First(Function(x) x.idConcepto = dxw.idConcepto)
ap.Concepto = con.Concepto
If tvApuntesModelo.ActiveEditor IsNot Nothing Then tvApuntesModelo.ActiveEditor.EditValue = con.Concepto
tvApuntesModelo.PostEditor()
tvApuntesModelo.CloseEditor()
gcApuntesModelos.RefreshRow(tvApuntesModelo.FocusedRowHandle)
tvApuntesModelo.MoveNextCell()
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub ucAsientoModelo_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
_idAsientoACopiar = Nothing
_idAsiento = ra.idAsientoModelo
End Sub
Private Sub gcApuntesModelo_EnterPulsado() Handles gcApuntesModelos.EnterPulsado
Select Case gcApuntesModelos.CurrentColumn.FieldName.ToLower
Case "concepto"
If tvApuntesModelo.FocusedRowHandle = DataControlBase.NewItemRowHandle Then
Dim ap As apuntes = gcApuntesModelos.CurrentItem
Dim apant = ra.apuntesmodelo.FirstOrDefault(Function(x) x.Concepto <> "")
If apant IsNot Nothing Then
ap.idConcepto = apant.idConcepto
ap.Concepto = apant.Concepto
End If
gcApuntesModelos.RefreshRow(tvApuntesModelo.FocusedRowHandle)
End If
Case "tipodocumento"
If tvApuntesModelo.FocusedRowHandle = DataControlBase.NewItemRowHandle Then
Dim ap As apuntes = gcApuntesModelos.CurrentItem
Dim apant = ra.apuntesmodelo.FirstOrDefault(Function(x) x.TipoDocumento.HasValue)
If apant IsNot Nothing Then
ap.TipoDocumento = apant.TipoDocumento
End If
gcApuntesModelos.RefreshRow(tvApuntesModelo.FocusedRowHandle)
End If
Case "numerodocumento"
If tvApuntesModelo.FocusedRowHandle = DataControlBase.NewItemRowHandle Then
Dim ap As apuntes = gcApuntesModelos.CurrentItem
Dim apant = ra.apuntesmodelo.FirstOrDefault(Function(x) x.NumeroDocumento.NothingAVacio)
If apant IsNot Nothing Then
ap.NumeroDocumento = apant.NumeroDocumento
End If
gcApuntesModelos.RefreshRow(tvApuntesModelo.FocusedRowHandle)
End If
End Select
End Sub
Private Sub tvApuntesModelo_CellValueChanged(sender As Object, e As CellValueChangedEventArgs) Handles tvApuntesModelo.CellValueChanged
Try
Dim ap As apuntesmodelo = e.Row
Select Case e.Column.FieldName.ToLower
Case "numerocuenta"
Dim NumeroCuenta As String = ap.NumeroCuenta.NothingAVacio
If NumeroCuenta.Contains(".") Then
NumeroCuenta = NumeroCuenta.Replace(".", "0".PadRight(9 - NumeroCuenta.Length, "0")).Acortar(8)
ap.NumeroCuenta = NumeroCuenta
gcApuntesModelos.RefreshRow(tvApuntesModelo.FocusedRowHandle)
End If
End Select
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub BtCuenta_DefaultButtonClick(sender As Object, e As RoutedEventArgs) Handles btCuenta.DefaultButtonClick
Try
If tvApuntesModelo.HasValidationError Then tvApuntesModelo.CancelRowEdit()
Dim asiento As asientosmodelos = Me.DataContext
If gcApuntesModelos.CurrentItem Is Nothing Then tvApuntesModelo.AddNewRow()
If tvApuntesModelo.ActiveEditor Is Nothing Then
Dispatcher.BeginInvoke(New Action(Sub() tvApuntesModelo.ShowEditor()), System.Windows.Threading.DispatcherPriority.Render)
End If
Dim idj = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).First.idEjercicio
Dim dxw As New dxwCuentas(bd, idj)
If dxw.ShowDialog Then
Dim ap As apuntesmodelo = gcApuntesModelos.CurrentItem
Dim cta = bd.cuentas.First(Function(x) x.idCuenta = dxw.idCuenta)
ap.NumeroCuenta = cta.NumeroCuenta
If tvApuntesModelo.ActiveEditor IsNot Nothing Then tvApuntesModelo.ActiveEditor.EditValue = cta.NumeroCuenta
tvApuntesModelo.PostEditor()
gcApuntesModelos.RefreshRow(tvApuntesModelo.FocusedRowHandle)
tvApuntesModelo.MoveNextCell()
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
End Class

View File

@@ -0,0 +1,51 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:bdGrupoSanchoToro="clr-namespace:bdGrupoSanchoToro;assembly=bdGrupoSanchoToro" x:Class="ucAsientosModelos"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Filtros" x:Name="lgFiltrosBusquedaRapida" Width="Auto" Orientation="Vertical" HorizontalAlignment="Stretch" >
<dxlc:LayoutGroup Width="650" HorizontalAlignment="Left" >
<dxlc:LayoutGroup Orientation="Vertical">
<tsWPFCore:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" x:FieldModifier="public" FontWeight="Normal" />
</tsWPFCore:tsLayoutItem>
<dxlc:LayoutItem Label="Campos de búsqueda:" x:Name="liCamposBusqueda" >
<Border BorderThickness="1" BorderBrush="Black" >
<TextBlock x:Name="tbCamposBusqueda" Text="Código, Descripción, Nº Cuenta, Importe, Nº Documento"/>
</Border>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" TabIndex="1">
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="idAsientoModelo" Header="id Asiento Mod." Width="100" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
<dxg:GridColumn FieldName="Codigo" Header="Código" Width="120" IsSmart="True"/>
<dxg:GridColumn FieldName="Descripcion" Width="300" IsSmart="True"/>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPFCore:tsTableView AllowEditing="False" ShowTotalSummary="True" ShowSearchPanelMode="Always" ShowGroupPanel="True" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,142 @@
Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports System.Linq.Dynamic
Imports tsl5.Datos
Imports tsWPFCore
Imports tsWPFCore.Comun
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucAsientosModelos
Dim bd As tscGrupoSanchoToro
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "AsientosModelos"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Asientos Modelos"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "asientosmodelos"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Asientos Modelos"
End Sub
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 Background Or Refrescar Then ObtieneAsientosAsync(bd, False)
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.CONTABILIDAD", idUsuario)
End Function
Public Function ObtieneAsientosModelos(BackGround As Boolean, TextoBusqueda As String) As List(Of asientosmodelos)
Dim rs As New List(Of asientosmodelos)
Dim parametros(0) As Object
Dim iNumExc As Integer = 0
Do
Try
If TextoBusqueda <> "" Then
Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, {"Importe"}, {"Codigo", "Descripcion"}, Nothing)
If ExpresionBusqueda <> "" Then
rs = bd.asientosmodelos.Where(ExpresionBusqueda, parametros).ToList
Else
rs = bd.asientosmodelos.ToList
End If
Dim Calfap() As String = {"NumeroDocumento", "Concepto"}
Dim Cnumap() As String = {"Debe", "Haber"}
Dim ExpBusAsi As String = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Cnumap, Calfap, Nothing)
Dim lap = bd.apuntesmodelo.Where(ExpBusAsi, parametros).Select(Function(x) x.idAsientoModeloNavigation).ToList
Dim ctas = TextoBusqueda.Split(" ").Where(Function(x) x.Length = bdGrupoSanchoToro.db.cuentas.LongitudCuentaFinal).ToArray
Dim lap2 = bd.apuntesmodelo.Where(Function(x) ctas.Contains(x.NumeroCuenta)).Select(Function(x) x.idAsientoModeloNavigation).ToList
rs = rs.Union(lap).Union(lap2).OrderBy(Function(x) x.Descripcion).ToList
Else
rs = bd.asientosmodelos.ToList
End If
Exit Do
Catch ex As Exception
If BackGround = False 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 ObtieneAsientosAsync(bd As tscGrupoSanchoToro, Background As Boolean)
Try
Dim rs As New List(Of asientosmodelos)
Dim Busqueda As String
Busqueda = Me.teBusqueda.Text.Trim
If Background Then
Me.ContenedorAplicacion.IsEnabled = False
Await Task.Run(Sub()
rs = ObtieneAsientosModelos(Background, Busqueda)
End Sub)
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando Asientos Modelos ...")
rs = ObtieneAsientosModelos(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 ucAsientosModelos_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
FuncionesDinamicas.AbrirAP(New ucAsientoModelo, OtrosParametros)
End Sub
Private Sub ucAsientosModelos_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Dim id As Integer = DirectCast(Me.gc.SelectedItems(0), asientosmodelos).idAsientoModelo
FuncionesDinamicas.AbrirAP(New ucAsientoModelo(id), OtrosParametros)
End Sub
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
ObtieneAsientosAsync(bd, False)
End Sub
End Class

View File

@@ -0,0 +1,62 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" x:Class="ucBalanceExplotacion"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Filtros" x:Name="lgFiltrosBusquedaRapida" Width="Auto" HorizontalAlignment="Stretch" >
<tsWPFCore:tsLayoutItem Label="Fecha Inicio:" Width="250">
<dxe:DateEdit x:Name="deFechaInicio" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Fecha Fin:" Width="200">
<dxe:DateEdit x:Name="deFechaFin" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" CustomSummary="Gc_CustomSummary" >
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Grupo" Header="Grupo" Width="120" IsSmart="True" GroupIndex="0" />
<dxg:GridColumn FieldName="Cuenta" Header="Cuenta" Width="120" IsSmart="True" />
<dxg:GridColumn FieldName="Denominacion" Header="Denominación" Width="600" IsSmart="True"/>
<dxg:GridColumn FieldName="Importe" Width="220" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<tsWPFCore:tsGridControl.GroupSummary >
<dxg:GridSummaryItem FieldName="Importe" SummaryType="Sum" ShowInGroupColumnFooter="Importe" DisplayFormat=" {0:c2}" />
</tsWPFCore:tsGridControl.GroupSummary>
<tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridSummaryItem FieldName="TotalGastos" SummaryType="Custom" ShowInColumn="Importe" DisplayFormat="Gastos: {0:c2}" />
<dxg:GridSummaryItem FieldName="Importe" SummaryType="Custom" ShowInColumn="Importe" DisplayFormat="Ingresos: {0:c2}" />
<dxg:GridSummaryItem FieldName="Perdidas" SummaryType="Custom" ShowInColumn="Importe" DisplayFormat="Pérdidas: {0:c2}" />
<dxg:GridSummaryItem FieldName="Ganancias" SummaryType="Custom" ShowInColumn="Importe" DisplayFormat="Ganancias: {0:c2}" />
</tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridControl.View>
<tsWPFCore:tsTableView ShowGroupFooters="True" ShowGroupPanel="True" ShowSearchPanelMode="Always" ShowTotalSummary="True" >
</tsWPFCore:tsTableView>
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,214 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports System.Linq.Dynamic
Imports DevExpress.Xpf.Bars
Imports tsl5.Datos
Imports tsWPF
Imports DevExpress.Data
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucBalanceExplotacion
Private TotalGastos As Double
Private TotalIngresos As Double
Dim bd As tscGrupoSanchoToro
' Private _Ejercicios As List(Of Integer)
' Private _NivelCuentas As Integer
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "BalanceExplotacion"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Cuentas"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "Cuentas"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Balance de Explotación"
End Sub
Public Overrides Sub Cargado()
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
Dim ejab = Ejercicios.Where(Function(x) x.FechaCierre Is Nothing)
deFechaInicio.EditValue = ejab.OrderBy(Function(x) x.FechaInicio).First.FechaInicio
deFechaFin.EditValue = ejab.OrderByDescending(Function(x) x.FechaFin).First.FechaFin
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Return 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 bdCOASVD.GestionAsegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
Public Sub New()
' Esta llamada es exigida por el diseñador.
InitializeComponent()
'Me.lgFiltrosBusquedaRapida.Visibility = Visibility.Collapsed
'Me.lgFiltrosBusquedaAvanzada.Visibility = Visibility.Visible
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Function ObtieneApuntes(ByRef DataContext As Object, BackGround As Boolean, FechaInicio As DateOnly, FechaFin As DateOnly) As List(Of CuentaBalanceExplotacion)
Dim parametros(0) As Object
Dim iNumExc As Integer = 0
Dim lcbe As New List(Of CuentaBalanceExplotacion)
Do
Try
Dim tiporeg As Integer = bdGrupoSanchoToro.db.asientos.TipoAsiento.REGULARIZACION
Dim rsa = bd.apuntes.Include(Function(x) x.idCuentaNavigation.idCuenta).Where(Function(x) x.idAsientoNavigation.Tipo <> tiporeg And x.idAsientoNavigation.Fecha >= FechaInicio And x.idAsientoNavigation.Fecha <= FechaFin And (x.idCuentaNavigation.NumeroCuenta.StartsWith("6") Or x.idCuentaNavigation.NumeroCuenta.StartsWith("7"))).GroupBy(Function(x) x.idCuentaNavigation.NumeroCuenta).ToList()
Dim orden As Integer
For Each g In rsa
Dim cbe As New CuentaBalanceExplotacion
orden += 1
With cbe
.Cuenta = g.First.idCuentaNavigation.NumeroCuenta
.Denominacion = g.First.idCuentaNavigation.Denominacion
.Importe = (g.Sum(Function(x) x.Debe) - g.Sum(Function(x) x.Haber)) * If(.Cuenta.StartsWith("6"), 1, -1)
.Grupo = If(.Cuenta.StartsWith("6"), "GASTOS", "INGRESOS")
End With
lcbe.Add(cbe)
Next
' rs = bd.asientos.Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
Exit Do
Catch ex As Exception
iNumExc += 1
If iNumExc > 3 Then
lcbe = Nothing
Exit Do
End If
End Try
Loop
Return lcbe
End Function
Public Async Sub ObtieneApuntesAsync(bd As tscGrupoSanchoToro, Background As Boolean)
Try
Dim rs As New List(Of CuentaBalanceExplotacion)
Dim fi, ff As DateOnly?
fi = deFechaInicio.EditValue
ff = deFechaFin.EditValue
If Background Then
Me.ContenedorAplicacion.IsEnabled = False
Await Task.Run(Sub()
rs = ObtieneApuntes(bd, Background, fi, ff)
End Sub)
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando Apuntes ...")
rs = ObtieneApuntes(bd, Background, fi, ff)
End If
gc.ItemsSource = rs
DataContext = rs
gc.RefreshData()
gc.ExpandAllGroups()
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 ucCuenta, OtrosParametros)
End Sub
Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Dim id As Integer = DirectCast(Me.gc.CurrentItem, cuentas).idCuenta
Dim uc As New ucCuenta(id)
FuncionesDinamicas.AbrirAP(New ucCuenta(id), OtrosParametros)
End Sub
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
ObtieneApuntesAsync(bd, False)
End Sub
Private Sub Gc_CustomSummary(sender As Object, e As DevExpress.Data.CustomSummaryEventArgs)
Dim Campo As String = (CType(e.Item, GridSummaryItem)).FieldName
Dim cta As CuentaBalanceExplotacion = Nothing
If e.SummaryProcess = CustomSummaryProcess.Calculate Then
cta = DirectCast(e.Row, CuentaBalanceExplotacion)
End If
Select Case Campo
Case "Importe" 'INGRESOS
If e.SummaryProcess = CustomSummaryProcess.Start Then
TotalIngresos = 0
TotalGastos = 0
End If
If e.SummaryProcess = CustomSummaryProcess.Calculate Then
If cta.Cuenta.StartsWith("6") Then
TotalGastos += cta.Importe
Else
TotalIngresos += cta.Importe
End If
End If
If e.SummaryProcess = CustomSummaryProcess.Finalize Then
e.TotalValue = TotalIngresos
End If
Case "TotalGastos"
If e.SummaryProcess = CustomSummaryProcess.Finalize Then
e.TotalValue = TotalGastos
End If
Case "Perdidas"
If e.SummaryProcess = CustomSummaryProcess.Finalize Then
e.TotalValue = If(TotalGastos > TotalIngresos, TotalGastos - TotalIngresos, 0)
End If
Case "Ganancias"
If e.SummaryProcess = CustomSummaryProcess.Finalize Then
e.TotalValue = If(TotalIngresos > TotalGastos, TotalIngresos - TotalGastos, 0)
End If
End Select
End Sub
End Class
Public Class CuentaBalanceExplotacion
Property Grupo As String
Property Cuenta As String
Property Denominacion As String
Property Importe As Double
End Class

View File

@@ -0,0 +1,205 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" x:Class="ucBalanceSumasYSaldos"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Filtros" x:Name="lgFiltrosBusquedaRapida" Width="Auto" HorizontalAlignment="Stretch" >
<tsWPFCore:tsLayoutItem Label="Fecha Inicio:" Width="250">
<dxe:DateEdit x:Name="deFechaInicio" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Fecha Fin:" Width="200">
<dxe:DateEdit x:Name="deFechaFin" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Incluir Asiento Regularización:" HorizontalAlignment="Left" HorizontalContentAlignment="Left" >
<dxe:CheckEdit x:Name="cbIncluirAsientoApertura" IsChecked="True" />
</tsWPFCore:tsLayoutItem>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" >
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Cuenta" Header="Cuenta" Width="120" IsSmart="True" />
<dxg:GridColumn FieldName="Denominacion" Header="Denominación" Width="400" IsSmart="True"/>
<dxg:GridColumn FieldName="DebeT1" Header="Debe T1" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="HaberT1" Header="Haber T1" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoT1" Header="Saldo T1" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DebeT2" Header="Debe T2" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="HaberT2" Header="Haber T2" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoT2" Header="Saldo T2" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DebeT3" Header="Debe T3" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="HaberT3" Header="Haber T3" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoT3" Header="Saldo T3" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DebeT4" Header="Debe T4" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="HaberT4" Header="Haber T4" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoT4" Header="Saldo T4" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Debe" Header="Debe Periodo" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
<dxg:GridColumn.CellStyle>
<Style TargetType="dxg:LightweightCellEditor">
<Setter Property="TextElement.Foreground" Value="Blue"/>
</Style>
</dxg:GridColumn.CellStyle>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Haber" Header="Haber Periodo" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
<dxg:GridColumn.CellStyle>
<Style TargetType="dxg:LightweightCellEditor">
<Setter Property="TextElement.Foreground" Value="Blue"/>
</Style>
</dxg:GridColumn.CellStyle>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Saldo" Header="Saldo Periodo" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
<dxg:GridColumn.CellStyle>
<Style TargetType="dxg:LightweightCellEditor">
<Setter Property="TextElement.Foreground" Value="Blue"/>
</Style>
</dxg:GridColumn.CellStyle>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DebeAcumulado" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
<dxg:GridColumn.CellStyle>
<Style TargetType="dxg:LightweightCellEditor">
<Setter Property="TextElement.Foreground" Value="Blue"/>
</Style>
</dxg:GridColumn.CellStyle>
</dxg:GridColumn>
<dxg:GridColumn FieldName="HaberAcumulado" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
<dxg:GridColumn.CellStyle>
<Style TargetType="dxg:LightweightCellEditor">
<Setter Property="TextElement.Foreground" Value="Blue"/>
</Style>
</dxg:GridColumn.CellStyle>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoAcumulado" Width="120" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
<dxg:GridColumn.CellStyle>
<Style TargetType="dxg:LightweightCellEditor">
<Setter Property="TextElement.Foreground" Value="Blue"/>
</Style>
</dxg:GridColumn.CellStyle>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<tsWPFCore:tsGridControl.GroupSummary >
<dxg:GridSummaryItem FieldName="Importe" SummaryType="Sum" ShowInGroupColumnFooter="Importe" DisplayFormat=" {0:c2}" />
</tsWPFCore:tsGridControl.GroupSummary>
<tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridSummaryItem FieldName="Debe" SummaryType="Sum" ShowInColumn="Debe" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="Haber" SummaryType="Sum" ShowInColumn="Haber" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="Saldo" SummaryType="Sum" ShowInColumn="Saldo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DebeT1" SummaryType="Sum" ShowInColumn="DebeT1" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="HaberT1" SummaryType="Sum" ShowInColumn="HaberT1" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoT1" SummaryType="Sum" ShowInColumn="SaldoT1" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DebeT2" SummaryType="Sum" ShowInColumn="DebeT2" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="HaberT2" SummaryType="Sum" ShowInColumn="HaberT2" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoT2" SummaryType="Sum" ShowInColumn="SaldoT2" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DebeT3" SummaryType="Sum" ShowInColumn="DebeT3" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="HaberT3" SummaryType="Sum" ShowInColumn="HaberT3" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoT3" SummaryType="Sum" ShowInColumn="SaldoT3" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DebeT4" SummaryType="Sum" ShowInColumn="DebeT4" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="HaberT4" SummaryType="Sum" ShowInColumn="HaberT4" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoT4" SummaryType="Sum" ShowInColumn="SaldoT4" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DebeAcumulado" SummaryType="Sum" ShowInColumn="DebeAcumulado" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="HaberAcumulado" SummaryType="Sum" ShowInColumn="HaberAcumulado" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAcumulado" SummaryType="Sum" ShowInColumn="SaldoAcumulado" DisplayFormat=" {0:c2}" />
</tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridControl.View>
<tsWPFCore:tsTableView ShowGroupFooters="True" ShowGroupPanel="True" ShowSearchPanelMode="Always" ShowTotalSummary="True" >
</tsWPFCore:tsTableView>
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,281 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports System.Linq.Dynamic
Imports DevExpress.Xpf.Bars
Imports tsl5.Datos
Imports tsWPF
Imports DevExpress.Data
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucBalanceSumasYSaldos
Private TotalGastos As Double
Private TotalIngresos As Double
Dim bd As tscGrupoSanchoToro
' Private _Ejercicios As List(Of Integer)
' Private _NivelCuentas As Integer
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "BalanceSumasYSaldos" & _Nivel.ToString
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Cuentas"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "Cuentas"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Balance de Sumas y Saldos (" & _Nivel.ToString & " DÍGITOS)"
End Sub
Private _Nivel As Integer
Public Overrides Sub Cargado()
_Nivel = CInt(Rutinas.Ttagi(Me.OtrosParametros, "OPAR"))
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
Dim ejab = Ejercicios.Where(Function(x) x.FechaCierre Is Nothing)
deFechaInicio.EditValue = ejab.OrderBy(Function(x) x.FechaInicio).First.FechaInicio
deFechaFin.EditValue = ejab.OrderByDescending(Function(x) x.FechaFin).First.FechaFin
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Return 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 bdCOASVD.GestionAsegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
Public Sub New()
' Esta llamada es exigida por el diseñador.
InitializeComponent()
'Me.lgFiltrosBusquedaRapida.Visibility = Visibility.Collapsed
'Me.lgFiltrosBusquedaAvanzada.Visibility = Visibility.Visible
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Function ObtieneApuntes(BackGround As Boolean, FechaInicio As DateOnly, FechaFin As DateOnly, Nivel As Integer, IncluirAsientoRegularizacion As Boolean) As List(Of CuentaBalanceSumasYSaldos)
Dim parametros(0) As Object
Dim iNumExc As Integer = 0
Dim lcbe As New List(Of CuentaBalanceSumasYSaldos)
Do
Try
Dim ctas = bd.cuentas.Where(Function(x) ((x.idEjercicioNavigation.FechaInicio <= FechaInicio And FechaInicio <= x.idEjercicioNavigation.FechaFin) OrElse (FechaInicio <= x.idEjercicioNavigation.FechaInicio And FechaFin >= x.idEjercicioNavigation.FechaInicio)) And x.NumeroCuenta.Length = Nivel).ToList()
'Dim ctas = bd.cuentas.Where(Function(x) x.NumeroCuenta.Length = Nivel).GroupBy(Function(x) x.NumeroCuenta).Select(Function(x) x.OrderByDescending(Function(y) y.ejercicioscontables.FechaInicio).FirstOrDefault).Select(Function(x) New With {.NumeroCuenta = x.NumeroCuenta, .Denominacion = x.Denominacion})
Dim fit1 As DateOnly = New DateOnly(FechaInicio.Year, 1, 1)
Dim fit2 As DateOnly = New DateOnly(FechaInicio.Year, 4, 1)
Dim fit3 As DateOnly = New DateOnly(FechaInicio.Year, 7, 1)
Dim fit4 As DateOnly = New DateOnly(FechaInicio.Year, 10, 1)
Dim fft1 As DateOnly = New DateOnly(FechaInicio.Year, 3, 31)
Dim fft2 As DateOnly = New DateOnly(FechaInicio.Year, 6, 30)
Dim fft3 As DateOnly = New DateOnly(FechaInicio.Year, 9, 30)
Dim fft4 As DateOnly = New DateOnly(FechaInicio.Year, 12, 31)
Dim ff As DateOnly = If(fft4 > FechaFin, fft4, FechaFin)
If Nivel = 8 Then
Dim FechaInicioPeriodo As New DateOnly(FechaInicio.Year, 1, 1)
Dim iqApuntes As IQueryable(Of apuntes)
If IncluirAsientoRegularizacion Then
iqApuntes = bd.apuntes.Include("asientos").AsQueryable
Else
iqApuntes = bd.apuntes.Include("asientos").Where(Function(x) x.idAsientoNavigation.Tipo <> asientos.TipoAsiento.REGULARIZACION)
End If
lcbe = iqApuntes.Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicioPeriodo AndAlso x.idAsientoNavigation.Fecha <= ff).ToList.GroupBy(Function(x) New With {Key .Cta = x.idCuentaNavigation.NumeroCuenta}) _
.Select(Function(g) New CuentaBalanceSumasYSaldos With {.Cuenta = g.Key.Cta,
.Denominacion = ctas.FirstOrDefault(Function(c) c.NumeroCuenta = g.Key.Cta).Denominacion,
.Debe = g.Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicio AndAlso x.idAsientoNavigation.Fecha <= FechaFin).Sum(Function(y) y.Debe),
.Haber = g.Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicio AndAlso x.idAsientoNavigation.Fecha <= FechaFin).Sum(Function(y) y.Haber),
.DebeAcumulado = g.Where(Function(x) x.idAsientoNavigation.Fecha <= FechaFin).Sum(Function(x) x.Debe),
.HaberAcumulado = g.Where(Function(x) x.idAsientoNavigation.Fecha <= FechaFin).Sum(Function(x) x.Haber),
.DebeT1 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit1 AndAlso x.idAsientoNavigation.Fecha <= fft1).Sum(Function(y) y.Debe),
.HaberT1 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit1 AndAlso x.idAsientoNavigation.Fecha <= fft1).Sum(Function(y) y.Haber),
.DebeT2 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit2 AndAlso x.idAsientoNavigation.Fecha <= fft2).Sum(Function(y) y.Debe),
.HaberT2 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit2 AndAlso x.idAsientoNavigation.Fecha <= fft2).Sum(Function(y) y.Haber),
.DebeT3 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit3 AndAlso x.idAsientoNavigation.Fecha <= fft3).Sum(Function(y) y.Debe),
.HaberT3 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit3 AndAlso x.idAsientoNavigation.Fecha <= fft3).Sum(Function(y) y.Haber),
.DebeT4 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit4 AndAlso x.idAsientoNavigation.Fecha <= fft4).Sum(Function(y) y.Debe),
.HaberT4 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit4 AndAlso x.idAsientoNavigation.Fecha <= fft4).Sum(Function(y) y.Haber)
}).OrderBy(Function(x) x.Cuenta).ToList
Else
Dim FechaInicioPeriodo As New DateOnly(FechaInicio.Year, 1, 1)
Dim iqApuntes As IQueryable(Of apuntes)
If IncluirAsientoRegularizacion Then
iqApuntes = bd.apuntes.Include("asientos").AsQueryable
Else
iqApuntes = bd.apuntes.Include("asientos").Where(Function(x) x.idAsientoNavigation.Tipo <> asientos.TipoAsiento.REGULARIZACION)
End If
lcbe = iqApuntes.Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicioPeriodo And x.idAsientoNavigation.Fecha <= ff).ToList.GroupBy(Function(x) New With {Key .CtaSuperior = x.idCuentaNavigation.NumeroCuenta.Substring(0, Nivel)}) _
.Select(Function(g) New CuentaBalanceSumasYSaldos With {.Cuenta = g.Key.CtaSuperior,
.Denominacion = ctas.FirstOrDefault(Function(c) c.NumeroCuenta = g.Key.CtaSuperior).Denominacion,
.Debe = g.Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicio AndAlso x.idAsientoNavigation.Fecha <= FechaFin).Sum(Function(y) y.Debe),
.Haber = g.Where(Function(x) x.idAsientoNavigation.Fecha >= FechaInicio AndAlso x.idAsientoNavigation.Fecha <= FechaFin).Sum(Function(y) y.Haber),
.DebeAcumulado = g.Where(Function(x) x.idAsientoNavigation.Fecha <= FechaFin).Sum(Function(x) x.Debe),
.HaberAcumulado = g.Where(Function(x) x.idAsientoNavigation.Fecha <= FechaFin).Sum(Function(x) x.Haber),
.DebeT1 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit1 AndAlso x.idAsientoNavigation.Fecha <= fft1).Sum(Function(y) y.Debe),
.HaberT1 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit1 AndAlso x.idAsientoNavigation.Fecha <= fft1).Sum(Function(y) y.Haber),
.DebeT2 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit2 AndAlso x.idAsientoNavigation.Fecha <= fft2).Sum(Function(y) y.Debe),
.HaberT2 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit2 AndAlso x.idAsientoNavigation.Fecha <= fft2).Sum(Function(y) y.Haber),
.DebeT3 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit3 AndAlso x.idAsientoNavigation.Fecha <= fft3).Sum(Function(y) y.Debe),
.HaberT3 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit3 AndAlso x.idAsientoNavigation.Fecha <= fft3).Sum(Function(y) y.Haber),
.DebeT4 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit4 AndAlso x.idAsientoNavigation.Fecha <= fft4).Sum(Function(y) y.Debe),
.HaberT4 = g.Where(Function(x) x.idAsientoNavigation.Fecha >= fit4 AndAlso x.idAsientoNavigation.Fecha <= fft4).Sum(Function(y) y.Haber)
}).OrderBy(Function(x) x.Cuenta).ToList
End If
Exit Do
Catch ex As Exception
If BackGround = False 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 lcbe
End Function
Public Async Sub ObtieneApuntesAsync(bd As tscGrupoSanchoToro, Background As Boolean)
Try
Dim rs As New List(Of CuentaBalanceSumasYSaldos)
Dim fi, ff As DateOnly?
fi = deFechaInicio.EditValue
ff = deFechaFin.EditValue
If Background Then
If fi.HasValue AndAlso ff.HasValue Then
Me.ContenedorAplicacion.IsEnabled = False
Await Task.Run(Sub()
rs = ObtieneApuntes(Background, fi, ff, _Nivel, cbIncluirAsientoApertura.IsChecked)
End Sub)
End If
Else
If fi.HasValue = False OrElse ff.HasValue = False Then
DXMessageBox.Show("Las fechas de inicio y fin son obligatorias", "Atención")
Else
If fi.Value.Year <> ff.Value.Year Then
DXMessageBox.Show("Atención los ejercicios contables desde la fecha de inicio a la de fin son diferentes por lo que los datos trimestrales solo serán del primer año", "Atención")
End If
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando Apuntes ...")
rs = ObtieneApuntes(Background, fi, ff, _Nivel, cbIncluirAsientoApertura.IsChecked)
End If
End If
gc.ItemsSource = rs
DataContext = rs
gc.ExpandAllGroups()
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 ucCuenta, OtrosParametros)
End Sub
Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Dim id As Integer = DirectCast(Me.gc.CurrentItem, cuentas).idCuenta
Dim uc As New ucCuenta(id)
FuncionesDinamicas.AbrirAP(New ucCuenta(id), OtrosParametros)
End Sub
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
ObtieneApuntesAsync(bd, False)
End Sub
End Class
Public Class CuentaBalanceSumasYSaldos
Property Cuenta As String
Property Denominacion As String
Property Debe As Double
Property Haber As Double
ReadOnly Property Saldo As Double
Get
Return Math.Round(Debe - Haber, 2, MidpointRounding.AwayFromZero)
End Get
End Property
Property DebeT1 As Double
Property HaberT1 As Double
ReadOnly Property SaldoT1 As Double
Get
Return Math.Round(DebeT1 - HaberT1, 2, MidpointRounding.AwayFromZero)
End Get
End Property
Property DebeT2 As Double
Property HaberT2 As Double
ReadOnly Property SaldoT2 As Double
Get
Return Math.Round(DebeT2 - HaberT2, 2, MidpointRounding.AwayFromZero)
End Get
End Property
Property DebeT3 As Double
Property HaberT3 As Double
ReadOnly Property SaldoT3 As Double
Get
Return Math.Round(DebeT3 - HaberT3, 2, MidpointRounding.AwayFromZero)
End Get
End Property
Property DebeT4 As Double
Property HaberT4 As Double
ReadOnly Property SaldoT4 As Double
Get
Return Math.Round(DebeT4 - HaberT4, 2, MidpointRounding.AwayFromZero)
End Get
End Property
Property DebeAcumulado As Double
Property HaberAcumulado As Double
ReadOnly Property SaldoAcumulado As Double
Get
Return Math.Round(DebeAcumulado - HaberAcumulado, 2, MidpointRounding.AwayFromZero)
End Get
End Property
End Class

View File

@@ -0,0 +1,44 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
x:Class="ucBancos"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
<Setter Property="Background" Value="#B0E0E6" />
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid x:Name="grid">
<tsWPFCore:tsGridControl x:Name="gc" >
<tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:PropiedadesTSGC CamposObligatorios="Codigo" CamposUnicos="Codigo"/>
</tsWPFCore:tsGridControl.PropiedadesTSGC>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Codigo" Header="Codigo" IsSmart="True" Width="75" />
<dxg:GridColumn FieldName="Nombre" Header="Nombre" IsSmart="True" Width="400" />
<dxg:GridColumn FieldName="BIC" Header="BIC" IsSmart="True" Width="150" />
<dxg:GridColumn FieldName="Obsoleto" Header="Obsoleto" IsSmart="True" Width="75" >
<dxg:GridColumn.EditSettings>
<dxe:CheckEditSettings />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View >
<tsWPFCore:tsTableView x:Name="tvBancos" NewItemRowPosition="Bottom" InitNewRow="tvBancos_InitNewRow" AllowEditing="True" ShowSearchPanelMode="Always" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,152 @@
Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Core
Imports DevExpress.XtraReports.UserDesigner
Imports DevExpress.XtraReports.UI
Imports System.IO
Imports tsl5.Datos
Imports tsWPF
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucBancos
Private bd As tscGrupoSanchoToro
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "Bancos"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Bancos"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "bancos"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Bancos"
End Sub
Public Overrides Sub Cargado()
ContenedorAplicacion.siEstado.IsVisible = False
ContenedorAplicacion.btNuevo.IsVisible = False
ContenedorAplicacion.btGuardar.IsVisible = True
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Dim bancos = (From b In bd.bancos Select b)
Me.gc.ItemsSource = bancos
Return 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.gestionasegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
Private Sub tvBancos_InitNewRow(sender As Object, e As DevExpress.Xpf.Grid.InitNewRowEventArgs)
gc.SetCellValue(e.RowHandle, "Codigo", "")
gc.SetCellValue(e.RowHandle, "Nombre", "")
gc.SetCellValue(e.RowHandle, "BIC", "")
gc.SetCellValue(e.RowHandle, "Obsoleto", False)
End Sub
'Private WithEvents apCL As tsWPF.ApCabLin
'Public ReadOnly Property CampoIndice As String Implements tsWPF.IApCabLin.CampoIndice
' Get
' Return ""
' End Get
'End Property
'Public Sub EstableceApCabLin(ApCabLin As tsWPF.ApCabLin) Implements tsWPF.IApCabLin.EstableceApCabLin
' Me.apCL = ApCabLin
'End Sub
''Public Sub EstableceDataContext(ByRef DataContext As Object, ByRef CampoIndice As String, ValorCampoIndice As Object) Implements tsWPF.IApCabLin.EstableceDataContext
'' Try
'' Dim bancos = (From b In bd.bancos Select b)
'' DataContext = bancos
'' Me.gc.ItemsSource = bancos
'' 'Dim gp = (From e In bd.enumeraciones Select e Where e.gruposenumeraciones.Grupo = "CA").ToList
'' 'Me.cbCentroAcademico.ItemsSource = gp
'' Me.apCL.Estado = tsWPF.EstadosCablin.SinDatos
'' Catch ex As Exception
'' MsgBox(ex.Message)
'' End Try
''End Sub
'Public ReadOnly Property NombreTablaBase As String Implements tsWPF.IApCabLin.NombreTablaBase
' Get
' Return "bancos"
' End Get
'End Property
'Public Function ObtieneContexto(dcn As tsl5.Datos.DatosConexionCliente) As System.Data.Objects.ObjectContext Implements tsWPF.IApCabLin.ObtieneContexto
' bd = bdGrupoSanchoToro.gestionasegasaEntities.NuevoContexto
' Return bd
'End Function
'Public Function ObtienePermisos() As tsWPF.Permisos Implements tsWPF.IApCabLin.ObtienePermisos
' Return bdGrupoSanchoToro.utilidades.ObtienePermisos(Me.bd, "AP.BANCOS", Me.apCL.dsc.idUsuario)
'End Function
'Public Function ObtieneTituloPestaña() As String Implements tsWPF.IApCabLin.ObtieneTituloPestaña
' Return "Bancos"
'End Function
'Public ReadOnly Property Titulo As String Implements tsWPF.IApCabLin.Titulo
' Get
' Return "Bancos"
' End Get
'End Property
'Private Sub apCL_Cargado() Handles apCL.Cargado
' Dim btNuevo = (From it In Me.apCL.ContenedorCL.BarraBotones.Bars(0).ItemLinks Where it.Name = "ilNuevo").First
' btNuevo.IsVisible = False
' Dim btEstado = (From it In Me.apCL.ContenedorCL.BarraBotones.Bars(0).ItemLinks Where it.Name = "ilEstado").First
' btEstado.IsVisible = False
'End Sub
'Private Sub tvBancos_InitNewRow(sender As Object, e As DevExpress.Xpf.Grid.InitNewRowEventArgs)
' gc.SetCellValue(e.RowHandle, "Codigo", "")
' gc.SetCellValue(e.RowHandle, "Nombre", "")
' gc.SetCellValue(e.RowHandle, "BIC", "")
' gc.SetCellValue(e.RowHandle, "Obsoleto", False)
'End Sub
'Public Sub EstableceOrigenDatosAuxiliares(Optional BackGround As Boolean = False) Implements tsWPF.IApCabLin.EstableceOrigenDatosAuxiliares
'End Sub
'Public Function ObtieneDataContext(ValorCampoIndice As Object, Optional BackGround As Boolean = False) As Object Implements tsWPF.IApCabLin.ObtieneDataContext
' Dim bancos = (From b In bd.bancos Select b)
' Me.gc.ItemsSource = bancos
' Me.apCL.Estado = tsWPF.EstadosCablin.SinDatos
' Return bancos
'End Function
End Class

View File

@@ -0,0 +1,49 @@
<tsWPFCore:tsUserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucConceptoApuntes"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1400">
<tsWPFCore:tsUserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
<Setter Property="Background" Value="#B0E0E6" />
</Style>
</ResourceDictionary>
</tsWPFCore:tsUserControl.Resources>
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
<dxlc:LayoutGroup Header="Datos Del Concepto" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch" Orientation="Vertical">
<dxlc:LayoutGroup Orientation="Horizontal">
<tsWPFCore:tsLayoutItem Label="id Concepto:" Width="200">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS UsualCorreccion="False" Modificable="NoModificable" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding idConcepto, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="3" NullText="AUTOMÁTICO" NullValue="0" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Concepto:" Width="400">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Unico="True" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding Concepto, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="1" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Codigo:" Width="200">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Unico="True" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding Codigo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="2" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,155 @@
Imports DevExpress.Xpf.Editors
Imports DevExpress.Xpf.LayoutControl
Imports System.ComponentModel
Imports System.Data
Imports DevExpress.Xpf.Editors.Validation
Imports DevExpress.Xpf.Editors.Helpers
Imports DevExpress.Xpf.Core
Imports System.Data.Common
Imports System.Data.Entity
Imports tsl5.Datos
Imports DevExpress.Xpf.Bars
Imports DevExpress.Xpf.Grid
Imports System.Collections
Imports tsl5.Extensiones
Imports System.Data.Objects.DataClasses
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucConceptoApuntes
Private bd As tscGrupoSanchoToro
Friend _idConcepto As Nullable(Of Integer)
Private lConceptos As List(Of conceptosapuntes)
Public Overrides Sub Cargado()
Me.Tipo_ucControlBusqueda = GetType(ucConceptosApuntes)
End Sub
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Dim ra As conceptosapuntes
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Dim NuevoEstado As EstadosAplicacion
If FuerzaNuevo OrElse _idConcepto Is Nothing Then
ra = New conceptosapuntes
NuevoEstado = EstadosAplicacion.Nuevo
'lgDatosProveedor.DataContext = bd.proveedores.First(Function(x) x.idProveedor = ra.idProveedor) 'ra.entidades
Else
ra = bd.conceptosapuntes.First(Function(x) x.idConcepto = _idConcepto)
NuevoEstado = EstadosAplicacion.ModificandoRegistro
'lgDatosProveedor.DataContext = bd.proveedores.First(Function(x) x.idProveedor = ra.idProveedor) 'ra.entidades
End If
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 "conceptosapuntes"
End Get
End Property
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
If Me.Estado = EstadosAplicacion.Nuevo Then
Return "Concepto Apuntes.Nuevo"
Else
Return "Concepto Apuntes." & DirectCast(Me.DataContext, conceptosapuntes).idConcepto.ToString
End If
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Concepto Apuntes"
End Get
End Property
Public Sub New(Optional idConcepto As Integer? = Nothing)
' Llamada necesaria para el diseñador.
InitializeComponent()
_idConcepto = idConcepto
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Overrides Sub EstableceTitulo()
If Me.Estado = EstadosAplicacion.ModificandoRegistro Then
Dim ca As conceptosapuntes = Me.DataContext
Me.docpanel.Caption = "Concepto Apuntes " & ca.Codigo
Me.docpanel.Tag = "Concepto Apuntes." & ca.Codigo
Else
Me.docpanel.Caption = "Concepto Apuntes Nueva"
Me.docpanel.Tag = "Concepto Apuntes.Nuevo"
End If
' End If
'End If
End Sub
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", 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
Me.ErroresValidacion.EliminaError("validando-" & pts.NombreCampo)
'Select Case pts.NombreCampo.ToLower
' Case "idproveedor_nulable"
' Dim id As Integer = e.Value
' Dim ent = bd.Entidades.First(Function(x) x.idEntidad = id)
' lgDatosProveedor.DataContext = ent
'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
_idConcepto = ra.idConcepto
End Sub
Private Sub ap_EstadoCambiado(EstadoAnterior As EstadosAplicacion, EstadoNuevo As EstadosAplicacion) Handles Me.EstadoCambiado
Select Case EstadoNuevo
Case EstadosAplicacion.ModificandoRegistro
Dim ra As conceptosapuntes = Me.DataContext
End Select
End Sub
End Class

View File

@@ -0,0 +1,56 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" x:Class="ucConceptosApuntes"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<tsWPFCore:tsUserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</tsWPFCore:tsUserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Búsqueda Rápida" Orientation="Vertical" x:Name="BusquedaRapida">
<dxlc:LayoutGroup Width="600" HorizontalAlignment="Left" >
<dxlc:LayoutGroup Orientation="Vertical">
<tsWPFCore:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" FontWeight="Normal" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
</dxlc:LayoutGroup>
<dxlc:LayoutItem Label="Campos de búsqueda:">
<Border BorderThickness="1" BorderBrush="Black" >
<StackPanel Orientation="Horizontal" >
<TextBlock x:Name="tbCamposBusqueda" Text="idConcepto, Codigo, Concepto"/>
<TextBlock Margin="20,0,0,0" Text="(En Blanco Muestra Todos)" FontWeight="Bold" ></TextBlock>
</StackPanel>
</Border>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" >
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:PropiedadesTSGC />
</tsWPFCore:tsGridControl.PropiedadesTSGC>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="idConcepto" Width="120" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
<dxg:GridColumn FieldName="Concepto" Width="400" IsSmart="True" />
<dxg:GridColumn FieldName="Codigo" Header="Código" Width="100" IsSmart="True" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPFCore:tsTableView x:Name="tv" ShowSearchPanelMode="Always" AllowEditing="False" ShowGroupPanel="True" ShowTotalSummary="True" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,158 @@
Imports System.Data.Entity
Imports DevExpress.Xpf.Core
Imports System.Collections
Imports DevExpress.Xpf.Bars
Imports System.Threading.Tasks
Imports System.Linq.Dynamic
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucConceptosApuntes
Private bd As tscGrupoSanchoToro
Private _CamposBusquedaNumericos() As String = {"idConcepto"}
Private _CamposBusquedaAlfabeticos() As String = {"Codigo", "Concepto"}
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.HabilitarRefresco = True
End Sub
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
If Background Or Refrescar Then ObtieneConceptosApuntesAsync(Background)
Return EstadosAplicacion.AplicacionSinIndice
End Function
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Conceptos Apuntes"
End Sub
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "ConceptosApuntes"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "conceptosapuntes"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Conceptos Apuntes"
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.CONTABILIDAD", idUsuario)
End Function
Private Sub Nuevo() Handles Me.BotonNuevoPulsado
Dim r As New ucConceptoApuntes
FuncionesDinamicas.AbrirAP(r, 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, conceptosapuntes)
Select Case Celda.Column.FieldName.ToLower
Case "idconcepto"
Dim id As Integer = ra.idConcepto
FuncionesDinamicas.AbrirAP(New ucConceptoApuntes(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 ObtieneConceptosApuntes(ByRef Background As Boolean, TextoBusqueda As String) As List(Of conceptosapuntes)
Dim rs As IQueryable(Of conceptosapuntes)
Dim lf As New List(Of conceptosapuntes)
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.conceptosapuntes.Where(ExpresionBusqueda, parametros)
Else
rs = bd.conceptosapuntes.OrderByDescending(Function(x) x.Concepto)
End If
lf = rs.ToList
Exit Do
Catch ex As Exception
If Background = False 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 lf
End Function
Public Async Sub ObtieneConceptosApuntesAsync(Background As Boolean)
Try
Dim rs As New List(Of conceptosapuntes)
Dim Busqueda = tsl5.Extensiones.ObjetoNothingAVacio(Me.teBusqueda.EditValue)
If Background Then
Me.ContenedorAplicacion.IsEnabled = False
Await Task.Run(Sub()
rs = ObtieneConceptosApuntes(Background, Busqueda)
End Sub)
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando Facturas Recibidas ...")
rs = ObtieneConceptosApuntes(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)
ObtieneConceptosApuntesAsync(False)
End Sub
End Class

View File

@@ -0,0 +1,634 @@
<tsWPFCore:tsUserControl x:Class="ucCuenta"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
mc:Ignorable="d" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
<Setter Property="Background" Value="#B0E0E6" />
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
<dxlc:LayoutControl Name="LayoutControl1" Orientation="Vertical">
<dxlc:LayoutGroup Header="Cuenta" Name="lgDetalle" View="GroupBox" ItemLabelsAlignment="Default" IsLocked="True" Orientation="Vertical" Width="Auto" HorizontalAlignment="Stretch">
<dxlc:LayoutGroup Orientation="Horizontal" HorizontalAlignment="Stretch">
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" ItemLabelsAlignment="Local" Width="250">
<tsWPFCore:tsLayoutItem Label="Ejercicio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Obligatorio="True"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:ComboBoxEdit x:Name="cbEjercicio" EditValue="{Binding idEjercicio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" ValueMember="idEjercicio" DisplayMember="Descripcion" TabIndex="100" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Cuenta:">
<dxe:TextEdit EditValue="{Binding NumeroCuenta, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" ItemLabelsAlignment="Local" Width="550">
<tsWPFCore:tsLayoutItem Label="Denominación:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Obligatorio="True"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding Denominacion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="1"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Empresa Amortización:">
<dxe:ComboBoxEdit AllowNullInput="True" x:Name="cbEmpresaAmortizacion" EditValue="{Binding idEmpresaAmortizacion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" DisplayMember="Descripcion" ValueMember="idEnumeracion" TabIndex="4" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" ItemLabelsAlignment="Local" Width="250">
<tsWPFCore:tsLayoutItem Label="Mote:">
<dxe:TextEdit EditValue="{Binding Mote, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="2"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Es Cuenta Final:" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:CheckEdit EditValue="{Binding EsCuentaFinal, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="101"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<dx:DXTabControl Width="Auto" HorizontalAlignment="Stretch" TabIndex="11" >
<dx:DXTabControl.View>
<dx:TabControlScrollView />
</dx:DXTabControl.View>
<dx:DXTabItem Header="Apuntes">
<tsWPFCore:tsGridControl x:Name="gcApuntes" TabIndex="5">
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:PropiedadesTSGC/>
</tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:tsGridControl.View>
<tsWPFCore:tsTableView x:Name="tvApuntes" NewItemRowPosition="Bottom" ShowSearchPanelMode="Always" ShowTotalSummary="True" />
</tsWPFCore:tsGridControl.View >
<tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridSummaryItem SummaryType="Sum" FieldName="Debe" DisplayFormat="T. Debe: {0:c2}" ShowInColumn="Debe" />
<dxg:GridSummaryItem SummaryType="Sum" FieldName="Haber" DisplayFormat="T. Haber: {0:c2}" ShowInColumn="Haber" />
</tsWPFCore:tsGridControl.TotalSummary>
<tsWPFCore:tsGridControl.Columns>
<dxg:GridColumn FieldName="idAsiento" Header="id Asiento" IsSmart="True" Width="140" CellTemplate="{DynamicResource VerDetalleTemplate}"/>
<dxg:GridColumn FieldName="cuentas.NumeroCuenta" Header="Nº Cuenta" IsSmart="True" Width="140" />
<dxg:GridColumn FieldName="asientos.Fecha" Header="Fecha" Width="90" IsSmart="True"/>
<dxg:GridColumn FieldName="Concepto" Header="Concepto" IsSmart="True" Width="400" >
<dxg:GridColumn.EditSettings>
<dxe:ButtonEditSettings x:Name="btConcepto" >
</dxe:ButtonEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Debe" Header="Debe" IsSmart="True" Width="150" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Haber" Header="Haber" IsSmart="True" Width="150" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoCuentaTmp" Header="Saldo" IsSmart="True" Width="150" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<tsWPFCore:tsGridColumn Width="220" Header="Tipo Documento" FieldName="TipoDocumento">
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ComboBoxEditSettings ValueMember="id" x:Name="cbTipoDocumento" IncrementalFiltering="True" DisplayMember="Descripcion" AutoComplete="True"/>
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="NumeroDocumento" Header="Nº Documento" IsSmart="True" Width="220" CellTemplate="{DynamicResource VerDetalleTemplate}" />
</tsWPFCore:tsGridControl.Columns>
</tsWPFCore:tsGridControl>
</dx:DXTabItem>
<dx:DXTabItem Header="Totales / Presupuesto">
<dxlc:LayoutGroup HorizontalAlignment="Left" >
<dxlc:LayoutGroup Orientation="Vertical" ItemLabelsAlignment="Local" Width="200" x:Name="lgDebe" View="GroupBox" Header="DEBE" >
<dxlc:LayoutGroup.HeaderTemplate>
<DataTemplate>
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="DEBE" FontWeight="Black" />
</StackPanel>
</Grid>
</DataTemplate>
</dxlc:LayoutGroup.HeaderTemplate>
<tsWPFCore:tsLayoutItem Label="Enero:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeEnero, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="6"/>
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Febrero:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeFebrero, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Marzo:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeMarzo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Abril:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeAbril, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Mayo:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeMayo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Junio:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeJunio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Julio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeJulio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Agosto:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeAgosto, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Septiembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeSeptiembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Octubre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeOctubre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Noviembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeNoviembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Diciembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DebeDiciembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Total:" FontWeight="Bold" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding TotalDebe, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" ItemLabelsAlignment="Local" Width="200" x:Name="lgHaber" View="GroupBox" >
<dxlc:LayoutGroup.HeaderTemplate>
<DataTemplate>
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="HABER" FontWeight="Black" />
</StackPanel>
</Grid>
</DataTemplate>
</dxlc:LayoutGroup.HeaderTemplate>
<tsWPFCore:tsLayoutItem Label="Enero:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberEnero, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="7"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Febrero:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberFebrero, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="10"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Marzo:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberMarzo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="13"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Abril:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberAbril, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="16"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Mayo:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberMayo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="19"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Junio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberJunio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="22"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Julio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberJulio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="25"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Agosto:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberAgosto, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="28"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Septiembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberSeptiembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="31"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Octubre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberOctubre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="34"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Noviembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberNoviembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="37"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Diciembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding HaberDiciembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="40"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Total:" FontWeight="Bold" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding TotalHaber, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="43"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" Width="200" HorizontalAlignment="Left" x:Name="lgSaldo" ItemLabelsAlignment="Local" View="GroupBox" >
<dxlc:LayoutGroup.HeaderTemplate>
<DataTemplate>
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="SALDO" FontWeight="Black" />
</StackPanel>
</Grid>
</DataTemplate>
</dxlc:LayoutGroup.HeaderTemplate>
<tsWPFCore:tsLayoutItem Label="Enero:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoEnero, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="8"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Febrero:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoFebrero, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="11"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Marzo:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoMarzo, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Abril:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoAbril, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="17"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Mayo:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoMayo, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="20"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Junio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoJunio, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="23"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Julio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoJulio, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="26"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Agosto:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoAgosto, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="29"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Septiembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoSeptiembre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="32"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Octubre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoOctubre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="35"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Noviembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoNoviembre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="38"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Diciembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding SaldoDiciembre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="41"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Total:" FontWeight="Bold" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding TotalSaldo, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="44"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" Width="200" ItemLabelsAlignment="Local" View="GroupBox">
<dxlc:LayoutGroup.HeaderTemplate>
<DataTemplate>
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="PRESUPUESTO" FontWeight="Black" />
</StackPanel>
</Grid>
</DataTemplate>
</dxlc:LayoutGroup.HeaderTemplate>
<tsWPFCore:tsLayoutItem Label="Enero:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoEnero, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="9"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Febrero:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoFebrero, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="12"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Marzo:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoMarzo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Abril:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoAbril, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="18"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Mayo:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoMayo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="21"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Junio:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoJunio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="24"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Julio:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoJulio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="27"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Agosto:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoAgosto, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="30"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Septiembre:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoSeptiembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="33"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Octubre:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoOctubre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="36"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Noviembre:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoNoviembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="39"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Diciembre:">
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PresupuestoDiciembre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="42"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Total:" FontWeight="Bold" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding TotalPresupuestado, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="45"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" ItemLabelsAlignment="Local" Width="200" x:Name="lgDesvio" View="GroupBox" Header="DESVÍO">
<dxlc:LayoutGroup.HeaderTemplate>
<DataTemplate>
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="DESVIO PRESUPUESTO" FontWeight="Black" />
</StackPanel>
</Grid>
</DataTemplate>
</dxlc:LayoutGroup.HeaderTemplate>
<tsWPFCore:tsLayoutItem Label="Enero:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoEnero, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="7"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Febrero:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoFebrero, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="10"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Marzo:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoMarzo, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="13"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Abril:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoAbril, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="16"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Mayo:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoMayo, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="19"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Junio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoJunio, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="22"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Julio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoJulio, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="25"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Agosto:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoAgosto, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="28"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Septiembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoSeptiembre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="31"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Octubre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoOctubre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="34"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Noviembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoNoviembre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="37"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Diciembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoDiciembre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="40"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Total:" FontWeight="Bold" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding DesvioPresupuestoTotal, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="43"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" ItemLabelsAlignment="Local" Width="200" x:Name="lgPorcentajeDesvio" View="GroupBox" >
<dxlc:LayoutGroup.HeaderTemplate>
<DataTemplate>
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="% DESVIO PRESUPUESTO" FontWeight="Black" />
</StackPanel>
</Grid>
</DataTemplate>
</dxlc:LayoutGroup.HeaderTemplate>
<tsWPFCore:tsLayoutItem Label="Enero:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoEnero, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="7"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Febrero:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoFebrero, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="10"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Marzo:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoMarzo, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="13"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Abril:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoAbril, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="16"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Mayo:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoMayo, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="19"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Junio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoJunio, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="22"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Julio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoJulio, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="25"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Agosto:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoAgosto, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="28"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Septiembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoSeptiembre, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="31"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Octubre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoOctubre, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="34"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Noviembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoNoviembre, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="37"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Diciembre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoDiciembre, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="40"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Total:" FontWeight="Bold" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit HorizontalContentAlignment="Right" Mask="P2" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PorcentajeDesvioPresupuestoTotal, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="43"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dx:DXTabItem>
</dx:DXTabControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,350 @@
Imports DevExpress.Xpf.Editors
Imports DevExpress.Xpf.LayoutControl
Imports tsWPF
Imports System.Data
Imports DevExpress.Xpf.Editors.Validation
Imports DevExpress.Xpf.Editors.Helpers
Imports DevExpress.Xpf.Core
Imports tsWPF.modExtensiones
Imports System.Data.Common
Imports System.Data.Entity
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Bars
Imports DevExpress.Xpf.Grid
Imports tsl5.Datos
Imports tsl5.Extensiones.StringExtensions
Imports tsWPFCore.Comun
Imports tsUtilidades
Imports tsWPFCore
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucCuenta
Private bd As tscGrupoSanchoToro
Private _idCuenta As Integer?
Private ra As cuentas
Public Sub New(Optional idCuenta As Integer? = Nothing)
' Esta llamada es exigida por el diseñador.
InitializeComponent()
_idCuenta = idCuenta
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
If Estado = EstadosAplicacion.Nuevo Then
Return "Cuenta.Nuevo"
Else
Dim cta = DirectCast(Me.DataContext, cuentas)
Return "Cuenta." & cta.NumeroCuenta.ToString & " (" & cta.idEjercicioNavigation.Descripcion & ")"
End If
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Cuenta"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "cuentas"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
cbEmpresaAmortizacion.ItemsSource = bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "EMPAMO")
cbEjercicio.ItemsSource = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
End Sub
Public Overrides Sub EstableceTitulo()
If Me.docpanel Is Nothing Then
Dim w As dxwGenerica = Window.GetWindow(Me)
w.Title = "Agregar nueva cuenta"
Else
If Me.Estado = EstadosAplicacion.ModificandoRegistro Then
Dim cta As cuentas = Me.DataContext
Me.docpanel.Caption = "Cuenta " & cta.NumeroCuenta.ToString & " (" & cta.idEjercicioNavigation.Descripcion & ")"
Me.docpanel.Tag = "Cuenta." & cta.idCuenta
Else
Me.docpanel.Caption = "Cuenta Nuevo"
Me.docpanel.Tag = "Cuenta.Nuevo"
End If
End If
End Sub
Public Overrides Sub Cargado()
Me.Tipo_ucControlBusqueda = GetType(ucCuentas)
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Dim NuevoEstado As EstadosAplicacion
If FuerzaNuevo OrElse _idCuenta Is Nothing Then
ra = New bdGrupoSanchoToro.db.cuentas
Me.DataContext = ra
_idCuenta = Nothing
ra.idEjercicioNavigation = bd.ejercicioscontables.Where(Function(X) X.FechaCierre.HasValue = False).OrderByDescending(Function(X) X.FechaApertura).First
NuevoEstado = EstadosAplicacion.Nuevo
Else
ra = bd.cuentas.First(Function(x) x.idCuenta = _idCuenta.Value)
NuevoEstado = EstadosAplicacion.ModificandoRegistro
lgDebe.DataContext = ra.ValoresExtendidos
lgHaber.DataContext = ra.ValoresExtendidos
lgSaldo.DataContext = ra.ValoresExtendidos
lgDesvio.DataContext = ra.ValoresExtendidos
lgPorcentajeDesvio.DataContext = ra.ValoresExtendidos
If ra.Nivel = 8 Then
If bd.apuntes.Any(Function(x) x.idCuenta = ra.idCuenta) Then
tsUserControl.EstableceSoloLectura(cbEjercicio, True)
End If
Else
If bd.apuntes.Any(Function(x) x.idCuentaNavigation.NumeroCuenta.StartsWith(ra.NumeroCuenta) And x.idAsientoNavigation.idEjercicio = ra.idEjercicio) Then
tsUserControl.EstableceSoloLectura(cbEjercicio, True)
End If
End If
End If
Me.DataContext = ra
Dim aps As List(Of apuntes)
If ra.EsCuentaFinal Then
aps = bd.apuntes.Include("asientos").Include("cuentas").Where(Function(x) x.idCuenta = ra.idCuenta).OrderBy(Function(x) x.idAsientoNavigation.Fecha).ThenBy(Function(x) x.idAsientoNavigation.NumeroAsiento).ThenBy(Function(x) x.idAsientoNavigation.idAsiento).ToList()
Else
aps = bd.apuntes.Include("asientos").Include("cuentas").Where(Function(x) x.idCuentaNavigation.NumeroCuenta.StartsWith(ra.NumeroCuenta) And x.idAsientoNavigation.idEjercicio = ra.idEjercicio).OrderBy(Function(x) x.idAsientoNavigation.Fecha).ThenBy(Function(x) x.idAsientoNavigation.NumeroAsiento).ThenBy(Function(x) x.idAsiento).ToList
End If
bdGrupoSanchoToro.db.apuntes.EstableceSaldoTmp(aps)
gcApuntes.ItemsSource = aps
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.gestionasegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
Private Sub ucCuenta_ValidarControl(sender As Object, e As DevExpress.Xpf.Editors.ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
Try
Dim pts As PropiedadesTS = sender.parent.propiedadests
If Not pts Is Nothing Then
Select Case pts.NombreCampo.ToLower
Case "numerocuenta"
Dim re = New Text.RegularExpressions.Regex("[0-9]")
Dim sNC As String = e.Value
Dim rs As Integer
If Not Integer.TryParse(sNC, rs) Then
Throw New Exception("Solo se admiten numeros en el nº de cuenta")
Else
If rs < 0 Then
Throw New Exception("Solo se admiten numeros en el nº de cuenta")
Else
If sNC.Length <> 8 And sNC.Length <> 4 And sNC.Length <> 3 And sNC.Length <> 2 And sNC.Length <> 1 Then
Throw New Exception("Los nº de dígitos de la cuenta deben ser 8,4,3,2 o 1.")
End If
End If
End If
ra.EsCuentaFinal = (sNC.Length = 8)
End Select
End If
Catch ex As Exception
Dim sCodigoError As String = "validando-"
ev = New ErrorValidacion(sCodigoError, sender, ex.Message, ex, DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical)
e.IsValid = False
End Try
End Sub
Private Sub apCL_EstadoCambiado(EstadoAnterior As EstadosAplicacion, EstadoNuevo As EstadosAplicacion) Handles Me.EstadoCambiado
Select Case EstadoNuevo
Case EstadosAplicacion.Nuevo
Dim ejs = bd.ejercicioscontables.Where(Function(x) x.FechaCierre Is Nothing).OrderByDescending(Function(x) x.FechaInicio).ToList
cbEjercicio.ItemsSource = ejs
cbEjercicio.EditValue = ejs.First.idEjercicio
Case EstadosAplicacion.ModificandoRegistro
cbEjercicio.ItemsSource = bd.ejercicioscontables.Where(Function(x) x.FechaCierre Is Nothing Or x.idEjercicio = ra.idEjercicio).OrderByDescending(Function(x) x.FechaInicio).ToList
If ra.idEjercicioNavigation.FechaCierre.HasValue Then
EstableceSoloLectura()
Else
tsUserControl.EstableceSoloLectura(cbEjercicio, ra.apuntes.Count > 0)
End If
End Select
End Sub
Private Sub apCL_CampoActualizado(sender As Object, e As DataTransferEventArgs) Handles Me.CampoActualizado
Dim pts As PropiedadesTS = sender.parent.propiedadests
If Not pts Is Nothing Then
If pts.NombreCampo.ToLower.StartsWith("presupuesto") Then
ra.ActualizaTotalPresupuestado()
End If
End If
End Sub
Private Sub apCL_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 bd.cuentas.Any(Function(x) x.idCuenta <> ra.idCuenta And x.NumeroCuenta = ra.NumeroCuenta And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_EXISTENTE", "Ya existe la cuenta del ejercicio indicado")
Else
If bd.cuentas.Any(Function(x) x.idCuenta <> ra.idCuenta And x.Mote = ra.Mote And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_EXISTENTE", "Ya existe unaa cuenta con el mismo mote")
End If
End If
Select Case ra.NumeroCuenta.NothingAVacio.Length
Case 8
Dim Cta4 = ra.NumeroCuenta.Substring(0, 4)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta4 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_4", "La cuenta superior de 4 dígitos no existe. Creela primero.")
End If
Dim Cta3 = ra.NumeroCuenta.Substring(0, 3)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta3 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_3", "La cuenta superior de 3 dígitos no existe. Creela primero.")
End If
Dim Cta2 = ra.NumeroCuenta.Substring(0, 2)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta2 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_2", "La cuenta superior de 2 dígitos no existe. Creela primero.")
End If
Dim Cta1 = ra.NumeroCuenta.Substring(0, 1)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta1 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_1", "La cuenta superior de 1 dígito no existe. Creela primero.")
End If
Case 4
Dim Cta3 = ra.NumeroCuenta.Substring(0, 3)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta3 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_3", "La cuenta superior de 3 dígitos no existe. Creela primero.")
End If
Dim Cta2 = ra.NumeroCuenta.Substring(0, 2)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta2 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_2", "La cuenta superior de 2 dígitos no existe. Creela primero.")
End If
Dim Cta1 = ra.NumeroCuenta.Substring(0, 1)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta1 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_1", "La cuenta superior de 1 dígito no existe. Creela primero.")
End If
Case 3
Dim Cta2 = ra.NumeroCuenta.Substring(0, 2)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta2 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_2", "La cuenta superior de 2 dígitos no existe. Creela primero.")
End If
Dim Cta1 = ra.NumeroCuenta.Substring(0, 1)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta1 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_1", "La cuenta superior de 1 dígito no existe. Creela primero.")
End If
Case 2
Dim Cta1 = ra.NumeroCuenta.Substring(0, 1)
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = Cta1 And x.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_SUPERIOR_1", "La cuenta superior de 1 dígito no existe. Creela primero.")
End If
Case 1
Case Else
hte.Add("Almacenar-NUMERO_DIGITOS_ERRONEOS", "El nº de dígitos es erróneo")
End Select
'If ra.TotalPresupuestado > 0 And (ra.EsCuentaFinal = False Or (ra.NumeroCuenta.StartsWith("6") = False And ra.NumeroCuenta.StartsWith("7") = False)) Then
' hte.Add("Almacenar-PRESUPUESTO_CUENTA_INALIDA", "El presupuesto solo se debe rellenar en cuentas finales del grupo 6 y 7")
'End If
If hte.Count > 0 Then
MensajesError = hte
Cancelar = True
Else
Select Case Estado
Case EstadosAplicacion.Nuevo
If ra.EsCuentaFinal Then
ActualizaCuentaSuperior(ra.CuentaSuperior4, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, 1)
ActualizaCuentaSuperior(ra.CuentaSuperior3, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, 1)
ActualizaCuentaSuperior(ra.CuentaSuperior2, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, 1)
ActualizaCuentaSuperior(ra.CuentaSuperior1, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, 1)
End If
Case EstadosAplicacion.ModificandoRegistro
If ra.EsCuentaFinal Then
ActualizaCuentaSuperior(ra.CuentaSuperior4, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, 1)
ActualizaCuentaSuperior(ra.CuentaSuperior3, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, 1)
ActualizaCuentaSuperior(ra.CuentaSuperior2, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, 1)
ActualizaCuentaSuperior(ra.CuentaSuperior1, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, 1)
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
Dim raant = bd.cuentas.First(Function(x) x.idCuenta = ra.idCuenta)
ActualizaCuentaSuperior(ra.CuentaSuperior4, raant.PresupuestoEnero, raant.PresupuestoFebrero, raant.PresupuestoMarzo, raant.PresupuestoAbril, raant.PresupuestoMayo, raant.PresupuestoJunio, raant.PresupuestoJulio, raant.PresupuestoAgosto, raant.PresupuestoSeptiembre, raant.PresupuestoOctubre, raant.PresupuestoNoviembre, raant.PresupuestoDiciembre, -1)
ActualizaCuentaSuperior(ra.CuentaSuperior3, raant.PresupuestoEnero, raant.PresupuestoFebrero, raant.PresupuestoMarzo, raant.PresupuestoAbril, raant.PresupuestoMayo, raant.PresupuestoJunio, raant.PresupuestoJulio, raant.PresupuestoAgosto, raant.PresupuestoSeptiembre, raant.PresupuestoOctubre, raant.PresupuestoNoviembre, raant.PresupuestoDiciembre, -1)
ActualizaCuentaSuperior(ra.CuentaSuperior2, raant.PresupuestoEnero, raant.PresupuestoFebrero, raant.PresupuestoMarzo, raant.PresupuestoAbril, raant.PresupuestoMayo, raant.PresupuestoJunio, raant.PresupuestoJulio, raant.PresupuestoAgosto, raant.PresupuestoSeptiembre, raant.PresupuestoOctubre, raant.PresupuestoNoviembre, raant.PresupuestoDiciembre, -1)
ActualizaCuentaSuperior(ra.CuentaSuperior1, raant.PresupuestoEnero, raant.PresupuestoFebrero, raant.PresupuestoMarzo, raant.PresupuestoAbril, raant.PresupuestoMayo, raant.PresupuestoJunio, raant.PresupuestoJulio, raant.PresupuestoAgosto, raant.PresupuestoSeptiembre, raant.PresupuestoOctubre, raant.PresupuestoNoviembre, raant.PresupuestoDiciembre, -1)
End If
End Select
End If
End Sub
Private Sub apCL_AntesEliminar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, ByRef EliminacionManual As Boolean) Handles Me.AntesEliminar
Dim hte As New Hashtable
If ra.apuntes.Count > 0 Then
hte.Add("Almacenar-CUENTA_CON_APUNTES", "No se puede eliminar una cuenta que ya tiene apuntes.")
End If
If Not ra.EsCuentaFinal Then
If bd.apuntes.Any(Function(x) x.idCuentaNavigation.NumeroCuenta.StartsWith(ra.NumeroCuenta) And x.idAsientoNavigation.idEjercicio = ra.idEjercicio) Then
hte.Add("Almacenar-CUENTA_INFERIOR_CON_APUNTES", "No se puede eliminar una cuenta que ya tiene apuntes.")
End If
End If
If hte.Count = 0 And ra.EsCuentaFinal = False Then
Dim ci = bd.cuentas.Where(Function(x) x.idEjercicio = ra.idEjercicio And x.NumeroCuenta.StartsWith(ra.NumeroCuenta))
For i = ci.Count - 1 To 0 Step -1
bd.Remove(ci(i))
Next
End If
If hte.Count > 0 Then
MensajesError = hte
Cancelar = True
Else
If ra.EsCuentaFinal Then
ActualizaCuentaSuperior(ra.CuentaSuperior4, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, -1)
ActualizaCuentaSuperior(ra.CuentaSuperior3, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, -1)
ActualizaCuentaSuperior(ra.CuentaSuperior2, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, -1)
ActualizaCuentaSuperior(ra.CuentaSuperior1, ra.PresupuestoEnero, ra.PresupuestoFebrero, ra.PresupuestoMarzo, ra.PresupuestoAbril, ra.PresupuestoMayo, ra.PresupuestoJunio, ra.PresupuestoJulio, ra.PresupuestoAgosto, ra.PresupuestoSeptiembre, ra.PresupuestoOctubre, ra.PresupuestoNoviembre, ra.PresupuestoDiciembre, -1)
End If
End If
End Sub
Private Sub ActualizaCuentaSuperior(cta As cuentas, Presupuesto1 As Double, Presupuesto2 As Double, Presupuesto3 As Double, Presupuesto4 As Double, Presupuesto5 As Double, Presupuesto6 As Double, Presupuesto7 As Double, Presupuesto8 As Double, Presupuesto9 As Double, Presupuesto10 As Double, Presupuesto11 As Double, Presupuesto12 As Double, Factor As Integer)
cta.PresupuestoEnero += (Presupuesto1 * Factor)
cta.PresupuestoFebrero += (Presupuesto2 * Factor)
cta.PresupuestoMarzo += (Presupuesto3 * Factor)
cta.PresupuestoAbril += (Presupuesto4 * Factor)
cta.PresupuestoMayo += (Presupuesto7 * Factor)
cta.PresupuestoJunio += (Presupuesto6 * Factor)
cta.PresupuestoJulio += (Presupuesto7 * Factor)
cta.PresupuestoAgosto += (Presupuesto8 * Factor)
cta.PresupuestoSeptiembre += (Presupuesto9 * Factor)
cta.PresupuestoOctubre += (Presupuesto10 * Factor)
cta.PresupuestoNoviembre += (Presupuesto11 * Factor)
cta.PresupuestoDiciembre += (Presupuesto12 * Factor)
End Sub
Private Sub apCL_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Select Case Celda.Column.FieldName.ToLower
Case "idasiento"
Dim id As Integer = DirectCast(Me.gcApuntes.CurrentItem, apuntes).idAsiento
Dim uc As New ucDiario(id)
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
Case "numerodocumento"
Dim ap = DirectCast(Me.gcApuntes.CurrentItem, apuntes)
ucDiario.VerDocumentoApunte(bd, ap)
End Select
End Sub
Private Sub ucCuenta_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
_idCuenta = ra.idCuenta
End Sub
End Class

View File

@@ -0,0 +1,367 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:bdGrupoSanchoToro="clr-namespace:bdGrupoSanchoToro;assembly=bdGrupoSanchoToro" x:Class="ucCuentas"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Filtros" x:Name="lgFiltrosBusquedaRapida" Width="Auto" HorizontalAlignment="Stretch" >
<dxlc:LayoutGroup Orientation="Vertical" Width="800" >
<dxlc:LayoutGroup Orientation="Vertical" >
<dxlc:LayoutGroup >
<tsWPFCore:tsLayoutItem Label="Ejercicios" >
<dxe:ComboBoxEdit ValueMember="idEjercicio" DisplayMember="Descripcion" x:Name="cbEjercicios" TabIndex="3" >
<dxe:ComboBoxEdit.StyleSettings>
<dxe:CheckedComboBoxStyleSettings />
</dxe:ComboBoxEdit.StyleSettings>
</dxe:ComboBoxEdit>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Grupo Cuentas:" Width="300" >
<dxe:ComboBoxEdit ValueMember="Nivel" DisplayMember="Descripcion" x:Name="cbNivel" TabIndex="4" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup>
<tsWPFCore:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" x:FieldModifier="public" FontWeight="Normal" />
</tsWPFCore:tsLayoutItem>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" Margin="20,0,0,0" VerticalAlignment="Top" />
</dxlc:LayoutGroup>
<dxlc:LayoutGroup ItemLabelsAlignment="Local" >
<dxlc:LayoutItem Label="Campos de búsqueda:" >
<Border BorderThickness="1" BorderBrush="Black" >
<TextBlock x:Name="tbCamposBusqueda" Text="Descripción, Nº Cuenta, Mote"/>
</Border>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" >
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="idCuenta" Width="100" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
<dxg:GridColumn FieldName="NumeroCuenta" Width="120" IsSmart="True"/>
<dxg:GridColumn FieldName="Denominacion" Header="Denominación" Width="400" IsSmart="True"/>
<dxg:GridColumn FieldName="Grupo4" Header="Grupo 4 Dígitos" Width="220" IsSmart="True" x:Name="gcGrupo4" />
<dxg:GridColumn FieldName="Grupo3" Header="Grupo 3 Dígitos" Width="220" IsSmart="True" x:Name="gcGrupo3"/>
<dxg:GridColumn FieldName="Grupo2" Header="Grupo 2 Dígitos" Width="220" IsSmart="True" x:Name="gcGrupo2"/>
<dxg:GridColumn FieldName="Grupo1" Header="Grupo 1 Dígito" Width="220" IsSmart="True" x:Name="gcGrupo1"/>
<dxg:GridColumn FieldName="Ejercicio" Header="Ejercicio" Width="100" IsSmart="True"/>
<dxg:GridColumn FieldName="Mote" Header="Mote" Width="150" IsSmart="True"/>
<dxg:GridColumn FieldName="SaldoEnero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoFebrero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoMarzo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoAbril" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoMayo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoJunio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoJulio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoAgosto" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoSeptiembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoOctubre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoNoviembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoDiciembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="TotalSaldo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoEnero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoFebrero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoMarzo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoAbril" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoMayo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoJunio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoJulio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoAgosto" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoSeptiembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoOctubre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoNoviembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoDiciembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="TotalPresupuestado" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoEnero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoFebrero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoMarzo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoAbril" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoMayo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoJunio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoJulio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoAgosto" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoSeptiembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoOctubre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoNoviembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoDiciembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoTotal" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<tsWPFCore:tsGridControl.GroupSummary >
<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº Cuentas:{0:n0}" ShowInGroupColumnFooter="Denominacion" />
<dxg:GridSummaryItem FieldName="SaldoEnero" SummaryType="Sum" ShowInGroupColumnFooter="SaldoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="SaldoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="SaldoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAbril" SummaryType="Sum" ShowInGroupColumnFooter="SaldoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoMayo" SummaryType="Sum" ShowInGroupColumnFooter="SaldoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoJunio" SummaryType="Sum" ShowInGroupColumnFooter="SaldoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoJulio" SummaryType="Sum" ShowInGroupColumnFooter="SaldoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="SaldoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="TotalSaldo" SummaryType="Sum" ShowInGroupColumnFooter="TotalSaldo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoEnero" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoAbril" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoMayo" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoJunio" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoJulio" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="TotalPresupuestado" SummaryType="Sum" ShowInGroupColumnFooter="TotalPresupuestado" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoEnero" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoAbril" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoMayo" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoJunio" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoJulio" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoTotal" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoTotal" DisplayFormat=" {0:c2}" />
</tsWPFCore:tsGridControl.GroupSummary>
<tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº Cuentas: {0:n0}" ShowInColumn="Denominacion" TextBlock.TextAlignment="Left" />
<dxg:GridSummaryItem FieldName="SaldoEnero" SummaryType="Sum" ShowInGroupColumnFooter="SaldoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="SaldoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="SaldoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAbril" SummaryType="Sum" ShowInGroupColumnFooter="SaldoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoMayo" SummaryType="Sum" ShowInGroupColumnFooter="SaldoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoJunio" SummaryType="Sum" ShowInGroupColumnFooter="SaldoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoJulio" SummaryType="Sum" ShowInGroupColumnFooter="SaldoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="SaldoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="TotalSaldo" SummaryType="Sum" ShowInGroupColumnFooter="TotalSaldo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoEnero" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoAbril" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoMayo" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoJunio" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoJulio" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="TotalPresupuestado" SummaryType="Sum" ShowInGroupColumnFooter="TotalPresupuestado" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoEnero" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoAbril" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoMayo" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoJunio" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoJulio" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoTotal" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoTotal" DisplayFormat=" {0:c2}" />
</tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridControl.View>
<tsWPFCore:tsTableView ShowGroupFooters="True" ShowGroupPanel="True" ShowSearchPanelMode="Always" ShowTotalSummary="True" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,279 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports System.Linq.Dynamic
Imports DevExpress.Xpf.Bars
Imports tsl5.Datos
Imports tsWPF
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucCuentas
Dim bd As tscGrupoSanchoToro
Dim EjerContables As List(Of ejercicioscontables)
' Private _Ejercicios As List(Of Integer)
' Private _NivelCuentas As Integer
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "CuentasContables"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Cuentas"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "cuentas"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
If Me.ContenedorAplicacion.cbAcciones.ItemsSource Is Nothing Then
Dim Acciones As New List(Of tsWPFCore.Accion)
Acciones.Add(New Accion With {
.idAccion = 1,
.Descripcion = "LISTADO DIARIO CUENTAS SELECCIONADAS"})
Acciones.Add(New Accion With {
.idAccion = 2,
.Descripcion = "LISTADO DIARIO CUENTAS SELECCIONADAS (ANTES CIERRE)"})
Acciones.Add(New Accion With {
.idAccion = 3,
.Descripcion = "EXTRACTO DE CUENTAS (MAYOR)"})
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
End If
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Cuentas"
End Sub
Public Overrides Sub Cargado()
GridSeleccion = Me.gc
'Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
'If Me.lgFiltrosBusquedaAvanzada.Visibility = Visibility.Visible Then
' cbEjerciciosBA.ItemsSource = Ejercicios
' Dim ejab = Ejercicios.Where(Function(x) x.FechaCierre Is Nothing)
' Me.cbEjerciciosBA.EditValue = ejab.Select(Function(x) x.idEjercicio).ToList
' cbNivelBA.ItemsSource = bdGrupoSanchoToro.cuentas.ListadoGruposCuentas
' cbNivelBA.EditValue = bdGrupoSanchoToro.cuentas.LongitudCuentaFinal
'Else
' cbEjercicios.ItemsSource = Ejercicios
' Me.cbEjercicios.EditValue = _Ejercicios
' cbNivel.ItemsSource = bdGrupoSanchoToro.cuentas.ListadoGruposCuentas
' cbNivel.EditValue = _NivelCuentas
'End If
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
cbEjercicios.ItemsSource = Ejercicios
Me.cbEjercicios.EditValue = Ejercicios.Where(Function(x) x.FechaCierre.HasValue = False).Select(Function(x) x.idEjercicio).ToList
cbNivel.ItemsSource = bdGrupoSanchoToro.db.cuentas.ListadoGruposCuentas
cbNivel.EditValue = bdGrupoSanchoToro.db.cuentas.LongitudCuentaFinal
Return 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.gestionasegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
'Public Sub New(TextoBusqueda As String, TituloCamposBusqueda As String, CamposBusquedaAlfabeticos() As String, CamposBusquedaNumericos() As String, Ejercicios As List(Of Integer), NivelCuentas As Integer)
' InitializeComponent()
' ' _ListadoFiltrado = ListadoFiltrado
' Me.lgFiltrosBusquedaRapida.Visibility = Visibility.Visible
' Me.lgFiltrosBusquedaAvanzada.Visibility = Visibility.Collapsed
' Me.teBusqueda.Text = TextoBusqueda
' Me.tbCamposBusqueda.Text = TituloCamposBusqueda
' _Ejercicios = Ejercicios
' _CamposBusquedaAlfabeticos = CamposBusquedaAlfabeticos
' _CamposBusquedaNumericos = CamposBusquedaNumericos
' _NivelCuentas = NivelCuentas
'End Sub
Public Sub New()
' Esta llamada es exigida por el diseñador.
InitializeComponent()
'Me.lgFiltrosBusquedaRapida.Visibility = Visibility.Collapsed
'Me.lgFiltrosBusquedaAvanzada.Visibility = Visibility.Visible
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Function ObtieneCuentas(BackGround As Boolean, TextoBusqueda As String, Ejercicios() As Integer, Nivel As Integer) As List(Of vf_cuentas)
Dim iNumExc As Integer = 0
Dim ctas As List(Of vf_cuentas)
Do
Try
Dim ExpresionBusqueda As String = ""
If TextoBusqueda <> "" Then
'Dim CamposBusquedaNumericos() As String = {"TotalDebe", "TotalHaber"}
Dim CamposBusquedaAlfabeticos() As String = {"Denominacion", "Mote"}
Dim CamposBusquedaAlfabeticosPorComienzo() As String = {"NumeroCuenta"}
ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Nothing, CamposBusquedaAlfabeticos, Nothing, CamposBusquedaAlfabeticosPorComienzo)
End If
ctas = bdGrupoSanchoToro.db.vf_cuentas.Obtiene_vf_cuentas(bd, Ejercicios, Nivel, ExpresionBusqueda)
Exit Do
Catch ex As Exception
If BackGround = False 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 ctas
End Function
Public Async Sub ObtienecuentasAsync(bd As tscGrupoSanchoToro, Background As Boolean)
Try
Dim rs As New List(Of vf_cuentas)
Dim ejercicios As New List(Of Integer)
Dim Nivel As Integer
Dim Busqueda As String
Busqueda = Me.teBusqueda.Text.Trim
If cbEjercicios.EditValue IsNot Nothing Then
If cbEjercicios.EditValue.GetType Is GetType(List(Of Object)) Then
Dim loej As List(Of Object) = cbEjercicios.EditValue
For Each ej In loej
ejercicios.Add(CType(ej, Integer))
Next
Else
ejercicios = TryCast(cbEjercicios.EditValue, List(Of Integer))
End If
End If
Nivel = cbNivel.EditValue
If Background Then
Me.ContenedorAplicacion.IsEnabled = False
Await Task.Run(Sub()
rs = ObtieneCuentas(Background, Busqueda, ejercicios.ToArray, Nivel)
End Sub)
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando cuentas ...")
rs = ObtieneCuentas(Background, Busqueda, ejercicios.ToArray, Nivel)
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 ucCuenta(), OtrosParametros)
End Sub
Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Dim id As Integer = DirectCast(Me.gc.SelectedItems(0), vf_cuentas).idCuenta
Dim uc As New ucCuenta(id)
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
End Sub
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
'Dim Nivel As Integer = cbNivel.EditValue
'gcGrupo1.Visible = Nivel > 1
'gcGrupo2.Visible = Nivel > 2
'gcGrupo3.Visible = Nivel > 3
'gcGrupo4.Visible = Nivel > 4
ObtienecuentasAsync(bd, False)
End Sub
'Private Sub CbEjerciciosBA_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs)
' ObtienecuentasAsync(bd, False, True)
'End Sub
Private Sub CbNivelBA_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs)
'Dim Nivel = CInt(e.NewValue)
'gcGrupo1.Visible = Nivel > 1
'gcGrupo2.Visible = Nivel > 2
'gcGrupo3.Visible = Nivel > 3
'gcGrupo4.Visible = Nivel > 4
End Sub
Private Sub ApLineas_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
Try
Select Case idAccion
Case 1 'LISTADO DE DIARIO INCLUIDO CIERRE
Dim vf_ctas = gc.ElementosSeleccionados.Cast(Of vf_cuentas).ToList
If vf_ctas.Count = 0 Then
DXMessageBox.Show("Antes debe seleccionar las cuentas para el listado.", "Atención")
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando cuentas ...")
Dim lc As New List(Of cuentas)
For Each ct In vf_ctas
Dim CUENTA = bd.cuentas.First(Function(x) x.idCuenta = ct.idCuenta)
CUENTA.RellenaApuntesTemporales(True)
lc.Add(CUENTA)
Next
Dim idp = bd.plantillas.First(Function(x) x.Codigo = "CONTA.DIACUEN").idPlantilla
DXSplashScreen.Close()
Informes.MuestraImpresos(bd, idp, lc, Me.GrupoDocumentos, dm.DockController)
End If
Case 2 'LISTADO DE DIARIO SIN CIERRE
Dim vf_ctas = gc.ElementosSeleccionados.Cast(Of vf_cuentas).ToList
If vf_ctas.Count = 0 Then
DXMessageBox.Show("Antes debe seleccionar las cuentas para el listado.", "Atención")
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando cuentas ...")
Dim lc As New List(Of cuentas)
For Each ct In vf_ctas
Dim CUENTA = bd.cuentas.First(Function(x) x.idCuenta = ct.idCuenta)
CUENTA.RellenaApuntesTemporales(False)
lc.Add(CUENTA)
Next
Dim idp = bd.plantillas.First(Function(x) x.Codigo = "CONTA.DIACUEN").idPlantilla
DXSplashScreen.Close()
Informes.MuestraImpresos(bd, idp, lc, Me.GrupoDocumentos, dm.DockController)
End If
Case 3
Dim uc As New ucApuntes
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
End Select
Catch ex As Exception
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
End Class

View File

@@ -0,0 +1,147 @@
<tsWPFCore:tsUserControl x:Class="ucDiario"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
mc:Ignorable="d" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
<Setter Property="Background" Value="#B0E0E6" />
</Style>
<Storyboard x:Key="sbBlink">
<DoubleAnimation Storyboard.TargetProperty="(TextBlock.Opacity)"
From="1.0" To="0.0" Duration="0:0:0.7"
AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</ResourceDictionary>
</UserControl.Resources>
<Grid Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
<dxlc:LayoutControl Name="LayoutControl1" Orientation="Vertical">
<dxlc:LayoutGroup Header="Datos del Asiento" Name="lgDetalle" View="GroupBox" ItemLabelsAlignment="Default" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
<dxlc:LayoutGroup.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" >
<TextBlock Text="Datos del Asiento"/>
<TextBlock x:Name="tbAlerta" Margin="60,0,0,0" Text="ATENCIÓN: " FontWeight="ExtraBold" Loaded="TbAlerta_Loaded" Foreground="red" Visibility="Hidden" ></TextBlock>
</StackPanel>
</DataTemplate>
</dxlc:LayoutGroup.HeaderTemplate>
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" >
<dxlc:LayoutGroup Width="580" >
<tsWPFCore:tsLayoutItem Label="Fecha:" Width="180">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Obligatorio="True"/>
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:DateEdit EditValue="{Binding Fecha, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" AllowNullInput="False" TabIndex="0" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="id Asiento:" Width="180">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding idAsiento_Nulable, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" NullText="« AUTOMÁTICO »" TabIndex="1" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Nº Asiento HP:" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding NumeroAsiento, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" NullText="« AUTOMÁTICO »" TabIndex="2" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<tsWPFCore:tsLayoutItem Label="Usuario:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding usuarios.Nombre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="201"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left">
<tsWPFCore:tsLayoutItem Label="Ejercicio:" Width="250" x:Name="liEjercicio" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Obligatorio="True" Modificable="NoModificable" UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding EjercicioTmp, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=True, ValidatesOnExceptions=true}" NullText="« AUTOMÁTICO »" TabIndex="3" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Punteado:" >
<dxe:CheckEdit IsChecked="{Binding Punteado, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="6" IsThreeState="False" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<tsWPFCore:tsLayoutItem Label="Importe:" Width="200" HorizontalAlignment="Left" >
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit x:Name="teEjercicio" EditValue="{Binding Importe, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" Mask="C2" MaskType="Numeric" MaskUseAsDisplayFormat="True" TabIndex="4" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Fecha Introducción:" Width="270" HorizontalAlignment="Left">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:DateEdit EditValue="{Binding FechaIntroduccion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" AllowNullInput="False" TabIndex="5" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gcApuntes" TabIndex="7" NombreTablaBase="apuntes" >
<tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:PropiedadesTSGC CamposObligatorios="NumeroCuentaTmp,Concepto" Descripcion="Apuntes" />
</tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:tsGridControl.View>
<tsWPFCore:tsTableView x:Name="tvApuntes" NewItemRowPosition="Bottom" ShowSearchPanelCloseButton="False" SearchPanelFindMode="Always" ShowTotalSummary="True" AllowSorting="False" />
</tsWPFCore:tsGridControl.View >
<tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridSummaryItem SummaryType="Sum" FieldName="Debe" DisplayFormat="T. Debe: {0:c2}" ShowInColumn="Debe" />
<dxg:GridSummaryItem SummaryType="Sum" FieldName="Haber" DisplayFormat="T. Haber: {0:c2}" ShowInColumn="Haber" />
<dxg:GridSummaryItem SummaryType="Sum" FieldName="Diferencia" DisplayFormat="Diferencia: {0:c2}" ShowInColumn="TipoDocumento" />
</tsWPFCore:tsGridControl.TotalSummary>
<tsWPFCore:tsGridControl.Columns>
<tsWPFCore:tsGridColumn x:Name="gcNumeroCuenta" FieldName="NumeroCuentaTmp" Header="Cuenta" IsSmart="True" Width="140" Validate="GcNumeroCuenta_Validate">
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ButtonEditSettings x:Name="btCuenta" DefaultButtonClick="BtCuenta_DefaultButtonClick" MaxLength="8" IsEnabled="{Binding Path=Column.IsReadOnly}" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn Width="220" Header="Tipo Documento" FieldName="TipoDocumento" TabStop="False" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ComboBoxEditSettings ValueMember="id" x:Name="cbTipoDocumento" IncrementalFiltering="True" DisplayMember="Descripcion" AutoComplete="True"/>
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="DescripcionCuentaTmp" Header="Descripción Cuenta" IsSmart="True" Width="400" TabStop="False" SoloLectura="True" />
<tsWPFCore:tsGridColumn FieldName="Concepto" Header="Concepto" IsSmart="True" Width="400" x:Name="gcConcepto" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ButtonEditSettings x:Name="btConcepto" DefaultButtonClick="BtConcepto_DefaultButtonClick" MaxLength="200" >
</dxe:ButtonEditSettings>
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="Debe" Header="Debe" IsSmart="True" Width="150" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="Haber" Header="Haber" IsSmart="True" Width="150" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="NumeroDocumento" Header="Nº Documento" IsSmart="True" Width="220" >
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ButtonEditSettings AllowDefaultButton="False" >
<dxe:ButtonEditSettings.Buttons>
<dxe:ButtonInfo GlyphKind="Search" x:Name="VerDocumento" Click="VerDocumento_Click" />
</dxe:ButtonEditSettings.Buttons>
</dxe:ButtonEditSettings>
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
</tsWPFCore:tsGridControl.Columns>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,613 @@
Option Strict Off
Imports DevExpress.Xpf.Editors
Imports DevExpress.Xpf.LayoutControl
Imports tsWPF
Imports System.ComponentModel
Imports System.Data
Imports DevExpress.Xpf.Editors.Validation
Imports DevExpress.Xpf.Editors.Helpers
Imports DevExpress.Xpf.Core
Imports tsWPF.modExtensiones
Imports System.Data.Common
Imports System.Data.Entity
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports tsl5.Extensiones
Imports bdGrupoSanchoToro.apuntes
Imports DevExpress.Xpf.Bars
Imports tsl5.Datos
Imports System.Windows.Media.Animation
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucDiario
Private bd As tscGrupoSanchoToro
Private _idAsiento? As Integer
Private tbAlerta As TextBlock
Private ra As asientos
Public Sub New(Optional idAsiento As Integer? = Nothing)
' Esta llamada es exigida por el diseñador.
InitializeComponent()
_idAsiento = idAsiento
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
If Estado = EstadosAplicacion.Nuevo Then
Return "Asiento.Nuevo"
Else
Return "Asiento." & DirectCast(Me.DataContext, asientos).idAsiento.ToString
End If
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Asientos"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "asientos"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
cbTipoDocumento.ItemsSource = bdGrupoSanchoToro.db.apuntes.ListaTiposDocumentos
If Me.ContenedorAplicacion.cbAcciones.ItemsSource Is Nothing Then
Dim Acciones As New List(Of tsWPFCore.Accion)
Acciones.Add(New Accion With {
.idAccion = 1,
.Descripcion = "LEE ASIENTO MODELO"})
Acciones.Add(New Accion With {
.idAccion = 2,
.Descripcion = "COPIA ASIENTO ACTUAL COMO ASIENTO MODELO"})
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
End If
End Sub
Public Overrides Sub EstableceTitulo()
If Me.docpanel Is Nothing Then
Dim w As dxwGenerica = Window.GetWindow(Me)
w.Title = "Agregar nuevo asiento"
Else
If Me.Estado = EstadosAplicacion.ModificandoRegistro Then
Dim asiento As asientos = Me.DataContext
Me.docpanel.Caption = "Asiento " & asiento.idAsiento.ToString
Me.docpanel.Tag = "Asiento." & asiento.idAsiento.ToString
Else
Me.docpanel.Caption = "Asiento Nuevo"
Me.docpanel.Tag = "Asiento.Nuevo"
End If
End If
End Sub
Public Overrides Sub Cargado()
Me.Tipo_ucControlBusqueda = GetType(ucDiarios)
' Me.GridBusqueda = GetType(ucDiarios)
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Dim NuevoEstado As EstadosAplicacion
If FuerzaNuevo OrElse _idAsiento Is Nothing Then
ra = New asientos
ra.Fecha = Today ' If(uEc.FechaFin > Now.Date, Now.Date, uEc.FechaFin)
ra.FechaIntroduccion = Now
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
uEc = bd.ejercicioscontables.Where(Function(x) x.FechaCierre Is Nothing).OrderByDescending(Function(x) x.FechaInicio).First
ra.Fecha = uEc.FechaInicio
End If
ra.idEjercicioNavigation = uEc
ra.idEjercicio = uEc.idEjercicio
ra.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.NORMAL
ra.Punteado = False
NuevoEstado = EstadosAplicacion.Nuevo
ra.usuarios = bd.usuarios.First(Function(x) x.idUsuario = bdGrupoSanchoToro.Utilidades.dsc.idUsuario)
Else
ra = bd.asientos.First(Function(x) x.idAsiento = _idAsiento)
NuevoEstado = EstadosAplicacion.ModificandoRegistro
End If
Me.DataContext = ra
ra.RellenaCuentaTmp()
gcApuntes.ItemsSource = ra.apuntes
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.gestionasegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
Private Sub ucDiario_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 hte As New Hashtable
Dim sd = Math.Round(ra.apuntes.Sum(Function(x) x.Debe), 2, MidpointRounding.AwayFromZero)
Dim sh = Math.Round(ra.apuntes.Sum(Function(x) x.Haber), 2, MidpointRounding.AwayFromZero)
If sd <> sh Then
hte.Add("Almacenar-SUMA", "La suma del Debe no coincide con la suma del Haber")
Else
If ra.apuntes.Count < 2 Then
hte.Add("Almacenar-Apuntes", "Es obligatorio meter al menos 2 apuntes")
End If
End If
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")
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)
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ó")
End If
If Estado = EstadosAplicacion.Nuevo Then
ra.FechaIntroduccion = tsl5.bbdd.AhoraSqlServer(bd)
ra.idUsuario = idUsuario
End If
If hte.Count > 0 Then
MensajesError = hte
Cancelar = True
Else
ra.idEjercicioNavigation = ej
ra.idEjercicio = ej.idEjercicio
ra.EjercicioTmp = ej.Descripcion
For Each ap In ra.apuntes
ap.idCuenta = bd.cuentas.First(Function(x) x.idEjercicio = ra.idEjercicio And x.NumeroCuenta = ap.NumeroCuentaTmp).idCuenta
If ap.idAsientoNavigation Is Nothing Then ap.idAsientoNavigation = ra
Next
ra.Importe = sd
' If ra.NumeroAsiento.HasValue = False Then ra.EstableceNumeroAsiento(bd)
End If
End Sub
Private Sub ucpersona_ValidarControl(sender As Object, e As DevExpress.Xpf.Editors.ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
Try
Dim pts As PropiedadesTS = sender.parent.propiedadests
If Not pts Is Nothing Then
Select Case pts.NombreCampo.ToLower
Case "fecha"
Dim NuevaFecha As DateOnly = e.Value
NuevaFecha = NuevaFecha.Date
If NuevaFecha <> ra.Fecha Then
Dim Ejercicios = bd.ejercicioscontables.ToList
Dim EjercicioNuevo = Ejercicios.FirstOrDefault(Function(x) x.FechaInicio <= NuevaFecha And x.FechaFin >= NuevaFecha And x.FechaCierre Is Nothing)
If EjercicioNuevo Is Nothing Then
ev = New ErrorValidacion(DirectCast(sender.parent.propiedadests, PropiedadesTS).NumeroObjeto, sender, "No existe ningún ejercicio abierto con la fecha indicada", Nothing, DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical)
Else
Dim EjercicioAnterior = Ejercicios.FirstOrDefault(Function(x) x.FechaInicio <= ra.Fecha And x.FechaFin >= ra.Fecha)
If EjercicioAnterior IsNot Nothing AndAlso ra.apuntes.Count > 1 Then
Dim sCuentasFaltantes As String = ""
If EjercicioAnterior.idEjercicio <> EjercicioNuevo.idEjercicio Then
For Each ap In ra.apuntes
Dim cta = ap.idCuentaNavigation.NumeroCuenta
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = cta And x.idEjercicio = EjercicioNuevo.idEjercicio) Then
sCuentasFaltantes &= cta & ","
End If
Next
If sCuentasFaltantes <> "" Then
ev = New ErrorValidacion(DirectCast(sender.parent.propiedadests, PropiedadesTS).NumeroObjeto, sender, "En el ejercicio de la fecha indicada, no existen las cuentas " & sCuentasFaltantes, Nothing, DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical)
Else
ra.idEjercicioNavigation = EjercicioNuevo
ra.idEjercicio = EjercicioNuevo.idEjercicio
ra.NumeroAsiento = Nothing
ra.RellenaCuentaTmp()
teEjercicio.EditValue = EjercicioNuevo.Descripcion
End If
End If
End If
End If
End If
End Select
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub BtCuenta_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
Try
Dim dxw As New dxwCuentas(bd, ra.idEjercicio)
If dxw.ShowDialog Then
' If tvApuntes.HasValidationError Then tvApuntes.CancelRowEdit()
If gcApuntes.CurrentItem Is Nothing Then tvApuntes.AddNewRow()
If tvApuntes.ActiveEditor Is Nothing Then
Dispatcher.BeginInvoke(New Action(Sub() tvApuntes.ShowEditor()), System.Windows.Threading.DispatcherPriority.Render)
End If
Dim ap As apuntes = gcApuntes.CurrentItem
Dim cta = bd.cuentas.First(Function(x) x.idCuenta = dxw.idCuenta)
ap.NumeroCuentaTmp = cta.NumeroCuenta
ap.DescripcionCuentaTmp = cta.Denominacion
If tvApuntes.ActiveEditor IsNot Nothing Then tvApuntes.ActiveEditor.EditValue = cta.NumeroCuenta
tvApuntes.PostEditor()
gcApuntes.RefreshRow(tvApuntes.FocusedRowHandle)
tvApuntes.MoveNextCell()
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub tvApuntes_CellValueChanged(sender As Object, e As CellValueChangedEventArgs) Handles tvApuntes.CellValueChanged
Try
Dim ap As apuntes = e.Row
If ap IsNot Nothing Then
Select Case e.Column.FieldName.ToLower
Case "numerocuentatmp"
Dim NumeroCuenta As String = ap.NumeroCuentaTmp.NothingAVacio
If NumeroCuenta.Contains(".") Then
NumeroCuenta = NumeroCuenta.Replace(".", "0".PadRight(9 - NumeroCuenta.Length, "0")).Acortar(8)
ap.NumeroCuentaTmp = NumeroCuenta
End If
Dim cta = bd.cuentas.FirstOrDefault(Function(x) x.NumeroCuenta = NumeroCuenta And x.idEjercicio = ra.idEjercicio)
If cta IsNot Nothing Then
ap.DescripcionCuentaTmp = cta.Denominacion
ap.idCuentaNavigation = cta
End If
gcApuntes.RefreshRow(tvApuntes.FocusedRowHandle)
End Select
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub BtConcepto_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
Try
Dim dxw As New dxwConceptosPredefinidos(bd)
If dxw.ShowDialog Then
' If tvApuntes.HasValidationError Then tvApuntes.CancelRowEdit()
If gcApuntes.CurrentItem Is Nothing Then tvApuntes.AddNewRow()
Dim ap As apuntes = gcApuntes.CurrentItem
If tvApuntes.ActiveEditor Is Nothing Then
Dispatcher.BeginInvoke(New Action(Sub() tvApuntes.ShowEditor()), System.Windows.Threading.DispatcherPriority.Render)
End If
Dim con = bd.conceptosapuntes.First(Function(x) x.idConcepto = dxw.idConcepto)
ap.Concepto = con.Concepto
If tvApuntes.ActiveEditor IsNot Nothing Then tvApuntes.ActiveEditor.EditValue = con.Concepto
tvApuntes.PostEditor()
tvApuntes.CloseEditor()
gcApuntes.RefreshRow(tvApuntes.FocusedRowHandle)
tvApuntes.MoveNextCell()
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub tvApuntes_ValidateRow(sender As Object, e As GridRowValidationEventArgs) Handles tvApuntes.ValidateRow
Try
Dim htErrores = New Hashtable
ErroresValidacion.LimpiarErrores("TSGC-" & gcApuntes.PropiedadesTS.NumeroObjeto.ToString & ":" & e.RowHandle.ToString & ":")
Dim ap As apuntes = e.Row
If ap.Debe <> 0 And ap.Haber <> 0 Then
htErrores.Add("ValoresEnDebeYHaber", "Los asientos no pueden tener valor en el debe y el haber al mismo tiempo")
End If
If ap.Debe = 0 And ap.Haber = 0 Then
htErrores.Add("Valor0EnDebeYHaber", "Los asientos deben tener algún valor en el debe y el haber")
End If
If htErrores.Count > 0 Then
Me.AgregaErroresTSGC(gcApuntes, htErrores, e)
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub apCL_EstadoCambiado(EstadoAnterior As EstadosAplicacion, EstadoNuevo As EstadosAplicacion) Handles Me.EstadoCambiado
Try
Select Case EstadoNuevo
Case EstadosAplicacion.ModificandoRegistro
Dim ra As asientos = DataContext
If ra.idEjercicioNavigation.FechaCierre.HasValue Then
EstableceSoloLectura()
End If
End Select
EstableceAlerta()
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub TbAlerta_Loaded(sender As Object, e As RoutedEventArgs)
Try
If tbAlerta Is Nothing Then
tbAlerta = sender
EstableceAlerta()
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub EstableceAlerta()
Try
If tbAlerta IsNot Nothing Then
Dim ra As asientos = Me.DataContext
If ra.idEjercicioNavigation IsNot Nothing AndAlso ra.idEjercicioNavigation.FechaInicio.Year <> Now.Year Then
tbAlerta.Visibility = Visibility.Visible
Dim Emp = ra.idEjercicioNavigation.Descripcion
tbAlerta.Text = "Atención: Ejercicio " & Emp
Dim sb As Storyboard = Me.FindResource("sbBlink")
Storyboard.SetTarget(sb, tbAlerta)
BeginStoryboard(sb)
Else
tbAlerta.Visibility = Visibility.Hidden
End If
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub GcNumeroCuenta_Validate(sender As Object, e As GridCellValidationEventArgs)
Try
If e IsNot Nothing AndAlso e.Value IsNot Nothing Then
If gcApuntes.CurrentItem Is Nothing Then tvApuntes.AddNewRow()
Dim NumeroCuenta As String = e.Value.ToString
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = NumeroCuenta And x.EsCuentaFinal And x.idEjercicio = ra.idEjercicio) Then
If NumeroCuenta.Contains(".") Then
NumeroCuenta = NumeroCuenta.Replace(".", "0".PadRight(9 - NumeroCuenta.Length, "0")).Acortar(8)
End If
If Not bd.cuentas.Any(Function(x) x.NumeroCuenta = NumeroCuenta And x.EsCuentaFinal And x.idEjercicio = ra.idEjercicio) Then
e.SetError("Nº de cuenta incorrecto")
Else
Dim ap As apuntes = gcApuntes.CurrentItem
ap.NumeroCuentaTmp = NumeroCuenta
End If
Else
Dim ap As apuntes = gcApuntes.CurrentItem
ap.NumeroCuentaTmp = NumeroCuenta
End If
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub VerDocumento_Click(sender As Object, e As RoutedEventArgs)
If gcApuntes.CurrentItem IsNot Nothing Then
Dim ap As apuntes = gcApuntes.CurrentItem
VerDocumentoApunte(bd, ap)
End If
End Sub
Friend Shared Sub VerDocumentoApunte(bd As tscGrupoSanchoToro, ap As apuntes)
If ap.NumeroDocumento.NothingAVacio <> "" AndAlso ap.TipoDocumento.HasValue Then
Select Case ap.TipoDocumento
Case TiposDocumentos.RECIBO
Dim rec = bd.movimientoscaja.FirstOrDefault(Function(x) x.idMovimiento = ap.idAplicacion)
If rec IsNot Nothing Then
Dim uc As New ucMovimientoCaja(rec.idRecibo)
FuncionesDinamicas.AbrirAP(uc)
Else
DXMessageBox.Show("El recibo no se encuentra", "Atención")
End If
Case Else
DXMessageBox.Show("Tipo de documento no disponible", "Atención")
End Select
End If
End Sub
' Private Sub apCL_AntesEliminar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, ByRef EliminacionManual As Boolean) Handles Me.AntesEliminar
'bd.asientos.DeleteObject(ra)
'bd.GuardarCambios()
'Cancelar = True
' End Sub
Private Sub ucDiario_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
_idAsiento = ra.idAsiento
ra.RefrescaExtensiones
End Sub
Private Sub ucDiario_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
Select Case idAccion
Case 1 ' lee asiento modelo
If Me.Estado = EstadosAplicacion.Nuevo AndAlso ra.apuntes.Count = 0 AndAlso ra.idEjercicio > 0 Then
Dim dxwam As New dxwAsientosModelo(bd)
If dxwam.ShowDialog Then
Dim am = bd.asientosmodelos.First(Function(x) x.idAsientoModelo = dxwam.idAsientoModelo)
ra.idAsientoModelo = am.idAsientoModelo
For Each ap In am.apuntesmodelo.OrderBy(Function(x) x.Orden)
Dim na As New apuntes
With na
Dim CTA = bd.cuentas.FirstOrDefault(Function(x) x.idEjercicio = ra.idEjercicio And x.NumeroCuenta = ap.NumeroCuenta)
If CTA IsNot Nothing Then
na.DescripcionCuentaTmp = CTA.Denominacion
na.NumeroCuentaTmp = CTA.NumeroCuenta
na.idCuentaNavigation = CTA
na.Concepto = ap.Concepto
na.Debe = ap.Debe
na.Haber = ap.Haber
na.idConcepto = ap.idConcepto
na.NumeroDocumento = ap.NumeroDocumento
na.TipoDocumento = ap.TipoDocumento
Else
DXMessageBox.Show("Cuenta " & ap.NumeroCuenta & " no existente.", "Atención")
End If
End With
ra.apuntes.Add(na)
Next
Me.gcApuntes.RefreshData()
End If
Else
DXMessageBox.Show("Solo se pueden leer apuntes si aún está sin apuntes y tiene fecha", "Atención")
End If
Case 2
Dim SoloLectura = Not Me.ContenedorAplicacion.btGuardar.IsEnabled
Dim Continuar = SoloLectura
If Not SoloLectura Then
Continuar = Me.Guardar(Nothing, Nothing, True) = False
End If
If Continuar Then
Dim uc As New ucAsientoModelo(Nothing, ra.idAsiento)
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
End If
End Select
End Sub
Private Sub tvApuntes_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles tvApuntes.PreviewKeyDown
If e.Key = Key.F6 Then
Select Case gcApuntes.CurrentColumn.FieldName.ToLower
Case "numerocuentatmp"
tvApuntes.ShowEditor()
BtCuenta_DefaultButtonClick(Nothing, Nothing)
Case "concepto"
tvApuntes.ShowEditor()
BtConcepto_DefaultButtonClick(Nothing, Nothing)
End Select
End If
End Sub
Private Sub gcApuntes_EnterPulsado() Handles gcApuntes.EnterPulsado
Select Case gcApuntes.CurrentColumn.FieldName.ToLower
Case "concepto"
If tvApuntes.FocusedRowHandle = DataControlBase.NewItemRowHandle Then
If gcApuntes.CurrentItem Is Nothing Then tvApuntes.AddNewRow()
Dim ap As apuntes = gcApuntes.CurrentItem
Dim apant = ra.apuntes.LastOrDefault(Function(x) x.Concepto <> "")
If apant IsNot Nothing Then
ap.idConcepto = apant.idConcepto
ap.Concepto = apant.Concepto
End If
gcApuntes.RefreshRow(tvApuntes.FocusedRowHandle)
End If
Case "tipodocumento"
If tvApuntes.FocusedRowHandle = DataControlBase.NewItemRowHandle Then
If gcApuntes.CurrentItem Is Nothing Then tvApuntes.AddNewRow()
Dim ap As apuntes = gcApuntes.CurrentItem
Dim apant = ra.apuntes.LastOrDefault(Function(x) x.TipoDocumento.HasValue)
If apant IsNot Nothing Then
ap.TipoDocumento = apant.TipoDocumento
End If
gcApuntes.RefreshRow(tvApuntes.FocusedRowHandle)
End If
Case "numerodocumento"
If tvApuntes.FocusedRowHandle = DataControlBase.NewItemRowHandle Then
If gcApuntes.CurrentItem Is Nothing Then tvApuntes.AddNewRow()
Dim ap As apuntes = gcApuntes.CurrentItem
Dim apant = ra.apuntes.LastOrDefault(Function(x) x.NumeroDocumento.NothingAVacio <> "")
If apant IsNot Nothing Then
ap.NumeroDocumento = apant.NumeroDocumento
End If
gcApuntes.RefreshRow(tvApuntes.FocusedRowHandle)
End If
Case "numerocuentatmp"
If tvApuntes.FocusedRowHandle = DataControlBase.NewItemRowHandle Then
If gcApuntes.CurrentItem Is Nothing Then tvApuntes.AddNewRow()
Dim ap As apuntes = gcApuntes.CurrentItem
Dim apant = ra.apuntes.LastOrDefault
If apant IsNot Nothing Then
ap.NumeroCuentaTmp = apant.NumeroCuentaTmp
Dim cta = bd.cuentas.FirstOrDefault(Function(x) x.NumeroCuenta = ap.NumeroCuentaTmp And x.idEjercicio = ra.idEjercicio)
If cta IsNot Nothing Then
ap.DescripcionCuentaTmp = cta.Denominacion
ap.idCuentaNavigation = cta
End If
gcApuntes.RefreshRow(tvApuntes.FocusedRowHandle)
End If
End If
End Select
End Sub
Private Sub ucDiario_ErrorGuardando(sender As Object, ex As Exception, OpcionGuardado As Integer) Handles Me.ErrorGuardando
Try
Dim ea = bd.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added)
Dim ee = bd.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Deleted)
Dim em = bd.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Modified)
Dim sMensaje As String = "Entidades Añadidas: " & ea.Count.ToString
For Each ent In ea
Select Case ent.Entity.GetType
Case GetType(apuntes)
Dim ap As apuntes = ent.Entity
sMensaje &= vbCrLf & " Nº Asiento " & ap.idAsiento.ToString & " Concepto " & ap.Concepto & " Debe " & ap.Debe.ToString("c2") & " Haber " & ap.Haber.ToString("c2")
End Select
Next
sMensaje &= vbCrLf & "Entidades Eliminadas: " & ee.Count.ToString
For Each ent In ee
Select Case ent.Entity.GetType
Case GetType(apuntes)
Dim ap As apuntes = ent.Entity
sMensaje &= vbCrLf & " Nº Asiento " & ap.idAsiento.ToString & " Concepto " & ap.Concepto & " Debe " & ap.Debe.ToString("c2") & " Haber " & ap.Haber.ToString("c2") & " idApunte " & ap.idApunte.ToString
End Select
Next
sMensaje &= vbCrLf & "Entidades Modificadas: " & ee.Count.ToString
For Each ent In ee
Select Case ent.Entity.GetType
Case GetType(apuntes)
Dim ap As apuntes = ent.Entity
sMensaje &= vbCrLf & " Nº Asiento " & ap.idAsiento.ToString & " Concepto " & ap.Concepto & " Debe " & ap.Debe.ToString("c2") & " Haber " & ap.Haber.ToString("c2") & " idApunte " & ap.idApunte.ToString
End Select
Next
Dim ex2 As New Exception(sMensaje, ex)
FuncionesDinamicas.ErrorNoControladoAp(Me, ex2)
Catch exc As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, exc)
End Try
End Sub
Private Sub ucDiario_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 "fecha"
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
uEc = bd.ejercicioscontables.Where(Function(x) x.FechaCierre Is Nothing).OrderByDescending(Function(x) x.FechaInicio).First
ra.Fecha = uEc.FechaInicio
End If
ra.idEjercicioNavigation = uEc
ra.EjercicioTmp = uEc.Descripcion
End Select
End If
End Sub
End Class

View File

@@ -0,0 +1,69 @@
<tsWPFCore:tsUserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:bdGrupoSanchoToro="clr-namespace:bdGrupoSanchoToro;assembly=bdGrupoSanchoToro" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucDiarios"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<tsWPFCore:tsUserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</tsWPFCore:tsUserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Filtros" x:Name="lgFiltrosBusquedaRapida" Width="Auto" Orientation="Vertical" HorizontalAlignment="Stretch">
<dxlc:LayoutGroup Orientation="Vertical" Width="800" HorizontalAlignment="Left">
<dxlc:LayoutGroup>
<tsWPFCore:tsLayoutItem Label="Fecha Inicio:" Width="250">
<dxe:DateEdit x:Name="deFechaInicio" TabIndex="3" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Fecha Fin:" Width="200">
<dxe:DateEdit x:Name="deFechaFin" TabIndex="3" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup>
<tsWPFCore:tsLayoutItem Label="Búsqueda:" FontWeight="Bold">
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" x:FieldModifier="public" FontWeight="Normal" />
</tsWPFCore:tsLayoutItem>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
</dxlc:LayoutGroup>
<dxlc:LayoutItem Label="Campos de búsqueda:" x:Name="liCamposBusqueda">
<Border BorderThickness="1" BorderBrush="Black">
<TextBlock x:Name="tbCamposBusqueda" Text="Nº Asiento, Nº Documento, Concepto apunte, Importe Asiento, Importe Apunte, Nº Cuenta" />
</Border>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" TabIndex="2">
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
</tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:tsGridControl.View>
<tsWPFCore:tsTableView ShowSearchPanelMode="Always" />
</tsWPFCore:tsGridControl.View>
<dxg:GridColumn FieldName="idAsiento" Header="id Asiento" Width="100" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
<dxg:GridColumn FieldName="Fecha" Header="Fecha" Width="110" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Importe" Header="Importe" Width="90" HorizontalHeaderContentAlignment="Right">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="ejercicioscontables.Descripcion" Header="Ejercicio" Width="100" IsSmart="True" />
<dxg:GridColumn FieldName="Cuentas" Header="Cuentas" Width="600" IsSmart="True" />
<dxg:GridColumn FieldName="Conceptos" Header="Conceptos" Width="600" IsSmart="True" />
<dxg:GridColumn FieldName="Documentos" Header="Documentos" Width="400" IsSmart="True" />
<dxg:GridColumn FieldName="NumeroAsiento" Header="Nº Asiento Oficial" Width="120" IsSmart="True" />
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,189 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports System.Linq.Dynamic
Imports tsl5.Datos
Imports tsWPF
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucDiarios
Dim bd As tscGrupoSanchoToro
Private _ListadoFiltrado As List(Of asientos)
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Asientos"
End Sub
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "Asientos"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Asientos Diarios"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "asientos"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub Cargado()
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
HabilitarRefresco = True
Dim ejab = Ejercicios.Where(Function(x) x.FechaCierre Is Nothing)
deFechaInicio.EditValue = ejab.OrderBy(Function(x) x.FechaInicio).First.FechaInicio
deFechaFin.EditValue = ejab.OrderByDescending(Function(x) x.FechaFin).First.FechaFin
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
If Background Then ObtieneAsientosAsync(bd, Background)
Return 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.gestionasegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
'Public Sub New(ListadoFiltrado As List(Of asientos), TextoBusqueda As String, TituloCamposBusqueda As String, CamposBusquedaAlfabeticos() As String, CamposBusquedaNumericos() As String, FechaInicio As Date, FechaFin As Date)
' InitializeComponent()
' _ListadoFiltrado = ListadoFiltrado
' Me.lgFiltrosBusquedaRapida.Visibility = Visibility.Visible
' Me.lgFiltrosBusquedaAvanzada.Visibility = Visibility.Collapsed
' Me.teBusqueda.Text = TextoBusqueda
' Me.tbCamposBusqueda.Text = TituloCamposBusqueda
' Me.deFechaInicio.EditValue = FechaInicio
' Me.deFechaFin.EditValue = FechaFin
' _CamposBusquedaAlfabeticos = CamposBusquedaAlfabeticos
' _CamposBusquedaNumericos = CamposBusquedaNumericos
'End Sub
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 ObtieneAsientos(BackGround As Boolean, TextoBusqueda As String, FechaInicio As Date, FechaFin As Date) As List(Of asientos)
Dim rs As New List(Of asientos)
Dim parametros(0) As Object
Dim iNumExc As Integer = 0
Do
Try
If TextoBusqueda <> "" Then
Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, {"Importe"}, Nothing, Nothing)
'If ExpresionBusqueda <> "" Then
' rs = bd.asientos.Where(ExpresionBusqueda, parametros).Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
'Else
' rs = bd.asientos.Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
'End If
Dim Calfap() As String = {"NumeroDocumento", "Concepto"}
Dim Cnumap() As String = {"idAsiento", "Debe", "Haber"}
Dim ExpBusAsi As String = tsWPF.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 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
rs = lap.Union(lap2).OrderBy(Function(x) x.Fecha).ThenBy(Function(x) x.Fecha).ToList
Else
rs = bd.asientos.Where(Function(x) x.Fecha >= FechaInicio And x.Fecha <= FechaFin).ToList
End If
Exit Do
Catch ex As Exception
If BackGround = False 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 ObtieneAsientosAsync(bd As tscGrupoSanchoToro, Background As Boolean)
Try
Dim rs As New List(Of asientos)
Dim fi, ff As Date?
Dim Busqueda As String
Busqueda = Me.teBusqueda.Text.Trim
fi = deFechaInicio.EditValue
ff = deFechaFin.EditValue
If Background Then
Me.ContenedorAplicacion.IsEnabled = False
Await Task.Run(Sub()
rs = ObtieneAsientos(Background, Busqueda, fi, ff)
End Sub)
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando Asientos ...")
rs = ObtieneAsientos(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
Dim r As New ucDiario
FuncionesDinamicas.AbrirAP(r, OtrosParametros)
End Sub
Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Dim id As Integer = DirectCast(Me.gc.SelectedItems(0), asientos).idAsiento
FuncionesDinamicas.AbrirAP(New ucDiario(id), OtrosParametros)
End Sub
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
ObtieneAsientosAsync(bd, False)
End Sub
End Class

View File

@@ -0,0 +1,455 @@
<tsWPFCore:tsUserControl xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucEjercicioContable"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="2218.923">
<tsWPFCore:tsUserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
<Setter Property="Background" Value="#B0E0E6" />
</Style>
</ResourceDictionary>
</tsWPFCore:tsUserControl.Resources>
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
<dxlc:LayoutGroup Header="Datos Ejercicio" x:Name="lgDetalle" View="GroupBox" ItemLabelsAlignment="Default" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
<dxlc:LayoutGroup Orientation="Vertical" Width="350">
<tsWPFCore:tsLayoutItem Label="Nº Ejercicio:" Width="200" HorizontalAlignment="Left">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit AllowNullInput="True" NullText="« AUTOMÁTICO »" EditValue="{Binding idEjercicio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="9">
<dxe:TextEdit.NullValue>
<sys:Int32>0</sys:Int32>
</dxe:TextEdit.NullValue>
</dxe:TextEdit>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Descripción:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Unico="True" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding Descripcion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="1" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" Width="400">
<dxlc:LayoutGroup Orientation="Horizontal">
<tsWPFCore:tsLayoutItem Label="Fecha Inicio:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:DateEdit EditValue="{Binding FechaInicio, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="3" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Fecha Fin:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:DateEdit EditValue="{Binding FechaFin, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="4" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<tsWPFCore:tsLayoutItem Label="Empresa:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS Obligatorio="True" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:ComboBoxEdit x:Name="cbEmpresa" ValueMember="idEmpresaContable" DisplayMember="RazonSocial" EditValue="{Binding idEmpresa, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="1" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" Width="280">
<tsWPFCore:tsLayoutItem Label="Fecha Apertura:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS UsualCorreccion="False" Modificable="NoModificable" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:DateEdit EditValue="{Binding FechaApertura, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="2" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Nº Asiento Apertura:">
<Border BorderThickness="1" BorderBrush="Black">
<TextBlock><Hyperlink x:Name="hlAsientoApertura" Click="HlAsientoApertura_Click" Tag="{Binding AsientoApertura.idAsiento}"><InlineUIContainer>
<TextBlock Text="{Binding AsientoApertura.idAsiento, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
</InlineUIContainer></Hyperlink></TextBlock>
</Border>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" Width="280">
<tsWPFCore:tsLayoutItem Label="Fecha Cierre:">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:DateEdit EditValue="{Binding FechaCierre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="5" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Nº Asiento Regularización:">
<Border BorderThickness="1" BorderBrush="Black">
<TextBlock><Hyperlink x:Name="hlAsientoRegularizacion" Click="HlAsientoRegularizacion_Click" Tag="{Binding AsientoRegularizacion.idAsiento}"><InlineUIContainer>
<TextBlock Text="{Binding AsientoRegularizacion.idAsiento, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
</InlineUIContainer></Hyperlink></TextBlock>
</Border>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<dx:DXTabControl x:Name="DXTabPersonal1" Width="Auto" HorizontalAlignment="Stretch">
<dx:DXTabControl.View>
<dx:TabControlScrollView />
</dx:DXTabControl.View>
<dx:DXTabItem Header="Cuentas">
<dxlc:LayoutGroup Orientation="Vertical">
<dxlc:LayoutItem Label="Grupo Cuentas:" Width="400" HorizontalAlignment="Left" FontWeight="SemiBold">
<dxe:ComboBoxEdit ValueMember="Nivel" DisplayMember="Descripcion" x:Name="cbNivel" />
</dxlc:LayoutItem>
<tsWPFCore:tsGridControl x:Name="gcCuentas">
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="idCuenta" Width="100" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
<dxg:GridColumn FieldName="NumeroCuenta" Width="120" IsSmart="True" />
<dxg:GridColumn FieldName="Denominacion" Header="Denominación" Width="400" IsSmart="True" />
<dxg:GridColumn FieldName="Grupo4" Header="Grupo 4 Dígitos" Width="220" IsSmart="True" x:Name="gcGrupo4" />
<dxg:GridColumn FieldName="Grupo3" Header="Grupo 3 Dígitos" Width="220" IsSmart="True" x:Name="gcGrupo3" />
<dxg:GridColumn FieldName="Grupo2" Header="Grupo 2 Dígitos" Width="220" IsSmart="True" x:Name="gcGrupo2" />
<dxg:GridColumn FieldName="Grupo1" Header="Grupo 1 Dígito" Width="220" IsSmart="True" x:Name="gcGrupo1" />
<dxg:GridColumn FieldName="Mote" Header="Mote" Width="150" IsSmart="True" />
<dxg:GridColumn FieldName="SaldoEnero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoFebrero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoMarzo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoAbril" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoMayo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoJunio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoJulio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoAgosto" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoSeptiembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoOctubre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoNoviembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SaldoDiciembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="TotalSaldo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoEnero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoFebrero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoMarzo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoAbril" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoMayo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoJunio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoJulio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoAgosto" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoSeptiembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoOctubre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoNoviembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PresupuestoDiciembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="TotalPresupuestado" Width="140" HorizontalHeaderContentAlignment="Right" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoEnero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoFebrero" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoMarzo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoAbril" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoMayo" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoJunio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoJulio" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoAgosto" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoSeptiembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoOctubre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoNoviembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoDiciembre" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" Visible="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="DesvioPresupuestoTotal" Width="160" HorizontalHeaderContentAlignment="Right" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<tsWPFCore:tsGridControl.GroupSummary>
<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº Cuentas:{0:n0}" ShowInGroupColumnFooter="Denominacion" />
<dxg:GridSummaryItem FieldName="SaldoEnero" SummaryType="Sum" ShowInGroupColumnFooter="SaldoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="SaldoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="SaldoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAbril" SummaryType="Sum" ShowInGroupColumnFooter="SaldoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoMayo" SummaryType="Sum" ShowInGroupColumnFooter="SaldoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoJunio" SummaryType="Sum" ShowInGroupColumnFooter="SaldoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoJulio" SummaryType="Sum" ShowInGroupColumnFooter="SaldoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="SaldoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="TotalSaldo" SummaryType="Sum" ShowInGroupColumnFooter="TotalSaldo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoEnero" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoAbril" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoMayo" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoJunio" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoJulio" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="TotalPresupuestado" SummaryType="Sum" ShowInGroupColumnFooter="TotalPresupuestado" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoEnero" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoAbril" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoMayo" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoJunio" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoJulio" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoTotal" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoTotal" DisplayFormat=" {0:c2}" />
</tsWPFCore:tsGridControl.GroupSummary>
<tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº Cuentas: {0:n0}" ShowInColumn="Denominacion" TextBlock.TextAlignment="Left" />
<dxg:GridSummaryItem FieldName="SaldoEnero" SummaryType="Sum" ShowInGroupColumnFooter="SaldoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="SaldoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="SaldoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAbril" SummaryType="Sum" ShowInGroupColumnFooter="SaldoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoMayo" SummaryType="Sum" ShowInGroupColumnFooter="SaldoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoJunio" SummaryType="Sum" ShowInGroupColumnFooter="SaldoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoJulio" SummaryType="Sum" ShowInGroupColumnFooter="SaldoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="SaldoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="SaldoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="SaldoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="TotalSaldo" SummaryType="Sum" ShowInGroupColumnFooter="TotalSaldo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoEnero" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoAbril" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoMayo" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoJunio" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoJulio" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="PresupuestoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="PresupuestoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="TotalPresupuestado" SummaryType="Sum" ShowInGroupColumnFooter="TotalPresupuestado" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoEnero" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoEnero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoFebrero" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoFebrero" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoMarzo" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoMarzo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoAbril" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoAbril" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoMayo" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoMayo" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoJunio" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoJunio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoJulio" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoJulio" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoAgosto" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoAgosto" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoSeptiembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoSeptiembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoOctubre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoOctubre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoNoviembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoNoviembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoDiciembre" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoDiciembre" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="DesvioPresupuestoTotal" SummaryType="Sum" ShowInGroupColumnFooter="DesvioPresupuestoTotal" DisplayFormat=" {0:c2}" />
</tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridControl.View>
<tsWPFCore:tsTableView x:Name="tvCuentas" ShowGroupFooters="True" ShowGroupPanel="True" ShowSearchPanelMode="Always" ShowTotalSummary="True" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutGroup>
</dx:DXTabItem>
<dx:DXTabItem Header="Asientos">
<tsWPFCore:tsGridControl x:Name="gcAsientos">
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="idAsiento" Header="id Asiento" Width="100" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
<dxg:GridColumn FieldName="Fecha" Header="Fecha" Width="90" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Importe" Header="Importe" Width="90" HorizontalHeaderContentAlignment="Right">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Cuentas" Header="Cuentas" Width="600" IsSmart="True" />
<dxg:GridColumn FieldName="Documentos" Header="Documentos" Width="400" IsSmart="True" />
<dxg:GridColumn FieldName="NumeroAsiento" Header="Nº Asiento Oficial" Width="120" IsSmart="True" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPFCore:tsTableView ShowGroupFooters="True" ShowGroupPanel="True" ShowSearchPanelMode="Always" ShowTotalSummary="True" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dx:DXTabItem>
</dx:DXTabControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,612 @@
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 System.Data.Common
Imports DevExpress.Xpf.Bars
Imports DevExpress.Xpf.Grid
Imports System.IO
Imports DevExpress.Spreadsheet
Imports Microsoft.Win32
Imports System.Drawing
Imports tsWPFCore.Comun
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Imports tsUtilidades
Public Class ucEjercicioContable
Private bd As tscGrupoSanchoToro
Friend _idEjercicio As Nullable(Of Integer)
'
Public Overrides Sub Cargado()
Me.Tipo_ucControlBusqueda = GetType(ucEjerciciosContables)
End Sub
Dim ra As ejercicioscontables
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Try
Dim NuevoEstado As EstadosAplicacion
If FuerzaNuevo OrElse _idEjercicio Is Nothing Then
ra = New bdGrupoSanchoToro.db.ejercicioscontables
ra.FechaApertura = Now.Date
Dim Anno As Integer = Now.Year
If Now.Month > 1 Then Anno += 1
ra.Descripcion = Anno.ToString
ra.FechaInicio = New Date(Anno, 1, 1)
ra.FechaFin = New Date(Anno, 12, 31)
ra.idEmpresa = bd.empresas.First(Function(x) x.FechaBaja.HasValue = False).idEmpresa
Me.DataContext = ra
_idEjercicio = Nothing
' ra.idEjercicio = Nothing
NuevoEstado = EstadosAplicacion.Nuevo
tsUserControl.EstableceSoloLectura(Me.cbEmpresa, False)
Else
ra = bd.ejercicioscontables.First(Function(x) x.idEjercicio = _idEjercicio)
NuevoEstado = EstadosAplicacion.ModificandoRegistro
tsUserControl.EstableceSoloLectura(Me.cbEmpresa, ra.cuentas.Count > 0 Or ra.asientos.Count > 0)
End If
Me.DataContext = ra
gcAsientos.ItemsSource = ra.asientos
If cbNivel.ItemsSource Is Nothing Then
cbNivel.ItemsSource = bdGrupoSanchoToro.db.cuentas.ListadoGruposCuentas
cbNivel.EditValue = cuentas.LongitudCuentaFinal
Else
' If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)()
' DXSplashScreen.SetState("Obteniendo cuentas ...")
ObtieneCuentas(ra)
' If DXSplashScreen.IsActive Then DXSplashScreen.Close()
End If
Return NuevoEstado
Catch ex As Exception
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
Return EstadosAplicacion.SinDatos
End Try
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 "ejercicioscontables"
End Get
End Property
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
If Estado = EstadosAplicacion.Nuevo Then
Me.cbEmpresa.ItemsSource = bd.empresas.Where(Function(x) x.FechaBaja.HasValue = False)
Return "Entidad.Nuevo"
Else
Me.cbEmpresa.ItemsSource = bd.empresas.ToList
Return "Ejercicio." & DirectCast(Me.DataContext, ejercicioscontables).Descripcion.ToString
End If
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Ejercicio Contable"
End Get
End Property
Public Sub New(Optional idEjercicio As Integer? = Nothing)
' Llamada necesaria para el diseñador.
InitializeComponent()
_idEjercicio = idEjercicio
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Overrides Sub EstableceTitulo()
If Me.docpanel Is Nothing Then
Dim w As dxwGenerica = Window.GetWindow(Me)
w.Title = "Agregar nuevo ejercicio"
Else
If Me.Estado = EstadosAplicacion.ModificandoRegistro Then
Me.docpanel.Caption = "Ejercicio " & ra.Descripcion
Me.docpanel.Tag = "Ejercicio." & ra.Descripcion
Else
Me.docpanel.Caption = "Ejercicio Nuevo"
Me.docpanel.Tag = "Ejercicio.Nuevo"
End If
End If
End Sub
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
'Public Overrides Function ObtieneConexionBD() As BBDD
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
'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
If Not pts Is Nothing Then
Dim ra As ejercicioscontables = Me.DataContext
End If
End Sub
Private Sub ObtieneCuentas(ra As ejercicioscontables)
Try
If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Obteniendo cuentas ...")
Dim Nivel As Integer = cbNivel.EditValue
Dim ctas = bdGrupoSanchoToro.db.vf_cuentas.Obtiene_vf_cuentas(bd, ra.ideje, Nivel)
gcCuentas.ItemsSource = ctas
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
Catch ex As Exception
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub cbNivel_EditValueChanged(sender As Object, e As EditValueChangedEventArgs) Handles cbNivel.EditValueChanged
ObtieneCuentas(ra)
End Sub
Private Sub HlAsientoRegularizacion_Click(sender As Object, e As RoutedEventArgs)
Dim id = DirectCast(Me.DataContext, ejercicioscontables).AsientoRegularizacion.idAsiento
FuncionesDinamicas.AbrirAP(New ucDiario(id), OtrosParametros)
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 = "GENERA ASIENTO DE REGULARIZACIÓN Y DE APERTURA"})
Acciones.Add(New Accion With {
.idAccion = 2,
.Descripcion = "REENUMERA Nº ASIENTO OFICIAL"})
Acciones.Add(New Accion With {
.idAccion = 3,
.Descripcion = "GENERA BALANCE DE SITUACION"})
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
If Acciones.Count > 0 Then Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
End Sub
Private Sub HlAsientoApertura_Click(sender As Object, e As RoutedEventArgs)
Dim id = DirectCast(Me.DataContext, ejercicioscontables).AsientoApertura.idAsiento
FuncionesDinamicas.AbrirAP(New ucDiario(id), OtrosParametros)
End Sub
Private Sub ap_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Select Case Celda.Column.FieldName.ToLower
Case "idasiento"
Dim id As Integer = DirectCast(Me.gcAsientos.CurrentItem, asientos).idAsiento
FuncionesDinamicas.AbrirAP(New ucDiario(id), OtrosParametros)
Case "idcuenta"
Dim id As Integer = DirectCast(Me.gcCuentas.CurrentItem, vf_cuentas).idCuenta
FuncionesDinamicas.AbrirAP(New ucCuenta(id), OtrosParametros)
End Select
End Sub
Private Sub ap_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
Dim NuevoEjercicio As ejercicioscontables = ra
_idEjercicio = NuevoEjercicio.idEjercicio
If NuevoEjercicio.FechaCierre.HasValue = False AndAlso NuevoEjercicio.FechaApertura.Year = Now.Year Then
Dim ea = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).FirstOrDefault(Function(x) x.FechaInicio < NuevoEjercicio.FechaInicio)
If DXMessageBox.Show("¿Desea copiar las cuentas del Ejercicio Anterior?", "Atención", vbYesNo) = MessageBoxResult.Yes Then
CopiaCuentas(NuevoEjercicio)
RefrescaUC(True)
End If
End If
End Sub
Friend Sub CopiaCuentas(NuevoEjercicio As ejercicioscontables)
Try
Dim ea = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).FirstOrDefault(Function(x) x.FechaInicio < NuevoEjercicio.FechaInicio)
If ea IsNot Nothing Then
If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Copiando Cuentas del Ejercicio " & ea.Descripcion & " ...")
Dim ctas1 = ea.cuentas.Where(Function(x) x.NumeroCuenta.Length = 1).ToList
Dim ctas2 = ea.cuentas.Where(Function(x) x.NumeroCuenta.Length = 2).ToList
Dim ctas3 = ea.cuentas.Where(Function(x) x.NumeroCuenta.Length = 3).ToList
Dim ctas4 = ea.cuentas.Where(Function(x) x.NumeroCuenta.Length = 4).ToList
Dim ctas8 = ea.cuentas.Where(Function(x) x.NumeroCuenta.Length = 8).ToList
Dim Nc As Integer = 0
For Each cta In ctas1
Nc += CopiaCuenta(bd, NuevoEjercicio, cta)
Next
For Each cta In ctas2
Nc += CopiaCuenta(bd, NuevoEjercicio, cta)
Next
For Each cta In ctas3
Nc += CopiaCuenta(bd, NuevoEjercicio, cta)
Next
For Each cta In ctas4
Nc += CopiaCuenta(bd, NuevoEjercicio, cta)
Next
For Each cta In ctas8
Nc += CopiaCuenta(bd, NuevoEjercicio, cta)
Next
bd.GuardarCambios()
DXSplashScreen.Close()
'DXMessageBox.Show("Se han copiado " & (ctas1.Count + ctas2.Count + ctas3.Count + ctas4.Count + ctas8.Count).ToString & " Cuentas", "Información")
DXMessageBox.Show("Se han copiado " & Nc.ToString, "Información")
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
DXMessageBox.Show(ex.Message, "Error")
Finally
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
End Try
End Sub
Friend Function CopiaCuenta(bdtmp As tscGrupoSanchoToro, NuevoEjercicio As ejercicioscontables, CtaAnterior As cuentas, Optional ByRef CuentaNueva As cuentas = Nothing) As Integer
If Not NuevoEjercicio.cuentas.Any(Function(X) X.NumeroCuenta = CtaAnterior.NumeroCuenta) Then
Dim nc As New cuentas
nc.Denominacion = CtaAnterior.Denominacion
nc.EsCuentaFinal = CtaAnterior.EsCuentaFinal
nc.Mote = CtaAnterior.Mote
nc.Observaciones = CtaAnterior.Observaciones
nc.NumeroCuenta = CtaAnterior.NumeroCuenta
nc.idEjercicio = NuevoEjercicio.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
bdtmp.cuentas.Add(nc)
CuentaNueva = nc
Return 1
Else
CuentaNueva = Nothing
Return 0
End If
End Function
Friend Sub ReenumeraAsientosOficiales()
Try
If Estado = EstadosAplicacion.Nuevo Then
DXMessageBox.Show("No se puede realizar esta operación en ejercicios nuevos", "Atención")
Else
bd = bdGrupoSanchoToro.tscGrupoSanchoToro.NuevoContexto
Dim ejact As ejercicioscontables = bd.ejercicioscontables.Where(Function(x) x.idEjercicio = ra.idEjercicio)
Dim asap = bd.asientos.FirstOrDefault(Function(x) x.idEjercicio = ejact.idEjercicio AndAlso x.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.APERTURA)
Dim asci = bd.asientos.FirstOrDefault(Function(x) x.idEjercicio = ejact.idEjercicio And x.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.REGULARIZACION)
bd.Database.ExecuteSqlRaw("UPDATE ASIENTOS SET NumeroAsiento=null where idEjercicio=" & ejact.idEjercicio.ToString & ";")
Dim asn = bd.asientos.Where(Function(x) x.idEjercicio = ejact.idEjercicio And x.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.NORMAL).ToList
Dim cont = 0
If asap IsNot Nothing Then
cont += 1
asap.NumeroAsiento = cont
End If
For Each asi In asn
cont += 1
asap.NumeroAsiento = cont
Next
If asci IsNot Nothing Then
cont += 1
asap.NumeroAsiento = cont
End If
bd.GuardarCambios()
End If
Catch ex As Exception
End Try
End Sub
Friend Sub GeneraAsientoRegularizacionYApertura()
Try
If Estado = EstadosAplicacion.Nuevo Then
DXMessageBox.Show("No se puede realizar esta operación sobre ejercicios nuevos", "Atención")
Else
bd = bdGrupoSanchoToro.tscGrupoSanchoToro.NuevoContexto
Dim ejact As ejercicioscontables = bd.ejercicioscontables.FirstOrDefault(Function(x) x.idEjercicio = ra.idEjercicio)
Dim ejnue As ejercicioscontables = bd.ejercicioscontables.FirstOrDefault(Function(x) x.FechaInicio > ejact.FechaInicio)
If ejnue Is Nothing Then
DXMessageBox.Show("Antes debe crear el nuevo ejercicio", "Información")
Else
Dim Continua As Boolean = True
If ejact.FechaCierre.HasValue OrElse ejnue.FechaCierre.HasValue Then
DXMessageBox.Show("Alguno de los ejerccicios implicados ya están cerrados. Si desea volverlo a cerrar primero debe quitar dicha fecha.", "Atención")
Else
Dim AsiCie = bd.asientos.FirstOrDefault(Function(x) x.idEjercicio = ejact.idEjercicio And x.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.REGULARIZACION)
Dim AsiAper = bd.asientos.FirstOrDefault(Function(x) x.idEjercicio = ejnue.idEjercicio And x.Tipo = asientos.TipoAsiento.APERTURA)
If AsiCie IsNot Nothing OrElse AsiAper IsNot Nothing Then Continua = DXMessageBox.Show("Ya existe un asiento de regularización/apertura en los ejercicios implicados. ¿Desea eliminar dichos asientos y generarlos de nuevo?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.Yes
If Continua Then
If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Generando Cierre Ejercicio " & ejact.Descripcion & " ...")
If AsiCie IsNot Nothing Then
bd.asientos.Remove(AsiCie)
bd.GuardarCambios()
End If
Dim ctasgr6Y7 = bd.cuentas.Where(Function(x) x.idEjercicio = ejact.idEjercicio And x.EsCuentaFinal And (x.NumeroCuenta.StartsWith("6") Or x.NumeroCuenta.StartsWith("7"))).OrderBy(Function(X) X.NumeroCuenta).ToList.Where(Function(x) x.TotalSaldo <> 0)
Dim asireg As New asientos
bd.asientos.Add(asireg)
With asireg
.Fecha = ejact.FechaFin
.idEjercicio = ejact.idEjercicio
.idUsuario = idUsuario
.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.REGULARIZACION
End With
For Each cta In ctasgr6Y7
Dim na As New apuntes
asireg.apuntes.Add(na)
With na
.idCuenta = ejact.cuentas.First(Function(x) x.NumeroCuenta = cta.NumeroCuenta).idCuenta
' .Fecha = ejact.FechaFin
.Concepto = "A PERDIDAS Y GANANCIAS"
' If cta.TotalSaldo > 0 Then
If cta.NumeroCuenta.StartsWith("6") Then
.Debe = 0
.Haber = Math.Round(cta.TotalSaldo, 2, MidpointRounding.AwayFromZero)
Else
.Debe = Math.Round(cta.TotalSaldo * -1, 2, MidpointRounding.AwayFromZero)
.Haber = 0
End If
'Else
' .Debe = cta.TotalSaldo * -1
' .Haber = 0
'End If
asireg.Importe = Math.Round(asireg.Importe + .Debe, 2, MidpointRounding.AwayFromZero)
End With
Dim naPYG As New apuntes
asireg.apuntes.Add(naPYG)
With naPYG
.idCuenta = ejact.cuentas.First(Function(x) x.NumeroCuenta = bdGrupoSanchoToro.db.cuentas.CUENTA_PERDIDAS_Y_GANANCIAS).idCuenta
'.Fecha = ejact.FechaFin
.Concepto = cta.Denominacion
' If cta.TotalSaldo > 0 Then
If cta.NumeroCuenta.StartsWith("6") Then
.Debe = Math.Round(cta.TotalSaldo, 2, MidpointRounding.AwayFromZero)
.Haber = 0
Else
.Debe = 0
.Haber = Math.Round(cta.TotalSaldo * -1, 2, MidpointRounding.AwayFromZero)
End If
'Else
' .Debe = 0
' .Haber = cta.TotalSaldo * -1
'End If
asireg.Importe = Math.Round(asireg.Importe + .Debe, 2, MidpointRounding.AwayFromZero)
End With
Next
asireg.Importe = Math.Round(asireg.Importe, 2, MidpointRounding.AwayFromZero)
bd.GuardarCambios()
'
' APERTURA
'
DXSplashScreen.SetState("Generando Apertura Ejercicio " & ejnue.Descripcion & " ...")
' Dim AsiAper = bd.asientos.FirstOrDefault(Function(x) x.idEjercicio = ejnue.idEjercicio And x.Tipo = asientos.TipoAsiento.APERTURA)
If AsiAper IsNot Nothing Then
bd.asientos.Remove(AsiAper)
bd.GuardarCambios()
End If
bd = bdGrupoSanchoToro.tscGrupoSanchoToro.NuevoContexto
ejact = bd.ejercicioscontables.FirstOrDefault(Function(x) x.idEjercicio = ra.idEjercicio)
ejnue = bd.ejercicioscontables.FirstOrDefault(Function(x) x.FechaInicio > ejact.FechaInicio)
' Dim ctas = bd.Obtiene_ve_cuentas(bd.apuntes.Where(Function(x) x.asientos.idEjercicio = ejact.idEjercicio)).Where(Function(x) x.TotalDebe - x.TotalHaber <> 0).OrderBy(Function(X) X.NumeroCuenta).ToList
Dim ctas = bdGrupoSanchoToro.db.vf_cuentas.Obtiene_vf_cuentas(bd, ejact.idEjercicio, 8).Where(Function(x) x.TotalDebe - x.TotalHaber <> 0).OrderBy(Function(X) X.NumeroCuenta).ToList
Dim NueAsiAper As New asientos
bd.asientos.Add(NueAsiAper)
With NueAsiAper
.Fecha = ejnue.FechaInicio
.idEjercicio = ejnue.idEjercicio
.idUsuario = idUsuario
.Tipo = bdGrupoSanchoToro.db.asientos.TipoAsiento.APERTURA
End With
For Each cta In ctas
Dim na As New apuntes
NueAsiAper.apuntes.Add(na)
With na
Dim ctne = ejnue.cuentas.FirstOrDefault(Function(x) x.NumeroCuenta = cta.NumeroCuenta)
If ctne Is Nothing Then
Dim ctaea = bd.cuentas.First(Function(x) x.idCuenta = cta.idCuenta)
CopiaCuenta(bd, ejnue, ctaea, ctne)
End If
.cuentas = ctne
'.idCuenta = ejnue.cuentas.First(Function(x) x.NumeroCuenta = cta.NumeroCuenta).idCuenta
'.Fecha = ejnue.FechaInicio
.Concepto = "ASIENTO APERTURA"
If cta.TotalSaldo > 0 Then
.Haber = 0
.Debe = Math.Round(cta.TotalSaldo, 2, MidpointRounding.AwayFromZero)
Else
.Haber = Math.Round(cta.TotalSaldo * -1, 2, MidpointRounding.AwayFromZero)
.Debe = 0
End If
NueAsiAper.Importe += .Debe
End With
Next
NueAsiAper.Importe = Math.Round(NueAsiAper.Importe, 2, MidpointRounding.AwayFromZero)
bd.GuardarCambios()
RefrescaUC()
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
DXMessageBox.Show("Asiento de Regularización y Apertura creado correctamente.", "Atención")
End If
End If
End If
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
DXMessageBox.Show(ex.Message, "Error")
Finally
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
End Try
End Sub
Private Sub ap_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
Select Case idAccion
Case 1 ' GENERA ASIENTO DE CIERRE Y APERTURA
GeneraAsientoRegularizacionYApertura()
Case 2 ' REENUMERA ASIENTOS OFICIALES Y CIERRA EL EJERCCIO
ReenumeraAsientosOficiales()
Case 3
GeneraInformeContable("BALSIT")
End Select
End Sub
Public Sub GeneraInformeContable(Codigo As String)
Try
If Estado = EstadosAplicacion.Nuevo Then
DXMessageBox.Show("No se puede realizar esta operación sobre ejercicios nuevos", "Atención")
Else
Dim fb As New SaveFileDialog
Dim ic = bd.informescontables.First(Function(x) x.Codigo = Codigo)
fb.FileName = ic.Descripcion & " " & Now.ToString("dd-MM-yyyy")
fb.Filter = "Fichero Excel | *.xlsx"
fb.DefaultExt = "xlsx"
fb.FileName &= ".xlsx"
fb.AddExtension = True
If fb.ShowDialog Then
bd = bdGrupoSanchoToro.tscGrupoSanchoToro.NuevoContexto
If Not DXSplashScreen.IsActive Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Generando Informe ...")
Dim ej As ejercicioscontables = bd.ejercicioscontables.First(Function(x) x.idEjercicio = ra.idEjercicio)
Dim b() As Byte = ic.idFicheroNavigation.Fichero
Dim ms As New MemoryStream(b)
Dim wb As New Workbook
If ic.idFicheroNavigation.NombreFichero.ToLower.EndsWith(".xls") Then
wb.LoadDocument(ms, DevExpress.Spreadsheet.DocumentFormat.Xls)
Else
wb.LoadDocument(ms, DevExpress.Spreadsheet.DocumentFormat.Xlsx)
End If
Dim ctas = ej.cuentas.ToList
Dim ctasejant As New List(Of cuentas)
Dim ejant = bd.ejercicioscontables.Where(Function(x) x.FechaInicio < ej.FechaInicio).OrderByDescending(Function(x) x.FechaInicio).FirstOrDefault
If ejant IsNot Nothing Then
ctasejant = ejant.cuentas.ToList
End If
For Each c In ic.celdasinformescontables
Dim celda As String = c.Columna & c.Fila.ToString
Try
Select Case c.NombreCampo.ToLower
Case "totalsaldoejant"
If ejant IsNot Nothing Then wb.Worksheets(c.Hoja).Cells(celda).Value = ObtieneTotalSaldo(ctasejant, c)
Case "totalsaldo"
wb.Worksheets(c.Hoja).Cells(celda).Value = ObtieneTotalSaldo(ctas, c)
Case "totalsaldoac" 'Antes de CIERRE
wb.Worksheets(c.Hoja).Cells(celda).Value = ObtieneTotalSaldoAC(ctas, c)
Case "totalsaldoacejant" 'Antes de CIERRE
If ejant IsNot Nothing Then wb.Worksheets(c.Hoja).Cells(celda).Value = ObtieneTotalSaldoAC(ctasejant, c)
Case "ejercicio"
wb.Worksheets(c.Hoja).Cells(celda).Value = ej.Descripcion
Case "ejercicioant"
If ejant IsNot Nothing Then wb.Worksheets(c.Hoja).Cells(celda).Value = ejant.Descripcion
End Select
Catch ex As Exception
Throw New Exception("Error en Hoja " & c.Hoja.ToString & " Columna " & celda & " " & ex.Message, ex)
End Try
Next
wb.SaveDocument(fb.FileName, DevExpress.Spreadsheet.DocumentFormat.Xlsx)
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
Process.Start(fb.FileName)
End If
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Function ObtieneTotalSaldo(ctas As List(Of cuentas), c As celdasinformescontables) As Double
Dim Total As Double = 0
Dim ctascelda = c.cuentasceldasinformescontables.ToList
For Each cc In ctascelda
Dim cta = ctas.FirstOrDefault(Function(x) x.NumeroCuenta = cc.NumeroCuenta)
If cta IsNot Nothing Then
If cc.SoloSiNegativo Then
If cta.TotalSaldo < 0 Then Total += (cta.TotalSaldo * cc.Factor)
Else
If cc.SoloSiPositivo Then
If cta.TotalSaldo > 0 Then Total += (cta.TotalSaldo * cc.Factor)
Else
Total += (cta.TotalSaldo * cc.Factor)
End If
End If
End If
Next
Return Total
End Function
Private Function ObtieneTotalSaldoAC(ctas As List(Of cuentas), c As celdasinformescontables) As Double
Dim Total As Double = 0
Dim ctascelda = c.cuentasceldasinformescontables.ToList
For Each cc In ctascelda
Dim cta = ctas.FirstOrDefault(Function(x) x.NumeroCuenta = cc.NumeroCuenta)
If cta IsNot Nothing Then
If cc.SoloSiNegativo Then
If cta.TotalSaldoAntesCierre < 0 Then Total += (cta.TotalSaldoAntesCierre * cc.Factor)
Else
If cc.SoloSiPositivo Then
If cta.TotalSaldoAntesCierre > 0 Then Total += (cta.TotalSaldoAntesCierre * cc.Factor)
Else
Total += (cta.TotalSaldoAntesCierre * cc.Factor)
End If
End If
End If
Next
Return Total
End Function
Private Sub EstableceEstiloGrupo(rg As DevExpress.Spreadsheet.CellRange)
Dim rgf As Formatting = rg.BeginUpdateFormatting
rgf.Font.Bold = True
rgf.Fill.BackgroundColor = Color.LightCyan
rgf.Borders.BottomBorder.LineStyle = BorderLineStyle.DashDot
rgf.Borders.TopBorder.LineStyle = BorderLineStyle.DashDot
rgf.Borders.LeftBorder.LineStyle = BorderLineStyle.DashDot
rgf.Borders.RightBorder.LineStyle = BorderLineStyle.DashDot
End Sub
Private Sub ucEjercicioContable_EstadoCambiado(EstadoAnterior As EstadosAplicacion, EstadoNuevo As EstadosAplicacion) Handles Me.EstadoCambiado
End Sub
'Private Sub ucEjercicioContable_AbreRegistroBuscado(uc As tsUserControl) Handles Me.AbreRegistroBuscado
'End Sub
'Private Sub ucEjercicioContable_AbreRegistroBuscado(uc As tsUserControl) Handles Me.AbreRegistroBuscado
' Dim ucecs = DirectCast(uc, ucEjerciciosContables)
' _idEjercicio = DirectCast(ucecs.gcEjercicios.CurrentItem, ejercicioscontables).idEjercicio
'End Sub
End Class

View File

@@ -0,0 +1,54 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:bdGrupoSanchoToro="clr-namespace:bdGrupoSanchoToro;assembly=bdGrupoSanchoToro" x:Class="ucEjerciciosContables"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<tsWPFCore:tsGridControl x:Name="gcEjercicios" >
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<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="FechaInicio" Width="90" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<tsWPFCore:tsGridColumn FieldName="FechaFin" Width="90" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
</dxg:GridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<dxg:GridColumn FieldName="FechaApertura" Width="100" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="FechaCierre" Width="90" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPFCore:tsTableView ShowSearchPanelMode="Always" />
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,104 @@

Imports System.CodeDom.Compiler
Imports DevExpress.Xpf.Core
Imports System.Reflection
Imports DevExpress.Xpf.Bars
Imports tsWPFCore
Imports tsWPFCore.Comun
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucEjerciciosContables
Private bd As tscGrupoSanchoToro
Public Overrides Sub Cargado()
' AddHandler Me.ContenedorAplicacion.btNuevo.ItemClick, AddressOf Nuevo
' ap.ContenedorAplicacion.btGuardar.IsVisible = False
ContenedorAplicacion.siEstado.IsVisible = False
End Sub
'Public Sub EstableceAplicacion(ap As tsWPF.Aplicacion) .EstableceAplicacion
' Me.ap = ap
'End Sub
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
Me.gcEjercicios.ItemsSource = bd.ejercicioscontables.ToList
Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
End Function
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub EstableceTitulo()
If Me.docpanel Is Nothing Then
Dim w As Window = Window.GetWindow(Me)
w.Title = "Seleccione Ejercicio Contable"
Else
Me.docpanel.Caption = "Ejercicios Contables"
End If
End Sub
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "EjerciciosContables"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "ejercicioscontables"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Ejercicios Contables"
End Get
End Property
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
bd = tscGrupoSanchoToro.NuevoContexto()
Return bd
End Function
'Public Overrides Function ObtieneConexionBD() As tsl5.Datos.BBDD
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRATIVOS", idUsuario)
End Function
Private Sub Nuevo() Handles Me.BotonNuevoPulsado
FuncionesDinamicas.AbrirAP(New ucEjercicioContable, OtrosParametros)
End Sub
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Dim id As Integer = DirectCast(Me.gcEjercicios.CurrentItem, ejercicioscontables).idEjercicio
' Dim uc As New ucRamo
' Dim dwi As dxwInicio = Window.GetWindow(Me)
FuncionesDinamicas.AbrirAP(New ucEjercicioContable(id), OtrosParametros)
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
Dim ra As ejercicioscontables = Me.DataContext
If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
If bd.ejercicioscontables.Any(Function(x) x.idEmpresa = ra.idEmpresa And ((x.FechaInicio >= ra.FechaInicio And x.FechaInicio <= ra.FechaFin) Or (x.FechaFin >= ra.FechaInicio And x.FechaFin <= ra.FechaFin))) Then
Cancelar = True
End If
End If
End Sub
'Private Sub TableView_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
' If Window.GetWindow(Me).GetType Is GetType(tsWPF.dxwVentanaBusqueda) Then
' Dim dxwvb = DirectCast(Window.GetWindow(Me), tsWPF.dxwVentanaBusqueda)
' dxwvb.BtAceptar_Click(Nothing, Nothing)
' End If
'End Sub
End Class

View File

@@ -0,0 +1,117 @@
<tsWPFCore:tsUserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucInformeContables"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
<Setter Property="Background" Value="#B0E0E6" />
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Datos del Informe" HorizontalAlignment="Stretch" Orientation="Vertical">
<dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" Width="900" HorizontalAlignment="Left">
<dxlc:LayoutGroup>
<tsWPFCore:tsLayoutItem Label="Código:" Width="250">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding Codigo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="17" />
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Descripción">
<tsWPFCore:tsLayoutItem.PropiedadesTS>
<tsWPFCore:PropiedadesTS UsualCorreccion="False" />
</tsWPFCore:tsLayoutItem.PropiedadesTS>
<dxe:TextEdit EditValue="{Binding Descripcion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="18" />
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup>
<tsWPFCore:tsLayoutItem Label="Archivo:">
<dxe:ButtonEdit IsTextEditable="False" EditValue="{Binding ficheros.NombreFichero, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="24" x:Name="RutaDocumentoAdjunto">
<dxe:ButtonInfo x:Name="biVerFicheroEscaneado" GlyphKind="Search" Click="BiVerFicheroEscaneado_Click" />
</dxe:ButtonEdit>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup View="GroupBox" Header="Celdas" Orientation="Vertical">
<tsWPFCore:tsGridControl x:Name="gcCeldas" TabIndex="26" NombreTablaBase="celdasInformesContables">
<tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:PropiedadesTSGC CamposObligatorios="NombreCampo,Hoja,Fila,Columna" />
</tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:tsGridControl.View>
<tsWPFCore:tsTableView x:Name="tvGestiones" ShowGroupPanel="False" NewItemRowPosition="Bottom" />
</tsWPFCore:tsGridControl.View>
<dxg:GridColumn FieldName="Hoja" Width="50" ReadOnly="True" SortIndex="0" SortOrder="Ascending">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings Mask="N1" MaskUseAsDisplayFormat="True" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<tsWPFCore:tsGridColumn FieldName="Fila" Width="50" IsSmart="True">
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:TextEditSettings Mask="N1" MaskUseAsDisplayFormat="True" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="Columna" IsSmart="True" Width="80">
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:TextEditSettings MaskUseAsDisplayFormat="True" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="NombreCampo" IsSmart="True" Width="350">
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:ComboBoxEditSettings ValueMember="Campo" PopupWidth="600" x:Name="cbCampos" IncrementalFiltering="True" DisplayMember="Descripcion" AutoComplete="True" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<tsWPFCore:tsGridColumn FieldName="Observaciones" IsSmart="True" Width="400" />
</tsWPFCore:tsGridControl>
<tsWPFCore:tsGridControl x:Name="gcCuentasCeldas" TabIndex="26" NombreTablaBase="gestionessiniestros">
<tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:PropiedadesTSGC CamposObligatorios="NumeroCuenta" CamposUnicos="NumeroCuenta" Descripcion="NumeroCuenta" />
</tsWPFCore:tsGridControl.PropiedadesTSGC>
<tsWPFCore:tsGridControl.View>
<tsWPFCore:tsTableView x:Name="tvCuentasCeldas" ShowGroupPanel="False" NewItemRowPosition="Bottom" AllowSorting="False" />
</tsWPFCore:tsGridControl.View>
<!--<tsWPF:tsGridColumn FieldName="idCuenta" Header="Nº Celda" Width="80" >
</tsWPF:tsGridColumn>-->
<dxg:GridColumn FieldName="NumeroCuenta" Width="120" ReadOnly="True" SortIndex="0">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings Mask="N1" MaxLength="8" MaskUseAsDisplayFormat="True" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<tsWPFCore:tsGridColumn FieldName="Factor" Width="50" IsSmart="True">
<tsWPFCore:tsGridColumn.EditSettings>
<dxe:TextEditSettings Mask="-?[1]" MaskType="RegEx" MaskUseAsDisplayFormat="True" />
</tsWPFCore:tsGridColumn.EditSettings>
</tsWPFCore:tsGridColumn>
<dxg:GridColumn FieldName="SoloSiPositivo" Width="120">
<dxg:GridColumn.EditSettings>
<dxe:CheckEditSettings />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="SoloSiNegativo" Width="120">
<dxg:GridColumn.EditSettings>
<dxe:CheckEditSettings />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</tsWPFCore:tsGridControl>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,312 @@
Imports DevExpress.Xpf.Editors
Imports DevExpress.Xpf.LayoutControl
Imports tsWPF
Imports System.ComponentModel
Imports System.Data
Imports DevExpress.Xpf.Editors.Validation
Imports DevExpress.Xpf.Editors.Helpers
Imports DevExpress.Xpf.Core
Imports tsWPF.modExtensiones
Imports System.Data.Common
Imports System.Data.Entity
Imports bdGrupoSanchoToro
Imports tsl5.Datos
Imports DevExpress.Xpf.Bars
Imports DevExpress.Xpf.Grid
Imports System.IO
Imports DevExpress.Spreadsheet
Imports Microsoft.Win32
Imports System.Drawing
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucInformeContables
Private bd As tscGrupoSanchoToro
Friend _idInforme As Nullable(Of Integer)
'
Public Overrides Sub Cargado()
Me.Tipo_ucControlBusqueda = GetType(ucInformesContables)
End Sub
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Dim NuevoEstado As EstadosAplicacion
Dim ra As informescontables
If FuerzaNuevo OrElse _idInforme Is Nothing Then
ra = New bdGrupoSanchoToro.db.informescontables
'ra.FechaApertura = Now.Date
'ra.Descripcion = Now.Year.ToString
'ra.FechaInicio = New Date(Now.Year, 1, 1)
'ra.FechaFin = New Date(Now.Year, 12, 31)
'ra.idEmpresa = bd.empresascontables.First(Function(x) x.FechaBaja.HasValue = False).idEmpresaContable
Me.DataContext = ra
_idInforme = Nothing
' ra.idEjercicio = Nothing
NuevoEstado = EstadosAplicacion.Nuevo
Else
ra = bd.informescontables.First(Function(x) x.idInforme = _idInforme)
NuevoEstado = EstadosAplicacion.ModificandoRegistro
End If
Me.DataContext = ra
gcCeldas.ItemsSource = ra.celdasinformescontables
'gcCuentasCeldas.ItemsSource = ra.celdasinformescontables.
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 "informescontables"
End Get
End Property
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
If Estado = EstadosAplicacion.Nuevo Then
Return "informescontables.Nuevo"
Else
Return "informescontables." & DirectCast(Me.DataContext, informescontables).idInforme.ToString
End If
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Informe Contable"
End Get
End Property
Public Sub New(Optional idInforme As Integer? = Nothing)
' Llamada necesaria para el diseñador.
InitializeComponent()
_idInforme = idInforme
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
'Public Sub EstableceAplicacion(ap As Aplicacion) Implements IAplicacion.EstableceAplicacion
' Me.ap = ap
'End Sub
Public Overrides Sub EstableceTitulo()
If Me.docpanel Is Nothing Then
Dim w As dxwGenerica = Window.GetWindow(Me)
w.Title = "Agregar nuevo informe"
Else
If Me.Estado = EstadosAplicacion.ModificandoRegistro Then
Dim ej As informescontables = Me.DataContext
Me.docpanel.Caption = "Informe " & ej.Descripcion
Me.docpanel.Tag = "Informe." & ej.Descripcion
Else
Me.docpanel.Caption = "Informe Nuevo"
Me.docpanel.Tag = "Informe.Nuevo"
End If
End If
End Sub
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
'Public Overrides Function ObtieneConexionBD() As BBDD
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
'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
If Not pts Is Nothing Then
Dim ra As informescontables = Me.DataContext
' Select Case pts.NombreCampo.ToLower
' End Select
End If
End Sub
'Private Sub ObtieneCuentas(ra As informescontables)
' 'Dim Nivel As Integer = cbNivel.EditValue
' 'Dim ctas = ra.cuentas.Where(Function(x) x.NumeroCuenta.Length = Nivel).ToList
' 'gcCuentas.ItemsSource = ctas
'End Sub
'Private Sub cbNivel_EditValueChanged(sender As Object, e As EditValueChangedEventArgs) Handles cbNivel.EditValueChanged
' Dim ra As ejercicioscontables = Me.DataContext
' ObtieneCuentas(ra)
'End Sub
'Private Sub HlAsientoRegularizacion_Click(sender As Object, e As RoutedEventArgs)
' Dim id = DirectCast(Me.DataContext, informescontables).AsientoRegularizacion.idAsiento
' Dim uc As New ucDiario
' FuncionesDinamicas.AbrirUcCL(uc, Comun.dwi.grupodoc, Nothing, Comun.dcfg, Comun.dcn, 0, bdGrupoSanchoToro.Utilidades.dsc, Comun.OtrosParametros, id)
'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 = "GENERA ASIENTO CIERRE Y DE APERTURA"})
'Acciones.Add(New Accion With {
' .idAccion = 2,
' .Descripcion = "REENUMERA Nº ASIENTO OFICIAL"})
'Acciones.Add(New Accion With {
' .idAccion = 3,
' .Descripcion = "GENERA BALANCE DE SITUACION"})
Me.cbCampos.ItemsSource = CampoInforme.ObtieneCamposInformes
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
If Acciones.Count > 0 Then Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
End Sub
'Private Sub HlAsientoApertura_Click(sender As Object, e As RoutedEventArgs)
' Dim id = DirectCast(Me.DataContext, informescontables).AsientoApertura.idAsiento
' Dim uc As New ucDiario
' FuncionesDinamicas.AbrirUcCL(uc, Comun.dwi.grupodoc, Nothing, Comun.dcfg, Comun.dcn, 0, bdGrupoSanchoToro.Utilidades.dsc, Comun.OtrosParametros, id)
'End Sub
Private Sub ap_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Select Case Celda.Column.FieldName.ToLower
'Case "idCelda"
' Dim id As Integer = DirectCast(Me.gcGestiones.CurrentItem, asientos).idAsiento
' Dim uc As New ucDiario
' FuncionesDinamicas.AbrirUcCL(uc, Comun.dwi.grupodoc, Nothing, Comun.dcfg, Comun.dcn, 0, bdGrupoSanchoToro.Utilidades.dsc, Comun.OtrosParametros, id)
End Select
End Sub
Private Sub ap_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
Dim ra As informescontables = Me.DataContext
_idInforme = ra.idInforme
'Dim NuevoInforme As informescontables = Me.DataContext
'_idInforme = NuevoInforme.idInforme
'If NuevoInforme.FechaCierre.HasValue = False AndAlso NuevoInforme.FechaApertura.Year = Now.Year Then
' Dim ea = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).FirstOrDefault(Function(x) x.FechaInicio < NuevoInforme.FechaInicio)
' If DXMessageBox.Show("¿Desea copiar las cuentas del Ejercicio Anterior?", "Atención", vbYesNo) = MessageBoxResult.Yes Then
' CopiaCuentas(NuevoInforme)
' ap.RefrescaUC(True)
' End If
'End If
End Sub
Private Sub ap_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
'Select Case idAccion
' Case 1 ' GENERA ASIENTO DE CIERRE Y APERTURA
' GeneraAsientoRegularizacionYApertura()
' Case 2 ' REENUMERA ASIENTOS OFICIALES Y CIERRA EL EJERCCIO
' ReenumeraAsientosOficiales()
' Case 3
' GeneraInformeContable("BALSIT")
'End Select
End Sub
Private Sub EstableceEstiloGrupo(rg As DevExpress.Spreadsheet.CellRange)
Dim rgf As Formatting = rg.BeginUpdateFormatting
rgf.Font.Bold = True
rgf.Fill.BackgroundColor = Color.LightCyan
rgf.Borders.BottomBorder.LineStyle = BorderLineStyle.DashDot
rgf.Borders.TopBorder.LineStyle = BorderLineStyle.DashDot
rgf.Borders.LeftBorder.LineStyle = BorderLineStyle.DashDot
rgf.Borders.RightBorder.LineStyle = BorderLineStyle.DashDot
End Sub
Private Sub RutaDocumentoAdjunto_DefaultButtonClick(sender As Object, e As RoutedEventArgs) Handles RutaDocumentoAdjunto.DefaultButtonClick
Dim ra As informescontables = Me.DataContext
Dim ofd As New OpenFileDialog
ofd.CheckPathExists = True
ofd.Filter = "Documento .xlsx|*.xlsx"
If ofd.ShowDialog Then
Dim fic As db.ficheros
If ra.idFicheroNavigation Is Nothing Then
fic = New db.ficheros
ra.idFicheroNavigation = fic
Else
fic = ra.idFicheroNavigation
End If
fic.NombreFichero = IO.Path.GetFileName(ofd.FileName)
fic.Fichero = IO.File.ReadAllBytes(ofd.FileName)
fic.Fecha = Now
fic.idTipo = bd.enumeraciones.Where(Function(x) x.Codigo = "TIPFIC.PLANTILLA").First.idEnumeracion
RutaDocumentoAdjunto.Text = IO.Path.GetFileName(ofd.FileName)
End If
End Sub
Private Sub BiVerFicheroEscaneado_Click(sender As Object, e As RoutedEventArgs)
Dim ra As informescontables = Me.DataContext
If ra.idFicheroNavigation IsNot Nothing AndAlso ra.idFicheroNavigation.Fichero IsNot Nothing Then
IO.File.WriteAllBytes("c:\tmp\" + ra.idFicheroNavigation.NombreFichero, ra.idFicheroNavigation.Fichero)
Process.Start("c:\tmp\" + ra.idFicheroNavigation.NombreFichero)
Else
DXMessageBox.Show("No se ha asignado ningún documento externo", "Atención")
End If
End Sub
Private Sub gcCeldas_CurrentItemChanged(sender As Object, e As CurrentItemChangedEventArgs) Handles gcCeldas.CurrentItemChanged
Dim celdainformes As celdasinformescontables = CType(gcCeldas.CurrentItem, celdasinformescontables)
If celdainformes IsNot Nothing Then
gcCuentasCeldas.ItemsSource = celdainformes.cuentasceldasinformescontables
Else
gcCuentasCeldas.ItemsSource = Nothing
End If
End Sub
'Private Sub tvCuentasCeldas_CellValueChanged(sender As Object, e As CellValueChangedEventArgs) Handles tvCuentasCeldas.CellValueChanged
' Select Case e.Column.FieldName.ToLower
' Case "numerocuenta"
' Dim dre As cuentasceldasinformescontables = e.Row
' Dim valor As String = tvCuentasCeldas.Grid.GetCellValue(e.RowHandle, "NumeroCuenta")
' If (Not valor.Length = 0) OrElse (valor.Length > 4 And valor.Length < 8) OrElse valor.Length > 8 Then
' tvCuentasCeldas.Grid.SetCellValue(e.RowHandle, "NumeroCuenta", "")
' End If
' End Select
'End Sub
Private Sub tvCuentasCeldas_ValidateRow(sender As Object, e As GridRowValidationEventArgs) Handles tvCuentasCeldas.ValidateRow
Dim htErrores = New Hashtable
Dim ap As cuentasceldasinformescontables = e.Row
Dim valor As String = ap.NumeroCuenta
If (Not valor.Length = 0) OrElse (valor.Length > 4 And valor.Length < 8) OrElse valor.Length > 8 Then
htErrores.Add("CuentasCeldas", "El numero de cuenta tiene que tener longitud de 1,2,3,4 u 8 caratéres")
End If
If htErrores.Count > 0 Then If htErrores.Count > 0 Then Me.AgregaErroresTSGC(gcCuentasCeldas, htErrores, e)
End Sub
Private Sub tvCuentasCeldas_ValidateCell(sender As Object, e As GridCellValidationEventArgs) Handles tvCuentasCeldas.ValidateCell
'Dim ap As cuentasceldasinformescontables = tvCuentasCeldas.Grid.GetCellValue(e.RowHandle, "NumeroCuenta")
If (e.Cell.Property = "NumeroCuenta") Then
Dim valor As String = e.Value
If (valor.Length = 0) OrElse ((valor.Length > 4 And valor.Length < 8) OrElse valor.Length > 8) Then
e.ErrorContent = "El numero de cuenta tiene que tener longitud de 1,2,3,4 u 8 caratéres"
e.IsValid = False
End If
End If
End Sub
End Class
Public Class CampoInforme
Property Campo As String
Property Descripcion As String
Public Shared Function ObtieneCamposInformes() As List(Of CampoInforme)
Dim lc As New List(Of CampoInforme)
lc.Add(New CampoInforme With {.Campo = "TOTALSALDO", .Descripcion = "TOTAL SALDO CUENTA"})
lc.Add(New CampoInforme With {.Campo = "TOTALSALDOEJANT", .Descripcion = "TOTAL SALDO CUENTA EJERCICIO ANTERIOR"})
lc.Add(New CampoInforme With {.Campo = "TOTALSALDOAC", .Descripcion = "TOTAL SALDO CUENTA (ANTES DE CIERRE)"})
lc.Add(New CampoInforme With {.Campo = "TOTALSALDOACEJANT", .Descripcion = "TOTAL SALDO CUENTA EJERCICIO ANTERIOR (ANTES DE CIERRE)"})
lc.Add(New CampoInforme With {.Campo = "EJERCICIO", .Descripcion = "EJERCICIO ACTUAL"})
lc.Add(New CampoInforme With {.Campo = "EJERCICIOANT", .Descripcion = "EJERCICIO ANTERIOR"})
Return lc
End Function
End Class

View File

@@ -0,0 +1,34 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:bdGrupoSanchoToro="clr-namespace:bdGrupoSanchoToro;assembly=bdGrupoSanchoToro" x:Class="ucInformesContables"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<tsWPFCore:tsGridControl x:Name="gc">
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.View>
<tsWPFCore:tsTableView ShowSearchPanelMode="Always" />
</dxg:GridControl.View>
<dxg:GridColumn FieldName="idInforme" Header="Nº Informe" Width="70" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
<dxg:GridColumn FieldName="Codigo" Header="Código" Width="150" IsSmart="True"/>
<dxg:GridColumn FieldName="Descripcion" Header="Descripción" Width="230" IsSmart="True" FilterPopupMode="Excel" />
<dxg:GridColumn FieldName="idFichero" Header="idFichero" Width="90" IsSmart="True" />
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,160 @@
Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports System.Linq.Dynamic
Imports tsWPF
Imports System.CodeDom.Compiler
Imports System.Reflection
Imports DevExpress.Xpf.Bars
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucInformesContables
Private bd As tscGrupoSanchoToro
Public Overrides Sub Cargado()
Me.ContenedorAplicacion.siEstado.IsVisible = False
End Sub
'Public Sub EstableceAplicacion(ap As tsWPF.Aplicacion) .EstableceAplicacion
' Me.ap = ap
'End Sub
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Me.gc.ItemsSource = bd.informescontables.ToList
Return 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 = "COPIA INFORME"})
'Acciones.Add(New Accion With {
' .idAccion = 2,
' .Descripcion = "REENUMERA Nº ASIENTO OFICIAL"})
'Acciones.Add(New Accion With {
' .idAccion = 3,
' .Descripcion = "GENERA BALANCE DE SITUACION"})
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
If Acciones.Count > 0 Then Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Informes Contables"
End Sub
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "informescontables"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "informescontables"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Informes Contables"
End Get
End Property
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
bd = tscGrupoSanchoToro.NuevoContexto()
Return bd
End Function
'Public Overrides Function ObtieneConexionBD() As tsl5.Datos.BBDD
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
'End Function
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
Return Comun.ObtienePermisos(Me.bd, "AP.CONTABILIDAD", idUsuario)
End Function
Private Sub Nuevo() Handles Me.BotonNuevoPulsado
FuncionesDinamicas.AbrirAP(New ucInformeContables, OtrosParametros)
End Sub
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
Dim id As Integer = DirectCast(Me.gc.CurrentItem, informescontables).idInforme
' Dim uc As New ucRamo
' Dim dwi As dxwInicio = Window.GetWindow(Me)
FuncionesDinamicas.AbrirAP(New ucInformeContables(id), OtrosParametros)
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
' Dim ra As informescontables = Me.DataContext
' If Me.Estado = EstadosAplicacion.Nuevo Then
' If bd.informescontables.Any(Function(x) x.Codigo = ra.Codigo) Then
' Cancelar = True
' End If
' End If
'End Sub
Private Sub ucInformesContables_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
Select Case idAccion
Case 1
Dim ra As informescontables = gc.CurrentItem
If ra IsNot Nothing Then
Dim ni As New informescontables
Dim sDesc As String
Dim sCod As String
Dim i As Integer = 0
Do
If i = 0 Then
sDesc = "COPIA " & ra.Descripcion
sCod = ra.Codigo & ".COP"
Else
sDesc = "COPIA " & i.ToString & " " & ra.Descripcion
sCod = ra.Codigo & ".COP" & i.ToString
End If
i += 1
Loop Until bd.informescontables.Any(Function(x) x.Descripcion = sDesc Or x.Codigo = sCod) = False
Dim fi As New ficheros
With fi
.Descripcion = ra.ficheros.Descripcion
.Fecha = ra.ficheros.Fecha
.idAplicacion = ra.ficheros.idAplicacion
.idTipo = ra.ficheros.idTipo
.Observaciones = ra.ficheros.Observaciones
.Fichero = ra.ficheros.Fichero
.NombreFichero = ra.ficheros.NombreFichero
End With
With ni
.Codigo = sCod
.Descripcion = sDesc
.ficheros = fi
End With
For Each c In ra.celdasinformescontables
Dim nc As New celdasinformescontables
With nc
.Columna = c.Columna
.Fila = c.Fila
.Hoja = c.Hoja
.NombreCampo = c.NombreCampo
.Observaciones = c.Observaciones
End With
ni.celdasinformescontables.Add(nc)
Next
bd.informescontables.AddObject(ni)
bd.SaveChanges()
Me.RefrescaUC()
Else
DXMessageBox.Show("Seleccione el informe a copiar primero", "Atención")
End If
End Select
End Sub
End Class

View File

@@ -0,0 +1,94 @@
<tsWPFCore:tsUserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPF="clr-namespace:tsWPF;assembly=tsWPF" x:Class="ucListadoDiario"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<dxlc:LayoutControl Orientation="Vertical">
<dxlc:LayoutGroup View="GroupBox" Header="Filtros" x:Name="lgFiltrosBusquedaRapida" Width="Auto" Orientation="Vertical" HorizontalAlignment="Stretch" >
<dxlc:LayoutGroup Orientation="Vertical" Width="800" HorizontalAlignment="Left" >
<dxlc:LayoutGroup >
<tsWPFCore:tsLayoutItem Label="Fecha Inicio:" Width="250">
<dxe:DateEdit x:Name="deFechaInicio" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
<tsWPFCore:tsLayoutItem Label="Fecha Fin:" Width="200">
<dxe:DateEdit x:Name="deFechaFin" TabIndex="3"/>
</tsWPFCore:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup >
<tsWPFCore:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" x:FieldModifier="public" FontWeight="Normal" />
</tsWPFCore:tsLayoutItem>
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
</dxlc:LayoutGroup>
<dxlc:LayoutItem Label="Campos de búsqueda:" x:Name="liCamposBusqueda" >
<Border BorderThickness="1" BorderBrush="Black" >
<TextBlock x:Name="tbCamposBusqueda" Text="Nº Cuenta, Denominación Cuenta"/>
</Border>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<tsWPFCore:tsGridControl x:Name="gc" >
<tsWPFCore:tsGridControl.PropiedadesTS>
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
</tsWPFCore:tsGridControl.PropiedadesTS>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="idAsiento" Header="Nº Asiento" Width="100" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" GroupIndex="0" />
<dxg:GridColumn FieldName="cuentas.NumeroCuenta" Header="Cuenta" Width="120" IsSmart="True"/>
<dxg:GridColumn FieldName="asientos.Fecha" Header="Fecha" Width="90" IsSmart="True">
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="d"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Concepto" Header="Concepto" Width="400" IsSmart="True"/>
<dxg:GridColumn FieldName="Debe" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Haber" Width="110" HorizontalHeaderContentAlignment="Right" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<tsWPFCore:tsGridControl.GroupSummary >
<!--<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº Apuntes:{0:n0}" ShowInGroupColumnFooter="Concepto" />-->
<dxg:GridSummaryItem FieldName="Debe" SummaryType="Sum" ShowInGroupColumnFooter="Debe" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="Haber" SummaryType="Sum" ShowInGroupColumnFooter="Haber" DisplayFormat=" {0:c2}" />
<!--<dxg:GridSummaryItem FieldName="Saldo" SummaryType="Sum" ShowInGroupColumnFooter="Saldo" DisplayFormat=" {0:c2}" />-->
</tsWPFCore:tsGridControl.GroupSummary>
<tsWPFCore:tsGridControl.TotalSummary>
<!--<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº A:{0:n0}" ShowInColumn="Concepto" />-->
<dxg:GridSummaryItem FieldName="Debe" SummaryType="Sum" ShowInColumn="Debe" DisplayFormat=" {0:c2}" />
<dxg:GridSummaryItem FieldName="Haber" SummaryType="Sum" ShowInColumn="Haber" DisplayFormat=" {0:c2}" />
<!--<dxg:GridSummaryItem FieldName="Saldo" SummaryType="Sum" ShowInColumn="Saldo" DisplayFormat=" {0:c2}" />-->
</tsWPFCore:tsGridControl.TotalSummary>
<dxg:GridControl.View>
<tsWPFCore:tsTableView ShowGroupFooters="True" ShowGroupPanel="True" ShowSearchPanelMode="Always" ShowTotalSummary="True" >
<tsWPFCore:tsTableView.FormatConditions>
<dxg:FormatCondition Expression="[Tipo] = 0" FieldName="{x:Null}" >
<dxg:Format Foreground="Red" />
</dxg:FormatCondition>
</tsWPFCore:tsTableView.FormatConditions>
</tsWPFCore:tsTableView>
</dxg:GridControl.View>
</tsWPFCore:tsGridControl>
</dxlc:LayoutControl>
</Grid>
</tsWPFCore:tsUserControl>

View File

@@ -0,0 +1,176 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports bdGrupoSanchoToro
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports System.Linq.Dynamic
Imports DevExpress.Xpf.Bars
Imports tsl5.Datos
Imports tsWPF
Imports tsWPF.Comun
Imports tsWPFCore.Comun
Imports tsWPFCore
Imports tsUtilidades
Imports bdGrupoSanchoToro
Imports bdGrupoSanchoToro.db
Imports bdGrupoSanchoToro.db.Utilidades
Public Class ucListadoDiario
Dim bd As tscGrupoSanchoToro
Dim EjerContables As List(Of ejercicioscontables)
' Private _Ejercicios As List(Of Integer)
' Private _NivelCuentas As Integer
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
Get
Return "ListadoDiario"
End Get
End Property
Public Overrides ReadOnly Property DescripcionRegistro As String
Get
Return "Apuntes"
End Get
End Property
Public Overrides ReadOnly Property NombreTablaBase As String
Get
Return "apuntes"
End Get
End Property
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
End Sub
Public Overrides Sub EstableceTitulo()
Me.docpanel.Caption = "Listado Diario"
End Sub
Public Overrides Sub Cargado()
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
Dim ejab = Ejercicios.Where(Function(x) x.FechaCierre Is Nothing)
deFechaInicio.EditValue = ejab.OrderBy(Function(x) x.FechaInicio).First.FechaInicio
deFechaFin.EditValue = ejab.OrderByDescending(Function(x) x.FechaFin).First.FechaFin
End Sub
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As EstadosAplicacion
Dim Ejercicios = bd.ejercicioscontables.OrderByDescending(Function(x) x.FechaInicio).ToList
Return 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.CONTABILIDAD", idUsuario)
End Function
Public Sub New()
' Esta llamada es exigida por el diseñador.
InitializeComponent()
'Me.lgFiltrosBusquedaRapida.Visibility = Visibility.Collapsed
'Me.lgFiltrosBusquedaAvanzada.Visibility = Visibility.Visible
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Public Function ObtieneApuntes(TextoBusqueda As String, FechaInicio As Date, FechaFin As Date) As List(Of apuntes)
Dim rs As List(Of apuntes)
Dim parametros(0) As Object
Dim iNumExc As Integer = 0
Do
Try
If TextoBusqueda <> "" Then
Dim Calf() As String = {"cuentas.Denominacion"}
Dim Calfc() As String = {"cuentas.NumeroCuenta"}
Dim ExpBus As String = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Nothing, Calf, Nothing, Calfc)
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
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
End If
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
End If
Exit Do
Catch ex As Exception
iNumExc += 1
If iNumExc > 3 Then
Throw New Exception(ex.Message, ex)
End If
End Try
Loop
Return rs
End Function
Public Async Sub ObtieneApuntesAsync(bd As tscGrupoSanchoToro, Background As Boolean)
Try
Dim rs As New List(Of apuntes)
Dim fi, ff As Date?
Dim Busqueda As String
Busqueda = Me.teBusqueda.Text.Trim
fi = deFechaInicio.EditValue
ff = deFechaFin.EditValue
If Background Then
Me.ContenedorAplicacion.IsEnabled = False
Await Task.Run(Sub()
rs = ObtieneApuntes(Busqueda, fi, ff)
End Sub)
Else
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
DXSplashScreen.SetState("Buscando Apuntes ...")
rs = ObtieneApuntes(Busqueda, fi, ff)
End If
gc.ItemsSource = rs
DataContext = rs
gc.ExpandAllGroups()
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, apuntes).idAsiento
If id > 0 Then
Dim uc As New ucDiario(id)
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
End If
End Sub
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
ObtieneApuntesAsync(bd, False)
End Sub
'Private Sub CbEjerciciosBA_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs)
' ObtienecuentasAsync(bd, False, True)
'End Sub
'Private Sub ApLineas_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
' Select Case idAccion
' Case 1 ' balance de situacion
' End Select
'End Sub
End Class

View File

@@ -29,7 +29,7 @@ namespace bdGrupoSanchoToro.XSD {
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public CTESGESL() { public CTESGESL() {
this.BeginInit(); this.BeginInit();
this.InitClass(); this.InitClass();
@@ -40,7 +40,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called" + [System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called" +
" or extended by application code.", DiagnosticId="SYSLIB0051")] " or extended by application code.", DiagnosticId="SYSLIB0051")]
protected CTESGESL(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : protected CTESGESL(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
@@ -78,7 +78,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public DatosDataTable Datos { public DatosDataTable Datos {
@@ -88,7 +88,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.BrowsableAttribute(true)] [global::System.ComponentModel.BrowsableAttribute(true)]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
@@ -101,7 +101,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataTableCollection Tables { public new global::System.Data.DataTableCollection Tables {
get { get {
@@ -110,7 +110,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataRelationCollection Relations { public new global::System.Data.DataRelationCollection Relations {
get { get {
@@ -119,7 +119,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void InitializeDerivedDataSet() { protected override void InitializeDerivedDataSet() {
this.BeginInit(); this.BeginInit();
this.InitClass(); this.InitClass();
@@ -127,7 +127,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public override global::System.Data.DataSet Clone() { public override global::System.Data.DataSet Clone() {
CTESGESL cln = ((CTESGESL)(base.Clone())); CTESGESL cln = ((CTESGESL)(base.Clone()));
cln.InitVars(); cln.InitVars();
@@ -136,19 +136,19 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override bool ShouldSerializeTables() { protected override bool ShouldSerializeTables() {
return false; return false;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override bool ShouldSerializeRelations() { protected override bool ShouldSerializeRelations() {
return false; return false;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) { protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
this.Reset(); this.Reset();
@@ -173,7 +173,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() { protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null)); this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
@@ -182,13 +182,13 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal void InitVars() { internal void InitVars() {
this.InitVars(true); this.InitVars(true);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal void InitVars(bool initTable) { internal void InitVars(bool initTable) {
this.tableDatos = ((DatosDataTable)(base.Tables["Datos"])); this.tableDatos = ((DatosDataTable)(base.Tables["Datos"]));
if ((initTable == true)) { if ((initTable == true)) {
@@ -199,7 +199,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
private void InitClass() { private void InitClass() {
this.DataSetName = "CTESGESL"; this.DataSetName = "CTESGESL";
this.Prefix = ""; this.Prefix = "";
@@ -211,13 +211,13 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
private bool ShouldSerializeDatos() { private bool ShouldSerializeDatos() {
return false; return false;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
this.InitVars(); this.InitVars();
@@ -225,7 +225,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
CTESGESL ds = new CTESGESL(); CTESGESL ds = new CTESGESL();
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
@@ -271,7 +271,7 @@ namespace bdGrupoSanchoToro.XSD {
return type; return type;
} }
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public delegate void DatosRowChangeEventHandler(object sender, DatosRowChangeEvent e); public delegate void DatosRowChangeEventHandler(object sender, DatosRowChangeEvent e);
/// <summary> /// <summary>
@@ -292,7 +292,7 @@ namespace bdGrupoSanchoToro.XSD {
private global::System.Data.DataColumn columnLCVAA; private global::System.Data.DataColumn columnLCVAA;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosDataTable() { public DatosDataTable() {
this.TableName = "Datos"; this.TableName = "Datos";
this.BeginInit(); this.BeginInit();
@@ -301,7 +301,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal DatosDataTable(global::System.Data.DataTable table) { internal DatosDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName; this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
@@ -318,7 +318,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called" + [System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called" +
" or extended by application code.", DiagnosticId="SYSLIB0051")] " or extended by application code.", DiagnosticId="SYSLIB0051")]
protected DatosDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : protected DatosDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
@@ -327,7 +327,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCORDColumn { public global::System.Data.DataColumn LCORDColumn {
get { get {
return this.columnLCORD; return this.columnLCORD;
@@ -335,7 +335,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCGRUColumn { public global::System.Data.DataColumn LCGRUColumn {
get { get {
return this.columnLCGRU; return this.columnLCGRU;
@@ -343,7 +343,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCCODColumn { public global::System.Data.DataColumn LCCODColumn {
get { get {
return this.columnLCCOD; return this.columnLCCOD;
@@ -351,7 +351,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCDESColumn { public global::System.Data.DataColumn LCDESColumn {
get { get {
return this.columnLCDES; return this.columnLCDES;
@@ -359,7 +359,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCVAAColumn { public global::System.Data.DataColumn LCVAAColumn {
get { get {
return this.columnLCVAA; return this.columnLCVAA;
@@ -367,7 +367,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.Browsable(false)]
public int Count { public int Count {
get { get {
@@ -376,33 +376,33 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRow this[int index] { public DatosRow this[int index] {
get { get {
return ((DatosRow)(this.Rows[index])); return ((DatosRow)(this.Rows[index]));
} }
} }
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public event DatosRowChangeEventHandler DatosRowChanging; public event DatosRowChangeEventHandler DatosRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public event DatosRowChangeEventHandler DatosRowChanged; public event DatosRowChangeEventHandler DatosRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public event DatosRowChangeEventHandler DatosRowDeleting; public event DatosRowChangeEventHandler DatosRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public event DatosRowChangeEventHandler DatosRowDeleted; public event DatosRowChangeEventHandler DatosRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void AddDatosRow(DatosRow row) { public void AddDatosRow(DatosRow row) {
this.Rows.Add(row); this.Rows.Add(row);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRow AddDatosRow(string LCORD, string LCGRU, string LCCOD, string LCDES, string LCVAA) { public DatosRow AddDatosRow(string LCORD, string LCGRU, string LCCOD, string LCDES, string LCVAA) {
DatosRow rowDatosRow = ((DatosRow)(this.NewRow())); DatosRow rowDatosRow = ((DatosRow)(this.NewRow()));
object[] columnValuesArray = new object[] { object[] columnValuesArray = new object[] {
@@ -417,7 +417,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public override global::System.Data.DataTable Clone() { public override global::System.Data.DataTable Clone() {
DatosDataTable cln = ((DatosDataTable)(base.Clone())); DatosDataTable cln = ((DatosDataTable)(base.Clone()));
cln.InitVars(); cln.InitVars();
@@ -425,13 +425,13 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() { protected override global::System.Data.DataTable CreateInstance() {
return new DatosDataTable(); return new DatosDataTable();
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal void InitVars() { internal void InitVars() {
this.columnLCORD = base.Columns["LCORD"]; this.columnLCORD = base.Columns["LCORD"];
this.columnLCGRU = base.Columns["LCGRU"]; this.columnLCGRU = base.Columns["LCGRU"];
@@ -441,7 +441,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
private void InitClass() { private void InitClass() {
this.columnLCORD = new global::System.Data.DataColumn("LCORD", typeof(string), null, global::System.Data.MappingType.Element); this.columnLCORD = new global::System.Data.DataColumn("LCORD", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnLCORD); base.Columns.Add(this.columnLCORD);
@@ -456,25 +456,25 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRow NewDatosRow() { public DatosRow NewDatosRow() {
return ((DatosRow)(this.NewRow())); return ((DatosRow)(this.NewRow()));
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new DatosRow(builder); return new DatosRow(builder);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override global::System.Type GetRowType() { protected override global::System.Type GetRowType() {
return typeof(DatosRow); return typeof(DatosRow);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e); base.OnRowChanged(e);
if ((this.DatosRowChanged != null)) { if ((this.DatosRowChanged != null)) {
@@ -483,7 +483,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e); base.OnRowChanging(e);
if ((this.DatosRowChanging != null)) { if ((this.DatosRowChanging != null)) {
@@ -492,7 +492,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e); base.OnRowDeleted(e);
if ((this.DatosRowDeleted != null)) { if ((this.DatosRowDeleted != null)) {
@@ -501,7 +501,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e); base.OnRowDeleting(e);
if ((this.DatosRowDeleting != null)) { if ((this.DatosRowDeleting != null)) {
@@ -510,13 +510,13 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void RemoveDatosRow(DatosRow row) { public void RemoveDatosRow(DatosRow row) {
this.Rows.Remove(row); this.Rows.Remove(row);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
@@ -587,14 +587,14 @@ namespace bdGrupoSanchoToro.XSD {
private DatosDataTable tableDatos; private DatosDataTable tableDatos;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal DatosRow(global::System.Data.DataRowBuilder rb) : internal DatosRow(global::System.Data.DataRowBuilder rb) :
base(rb) { base(rb) {
this.tableDatos = ((DatosDataTable)(this.Table)); this.tableDatos = ((DatosDataTable)(this.Table));
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCORD { public string LCORD {
get { get {
try { try {
@@ -610,7 +610,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCGRU { public string LCGRU {
get { get {
try { try {
@@ -626,7 +626,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCCOD { public string LCCOD {
get { get {
try { try {
@@ -642,7 +642,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCDES { public string LCDES {
get { get {
try { try {
@@ -658,7 +658,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCVAA { public string LCVAA {
get { get {
try { try {
@@ -674,61 +674,61 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCORDNull() { public bool IsLCORDNull() {
return this.IsNull(this.tableDatos.LCORDColumn); return this.IsNull(this.tableDatos.LCORDColumn);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCORDNull() { public void SetLCORDNull() {
this[this.tableDatos.LCORDColumn] = global::System.Convert.DBNull; this[this.tableDatos.LCORDColumn] = global::System.Convert.DBNull;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCGRUNull() { public bool IsLCGRUNull() {
return this.IsNull(this.tableDatos.LCGRUColumn); return this.IsNull(this.tableDatos.LCGRUColumn);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCGRUNull() { public void SetLCGRUNull() {
this[this.tableDatos.LCGRUColumn] = global::System.Convert.DBNull; this[this.tableDatos.LCGRUColumn] = global::System.Convert.DBNull;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCCODNull() { public bool IsLCCODNull() {
return this.IsNull(this.tableDatos.LCCODColumn); return this.IsNull(this.tableDatos.LCCODColumn);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCCODNull() { public void SetLCCODNull() {
this[this.tableDatos.LCCODColumn] = global::System.Convert.DBNull; this[this.tableDatos.LCCODColumn] = global::System.Convert.DBNull;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCDESNull() { public bool IsLCDESNull() {
return this.IsNull(this.tableDatos.LCDESColumn); return this.IsNull(this.tableDatos.LCDESColumn);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCDESNull() { public void SetLCDESNull() {
this[this.tableDatos.LCDESColumn] = global::System.Convert.DBNull; this[this.tableDatos.LCDESColumn] = global::System.Convert.DBNull;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCVAANull() { public bool IsLCVAANull() {
return this.IsNull(this.tableDatos.LCVAAColumn); return this.IsNull(this.tableDatos.LCVAAColumn);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCVAANull() { public void SetLCVAANull() {
this[this.tableDatos.LCVAAColumn] = global::System.Convert.DBNull; this[this.tableDatos.LCVAAColumn] = global::System.Convert.DBNull;
} }
@@ -737,7 +737,7 @@ namespace bdGrupoSanchoToro.XSD {
/// <summary> /// <summary>
///Row event argument class ///Row event argument class
///</summary> ///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public class DatosRowChangeEvent : global::System.EventArgs { public class DatosRowChangeEvent : global::System.EventArgs {
private DatosRow eventRow; private DatosRow eventRow;
@@ -745,14 +745,14 @@ namespace bdGrupoSanchoToro.XSD {
private global::System.Data.DataRowAction eventAction; private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRowChangeEvent(DatosRow row, global::System.Data.DataRowAction action) { public DatosRowChangeEvent(DatosRow row, global::System.Data.DataRowAction action) {
this.eventRow = row; this.eventRow = row;
this.eventAction = action; this.eventAction = action;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRow Row { public DatosRow Row {
get { get {
return this.eventRow; return this.eventRow;
@@ -760,7 +760,7 @@ namespace bdGrupoSanchoToro.XSD {
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataRowAction Action { public global::System.Data.DataRowAction Action {
get { get {
return this.eventAction; return this.eventAction;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,133 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
namespace bdGrupoSanchoToro.db
{
public partial class apuntes
{
private string _NumeroCuentaTmp;
public string NumeroCuentaTmp
{
get
{
return _NumeroCuentaTmp;
}
set
{
_NumeroCuentaTmp = value;
OnPropertyChanged("NumeroCuentaTmp");
}
}
public double SaldoCuentaTmp { get; set; }
public string DescripcionCuentaTmp { get; set; }
public static void EstableceSaldoTmp(List<apuntes> lap)
{
double SaldoAnterior = 0;
foreach (var ap in lap)
{
SaldoAnterior = SaldoAnterior + ap.Debe - ap.Haber;
ap.SaldoCuentaTmp = SaldoAnterior;
}
}
public static List<Tipo> ListaTiposDocumentos()
{
var lEstados = new List<Tipo>();
foreach (TiposDocumentos Enumeracion in Enum.GetValues(typeof(TiposDocumentos)))
lEstados.Add(new Tipo() { id = (int)Enumeracion, Descripcion = Enumeracion.ToString().Replace("_", " ") });
return lEstados;
}
public double DebeAnterior(tscGrupoSanchoToro bd, DateOnly Fecha)
{
try
{
var aps = bd.apuntes.Where(X => X.idCuentaNavigation.idCuenta == this.idCuenta & X.idAsientoNavigation.Fecha < Fecha).ToList();
return aps.Sum(x => x.Debe);
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
public double HaberAnterior(tscGrupoSanchoToro bd, DateOnly Fecha)
{
try
{
var aps = bd.apuntes.Where(X => X.idCuenta == this.idCuenta & X.idAsientoNavigation.Fecha < Fecha).ToList();
return aps.Sum(x => x.Haber);
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
private bool? _Conciliado;
public bool Conciliado
{
get
{
if (_Conciliado.HasValue)
return (bool)_Conciliado;
else if (ConciliacionActual_TMP != null)
{
if (ConciliacionActual_TMP.idConciliacion != this.idConciliacion)
return false;
else
return this.idConciliacion.HasValue;
}
else
return this.idConciliacion.HasValue;
}
set
{
_Conciliado = value;
if (value)
this.idConciliacionNavigation = this.ConciliacionActual_TMP;
else
this.idConciliacion = null;
}
}
public string ConciliadoEn
{
get
{
if (ConciliacionActual_TMP != null && this.idConciliacion.HasValue && this.idConciliacion != ConciliacionActual_TMP.idConciliacion)
return "Nº Conc.: " + this.idConciliacion + " (" + this.idConciliacionNavigation.Anno.ToString + "-" + this.idConciliacionNavigation.Mes.ToString + ")";
else
return "";
}
}
public conciliacionesbancarias ConciliacionActual_TMP { get; set; }
public double Saldo
{
get
{
return Math.Round(Debe - Haber, 2);
}
}
public double Diferencia
{
get
{
return Debe - Haber;
}
}
public class Tipo
{
public int id { get; set; }
public string Descripcion { get; set; }
}
public enum TiposDocumentos
{
RECIBO = 1,
FACTURA = 2,
OTRO = 99
}
}
}

View File

@@ -0,0 +1,107 @@
using FluentFTP.Helpers;
using Microsoft.VisualBasic;
using System;
using System.Data;
using System.Linq;
namespace bdGrupoSanchoToro.db
{
public partial class asientos
{
public enum TipoAsiento : int
{
NORMAL = 0,
APERTURA = 1,
REGULARIZACION = 2
}
public string Cuentas
{
get
{
if (this.apuntes.Count > 10)
return "** MÁS DE 10 **";
else
{
string sCuentas = "";
foreach (var ap in this.apuntes)
sCuentas += ap.idCuentaNavigation.NumeroCuenta + " ";
return sCuentas.Trim();
}
}
}
public string Documentos
{
get
{
string sDocumentos = "";
foreach (var ap in this.apuntes.ToList().Where(x => x.NumeroDocumento != null && x.NumeroDocumento != "").GroupBy(x => x.NumeroDocumento))
sDocumentos += ap.First().NumeroDocumento + " ";
return sDocumentos.Trim();
}
}
public string Conceptos
{
get
{
string sDocumentos = "";
foreach (var ap in this.apuntes.ToList().GroupBy(x => x.Concepto))
sDocumentos += ap.First().Concepto + " ";
return sDocumentos.Trim();
}
}
public int? idAsiento_Nulable
{
get
{
if (this.idAsiento == 0)
return null;
else
return this.idAsiento;
}
}
public void RellenaCuentaTmp()
{
foreach (var ap in this.apuntes)
{
ap.NumeroCuentaTmp = ap.idCuentaNavigation.NumeroCuenta;
ap.DescripcionCuentaTmp = ap.idCuentaNavigation.Denominacion;
}
}
public void RefrescaExtensiones()
{
OnPropertyChanged("EjercicioTmp");
OnPropertyChanged("idAsiento_Nulable");
}
public static cuentas ObtieneCuenta(tscGrupoSanchoToro bd, string cta, int idEjercicio)
{
var cuenta = bd.cuentas.FirstOrDefault(x => x.NumeroCuenta == cta & x.idEjercicio == idEjercicio);
if (cuenta == null)
{
var ctaant = bd.cuentas.Where(x => x.NumeroCuenta == cta).OrderByDescending(x => x.idEjercicioNavigation.FechaInicio).FirstOrDefault();
if (ctaant != null)
cuenta = bdGrupoSanchoToro.db.cuentas.CreaCuenta(bd, idEjercicio, cta, ctaant.Denominacion, ctaant.Observaciones);
}
return cuenta;
}
private string _Ejercicio;
public string EjercicioTmp
{
get
{
if (_Ejercicio == "" && idEjercicioNavigation != null)
_Ejercicio = idEjercicioNavigation.Descripcion;
return _Ejercicio;
}
set
{
_Ejercicio = value;
OnPropertyChanged("EjercicioTmp");
}
}
}
}

View File

@@ -0,0 +1,746 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class cuentas
{
public static int LongitudCuentaFinal
{
get
{
return (8);
}
}
public const string CUENTA_PERDIDAS_Y_GANANCIAS = "12900000";
public List<apuntes> ApuntesTemporales { get; set; }
public string Descripcion
{
get
{
return this.NumeroCuenta + " " + this.Denominacion;
}
}
public void RellenaApuntesTemporales(bool IncluirAsientoCierre)
{
if (this.Nivel == LongitudCuentaFinal)
{
int TipoApertura = (int)asientos.TipoAsiento.APERTURA;
int TipoRegularizacion = (int)asientos.TipoAsiento.REGULARIZACION;
var apap = this.apuntes.Where(x => x.idAsientoNavigation.Tipo == TipoApertura).ToList();
if (apap.Count == 0)
this.SaldoInicialTmp = 0;
else
this.SaldoInicialTmp = Math.Round(apap.Sum(x => x.Debe - x.Haber), 2, MidpointRounding.AwayFromZero);
if (IncluirAsientoCierre)
ApuntesTemporales = this.apuntes.Where(x => x.idAsientoNavigation.Tipo != TipoApertura).ToList();
else
ApuntesTemporales = this.apuntes.Where(x => x.idAsientoNavigation.Tipo != TipoApertura & x.idAsientoNavigation.Tipo != TipoRegularizacion).ToList();
}
else
{
int TipoApertura = (int)asientos.TipoAsiento.APERTURA;
int TipoRegularizacion = (int)asientos.TipoAsiento.REGULARIZACION;
bdGrupoSanchoToro.tscGrupoSanchoToro.NuevoContexto();
var apap = bd.apuntes.Where(x => x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta) & x.idAsientoNavigation.Tipo == TipoApertura ).ToList();
if (apap.Count == 0)
this.SaldoInicialTmp = 0;
else
this.SaldoInicialTmp = Math.Round(apap.Sum(x => x.Debe - x.Haber), 2, MidpointRounding.AwayFromZero);
if (IncluirAsientoCierre)
ApuntesTemporales = bd.apuntes.Where(x => x.idAsientoNavigation.idEjercicio == this.idEjercicio & x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta) & x.idAsientoNavigation.Tipo != TipoApertura).ToList();
else
ApuntesTemporales = bd.apuntes.Where(x => x.idAsientoNavigation.idEjercicio == this.idEjercicio & x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta) & x.idAsientoNavigation.Tipo != TipoRegularizacion & x.idAsientoNavigation.Tipo != TipoApertura).ToList();
}
if (ApuntesTemporales.Count == 0)
{
this.SaldoDebeTmp = 0;
this.SaldoHaberTmp = 0;
}
else
{
this.SaldoDebeTmp = Math.Round(ApuntesTemporales.Sum(x => x.Debe), 2, MidpointRounding.AwayFromZero);
this.SaldoHaberTmp = Math.Round(ApuntesTemporales.Sum(x => x.Haber), 2, MidpointRounding.AwayFromZero);
}
this.SaldoFinalTmp = this.SaldoInicialTmp + this.SaldoDebeTmp - this.SaldoHaberTmp;
}
public double SaldoInicialTmp { get; set; }
public double SaldoDebeTmp { get; set; }
public double SaldoHaberTmp { get; set; }
public double SaldoFinalTmp { get; set; }
public static cuentas CreaCuenta(tscGrupoSanchoToro bd, int idEjercicio, string NumeroCuenta, string Descripcion, string Observaciones = "")
{
var cta = bd.cuentas.FirstOrDefault(x => x.NumeroCuenta == NumeroCuenta & x.idEjercicio == idEjercicio);
if (cta == null)
{
cta = new cuentas();
{
var withBlock = cta;
withBlock.NumeroCuenta = NumeroCuenta;
withBlock.idEjercicio = idEjercicio;
withBlock.Denominacion = Descripcion.Acortar(150);
withBlock.EsCuentaFinal = true;
withBlock.Observaciones = Observaciones;
}
bd.cuentas.Add(cta);
bd.SaveChanges();
}
return cta;
}
public static cuentas CreaCuenta(tscGrupoSanchoToro bd, DateOnly Fecha, string NumeroCuenta, string Descripcion, string Observaciones = "")
{
var ej = bd.ejercicioscontables.FirstOrDefault(x => x.FechaInicio <= Fecha & x.FechaFin >= Fecha);
if (ej == null)
throw new Exception("No existe ningún ejercicio abierto para la fecha " + Fecha.ToString());
return CreaCuenta(bd, ej.idEjercicio, NumeroCuenta, Descripcion, Observaciones);
}
int TipoApertura = (int)asientos.TipoAsiento.APERTURA;
int TipoRegularizacion = (int)asientos.TipoAsiento.REGULARIZACION;
public double TotalSaldoAntesCierre
{
get
{
var ac = this.idEjercicioNavigation.asientos.FirstOrDefault(x => x.Tipo == TipoRegularizacion);
if (ac == null)
return TotalSaldo;
else
{
var tdac = ac.apuntes.Where(x => x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta)).Sum(x => x.Debe);
var thac = ac.apuntes.Where(x => x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta)).Sum(x => x.Haber);
return TotalSaldo - tdac + thac;
}
}
}
public string Grupo1
{
get
{
if (this.NumeroCuenta.Length > 1)
{
var nc = this.NumeroCuenta.Substring(0, 1);
return nc + " - " + this.idEjercicioNavigation.cuentas.First(x => x.NumeroCuenta == nc).Denominacion;
}
else
return "";
}
}
public string Grupo2
{
get
{
if (this.NumeroCuenta.Length > 2)
{
var nc = this.NumeroCuenta.Substring(0, 2);
return nc + " - " + this.idEjercicioNavigation.cuentas.First(x => x.NumeroCuenta == nc).Denominacion;
}
else
return "";
}
}
public string Grupo3
{
get
{
if (this.NumeroCuenta.Length > 3)
{
var nc = this.NumeroCuenta.Substring(0, 3);
return nc + " - " + this.idEjercicioNavigation.cuentas.First(x => x.NumeroCuenta == nc).Denominacion;
}
else
return "";
}
}
public string Grupo4
{
get
{
if (this.NumeroCuenta.Length > 4)
{
var nc = this.NumeroCuenta.Substring(0, 4);
return nc + " - " + this.idEjercicioNavigation.cuentas.First(x => x.NumeroCuenta == nc).Denominacion;
}
else
return "";
}
}
private tscGrupoSanchoToro _bd;
public tscGrupoSanchoToro bd
{
get
{
if (_bd == null)
_bd = bdGrupoSanchoToro.tscGrupoSanchoToro.NuevoContexto();
return _bd;
}
}
public cuentas CuentaSuperior1
{
get
{
if (this.NumeroCuenta.Length == 1)
return null/* TODO Change to default(_) if this is not a reference type */;
else
{
var CuentaSuperior = this.NumeroCuenta.Substring(0, 1);
return bd.cuentas.First(x => x.NumeroCuenta == CuentaSuperior & x.idEjercicio == this.idEjercicio);
}
}
}
public cuentas CuentaSuperior2
{
get
{
if (this.NumeroCuenta.Length < 3)
return null/* TODO Change to default(_) if this is not a reference type */;
else
{
var CuentaSuperior = this.NumeroCuenta.Substring(0, 2);
return bd.cuentas.First(x => x.NumeroCuenta == CuentaSuperior & x.idEjercicio == this.idEjercicio);
}
}
}
public cuentas CuentaSuperior3
{
get
{
if (this.NumeroCuenta.Length < 4)
return null/* TODO Change to default(_) if this is not a reference type */;
else
{
var CuentaSuperior = this.NumeroCuenta.Substring(0, 3);
return bd.cuentas.First(x => x.NumeroCuenta == CuentaSuperior & x.idEjercicio == this.idEjercicio);
}
}
}
public cuentas CuentaSuperior4
{
get
{
if (this.NumeroCuenta.Length < 5)
return null/* TODO Change to default(_) if this is not a reference type */;
else
{
var CuentaSuperior = this.NumeroCuenta.Substring(0, 4);
return bd.cuentas.First(x => x.NumeroCuenta == CuentaSuperior & x.idEjercicio == this.idEjercicio);
}
}
}
public int Nivel
{
get
{
return NumeroCuenta.NothingAVacio().Length;
}
}
private vf_cuentas _ValoresExtendidos;
public vf_cuentas ValoresExtendidos
{
get
{
if (_ValoresExtendidos == null)
_ValoresExtendidos = Obtiene_vf_cuenta();
return _ValoresExtendidos;
}
}
public vf_cuentas Obtiene_vf_cuenta()
{
try
{
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
vf_cuentas ct;
if (this.Nivel == 8)
ct = bd.vf_cuentas.First(x => x.idCuenta == this.idCuenta);
else if (Nivel == 0)
{
ct = new vf_cuentas();
{
var withBlock = ct;
withBlock.idCuenta = 0;
withBlock.idEjercicio = 0;
withBlock.Mote = "";
withBlock.Denominacion = "";
withBlock.idEmpresaAmortizacion = 0;
withBlock.NumeroCuenta = "";
withBlock.Observaciones = "";
withBlock.PresupuestoEnero = 0;
withBlock.PresupuestoFebrero = 0;
withBlock.PresupuestoMarzo = 0;
withBlock.PresupuestoAbril = 0;
withBlock.PresupuestoMayo = 0;
withBlock.PresupuestoJunio = 0;
withBlock.PresupuestoJulio = 0;
withBlock.PresupuestoAgosto = 0;
withBlock.PresupuestoSeptiembre = 0;
withBlock.PresupuestoOctubre = 0;
withBlock.PresupuestoNoviembre = 0;
withBlock.PresupuestoDiciembre = 0;
withBlock.DebeEnero = 0;
withBlock.DebeFebrero = 0;
withBlock.DebeMarzo = 0;
withBlock.DebeAbril = 0;
withBlock.DebeMayo = 0;
withBlock.DebeJunio = 0;
withBlock.DebeJulio = 0;
withBlock.DebeAgosto = 0;
withBlock.DebeSeptiembre = 0;
withBlock.DebeOctubre = 0;
withBlock.DebeNoviembre = 0;
withBlock.DebeDiciembre = 0;
withBlock.HaberEnero = 0;
withBlock.HaberFebrero = 0;
withBlock.HaberMarzo = 0;
withBlock.HaberAbril = 0;
withBlock.HaberMayo = 0;
withBlock.HaberJunio = 0;
withBlock.HaberJulio = 0;
withBlock.HaberAgosto = 0;
withBlock.HaberSeptiembre = 0;
withBlock.HaberOctubre = 0;
withBlock.HaberNoviembre = 0;
withBlock.HaberDiciembre = 0;
withBlock.TotalDebe = 0;
withBlock.TotalHaber = 0;
}
}
else
{
var sumatorio = bd.vf_cuentas.Where(x => x.NumeroCuenta.StartsWith(this.NumeroCuenta) & x.idEjercicio == this.idEjercicio).ToList();
ct = new vf_cuentas();
{
var withBlock = ct;
withBlock.idCuenta = this.idCuenta;
withBlock.idEjercicio = this.idEjercicio;
withBlock.Mote = this.Mote;
withBlock.Denominacion = this.Denominacion;
withBlock.idEmpresaAmortizacion = this.idEmpresaAmortizacion;
withBlock.NumeroCuenta = this.NumeroCuenta;
withBlock.Observaciones = this.Observaciones;
withBlock.PresupuestoEnero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoFebrero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMarzo = Math.Round(sumatorio.Sum(x => x.PresupuestoMarzo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAbril = Math.Round(sumatorio.Sum(x => x.PresupuestoAbril), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMayo = Math.Round(sumatorio.Sum(x => x.PresupuestoMayo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJunio = Math.Round(sumatorio.Sum(x => x.PresupuestoJunio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJulio = Math.Round(sumatorio.Sum(x => x.PresupuestoJulio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAgosto = Math.Round(sumatorio.Sum(x => x.PresupuestoAgosto), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoSeptiembre = Math.Round(sumatorio.Sum(x => x.PresupuestoSeptiembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoOctubre = Math.Round(sumatorio.Sum(x => x.PresupuestoOctubre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoNoviembre = Math.Round(sumatorio.Sum(x => x.PresupuestoNoviembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoDiciembre = Math.Round(sumatorio.Sum(x => x.PresupuestoDiciembre), 2, MidpointRounding.AwayFromZero);
withBlock.DebeEnero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeFebrero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMarzo = Math.Round(sumatorio.Sum(x => x.DebeMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAbril = Math.Round(sumatorio.Sum(x => x.DebeAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMayo = Math.Round(sumatorio.Sum(x => x.DebeMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJunio = Math.Round(sumatorio.Sum(x => x.DebeJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJulio = Math.Round(sumatorio.Sum(x => x.DebeJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAgosto = Math.Round(sumatorio.Sum(x => x.DebeAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeSeptiembre = Math.Round(sumatorio.Sum(x => x.DebeSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeOctubre = Math.Round(sumatorio.Sum(x => x.DebeOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeNoviembre = Math.Round(sumatorio.Sum(x => x.DebeNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeDiciembre = Math.Round(sumatorio.Sum(x => x.DebeDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberEnero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberFebrero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMarzo = Math.Round(sumatorio.Sum(x => x.HaberMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAbril = Math.Round(sumatorio.Sum(x => x.HaberAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMayo = Math.Round(sumatorio.Sum(x => x.HaberMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJunio = Math.Round(sumatorio.Sum(x => x.HaberJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJulio = Math.Round(sumatorio.Sum(x => x.HaberJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAgosto = Math.Round(sumatorio.Sum(x => x.HaberAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberSeptiembre = Math.Round(sumatorio.Sum(x => x.HaberSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberOctubre = Math.Round(sumatorio.Sum(x => x.HaberOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberNoviembre = Math.Round(sumatorio.Sum(x => x.HaberNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberDiciembre = Math.Round(sumatorio.Sum(x => x.HaberDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.TotalDebe = Math.Round(sumatorio.Sum(x => x.TotalDebe), 2, MidpointRounding.AwayFromZero);
withBlock.TotalHaber = Math.Round(sumatorio.Sum(x => x.TotalHaber), 2, MidpointRounding.AwayFromZero);
}
}
try
{
if (Nivel > 0)
{
var cta1 = bd.cuentas.First(x => x.NumeroCuenta == ct.NumeroCuenta.Substring(0, 1) & x.idEjercicio == this.idEjercicio);
ct.Grupo1 = cta1.NumeroCuenta + " " + cta1.Denominacion;
if (ct.Nivel > 1)
{
var cta2 = bd.cuentas.First(x => x.NumeroCuenta == ct.NumeroCuenta.Substring(0, 2) & x.idEjercicio == this.idEjercicio);
ct.Grupo2 = cta2.NumeroCuenta + " " + cta2.Denominacion;
if (ct.Nivel > 2)
{
var cta3 = bd.cuentas.First(x => x.NumeroCuenta == ct.NumeroCuenta.Substring(0, 3) & x.idEjercicio == this.idEjercicio);
ct.Grupo3 = cta3.NumeroCuenta + " " + cta3.Denominacion;
if (ct.Nivel > 3)
{
var cta4 = bd.cuentas.First(x => x.NumeroCuenta == ct.NumeroCuenta.Substring(0, 4) & x.idEjercicio == this.idEjercicio);
ct.Grupo4 = cta4.NumeroCuenta + " " + cta4.Denominacion;
}
}
}
}
}
catch (Exception ex)
{
throw new Exception("Error obteniendo cuentas intermedia de la cuenta " + this.NumeroCuenta + " " + ex.Message, ex);
}
return ct;
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
#region "Saldos"
public double SaldoEnero
{
get
{
return ValoresExtendidos.SaldoEnero;
}
}
public double SaldoFebrero
{
get
{
return ValoresExtendidos.SaldoFebrero;
}
}
public double SaldoMarzo
{
get
{
return ValoresExtendidos.SaldoMarzo;
}
}
public double SaldoAbril
{
get
{
return ValoresExtendidos.SaldoAbril;
}
}
public double SaldoMayo
{
get
{
return ValoresExtendidos.SaldoMayo;
}
}
public double SaldoJunio
{
get
{
return ValoresExtendidos.SaldoJunio;
}
}
public double SaldoJulio
{
get
{
return ValoresExtendidos.SaldoJulio;
}
}
public double SaldoAgosto
{
get
{
return ValoresExtendidos.SaldoAgosto;
}
}
public double SaldoSeptiembre
{
get
{
return ValoresExtendidos.SaldoSeptiembre;
}
}
public double SaldoOctubre
{
get
{
return ValoresExtendidos.SaldoOctubre;
}
}
public double SaldoNoviembre
{
get
{
return ValoresExtendidos.SaldoNoviembre;
}
}
public double SaldoDiciembre
{
get
{
return ValoresExtendidos.SaldoDiciembre;
}
}
public double TotalSaldo
{
get
{
return ValoresExtendidos.TotalSaldo;
}
}
#endregion
#region "Presupuestos"
public double TotalPresupuestado
{
get
{
return Math.Round(PresupuestoEnero + PresupuestoFebrero + PresupuestoMarzo + PresupuestoAbril + PresupuestoMayo + PresupuestoJunio + PresupuestoJulio + PresupuestoAgosto + PresupuestoSeptiembre + PresupuestoOctubre + PresupuestoNoviembre + PresupuestoDiciembre, 2, MidpointRounding.AwayFromZero);
}
}
public void ActualizaTotalPresupuestado()
{
OnPropertyChanged("TotalPresupuestado");
}
public double DesvioPresupuestoEnero
{
get
{
return ValoresExtendidos.DesvioPresupuestoEnero;
}
}
public double DesvioPresupuestoFebrero
{
get
{
return ValoresExtendidos.DesvioPresupuestoFebrero;
}
}
public double DesvioPresupuestoMarzo
{
get
{
return ValoresExtendidos.DesvioPresupuestoMarzo;
}
}
public double DesvioPresupuestoAbril
{
get
{
return ValoresExtendidos.DesvioPresupuestoAbril;
}
}
public double DesvioPresupuestoMayo
{
get
{
return ValoresExtendidos.DesvioPresupuestoMayo;
}
}
public double DesvioPresupuestoJunio
{
get
{
return ValoresExtendidos.DesvioPresupuestoJunio;
}
}
public double DesvioPresupuestoJulio
{
get
{
return ValoresExtendidos.DesvioPresupuestoJulio;
}
}
public double DesvioPresupuestoAgosto
{
get
{
return ValoresExtendidos.DesvioPresupuestoAgosto;
}
}
public double DesvioPresupuestoSeptiembre
{
get
{
return ValoresExtendidos.DesvioPresupuestoSeptiembre;
}
}
public double DesvioPresupuestoOctubre
{
get
{
return ValoresExtendidos.DesvioPresupuestoOctubre;
}
}
public double DesvioPresupuestoNoviembre
{
get
{
return ValoresExtendidos.DesvioPresupuestoNoviembre;
}
}
public double DesvioPresupuestoDiciembre
{
get
{
return ValoresExtendidos.DesvioPresupuestoDiciembre;
}
}
public double DesvioPresupuestoTotal
{
get
{
return ValoresExtendidos.DesvioPresupuestoTotal;
}
}
public double PorcentajeDesvioPresupuestoEnero
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoEnero;
}
}
public double PorcentajeDesvioPresupuestoFebrero
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoFebrero;
}
}
public double PorcentajeDesvioPresupuestoMarzo
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoMarzo;
}
}
public double PorcentajeDesvioPresupuestoAbril
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoAbril;
}
}
public double PorcentajeDesvioPresupuestoMayo
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoMayo;
}
}
public double PorcentajeDesvioPresupuestoJunio
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoJunio;
}
}
public double PorcentajeDesvioPresupuestoJulio
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoJulio;
}
}
public double PorcentajeDesvioPresupuestoAgosto
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoAgosto;
}
}
public double PorcentajeDesvioPresupuestoSeptiembre
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoSeptiembre;
}
}
public double PorcentajeDesvioPresupuestoOctubre
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoOctubre;
}
}
public double PorcentajeDesvioPresupuestoNoviembre
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoNoviembre;
}
}
public double PorcentajeDesvioPresupuestoDiciembre
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoDiciembre;
}
}
public double PorcentajeDesvioPresupuestoTotal
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoTotal;
}
}
#endregion
public static List<GrupoCuenta> ListadoGruposCuentas()
{
List<GrupoCuenta> lGrupos = new List<GrupoCuenta>();
lGrupos.Add(new GrupoCuenta() { Nivel = 1, Descripcion = "GRUPO INICIAL 1 DÍGITO" });
lGrupos.Add(new GrupoCuenta() { Nivel = 2, Descripcion = "GRUPO INTERMEDIO 2 DÍGITOS" });
lGrupos.Add(new GrupoCuenta() { Nivel = 3, Descripcion = "GRUPO INTERMEDIO 3 DÍGITOS" });
lGrupos.Add(new GrupoCuenta() { Nivel = 4, Descripcion = "GRUPO INTERMEDIO 4 DÍGITOS" });
lGrupos.Add(new GrupoCuenta() { Nivel = 8, Descripcion = "GRUPO FINAL 8 DÍGITOS" });
return lGrupos;
}
public class GrupoCuenta
{
public int Nivel { get; set; }
public string Descripcion { get; set; }
}
}
}

View File

@@ -0,0 +1,903 @@
using System;
using System.ComponentModel;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class vf_cuentas
{
public static List<vf_cuentas> Obtiene_vf_cuentas(tscGrupoSanchoToro bd, int idEjercicio, int Nivel)
{
try
{
List<vf_cuentas> lc;
var ctasintermedias = bd.cuentas.Where(x => x.EsCuentaFinal == false & x.idEjercicio == idEjercicio & x.NumeroCuenta.Length <= Nivel).ToList();
var ctasf = bd.vf_cuentas.Where(x => x.idEjercicio == idEjercicio).ToList();
if (Nivel == 8)
lc = ctasf;
else
{
lc = new List<vf_cuentas>();
foreach (var cta in ctasintermedias.Where(x => x.Nivel == Nivel))
{
var sumatorio = ctasf.Where(x => x.NumeroCuenta.StartsWith(cta.NumeroCuenta));
vf_cuentas nc = new vf_cuentas();
{
var withBlock = nc;
withBlock.idCuenta = cta.idCuenta;
withBlock.idEjercicio = cta.idEjercicio;
withBlock.Mote = cta.Mote;
withBlock.Denominacion = cta.Denominacion;
withBlock.idEmpresaAmortizacion = cta.idEmpresaAmortizacion;
withBlock.NumeroCuenta = cta.NumeroCuenta;
withBlock.Observaciones = cta.Observaciones;
withBlock.PresupuestoEnero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoFebrero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMarzo = Math.Round(sumatorio.Sum(x => x.PresupuestoMarzo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAbril = Math.Round(sumatorio.Sum(x => x.PresupuestoAbril), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMayo = Math.Round(sumatorio.Sum(x => x.PresupuestoMayo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJunio = Math.Round(sumatorio.Sum(x => x.PresupuestoJunio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJulio = Math.Round(sumatorio.Sum(x => x.PresupuestoJulio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAgosto = Math.Round(sumatorio.Sum(x => x.PresupuestoAgosto), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoSeptiembre = Math.Round(sumatorio.Sum(x => x.PresupuestoSeptiembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoOctubre = Math.Round(sumatorio.Sum(x => x.PresupuestoOctubre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoNoviembre = Math.Round(sumatorio.Sum(x => x.PresupuestoNoviembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoDiciembre = Math.Round(sumatorio.Sum(x => x.PresupuestoDiciembre), 2, MidpointRounding.AwayFromZero);
withBlock.DebeEnero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeFebrero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMarzo = Math.Round(sumatorio.Sum(x => x.DebeMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAbril = Math.Round(sumatorio.Sum(x => x.DebeAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMayo = Math.Round(sumatorio.Sum(x => x.DebeMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJunio = Math.Round(sumatorio.Sum(x => x.DebeJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJulio = Math.Round(sumatorio.Sum(x => x.DebeJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAgosto = Math.Round(sumatorio.Sum(x => x.DebeAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeSeptiembre = Math.Round(sumatorio.Sum(x => x.DebeSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeOctubre = Math.Round(sumatorio.Sum(x => x.DebeOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeNoviembre = Math.Round(sumatorio.Sum(x => x.DebeNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeDiciembre = Math.Round(sumatorio.Sum(x => x.DebeDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberEnero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberFebrero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMarzo = Math.Round(sumatorio.Sum(x => x.HaberMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAbril = Math.Round(sumatorio.Sum(x => x.HaberAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMayo = Math.Round(sumatorio.Sum(x => x.HaberMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJunio = Math.Round(sumatorio.Sum(x => x.HaberJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJulio = Math.Round(sumatorio.Sum(x => x.HaberJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAgosto = Math.Round(sumatorio.Sum(x => x.HaberAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberSeptiembre = Math.Round(sumatorio.Sum(x => x.HaberSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberOctubre = Math.Round(sumatorio.Sum(x => x.HaberOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberNoviembre = Math.Round(sumatorio.Sum(x => x.HaberNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberDiciembre = Math.Round(sumatorio.Sum(x => x.HaberDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.TotalDebe = Math.Round(sumatorio.Sum(x => x.TotalDebe), 2, MidpointRounding.AwayFromZero);
withBlock.TotalHaber = Math.Round(sumatorio.Sum(x => x.TotalHaber), 2, MidpointRounding.AwayFromZero);
lc.Add(nc);
}
}
}
foreach (var cta in lc)
{
try
{
var cta1 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 1));
cta.Grupo1 = cta1.NumeroCuenta + " " + cta1.Denominacion;
if (cta.Nivel > 1)
{
var cta2 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 2));
cta.Grupo2 = cta2.NumeroCuenta + " " + cta2.Denominacion;
if (cta.Nivel > 2)
{
var cta3 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 3));
cta.Grupo3 = cta3.NumeroCuenta + " " + cta3.Denominacion;
if (cta.Nivel > 3)
{
var cta4 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 4));
cta.Grupo4 = cta4.NumeroCuenta + " " + cta4.Denominacion;
}
}
}
}
catch (Exception ex)
{
throw new Exception("Error obteniendo cuentas intermedia de la cuenta " + cta.NumeroCuenta + " " + ex.Message, ex);
}
}
return lc;
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
public static List<vf_cuentas> Obtiene_vf_cuentas(tscGrupoSanchoToro bd, int[] Ejercicios, int Nivel, string ExpresionBusqueda)
{
try
{
List<vf_cuentas> lc;
IQueryable<cuentas> qCtasIntermedias = bd.cuentas.Where(x => x.EsCuentaFinal == false & Ejercicios.Contains(x.idEjercicio) & x.NumeroCuenta.Length <= Nivel);
object[] parametros = new object[1];
IQueryable<vf_cuentas> qcastf;
if (ExpresionBusqueda == "")
qcastf = bd.vf_cuentas.AsQueryable();
else
{
qcastf = bd.vf_cuentas.Where(ExpresionBusqueda, parametros);
if (Nivel < 8)
{
ExpresionBusqueda = "NumeroCuenta.Length<" + Nivel.ToString() + " or (" + ExpresionBusqueda + ")";
qCtasIntermedias = qCtasIntermedias.Where(ExpresionBusqueda, parametros);
}
}
var ctasintermedias = qCtasIntermedias.ToList();
// Dim KK = qcastf.ToList
var ctasf = qcastf.Where(x => Ejercicios.Contains(x.idEjercicio)).ToList();
if (Nivel == 8)
lc = ctasf;
else
{
lc = new List<vf_cuentas>();
foreach (var cta in ctasintermedias.Where(x => x.Nivel == Nivel))
{
var sumatorio = ctasf.Where(x => x.idEjercicio == cta.idEjercicio & x.NumeroCuenta.StartsWith(cta.NumeroCuenta));
vf_cuentas nc = new vf_cuentas();
{
var withBlock = nc;
withBlock.idCuenta = cta.idCuenta;
withBlock.idEjercicio = cta.idEjercicio;
withBlock.Mote = cta.Mote;
withBlock.Denominacion = cta.Denominacion;
withBlock.idEmpresaAmortizacion = cta.idEmpresaAmortizacion;
withBlock.NumeroCuenta = cta.NumeroCuenta;
withBlock.Observaciones = cta.Observaciones;
withBlock.PresupuestoEnero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoFebrero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMarzo = Math.Round(sumatorio.Sum(x => x.PresupuestoMarzo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAbril = Math.Round(sumatorio.Sum(x => x.PresupuestoAbril), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMayo = Math.Round(sumatorio.Sum(x => x.PresupuestoMayo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJunio = Math.Round(sumatorio.Sum(x => x.PresupuestoJunio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJulio = Math.Round(sumatorio.Sum(x => x.PresupuestoJulio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAgosto = Math.Round(sumatorio.Sum(x => x.PresupuestoAgosto), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoSeptiembre = Math.Round(sumatorio.Sum(x => x.PresupuestoSeptiembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoOctubre = Math.Round(sumatorio.Sum(x => x.PresupuestoOctubre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoNoviembre = Math.Round(sumatorio.Sum(x => x.PresupuestoNoviembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoDiciembre = Math.Round(sumatorio.Sum(x => x.PresupuestoDiciembre), 2, MidpointRounding.AwayFromZero);
withBlock.DebeEnero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeFebrero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMarzo = Math.Round(sumatorio.Sum(x => x.DebeMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAbril = Math.Round(sumatorio.Sum(x => x.DebeAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMayo = Math.Round(sumatorio.Sum(x => x.DebeMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJunio = Math.Round(sumatorio.Sum(x => x.DebeJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJulio = Math.Round(sumatorio.Sum(x => x.DebeJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAgosto = Math.Round(sumatorio.Sum(x => x.DebeAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeSeptiembre = Math.Round(sumatorio.Sum(x => x.DebeSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeOctubre = Math.Round(sumatorio.Sum(x => x.DebeOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeNoviembre = Math.Round(sumatorio.Sum(x => x.DebeNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeDiciembre = Math.Round(sumatorio.Sum(x => x.DebeDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberEnero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberFebrero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMarzo = Math.Round(sumatorio.Sum(x => x.HaberMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAbril = Math.Round(sumatorio.Sum(x => x.HaberAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMayo = Math.Round(sumatorio.Sum(x => x.HaberMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJunio = Math.Round(sumatorio.Sum(x => x.HaberJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJulio = Math.Round(sumatorio.Sum(x => x.HaberJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAgosto = Math.Round(sumatorio.Sum(x => x.HaberAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberSeptiembre = Math.Round(sumatorio.Sum(x => x.HaberSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberOctubre = Math.Round(sumatorio.Sum(x => x.HaberOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberNoviembre = Math.Round(sumatorio.Sum(x => x.HaberNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberDiciembre = Math.Round(sumatorio.Sum(x => x.HaberDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.TotalDebe = Math.Round(sumatorio.Sum(x => x.TotalDebe), 2, MidpointRounding.AwayFromZero);
withBlock.TotalHaber = Math.Round(sumatorio.Sum(x => x.TotalHaber), 2, MidpointRounding.AwayFromZero);
lc.Add(nc);
}
}
}
foreach (var cta in lc)
{
try
{
var cta1 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 1));
cta.Grupo1 = cta1.NumeroCuenta + " " + cta1.Denominacion;
if (cta.Nivel > 1)
{
var cta2 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 2));
cta.Grupo2 = cta2.NumeroCuenta + " " + cta2.Denominacion;
if (cta.Nivel > 2)
{
var cta3 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 3));
cta.Grupo3 = cta3.NumeroCuenta + " " + cta3.Denominacion;
if (cta.Nivel > 3)
{
var cta4 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 4));
cta.Grupo4 = cta4.NumeroCuenta + " " + cta4.Denominacion;
}
}
}
}
catch (Exception ex)
{
throw new Exception("Error obteniendo cuentas intermedia de la cuenta " + cta.NumeroCuenta + " " + ex.Message, ex);
}
}
return lc;
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
public string Grupo1 { get; set; }
public string Grupo2 { get; set; }
public string Grupo3 { get; set; }
public string Grupo4 { get; set; }
public int Nivel
{
get
{
return NumeroCuenta.Length;
}
}
#region "Saldos"
public double SaldoEnero
{
get
{
return Math.Round(DebeEnero.NothingA0() - HaberEnero.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoFebrero
{
get
{
return Math.Round(DebeFebrero.NothingA0() - HaberFebrero.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoMarzo
{
get
{
return Math.Round(DebeMarzo.NothingA0() - HaberMarzo.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoAbril
{
get
{
return Math.Round(DebeAbril.NothingA0() - HaberAbril.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoMayo
{
get
{
return Math.Round(DebeMayo.NothingA0() - HaberMayo.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoJunio
{
get
{
return Math.Round(DebeJunio.NothingA0() - HaberJunio.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoJulio
{
get
{
return Math.Round(DebeJulio.NothingA0() - HaberJulio.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoAgosto
{
get
{
return Math.Round(DebeAgosto.NothingA0() - HaberAgosto.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoSeptiembre
{
get
{
return Math.Round(DebeSeptiembre.NothingA0() - HaberSeptiembre.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoOctubre
{
get
{
return Math.Round(DebeOctubre.NothingA0() - HaberOctubre.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoNoviembre
{
get
{
return Math.Round(DebeNoviembre.NothingA0() - HaberNoviembre.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoDiciembre
{
get
{
return Math.Round(DebeDiciembre.NothingA0() - HaberDiciembre.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double TotalSaldo
{
get
{
return Math.Round(TotalDebe - TotalHaber, 2, MidpointRounding.AwayFromZero);
}
}
#endregion
#region "Presupuestos"
public double TotalPresupuestado
{
get
{
return Math.Round(PresupuestoEnero + PresupuestoFebrero + PresupuestoMarzo + PresupuestoAbril + PresupuestoMayo + PresupuestoJunio + PresupuestoJulio + PresupuestoAgosto + PresupuestoSeptiembre + PresupuestoOctubre + PresupuestoNoviembre + PresupuestoDiciembre, 2, MidpointRounding.AwayFromZero);
}
}
public void ActualizaTotalPresupuestado()
{
OnPropertyChanged("TotalPresupuestado");
}
public double DesvioPresupuestoEnero
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoEnero) - Math.Abs(this.SaldoEnero), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoFebrero
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoFebrero) - Math.Abs(this.SaldoFebrero), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoMarzo
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoMarzo) - Math.Abs(this.SaldoMarzo), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoAbril
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoAbril) - Math.Abs(this.SaldoAbril), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoMayo
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoMayo) - Math.Abs(this.SaldoMayo), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoJunio
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoJunio) - Math.Abs(this.SaldoJunio), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoJulio
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoJulio) - Math.Abs(this.SaldoJulio), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoAgosto
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoAgosto) - Math.Abs(this.SaldoAgosto), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoSeptiembre
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoSeptiembre) - Math.Abs(this.SaldoSeptiembre), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoOctubre
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoOctubre) - Math.Abs(this.SaldoOctubre), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoNoviembre
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoNoviembre) - Math.Abs(this.SaldoNoviembre), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoDiciembre
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoDiciembre) - Math.Abs(this.SaldoDiciembre), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoTotal
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.TotalPresupuestado) - Math.Abs(this.TotalSaldo), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double PorcentajeDesvioPresupuestoEnero
{
get
{
if (SaldoEnero == 0)
{
if (DesvioPresupuestoEnero < 0)
return -100;
else if (DesvioPresupuestoEnero > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoEnero * 100 / (double)SaldoEnero, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoFebrero
{
get
{
if (SaldoFebrero == 0)
{
if (DesvioPresupuestoFebrero < 0)
return -100;
else if (DesvioPresupuestoFebrero > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoFebrero * 100 / (double)SaldoFebrero, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoMarzo
{
get
{
if (SaldoMarzo == 0)
{
if (DesvioPresupuestoMarzo < 0)
return -100;
else if (DesvioPresupuestoMarzo > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoMarzo * 100 / (double)SaldoMarzo, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoAbril
{
get
{
if (SaldoAbril == 0)
{
if (DesvioPresupuestoAbril < 0)
return -100;
else if (DesvioPresupuestoAbril > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoAbril * 100 / (double)SaldoAbril, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoMayo
{
get
{
if (SaldoMayo == 0)
{
if (DesvioPresupuestoMayo < 0)
return -100;
else if (DesvioPresupuestoMayo > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoMayo * 100 / (double)SaldoMayo, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoJunio
{
get
{
if (SaldoJunio == 0)
{
if (DesvioPresupuestoJunio < 0)
return -100;
else if (DesvioPresupuestoJunio > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoJunio * 100 / (double)SaldoJunio, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoJulio
{
get
{
if (SaldoJulio == 0)
{
if (DesvioPresupuestoJulio < 0)
return -100;
else if (DesvioPresupuestoJulio > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoJulio * 100 / (double)SaldoJulio, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoAgosto
{
get
{
if (SaldoAgosto == 0)
{
if (DesvioPresupuestoAgosto < 0)
return -100;
else if (DesvioPresupuestoAgosto > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoAgosto * 100 / (double)SaldoAgosto, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoSeptiembre
{
get
{
if (SaldoSeptiembre == 0)
{
if (DesvioPresupuestoSeptiembre < 0)
return -100;
else if (DesvioPresupuestoSeptiembre > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoSeptiembre * 100 / (double)SaldoSeptiembre, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoOctubre
{
get
{
if (SaldoOctubre == 0)
{
if (DesvioPresupuestoOctubre < 0)
return -100;
else if (DesvioPresupuestoOctubre > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoOctubre * 100 / (double)SaldoOctubre, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoNoviembre
{
get
{
if (SaldoNoviembre == 0)
{
if (DesvioPresupuestoNoviembre < 0)
return -100;
else if (DesvioPresupuestoNoviembre > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoNoviembre * 100 / (double)SaldoNoviembre, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoDiciembre
{
get
{
if (SaldoDiciembre == 0)
{
if (DesvioPresupuestoDiciembre < 0)
return -100;
else if (DesvioPresupuestoDiciembre > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoDiciembre * 100 / (double)SaldoDiciembre, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoTotal
{
get
{
if (TotalSaldo == 0)
{
if (DesvioPresupuestoTotal < 0)
return -100;
else if (DesvioPresupuestoTotal > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoTotal * 100 / (double)TotalSaldo, 2, MidpointRounding.AwayFromZero);
}
}
#endregion
}
}