20260129 - 01
This commit is contained in:
384
GestionGrupoSanchoToro/Almacen/ucAlbaran.xaml
Normal file
384
GestionGrupoSanchoToro/Almacen/ucAlbaran.xaml
Normal file
@@ -0,0 +1,384 @@
|
||||
<tsWPFCore:tsUserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
|
||||
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucAlbaran"
|
||||
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1366">
|
||||
<UserControl.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>
|
||||
</UserControl.Resources>
|
||||
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
|
||||
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Datos Del Albarán" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dxlc:LayoutGroup Width="1310">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="250" HorizontalAlignment="Left">
|
||||
<tsWPFCore:tsLayoutItem Label="Nº Albarán:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS UsualCorreccion="False" Modificable="NoModificable" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding NumeroAlbaran, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="100" NullText="« AUTOMÁTICO »" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="Nº Contrato:">
|
||||
<dxe:ButtonEdit x:Name="beContrato" EditValue="{Binding NumeroContrato, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="12" DefaultButtonClick="beContrato_DefaultButtonClick">
|
||||
<dxe:ButtonInfo GlyphKind="Search" x:Name="btIrAContrato" Click="btIrAContrato_Click" />
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" x:Name="btQuitarContrato" Click="btQuitarContrato_Click" />
|
||||
</dxe:ButtonEdit>
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="Nº Bultos:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding NumeroBultos, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="102" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="500">
|
||||
<dxlc:LayoutGroup>
|
||||
<tsWPFCore:tsLayoutItem Label="Fecha Albarán:" Width="230">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding Fecha, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="101" Mask="G" MaskUseAsDisplayFormat="True" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Tipo:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbTipo" AutoComplete="True" DisplayMember="Descripcion" ValueMember="Valor" EditValue="{Binding Tipo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="4" AllowNullInput="True" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<tsWPFCore:tsLayoutItem Label="Cliente/Proveedor:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbRazonSocial" AutoComplete="True" ValidateOnTextInput="False" IsTextEditable="True" DisplayMember="RazonSocial" ValueMember="idEntidad" EditValue="{Binding idEntidad, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" AllowDefaultButton="False" TabIndex="1">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo x:Name="biBuscarCliente" GlyphKind="Search" IsDefaultButton="False" Click="BiBuscarCliente_Click" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="Almacén Origen:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbAlmacenOrigen" AutoComplete="True" DisplayMember="Descripcion" ValueMember="idAlmacen" EditValue="{Binding idAlmacenOrigen, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="4" AllowNullInput="True" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup ItemLabelsAlignment="Local">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPFCore:tsLayoutItem Label="Nº Vale Transporte:" Width="250" HorizontalAlignment="Left">
|
||||
<Border BorderThickness="1" BorderBrush="Black" Height="22">
|
||||
<TextBlock><Hyperlink x:Name="hlVale" Click="hlVale_Click" Tag="{Binding idValeTransporte}"><InlineUIContainer>
|
||||
<TextBlock Text="{Binding idValeTransporte, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</InlineUIContainer></Hyperlink></TextBlock>
|
||||
</Border>
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Usuario:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS UsualCorreccion="False" Modificable="NoModificable" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Usuario, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="100" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="Almacén Destino:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbAlmacenDestino" AutoComplete="True" DisplayMember="Descripcion" ValueMember="idAlmacen" EditValue="{Binding idAlmacenDestino, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="4" AllowNullInput="True" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Header="Datos de la Carga" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Width="1310" HorizontalAlignment="Left">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="455">
|
||||
<tsWPFCore:tsLayoutItem Label="Direccion:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding LugarCarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" x:Name="teDireccionCliente" TabIndex="11" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<dxlc:LayoutGroup>
|
||||
<tsWPFCore:tsLayoutItem Label="Encargado Carga:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Cargadores, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="540">
|
||||
<dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="200">
|
||||
<tsWPFCore:tsLayoutItem Label="Código Postal:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ButtonEdit x:Name="beCodigoPostalCarga" EditValue="{Binding CodigoPostalCarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="31" DefaultButtonClick="BeCodigoPostalCarga_DefaultButtonClick">
|
||||
<dxe:ButtonInfo GlyphKind="Plus" x:Name="btAñadirCodigoPostalCarga" Click="BtAñadirCodigoPostalCarga_Click" />
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" x:Name="btCancelarCodigoPostalCarga" Click="BtCancelarCodigoPostalCarga_Click" />
|
||||
</dxe:ButtonEdit>
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="Teléfono 1:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Telefono1Carga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPFCore:tsLayoutItem Label="Población:" x:Name="Poblacion">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding PoblacionCarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="13" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Teléfono 2:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Telefono2Carga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPFCore:tsLayoutItem Label="Provincia:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding ProvinciaCarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="email:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding EmailCarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
<dxlc:LayoutGroup Width="1310" HorizontalAlignment="Left">
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Fecha Carga:" Width="250">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaCarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="101" Mask="G" MaskUseAsDisplayFormat="True" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Observaciones:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding ObservacionesCarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="20" FontWeight="Bold" Foreground="Red" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Header="Datos de la Descarga" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Width="1310" HorizontalAlignment="Left">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="455">
|
||||
<tsWPFCore:tsLayoutItem Label="Direccion:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding LugarDescarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="11" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<dxlc:LayoutGroup>
|
||||
<tsWPFCore:tsLayoutItem Label="Encargado Descarga:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Descargadores, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="540">
|
||||
<dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="200">
|
||||
<tsWPFCore:tsLayoutItem Label="Código Postal:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ButtonEdit x:Name="beCodigoPostalDescarga" EditValue="{Binding CodigoPostalDescarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="31" DefaultButtonClick="BeCodigoPostalDescarga_DefaultButtonClick">
|
||||
<dxe:ButtonInfo GlyphKind="Plus" x:Name="btAñadirCodigoPostalDescarga" Click="BtAñadirCodigoPostalDescarga_Click" />
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" x:Name="btCancelarCodigoPostalDescarga" Click="BtCancelarCodigoPostalDescarga_Click" />
|
||||
</dxe:ButtonEdit>
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Teléfono 1:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Telefono1Descarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPFCore:tsLayoutItem Label="Población:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding PoblacionDescarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="13" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Teléfono 2:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Telefono2Descarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPFCore:tsLayoutItem Label="Provincia:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding ProvinciaDescarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="email:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding EmailDescarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
<dxlc:LayoutGroup Width="1310" HorizontalAlignment="Left">
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Fecha Descarga:" Width="250">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaDescarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="101" Mask="G" MaskUseAsDisplayFormat="True" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
<tsWPFCore:tsLayoutItem Label="Observaciones:">
|
||||
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding ObservacionesDescarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="20" FontWeight="Bold" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dx:DXTabControl x:Name="DXTabPersonal1" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dx:DXTabControl.View>
|
||||
<dx:TabControlScrollView />
|
||||
</dx:DXTabControl.View>
|
||||
<dx:DXTabItem Header="Desglose Albarán">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPFCore:tsGridControl x:Name="gcProductos" TabIndex="29">
|
||||
<tsWPFCore:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPFCore:PropiedadesTSGC CamposObligatorios="Cantidad,idProducto" />
|
||||
</tsWPFCore:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPFCore:tsGridControl.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS />
|
||||
</tsWPFCore:tsGridControl.PropiedadesTS>
|
||||
<tsWPFCore:tsGridControl.View>
|
||||
<tsWPFCore:tsTableView x:Name="tvProductos" ShowGroupPanel="False" NewItemRowPosition="Bottom">
|
||||
</tsWPFCore:tsTableView>
|
||||
</tsWPFCore:tsGridControl.View>
|
||||
|
||||
<tsWPFCore:tsGridColumn FieldName="idProducto" Header="Producto" Width="400">
|
||||
<tsWPFCore:tsGridColumn.EditSettings>
|
||||
<dxe:ComboBoxEditSettings x:Name="cbProducto" ValueMember="idProducto" DisplayMember="Descripcion" AllowDefaultButton="False" AutoComplete="True">
|
||||
<dxe:ComboBoxEditSettings.Buttons>
|
||||
<dxe:ButtonInfo x:Name="biBuscarProducto" GlyphKind="Search" IsDefaultButton="False" Click="BiBuscarProducto_Click" />
|
||||
</dxe:ComboBoxEditSettings.Buttons>
|
||||
</dxe:ComboBoxEditSettings>
|
||||
</tsWPFCore:tsGridColumn.EditSettings>
|
||||
</tsWPFCore:tsGridColumn>
|
||||
<tsWPFCore:tsGridColumn FieldName="Cantidad" Header="Cantidad" IsSmart="True" Width="70">
|
||||
<tsWPFCore:tsGridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="n0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</tsWPFCore:tsGridColumn.EditSettings>
|
||||
</tsWPFCore:tsGridColumn>
|
||||
<tsWPFCore:tsGridColumn FieldName="IncluidoEnPresupuesto" IsSmart="True" Width="150" SoloLectura="True">
|
||||
<tsWPFCore:tsGridColumn.EditSettings>
|
||||
<dxe:CheckEditSettings IsThreeState="False">
|
||||
</dxe:CheckEditSettings>
|
||||
</tsWPFCore:tsGridColumn.EditSettings>
|
||||
</tsWPFCore:tsGridColumn>
|
||||
<tsWPFCore:tsGridColumn FieldName="EsVenta" IsSmart="True" Width="150" x:Name="gcEsventa">
|
||||
<tsWPFCore:tsGridColumn.EditSettings>
|
||||
<dxe:CheckEditSettings IsThreeState="False">
|
||||
</dxe:CheckEditSettings>
|
||||
</tsWPFCore:tsGridColumn.EditSettings>
|
||||
</tsWPFCore:tsGridColumn>
|
||||
<tsWPFCore:tsGridColumn FieldName="Observaciones" Header="Observaciones" IsSmart="True" Width="500" />
|
||||
|
||||
</tsWPFCore:tsGridControl>
|
||||
</dxlc:LayoutGroup>
|
||||
</dx:DXTabItem>
|
||||
<dx:DXTabItem Header="Registro de cambios">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPFCore:tsGridControl x:Name="gcLogs" TabIndex="30">
|
||||
<tsWPFCore:tsGridControl.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPFCore:tsGridControl.PropiedadesTS>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView x:Name="tvLogs" ShowSearchPanelMode="Default" ShowGroupPanel="False" />
|
||||
</dxg:GridControl.View>
|
||||
<dxg:GridControl.Columns>
|
||||
<tsWPFCore:tsGridColumn FieldName="idLog" Header="Nº Cambio" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<tsWPFCore:tsGridColumn FieldName="FechaHora" Header="Fecha Hora Cambio">
|
||||
<tsWPFCore:tsGridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="DateTime" MaskUseAsDisplayFormat="True" Mask="dd/MM/yyyy HH:mm" />
|
||||
</tsWPFCore:tsGridColumn.EditSettings>
|
||||
</tsWPFCore:tsGridColumn>
|
||||
<tsWPFCore:tsGridColumn FieldName="Usuario" Header="Usuario" Width="250" IsSmart="True" />
|
||||
<tsWPFCore:tsGridColumn FieldName="ip" Header="Dirección IP" IsSmart="True" Width="150" />
|
||||
</dxg:GridControl.Columns>
|
||||
|
||||
</tsWPFCore:tsGridControl>
|
||||
</dxlc:LayoutGroup>
|
||||
</dx:DXTabItem>
|
||||
</dx:DXTabControl>
|
||||
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPFCore:tsUserControl>
|
||||
785
GestionGrupoSanchoToro/Almacen/ucAlbaran.xaml.vb
Normal file
785
GestionGrupoSanchoToro/Almacen/ucAlbaran.xaml.vb
Normal file
@@ -0,0 +1,785 @@
|
||||
Imports DevExpress.Xpf.Editors
|
||||
Imports DevExpress.Xpf.LayoutControl
|
||||
Imports tsWPFCore
|
||||
Imports System.ComponentModel
|
||||
Imports System.Data
|
||||
Imports DevExpress.Xpf.Editors.Validation
|
||||
Imports DevExpress.Xpf.Editors.Helpers
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports tsWPFCore.modExtensiones
|
||||
Imports System.Data.Common
|
||||
Imports System.Data.Entity
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports tsUtilidades.Datos
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports System.Collections
|
||||
Imports tsUtilidades.Extensiones
|
||||
Imports tsUtilidades.Enumeraciones
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
|
||||
Imports System.Drawing
|
||||
Imports bdGrupoSanchoToro.db.albaranes
|
||||
|
||||
Public Class ucAlbaran
|
||||
Private bd As tscGrupoSanchoToro
|
||||
Friend _idAlbaran As Nullable(Of Integer)
|
||||
Private lProductos As List(Of productos)
|
||||
Private lArticulos As List(Of articulos)
|
||||
Friend idLog As Integer?
|
||||
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
|
||||
Me.Tipo_ucControlBusqueda = GetType(ucAlbaranes)
|
||||
End Sub
|
||||
Dim ra As albaranes
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
Try
|
||||
|
||||
lProductos = bd.productos.OrderBy(Function(x) x.Descripcion).ToList
|
||||
Dim lProductosAlb = ra.detallesalbaranes.Select(Function(x) x.idProducto).ToArray
|
||||
lProductos = lProductos.Where(Function(x) x.FechaBaja Is Nothing OrElse lProductosAlb.Contains(x.idProducto)).ToList
|
||||
cbProducto.ItemsSource = lProductos
|
||||
|
||||
cbRazonSocial.ItemsSource = bd.entidades.Where(Function(X) X.FechaBaja.HasValue = False OrElse X.idEntidad = ra.idEntidad).ToList.Select(Function(x) New With {x.idEntidad, x.RazonSocial}).OrderBy(Function(x) x.RazonSocial).ToList
|
||||
|
||||
Dim plantillas As List(Of tsWPFCore.Plantilla) = Comun.ObtienePlantillas(bd, {"GRUPLA.ALBENT"}, False)
|
||||
Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = plantillas
|
||||
If plantillas.Count > 0 Then
|
||||
Me.ContenedorAplicacion.bePlantilla.EditValue = plantillas.First.idPlantilla
|
||||
End If
|
||||
|
||||
Dim Acciones As New List(Of tsWPFCore.Accion)
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 1,
|
||||
.Descripcion = "GENERA ALBARÁN DE RECOGIDA Y FACTURA RÁPIDA (F10)"})
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 3,
|
||||
.Descripcion = "GENERA ALBARÁN DE RECOGIDA DE PRODUCTOS PENDIENTES (F11)"})
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 2,
|
||||
.Descripcion = "ENVIAR ALBARÁN POR CORREO ELECTRÓNICO (F12)"})
|
||||
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
|
||||
Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
|
||||
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||
Try
|
||||
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.LogXML, GetType(albaranes))
|
||||
' If ra.idUsuario.HasValue Then ra.idUsuarioNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuario.Value)
|
||||
' Dim df = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "detallesalbaranes_AE")
|
||||
' If df IsNot Nothing Then
|
||||
' Dim ld As List(Of detallesalbaranes) = tsUtilidades.Utilidades.DeserializarSinErrores(df.LogXML, GetType(List(Of detallesalbaranes)))
|
||||
' For Each d In ld
|
||||
' Dim pr = bd.productos.FirstOrDefault(Function(x) x.idProducto = d.idProducto)
|
||||
' d.productos = pr
|
||||
' If d.idArticulo.HasValue Then
|
||||
' Dim art = bd.articulos.FirstOrDefault(Function(x) x.idArticulo = d.idArticulo)
|
||||
' d.articulos = art
|
||||
' End If
|
||||
' ra.detallesalbaranes.Add(d)
|
||||
' Next
|
||||
' End If
|
||||
' Dim mv = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "MOVIMIENTOSCAJA_AE")
|
||||
' If mv IsNot Nothing Then
|
||||
' Dim ld = tsUtilidades.Utilidades.DeserializarSinErrores(mv.LogXML, GetType(List(Of movimientoscaja)))
|
||||
' For Each d In ld
|
||||
' ra.movimientoscaja.Add(d)
|
||||
' Next
|
||||
' End If
|
||||
' Dim lent = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "ENTIDADES")
|
||||
' If lent IsNot Nothing Then
|
||||
' Dim ent = tsUtilidades.Utilidades.DeserializarSinErrores(lent.LogXML, GetType(entidades))
|
||||
' ra.entidades = ent
|
||||
' ' lgDatosCliente.DataContext = ra.entidades
|
||||
' End If
|
||||
' Dim lobr = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "OBRAS")
|
||||
' If lobr IsNot Nothing Then
|
||||
' Dim obr = tsUtilidades.Utilidades.DeserializarSinErrores(lobr.LogXML, GetType(destinomontajes))
|
||||
' ra.destinomontajes = obr
|
||||
' ' lgDatosObra.DataContext = ra.destinomontajes
|
||||
' End If
|
||||
' NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
'Catch EX As Exception
|
||||
' Throw New Exception("No ha sido posible mostrar el registro del cambio (id " & idLog.Value.ToString & ").", EX)
|
||||
'End Try
|
||||
Else
|
||||
If FuerzaNuevo OrElse _idAlbaran Is Nothing Then
|
||||
ra = New albaranes
|
||||
_idAlbaran = Nothing
|
||||
ra.Fecha = DateOnly.FromDateTime(Today)
|
||||
ra.NumeroBultos = 1
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
||||
Else
|
||||
ra = bd.albaranes.First(Function(x) x.idAlbaran = _idAlbaran)
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
End If
|
||||
End If
|
||||
If Me.cbTipo.ItemsSource Is Nothing Then
|
||||
cbTipo.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum))
|
||||
cbAlmacenOrigen.ItemsSource = Comun.ObtieneListaAlmacenes(bd)
|
||||
cbAlmacenDestino.ItemsSource = Comun.ObtieneListaAlmacenes(bd)
|
||||
End If
|
||||
Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idAlbaran AndAlso x.Aplicacion = "albaranes").ToList
|
||||
gcProductos.ItemsSource = ra.detallesalbaranes
|
||||
Me.DataContext = ra
|
||||
Return NuevoEstado
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||
bd = tscGrupoSanchoToro.NuevoContexto
|
||||
Return bd
|
||||
End Function
|
||||
|
||||
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||
Get
|
||||
Return "albaranes"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private ReadOnly Property IAplicacion_CampoIndice As String
|
||||
Get
|
||||
Return "idAlbaran"
|
||||
End Get
|
||||
End Property
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
If idLog.HasValue Then
|
||||
Return "Albarán R.C.:" & idLog.ToString
|
||||
Else
|
||||
If Me.Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
|
||||
Return "Albarán.Nuevo"
|
||||
Else
|
||||
Return "Albarán." & DirectCast(Me.DataContext, albaranes).idAlbaran.ToString
|
||||
End If
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Albarán"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Public Overrides ReadOnly Property CampoIndice As String
|
||||
' Get
|
||||
' Return "idAlbaranEntrega"
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public Sub New(Optional idAlbaran As Integer? = Nothing)
|
||||
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
_idAlbaran = idAlbaran
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
If idLog.HasValue Then
|
||||
Me.docpanel.Caption = "R.C. Albarán " & ra.idAlbaran
|
||||
Me.docpanel.Tag = "R.C. Albarán." & ra.idAlbaran
|
||||
Else
|
||||
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||
Me.docpanel.Caption = "Albarán " & ra.idAlbaran
|
||||
Me.docpanel.Tag = "Albarán." & ra.idAlbaran.ToString
|
||||
Else
|
||||
Me.docpanel.Caption = "Albarán Nuevo"
|
||||
Me.docpanel.Tag = "Albaran.Nuevo"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overrides Function obtienePermisos() As tsUtilidades.Permisos
|
||||
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", bdGrupoSanchoToro.db.Utilidades.idUsuario)
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub ap_ValidarControl(sender As Object, e As ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
|
||||
|
||||
Dim pts As PropiedadesTS = sender.parent.propiedadests
|
||||
Try
|
||||
If Not pts Is Nothing Then
|
||||
Me.ErroresValidacion.EliminaError("validando-" & pts.NombreCampo)
|
||||
|
||||
Select Case pts.NombreCampo.ToLower
|
||||
|
||||
Case "codigopostalcarga"
|
||||
If Not e.Value Is Nothing AndAlso e.Value.ToString <> "" AndAlso e.Value.ToString <> ra.CodigoMunicipioCarga 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 If sCpo.Length <> 5 Then Throw New Exception("El código postal del Cliente 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.CodigoMunicipioCarga = pob.CodigoMunicipio
|
||||
Else
|
||||
Throw New Exception("El código postal de la carga no es correcto")
|
||||
End If
|
||||
Case 1
|
||||
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
|
||||
ra.CodigoMunicipioCarga = pob.CodigoMunicipio
|
||||
Case Else
|
||||
Dim wMunicipios As New dxwCodigosPostales(bd, sCpo)
|
||||
If wMunicipios.ShowDialog Then
|
||||
ra.CodigoMunicipioCarga = wMunicipios.CodigoMunicipio
|
||||
Else
|
||||
Throw New Exception("El código postal de la carga no es correcto")
|
||||
End If
|
||||
End Select
|
||||
ra.CodigoMunicipioCargaNavigation = bd.municipios.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioCarga)
|
||||
' ra.CodigoPostalCarga = sCpo
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
End If
|
||||
Case "codigopostaldescarga"
|
||||
If Not e.Value Is Nothing AndAlso e.Value.ToString <> "" AndAlso e.Value.ToString <> ra.CodigoMunicipioDescarga 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 If sCpo.Length <> 5 Then Throw New Exception("El código postal del Cliente 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.CodigoMunicipioDescarga = pob.CodigoMunicipio
|
||||
Else
|
||||
Throw New Exception("El código postal de la descarga no es correcto")
|
||||
End If
|
||||
Case 1
|
||||
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
|
||||
ra.CodigoMunicipioDescarga = pob.CodigoMunicipio
|
||||
Case Else
|
||||
Dim wMunicipios As New dxwCodigosPostales(bd, sCpo)
|
||||
If wMunicipios.ShowDialog Then
|
||||
ra.CodigoMunicipioDescarga = wMunicipios.CodigoMunicipio
|
||||
Else
|
||||
Throw New Exception("El código postal de la descarga no es correcto")
|
||||
End If
|
||||
End Select
|
||||
ra.CodigoMunicipioDescargaNavigation = bd.municipios.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioCarga)
|
||||
' ra.CodigoPostalDescarga = sCpo
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
|
||||
End If
|
||||
Case "emailcarga"
|
||||
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 "emaildescarga"
|
||||
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
|
||||
|
||||
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 BtAñadirCodigoPostalCarga_Click(sender As Object, e As RoutedEventArgs)
|
||||
If ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||
Dim vncp As New dxwAgregarNuevoMunicipio("")
|
||||
If vncp.ShowDialog Then
|
||||
Dim pob = bd.codigospostales.AsNoTracking.First(Function(x) x.CodigoPostal = vncp._CodigoPostal)
|
||||
ra.CodigoMunicipioCarga = pob.CodigoMunicipio
|
||||
ra.CodigoPostalCarga = vncp._CodigoPostal
|
||||
ra.CodigoMunicipioCargaNavigation = bd.municipios.AsNoTracking.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioCarga)
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BtAñadirCodigoPostalDesCarga_Click(sender As Object, e As RoutedEventArgs)
|
||||
If ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||
Dim vncp As New dxwAgregarNuevoMunicipio("")
|
||||
If vncp.ShowDialog Then
|
||||
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = vncp._CodigoPostal)
|
||||
ra.CodigoMunicipioDescarga = pob.CodigoMunicipio
|
||||
ra.CodigoPostalDescarga = vncp._CodigoPostal
|
||||
ra.CodigoMunicipioDescargaNavigation = bd.municipios.AsNoTracking.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioDescarga)
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BtCancelarCodigoPostalCarga_Click(sender As Object, e As RoutedEventArgs)
|
||||
If ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||
ra.CodigoPostalCarga = ""
|
||||
ra.CodigoMunicipioCarga = ""
|
||||
ra.CodigoMunicipioCarga = Nothing
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BtCancelarCodigoPostalDescarga_Click(sender As Object, e As RoutedEventArgs)
|
||||
If ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||
ra.CodigoPostalDescarga = ""
|
||||
ra.CodigoMunicipioDescarga = ""
|
||||
ra.CodigoMunicipioDescargaNavigation = Nothing
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ap_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
|
||||
Dim ae As albaranes = Me.DataContext
|
||||
_idAlbaran = DirectCast(Me.DataContext, albaranes).idAlbaran
|
||||
Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ae.idAlbaran AndAlso x.Aplicacion = "albaranes").ToList
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ap_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
|
||||
Select Case Celda.Column.FieldName.ToLower
|
||||
Case "idlog"
|
||||
Dim log As logs = gcLogs.CurrentItem
|
||||
Dim id As Integer = log.idLog
|
||||
Dim uc As New ucAlbaran
|
||||
uc.idLog = log.idLog
|
||||
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ap_EstadoCambiado(EstadoAnterior As tsUtilidades.EstadosAplicacion, EstadoNuevo As tsUtilidades.EstadosAplicacion) Handles Me.EstadoCambiado
|
||||
If idLog.HasValue Then EstableceSoloLectura()
|
||||
Select Case EstadoNuevo
|
||||
Case tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
If ra.Tipo = TipoAlbaranEnum.COMPRA Then
|
||||
gcEsventa.ReadOnly = True
|
||||
Else
|
||||
gcEsventa.ReadOnly = False
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub BiBuscarProducto_Click(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
|
||||
If tvProductos.ActiveEditor Is Nothing Then
|
||||
Dispatcher.BeginInvoke(New Action(Sub() tvProductos.ShowEditor()), System.Windows.Threading.DispatcherPriority.Render)
|
||||
End If
|
||||
Dim dxw As New dxwProductos(lProductos)
|
||||
If dxw.ShowDialog Then
|
||||
Dim dea As detallesalbaranes = gcProductos.CurrentItem
|
||||
Dim prod = lProductos.First(Function(x) x.idProducto = dxw.idProducto)
|
||||
If tvProductos.ActiveEditor IsNot Nothing Then
|
||||
tvProductos.ActiveEditor.EditValue = prod.idProducto
|
||||
Else
|
||||
Debug.Write("no")
|
||||
End If
|
||||
tvProductos.PostEditor()
|
||||
tvProductos.CloseEditor()
|
||||
gcProductos.RefreshRow(tvProductos.FocusedRowHandle)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BiBuscarCliente_Click(sender As Object, e As RoutedEventArgs)
|
||||
'If Me.Estado = EstadosAplicacion.Nuevo Then
|
||||
Dim dxw As New dxwEntidades(bd, True, False)
|
||||
If dxw.ShowDialog Then
|
||||
Dim ent = bd.entidades.First(Function(x) x.idEntidad = dxw.Entidad.idEntidad)
|
||||
ra.idEntidadNavigation = ent
|
||||
ra.idEntidad = ent.idEntidad
|
||||
End If
|
||||
' End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub RellenaDatosProducto(dea As detallesalbaranes)
|
||||
If dea IsNot Nothing AndAlso dea.idProducto <> 0 Then
|
||||
Dim ae As albaranes = Me.DataContext
|
||||
Dim pr = lProductos.First(Function(x) x.idProducto = dea.idProducto)
|
||||
If dea.Cantidad = 0 Then dea.Cantidad = 1
|
||||
dea.EsVenta = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub tvProductos_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles tvProductos.PreviewKeyDown
|
||||
If e.Key = Key.F6 Then
|
||||
Select Case gcProductos.CurrentColumn.FieldName.ToLower
|
||||
Case "idproducto"
|
||||
BiBuscarProducto_Click(Nothing, Nothing)
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub BeCodigoPostalCarga_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
Dim dxw As New dxwCodigosPostales(bd, "")
|
||||
If dxw.ShowDialog Then
|
||||
ra.CodigoMunicipioCarga = dxw.CodigoMunicipio
|
||||
ra.CodigoMunicipioCargaNavigation = bd.municipios.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioCarga)
|
||||
ra.CodigoPostalCarga = dxw.CodigoPostal
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BeCodigoPostalDescarga_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
Dim dxw As New dxwCodigosPostales(bd, "")
|
||||
If dxw.ShowDialog Then
|
||||
ra.CodigoMunicipioDescarga = dxw.CodigoMunicipio
|
||||
ra.CodigoPostalDescarga = dxw.CodigoPostal
|
||||
ra.CodigoMunicipioDescargaNavigation = bd.municipios.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioDescarga)
|
||||
ra.RefrescaCamposSoloLectura()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub uc_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||
|
||||
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
|
||||
Dim ae = bdtmp.albaranes.First(Function(x) x.idAlbaran = ra.idAlbaran)
|
||||
Imprimir(ra, idPlantilla, 1, False)
|
||||
Else
|
||||
DXMessageBox.Show("Antes debe almacenar", "Atención")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Imprimir(ra As albaranes, idPlantilla As Integer, Copias As Integer, ImpresoraDefecto As Boolean)
|
||||
Dim ds As List(Of albaranes)
|
||||
' Dim pl As plantillas = (From p In bd.plantillas Where p.idPlantilla = idPlantilla).First
|
||||
Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.idPlantilla = idPlantilla).Select(Function(x) New With {.Fichero = x.idFicheroNavigation.Fichero, .Tipo = x.idGrupoNavigation.Codigo}).FirstOrDefault
|
||||
ds = New List(Of albaranes)
|
||||
ds.Add(ra)
|
||||
Select Case pl.Tipo
|
||||
Case Else ' "GRUPLA.ALBENT"
|
||||
tsWPFCore.tsXtraReport.ImprimirPlantilla(pl.Fichero, ImpresoraDefecto, Copias, ds)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub tvProductos_ShowingEditor(sender As Object, e As ShowingEditorEventArgs) Handles tvProductos.ShowingEditor
|
||||
|
||||
'If ra.detallesalbaranes.ToList.Any(Function(x) x.idAlbaranRecogida.HasValue OrElse (x.idUltimaFactura.HasValue AndAlso (x.facturas.Fecha > ra.Fecha.Date))) Then
|
||||
' If e.RowHandle <> DataControlBase.NewItemRowHandle Then
|
||||
' Dim da As detallesalbaranes = gcProductos.GetRow(e.RowHandle)
|
||||
' If e.Column.FieldName.ToLower <> "observaciones" AndAlso e.Column.FieldName.ToLower <> "fechacancelacion" AndAlso e.Column.FieldName.ToLower <> "motivocancelacion" AndAlso e.Column.FieldName.ToLower <> "precio" AndAlso e.Column.FieldName.ToLower <> "cantidad" Then
|
||||
' If da.idAlbaranRecogida.HasValue OrElse da.idUltimaFactura.HasValue Then
|
||||
' e.Cancel = True
|
||||
' e.Handled = True
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub beCodigoPostalCarga_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles beCodigoPostalCarga.PreviewKeyDown
|
||||
If e.Key = Key.F6 Then
|
||||
BeCodigoPostalCarga_DefaultButtonClick(Nothing, Nothing)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub beCodigoPostalDescarga_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles beCodigoPostalDescarga.PreviewKeyDown
|
||||
If e.Key = Key.F6 Then
|
||||
BeCodigoPostalDescarga_DefaultButtonClick(Nothing, Nothing)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub tvProductos_ValidateRow(sender As Object, e As GridRowValidationEventArgs) Handles tvProductos.ValidateRow
|
||||
'Dim da As detallesalbaranes = e.Row
|
||||
'Dim Errores As String = ""
|
||||
'If da.Cantidad <> 1 AndAlso da.idArticulo.HasValue Then
|
||||
' Errores &= "Si es un artículo en concreto la cantidad tiene que ser 1" & vbCrLf
|
||||
'End If
|
||||
'If Errores <> "" Then
|
||||
' DXMessageBox.Show(Errores, "Error")
|
||||
' e.SetError(Errores)
|
||||
' e.IsValid = False
|
||||
'End If
|
||||
|
||||
Try
|
||||
Dim htErrores = New Hashtable
|
||||
ErroresValidacion.LimpiarErrores("TSGC-" & gcProductos.PropiedadesTS.NumeroObjeto.ToString & ":" & e.RowHandle.ToString & ":")
|
||||
Dim da As detallesalbaranes = e.Row
|
||||
|
||||
If da.Cantidad <> 1 AndAlso da.idArticulo.HasValue Then
|
||||
htErrores.Add("Cantidad1", "Si es un artículo en concreto la cantidad tiene que ser 1")
|
||||
End If
|
||||
If htErrores.Count > 0 Then
|
||||
Me.AgregaErroresTSGC(gcProductos, htErrores, e)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub tvProductos_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvProductos.InitNewRow
|
||||
gcProductos.SetCellValue(e.RowHandle, "Cantidad", 1)
|
||||
End Sub
|
||||
|
||||
Private Sub ucAlbaranEntrega_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
|
||||
'Select Case idAccion
|
||||
' Case 1 ' GENERA ALBARÁN DE RECOGIDA Y FACTURA RAPIDA
|
||||
' Try
|
||||
' If Not Guardar(Nothing, Nothing,,, 3) Then
|
||||
' Dim ae As albaranes = Me.DataContext
|
||||
' ' If ae.detallesalbaranes.Any(Function(x) x.idAlbaranRecogida.HasValue) Then
|
||||
' ' DXMessageBox.Show("Sólo se puede generar una factura rápida si no se ha recogido ningún producto del albarán", "Atención")
|
||||
' ' Else
|
||||
' Dim ar As albaranesrecogida = New albaranesrecogida
|
||||
' With ar
|
||||
' .Fecha = Now
|
||||
' .idCliente = ae.idCliente
|
||||
' .idUsuario = idUsuario
|
||||
' .EstableceNumeroAlbaran(bd)
|
||||
' End With
|
||||
' bd.albaranesrecogida.Add(ar)
|
||||
' For Each d In ae.detallesalbaranes.Where(Function(x) x.EsVenta = False AndAlso x.idAlbaranRecogida.HasValue = False)
|
||||
' d.albaranesrecogida = ar
|
||||
' Next
|
||||
' bd.GuardarCambios()
|
||||
' Dim id As Integer = ae.idAlbaranEntrega
|
||||
' Dim uc As New ucFacturaEmitida(,, id)
|
||||
' FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||
' tsWPFCore.Comun.dm.DockController.RemovePanel(docpanel)
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||
' DXMessageBox.Show(ex.Message, "Error")
|
||||
' End Try
|
||||
' Case 2 ' ENVIA ALBARÁN DE ENTREGA POR EMAIL
|
||||
|
||||
' Dim bCancelar As Boolean = False
|
||||
' If Me.ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||
' bCancelar = Me.Guardar(Nothing, Nothing,, True, 5)
|
||||
' End If
|
||||
' If Not bCancelar Then
|
||||
' Dim dxnc = New dxwEnvioCorreo(ra.entidades.Email, ra.entidades.Email2, "", "Producciones Romian, S.L. - Adjunto le remitimos albarán de entrega nº " & ra.NumeroAlbaran, "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos albarán entrega nº " & ra.NumeroAlbaran, "AlbaranEntrega_" & ra.NumeroAlbaran.Replace("/", "-") & ".pdf")
|
||||
' If dxnc.ShowDialog Then
|
||||
' Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO")
|
||||
' Dim bAlbaran = GeneraPdfAlbaran(bd, ra)
|
||||
' bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, dxnc._Asunto, dxnc._Cuerpo, cta, dxnc._Destinatarios, dxnc._CC, dxnc._BCC, bAlbaran, dxnc._Adjunto, ra.idAlbaranEntrega, "albaranes", ra.idCliente)
|
||||
' End If
|
||||
' End If
|
||||
'Case 3 ' GENERA ALBARÁN DE RECOGIDA RÁPIDO
|
||||
' Try
|
||||
' If Not Guardar(Nothing, Nothing,,, 3) Then
|
||||
' Dim ae As albaranes = Me.DataContext
|
||||
' Dim uc As New ucAlbaranRecogida(, ae.idAlbaranEntrega)
|
||||
' FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||
' tsWPFCore.Comun.dm.DockController.RemovePanel(docpanel)
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||
' DXMessageBox.Show(ex.Message, "Error")
|
||||
' End Try
|
||||
|
||||
' End Select
|
||||
End Sub
|
||||
|
||||
Friend Shared Function GeneraPdfAlbaran(bd As tscGrupoSanchoToro, Albaran As albaranes) As Byte()
|
||||
Dim albes As New List(Of albaranes)
|
||||
albes.Add(Albaran)
|
||||
Dim idplae = bd.plantillas.First(Function(x) x.Codigo = "ALBENTV").idPlantilla
|
||||
If Albaran.entidades.TipoImpresionAlbaranEntrega = db.albaranes.TipoImpresionAlbaranEntregaEnum.IMPRIMIR_CONTRATO Then idplae = bd.plantillas.First(Function(x) x.Codigo = "CONTAE").idPlantilla
|
||||
Dim bAes = Informes.GuardaInformeEnPdf(bd, idplae, albes)
|
||||
Return bAes
|
||||
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()
|
||||
ucAlbaranEntrega_EjecutarAccion(Nothing, Nothing, 1)
|
||||
e.Handled = True
|
||||
End Select
|
||||
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub gcProductos_AntesEliminar(gc As tsGridControl, ByRef Cancelar As Boolean) Handles gcProductos.AntesEliminar
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub ucAlbaranEntrega_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 "tipo"
|
||||
gcEsventa.ReadOnly = False
|
||||
Select Case DirectCast(ra.Tipo, bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum)
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.COMPRA
|
||||
For Each d In ra.detallesalbaranes.Where(Function(x) x.EsVenta)
|
||||
d.EsVenta = False
|
||||
Next
|
||||
gcEsventa.ReadOnly = True
|
||||
ra.idAlmacenOrigen = Nothing
|
||||
EstableceSoloLectura(cbAlmacenOrigen, True)
|
||||
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.CAMBIO_ALMACEN
|
||||
EstableceSoloLectura(cbAlmacenOrigen, False)
|
||||
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.SUBALQUILER
|
||||
ra.idAlmacenOrigen = Nothing
|
||||
EstableceSoloLectura(cbAlmacenOrigen, True)
|
||||
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.DEVOLUCION_SUBALQUILER
|
||||
EstableceSoloLectura(cbAlmacenOrigen, False)
|
||||
ra.idAlmacenDestino = Nothing
|
||||
EstableceSoloLectura(cbAlmacenDestino, True)
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.ENTREGA
|
||||
EstableceSoloLectura(cbAlmacenOrigen, False)
|
||||
ra.idAlmacenDestino = Nothing
|
||||
EstableceSoloLectura(cbAlmacenDestino, True)
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.RECOGIDA
|
||||
ra.idAlmacenOrigen = Nothing
|
||||
EstableceSoloLectura(cbAlmacenOrigen, True)
|
||||
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.STOCK_INICIAL_O_FABRICACION
|
||||
ra.idAlmacenOrigen = Nothing
|
||||
EstableceSoloLectura(cbAlmacenOrigen, True)
|
||||
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||
End Select
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub hlVale_Click(sender As Object, e As RoutedEventArgs)
|
||||
'Dim uc As New ucPresupuesto(ra.idPresupuesto)
|
||||
'FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||
End Sub
|
||||
|
||||
'Private Sub hlPresupuesto_Click(sender As Object, e As RoutedEventArgs)
|
||||
' If ra.idPresupuesto.HasValue Then
|
||||
' Dim uc As New ucPresupuesto(ra.idPresupuesto)
|
||||
' FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Private Sub beContrato_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
|
||||
'Dim dxw As New dxwAsignarContrato(bd, ra.idEntidad)
|
||||
'If dxw.ShowDialog Then
|
||||
' Dim ctr = bd.presupuestos.First(Function(x) x.idPresupuesto = dxw.idPresupuesto)
|
||||
' ra.idPresupuestoNavigation = ctr
|
||||
' If ra.idEntidad.HasValue = False Then
|
||||
' ra.idEntidadNavigation = ctr.idClienteNavigation
|
||||
' ra.idEntidad = ctr.idCliente
|
||||
' End If
|
||||
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub ucAlbaran_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
|
||||
Select Case DirectCast(ra.Tipo, bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum)
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.COMPRA
|
||||
For Each d In ra.detallesalbaranes.Where(Function(x) x.EsVenta)
|
||||
d.EsVenta = False
|
||||
Next
|
||||
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.CAMBIO_ALMACEN
|
||||
If ra.idAlmacenOrigen.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_ORIGEN_OBLIGATORIO", "El almacén origen es obligatorio")
|
||||
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.SUBALQUILER
|
||||
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.DEVOLUCION_SUBALQUILER
|
||||
If ra.idAlmacenOrigen.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_ORIGEN_OBLIGATORIO", "El almacén origen es obligatorio")
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.ENTREGA
|
||||
If ra.idAlmacenOrigen.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_ORIGEN_OBLIGATORIO", "El almacén origen es obligatorio")
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.RECOGIDA
|
||||
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.STOCK_INICIAL_O_FABRICACION
|
||||
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||
End Select
|
||||
If hte.Count > 0 Then
|
||||
MensajesError = hte
|
||||
Cancelar = True
|
||||
Else
|
||||
ra.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
|
||||
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
|
||||
|
||||
Select Case Estado
|
||||
Case tsUtilidades.EstadosAplicacion.Nuevo
|
||||
For Each d In ra.detallesalbaranes
|
||||
d.idAlbaranNavigation = ra
|
||||
d.ActualizaProducto(bdtmp, 1)
|
||||
Next
|
||||
Case tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
Dim das = bdtmp.detallesalbaranes.Where(Function(x) x.idAlbaran = ra.idAlbaran).ToList
|
||||
For Each d In das
|
||||
d.ActualizaProducto(bdtmp, -1)
|
||||
Next
|
||||
For Each d In ra.detallesalbaranes
|
||||
d.ActualizaProducto(bdtmp, 1)
|
||||
Next
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ucAlbaran_AntesEliminar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, ByRef OmitirPreguntaContinuar As Boolean) Handles Me.AntesEliminar
|
||||
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
|
||||
Dim das = bdtmp.detallesalbaranes.Where(Function(x) x.idAlbaran = ra.idAlbaran).ToList
|
||||
For Each d In das
|
||||
d.ActualizaProducto(bdtmp, -1)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub btIrAContrato_Click(sender As Object, e As RoutedEventArgs)
|
||||
If ra.idPresupuesto.HasValue Then
|
||||
'Dim uc As New ucPresupuesto(ra.idPresupuesto)
|
||||
'FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btQuitarContrato_Click(sender As Object, e As RoutedEventArgs)
|
||||
ra.idPresupuesto = Nothing
|
||||
ra.idPresupuestoNavigation = Nothing
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
98
GestionGrupoSanchoToro/Almacen/ucAlbaranes.xaml
Normal file
98
GestionGrupoSanchoToro/Almacen/ucAlbaranes.xaml
Normal file
@@ -0,0 +1,98 @@
|
||||
<tsWPFCore:tsUserControl
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" x:Class="ucAlbaranes"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="768" d:DesignWidth="1366">
|
||||
<tsWPFCore:tsUserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</tsWPFCore:tsUserControl.Resources>
|
||||
<Grid>
|
||||
<dxlc:LayoutControl Orientation="Vertical">
|
||||
<dxlc:LayoutGroup View="GroupBox" Header="Búsqueda Rápida" Orientation="Vertical" x:Name="BusquedaRapida">
|
||||
<dxlc:LayoutGroup Width="1100" HorizontalAlignment="Left" >
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup >
|
||||
<tsWPFCore:tsLayoutItem Label="Fecha Inicio:" Width="250" >
|
||||
<dxe:DateEdit x:Name="teFechaInicio" TabIndex="4" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="Fecha Fin:" Width="200" >
|
||||
<dxe:DateEdit x:Name="teFechaFin" TabIndex="5" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="Tipos Albaranes" >
|
||||
<dxe:ComboBoxEdit ValueMember="Valor" DisplayMember="Descripcion" x:Name="cbTipos" TabIndex="3" >
|
||||
<dxe:ComboBoxEdit.StyleSettings>
|
||||
<dxe:CheckedComboBoxStyleSettings />
|
||||
</dxe:ComboBoxEdit.StyleSettings>
|
||||
</dxe:ComboBoxEdit>
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<tsWPFCore:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
|
||||
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" FontWeight="Normal" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutItem Label="Campos de búsqueda:">
|
||||
<Border BorderThickness="1" BorderBrush="Black" >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Razón Social, NIF, Nº Albarán, Observaciones"/>
|
||||
<TextBlock Margin="20,0,0,0" Text="(En Blanco Muestra Todos)" FontWeight="Bold" ></TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</dxlc:LayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<tsWPFCore:tsGridControl x:Name="gc" TabIndex="1" >
|
||||
<tsWPFCore:tsGridControl.PropiedadesTS>
|
||||
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
|
||||
</tsWPFCore:tsGridControl.PropiedadesTS>
|
||||
<tsWPFCore:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPFCore:PropiedadesTSGC />
|
||||
</tsWPFCore:tsGridControl.PropiedadesTSGC>
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn FieldName="NumeroAlbaran" Width="150" IsSmart="True" Header="Nº Albarán" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<dxg:GridColumn FieldName="DescripcionTipoAlbaran" Width="250" IsSmart="True" Header="Tipo" />
|
||||
<dxg:GridColumn FieldName="RazonSocial" Header="Razón Social" Width="300" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<dxg:GridColumn FieldName="NIF" Header="N.I.F." Width="100" IsSmart="True" />
|
||||
<dxg:GridColumn FieldName="Fecha" Header="Fecha" IsSmart="True" Width="90" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="DescripcionEvento" Header="Evento" Width="400" IsSmart="True" />
|
||||
<dxg:GridColumn FieldName="Usuario" Header="Usuario" Width="250" IsSmart="True" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView x:Name="tv" ShowSearchPanelMode="Always" ShowGroupPanel="True" ShowTotalSummary="True">
|
||||
<dxg:TableView.FormatConditions>
|
||||
<dxg:FormatCondition Expression="[Tipo]==2" FieldName="{x:Null}">
|
||||
<dxg:Format Foreground="Green" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="[Tipo]==3 OrElse [Tipo]==4" FieldName="{x:Null}">
|
||||
<dxg:Format Foreground="DarkOrange" />
|
||||
</dxg:FormatCondition>
|
||||
<dxg:FormatCondition Expression="[Tipo]>99" FieldName="{x:Null}">
|
||||
<dxg:Format Foreground="Blue" />
|
||||
</dxg:FormatCondition>
|
||||
|
||||
</dxg:TableView.FormatConditions>
|
||||
</dxg:TableView>
|
||||
</dxg:GridControl.View>
|
||||
<tsWPFCore:tsGridControl.GroupSummary>
|
||||
<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº Albaranes: {0:n0}" />
|
||||
</tsWPFCore:tsGridControl.GroupSummary>
|
||||
<tsWPFCore:tsGridControl.TotalSummary>
|
||||
<dxg:GridSummaryItem SummaryType="Count" ShowInColumn="Cliente" DisplayFormat="Nº Albaranes: {0:n0}" />
|
||||
</tsWPFCore:tsGridControl.TotalSummary>
|
||||
</tsWPFCore:tsGridControl>
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPFCore:tsUserControl>
|
||||
208
GestionGrupoSanchoToro/Almacen/ucAlbaranes.xaml.vb
Normal file
208
GestionGrupoSanchoToro/Almacen/ucAlbaranes.xaml.vb
Normal file
@@ -0,0 +1,208 @@
|
||||
|
||||
Imports bdGrupoSanchoToro.db
|
||||
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.tscGrupoSanchoToro
|
||||
Imports tsUtilidades
|
||||
'Imports tsUtilidades.Extensiones
|
||||
|
||||
Public Class ucAlbaranes
|
||||
|
||||
Private bd As tscGrupoSanchoToro
|
||||
Private _CamposBusquedaNumericos() As String = {"idAlbaran"}
|
||||
Private _CamposBusquedaAlfabeticos() As String = {"RazonSocial", "NIF"}
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub New()
|
||||
|
||||
' Esta llamada es exigida por el diseñador.
|
||||
InitializeComponent()
|
||||
' Me.BusquedaRapida.Visibility = Visibility.Collapsed
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
ContenedorAplicacion.btGuardar.IsVisible = False
|
||||
ContenedorAplicacion.siEstado.IsVisible = False
|
||||
GridBusqueda = Me.gc
|
||||
'Dim Hoy = Date.Today
|
||||
'teFechaFin.EditValue = Hoy
|
||||
'teFechaInicio.EditValue = New Date(Hoy.Year, 1, 1)
|
||||
End Sub
|
||||
|
||||
|
||||
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||
Try
|
||||
If cbTipos.ItemsSource Is Nothing Then
|
||||
Dim tipos = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum))
|
||||
cbTipos.ItemsSource = tipos
|
||||
cbTipos.EditValue = tipos.Cast(Of DescripcionValor).Select(Function(x) x.Valor).ToList
|
||||
End If
|
||||
If Background OrElse Refrescar Then ObtieneAlbaranesAsync(bd, Background)
|
||||
Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
Me.docpanel.Caption = "Albaranes"
|
||||
End Sub
|
||||
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
Return "Albaranes"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||
Get
|
||||
Return "albaranes"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Albaranes"
|
||||
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 ucAlbaran, OtrosParametros)
|
||||
End Sub
|
||||
|
||||
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
Dim ra = DirectCast(Me.gc.CurrentItem, v_albaranesextendidos)
|
||||
If Defecto Then
|
||||
Dim id As Integer = ra.idAlbaran
|
||||
FuncionesDinamicas.AbrirAP(New ucAlbaran(id), OtrosParametros)
|
||||
Else
|
||||
Select Case Celda.Column.FieldName.ToLower
|
||||
Case "numeroalbaran"
|
||||
Dim id As Integer = ra.idAlbaran
|
||||
FuncionesDinamicas.AbrirAP(New ucAlbaran(id), OtrosParametros)
|
||||
Case "razonsocial"
|
||||
Dim id As Integer = ra.idEntidad
|
||||
FuncionesDinamicas.AbrirAP(New ucEntidad(id), OtrosParametros)
|
||||
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function ObtieneAlbaranes(TextoBusqueda As String, FechaInicio As DateOnly?, FechaFin As DateOnly?, Tipos As List(Of Integer)) As List(Of v_albaranesextendidos)
|
||||
Dim rs As IQueryable(Of v_albaranesextendidos)
|
||||
Dim la As New List(Of v_albaranesextendidos)
|
||||
Dim iNumExc As Integer = 0
|
||||
Do
|
||||
Try
|
||||
If TextoBusqueda <> "" Then
|
||||
Dim parametros(0) As Object
|
||||
Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Me._CamposBusquedaNumericos, Me._CamposBusquedaAlfabeticos, Nothing)
|
||||
rs = bd.v_albaranesextendidos.Where(ExpresionBusqueda)
|
||||
Else
|
||||
rs = bd.v_albaranesextendidos.AsQueryable
|
||||
End If
|
||||
|
||||
If FechaInicio.HasValue Then
|
||||
rs = rs.Where(Function(x) x.Fecha >= FechaInicio.Value)
|
||||
End If
|
||||
If FechaFin.HasValue Then
|
||||
FechaFin = FechaFin.Value.AddDays(1)
|
||||
rs = rs.Where(Function(x) x.Fecha < FechaFin.Value)
|
||||
End If
|
||||
la = rs.Where(Function(x) Tipos.Contains(x.Tipo)).OrderByDescending(Function(x) x.Fecha).ToList
|
||||
Exit Do
|
||||
Catch ex As Exception
|
||||
iNumExc += 1
|
||||
If iNumExc > 3 Then
|
||||
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||
|
||||
rs = Nothing
|
||||
Exit Do
|
||||
End If
|
||||
End Try
|
||||
Loop
|
||||
Return la
|
||||
End Function
|
||||
|
||||
Public Async Sub ObtieneAlbaranesAsync(bd As tscGrupoSanchoToro, Background As Boolean)
|
||||
Try
|
||||
Dim rs As New List(Of v_albaranesextendidos)
|
||||
Dim Busqueda = tsEFCore8.Extensiones.ObjetoNothingAVacio(Me.teBusqueda.EditValue)
|
||||
Dim fi As DateOnly? : If teFechaInicio.EditValue IsNot Nothing Then fi = DateOnly.FromDateTime(teFechaInicio.EditValue)
|
||||
Dim ff As DateOnly? : If teFechaFin.EditValue IsNot Nothing Then ff = DateOnly.FromDateTime(teFechaFin.EditValue)
|
||||
Dim Tipos = cbTipos.SelectedItems.Cast(Of DescripcionValor).Select(Function(x) x.Valor).ToList
|
||||
If Background Then
|
||||
Me.ContenedorAplicacion.IsEnabled = False
|
||||
Await Task.Run(Sub()
|
||||
rs = ObtieneAlbaranes(Busqueda, fi, ff, Tipos)
|
||||
End Sub)
|
||||
Else
|
||||
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
||||
DXSplashScreen.SetState("Buscando Albaranes de Entrega ...")
|
||||
rs = ObtieneAlbaranes(Busqueda, fi, ff, Tipos)
|
||||
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)
|
||||
ObtieneAlbaranesAsync(bd, False)
|
||||
End Sub
|
||||
|
||||
Private Sub ucAlbaranes_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
teBusqueda.SelectAll()
|
||||
End Sub
|
||||
|
||||
Private Sub cbIncluirTodos_Checked(sender As Object, e As RoutedEventArgs)
|
||||
Dim Hoy = Date.Today
|
||||
If teFechaFin.EditValue Is Nothing Then teFechaFin.EditValue = Hoy
|
||||
If teFechaInicio.EditValue Is Nothing Then teFechaInicio.EditValue = New Date(Hoy.Year, 1, 1)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
'Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles ImprimirPlantilla
|
||||
' Dim ds As List(Of Albaranes)
|
||||
' Dim pl As plantillas = (From p In bd.plantillas Where p.idPlantilla = idPlantilla).First
|
||||
' Dim sTipo As String = pl.enumeraciones.Codigo
|
||||
' Dim al As Albaranes = Me.DataContext
|
||||
' ds = New List(Of Albaranes)
|
||||
' ds.Add(al)
|
||||
' Select Case sTipo
|
||||
' Case "GRUPLA.AV-ALBARANES"
|
||||
' Informes.ImprimirPlantilla(bd, idPlantilla, ds, False)
|
||||
' End Select
|
||||
'End Sub
|
||||
End Class
|
||||
@@ -414,7 +414,7 @@ Public Class ucFacturaRecibida
|
||||
|
||||
|
||||
|
||||
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
||||
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||
Imprimir(idPlantilla, False, 1)
|
||||
End Sub
|
||||
Private Sub Imprimir(idPlantilla As Integer, ImpresoraDefecto As Boolean, Copias As Integer)
|
||||
|
||||
@@ -39,12 +39,12 @@ Public Class ucProducto
|
||||
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
|
||||
'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
|
||||
@@ -56,7 +56,7 @@ Public Class ucProducto
|
||||
' 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
|
||||
If ra.Servicio Then
|
||||
Me.gcStocksAlmacenes.ItemsSource = ObtieneISAlmacenes()
|
||||
Else
|
||||
Me.gcStocksAlmacenes.ItemsSource = Nothing
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<PackageReference Include="System.ServiceModel.Federation" Version="8.1.0" />
|
||||
<PackageReference Include="TSpdf.commons" Version="1.0.1" />
|
||||
<PackageReference Include="TSpdfUtils" Version="1.0.15" />
|
||||
<PackageReference Include="tsWPFCore" Version="1.3.1" />
|
||||
<PackageReference Include="tsWPFCore" Version="1.3.9" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -506,7 +506,7 @@ Public Class ucFacturaEmitida
|
||||
|
||||
|
||||
|
||||
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
||||
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||
Imprimir(idPlantilla, False, 1)
|
||||
End Sub
|
||||
Private Sub Imprimir(idPlantilla As Integer, ImpresoraDefecto As Boolean, Copias As Integer)
|
||||
|
||||
@@ -375,7 +375,7 @@ Public Class ucConciliacionBancaria
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ucConciliacionBancaria_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
||||
Private Sub ucConciliacionBancaria_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||
'Try
|
||||
' Dim pl = bd.plantillas.First(Function(x) x.idPlantilla = idPlantilla)
|
||||
' Select Case pl.Codigo
|
||||
|
||||
@@ -205,7 +205,7 @@ Public Class ucMovimientoCaja
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ucMovimientoCaja_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
||||
Private Sub ucMovimientoCaja_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||
Dim rec As movimientoscaja = Me.DataContext
|
||||
|
||||
Select Case DirectCast(rec.Tipo, TipoMovimientoEnum)
|
||||
|
||||
Reference in New Issue
Block a user