Agregar archivos de proyecto.
This commit is contained in:
138
GestionGrupoSanchoToro/FicherosMaestros/ucAlmacen.xaml
Normal file
138
GestionGrupoSanchoToro/FicherosMaestros/ucAlmacen.xaml
Normal file
@@ -0,0 +1,138 @@
|
||||
<tsWPF: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:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucAlmacen"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1366">
|
||||
<tsWPF:tsUserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
|
||||
<Setter Property="Background" Value="#B0E0E6" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</tsWPF:tsUserControl.Resources>
|
||||
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
|
||||
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Datos Almacén" View="GroupBox" ItemLabelsAlignment="Default" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="450">
|
||||
<tsWPF:tsLayoutItem Label="Descripción:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Descripcion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="1" x:Name="teNIF" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Encargados:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Encargados, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="5" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="350">
|
||||
<tsWPF:tsLayoutItem Label="Tipo:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbTipo" ValueMember="Valor" DisplayMember="Descripcion" EditValue="{Binding Tipo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" AutoComplete="True" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Email:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS MayusculasMinusculas="Normal" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Email, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="5" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPF:tsLayoutItem Label="Fecha Baja:" Width="200" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaBaja, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="6" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<!--<tsWPF:tsLayoutItem Label="Permisos:" Width="400" HorizontalAlignment="Left" >
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False"/>
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbPermiso" ValueMember="idPermiso" DisplayMember="Codigo" EditValue="{Binding idPermiso, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" AutoComplete="True" />
|
||||
</tsWPF:tsLayoutItem>-->
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Header="Dirección" View="GroupBox" ItemLabelsAlignment="Default" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<tsWPF:tsLayoutItem Label="Direccion:" Width="400">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Direccion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="13" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Código Postal:" Width="200">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ButtonEdit x:Name="beCodigoPostal" EditValue="{Binding CodigoPostal, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" DefaultButtonClick="BeCodigoPostal_DefaultButtonClick">
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" x:Name="btCancelarCodigoPostal" Click="BtCancelarCodigoPostal_Click" />
|
||||
</dxe:ButtonEdit>
|
||||
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Población:" x:Name="Poblacion" Width="350">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Poblacion, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Provincia:" Width="350">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Provincia, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="16" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
<dx:DXTabControl Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dx:DXTabControl.View>
|
||||
<dx:TabControlScrollView />
|
||||
</dx:DXTabControl.View>
|
||||
<dx:DXTabItem Header="Productos">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
|
||||
<tsWPF:tsGridControl x:Name="gcProductos" NombreTablaBase="stocks" TabIndex="41">
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.View>
|
||||
<tsWPF:tsTableView ShowGroupPanel="false" x:Name="tvProductos">
|
||||
</tsWPF:tsTableView>
|
||||
</tsWPF:tsGridControl.View>
|
||||
<dxg:GridControl.Columns>
|
||||
<tsWPF:tsGridColumn FieldName="Producto" IsSmart="True" Width="450" SoloLectura="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn FieldName="Unidades" IsSmart="True" Width="100" HorizontalHeaderContentAlignment="Right">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="n0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
|
||||
</dxg:GridControl.Columns>
|
||||
</tsWPF:tsGridControl>
|
||||
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dx:DXTabItem>
|
||||
|
||||
</dx:DXTabControl>
|
||||
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
232
GestionGrupoSanchoToro/FicherosMaestros/ucAlmacen.xaml.vb
Normal file
232
GestionGrupoSanchoToro/FicherosMaestros/ucAlmacen.xaml.vb
Normal file
@@ -0,0 +1,232 @@
|
||||
Imports DevExpress.Xpf.Editors
|
||||
Imports DevExpress.Xpf.LayoutControl
|
||||
Imports tsWPFCore
|
||||
Imports System.ComponentModel
|
||||
Imports System.Data
|
||||
Imports DevExpress.Xpf.Editors.Validation
|
||||
Imports DevExpress.Xpf.Editors.Helpers
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports tsWPFCore.modExtensiones
|
||||
Imports System.Data.Common
|
||||
Imports System.Data.Entity
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports tsUtilidades.Datos
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports bdGrupoSanchoToro.db.almacenes
|
||||
Imports tsEFCore8.Extensiones
|
||||
|
||||
Public Class ucAlmacen
|
||||
|
||||
|
||||
Private bd As tscGrupoSanchoToro
|
||||
Friend _idAlmacen As Nullable(Of Integer)
|
||||
Private ra As almacenes
|
||||
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 Estado = tsUtilidades.EstadosAplicacion.Nuevo OrElse _idAlmacen Is Nothing OrElse FuerzaNuevo Then
|
||||
ra = New almacenes
|
||||
Me.DataContext = ra
|
||||
_idAlmacen = Nothing
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
||||
Else
|
||||
ra = bd.almacenes.First(Function(x) x.idAlmacen = _idAlmacen.Value)
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
End If
|
||||
Me.DataContext = ra
|
||||
gcProductos.ItemsSource = ra.stocks
|
||||
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 "almacenes"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
|
||||
Return "Almacen.Nuevo"
|
||||
Else
|
||||
Return "Almacen." & DirectCast(Me.DataContext, almacenes).idAlmacen.ToString
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Almacén"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(Optional idAlmacen As Integer? = Nothing)
|
||||
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
_idAlmacen = idAlmacen
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
Me.cbTipo.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(TipoAlmacenEnum))
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||
Dim cj As almacenes = Me.DataContext
|
||||
Me.docpanel.Caption = "Almacen " & cj.Descripcion
|
||||
Me.docpanel.Tag = "Almacen." & cj.idAlmacen.ToString
|
||||
Else
|
||||
Me.docpanel.Caption = "Almacen Nuevo"
|
||||
Me.docpanel.Tag = "Almacen.Nuevo"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
Me.Tipo_ucControlBusqueda = GetType(ucAlmacenes)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub ucAlmacen_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
Select Case Celda.Column.FieldName.ToLower
|
||||
Case "producto"
|
||||
Dim st As stocks = gcProductos.CurrentItem
|
||||
FuncionesDinamicas.AbrirAP(New ucProducto(st.idProducto), OtrosParametros)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub ucAlmacen_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
|
||||
|
||||
_idAlmacen = ra.idAlmacen
|
||||
End Sub
|
||||
Private Sub ap_ValidarControl(sender As Object, e As ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
|
||||
|
||||
Dim pts As PropiedadesTS = sender.parent.propiedadests
|
||||
Try
|
||||
If Not pts Is Nothing Then
|
||||
ErroresValidacion.EliminaError("validando-" & pts.NombreCampo)
|
||||
|
||||
Select Case pts.NombreCampo.ToLower
|
||||
Case "email"
|
||||
If e.Value IsNot Nothing AndAlso e.Value.ToString <> "" Then
|
||||
If Not e.Value.ToString.Trim.ToLower.EsEmailValido Then Throw New Exception("El email es incorrecto")
|
||||
End If
|
||||
Case "codigopostal"
|
||||
If Not e.Value Is Nothing AndAlso e.Value.ToString <> "" AndAlso e.Value.ToString <> ra.CodigoPostal Then
|
||||
|
||||
Dim sCpo As String = e.Value.ToString
|
||||
If sCpo.Length <> 5 Then Throw New Exception("El código postal no es correcto")
|
||||
Dim sCodigoprovincia As String = sCpo.Substring(0, 2)
|
||||
If Not bd.provincias.Any(Function(x) x.CodigoProvincia = sCodigoprovincia) Then Throw New Exception("El código postal no es correcto")
|
||||
Select Case bd.codigospostales.Where(Function(x) x.CodigoPostal = sCpo).Count
|
||||
Case 0
|
||||
Dim vncp As New dxwAgregarNuevoCodigoPostal(sCpo, bd)
|
||||
If vncp.ShowDialog Then
|
||||
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
|
||||
ra.CodigoMunicipio = pob.CodigoMunicipio
|
||||
|
||||
Else
|
||||
ValorOriginalCambiado = ra.CodigoPostal
|
||||
Throw New Exception("El código postal no es correcto")
|
||||
End If
|
||||
Case 1
|
||||
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
|
||||
ra.CodigoMunicipio = pob.CodigoMunicipio
|
||||
|
||||
Case Else
|
||||
Dim wMunicipios As New dxwCodigosPostales(bd, sCpo)
|
||||
If wMunicipios.ShowDialog Then
|
||||
ra.CodigoMunicipio = wMunicipios.CodigoMunicipio
|
||||
Else
|
||||
Throw New Exception("El código postal no es correcto")
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
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 BeCodigoPostal_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
Dim dxw As New dxwCodigosPostales(bd, "")
|
||||
If dxw.ShowDialog Then
|
||||
ra.CodigoMunicipio = dxw.CodigoMunicipio
|
||||
ra.CodigoPostal = dxw.CodigoPostal
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BtCancelarCodigoPostal_Click(sender As Object, e As RoutedEventArgs)
|
||||
ra.CodigoMunicipio = ""
|
||||
End Sub
|
||||
|
||||
Private Sub ucAlmacen_CampoActualizado(sender As Object, e As DataTransferEventArgs) Handles Me.CampoActualizado
|
||||
Dim pts As PropiedadesTS = sender.parent.propiedadests
|
||||
If Not pts Is Nothing Then
|
||||
|
||||
Select Case pts.NombreCampo.ToLower
|
||||
Case "codigopostal"
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub beCodigoPostal_LostFocus(sender As Object, e As RoutedEventArgs) Handles beCodigoPostal.LostFocus
|
||||
If Me.ErroresValidacion.Errores.Any(Function(x) x.id = "validando-CodigoPostal") Then
|
||||
Dim cp = beCodigoPostal.EditText.ToString
|
||||
If bd.codigospostales.Any(Function(x) x.CodigoPostal = cp) Then
|
||||
ErroresValidacion.EliminaError("validando-CodigoPostal")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ucAlmacen_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
|
||||
Dim hte As New Hashtable
|
||||
ra.idEmpresa = EmpresaActual.idEmpresa
|
||||
Dim almexi = bd.almacenes.FirstOrDefault(Function(x) x.idAlmacen <> ra.idAlmacen AndAlso x.Descripcion = ra.Descripcion AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
|
||||
If almexi IsNot Nothing Then
|
||||
hte.Add("ALMACENAR-ALMACEN_DUPLIADO", "Almacén Duplicado")
|
||||
End If
|
||||
If hte.Count > 0 Then
|
||||
MensajesError = hte
|
||||
Cancelar = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
46
GestionGrupoSanchoToro/FicherosMaestros/ucAlmacenes.xaml
Normal file
46
GestionGrupoSanchoToro/FicherosMaestros/ucAlmacenes.xaml
Normal file
@@ -0,0 +1,46 @@
|
||||
<tsWPF: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:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
x:Class="ucAlmacenes"
|
||||
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="600" d:DesignWidth="850">
|
||||
<tsWPF:tsUserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</tsWPF:tsUserControl.Resources>
|
||||
<Grid x:Name="grid">
|
||||
|
||||
<dxlc:LayoutControl Orientation="Vertical" Margin="-11" >
|
||||
|
||||
<tsWPF:tsGridControl x:Name="gc" TabIndex="4" >
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:PropiedadesTSGC PermitirEliminar="False" />
|
||||
</tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<dxg:GridControl.Columns>
|
||||
<tsWPF:tsGridColumn FieldName="Descripcion" Header="Almacén" Width="400" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn FieldName="DescripcionTipo" Header="Tipo" IsSmart="True" Width="150"/>
|
||||
<tsWPF:tsGridColumn FieldName="FechaBaja" Width="150" IsSmart="True" SoloLectura="True" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<tsWPF:tsTableView x:Name="tv" >
|
||||
</tsWPF:tsTableView>
|
||||
</dxg:GridControl.View>
|
||||
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
84
GestionGrupoSanchoToro/FicherosMaestros/ucAlmacenes.xaml.vb
Normal file
84
GestionGrupoSanchoToro/FicherosMaestros/ucAlmacenes.xaml.vb
Normal file
@@ -0,0 +1,84 @@
|
||||
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports System.Data.Entity
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports tsWPFCore
|
||||
Imports System.Collections
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports System.Threading.Tasks
|
||||
Imports System.Linq.Dynamic
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
|
||||
|
||||
|
||||
Public Class ucAlmacenes
|
||||
|
||||
Private DatacontextEstablecido As Boolean
|
||||
Private bd As tscGrupoSanchoToro
|
||||
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
GridBusqueda = Me.gc
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||
gc.ItemsSource = bd.almacenes.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa).ToList
|
||||
Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
|
||||
End Function
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
Me.docpanel.Caption = "Almacenes"
|
||||
End Sub
|
||||
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
Return "Almacenes"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||
Get
|
||||
Return "Almacenes"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Almacén"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||
bd = tscGrupoSanchoToro.NuevoContexto()
|
||||
Return bd
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
|
||||
Dim al = DirectCast(Me.gc.CurrentItem, almacenes)
|
||||
Dim id = al.idAlmacen
|
||||
FuncionesDinamicas.AbrirAP(New ucAlmacen(id), OtrosParametros)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ucAlmacenes_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
|
||||
FuncionesDinamicas.AbrirAP(New ucAlmacen(Nothing), OtrosParametros)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
202
GestionGrupoSanchoToro/FicherosMaestros/ucCaja.xaml
Normal file
202
GestionGrupoSanchoToro/FicherosMaestros/ucCaja.xaml
Normal file
@@ -0,0 +1,202 @@
|
||||
<tsWPF: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:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucCaja"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1366">
|
||||
<tsWPF:tsUserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
|
||||
<Setter Property="Background" Value="#B0E0E6" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</tsWPF:tsUserControl.Resources>
|
||||
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
|
||||
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Datos Caja" x:Name="lgDetalle" View="GroupBox" ItemLabelsAlignment="Default" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="450">
|
||||
<tsWPF:tsLayoutItem Label="Descripción:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Descripcion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="1" x:Name="teNIF" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="IBAN:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding IBAN, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" x:Name="tbTelefonoTomador" TabIndex="5" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="350">
|
||||
<tsWPF:tsLayoutItem Label="Tipo:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbTipo" ValueMember="Valor" DisplayMember="Descripcion" EditValue="{Binding Tipo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" AutoComplete="True" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Sufijo Bancario:" Width="200" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding SufijoBancario, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="5" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPF:tsLayoutItem Label="Fecha Baja:" Width="200" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaBaja, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="6" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<!--<tsWPF:tsLayoutItem Label="Permisos:" Width="400" HorizontalAlignment="Left" >
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False"/>
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbPermiso" ValueMember="idPermiso" DisplayMember="Codigo" EditValue="{Binding idPermiso, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" AutoComplete="True" />
|
||||
</tsWPF:tsLayoutItem>-->
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Header="Datos Último Cierre" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<tsWPF:tsLayoutItem Label="Fecha Cierre:" Width="200">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaCierre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="6" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Width="200" Label="Saldo Al Cierre:" FontWeight="Bold">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="27" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding SaldoAlCierre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem FontWeight="Bold" Label="Importe Pendiente Cerrar:" Width="300">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="28" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding SaldoPendienteCierre, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
<tsWPF:tsLayoutItem FontWeight="Bold" Label="Saldo Actual:" Width="300">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="28" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding SaldoActual, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
<dx:DXTabControl Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dx:DXTabControl.View>
|
||||
<dx:TabControlScrollView />
|
||||
</dx:DXTabControl.View>
|
||||
<dx:DXTabItem Header="Movimientos">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Filtros" x:Name="lgFiltros" View="GroupBox" IsLocked="True" HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
<tsWPF:tsLayoutItem Label="Mostrar Movimientos Cerrados:" HorizontalAlignment="Left" HorizontalContentAlignment="Left" TabIndex="1">
|
||||
<dxe:CheckEdit x:Name="cbIncluirCerrados" EditValueChanged="CbIncluirCerrados_EditValueChanged" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Fecha Inicial:" Width="170" HorizontalAlignment="Left" Margin="60,0,0,0">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit x:Name="teFechaInicial" TabIndex="1" MaskUseAsDisplayFormat="True" AllowNullInput="true" NullText="" EditValueChanged="TeFechaInicial_EditValueChanged" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Fecha Final:" Width="170" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit x:Name="teFechaFinal" TabIndex="2" MaskUseAsDisplayFormat="True" AllowNullInput="true" NullText="" EditValueChanged="TeFechaFinal_EditValueChanged" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
<tsWPF:tsGridControl x:Name="gcMovimientos" TabIndex="4" NombreTablaBase="movimientoscaja">
|
||||
<tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:PropiedadesTSGC Descripcion="Movimientos Caja" />
|
||||
</tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
|
||||
<dxg:GridControl.Columns>
|
||||
<tsWPF:tsGridColumn FieldName="idMovimiento" Width="110" IsSmart="True" Header="Nº Movimiento" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn FieldName="Fecha" Width="150" IsSmart="True" ReadOnly="True" />
|
||||
<tsWPF:tsGridColumn FieldName="DescripcionTipoMovimiento" Header="Tipo" Width="190" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="Clase" Header="Clase" Width="80" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="ReferenciaDocumento" Width="100" IsSmart="True" Header="Referencia" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn FieldName="FechaDocumento" Width="150">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy HH:mm" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="RazonSocial" Width="300" IsSmart="True" Header="Razón Social" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn Width="100" TabStop="False" FieldName="Importe" HorizontalHeaderContentAlignment="Right">
|
||||
<tsWPF:tsGridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskUseAsDisplayFormat="True" MaskType="Numeric" Mask="c2" HorizontalContentAlignment="Right" />
|
||||
</tsWPF:tsGridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="Observaciones" Header="Observaciones" Width="400" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="FechaCierre" Width="150" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="usuarios.Nombre" Header="Usuario" Width="200" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="FechaSupervision" Header="Fecha Supervisión" Width="150" IsSmart="True" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<tsWPF:tsTableView ShowTotalSummary="True" x:Name="tv" ShowGroupFooters="True" ShowSearchPanelMode="Always">
|
||||
<tsWPF:tsTableView.FormatConditions>
|
||||
<dxg:FormatCondition Expression="Tipo=1" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Magenta" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="Tipo=2" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Red" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="Tipo=3" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Brown" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="Tipo=4 AndAlso Importe < 0" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Red" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="Tipo=9" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Blue" FontWeight="Bold" />
|
||||
</dxg:FormatCondition>
|
||||
|
||||
<dxg:FormatCondition Expression="Not IsNull([FechaCierre])" FieldName="{x:Null}">
|
||||
<dxg:Format FontStyle="Italic" />
|
||||
</dxg:FormatCondition>
|
||||
|
||||
|
||||
</tsWPF:tsTableView.FormatConditions>
|
||||
</tsWPF:tsTableView>
|
||||
</dxg:GridControl.View>
|
||||
<tsWPF:tsGridControl.TotalSummary>
|
||||
<dxg:GridSummaryItem SummaryType="Count" ShowInColumn="RazonSocial" DisplayFormat="Nº Movimientos: {0:n}" />
|
||||
<dxg:GridSummaryItem FieldName="Importe" SummaryType="Sum" ShowInColumn="Importe" DisplayFormat=" {0:c2}" />
|
||||
</tsWPF:tsGridControl.TotalSummary>
|
||||
<dxg:GridControl.GroupSummary>
|
||||
<dxg:GridSummaryItem SummaryType="Count" ShowInGroupColumnFooter="RazonSocial" DisplayFormat="Nº Movimientos: {0:n}" />
|
||||
<dxg:GridSummaryItem FieldName="Importe" SummaryType="Sum" ShowInGroupColumnFooter="Importe" DisplayFormat=" {0:c2}" />
|
||||
</dxg:GridControl.GroupSummary>
|
||||
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutGroup>
|
||||
</dx:DXTabItem>
|
||||
|
||||
</dx:DXTabControl>
|
||||
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
202
GestionGrupoSanchoToro/FicherosMaestros/ucCaja.xaml.bak
Normal file
202
GestionGrupoSanchoToro/FicherosMaestros/ucCaja.xaml.bak
Normal file
@@ -0,0 +1,202 @@
|
||||
<tsWPF: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:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v22.2" x:Class="ucCaja"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1366">
|
||||
<tsWPF:tsUserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
|
||||
<Setter Property="Background" Value="#B0E0E6" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</tsWPF:tsUserControl.Resources>
|
||||
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
|
||||
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Datos Caja" x:Name="lgDetalle" View="GroupBox" ItemLabelsAlignment="Default" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="450">
|
||||
<tsWPF:tsLayoutItem Label="Descripción:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Descripcion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="1" x:Name="teNIF" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="IBAN:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding IBAN, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" x:Name="tbTelefonoTomador" TabIndex="5" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="350">
|
||||
<tsWPF:tsLayoutItem Label="Tipo:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbTipo" ValueMember="Valor" DisplayMember="Descripcion" EditValue="{Binding Tipo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" AutoComplete="True" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Sufijo Bancario:" Width="200" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding SufijoBancario, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="5" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPF:tsLayoutItem Label="Fecha Baja:" Width="200" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaBaja, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="6" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<!--<tsWPF:tsLayoutItem Label="Permisos:" Width="400" HorizontalAlignment="Left" >
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False"/>
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbPermiso" ValueMember="idPermiso" DisplayMember="Codigo" EditValue="{Binding idPermiso, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" AutoComplete="True" />
|
||||
</tsWPF:tsLayoutItem>-->
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Header="Datos Último Cierre" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<tsWPF:tsLayoutItem Label="Fecha Cierre:" Width="200">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaCierre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="6" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Width="200" Label="Saldo Al Cierre:" FontWeight="Bold">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="27" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding SaldoAlCierre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem FontWeight="Bold" Label="Importe Pendiente Cerrar:" Width="300">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="28" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding SaldoPendienteCierre, Mode=OneWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
<tsWPF:tsLayoutItem FontWeight="Bold" Label="Saldo Actual:" Width="300">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="28" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding SaldoActual, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
<dx:DXTabControl Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dx:DXTabControl.View>
|
||||
<dx:TabControlScrollView />
|
||||
</dx:DXTabControl.View>
|
||||
<dx:DXTabItem Header="Movimientos">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Filtros" x:Name="lgFiltros" View="GroupBox" IsLocked="True" HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
<tsWPF:tsLayoutItem Label="Mostrar Movimientos Cerrados:" HorizontalAlignment="Left" HorizontalContentAlignment="Left" TabIndex="1">
|
||||
<dxe:CheckEdit x:Name="cbIncluirCerrados" EditValueChanged="CbIncluirCerrados_EditValueChanged" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Fecha Inicial:" Width="170" HorizontalAlignment="Left" Margin="60,0,0,0">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit x:Name="teFechaInicial" TabIndex="1" MaskUseAsDisplayFormat="True" AllowNullInput="true" NullText="" EditValueChanged="TeFechaInicial_EditValueChanged" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Fecha Final:" Width="170" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit x:Name="teFechaFinal" TabIndex="2" MaskUseAsDisplayFormat="True" AllowNullInput="true" NullText="" EditValueChanged="TeFechaFinal_EditValueChanged" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
<tsWPF:tsGridControl x:Name="gcMovimientos" TabIndex="4" NombreTablaBase="movimientoscaja">
|
||||
<tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:PropiedadesTSGC Descripcion="Movimientos Caja" />
|
||||
</tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
|
||||
<dxg:GridControl.Columns>
|
||||
<tsWPF:tsGridColumn FieldName="idMovimiento" Width="110" IsSmart="True" Header="Nº Movimiento" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn FieldName="Fecha" Width="150" IsSmart="True" ReadOnly="True" />
|
||||
<tsWPF:tsGridColumn FieldName="DescripcionTipoMovimiento" Header="Tipo" Width="190" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="Clase" Header="Clase" Width="80" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="ReferenciaDocumento" Width="100" IsSmart="True" Header="Referencia" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn FieldName="FechaDocumento" Width="150">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy HH:mm" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="RazonSocial" Width="300" IsSmart="True" Header="Razón Social" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn Width="100" TabStop="False" FieldName="Importe" HorizontalHeaderContentAlignment="Right">
|
||||
<tsWPF:tsGridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskUseAsDisplayFormat="True" MaskType="Numeric" Mask="c2" HorizontalContentAlignment="Right" />
|
||||
</tsWPF:tsGridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="Observaciones" Header="Observaciones" Width="400" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="FechaCierre" Width="150" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="usuarios.Nombre" Header="Usuario" Width="200" IsSmart="True" />
|
||||
<tsWPF:tsGridColumn FieldName="FechaSupervision" Header="Fecha Supervisión" Width="150" IsSmart="True" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<tsWPF:tsTableView ShowTotalSummary="True" x:Name="tv" ShowGroupFooters="True" ShowSearchPanelMode="Always">
|
||||
<tsWPF:tsTableView.FormatConditions>
|
||||
<dxg:FormatCondition Expression="Tipo=1" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Magenta" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="Tipo=2" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Red" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="Tipo=3" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Brown" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="Tipo=4 AndAlso Importe < 0" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Red" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="Tipo=9" FieldName="{x:Null}">
|
||||
<dx:Format Foreground="Blue" FontWeight="Bold" />
|
||||
</dxg:FormatCondition>
|
||||
|
||||
<dxg:FormatCondition Expression="Not IsNull([FechaCierre])" FieldName="{x:Null}">
|
||||
<dxg:Format FontStyle="Italic" />
|
||||
</dxg:FormatCondition>
|
||||
|
||||
|
||||
</tsWPF:tsTableView.FormatConditions>
|
||||
</tsWPF:tsTableView>
|
||||
</dxg:GridControl.View>
|
||||
<tsWPF:tsGridControl.TotalSummary>
|
||||
<dxg:GridSummaryItem SummaryType="Count" ShowInColumn="RazonSocial" DisplayFormat="Nº Movimientos: {0:n}" />
|
||||
<dxg:GridSummaryItem FieldName="Importe" SummaryType="Sum" ShowInColumn="Importe" DisplayFormat=" {0:c2}" />
|
||||
</tsWPF:tsGridControl.TotalSummary>
|
||||
<dxg:GridControl.GroupSummary>
|
||||
<dxg:GridSummaryItem SummaryType="Count" ShowInGroupColumnFooter="RazonSocial" DisplayFormat="Nº Movimientos: {0:n}" />
|
||||
<dxg:GridSummaryItem FieldName="Importe" SummaryType="Sum" ShowInGroupColumnFooter="Importe" DisplayFormat=" {0:c2}" />
|
||||
</dxg:GridControl.GroupSummary>
|
||||
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutGroup>
|
||||
</dx:DXTabItem>
|
||||
|
||||
</dx:DXTabControl>
|
||||
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
205
GestionGrupoSanchoToro/FicherosMaestros/ucCaja.xaml.vb
Normal file
205
GestionGrupoSanchoToro/FicherosMaestros/ucCaja.xaml.vb
Normal file
@@ -0,0 +1,205 @@
|
||||
Imports DevExpress.Xpf.Editors
|
||||
Imports tsWPFCore
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports Microsoft.EntityFrameworkCore
|
||||
Imports GrupoSanchoToro.GrupoSanchoToro
|
||||
|
||||
Public Class ucCaja
|
||||
|
||||
|
||||
Private bd As tscGrupoSanchoToro
|
||||
Friend _idCaja As Nullable(Of Integer)
|
||||
Dim ra As cajas
|
||||
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 Estado = tsUtilidades.EstadosAplicacion.Nuevo OrElse _idCaja Is Nothing OrElse FuerzaNuevo Then
|
||||
ra = New cajas
|
||||
ra.idEmpresa = EmpresaActual.idEmpresa
|
||||
Me.DataContext = ra
|
||||
_idCaja = Nothing
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
||||
Else
|
||||
ra = bd.cajas.First(Function(x) x.idCaja = _idCaja.Value)
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
End If
|
||||
Me.DataContext = ra
|
||||
ObtieneMovimientos()
|
||||
|
||||
Dim Acciones As New List(Of tsWPFCore.Accion)
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 1,
|
||||
.Descripcion = "CERRAR CAJA"})
|
||||
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
|
||||
Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
|
||||
ra = Me.DataContext
|
||||
|
||||
|
||||
Return NuevoEstado
|
||||
|
||||
End Function
|
||||
Private Sub ObtieneMovimientos()
|
||||
If Me.DataContext IsNot Nothing Then
|
||||
Dim ra As cajas = Me.DataContext
|
||||
Dim rs = bd.movimientoscaja.Include(Function(x) x.idMovimientoCierreNavigation).Where(Function(x) x.idCaja = ra.idCaja)
|
||||
Dim fi As Date? = teFechaInicial.EditValue
|
||||
If cbIncluirCerrados.IsChecked = False Then
|
||||
rs = rs.Where(Function(x) x.idMovimientoCierre.HasValue = False)
|
||||
End If
|
||||
If fi.HasValue Then
|
||||
rs = rs.Where(Function(x) x.Fecha >= fi.Value)
|
||||
End If
|
||||
Dim ff As Date? = teFechaFinal.EditValue
|
||||
If ff.HasValue Then
|
||||
ff = ff.Value.AddDays(1)
|
||||
rs = rs.Where(Function(x) x.Fecha < ff.Value)
|
||||
End If
|
||||
gcMovimientos.ItemsSource = rs.Include(Function(x) x.idFacturaNavigation.idClienteNavigation).Include(Function(x) x.idFacturaRecibidaNavigation.idProveedorNavigation).OrderBy(Function(x) x.Fecha).ToList
|
||||
Else
|
||||
gcMovimientos.ItemsSource = Nothing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||
bd = tscGrupoSanchoToro.NuevoContexto()
|
||||
Return bd
|
||||
End Function
|
||||
|
||||
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||
Get
|
||||
Return "cajas"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
|
||||
Return "Caja.Nuevo"
|
||||
Else
|
||||
Return "Caja." & DirectCast(Me.DataContext, cajas).idCaja.ToString
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Caja"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(Optional idCaja As Integer? = Nothing)
|
||||
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
_idCaja = idCaja
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
Me.cbTipo.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.cajas.TipoCajaEnum))
|
||||
'Try
|
||||
' Dim ra As cajas = Me.DataContext
|
||||
'Catch ex As Exception
|
||||
' Throw New Exception(ex.Message, ex)
|
||||
'End Try
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||
Dim cj As cajas = Me.DataContext
|
||||
Me.docpanel.Caption = "Caja " & cj.Descripcion
|
||||
Me.docpanel.Tag = "Caja." & cj.idCaja.ToString
|
||||
Else
|
||||
Me.docpanel.Caption = "Caja Nuevo"
|
||||
Me.docpanel.Tag = "Caja.Nuevo"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
Me.Tipo_ucControlBusqueda = GetType(ucCajas)
|
||||
End Sub
|
||||
|
||||
Private Sub TeFechaFinal_EditValueChanged(sender As Object, e As EditValueChangedEventArgs)
|
||||
ObtieneMovimientos()
|
||||
End Sub
|
||||
|
||||
Private Sub CbIncluirCerrados_EditValueChanged(sender As Object, e As EditValueChangedEventArgs)
|
||||
Dim fi As Date? = teFechaInicial.EditValue
|
||||
If fi.HasValue = False Then
|
||||
teFechaInicial.EditValue = Now.AddDays(-30).Date
|
||||
End If
|
||||
Dim ff As Date? = teFechaFinal.EditValue
|
||||
If ff.HasValue = False Then
|
||||
teFechaFinal.EditValue = Now.Date
|
||||
End If
|
||||
ObtieneMovimientos()
|
||||
End Sub
|
||||
|
||||
Private Sub TeFechaInicial_EditValueChanged(sender As Object, e As EditValueChangedEventArgs)
|
||||
ObtieneMovimientos()
|
||||
End Sub
|
||||
|
||||
Private Sub ucCaja_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
Dim ra As movimientoscaja = Me.gcMovimientos.CurrentItem
|
||||
Select Case Celda.Column.FieldName.ToLower
|
||||
Case "idmovimiento"
|
||||
FuncionesDinamicas.AbrirAP(New ucMovimientoCaja(ra.idMovimiento), OtrosParametros)
|
||||
Case "referenciadocumento"
|
||||
Dim tipom As TipoMovimientoEnum = ra.Tipo
|
||||
Select Case tipom
|
||||
Case TipoMovimientoEnum.RECIBO_CLIENTE
|
||||
' FuncionesDinamicas.AbrirAP(New ucFacturaEmitida(ra.idFactura), OtrosParametros)
|
||||
Case TipoMovimientoEnum.RECIBO_PROVEEDOR
|
||||
FuncionesDinamicas.AbrirAP(New ucFacturaRecibida(ra.idFacturaRecibida), OtrosParametros)
|
||||
End Select
|
||||
Case "razonsocial"
|
||||
FuncionesDinamicas.AbrirAP(New ucEntidad(ra.idEntidad), OtrosParametros)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ucCaja_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
|
||||
Select Case idAccion
|
||||
Case 1 ' CIERRE CAJA
|
||||
|
||||
If DXMessageBox.Show("¿Está seguro de querer cerrar la caja " & ra.Descripcion & "?", "Atención", vbYesNo) = MessageBoxResult.Yes Then
|
||||
DXMessageBox.Show(ListadosYProcesos.CierraCaja(ra.idCaja, True), "Cierre de Caja " & ra.Descripcion)
|
||||
RefrescaUC()
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ucCaja_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
|
||||
|
||||
_idCaja = ra.idCaja
|
||||
End Sub
|
||||
|
||||
Private Sub ucCaja_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
|
||||
Dim hte As New Hashtable
|
||||
ra.idEmpresa = EmpresaActual.idEmpresa
|
||||
Dim almexi = bd.cajas.FirstOrDefault(Function(x) x.idCaja <> ra.idCaja AndAlso x.Descripcion = ra.Descripcion AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
|
||||
If almexi IsNot Nothing Then
|
||||
hte.Add("ALMACENAR-CAJA_DUPLICADA", "Caja Duplicada")
|
||||
End If
|
||||
If hte.Count > 0 Then
|
||||
MensajesError = hte
|
||||
Cancelar = True
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
76
GestionGrupoSanchoToro/FicherosMaestros/ucCajas.xaml
Normal file
76
GestionGrupoSanchoToro/FicherosMaestros/ucCajas.xaml
Normal file
@@ -0,0 +1,76 @@
|
||||
<tsWPF: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:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
x:Class="ucCajas"
|
||||
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="600" d:DesignWidth="850">
|
||||
<tsWPF:tsUserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</tsWPF:tsUserControl.Resources>
|
||||
<Grid x:Name="grid">
|
||||
|
||||
<dxlc:LayoutControl Orientation="Vertical" Margin="-11" >
|
||||
|
||||
<tsWPF:tsGridControl x:Name="gc" TabIndex="4" >
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:PropiedadesTSGC PermitirEliminar="False" />
|
||||
</tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
|
||||
<dxg:GridControl.Columns>
|
||||
<tsWPF:tsGridColumn FieldName="Descripcion" Header="Caja" Width="300" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn FieldName="FechaCierre" Header="Último Cierre" IsSmart="True" Width="150"/>
|
||||
<tsWPF:tsGridColumn FieldName="SaldoAlCierre" HorizontalHeaderContentAlignment="Right" Width="100">
|
||||
<tsWPF:tsGridColumn.EditSettings>
|
||||
<dxe:TextEditSettings Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right"/>
|
||||
</tsWPF:tsGridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="SaldoPendienteCierre" HorizontalHeaderContentAlignment="Right" Width="150">
|
||||
<tsWPF:tsGridColumn.EditSettings>
|
||||
<dxe:TextEditSettings Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right"/>
|
||||
</tsWPF:tsGridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="SaldoActual" HorizontalHeaderContentAlignment="Right" Width="100">
|
||||
<tsWPF:tsGridColumn.EditSettings>
|
||||
<dxe:TextEditSettings Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right"/>
|
||||
</tsWPF:tsGridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
|
||||
<tsWPF:tsGridColumn FieldName="IBAN" IsSmart="True" SoloLectura="True" Width="250"/>
|
||||
|
||||
<tsWPF:tsGridColumn FieldName="FechaBaja" Width="150" IsSmart="True" ReadOnly="True" />
|
||||
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<tsWPF:tsTableView ShowTotalSummary="True" x:Name="tv" >
|
||||
</tsWPF:tsTableView>
|
||||
</dxg:GridControl.View>
|
||||
<tsWPF:tsGridControl.TotalSummary>
|
||||
<dxg:GridSummaryItem SummaryType="Count" Alignment="Right" />
|
||||
<dxg:GridSummaryItem FieldName="ImporteEntrada" SummaryType="Sum" ShowInColumn="ImporteEntrada" />
|
||||
<dxg:GridSummaryItem FieldName="ImporteSalida" SummaryType="Sum" ShowInColumn="ImporteSalida" />
|
||||
</tsWPF:tsGridControl.TotalSummary>
|
||||
<dxg:GridControl.GroupSummary>
|
||||
<dxg:GridSummaryItem SummaryType="Count" Alignment="Right" />
|
||||
<dxg:GridSummaryItem FieldName="ImporteEntrada" SummaryType="Sum" ShowInColumn="ImporteEntrada" />
|
||||
<dxg:GridSummaryItem FieldName="ImporteSalida" SummaryType="Sum" ShowInColumn="ImporteSalida" />
|
||||
</dxg:GridControl.GroupSummary>
|
||||
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
534
GestionGrupoSanchoToro/FicherosMaestros/ucCajas.xaml.vb
Normal file
534
GestionGrupoSanchoToro/FicherosMaestros/ucCajas.xaml.vb
Normal file
@@ -0,0 +1,534 @@
|
||||
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports System.Data.Entity
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports tsWPFCore
|
||||
Imports System.Collections
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports System.Threading.Tasks
|
||||
Imports System.Linq.Dynamic
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
|
||||
|
||||
|
||||
Public Class ucCajas
|
||||
|
||||
Private DatacontextEstablecido As Boolean
|
||||
Private bd As tscGrupoSanchoToro
|
||||
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
GridBusqueda = Me.gc
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||
gc.ItemsSource = bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa).OrderBy(Function(x) x.Descripcion).ToList
|
||||
Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
|
||||
End Function
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
Me.docpanel.Caption = "Cajas"
|
||||
End Sub
|
||||
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
Return "Cajas"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||
Get
|
||||
Return "cajas"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Caja"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||
bd = tscGrupoSanchoToro.NuevoContexto()
|
||||
Return bd
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
|
||||
Dim cj = DirectCast(Me.gc.CurrentItem, cajas)
|
||||
Dim id = cj.idCaja
|
||||
FuncionesDinamicas.AbrirAP(New ucCaja(id), OtrosParametros)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ucCajas_BotonNuevoPulsado() Handles Me.BotonNuevoPulsado
|
||||
FuncionesDinamicas.AbrirAP(New ucCaja(Nothing), OtrosParametros)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
'Public Class ucConciliacionBancaria
|
||||
'
|
||||
|
||||
' Dim bd As tscGrupoSanchoToro
|
||||
' Private WithEvents ApLineas As tsWPFCore.ApLineas
|
||||
' ' Private ListadoCajas As List(Of Integer)
|
||||
' Private DatosCargados As Boolean
|
||||
' Private TotalPagado As Double
|
||||
' Private TotalDevuelto As Double
|
||||
' Private TotalPagadoAgrupado As Double
|
||||
' Private TotalDevueltoAgrupado As Double
|
||||
' Private ApuntesAGuardar As List(Of Integer)
|
||||
' Private idCajs() As Integer
|
||||
' Private cajs As List(Of cajas)
|
||||
|
||||
|
||||
' Private Sub ApLineas_Cargado() Handles ApLineas.Cargado
|
||||
' Me.tv.AllowEditing = True
|
||||
' ' Me.gcSupervisado.AllowEditing = DevExpress.Utils.DefaultBoolean.True
|
||||
' Me.ApLineas.ContenedorL.btEliminar.IsVisible = False
|
||||
' Me.ApLineas.ContenedorL.btNuevo.IsVisible = False
|
||||
' Me.ApLineas.ContenedorL.btInvertir.IsVisible = False
|
||||
' Me.ApLineas.ContenedorL.btSeleccionar.IsVisible = False
|
||||
' Dim biguardar As DevExpress.Xpf.Bars.BarButtonItem
|
||||
' biguardar = New DevExpress.Xpf.Bars.BarButtonItem
|
||||
' biguardar.Name = "btGuardarConciliacion"
|
||||
' biguardar.Glyph = New BitmapImage(New Uri("pack://application:,,,/DevExpress.Images.v16.2;component/GrayScaleImages/Save/Save_16x16.png"))
|
||||
' biguardar.Hint = "Guardar"
|
||||
' biguardar.IsEnabled = True
|
||||
' Me.ApLineas.ContenedorL.BarraBotones.Items.Add(biguardar)
|
||||
' Dim ilGuardar As New DevExpress.Xpf.Bars.BarButtonItemLink()
|
||||
' ilGuardar.Name = "ilGuardar"
|
||||
' ilGuardar.BarItemName = biguardar.Name
|
||||
' Me.ApLineas.ContenedorL.BarraBotones.Bars(0).ItemLinks.Insert(0, ilGuardar)
|
||||
' AddHandler biguardar.ItemClick, AddressOf Guardar_ItemClick
|
||||
|
||||
' End Sub
|
||||
|
||||
|
||||
' Private Sub ApLineas_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles ApLineas.Enlazar
|
||||
' 'Select Case Celda.Column.FieldName.ToLower
|
||||
' ' Case "numerorecibo"
|
||||
' Dim rec As Apuntes = Celda.RowData.Row
|
||||
' Dim ucf As New ucFactura
|
||||
' Dim dwi As dxwInicio = Window.GetWindow(Me)
|
||||
' If rec.NumeroRecibo IsNot Nothing Then
|
||||
' Comun.AbrirUcCL(ucf, dwi.grupodoc, Nothing, Me.ApLineas.dcfg, Me.ApLineas.dcn, 0, Me.ApLineas.dsc, Me.ApLineas.OtrosParametros, bd.recibos.First(Function(x) x.idrecibo = rec.NumeroRecibo).idFactura)
|
||||
' End If
|
||||
' ' End Select
|
||||
' End Sub
|
||||
|
||||
|
||||
' Public Sub EstableceDataContext(ByRef DataContext As Object, Optional BackGround As Boolean = False) Implements tsWPFCore.IApLineas.EstableceDataContext
|
||||
' Try
|
||||
' If Not DatosCargados Then
|
||||
' cajs = (From c In bd.cajas Where c.FechaBaja Is Nothing AndAlso c.enumeraciones.Codigo <> "TIPCAJ.METALICO" Order By c.Descripcion).ToList
|
||||
' For i = cajs.Count - 1 To 0 Step -1
|
||||
' If Comun.ObtienePermisos(bd, cajs(i).idPermiso, ApLineas.dsc.idUsuario).Otros = False Then
|
||||
' cajs.Remove(cajs(i))
|
||||
' End If
|
||||
' Next
|
||||
' If cajs.Count > 0 Then
|
||||
' If Comun.idCajaPredeterminada Is Nothing Then
|
||||
' If cajs.Count = 1 Then Comun.idCajaPredeterminada = cajs.First.idCaja
|
||||
' Else
|
||||
' If cajs.Where(Function(c) c.idCaja = Comun.idCajaPredeterminada).Count = 0 Then
|
||||
' Comun.idCajaPredeterminada = cajs.First.idCaja
|
||||
' End If
|
||||
' End If
|
||||
' Dim cj As cajas = (From c In bd.cajas Select c Where c.idCaja = Comun.idCajaPredeterminada).First
|
||||
' End If
|
||||
' idCajs = cajs.Select(Function(x) x.idCaja).ToArray
|
||||
' ' Me.cbCaja.ItemsSource = cajs
|
||||
' ' ListadoCajas = (From c In cajs Select c.idCaja).ToList
|
||||
' 'If Comun.idCajaPredeterminada IsNot Nothing Then
|
||||
' ' Me.cbCaja.EditValue = Comun.idCajaPredeterminada
|
||||
' 'Else
|
||||
' ' Me.cbCaja.EditValue = cajs.First
|
||||
' 'End If
|
||||
' End If
|
||||
' ' Me.teFechaFinal.EditValue = Now
|
||||
' ' Me.teFechaInicial.EditValue = Now
|
||||
|
||||
' DatosCargados = True
|
||||
' ObtieneApuntes()
|
||||
|
||||
' DataContext = Me.gc.DataContext
|
||||
|
||||
' Catch ex As Exception
|
||||
' DXMessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' End Try
|
||||
' End Sub
|
||||
|
||||
' Public ReadOnly Property NombreTablaBase As String Implements tsWPFCore.IApLineas.NombreTablaBase
|
||||
' Get
|
||||
' Return ""
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public ReadOnly Property CampoIndice As String Implements IAplicacion.CampoIndice
|
||||
' Get
|
||||
' Throw New NotImplementedException()
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
' Get
|
||||
' Throw New NotImplementedException()
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
' Get
|
||||
' Throw New NotImplementedException()
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Private ReadOnly Property IAplicacion_NombreTablaBase As String Implements IAplicacion.NombreTablaBase
|
||||
' Get
|
||||
' Throw New NotImplementedException()
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public Sub Nuevo() Implements tsWPFCore.IApLineas.Nuevo
|
||||
|
||||
|
||||
' End Sub
|
||||
|
||||
|
||||
' Public Function ObtieneRejilla() As tsWPFCore.tsGridControl Implements tsWPFCore.IApLineas.ObtieneRejilla
|
||||
' Return Me.gc
|
||||
' End Function
|
||||
|
||||
' Public Sub EstableceApLin(ApLin As tsWPFCore.ApLineas) Implements tsWPFCore.IApLineas.EstableceApLin
|
||||
' Me.ApLineas = ApLin
|
||||
' End Sub
|
||||
|
||||
' Public Function ObtieneContexto(dcn As tsUtilidades.Datos.DatosConexionCliente) As System.Data.Objects.ObjectContext Implements tsWPFCore.IApLineas.ObtieneContexto
|
||||
' bd = bdM3Academy.Utilidades.NuevaConexion(dcn.BasesDatos(0))
|
||||
' Return bd
|
||||
' End Function
|
||||
|
||||
' Public Function ObtienePermisos() As tsUtilidades.Permisos Implements tsWPFCore.IApLineas.ObtienePermisos
|
||||
' Return Comun.ObtienePermisos(Me.bd, "AP.CONCILIACIONBANCARIA", Me.ApLineas.dsc.idUsuario)
|
||||
' End Function
|
||||
|
||||
' Public Function ObtieneCampoIndice() As String Implements tsWPFCore.IApLineas.ObtieneCampoIndice
|
||||
' Return ""
|
||||
' End Function
|
||||
|
||||
|
||||
' 'Private Sub ApLineas_ImprimirPlantilla(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs, idPlantilla As Integer) Handles ApLineas.ImprimirPlantilla
|
||||
' ' Try
|
||||
' ' Dim ds As Object = ObtieneDataSource()
|
||||
' ' Informes.MuestraImpresos(bd, idPlantilla, ds, Me.ApLineas.GrupoDocumentos, tsWPFCore.ApCabLin.dm.DockController)
|
||||
' ' Catch EX As Exception
|
||||
' ' DXMessageBox.Show(EX.Message, "Atención", MessageBoxButton.OK)
|
||||
' ' End Try
|
||||
' 'End Sub
|
||||
|
||||
' Private Sub ObtieneApuntes()
|
||||
' Try
|
||||
' If DatosCargados Then
|
||||
' ApuntesAGuardar = New List(Of Integer)
|
||||
' Dim iNumeroApuntes As Integer
|
||||
' Dim ierecs As IEnumerable(Of recibos)
|
||||
' Dim recs As List(Of recibos)
|
||||
|
||||
' Dim lm As New List(Of Apuntes)
|
||||
|
||||
' Dim m As Apuntes
|
||||
' ' Dim idCaja As Integer? = DirectCast(Me.cbCaja.EditValue, Integer)
|
||||
' Dim dIngresosp, dGastosp As Double
|
||||
' If idCajs.Count > 0 Then
|
||||
' ierecs = (From r In bd.recibos Where idCajs.Contains(r.idCaja))
|
||||
' If Me.teFechaInicial.EditValue IsNot Nothing Then
|
||||
' Dim dFi As Date = Me.teFechaInicial.EditValue
|
||||
' Dim fi As New DateTime(dFi.Year, dFi.Month, dFi.Day, 0, 0, 0)
|
||||
' ierecs = (From r In ierecs Where r.FechaPago >= dFi)
|
||||
' End If
|
||||
' If Me.teFechaFinal.EditValue IsNot Nothing Then
|
||||
' Dim dFf As Date = Me.teFechaFinal.EditValue
|
||||
' Dim ff As New DateTime(dFf.Year, dFf.Month, dFf.Day, 23, 59, 59)
|
||||
' ierecs = (From r In ierecs Where r.FechaPago <= dFf)
|
||||
' End If
|
||||
' If Not Me.cbIncluirSupervisados.IsChecked Then
|
||||
' ierecs = (From r In ierecs Where r.Supervisado = False)
|
||||
' End If
|
||||
' recs = ierecs.ToList
|
||||
' For Each r In recs
|
||||
' iNumeroApuntes += 1
|
||||
' m = New Apuntes
|
||||
' m.Caja = cajs.First(Function(x) x.idCaja = r.idCaja).Descripcion
|
||||
' If r.facturas.Mes IsNot Nothing Then
|
||||
' m.Descripcion = "Recibo de " & r.facturas.RazonSocial & " Mensualidad: " & tsUtilidades.Utilidades.MesCastellano(r.facturas.Mes Mod 100) & " " & (r.facturas.Mes \ 100).ToString
|
||||
' Else
|
||||
' m.Descripcion = "Recibo de " & r.facturas.RazonSocial
|
||||
' End If
|
||||
' m.Fecha = r.FechaPago.Date
|
||||
' m.ImporteEntrada = r.Importe
|
||||
' m.ImporteSalida = 0
|
||||
' m.NumeroRecibo = r.idrecibo
|
||||
' m.Tipo = TipoMovimiento.RECIBO
|
||||
' m.Usuario = If(r.usuarios Is Nothing, "", r.usuarios.Nombre)
|
||||
' m.idApunte = iNumeroApuntes
|
||||
' ' m.Supervisado = r.Supervisado
|
||||
' m.FechaSupervision = r.FechaSupervision
|
||||
' m.idMovimientoORecibo = r.idrecibo
|
||||
' lm.Add(m)
|
||||
' Next
|
||||
' dIngresosp = recs.Sum(Function(x) x.Importe)
|
||||
|
||||
|
||||
' ierecs = (From r In bd.recibos Where idCajs.Contains(r.idCaja) AndAlso r.FechaDevolucion IsNot Nothing)
|
||||
' If Me.teFechaInicial.EditValue IsNot Nothing Then
|
||||
' Dim dFi As Date = Me.teFechaInicial.EditValue
|
||||
' Dim fi As New DateTime(dFi.Year, dFi.Month, dFi.Day, 0, 0, 0)
|
||||
' ierecs = (From r In ierecs Where r.FechaDevolucion >= dFi)
|
||||
' End If
|
||||
' If Me.teFechaFinal.EditValue IsNot Nothing Then
|
||||
' Dim dFf As Date = Me.teFechaFinal.EditValue
|
||||
' Dim ff As New DateTime(dFf.Year, dFf.Month, dFf.Day, 23, 59, 59)
|
||||
' ierecs = (From r In ierecs Where r.FechaDevolucion <= dFf)
|
||||
' End If
|
||||
' If Not Me.cbIncluirSupervisados.IsChecked Then
|
||||
' ierecs = (From r In ierecs Where r.DevolucionSupervisada = False)
|
||||
' End If
|
||||
' recs = ierecs.ToList
|
||||
' For Each r In recs
|
||||
' iNumeroApuntes += 1
|
||||
' m = New Apuntes
|
||||
' m.Caja = cajs.First(Function(x) x.idCaja = r.idCaja).Descripcion
|
||||
' If r.facturas.Mes IsNot Nothing Then
|
||||
' m.Descripcion = "Devolución Recibo de " & r.facturas.RazonSocial & " Mensualidad: " & tsUtilidades.Utilidades.MesCastellano(r.facturas.Mes Mod 100) & " " & (r.facturas.Mes \ 100).ToString
|
||||
' Else
|
||||
' m.Descripcion = "Devolución Recibo de " & r.facturas.RazonSocial
|
||||
' End If
|
||||
' m.Fecha = r.FechaDevolucion.Value.Date
|
||||
' m.ImporteEntrada = 0
|
||||
' m.ImporteSalida = r.Importe
|
||||
' m.NumeroRecibo = r.idrecibo
|
||||
' m.Tipo = TipoMovimiento.DEVOLUCION_RECIBO
|
||||
' m.Usuario = If(r.usuarios1 Is Nothing, "", r.usuarios1.Nombre)
|
||||
' m.idApunte = iNumeroApuntes
|
||||
' ' m.Supervisado = r.DevolucionSupervisada
|
||||
' m.FechaSupervision = r.FechaSupervisionDevolucion
|
||||
' m.idMovimientoORecibo = r.idrecibo
|
||||
' lm.Add(m)
|
||||
' Next
|
||||
' dGastosp = recs.Sum(Function(x) x.Importe)
|
||||
|
||||
' Dim iemovs As IEnumerable(Of movimientoscaja)
|
||||
' Dim movs As List(Of movimientoscaja)
|
||||
' iemovs = (From mv In bd.movimientoscaja Where idCajs.Contains(mv.idCaja) AndAlso mv.Tipo <> TipoMovimiento.APERTURA AndAlso mv.Tipo <> TipoMovimiento.CIERRE)
|
||||
|
||||
' ' ierecs = (From r In bd.recibos Where r.idCaja = idCaja AndAlso r.FechaDevolucion IsNot Nothing)
|
||||
' If Me.teFechaInicial.EditValue IsNot Nothing Then
|
||||
' Dim dFi As Date = Me.teFechaInicial.EditValue
|
||||
' Dim fi As New DateTime(dFi.Year, dFi.Month, dFi.Day, 0, 0, 0)
|
||||
' iemovs = (From mv In iemovs Where mv.Fecha >= dFi)
|
||||
' End If
|
||||
' If Me.teFechaFinal.EditValue IsNot Nothing Then
|
||||
' Dim dFf As Date = Me.teFechaFinal.EditValue
|
||||
' Dim ff As New DateTime(dFf.Year, dFf.Month, dFf.Day, 23, 59, 59)
|
||||
' iemovs = (From mv In iemovs Where mv.Fecha <= dFf)
|
||||
' End If
|
||||
' If Not Me.cbIncluirSupervisados.IsChecked Then
|
||||
' iemovs = (From mv In iemovs Where mv.Supervisado = False)
|
||||
' End If
|
||||
' movs = iemovs.ToList
|
||||
' For Each mc In movs
|
||||
' iNumeroApuntes += 1
|
||||
' m = New Apuntes
|
||||
' m.Caja = cajs.First(Function(x) x.idCaja = mc.idCaja).Descripcion
|
||||
' m.Descripcion = mc.Descripcion
|
||||
' m.Fecha = mc.Fecha.Value.Date
|
||||
' m.ImporteSalida = mc.ImporteSalida
|
||||
' m.ImporteEntrada = mc.ImporteEntrada
|
||||
' m.Tipo = mc.Tipo
|
||||
' 'Select Case mc.Tipo
|
||||
' ' Case "INGRESO"
|
||||
' ' m.Tipo = TipoMovimiento.INGRESO
|
||||
' ' Case "GASTO"
|
||||
' ' m.Tipo = TipoMovimiento.GASTO
|
||||
' ' Case "APERTURA"
|
||||
' ' m.Tipo = TipoMovimiento.APERTURA
|
||||
' ' Case "CIERRE"
|
||||
' ' m.Tipo = TipoMovimiento.CIERRE
|
||||
' ' Case "DEVOLUCION RECIBO"
|
||||
' ' m.Tipo = TipoMovimiento.DEVOLUCION_RECIBO
|
||||
' ' Case "TRASPASO"
|
||||
' ' m.Tipo = TipoMovimiento.TRASPASO
|
||||
' 'End Select
|
||||
' m.Usuario = mc.usuarios.Nombre
|
||||
' m.idApunte = iNumeroApuntes
|
||||
' ' m.Supervisado = mc.Supervisado
|
||||
' m.FechaSupervision = mc.FechaSupervision
|
||||
' m.idMovimientoORecibo = mc.idMovimiento
|
||||
' lm.Add(m)
|
||||
' Next
|
||||
' dIngresosp += movs.Sum(Function(x) x.ImporteEntrada)
|
||||
' dGastosp += movs.Sum(Function(x) x.ImporteSalida)
|
||||
' If idCajs.Count > 0 Then
|
||||
' recs = (From r In bd.recibos Where idCajs.Contains(r.idCaja) AndAlso r.idMovimientoCierre Is Nothing).ToList
|
||||
' Dim imprecs As Double? = recs.Sum(Function(r) r.Importe)
|
||||
' Dim recdevs = (From r In bd.recibos Where idCajs.Contains(r.idCaja) AndAlso r.idMovimientoCierreDevolucion Is Nothing AndAlso r.FechaDevolucion IsNot Nothing).ToList
|
||||
' Dim imprecdevs As Double? = recdevs.Sum(Function(r) r.Importe)
|
||||
' Dim mvs = (From mv In bd.movimientoscaja Where idCajs.Contains(mv.idCaja) AndAlso mv.idMovimientoCierre Is Nothing AndAlso mv.Tipo <> TipoMovimiento.CIERRE)
|
||||
' Dim dImporteMovEnt As Double? = mvs.Sum(Function(mv) mv.ImporteEntrada)
|
||||
' Dim dImporteMovSal As Double? = mvs.Sum(Function(mv) mv.ImporteSalida)
|
||||
' Dim dIngresos As Double = If(dImporteMovEnt, 0) + If(imprecs, 0)
|
||||
' Dim dGastos As Double = If(dImporteMovSal, 0) + If(imprecdevs, 0)
|
||||
' 'Me.teSaldoActual.EditValue = dIngresos - dGastos
|
||||
' 'Me.teIngresos.EditValue = dIngresosp
|
||||
' 'Me.teGastos.EditValue = dGastosp
|
||||
' Else
|
||||
' 'Me.teSaldoActual.EditValue = 0
|
||||
' 'Me.teIngresos.EditValue = 0
|
||||
' 'Me.teGastos.EditValue = 0
|
||||
' End If
|
||||
' lm = lm.OrderBy(Function(x) x.Fecha).ThenBy(Function(x) x.idApunte).ToList
|
||||
' Else
|
||||
' Throw New Exception("Seleccione primero la caja")
|
||||
' End If
|
||||
' Me.gc.ItemsSource = lm
|
||||
|
||||
|
||||
|
||||
' For i = 0 To Me.gc.VisibleRowCount - 1
|
||||
' Dim rw = gc.GetRowHandleByVisibleIndex(i)
|
||||
' MarcaSeleccionados(rw)
|
||||
' Next
|
||||
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' Throw New Exception(ex.Message, ex)
|
||||
' End Try
|
||||
' End Sub
|
||||
' Private Sub MarcaSeleccionados(rw As Integer)
|
||||
' If Not gc.IsGroupRowHandle(rw) Then
|
||||
' Dim ap As Apuntes = gc.GetRow(rw)
|
||||
' If ap.FechaSupervision.HasValue Then
|
||||
' gc.SelectItem(rw)
|
||||
' End If
|
||||
' Else
|
||||
' For i = 0 To gc.GetChildRowCount(rw) - 1
|
||||
' MarcaSeleccionados(gc.GetChildRowHandle(rw, i))
|
||||
' Next
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Private Sub teFechaInicial_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs) Handles teFechaInicial.EditValueChanged
|
||||
' ObtieneApuntes()
|
||||
' Me.DataContext = Me.gc.ItemsSource
|
||||
' End Sub
|
||||
|
||||
' Private Sub teFechaFinal_EditValueChanged(sender As Object, e As DevExpress.Xpf.Editors.EditValueChangedEventArgs) Handles teFechaFinal.EditValueChanged
|
||||
' ObtieneApuntes()
|
||||
' Me.DataContext = Me.gc.ItemsSource
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
' Private Sub cbIncluirSupervisados_Checked(sender As Object, e As RoutedEventArgs)
|
||||
' ObtieneApuntes()
|
||||
' Me.DataContext = Me.gc.ItemsSource
|
||||
' End Sub
|
||||
|
||||
' Private Sub cbIncluirSupervisados_Unchecked(sender As Object, e As RoutedEventArgs)
|
||||
' ObtieneApuntes()
|
||||
' Me.DataContext = Me.gc.ItemsSource
|
||||
' End Sub
|
||||
|
||||
' Private Sub Guardar_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||
' tv.CommitEditing()
|
||||
|
||||
' ' Dim aps As List(Of Apuntes) = Me.gc.ItemsSource
|
||||
' Dim ahora As DateTime = Comun.AhoraMysql(bd)
|
||||
' gc.FilterCriteria = Nothing
|
||||
|
||||
' For i = 0 To Me.gc.VisibleRowCount - 1
|
||||
' Dim rw = gc.GetRowHandleByVisibleIndex(i)
|
||||
' If Not gc.IsGroupRowHandle(rw) Then
|
||||
' EstableceConciliacion(rw, ahora)
|
||||
' Else
|
||||
' For j = 0 To gc.GetChildRowCount(rw) - 1
|
||||
' EstableceConciliacion(gc.GetChildRowHandle(rw, j), ahora)
|
||||
' Next
|
||||
' End If
|
||||
' Next
|
||||
|
||||
|
||||
|
||||
' bd.GuardarCambios()
|
||||
' EstableceDataContext(Me.DataContext)
|
||||
' End Sub
|
||||
|
||||
' Private Sub EstableceConciliacion(rw As Integer, ahora As DateTime)
|
||||
' Dim ap As Apuntes
|
||||
' Dim r As recibos
|
||||
' Dim m As movimientoscaja
|
||||
|
||||
' If Not gc.IsGroupRowHandle(rw) Then
|
||||
' ap = gc.GetRow(rw)
|
||||
' Select Case ap.Tipo
|
||||
' Case TipoMovimiento.RECIBO
|
||||
' r = bd.recibos.First(Function(x) x.idrecibo = ap.idMovimientoORecibo)
|
||||
' If Me.tv.IsRowSelected(rw) Then
|
||||
' If Not r.Supervisado Then
|
||||
' r.Supervisado = True
|
||||
' r.FechaSupervision = ahora
|
||||
' End If
|
||||
' Else
|
||||
' If r.Supervisado Then
|
||||
' r.Supervisado = False
|
||||
' r.FechaSupervision = Nothing
|
||||
' End If
|
||||
' End If
|
||||
' Case TipoMovimiento.DEVOLUCION_RECIBO
|
||||
' r = bd.recibos.First(Function(x) x.idrecibo = ap.idMovimientoORecibo)
|
||||
' If Me.tv.IsRowSelected(rw) Then
|
||||
' If Not r.DevolucionSupervisada Then
|
||||
' r.DevolucionSupervisada = True
|
||||
' r.FechaSupervisionDevolucion = ahora
|
||||
' End If
|
||||
' Else
|
||||
' If r.DevolucionSupervisada Then
|
||||
' r.DevolucionSupervisada = False
|
||||
' r.FechaSupervisionDevolucion = Nothing
|
||||
' End If
|
||||
' End If
|
||||
' Case Else
|
||||
' m = bd.movimientoscaja.First(Function(x) x.idMovimiento = ap.idMovimientoORecibo)
|
||||
' If Me.tv.IsRowSelected(rw) Then
|
||||
' If Not m.Supervisado Then
|
||||
' m.Supervisado = True
|
||||
' m.FechaSupervision = ahora
|
||||
' End If
|
||||
' Else
|
||||
' If m.Supervisado Then
|
||||
' m.Supervisado = False
|
||||
' m.FechaSupervision = Nothing
|
||||
' End If
|
||||
' End If
|
||||
' End Select
|
||||
|
||||
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
'End Class
|
||||
199
GestionGrupoSanchoToro/FicherosMaestros/ucProducto.xaml
Normal file
199
GestionGrupoSanchoToro/FicherosMaestros/ucProducto.xaml
Normal file
@@ -0,0 +1,199 @@
|
||||
<tsWPF: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:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucProducto"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1366">
|
||||
<tsWPF:tsUserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
|
||||
<Setter Property="Background" Value="#B0E0E6" />
|
||||
<Setter Property="BorderThickness" Value="2" />
|
||||
</Style>
|
||||
<Style x:Key="RejillaAnidadaNietaStyle" TargetType="{x:Type dxg:RowControl}">
|
||||
<Setter Property="Background" Value="LightGreen" />
|
||||
<Setter Property="BorderThickness" Value="2" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</tsWPF:tsUserControl.Resources>
|
||||
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
|
||||
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Datos Producto" x:Name="lgDetalle" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="1250" HorizontalAlignment="Left">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Orientation="Horizontal">
|
||||
<tsWPF:tsLayoutItem Label="Código:" Width="240">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="2" EditValue="{Binding Codigo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Descripción:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" Unico="True" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Descripcion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="3" x:Name="teNIF" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Tipo:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbTipo" ValueMember="Valor" DisplayMember="Descripcion" EditValue="{Binding Tipo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" AutoComplete="True" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Fecha Baja:" Width="200">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaBaja, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="4" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
<tsWPF:tsLayoutItem Label="Observaciones:">
|
||||
<dxe:TextEdit EditValue="{Binding Observaciones, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="10" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
<dxlc:LayoutGroup Header="Tarifas" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch" ItemLabelsAlignment="Local">
|
||||
<dxlc:LayoutGroup Width="400">
|
||||
<tsWPF:tsLayoutItem Label="Precio:">
|
||||
<dxe:TextEdit TabIndex="11" Mask="c4" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding PrecioVenta, Converter={StaticResource DoubleToDecimalConverter}, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Precio Costo:">
|
||||
<dxe:TextEdit TabIndex="13" Mask="c4" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding UltimoPrecioCompra, Converter={StaticResource DoubleToDecimalConverter}, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
<dx:DXTabControl Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dx:DXTabControl.View>
|
||||
<dx:TabControlScrollView />
|
||||
</dx:DXTabControl.View>
|
||||
<dx:DXTabItem Header="Stocks">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Descglose por almacenes" View="GroupBox">
|
||||
<tsWPF:tsGridControl x:Name="gcStocksAlmacenes" NombreTablaBase="desgloseproductos" TabIndex="41">
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.View>
|
||||
<tsWPF:tsTableView ShowGroupPanel="false" x:Name="tvStocksAlmacenes" IsDetailButtonVisibleBinding="{Binding Row.ContieneHijos}">
|
||||
</tsWPF:tsTableView>
|
||||
</tsWPF:tsGridControl.View>
|
||||
<dxg:GridControl.Columns>
|
||||
<tsWPF:tsGridColumn FieldName="Almacen" Header="Almacén" IsSmart="True" Width="450" SoloLectura="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPF:tsGridColumn FieldName="TipoAlmacen" Header="Tipo Almacén" IsSmart="True" Width="200" SoloLectura="True" />
|
||||
<tsWPF:tsGridColumn FieldName="Unidades" IsSmart="True" Width="100">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="n0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
|
||||
</dxg:GridControl.Columns>
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dx:DXTabItem>
|
||||
|
||||
<!--<dx:DXTabItem Header="Albaranes en los que aparece">
|
||||
<tsWPF:tsGridControl x:Name="gcAlbaranes" TabIndex="43">
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.View>
|
||||
<tsWPF:tsTableView ShowSearchPanelMode="Always" ShowTotalSummary="True" x:Name="tvProductosAoV" ShowGroupFooters="True" />
|
||||
</tsWPF:tsGridControl.View>
|
||||
<dxg:GridColumn FieldName="NumeroAlbaran" Header="Nº Albarán" IsSmart="True" Width="120" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<dxg:GridColumn FieldName="albaranes.Fecha" Header="Fecha" IsSmart="True" Width="150">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="AlmacenOrigen" Header="Almacén Origen" IsSmart="True" Width="300" />
|
||||
<dxg:GridColumn FieldName="AlmacenDestino" Header="Almacén Destino" IsSmart="True" Width="300" />
|
||||
<dxg:GridColumn FieldName="Cantidad" Header="Cantidad" IsSmart="True" Width="70">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="n0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Entidad" Header="Cliente/Proveedor" Width="300" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<dxg:GridColumn FieldName="albaranes.DescripcionEvento" Header="Evento" Width="300" />
|
||||
<dxg:GridColumn FieldName="EsVenta" IsSmart="True" Width="60">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:CheckEditSettings IsThreeState="False">
|
||||
</dxe:CheckEditSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
</tsWPF:tsGridControl>
|
||||
</dx:DXTabItem>
|
||||
<dx:DXTabItem Header="Facturas en las que aparece">
|
||||
<tsWPF:tsGridControl x:Name="gcFacturas" TabIndex="43">
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.View>
|
||||
<tsWPF:tsTableView ShowSearchPanelMode="Always" ShowTotalSummary="True" x:Name="tvFacturas" ShowGroupFooters="True" />
|
||||
</tsWPF:tsGridControl.View>
|
||||
<dxg:GridColumn FieldName="NumeroFactura" Header="Nº Factura" IsSmart="True" Width="120" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<dxg:GridColumn FieldName="idFacturaNavigation.Fecha" Header="Fecha" IsSmart="True" Width="150">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="AlmacenOrigen" Header="Almacén Origen" IsSmart="True" Width="300" />
|
||||
<dxg:GridColumn FieldName="AlmacenDestino" Header="Almacén Destino" IsSmart="True" Width="300" />
|
||||
<dxg:GridColumn FieldName="Cantidad" Header="Cantidad" IsSmart="True" Width="70">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="n0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Entidad" Header="Cliente/Proveedor" Width="300" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<dxg:GridColumn FieldName="albaranes.DescripcionEvento" Header="Evento" Width="300" />
|
||||
<dxg:GridColumn FieldName="EsVenta" IsSmart="True" Width="60">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:CheckEditSettings IsThreeState="False">
|
||||
</dxe:CheckEditSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
</tsWPF:tsGridControl>
|
||||
</dx:DXTabItem>
|
||||
<dx:DXTabItem Header="Registro de cambios">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPF:tsGridControl x:Name="gcLogs" TabIndex="45">
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<dxg:GridControl.View>
|
||||
<tsWPF:tsTableView x:Name="tvLogs" ShowSearchPanelMode="Default" ShowGroupPanel="False" />
|
||||
</dxg:GridControl.View>
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn FieldName="idLog" Header="Nº Cambio" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<dxg:GridColumn FieldName="FechaHora" Header="Fecha Hora Cambio">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="DateTime" MaskUseAsDisplayFormat="True" Mask="dd/MM/yyyy HH:mm" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Usuario" Header="Usuario" Width="250" IsSmart="True" />
|
||||
<dxg:GridColumn FieldName="ip" Header="Dirección IP" IsSmart="True" Width="150" />
|
||||
</dxg:GridControl.Columns>
|
||||
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutGroup>
|
||||
</dx:DXTabItem>-->
|
||||
</dx:DXTabControl>
|
||||
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
309
GestionGrupoSanchoToro/FicherosMaestros/ucProducto.xaml.vb
Normal file
309
GestionGrupoSanchoToro/FicherosMaestros/ucProducto.xaml.vb
Normal file
@@ -0,0 +1,309 @@
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports System.Collections
|
||||
Imports tsWPFCore
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports DevExpress.XtraSplashScreen
|
||||
Imports bdGrupoSanchoToro.db.productos
|
||||
Imports Microsoft.EntityFrameworkCore
|
||||
|
||||
Public Class ucProducto
|
||||
|
||||
|
||||
Private bd As tscGrupoSanchoToro
|
||||
Friend _idproducto As Nullable(Of Integer)
|
||||
Friend idLog As Integer?
|
||||
Dim ra As productos
|
||||
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||
Dim NuevoEstado As tsUtilidades.EstadosAplicacion
|
||||
If idLog.HasValue Then
|
||||
Try
|
||||
Dim log = bd.logs.First(Function(x) x.idLog = idLog)
|
||||
ra = tsUtilidades.Utilidades.DeserializarSinErrores(log.Log, GetType(productos))
|
||||
If ra.idUsuarioCreador.HasValue Then ra.idUsuarioCreadorNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuarioCreador.Value)
|
||||
If ra.idUsuarioModificador.HasValue Then ra.idUsuarioModificadorNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuarioModificador.Value)
|
||||
If bd.logs.Any(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "ARTICULOS") Then
|
||||
Dim entspol = bd.logs.First(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "ARTICULOS")
|
||||
Dim ld = tsUtilidades.Utilidades.DeserializarSinErrores(entspol.Log, GetType(List(Of articulos)))
|
||||
For Each d In ld
|
||||
ra.articulos.Add(d)
|
||||
Next
|
||||
End If
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
Catch EX As Exception
|
||||
Throw New Exception("No ha sido posible mostrar el registro del cambio (id " & idLog.Value.ToString & ").", EX)
|
||||
End Try
|
||||
Else
|
||||
If Estado = tsUtilidades.EstadosAplicacion.Nuevo OrElse _idproducto Is Nothing OrElse FuerzaNuevo Then
|
||||
ra = New productos
|
||||
ra.TotalUnidades = 0
|
||||
ra.UnidadesVendidas = 0
|
||||
ra.UnidadesAlquiladas = 0
|
||||
ra.UnidadesAveriadas = 0
|
||||
ra.UnidadesDesechadas = 0
|
||||
ra.FacturarComoVentaPorDefecto = False
|
||||
Me.DataContext = ra
|
||||
_idproducto = Nothing
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
||||
Else
|
||||
ra = bd.productos.First(Function(x) x.idProducto = _idproducto.Value)
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
End If
|
||||
End If
|
||||
' Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idProducto AndAlso x.Aplicacion = "PRODUCTOS").ToList
|
||||
|
||||
'Me.gcServicios.ItemsSource = ra.DesgloseServicios
|
||||
If ra.Tipo = TipoProductoEnum.PRODUCTO Then
|
||||
Me.gcStocksAlmacenes.ItemsSource = ObtieneISAlmacenes()
|
||||
Else
|
||||
Me.gcStocksAlmacenes.ItemsSource = Nothing
|
||||
End If
|
||||
Me.DataContext = ra
|
||||
|
||||
' gcArticulos.ItemsSource = ra.articulos
|
||||
|
||||
If Me.ContenedorAplicacion.cbAcciones.ItemsSource Is Nothing Then
|
||||
Dim Acciones As New List(Of tsWPFCore.Accion)
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 1,
|
||||
.Descripcion = "AÑADE DESGLOSE DE PRODUCTOS (F10)"})
|
||||
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
|
||||
Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
|
||||
End If
|
||||
|
||||
Return NuevoEstado
|
||||
|
||||
End Function
|
||||
Private Sub ucAlbaranEntrega_TeclaFuncionPulsada(sender As Object, e As KeyEventArgs) Handles Me.TeclaFuncionPulsada
|
||||
Select Case e.Key
|
||||
Case Key.F12
|
||||
'ValidaControlObjetoActual()
|
||||
'ucAlbaranEntrega_EjecutarAccion(Nothing, Nothing, 2)
|
||||
Case Key.F11
|
||||
'ValidaControlObjetoActual()
|
||||
'ucAlbaranEntrega_EjecutarAccion(Nothing, Nothing, 3)
|
||||
|
||||
Case Key.System
|
||||
Select Case e.SystemKey
|
||||
Case Key.F10
|
||||
ValidaControlObjetoActual()
|
||||
ucProducto_EjecutarAccion(Nothing, Nothing, 1)
|
||||
e.Handled = True
|
||||
End Select
|
||||
|
||||
End Select
|
||||
End Sub
|
||||
Private Function ObtieneISAlmacenes() As List(Of stocks)
|
||||
Dim stact = bd.stocks.Where(Function(x) x.idProducto = ra.idProducto).ToList
|
||||
Dim alms = bd.almacenes.Where(Function(x) x.FechaBaja.HasValue = False).ToList
|
||||
For Each al In alms
|
||||
If stact.Any(Function(x) x.idAlmacen = al.idAlmacen) = False Then
|
||||
Dim ns As New stocks
|
||||
With ns
|
||||
ns.idProductoNavigation = ra
|
||||
ns.idAlmacenNavigation = al
|
||||
ns.Unidades = 0
|
||||
End With
|
||||
bd.stocks.Add(ns)
|
||||
stact.Add(ns)
|
||||
End If
|
||||
Next
|
||||
Return stact.OrderBy(Function(x) x.idAlmacenNavigation.Descripcion).ToList
|
||||
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 "productos"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
If idLog.HasValue Then
|
||||
Return "Producto. R.C.:" & idLog.ToString
|
||||
Else
|
||||
If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
|
||||
Return "Producto.Nuevo"
|
||||
Else
|
||||
Return "Producto." & DirectCast(Me.DataContext, productos).idProducto.ToString
|
||||
End If
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Producto"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(Optional idProducto As Integer? = Nothing)
|
||||
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
_idproducto = idProducto
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
Try
|
||||
|
||||
Dim idprs = ra.articulos.Where(Function(x) x.idProveedor.HasValue).Select(Function(x) x.idProveedor.Value).ToArray
|
||||
Me.cbTipo.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.productos.TipoProductoEnum)).ToList
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
If idLog.HasValue Then
|
||||
Dim pr As productos = Me.DataContext
|
||||
Me.docpanel.Caption = "R.C. Producto " & pr.idProducto
|
||||
Else
|
||||
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||
Me.docpanel.Caption = "Producto " & ra.Descripcion
|
||||
Me.docpanel.Tag = "producto." & ra.idProducto.ToString
|
||||
Else
|
||||
Me.docpanel.Caption = "Producto Nuevo"
|
||||
Me.docpanel.Tag = "producto.Nuevo"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
Me.Tipo_ucControlBusqueda = GetType(ucProductos)
|
||||
'Dim tmp = bd.productos.Where(Function(x) x.idProducto = 7).First.ListaAscendientes
|
||||
'Dim tmp2 = bd.productos.Where(Function(x) x.idProducto = 7).First.NivelMaximoAscendientes
|
||||
'Dim tmp3 = bd.productos.Where(Function(x) x.idProducto = 1).First.NivelMaximoDescendientes
|
||||
'Debug.Write(tmp.Count)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub ucProducto_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
|
||||
Select Case Celda.Column.FieldName.ToLower
|
||||
'Case "idlog"
|
||||
' Dim log As logs = gcLogs.CurrentItem
|
||||
' Dim id As Integer = log.idLog
|
||||
' Dim uc As New ucProducto
|
||||
' uc.idLog = log.idLog
|
||||
' FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||
Case "almacen"
|
||||
Dim st As stocks = Celda.Row
|
||||
FuncionesDinamicas.AbrirAP(New ucAlmacen(st.idAlmacen), OtrosParametros)
|
||||
'Case "numeroalbaran"
|
||||
' Dim al As detallesalbaranes = Celda.Row
|
||||
' FuncionesDinamicas.AbrirAP(New ucAlbaran(al.idAlbaran), OtrosParametros)
|
||||
Case "entidad"
|
||||
Dim da As detallesalbaranes = Celda.Row
|
||||
If da.idAlbaranNavigation.idEntidad.HasValue Then FuncionesDinamicas.AbrirAP(New ucEntidad(da.idAlbaranNavigation.idEntidad.Value), OtrosParametros)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ucProducto_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 "stockinicial01", "stockinicial02", "stockinicial03", "stockinicial04", "stockinicial05"
|
||||
' ra.ActualizaStockActual()
|
||||
' ra.ActualizaStockTotal()
|
||||
' End Select
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private RecalcularStocks As Boolean
|
||||
'Private Sub ucProducto_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
|
||||
' '
|
||||
' ' Esto se hace para evitar error duplicate entry en el intercambio de numero de series
|
||||
' '
|
||||
' Try
|
||||
' Dim bdtmp = tscGrupoSanchoToro.NuevoContexto()
|
||||
' Dim arts = bdtmp.articulos.Where(Function(x) x.idProducto = ra.idProducto).ToList
|
||||
' For Each art In arts
|
||||
' If ra.articulos.Any(Function(x) x.idArticulo <> art.idArticulo AndAlso art.CodigoArticulo = x.CodigoArticulo) Then
|
||||
' art.CodigoArticulo = Nothing
|
||||
' End If
|
||||
' Next
|
||||
' 'If Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||
' ' Dim raant = bdtmp.productos.First(Function(x) x.idProducto = ra.idProducto)
|
||||
' ' If (ra.Tipo = TipoProductoEnum.ELEMENTO_FINAL_TRIBUNA OrElse ra.Tipo = TipoProductoEnum.ELEMENTO_FINAL_CARPA OrElse ra.Tipo <= TipoProductoEnum.OTROS) AndAlso
|
||||
' ' Not (raant.Tipo = TipoProductoEnum.ELEMENTO_FINAL_TRIBUNA OrElse raant.Tipo = TipoProductoEnum.ELEMENTO_FINAL_CARPA OrElse raant.Tipo <= TipoProductoEnum.OTROS) Then
|
||||
' ' RecalcularStocks = True
|
||||
' ' Else
|
||||
' ' If Not (ra.Tipo = TipoProductoEnum.ELEMENTO_FINAL_TRIBUNA OrElse ra.Tipo = TipoProductoEnum.ELEMENTO_FINAL_CARPA OrElse ra.Tipo <= TipoProductoEnum.OTROS) AndAlso
|
||||
' ' (raant.Tipo = TipoProductoEnum.ELEMENTO_FINAL_TRIBUNA OrElse raant.Tipo = TipoProductoEnum.ELEMENTO_FINAL_CARPA OrElse raant.Tipo <= TipoProductoEnum.OTROS) Then
|
||||
' ' For i = ra.stocks.Count - 1 To 0
|
||||
' ' bd.stocks.Remove(ra.stocks(i))
|
||||
' ' Next
|
||||
' ' ra.TotalUnidades = 0
|
||||
' ' ra.UnidadesInicialesOFabricadas = 0
|
||||
' ' ra.UnidadesCompradas = 0
|
||||
' ' ra.UnidadesVendidas = 0
|
||||
' ' ra.UnidadesAlquiladas = 0
|
||||
' ' ra.UnidadesAveriadas = 0
|
||||
' ' ra.UnidadesDesechadas = 0
|
||||
' ' ra.UnidadesSubAlquiladas = 0
|
||||
' ' End If
|
||||
' ' End If
|
||||
' 'End If
|
||||
|
||||
' bdtmp.GuardarCambios()
|
||||
' Catch ex As Exception
|
||||
' Throw New Exception(ex.Message, ex)
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
Private Sub ucProducto_EstadoCambiado(EstadoAnterior As tsUtilidades.EstadosAplicacion, EstadoNuevo As tsUtilidades.EstadosAplicacion) Handles Me.EstadoCambiado
|
||||
If idLog.HasValue Then
|
||||
EstableceSoloLectura()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ucProducto_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
|
||||
'Select Case idAccion
|
||||
' Case 1 ' AÑADIR PRODUCTOS AL DESGLOSE
|
||||
|
||||
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ucProducto_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
|
||||
ra.idEmpresa = EmpresaActual.idEmpresa
|
||||
Dim hte As New Hashtable
|
||||
ra.idEmpresa = EmpresaActual.idEmpresa
|
||||
Dim almexi = bd.productos.FirstOrDefault(Function(x) x.idProducto <> ra.idProducto AndAlso x.Descripcion = ra.Descripcion AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
|
||||
If almexi IsNot Nothing Then
|
||||
hte.Add("ALMACENAR-PRODUCTO_DUPLIADO", "Producto Duplicado")
|
||||
End If
|
||||
If hte.Count > 0 Then
|
||||
MensajesError = hte
|
||||
Cancelar = True
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
120
GestionGrupoSanchoToro/FicherosMaestros/ucProductos.xaml
Normal file
120
GestionGrupoSanchoToro/FicherosMaestros/ucProductos.xaml
Normal file
@@ -0,0 +1,120 @@
|
||||
<tsWPF: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:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:bdGrupoSanchoToro="clr-namespace:bdGrupoSanchoToro;assembly=bdGrupoSanchoToro" x:Class="ucProductos"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="768" d:DesignWidth="1366">
|
||||
<tsWPF:tsUserControl.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</tsWPF: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">
|
||||
<tsWPF:tsLayoutItem Label="Incluir Bajas:" HorizontalContentAlignment="Left" TabIndex="1" >
|
||||
<dxe:CheckEdit x:Name="cbIncluirBajas" TabIndex="2" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
|
||||
<dxe:TextEdit x:Name="teBusqueda" TabIndex="1" FontWeight="Normal" />
|
||||
</tsWPF: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="Descripción, id,Codigo"/>
|
||||
<TextBlock Margin="20,0,0,0" Text="(En Blanco Muestra Todos)" FontWeight="Bold" ></TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</dxlc:LayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<tsWPF:tsGridControl x:Name="gc" >
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable"/>
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn FieldName="Descripcion" Header="Descripción" Width="400" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}"/>
|
||||
<dxg:GridColumn FieldName="Codigo" Header="Código" Width="100" IsSmart="True" />
|
||||
<dxg:GridColumn FieldName="DescripcionTipo" Header="Tipo" Width="250" IsSmart="True" />
|
||||
<!--<dxg:GridColumn FieldName="TotalUnidades" Width="100" IsSmart="True">
|
||||
<dxg:GridColumn.CellStyle>
|
||||
<Style TargetType="dxg:LightweightCellEditor">
|
||||
<Setter Property="TextElement.FontWeight" Value="Bold"/>
|
||||
</Style>
|
||||
</dxg:GridColumn.CellStyle>
|
||||
<dxg:GridColumn.HeaderStyle>
|
||||
<Style TargetType="dxg:GridColumnHeader">
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
</Style>
|
||||
</dxg:GridColumn.HeaderStyle>
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>-->
|
||||
<!--<dxg:GridColumn FieldName="UnidadesDisponibles" Width="150" HorizontalHeaderContentAlignment="Right" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
<dxg:GridColumn.CellStyle>
|
||||
<Style TargetType="dxg:LightweightCellEditor">
|
||||
<Setter Property="TextElement.FontWeight" Value="Bold"/>
|
||||
</Style>
|
||||
</dxg:GridColumn.CellStyle>
|
||||
<dxg:GridColumn.HeaderStyle>
|
||||
<Style TargetType="dxg:GridColumnHeader">
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
</Style>
|
||||
</dxg:GridColumn.HeaderStyle>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="UnidadesCompradas" Width="130" HorizontalHeaderContentAlignment="Right" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="UnidadesSubAlquiladas" Header="Unidades Subalquiladas" Width="150" HorizontalHeaderContentAlignment="Right" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="UnidadesAlquiladas" Width="130" HorizontalHeaderContentAlignment="Right" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="UnidadesVendidas" Width="130" HorizontalHeaderContentAlignment="Right" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="UnidadesAveriadas" Width="130" IsSmart="True">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
|
||||
<dxg:GridColumn FieldName="UnidadesDesechadas" Width="130" IsSmart="True">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>-->
|
||||
<dxg:GridColumn FieldName="Observaciones" Width="300" IsSmart="True"/>
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<tsWPF:tsTableView ShowSearchPanelMode="Always" ShowGroupPanel="True" />
|
||||
</dxg:GridControl.View>
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
|
||||
192
GestionGrupoSanchoToro/FicherosMaestros/ucProductos.xaml.vb
Normal file
192
GestionGrupoSanchoToro/FicherosMaestros/ucProductos.xaml.vb
Normal file
@@ -0,0 +1,192 @@
|
||||
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports System.Data.Entity
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports tsWPFCore
|
||||
Imports System.Collections
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports System.Threading.Tasks
|
||||
Imports System.Linq.Dynamic
|
||||
Imports Microsoft.EntityFrameworkCore
|
||||
Imports System.Linq.Dynamic.Core
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
Imports Microsoft.Win32
|
||||
Imports DevExpress.Spreadsheet
|
||||
Imports bdGrupoSanchoToro.db.productos
|
||||
Imports System.Drawing
|
||||
|
||||
Public Class ucProductos
|
||||
|
||||
|
||||
Private bd As tscGrupoSanchoToro
|
||||
|
||||
|
||||
'Public Sub New(ListadoFiltrado As List(Of productos), TextoBusqueda As String, TituloCamposBusqueda As String, CamposBusquedaAlfabeticos() As String, CamposBusquedaNumericos() As String)
|
||||
|
||||
' InitializeComponent()
|
||||
' Me.teBusqueda.Text = TextoBusqueda
|
||||
' ' Me.tbCamposBusqueda.Text = TituloCamposBusqueda
|
||||
' _CamposBusquedaAlfabeticos = CamposBusquedaAlfabeticos
|
||||
' _CamposBusquedaNumericos = CamposBusquedaNumericos
|
||||
' _TextoBusqueda = TextoBusqueda
|
||||
|
||||
'End Sub
|
||||
Private _CamposBusquedaNumericos() As String = {"idProducto"}
|
||||
Private _CamposBusquedaAlfabeticos() As String = {"Descripcion", "Codigo"}
|
||||
|
||||
|
||||
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 ReadOnly Property CampoIndice As String
|
||||
' Get
|
||||
' Return ""
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
Me.GridSeleccion = Me.gc
|
||||
Me.HabilitarRefresco = True
|
||||
'ContenedorAplicacion.btGuardar.IsVisible = False
|
||||
'ContenedorAplicacion.siEstado.IsVisible = False
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Function EstableceDCPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||
If Refrescar OrElse Background Then ObtieneproductosAsync(bd, Background)
|
||||
'If Me.ContenedorAplicacion.cbAcciones.ItemsSource Is Nothing Then
|
||||
' Dim Acciones As New List(Of tsWPFCore.Accion)
|
||||
' Acciones.Add(New Accion With {
|
||||
' .idAccion = 1,
|
||||
' .Descripcion = "CORREGIR STOCK"})
|
||||
' Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
|
||||
' Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
|
||||
'End If
|
||||
|
||||
Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
|
||||
|
||||
End Function
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
Me.docpanel.Caption = "Productos"
|
||||
End Sub
|
||||
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
Return "Productos"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||
Get
|
||||
Return "productos"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Productos"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||
bd = tscGrupoSanchoToro.NuevoContexto()
|
||||
Return bd
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||
End Function
|
||||
|
||||
Private Sub Nuevo() Handles Me.BotonNuevoPulsado
|
||||
FuncionesDinamicas.AbrirAP(New ucProducto, OtrosParametros)
|
||||
End Sub
|
||||
|
||||
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
|
||||
Dim pr As productos = gc.CurrentItem
|
||||
'If pr.Tipo = TipoProductoEnum.TRIBUNA Then
|
||||
' FuncionesDinamicas.AbrirAP(New ucProductoTribuna(pr.idProducto), OtrosParametros)
|
||||
'Else
|
||||
FuncionesDinamicas.AbrirAP(New ucProducto(pr.idProducto), OtrosParametros)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub ap_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
|
||||
|
||||
End Sub
|
||||
Public Function Obtieneproductos(TextoBusqueda As String, IncluirBajas As Boolean) As List(Of productos)
|
||||
|
||||
Dim iqPr = bd.productos.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa)
|
||||
If IncluirBajas Then iqPr = iqPr.Where(Function(x) x.FechaBaja Is Nothing).OrderBy(Function(x) x.Descripcion)
|
||||
Dim rs As List(Of productos)
|
||||
Do
|
||||
Dim iNumExc As Integer = 0
|
||||
Try
|
||||
If TextoBusqueda.Trim <> "" Then
|
||||
If TextoBusqueda <> "" Then
|
||||
Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Me._CamposBusquedaNumericos, Me._CamposBusquedaAlfabeticos, Nothing)
|
||||
iqPr = iqPr.Where(ExpresionBusqueda)
|
||||
End If
|
||||
End If
|
||||
rs = iqPr.OrderBy(Function(x) x.Descripcion).ToList
|
||||
Exit Do
|
||||
Catch ex As Exception
|
||||
iNumExc += 1
|
||||
If iNumExc > 3 Then
|
||||
rs = Nothing
|
||||
Exit Do
|
||||
End If
|
||||
End Try
|
||||
Loop
|
||||
Return rs
|
||||
End Function
|
||||
|
||||
Public Async Sub ObtieneproductosAsync(bd As tscGrupoSanchoToro, Background As Boolean)
|
||||
Try
|
||||
Dim rs As New List(Of productos)
|
||||
Dim Busqueda = tsEFCore8.Extensiones.ObjetoNothingAVacio(Me.teBusqueda.EditValue)
|
||||
Dim IncluirBajas = Me.cbIncluirBajas.IsChecked
|
||||
If Background Then
|
||||
Me.ContenedorAplicacion.IsEnabled = False
|
||||
Await Task.Run(Sub()
|
||||
rs = Obtieneproductos(Busqueda, IncluirBajas)
|
||||
End Sub)
|
||||
Else
|
||||
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
||||
DXSplashScreen.SetState("Buscando productos ...")
|
||||
rs = Obtieneproductos(Busqueda, IncluirBajas)
|
||||
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)
|
||||
ObtieneproductosAsync(bd, False)
|
||||
End Sub
|
||||
|
||||
Private Sub ucProductos_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
teBusqueda.SelectAll()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user