Agregar archivos de proyecto.
This commit is contained in:
879
GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml
Normal file
879
GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml
Normal file
@@ -0,0 +1,879 @@
|
||||
<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:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
|
||||
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
|
||||
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucFacturaEmitida"
|
||||
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1400">
|
||||
<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>
|
||||
<dxre:RichEditUICommand x:Key="commands"/>
|
||||
<dxre:RichEditStringIdConverter x:Key="stringIdConverter"/>
|
||||
<dxre:DefaultBarItemDataTemplates x:Key="defaultBarItemTemplates"/>
|
||||
<dxre:RtfToContentConverter x:Key="rtfToContentConverter" />
|
||||
</ResourceDictionary>
|
||||
</tsWPF:tsUserControl.Resources>
|
||||
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
|
||||
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Header="Datos De la Factura" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Orientation="Horizontal" Width="1280" HorizontalAlignment="Left">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="740">
|
||||
<dxlc:LayoutGroup Orientation="Horizontal">
|
||||
<tsWPF:tsLayoutItem Label="Serie:" Width="300">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" Modificable="ModificableEnNuevos" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbSerie" AutoComplete="True" ValidateOnTextInput="False" IsTextEditable="True" DisplayMember="Descripcion" ValueMember="idSerieFactura" EditValue="{Binding idSerieFactura_Nulable, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="1" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Nº Factura:" Width="200" x:Name="liNumeroFactura" >
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding NumeroFactura, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="100" NullText="« AUTOMÁTICO »" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Fecha Factura:" x:Name="liFechaFactura">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaFactura, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true, Converter={StaticResource DateOnlyToDateTimeConverter}}" TabIndex="3" >
|
||||
</dxe:DateEdit>
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<tsWPF:tsLayoutItem Label="Razón Social:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Obligatorio="True" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:ComboBoxEdit x:Name="cbRazonSocial" AutoComplete="True" ValidateOnTextInput="False" IsTextEditable="True" DisplayMember="RazonSocialNIF" ValueMember="idEntidad" EditValue="{Binding idCliente_Nulable, 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>
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Observaciones:">
|
||||
<dxe:TextEdit EditValue="{Binding Observaciones, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="6" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Horizontal">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Orientation="Horizontal">
|
||||
<tsWPF:tsLayoutItem Label="Fecha Emision:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaEmision, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="3" DisplayFormatString="dd/MM/yyyy HH:mm" >
|
||||
</dxe:DateEdit>
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Fecha Pago:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:DateEdit EditValue="{Binding FechaPago, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="5" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
<tsWPF:tsLayoutItem Label="Usuario:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding idUsuarioNavigation.Nombre, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="200" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Observaciones A Imprimir:" TabIndex="4">
|
||||
<dxe:TextEdit EditValue="{Binding ObservacionesAImprimir, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="7" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Header="Datos del Cliente" View="GroupBox" Width="Auto" HorizontalAlignment="Stretch" IsCollapsible="True" IsCollapsed="False">
|
||||
<dxlc:LayoutGroup Width="1280">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="415">
|
||||
<tsWPF:tsLayoutItem Label="Direccion:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding Direccion, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" x:Name="teDireccionCliente" TabIndex="8" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<dxlc:LayoutGroup>
|
||||
<tsWPF:tsLayoutItem Label="Teléfono 1:" Width="215">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" MayusculasMinusculas="Normal" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding idClienteNavigation.Telefono1, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" x:Name="teTelefono1Cliente" TabIndex="12" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Teléfono 2:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding idClienteNavigation.Telefono2, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" x:Name="teTelefono2Cliente" TabIndex="13" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
<tsWPF:tsLayoutItem Label="Código Postal:" Width="190">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding CodigoPostal, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="9" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Población:" x:Name="Poblacion" Width="318">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding CodigoMunicipioNavigation.Nombre , Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="10" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Provincia:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding CodigoMunicipioNavigation.CodigoProvinciaNavigation.Nombre, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="11" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<tsWPF:tsLayoutItem Label="Email:" Width="512" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" MayusculasMinusculas="Normal" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit EditValue="{Binding idClienteNavigation.Email, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" x:Name="teEmailCliente" TabIndex="14" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
<dx:DXTabControl x:Name="DXTabPersonal1" Width="Auto" HorizontalAlignment="Stretch">
|
||||
<dx:DXTabControl.View>
|
||||
<dx:TabControlScrollView />
|
||||
</dx:DXTabControl.View>
|
||||
<dx:DXTabItem Header="Detalle Factura">
|
||||
<dxdo:DockLayoutManager Name="DockLayoutManager1" MDIMergeStyle="Never" Grid.Row="0" >
|
||||
<dxdo:DockLayoutManager.LayoutRoot>
|
||||
<dxdo:LayoutGroup Tag="lg1" Orientation="Horizontal" >
|
||||
<dxdo:LayoutGroup Orientation="Vertical" Tag="lg2" >
|
||||
<dxdo:LayoutPanel AllowClose="False" AllowHide="false" Caption="Desglose" >
|
||||
<tsWPF:tsGridControl x:Name="gcDetalle" TabIndex="15">
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:PropiedadesTSGC PermitirEliminar="True" CamposObligatorios="idProducto" />
|
||||
</tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
|
||||
|
||||
<tsWPF:tsGridControl.View>
|
||||
<tsWPF:tsTableView x:Name="tvDetalle" ShowGroupPanel="False" NewItemRowPosition="Bottom" TabIndex="14" EnableImmediatePosting="True" >
|
||||
</tsWPF:tsTableView>
|
||||
</tsWPF:tsGridControl.View>
|
||||
|
||||
<dxg:GridColumn FieldName="idProducto" Header="Producto" Width="320">
|
||||
<dxg:GridColumn.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>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<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="Precio" IsSmart="True" Width="70">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="Importe" IsSmart="True" Width="80" SoloLectura="True">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="idTipoIVA" Header="% IVA" IsSmart="True" Width="80" >
|
||||
<tsWPF:tsGridColumn.EditSettings>
|
||||
<dxe:ComboBoxEditSettings x:Name="cbIva" ValueMember="idEnumeracion" DisplayMember="Descripcion" AllowDefaultButton="False" AutoComplete="True" />
|
||||
</tsWPF:tsGridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
</tsWPF:tsGridControl>
|
||||
</dxdo:LayoutPanel>
|
||||
|
||||
</dxdo:LayoutGroup>
|
||||
<dxdo:LayoutPanel Caption="Más Detalle del Producto" AllowHide="True" AllowDock="True" AllowClose="False" AllowContextMenu="False" AllowDockToCurrentItem="False" AllowDockToDocumentGroup="False" AllowFloat="False" AllowDrag="False" AllowDrop="False" AllowMaximize="False" AllowMinimize="False" AllowMove="False" dxlc:LayoutControl.AllowHorizontalSizing="True">
|
||||
<dxlc:LayoutGroup ItemLabelsAlignment="Default" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||
|
||||
<dxb:BarManager x:Name="BarManager1" ToolbarGlyphSize="Small" >
|
||||
<dxb:BarManager.Items>
|
||||
<dxb:BarButtonItem x:Name="biFileOpen" Command="{Binding FileOpen, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<!--<dxb:BarButtonItem x:Name="biFileSave" Command="{Binding FileSave, Mode=OneTime, Source={StaticResource commands}}"/>-->
|
||||
<dxb:BarButtonItem x:Name="biFileSaveAs" Command="{Binding FileSaveAs, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFileQuickPrint" Command="{Binding FileQuickPrint, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFilePrint" Command="{Binding FilePrint, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFilePrintPreview" Command="{Binding FilePrintPreview, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditUndo" Command="{Binding EditUndo, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditRedo" Command="{Binding EditRedo, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertPageBreak" Command="{Binding InsertPageBreak, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertTable" Command="{Binding InsertTable, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertPicture" Command="{Binding InsertPicture, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertFloatingPicture" Command="{Binding InsertFloatingPicture, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertBookmark" Command="{Binding InsertBookmark, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertHyperlink" Command="{Binding InsertHyperlink, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertHeader" Command="{Binding InsertHeader, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertFooter" Command="{Binding InsertFooter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertPageNumber" Command="{Binding InsertPageNumber, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertPageCount" Command="{Binding InsertPageCount, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertTextBox" Command="{Binding InsertTextBox, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertSymbol" Command="{Binding InsertSymbol, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarSubItem x:Name="biPageLayoutMargins" Command="{Binding PageLayoutMargins, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxb:BarSubItem.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutNormalMargins"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutNarrowMargins"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutModerateMargins"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutWideMargins"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biPageLayoutPageMarginsOptions"/>
|
||||
</dxb:BarSubItem.ItemLinks>
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutNormalMargins" GlyphSize="Large" Command="{Binding PageLayoutNormalMargins, Mode=OneTime, Source={StaticResource commands}}" ContentTemplate="{Binding SectionMarginBarItemContentTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutNarrowMargins" GlyphSize="Large" Command="{Binding PageLayoutNarrowMargins, Mode=OneTime, Source={StaticResource commands}}" ContentTemplate="{Binding SectionMarginBarItemContentTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutModerateMargins" GlyphSize="Large" Command="{Binding PageLayoutModerateMargins, Mode=OneTime, Source={StaticResource commands}}" ContentTemplate="{Binding SectionMarginBarItemContentTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutWideMargins" GlyphSize="Large" Command="{Binding PageLayoutWideMargins, Mode=OneTime, Source={StaticResource commands}}" ContentTemplate="{Binding SectionMarginBarItemContentTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}"/>
|
||||
<dxb:BarButtonItem x:Name="biPageLayoutPageMarginsOptions" Command="{Binding PageLayoutPageMarginsOptions, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarSubItem x:Name="biPageLayoutOrientation" Command="{Binding PageLayoutOrientation, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxb:BarSubItem.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutPortraitOrientation"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutLandscapeOrientation"/>
|
||||
</dxb:BarSubItem.ItemLinks>
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutPortraitOrientation" Command="{Binding PageLayoutPortraitOrientation, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutLandscapeOrientation" Command="{Binding PageLayoutLandscapeOrientation, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarSubItem x:Name="biPageLayoutSize" Command="{Binding PageLayoutSize, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxb:BarSubItem.ItemLinks>
|
||||
<dxre:PaperKindBarListItemLink BarItemName="biPageLayoutSizeList"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biPageLayoutPagePaperOptions"/>
|
||||
</dxb:BarSubItem.ItemLinks>
|
||||
</dxb:BarSubItem>
|
||||
<dxre:PaperKindBarListItem x:Name="biPageLayoutSizeList" RichEditControl="{Binding ElementName=recEditor}"/>
|
||||
<dxb:BarButtonItem x:Name="biPageLayoutPagePaperOptions" Command="{Binding PageLayoutPagePaperOptions, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarSubItem x:Name="biPageLayoutColumns" Command="{Binding PageLayoutColumns, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxb:BarSubItem.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutOneColumn"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutTwoColumns"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutThreeColumns"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biPageLayoutColumnsOptions"/>
|
||||
</dxb:BarSubItem.ItemLinks>
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutOneColumn" Command="{Binding PageLayoutOneColumn, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutTwoColumns" Command="{Binding PageLayoutTwoColumns, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutThreeColumns" Command="{Binding PageLayoutThreeColumns, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||
<dxb:BarButtonItem x:Name="biPageLayoutColumnsOptions" Command="{Binding PageLayoutColumnsOptions, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarSubItem x:Name="biInsertBreak" Command="{Binding InsertBreak, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxb:BarSubItem.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertPageBreak"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertColumnBreak"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertSectionBreakNextPage"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertSectionBreakContinuous"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertSectionBreakEvenPage"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertSectionBreakOddPage"/>
|
||||
</dxb:BarSubItem.ItemLinks>
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarButtonItem x:Name="biInsertColumnBreak" Command="{Binding InsertColumnBreak, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertSectionBreakNextPage" Command="{Binding InsertSectionBreakNextPage, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertSectionBreakContinuous" Command="{Binding InsertSectionBreakContinuous, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertSectionBreakEvenPage" Command="{Binding InsertSectionBreakEvenPage, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||
<dxb:BarButtonItem x:Name="biInsertSectionBreakOddPage" Command="{Binding InsertSectionBreakOddPage, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||
<dxb:BarSubItem x:Name="biPageLayoutLineNumbering" Command="{Binding PageLayoutLineNumbering, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxb:BarSubItem.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutLineNumberingNone"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutLineNumberingContinuous"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutLineNumberingRestartNewPage"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biPageLayoutLineNumberingRestartNewSection"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatParagraphSuppressLineNumbers"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biPageLayoutLineNumberingOptions"/>
|
||||
</dxb:BarSubItem.ItemLinks>
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutLineNumberingNone" Command="{Binding PageLayoutLineNumberingNone, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutLineNumberingContinuous" Command="{Binding PageLayoutLineNumberingContinuous, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutLineNumberingRestartNewPage" Command="{Binding PageLayoutLineNumberingRestartNewPage, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biPageLayoutLineNumberingRestartNewSection" Command="{Binding PageLayoutLineNumberingRestartNewSection, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatParagraphSuppressLineNumbers" Command="{Binding FormatParagraphSuppressLineNumbers, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biPageLayoutLineNumberingOptions" Command="{Binding PageLayoutLineNumberingOptions, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxre:BarButtonColorEditItem x:Name="biPageLayoutPageColor" Command="{Binding PageLayoutPageColor, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxre:BarButtonColorEditItem.PopupControl>
|
||||
<dxb:PopupControlContainerInfo>
|
||||
<dxe:ColorEdit EditValue="{Binding EditValue, ElementName=biPageLayoutPageColor, Mode=TwoWay}" ShowBorder="False"/>
|
||||
</dxb:PopupControlContainerInfo>
|
||||
</dxre:BarButtonColorEditItem.PopupControl>
|
||||
</dxre:BarButtonColorEditItem>
|
||||
<dxb:BarCheckItem x:Name="biViewDraft" Command="{Binding ViewDraft, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biViewPrintLayout" Command="{Binding ViewPrintLayout, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biViewSimple" Command="{Binding ViewSimple, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biViewHorizontalRuler" Command="{Binding ViewHorizontalRuler, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biViewVerticalRuler" Command="{Binding ViewVerticalRuler, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biViewZoomOut" Command="{Binding ViewZoomOut, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biViewZoomIn" Command="{Binding ViewZoomIn, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biGoToHeader" Command="{Binding GoToHeader, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biGoToFooter" Command="{Binding GoToFooter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biHeaderFooterGoToPrevious" Command="{Binding HeaderFooterGoToPrevious, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biHeaderFooterGoToNext" Command="{Binding HeaderFooterGoToNext, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biHeaderFooterLinkToPrevious" Command="{Binding HeaderFooterLinkToPrevious, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biHeaderFooterDifferentFirstPage" Command="{Binding HeaderFooterDifferentFirstPage, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biHeaderFooterDifferentOddEvenPages" Command="{Binding HeaderFooterDifferentOddEvenPages, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biHeaderFooterClose" Command="{Binding HeaderFooterClose, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditPaste" Command="{Binding EditPaste, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditCut" Command="{Binding EditCut, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditCopy" Command="{Binding EditCopy, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditPasteSpecial" Command="{Binding EditPasteSpecial, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxr:BarButtonGroup x:Name="biFont">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarEditItemLink BarItemName="biFormatFontName"/>
|
||||
<dxb:BarEditItemLink BarItemName="biFormatFontSize"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarEditItem x:Name="biFormatFontName" Content="" Command="{Binding FormatFontName, Mode=OneTime, Source={StaticResource commands}}" EditWidth="150">
|
||||
<dxb:BarEditItem.EditSettings>
|
||||
<dxre:FontComboBoxEditSettings/>
|
||||
</dxb:BarEditItem.EditSettings>
|
||||
</dxb:BarEditItem>
|
||||
<dxb:BarEditItem x:Name="biFormatFontSize" Content="" Command="{Binding FormatFontSize, Mode=OneTime, Source={StaticResource commands}}" EditWidth="50">
|
||||
<dxb:BarEditItem.EditSettings>
|
||||
<dxre:FontSizeComboBoxEditSettings OfficeFontSizeProvider="{Binding ElementName=recEditor}"/>
|
||||
</dxb:BarEditItem.EditSettings>
|
||||
</dxb:BarEditItem>
|
||||
<dxr:BarButtonGroup x:Name="biFontSize">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatIncreaseFontSize"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatDecreaseFontSize"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarButtonItem x:Name="biFormatIncreaseFontSize" Command="{Binding FormatIncreaseFontSize, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFormatDecreaseFontSize" Command="{Binding FormatDecreaseFontSize, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxr:BarButtonGroup x:Name="biClearFormatting">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatClearFormatting"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarButtonItem x:Name="biFormatClearFormatting" Command="{Binding FormatClearFormatting, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxr:BarButtonGroup x:Name="biFontShape">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatFontBold"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatFontItalic"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatFontUnderline"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatFontDoubleUnderline"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatFontStrikeout"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatFontDoubleStrikeout"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatFontSuperscript"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatFontSubscript"/>
|
||||
<dxb:BarSubItemLink BarItemName="biEditChangeCase"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarCheckItem x:Name="biFormatFontBold" Command="{Binding FormatFontBold, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatFontItalic" Command="{Binding FormatFontItalic, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatFontUnderline" Command="{Binding FormatFontUnderline, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatFontDoubleUnderline" Command="{Binding FormatFontDoubleUnderline, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatFontStrikeout" Command="{Binding FormatFontStrikeout, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatFontDoubleStrikeout" Command="{Binding FormatFontDoubleStrikeout, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatFontSuperscript" Command="{Binding FormatFontSuperscript, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatFontSubscript" Command="{Binding FormatFontSubscript, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarSubItem x:Name="biEditChangeCase" Command="{Binding EditChangeCase, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxb:BarSubItem.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditMakeUpperCase"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditMakeLowerCase"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditToggleCase"/>
|
||||
</dxb:BarSubItem.ItemLinks>
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarButtonItem x:Name="biEditMakeUpperCase" Command="{Binding EditMakeUpperCase, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditMakeLowerCase" Command="{Binding EditMakeLowerCase, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditToggleCase" Command="{Binding EditToggleCase, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxr:BarButtonGroup x:Name="biFontColor">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatFontBackColor"/>
|
||||
<dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatFontForeColor"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxre:BarSplitButtonColorEditItem x:Name="biFormatFontBackColor" Command="{Binding FormatFontBackColor, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||
<dxb:PopupControlContainerInfo>
|
||||
<dxe:ColorEdit ChipSize="Large" ChipMargin="5" ColumnCount="5" EditValue="{Binding EditValue, ElementName=biFormatFontBackColor, Mode=TwoWay}" ShowMoreColorsButton="False" ShowDefaultColorButton="False" ShowNoColorButton="True" ShowBorder="False">
|
||||
<dxe:ColorEdit.Palettes>
|
||||
<dxre:CharactersBackgroundColorPaletteCollection/>
|
||||
</dxe:ColorEdit.Palettes>
|
||||
</dxe:ColorEdit>
|
||||
</dxb:PopupControlContainerInfo>
|
||||
</dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||
</dxre:BarSplitButtonColorEditItem>
|
||||
<dxre:BarSplitButtonColorEditItem x:Name="biFormatFontForeColor" Command="{Binding FormatFontForeColor, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||
<dxb:PopupControlContainerInfo>
|
||||
<dxe:ColorEdit EditValue="{Binding EditValue, ElementName=biFormatFontForeColor, Mode=TwoWay}" ShowBorder="False"/>
|
||||
</dxb:PopupControlContainerInfo>
|
||||
</dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||
</dxre:BarSplitButtonColorEditItem>
|
||||
<dxr:BarButtonGroup x:Name="biNumberingList">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatBulletedList"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatNumberingList"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatMultilevelList"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarCheckItem x:Name="biFormatBulletedList" Command="{Binding FormatBulletedList, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatNumberingList" Command="{Binding FormatNumberingList, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatMultilevelList" Command="{Binding FormatMultilevelList, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxr:BarButtonGroup x:Name="biParagraphIndent">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatDecreaseIndent"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatIncreaseIndent"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarButtonItem x:Name="biFormatDecreaseIndent" Command="{Binding FormatDecreaseIndent, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFormatIncreaseIndent" Command="{Binding FormatIncreaseIndent, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxr:BarButtonGroup x:Name="biShowWhitespace">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biViewShowWhitespace"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarCheckItem x:Name="biViewShowWhitespace" Command="{Binding ViewShowWhitespace, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxr:BarButtonGroup x:Name="biParagraphAlignment">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignLeft"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignCenter"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignRight"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignJustify"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarCheckItem x:Name="biFormatParagraphAlignLeft" Command="{Binding FormatParagraphAlignLeft, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatParagraphAlignCenter" Command="{Binding FormatParagraphAlignCenter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatParagraphAlignRight" Command="{Binding FormatParagraphAlignRight, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatParagraphAlignJustify" Command="{Binding FormatParagraphAlignJustify, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxr:BarButtonGroup x:Name="biLineSpacing">
|
||||
<dxr:BarButtonGroup.ItemLinks>
|
||||
<dxb:BarSubItemLink BarItemName="biFormatParagraphLineSpacing"/>
|
||||
<dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatParagraphBackColor"/>
|
||||
</dxr:BarButtonGroup.ItemLinks>
|
||||
</dxr:BarButtonGroup>
|
||||
<dxb:BarSubItem x:Name="biFormatParagraphLineSpacing" Command="{Binding FormatParagraphLineSpacing, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxb:BarSubItem.ItemLinks>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingSingle"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingSesquialteral"/>
|
||||
<dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingDouble"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatParagraphLineSpacingCustomize"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatParagraphAddSpacingBefore"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatParagraphRemoveSpacingBefore"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatParagraphAddSpacingAfter"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biFormatParagraphRemoveSpacingAfter"/>
|
||||
</dxb:BarSubItem.ItemLinks>
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarCheckItem x:Name="biFormatParagraphLineSpacingSingle" Command="{Binding FormatParagraphLineSpacingSingle, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatParagraphLineSpacingSesquialteral" Command="{Binding FormatParagraphLineSpacingSesquialteral, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarCheckItem x:Name="biFormatParagraphLineSpacingDouble" Command="{Binding FormatParagraphLineSpacingDouble, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFormatParagraphLineSpacingCustomize" Command="{Binding FormatParagraphLineSpacingCustomize, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFormatParagraphAddSpacingBefore" Command="{Binding FormatParagraphAddSpacingBefore, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFormatParagraphRemoveSpacingBefore" Command="{Binding FormatParagraphRemoveSpacingBefore, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFormatParagraphAddSpacingAfter" Command="{Binding FormatParagraphAddSpacingAfter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biFormatParagraphRemoveSpacingAfter" Command="{Binding FormatParagraphRemoveSpacingAfter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxre:BarSplitButtonColorEditItem x:Name="biFormatParagraphBackColor" Command="{Binding FormatParagraphBackColor, Mode=OneTime, Source={StaticResource commands}}">
|
||||
<dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||
<dxb:PopupControlContainerInfo>
|
||||
<dxe:ColorEdit EditValue="{Binding EditValue, ElementName=biFormatParagraphBackColor, Mode=TwoWay}" ShowDefaultColorButton="False" ShowNoColorButton="True" ShowBorder="False"/>
|
||||
</dxb:PopupControlContainerInfo>
|
||||
</dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||
</dxre:BarSplitButtonColorEditItem>
|
||||
<dxr:BarButtonGroup x:Name="biParagraph"/>
|
||||
<dxre:GalleryStyleItem x:Name="biGalleryStyle" Command="{Binding FormatFontStyle, Mode=OneTime, Source={StaticResource commands}}" RichEditControl="{Binding ElementName=recEditor }">
|
||||
<dxre:GalleryStyleItem.Gallery>
|
||||
<dxre:RichEditStyleGallery ColCount="10" ItemCheckMode="Single" IsItemGlyphVisible="False" ItemCaptionTemplate="{Binding StyleGalleryItemCaptionTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}" IsItemDescriptionVisible="False" MinColCount="3"/>
|
||||
</dxre:GalleryStyleItem.Gallery>
|
||||
</dxre:GalleryStyleItem>
|
||||
<dxb:BarButtonItem x:Name="biEditFind" Command="{Binding EditFind, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biEditReplace" Command="{Binding EditReplace, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxre:InsertMergeFieldsBarSubItem x:Name="biMailMergeInsertFieldPlaceholder" Content="Insertar Campo Combinación" Command="{Binding MailMergeInsertFieldPlaceholder, Mode=OneTime, Source={StaticResource commands}}" RichEditControl="{Binding ElementName=recEditor}"/>
|
||||
<dxb:BarCheckItem x:Name="biMailMergeViewMergedData" Command="{Binding MailMergeViewMergedData, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biMailMergeShowAllFieldCodes" Command="{Binding MailMergeShowAllFieldCodes, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biMailMergeShowAllFieldResults" Command="{Binding MailMergeShowAllFieldResults, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biMailMergeFirstDataRecord" Command="{Binding MailMergeFirstDataRecord, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biMailMergePreviousDataRecord" Command="{Binding MailMergePreviousDataRecord, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biMailMergeNextDataRecord" Command="{Binding MailMergeNextDataRecord, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biMailMergeLastDataRecord" Command="{Binding MailMergeLastDataRecord, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
<dxb:BarButtonItem x:Name="biMailMergeSaveDocumentAs" Command="{Binding MailMergeSaveDocumentAs, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||
</dxb:BarManager.Items>
|
||||
<DockPanel>
|
||||
<dxr:RibbonControl x:Name="RibbonControl1" DockPanel.Dock="Top" ToolbarShowMode="Hide" ShowApplicationButton="False" MinimizationButtonVisibility="Visible " MinimizationButtonPosition="PageHeader" IsMinimized="False" PageCategoryAlignment="Left" RibbonStyle="OfficeSlim" >
|
||||
<dxr:RibbonDefaultPageCategory>
|
||||
|
||||
<dxr:RibbonPage x:Name="pageHome" Caption="{Binding ConverterParameter=Caption_PageHome, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||
<dxr:RibbonPageGroup x:Name="grpHomeClipboard" Caption="{Binding ConverterParameter=Caption_GroupClipboard, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditPaste"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditCut"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditCopy"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditPasteSpecial"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpHomeFont" CaptionButtonCommand="{Binding FormatFont, Mode=OneTime, Source={StaticResource commands}}" Caption="{Binding ConverterParameter=Caption_GroupFont, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxr:BarButtonGroupLink BarItemName="biFont"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biFontSize"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biClearFormatting"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biFontShape"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biFontColor"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpHomeParagraph" CaptionButtonCommand="{Binding FormatParagraph, Mode=OneTime, Source={StaticResource commands}}" Caption="{Binding ConverterParameter=Caption_GroupParagraph, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxr:BarButtonGroupLink BarItemName="biNumberingList"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biParagraphIndent"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biShowWhitespace"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biParagraphAlignment"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biLineSpacing"/>
|
||||
<dxr:BarButtonGroupLink BarItemName="biParagraph"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpHomeStyles" CaptionButtonCommand="{Binding FormatEditFontStyle, Mode=OneTime, Source={StaticResource commands}}" Caption="{Binding ConverterParameter=Caption_GroupStyles, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxre:RibbonStyleGalleryItemLink BarItemName="biGalleryStyle"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpHomeEditing" Caption="{Binding ConverterParameter=Caption_GroupEditing, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditFind"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biEditReplace"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
</dxr:RibbonPage>
|
||||
<dxr:RibbonPage x:Name="pageInsert" Caption="{Binding ConverterParameter=Caption_PageInsert, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||
<dxr:RibbonPageGroup x:Name="grpInsertPages" Caption="{Binding ConverterParameter=Caption_GroupPages, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertPageBreak"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpInsertTables" Caption="{Binding ConverterParameter=Caption_GroupTables, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertTable"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpInsertIllustrations" Caption="{Binding ConverterParameter=Caption_GroupIllustrations, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertPicture"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertFloatingPicture"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpInsertLinks" Caption="{Binding ConverterParameter=Caption_GroupLinks, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertBookmark"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertHyperlink"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpInsertHeaderFooter" Caption="{Binding ConverterParameter=Caption_GroupHeaderFooter, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertHeader"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertFooter"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertPageNumber"/>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertPageCount"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpInsertText" Caption="{Binding ConverterParameter=Caption_GroupText, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertTextBox"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
<dxr:RibbonPageGroup x:Name="grpInsertSymbols" Caption="{Binding ConverterParameter=Caption_GroupSymbols, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||
<dxr:RibbonPageGroup.ItemLinks>
|
||||
<dxb:BarButtonItemLink BarItemName="biInsertSymbol"/>
|
||||
</dxr:RibbonPageGroup.ItemLinks>
|
||||
</dxr:RibbonPageGroup>
|
||||
</dxr:RibbonPage>
|
||||
|
||||
</dxr:RibbonDefaultPageCategory>
|
||||
</dxr:RibbonControl>
|
||||
|
||||
<dxre:RichEditControl x:Name="recEditor" BarManager="{Binding ElementName=BarManager1, Mode=OneTime}" Ribbon="{Binding ElementName=RibbonControl1, Mode=OneTime}" Unit="Millimeter" ShowBorder="False" ShowHoverMenu="False" ActiveViewType="Simple" TabIndex="16" />
|
||||
|
||||
</DockPanel>
|
||||
</dxb:BarManager>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxdo:LayoutPanel>
|
||||
</dxdo:LayoutGroup>
|
||||
</dxdo:DockLayoutManager.LayoutRoot>
|
||||
</dxdo:DockLayoutManager>
|
||||
</dx:DXTabItem>
|
||||
<dx:DXTabItem Header="Pagos">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Header="Recibos" View="GroupBox">
|
||||
<tsWPF:tsGridControl TabIndex="34" x:Name="gcRecibos" NombreTablaBase="movimientoscaja">
|
||||
<tsWPF:tsGridControl.View>
|
||||
<tsWPF:tsTableView ShowTotalSummary="False" ShowGroupPanel="False" x:Name="tvRecibos" NewItemRowPosition="Bottom" AutoWidth="False" AllowGrouping="False" TabIndex="15" />
|
||||
</tsWPF:tsGridControl.View>
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="True" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:PropiedadesTSGC CamposObligatorios="Fecha,FechaCreacion,idCaja" />
|
||||
</tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:tsGridControl.Columns>
|
||||
<dxg:GridColumn FieldName="Importe" Width="150" Header="Importe">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskUseAsDisplayFormat="True" MaskType="Numeric" Mask="c2" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn Width="150" Header="Fecha Pago" FieldName="Fecha" SortOrder="Ascending" SortIndex="0" />
|
||||
|
||||
<tsWPF:tsGridColumn Width="250" Header="Caja" FieldName="idCaja">
|
||||
<tsWPF:tsGridColumn.EditSettings>
|
||||
<dxe:ComboBoxEditSettings ValueMember="idCaja" PopupWidth="600" x:Name="cbCaja" IncrementalFiltering="True" DisplayMember="Descripcion" AutoComplete="True" />
|
||||
</tsWPF:tsGridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<dxg:GridColumn FieldName="Observaciones" Header="Observaciones" Width="350" />
|
||||
<tsWPF:tsGridColumn Width="120" IsSmart="True" Header="Fecha Creación" FieldName="FechaCreacion" SoloLectura="True" />
|
||||
<!--<tsWPF:tsGridColumn Width="90" Header="Nº Pago" HorizontalHeaderContentAlignment="Center" FieldName="idMovimiento" SoloLectura="True" />-->
|
||||
<tsWPF:tsGridColumn Width="150" Header="Nº Recibo" HorizontalHeaderContentAlignment="Center" FieldName="NumeroReciboTMP" CellTemplate="{DynamicResource ImprimirTemplate}" SoloLectura="True" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
</tsWPF:tsGridControl.Columns>
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
</dx:DXTabItem>
|
||||
<dx:DXTabItem Header="Documentos" Height="22" VerticalAlignment="Top">
|
||||
<tsWPF:tsGridControl x:Name="gcDocumentos" NombreTablaBase="documentosfacturas" TabIndex="35" >
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="True" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
<tsWPF:PropiedadesTSGC CamposObligatorios="Descripcion" />
|
||||
</tsWPF:tsGridControl.PropiedadesTSGC>
|
||||
|
||||
<tsWPF:tsGridControl.View>
|
||||
<tsWPF:tsTableView x:Name="tvDocumentos" ShowTotalSummary="False" AllowGrouping="False" ShowGroupPanel="False" AutoWidth="False" NewItemRowPosition="Bottom" PreviewKeyDown="tvDocumentos_PreviewKeyDown" />
|
||||
</tsWPF:tsGridControl.View>
|
||||
<dxg:GridColumn FieldName="Descripcion" Header="Descripción" Width="500">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings TextWrapping="Wrap" AcceptsReturn="True" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<tsWPF:tsGridColumn Width="250" Header="Tipo" FieldName="Tipo">
|
||||
<tsWPF:tsGridColumn.EditSettings>
|
||||
<dxe:ComboBoxEditSettings ValueMember="Valor" PopupWidth="600" x:Name="cbTipoDocumento" IncrementalFiltering="True" DisplayMember="Descripcion" AutoComplete="True" />
|
||||
</tsWPF:tsGridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
|
||||
|
||||
<tsWPF:tsGridColumn FieldName="idFicheroNavigation.NombreFichero" Header="Fichero" Width="300" x:Name="gcNombreFichero">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:ButtonEditSettings x:Name="btFichero" IsTextEditable="False">
|
||||
<dxe:ButtonEditSettings.Buttons>
|
||||
<dxe:ButtonInfo GlyphKind="Search" Click="VerDocumento" />
|
||||
</dxe:ButtonEditSettings.Buttons>
|
||||
</dxe:ButtonEditSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="Fecha" Header="Fecha" Width="140" SoloLectura="True">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy HH:mm" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
</tsWPF:tsGridControl>
|
||||
</dx:DXTabItem>
|
||||
<dx:DXTabItem Header="Registro de cambios">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPF:tsGridControl x:Name="gcLogs" TabIndex="36">
|
||||
<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:DXTabItem Header="Registro de cambios" >
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<tsWPF:tsGridControl x:Name="gcLogs" TabIndex="21" >
|
||||
<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="usuarios.Nombre" 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:LayoutGroup View="GroupBox" x:Name="lgTotalesClase" IsCollapsible="True" IsLocked="True" Height="Auto" HorizontalAlignment="Stretch" Header="Totales">
|
||||
<dxlc:LayoutGroup Width="1280">
|
||||
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" Width="150">
|
||||
|
||||
|
||||
<tsWPF:tsLayoutItem Label="% I.V.A. 1:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="17" HorizontalAlignment="Stretch" EditValue="{Binding PorcentajeIVA1, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
|
||||
<tsWPF:tsLayoutItem Label="% I.V.A. 2:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="20" HorizontalAlignment="Stretch" EditValue="{Binding PorcentajeIVA2, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="% I.V.A. 3:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="23" HorizontalAlignment="Stretch" EditValue="{Binding PorcentajeIVA3, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" Width="230">
|
||||
<tsWPF:tsLayoutItem Label="Base Imponible 1:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="18" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" EditValue="{Binding BaseImponible1, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Base Imponible 2:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="21" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" EditValue="{Binding BaseImponible2, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Base Imponible 3:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="24" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" EditValue="{Binding BaseImponible3, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Base Imponible Exenta:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="26" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" EditValue="{Binding BaseImponibleExenta, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" HorizontalAlignment="Left" Width="180">
|
||||
<tsWPF:tsLayoutItem Label="Importe IVA 1:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="19" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" EditValue="{Binding CuotaIVA1, Mode=TwoWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Importe IVA 2:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="22" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" EditValue="{Binding CuotaIVA2, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Importe IVA 3:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="25" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" EditValue="{Binding CuotaIVA3, Mode=TwoWay , NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="250" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem Label="Total Base Imponible:" FontWeight="SemiBold">
|
||||
<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 TotalBaseImponible, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Total IVA:" FontWeight="SemiBold">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="29" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding TotalIVA, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" Width="200" HorizontalAlignment="Left">
|
||||
<tsWPF:tsLayoutItem Label="% I.R.P.F:" FontWeight="SemiBold">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="28" Mask="N0" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding PorcentajeIRPF, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Cuota I.R.P.F.:" FontWeight="SemiBold">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="30" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding IRPF, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Orientation="Vertical" >
|
||||
<tsWPF:tsLayoutItem Label="Total Factura:" FontWeight="Bold">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="31" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding TotalFactura, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem FontWeight="Bold" Label="Importe Pagado:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="32" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding ImportePagado, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
|
||||
<tsWPF:tsLayoutItem FontWeight="Bold" Label="Pendiente Pago:">
|
||||
<tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||
</tsWPF:tsLayoutItem.PropiedadesTS>
|
||||
<dxe:TextEdit TabIndex="33" Mask="c2" MaskType="Numeric" MaskUseAsDisplayFormat="True" IsReadOnly="True" FontWeight="Bold" EditValue="{Binding ImportePendiente, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
839
GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml.vb
Normal file
839
GestionGrupoSanchoToro/Ventas/ucFacturaEmitida.xaml.vb
Normal file
@@ -0,0 +1,839 @@
|
||||
Imports DevExpress.Xpf.Editors
|
||||
Imports DevExpress.Xpf.LayoutControl
|
||||
Imports tsWPFCore
|
||||
Imports System.ComponentModel
|
||||
Imports System.Data
|
||||
Imports DevExpress.Xpf.Editors.Validation
|
||||
Imports DevExpress.Xpf.Editors.Helpers
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports tsWPFCore.modExtensiones
|
||||
Imports System.Data.Common
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports tsUtilidades.Datos
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports System.Collections
|
||||
Imports tsEFCore8.Extensiones
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
Imports tsUtilidades.Enumeraciones
|
||||
Imports tsUtilidades
|
||||
Imports bdGrupoSanchoToro.db.productos
|
||||
Imports System.Windows.Threading
|
||||
Imports System.IO
|
||||
Imports Microsoft.Win32
|
||||
|
||||
'TODO: Comprobar cuando se puede modificar una factura (o eliminar)
|
||||
Public Class ucFacturaEmitida
|
||||
Private bd As tscGrupoSanchoToro
|
||||
Friend _idFactura As Nullable(Of Integer)
|
||||
Private lProductos As List(Of productos)
|
||||
Private ivas As List(Of enumeraciones)
|
||||
Friend idLog As Integer?
|
||||
Dim ra As facturas
|
||||
Public Overrides Sub Cargado()
|
||||
Me.Tipo_ucControlBusqueda = GetType(ucFacturasEmitidas)
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
Try
|
||||
lProductos = bd.productos.OrderBy(Function(x) x.Descripcion).ToList
|
||||
Dim lProductosFra = ra.detallesfacturas.Select(Function(x) x.idProducto).ToArray
|
||||
lProductos = lProductos.Where(Function(x) x.FechaBaja Is Nothing OrElse lProductosFra.Contains(x.idProducto)).ToList
|
||||
cbProducto.ItemsSource = lProductos
|
||||
Dim cjs = bd.cajas.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja.HasValue = False).OrderBy(Function(x) x.Descripcion).ToList
|
||||
Dim lCajas = cjs
|
||||
Dim ids = ra.movimientoscaja.Select(Function(x) x.idCaja).ToList
|
||||
Me.cbCaja.ItemsSource = lCajas.Where(Function(x) x.FechaBaja.HasValue = False OrElse ids.Contains(x.idCaja)).ToList
|
||||
cbTipoDocumento.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.documentosfacturas.TipoDocumentoFacturaEnum)).OrderBy(Function(x) x.Descripcion)
|
||||
Dim plantillas As List(Of tsWPFCore.Plantilla) = Comun.ObtienePlantillas(bd, {"GRUPLA.FACEMI"}, False)
|
||||
Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = plantillas
|
||||
If plantillas.Count > 0 Then
|
||||
Me.ContenedorAplicacion.bePlantilla.EditValue = plantillas.First.idPlantilla
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||
Dim NuevoEstado As tsUtilidades.EstadosAplicacion
|
||||
|
||||
If idLog.HasValue Then
|
||||
Try
|
||||
Dim log = bd.logs.First(Function(x) x.idLog = idLog)
|
||||
ra = tsUtilidades.Utilidades.DeserializarSinErrores(log.Log, GetType(facturas))
|
||||
If ra.idUsuario.HasValue Then ra.idUsuarioNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuario.Value)
|
||||
Dim df = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "DETALLESFACTURAS")
|
||||
If df IsNot Nothing Then
|
||||
Dim ld = tsUtilidades.Utilidades.DeserializarSinErrores(df.Log, GetType(List(Of detallesfacturas)))
|
||||
For Each d In ld
|
||||
ra.detallesfacturas.Add(d)
|
||||
Next
|
||||
End If
|
||||
Dim mv = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "MOVIMIENTOSCAJA_FR")
|
||||
If mv IsNot Nothing Then
|
||||
Dim ld = tsUtilidades.Utilidades.DeserializarSinErrores(mv.Log, GetType(List(Of movimientoscaja)))
|
||||
For Each d In ld
|
||||
ra.movimientoscaja.Add(d)
|
||||
Next
|
||||
End If
|
||||
Dim lent = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "ENTIDADES")
|
||||
If lent IsNot Nothing Then
|
||||
Dim ent = tsUtilidades.Utilidades.DeserializarSinErrores(lent.Log, GetType(entidades))
|
||||
ra.idClienteNavigation = ent
|
||||
End If
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
Catch EX As Exception
|
||||
Throw New Exception("No ha sido posible mostrar el registro del cambio (id " & idLog.Value.ToString & ").", EX)
|
||||
End Try
|
||||
Else
|
||||
If FuerzaNuevo OrElse _idFactura Is Nothing Then
|
||||
ra = New facturas
|
||||
ra.FechaFactura = DateOnly.FromDateTime(Today)
|
||||
_idFactura = Nothing
|
||||
ra.FechaEmision = Now
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
||||
ivas = bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "PIVA" AndAlso x.FechaBaja Is Nothing).ToList
|
||||
|
||||
Else
|
||||
ra = bd.facturas.First(Function(x) x.idFactura = _idFactura)
|
||||
Dim tiv = ra.detallesfacturas.Select(Function(x) x.idTipoIVA).GroupBy(Function(x) x).Select(Function(x) x.FirstOrDefault).ToList
|
||||
ivas = bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "PIVA" AndAlso (x.FechaBaja Is Nothing OrElse tiv.Contains(x.idEnumeracion))).ToList
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
End If
|
||||
End If
|
||||
cbRazonSocial.ItemsSource = bd.entidades.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso (x.EsCliente AndAlso x.FechaBaja.HasValue = False) OrElse x.idEntidad = ra.idCliente).ToList
|
||||
cbSerie.ItemsSource = bd.seriesfacturas.Where(Function(x) x.FechaBaja.HasValue = False AndAlso x.idEmpresa = EmpresaActual.idEmpresa).ToList
|
||||
cbIva.ItemsSource = ivas
|
||||
gcDetalle.ItemsSource = ra.detallesfacturas
|
||||
gcRecibos.ItemsSource = ra.movimientoscaja
|
||||
gcDocumentos.ItemsSource = ra.documentosfacturas
|
||||
Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idFactura AndAlso x.Aplicacion = "facturas").ToList
|
||||
Me.DataContext = ra
|
||||
Return NuevoEstado
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||
bd = tscGrupoSanchoToro.NuevoContexto(,,, True, "FACTURAS")
|
||||
Return bd
|
||||
End Function
|
||||
|
||||
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||
Get
|
||||
Return "facturas"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Public Overrides ReadOnly Property CampoIndice As String
|
||||
' Get
|
||||
' Return "idFactura"
|
||||
' End Get
|
||||
'End Property
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
If idLog.HasValue Then
|
||||
Return "Factura Cliente R.C.:" & idLog.ToString
|
||||
Else
|
||||
If Me.Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
|
||||
Return "Factura Cliente.Nuevo"
|
||||
Else
|
||||
Return "Factura Cliente." & DirectCast(Me.DataContext, facturas).idFactura.ToString
|
||||
End If
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Factura Cliente"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(Optional idFactura As Integer? = Nothing)
|
||||
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
_idFactura = idFactura
|
||||
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
If idLog.HasValue Then
|
||||
Dim fr As facturas = Me.DataContext
|
||||
Me.docpanel.Caption = "R.C. Factura de Cliente " & fr.NumeroFactura
|
||||
Me.docpanel.Tag = "R.C. Factura Emitida." & fr.NumeroFactura
|
||||
Else
|
||||
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||
Dim fr As facturas = Me.DataContext
|
||||
Me.docpanel.Caption = "Factura de Cliente " & fr.NumeroFactura
|
||||
Me.docpanel.Tag = "Factura Emitida." & fr.NumeroFactura
|
||||
Else
|
||||
Me.docpanel.Caption = "Factura de Cliente Nueva"
|
||||
Me.docpanel.Tag = "FacturaEmitida.Nuevo"
|
||||
End If
|
||||
End If
|
||||
' End If
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||
Dim pers = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||
' pers.Eliminar = False
|
||||
Return pers
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub ap_ValidarControl(sender As Object, e As ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
|
||||
Dim pts As PropiedadesTS = sender.parent.propiedadests
|
||||
Try
|
||||
If Not pts Is Nothing Then
|
||||
Me.ErroresValidacion.EliminaError("validando-" & pts.NombreCampo)
|
||||
|
||||
Select Case pts.NombreCampo.ToLower
|
||||
Case "idseriefactura_nulable"
|
||||
Dim Serie = CInt(e.Value)
|
||||
Dim sf = bd.seriesfacturas.First(Function(x) x.idSerieFactura = Serie)
|
||||
Dim Tipo As bdGrupoSanchoToro.db.seriesfacturas.TipoSerieFacturaEnum = sf.Tipo
|
||||
If Tipo = seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
|
||||
ra.NumeroFactura = sf.Serie & "/"
|
||||
Else
|
||||
ra.NumeroFactura = Nothing
|
||||
End If
|
||||
Dim lc As New List(Of tsLayoutItem)({liNumeroFactura})
|
||||
If Tipo <> seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
|
||||
EstableceSoloLectura(lc, True)
|
||||
Else
|
||||
EstableceSoloLectura(lc, False)
|
||||
End If
|
||||
Case "idcliente_nulable"
|
||||
Dim id As Integer = e.Value
|
||||
Dim ent = bd.entidades.First(Function(x) x.idEntidad = id)
|
||||
ra.RazonSocial = ent.RazonSocial
|
||||
ra.Direccion = ent.Direccion
|
||||
ra.CodigoMunicipio = ent.CodigoMunicipio
|
||||
ra.CodigoPostal = ent.CodigoPostal
|
||||
ra.NIF = ent.NIF
|
||||
ra.CodigoMunicipioNavigation = ent.CodigoMunicipioNavigation
|
||||
Case "numerofactura"
|
||||
Dim sf = bd.seriesfacturas.First(Function(x) x.idSerieFactura = ra.idSerieFactura)
|
||||
Dim Tipo As bdGrupoSanchoToro.db.seriesfacturas.TipoSerieFacturaEnum = sf.Tipo
|
||||
If Tipo = seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
|
||||
Dim nf As String = e.Value
|
||||
Dim nff = sf.Serie & "/"
|
||||
Dim numeracion As String = nf
|
||||
If numeracion.StartsWith(sf.Serie & "/") Then numeracion = nf.Split("/", 2)(1).Trim
|
||||
If numeracion.Length > sf.NumeroDigitos Then
|
||||
Throw New Exception("La numeración de la factura excede los dígitos permitidos")
|
||||
Else
|
||||
numeracion = numeracion.PadLeft(sf.NumeroDigitos, "0")
|
||||
End If
|
||||
nff &= numeracion
|
||||
If nff <> nf Then
|
||||
ValorOriginalCambiado = nff
|
||||
ra.NumeroFactura = nff
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Dim sCodigoError As String = "validando-"
|
||||
If pts IsNot Nothing Then
|
||||
sCodigoError &= pts.NombreCampo
|
||||
End If
|
||||
ev = New ErrorValidacion(sCodigoError, sender, ex.Message, ex, DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical)
|
||||
e.IsValid = False
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ap_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
|
||||
_idFactura = ra.idFactura
|
||||
Me.gcRecibos.ItemsSource = ra.movimientoscaja
|
||||
Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idFactura AndAlso x.Aplicacion = "FACTURAS").ToList
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ap_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
|
||||
Select Case Celda.Column.FieldName.ToLower
|
||||
Case "idlog"
|
||||
Dim log As logs = gcLogs.CurrentItem
|
||||
Dim id As Integer = log.idLog
|
||||
Dim uc As New ucFacturaEmitida
|
||||
uc.idLog = log.idLog
|
||||
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||
Case "numerorecibotmp"
|
||||
Dim fa As facturas = Me.DataContext
|
||||
Dim rec As movimientoscaja = Celda.RowData.Row
|
||||
If rec IsNot Nothing Then
|
||||
Dim lr As New List(Of movimientoscaja)
|
||||
Dim Continuar As Boolean
|
||||
If Me.ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||
Me.tvRecibos.CommitEditing()
|
||||
If Not Guardar(Nothing, Nothing,,, 9) Then
|
||||
If rec.Fecha = Date.MinValue Then
|
||||
rec.Fecha = AhoraMySql(bd)
|
||||
rec.FechaCreacion = rec.Fecha
|
||||
End If
|
||||
Continuar = True
|
||||
Else
|
||||
Continuar = False
|
||||
End If
|
||||
Else
|
||||
Continuar = True
|
||||
End If
|
||||
If Continuar Then
|
||||
lr.Add(rec)
|
||||
Dim cp As String = "RECIBO"
|
||||
Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.Codigo = cp).Select(Function(x) New With {.Fichero = x.idFicheroNavigation.Fichero, .Tipo = x.idGrupoNavigation.Codigo}).FirstOrDefault
|
||||
Informes.ImprimirPlantilla(bd, pl.Fichero, lr, False, 1)
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
'Select Case Celda.Column.FieldName.ToLower
|
||||
' Case "numeroalbaranentrega"
|
||||
' Dim ra = DirectCast(Me.gcDetalle.CurrentItem, detallesfacturas)
|
||||
' Dim id As Integer = ra.detallesalbaranes.idAlbaranEntrega
|
||||
' FuncionesDinamicas.AbrirAP(New ucAlbaranEntrega(id), OtrosParametros)
|
||||
' Case "numeroalbaranrecogida"
|
||||
' Dim ra = DirectCast(Me.gcDetalle.CurrentItem, detallesfacturas)
|
||||
' Dim id As Integer = ra.detallesalbaranes.idAlbaranRecogida
|
||||
' FuncionesDinamicas.AbrirAP(New ucAlbaranRecogida(id), OtrosParametros)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub ap_EstadoCambiado(EstadoAnterior As tsUtilidades.EstadosAplicacion, EstadoNuevo As tsUtilidades.EstadosAplicacion) Handles Me.EstadoCambiado
|
||||
Dim lc As New List(Of tsLayoutItem)({liNumeroFactura})
|
||||
|
||||
Select Case EstadoNuevo
|
||||
Case EstadosAplicacion.ModificandoRegistro
|
||||
If DirectCast(ra.idSerieFacturaNavigation.Tipo, db.seriesfacturas.TipoSerieFacturaEnum) <> seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
|
||||
EstableceSoloLectura(lc, True)
|
||||
End If
|
||||
Case EstadosAplicacion.Nuevo
|
||||
EstableceSoloLectura(lc, True)
|
||||
End Select
|
||||
If idLog.HasValue Then EstableceSoloLectura()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub BiBuscarProducto_Click(sender As Object, e As RoutedEventArgs)
|
||||
'Dim dxw As New dxwProductos(lProductos)
|
||||
'If dxw.ShowDialog Then
|
||||
' If gcDetalle.CurrentItem Is Nothing Then tvDetalle.AddNewRow()
|
||||
' Dim def As detallesfacturas = gcDetalle.CurrentItem
|
||||
' Dim prod = lProductos.First(Function(x) x.idProducto = dxw.idProducto)
|
||||
' def.idProducto = prod.idProducto
|
||||
' RellenaDatosProducto(def)
|
||||
' tvDetalle.MoveNextCell()
|
||||
' gcDetalle.RefreshRow(tvDetalle.FocusedRowHandle)
|
||||
'End If
|
||||
If tvDetalle.ActiveEditor Is Nothing Then
|
||||
Dispatcher.BeginInvoke(New Action(Sub() tvDetalle.ShowEditor()), System.Windows.Threading.DispatcherPriority.Render)
|
||||
End If
|
||||
|
||||
Dim dxw As New dxwProductos(lProductos)
|
||||
If dxw.ShowDialog Then
|
||||
If gcDetalle.CurrentItem Is Nothing Then tvDetalle.AddNewRow()
|
||||
Dim def As detallesfacturas = gcDetalle.CurrentItem
|
||||
Dim prod = lProductos.First(Function(x) x.idProducto = dxw.idProducto)
|
||||
def.idProducto = prod.idProducto
|
||||
If tvDetalle.ActiveEditor IsNot Nothing Then tvDetalle.ActiveEditor.EditValue = prod.idProducto
|
||||
tvDetalle.PostEditor()
|
||||
tvDetalle.CloseEditor()
|
||||
gcDetalle.RefreshRow(tvDetalle.FocusedRowHandle)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub ap_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
|
||||
|
||||
ra.idUsuario = idUsuario
|
||||
Dim hte As New Hashtable
|
||||
If ra.detallesfacturas.Count = 0 Then
|
||||
hte.Add("ALMACENAR-DETALLE_OBLIGATORIO", "Es obligatorio introducir al menos un artículo")
|
||||
End If
|
||||
If ra.TotalFactura = 0 Then
|
||||
hte.Add("ALMACENAR-IMPORTE_0", "El total de la factura no puede ser 0")
|
||||
End If
|
||||
|
||||
Dim sf = bd.seriesfacturas.First(Function(x) x.idSerieFactura = ra.idSerieFactura)
|
||||
ra.idSerieFacturaNavigation = sf
|
||||
If DirectCast(ra.idSerieFacturaNavigation.Tipo, db.seriesfacturas.TipoSerieFacturaEnum) = seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
|
||||
If ra.NumeroFactura.Trim.NothingAVacio = "" Then
|
||||
hte.Add("ALMACENAR-NUMERO_FACTURA_OBLIGATORIO", "El nº de factura es obligatorio.")
|
||||
End If
|
||||
End If
|
||||
If bd.facturas.Any(Function(x) x.NumeroFactura = ra.NumeroFactura AndAlso x.idCliente = ra.idCliente AndAlso x.idFactura <> ra.idFactura) Then
|
||||
hte.Add("ALMACENAR-YA_EXISTE_OTRA_FACTURA", "Ya existe esta factura del mismo cliente registrada")
|
||||
End If
|
||||
If Math.Abs(ra.ImportePagado) > Math.Abs(ra.TotalFactura) Then
|
||||
hte.Add("ALMACENAR-IMPORTE_PAGADO_SUPERIOR", "El importe pagado de los recibos no puede superar al total de la factura")
|
||||
End If
|
||||
If DirectCast(ra.idSerieFacturaNavigation.Tipo, db.seriesfacturas.TipoSerieFacturaEnum) <> seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
|
||||
If Estado = EstadosAplicacion.Nuevo Then
|
||||
Dim Año = ra.FechaFactura.Year
|
||||
If bd.facturas.Any(Function(x) x.idSerieFactura = ra.idSerieFactura AndAlso x.FechaFactura > ra.FechaFactura AndAlso x.FechaFactura.Year = Año) Then
|
||||
hte.Add("ALMACENAR_YA_EXISTE_OTRA_FACTURA", "Existen facturas con fecha posterior a la actual")
|
||||
End If
|
||||
Else
|
||||
Dim serie = ra.NumeroFactura.Split("/")(0)
|
||||
Dim Numero = ra.NumeroFactura.Split("/")(1)
|
||||
Dim ant = serie & "/" & (Integer.Parse(Numero) - 1).ToString.PadLeft(ra.idSerieFacturaNavigation.NumeroDigitos, "0")
|
||||
Dim pos = serie & "/" & (Integer.Parse(Numero) + 1).ToString.PadLeft(ra.idSerieFacturaNavigation.NumeroDigitos, "0")
|
||||
Dim fa = bd.facturas.FirstOrDefault(Function(x) x.NumeroFactura = ant And x.idSerieFactura = ra.idSerieFactura)
|
||||
Dim fp = bd.facturas.FirstOrDefault(Function(x) x.NumeroFactura = pos And x.idSerieFactura = ra.idSerieFactura)
|
||||
If (fa IsNot Nothing AndAlso fa.FechaFactura > ra.FechaFactura) OrElse (fp IsNot Nothing AndAlso fp.FechaFactura < ra.FechaFactura) Then
|
||||
hte.Add("ALMACENAR_YA_EXISTE_OTRA_FACTURA", "Las fechas de facturas deben seguir el orden de la numeración")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If hte.Count > 0 Then
|
||||
MensajesError = hte
|
||||
Cancelar = True
|
||||
Else
|
||||
Dim dfrtf = ra.detallesfacturas.Where(Function(x) x.DetalleRTFModificado).ToList
|
||||
For Each d In dfrtf
|
||||
If d.idDetalle = 0 Then
|
||||
If d.DetalleRTF.Length > 0 Then
|
||||
Dim f As New bdGrupoSanchoToro.db.ficheros
|
||||
With f
|
||||
.Descripcion = "Más descripción f.r."
|
||||
.Fichero = d.DetalleRTF
|
||||
.Fecha = Now
|
||||
End With
|
||||
d.idDetalleRTFNavigation = f
|
||||
End If
|
||||
Else
|
||||
If d.idDetalleRTF Is Nothing Then
|
||||
d.idDetalleRTFNavigation = New db.ficheros
|
||||
End If
|
||||
With d.idDetalleRTFNavigation
|
||||
.Fichero = d.DetalleRTF
|
||||
.Fecha = Now
|
||||
End With
|
||||
End If
|
||||
Next
|
||||
|
||||
If ra.NumeroFactura.NothingAVacio = "" Then ra.EstableceNumeroFactura(bd)
|
||||
For Each mv In ra.movimientoscaja
|
||||
mv.Tipo = TipoMovimientoEnum.RECIBO_CLIENTE
|
||||
If mv.idUsuario.HasValue = False Then mv.idUsuario = idUsuario
|
||||
Next
|
||||
For Each r In ra.movimientoscaja.ToList.Where(Function(x) x.NumeroRecibo.NothingAVacio = "")
|
||||
r.idFacturaNavigation = ra
|
||||
r.EstableceNumeroRecibo()
|
||||
Next
|
||||
For Each d In ra.documentosfacturas
|
||||
If d.idUsuario.HasValue = False Then d.idUsuario = idUsuario
|
||||
Next
|
||||
If ra.ImportePendiente = 0 Then
|
||||
ra.FechaPago = DateOnly.FromDateTime(ra.movimientoscaja.OrderByDescending(Function(x) x.Fecha).First.Fecha)
|
||||
Else
|
||||
ra.FechaPago = Nothing
|
||||
End If
|
||||
If ra.PorcentajeIVA2.HasValue = False Then
|
||||
ra.BaseImponible2 = Nothing
|
||||
ra.CuotaIVA2 = Nothing
|
||||
End If
|
||||
If ra.PorcentajeIVA2.HasValue = False Then
|
||||
ra.BaseImponible3 = Nothing
|
||||
ra.CuotaIVA3 = Nothing
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub tvDetalle_CellValueChanged(sender As Object, e As CellValueChangedEventArgs) Handles tvDetalle.CellValueChanged
|
||||
Dim def As detallesfacturas = e.Row
|
||||
Select Case e.Column.FieldName.ToLower
|
||||
Case "idproducto"
|
||||
RellenaDatosProducto(def)
|
||||
Case "idtipoiva"
|
||||
Dim idTIVA = CInt(e.Value)
|
||||
def.PorcentajeIVA = ivas.First(Function(x) x.idEnumeracion = idTIVA).ValorNumerico1
|
||||
End Select
|
||||
'tvDetalle.CommitEditing()
|
||||
'gcDetalle.CurrentItem = e.Row
|
||||
|
||||
End Sub
|
||||
Private Sub RellenaDatosProducto(dea As detallesfacturas)
|
||||
Dim ae As facturas = Me.DataContext
|
||||
Dim pr = lProductos.First(Function(x) x.idProducto = dea.idProducto)
|
||||
dea.Precio = pr.UltimoPrecioCompra
|
||||
If dea.Cantidad = 0 Then dea.Cantidad = 1
|
||||
' dea.RefrescaImporte()
|
||||
End Sub
|
||||
|
||||
Private Sub BiBuscarCliente_Click(sender As Object, e As RoutedEventArgs)
|
||||
If Me.ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||
Dim dxw As New dxwEntidades(bd, True, False)
|
||||
If dxw.ShowDialog Then
|
||||
Dim ent = bd.entidades.First(Function(x) x.idEntidad = dxw.Entidad.idEntidad)
|
||||
ra.idClienteNavigation = ent
|
||||
ra.idCliente_Nulable = ent.idEntidad
|
||||
ra.RazonSocial = ent.RazonSocial
|
||||
ra.CodigoPostal = ent.CodigoPostal
|
||||
ra.CodigoMunicipio = ent.CodigoMunicipio
|
||||
ra.Direccion = ent.Direccion
|
||||
ra.Observaciones = ""
|
||||
ra.NIF = ent.NIF
|
||||
' ra.RefrescaExtensiones()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
||||
Imprimir(idPlantilla, False, 1)
|
||||
End Sub
|
||||
Private Sub Imprimir(idPlantilla As Integer, ImpresoraDefecto As Boolean, Copias As Integer)
|
||||
|
||||
Dim ds As List(Of facturas)
|
||||
Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.idPlantilla = idPlantilla).Select(Function(x) New With {.Fichero = x.idFicheroNavigation.Fichero, .Tipo = x.idGrupoNavigation.Codigo}).FirstOrDefault
|
||||
ds = New List(Of facturas)
|
||||
ds.Add(ra)
|
||||
Informes.ImprimirPlantilla(bd, pl.Fichero, ds, ImpresoraDefecto, Copias)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
'Private Sub ap_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
|
||||
|
||||
|
||||
'End Sub
|
||||
|
||||
|
||||
Private Sub tvDetalle_RowUpdated(sender As Object, e As DevExpress.Xpf.Grid.RowEventArgs) Handles tvDetalle.RowUpdated
|
||||
If e.RowHandle = GridControl.NewItemRowHandle Then
|
||||
Dispatcher.BeginInvoke(New Action(Function()
|
||||
e.Source.Grid.CurrentItem = e.Row
|
||||
e.Source.ShowEditor()
|
||||
End Function), DispatcherPriority.Render)
|
||||
End If
|
||||
Call CalculaTotales()
|
||||
End Sub
|
||||
Sub CalculaTotales()
|
||||
|
||||
Dim ivas(2) As Double?
|
||||
For Each df In ra.detallesfacturas
|
||||
For i = 0 To 3
|
||||
If i = 3 Then Throw New Exception("Demasiados tipos de iva en la misma factura.")
|
||||
If ivas(i).HasValue = False OrElse ivas(i).Value = df.PorcentajeIVA Then
|
||||
ivas(i) = df.PorcentajeIVA
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
ra.PorcentajeIVA1 = ivas(0)
|
||||
ra.PorcentajeIVA2 = ivas(1)
|
||||
ra.PorcentajeIVA3 = ivas(2)
|
||||
ra.BaseImponibleExenta = ra.detallesfacturas.Where(Function(x) x.PorcentajeIVA.HasValue = False).Sum(Function(x) x.Importe)
|
||||
ra.BaseImponible1 = Nothing
|
||||
ra.BaseImponible2 = Nothing
|
||||
ra.BaseImponible3 = Nothing
|
||||
If ivas(0).HasValue Then ra.BaseImponible1 = ra.detallesfacturas.Where(Function(x) x.PorcentajeIVA.HasValue AndAlso x.PorcentajeIVA = ivas(0)).Sum(Function(x) x.Importe)
|
||||
If ivas(1).HasValue Then ra.BaseImponible2 = ra.detallesfacturas.Where(Function(x) x.PorcentajeIVA.HasValue AndAlso x.PorcentajeIVA = ivas(1)).Sum(Function(x) x.Importe)
|
||||
If ivas(2).HasValue Then ra.BaseImponible3 = ra.detallesfacturas.Where(Function(x) x.PorcentajeIVA.HasValue AndAlso x.PorcentajeIVA = ivas(2)).Sum(Function(x) x.Importe)
|
||||
ra.TotalBaseImponible = Math.Round(ra.detallesfacturas.Sum(Function(x) x.Importe), 2)
|
||||
CalculaCuotasIVA(ra)
|
||||
CalculaIRPF(ra)
|
||||
CalculaTotalesFinales(ra)
|
||||
End Sub
|
||||
Public Sub CalculaIRPF(F As facturas)
|
||||
If F.idSerieFacturaNavigation Is Nothing Then
|
||||
DXMessageBox.Show("Primero debe definir la serie de la factura", "Atención")
|
||||
Else
|
||||
If F.idSerieFacturaNavigation.IRPFDespuesDeIVA Then
|
||||
F.IRPF = Math.Round((F.TotalBaseImponible + F.TotalIVA) * F.PorcentajeIRPF / 100, 2, MidpointRounding.AwayFromZero)
|
||||
Else
|
||||
F.IRPF = Math.Round(F.TotalBaseImponible * F.PorcentajeIRPF / 100, 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Public Sub CalculaCuotasIVA(F As facturas)
|
||||
F.CuotaIVA1 = Nothing
|
||||
F.CuotaIVA2 = Nothing
|
||||
F.CuotaIVA3 = Nothing
|
||||
If F.PorcentajeIVA1.HasValue Then
|
||||
F.CuotaIVA1 = Math.Round(F.BaseImponible1.Value * F.PorcentajeIVA1.Value / 100, 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
If F.PorcentajeIVA2.HasValue Then
|
||||
F.CuotaIVA2 = Math.Round(F.BaseImponible2.Value * F.PorcentajeIVA2.Value / 100, 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
If F.PorcentajeIVA3.HasValue Then
|
||||
F.CuotaIVA3 = Math.Round(F.BaseImponible3.Value * F.PorcentajeIVA3.Value / 100, 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
End Sub
|
||||
Public Sub CalculaTotalesFinales(ra As facturas)
|
||||
ra.TotalIVA = Math.Round(If(ra.CuotaIVA1.HasValue, ra.CuotaIVA1.Value, 0) + If(ra.CuotaIVA2.HasValue, ra.CuotaIVA2.Value, 0) + If(ra.CuotaIVA3.HasValue, ra.CuotaIVA3.Value, 0), 2, MidpointRounding.AwayFromZero)
|
||||
ra.TotalFactura = Math.Round(ra.TotalBaseImponible + ra.TotalIVA - ra.IRPF, 2, MidpointRounding.AwayFromZero)
|
||||
ra.ImportePagado = Math.Round(ra.movimientoscaja.Sum(Function(x) x.Importe), 2, MidpointRounding.AwayFromZero)
|
||||
' ra.RefrescaExtensiones()
|
||||
End Sub
|
||||
Private Sub tvDetalle_ValidaFila(sender As Object, e As DevExpress.Xpf.Grid.GridRowValidationEventArgs) Handles tvDetalle.ValidateRow
|
||||
'Dim df As detallesfacturas = e.Row
|
||||
'Dim htErrores = New Hashtable
|
||||
'If df.Cantidad = 0 Then
|
||||
' DXMessageBox.Show("La Cantidad no puede ser 0", "Error")
|
||||
' e.SetError("La Cantidad no puede ser 0")
|
||||
' e.IsValid = False
|
||||
'End If
|
||||
Try
|
||||
Dim htErrores = New Hashtable
|
||||
ErroresValidacion.LimpiarErrores("TSGC-" & gcDetalle.PropiedadesTS.NumeroObjeto.ToString & ":" & e.RowHandle.ToString & ":")
|
||||
Dim df As detallesfacturas = e.Row
|
||||
|
||||
If df.Cantidad = 0 Then
|
||||
htErrores.Add("Cantidad0", "La Cantidad no puede ser 0")
|
||||
End If
|
||||
|
||||
If htErrores.Count > 0 Then
|
||||
Me.AgregaErroresTSGC(gcDetalle, htErrores, e)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub gcDetalle_DespuesEliminar(gc As tsGridControl) Handles gcDetalle.DespuesEliminar
|
||||
CalculaTotales()
|
||||
End Sub
|
||||
|
||||
Private Sub tvRecibos_ValidaFila(sender As Object, e As GridRowValidationEventArgs) Handles tvRecibos.ValidateRow
|
||||
'Dim mv As movimientoscaja = e.Row
|
||||
'If mv.Importe = 0 Then
|
||||
' DXMessageBox.Show("El Importe no puede ser 0", "Error")
|
||||
' e.SetError("El Importe no puede ser 0")
|
||||
' e.IsValid = False
|
||||
'End If
|
||||
Try
|
||||
Dim htErrores = New Hashtable
|
||||
ErroresValidacion.LimpiarErrores("TSGC-" & gcRecibos.PropiedadesTS.NumeroObjeto.ToString & ":" & e.RowHandle.ToString & ":")
|
||||
Dim mv As movimientoscaja = e.Row
|
||||
|
||||
If mv.Importe = 0 Then
|
||||
htErrores.Add("Importe0", "El Importe no puede ser 0")
|
||||
End If
|
||||
If htErrores.Count > 0 Then
|
||||
Me.AgregaErroresTSGC(gcRecibos, htErrores, e)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub gcRecibos_DespuesEliminar(gc As tsGridControl) Handles gcRecibos.DespuesEliminar
|
||||
CalculaTotales()
|
||||
End Sub
|
||||
|
||||
Private Sub tvRecibos_RowUpdated(sender As Object, e As RowEventArgs) Handles tvRecibos.RowUpdated
|
||||
|
||||
CalculaTotalesFinales(ra)
|
||||
End Sub
|
||||
|
||||
Private Sub tvRecibos_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvRecibos.InitNewRow
|
||||
gcRecibos.SetCellValue(e.RowHandle, "Fecha", Now)
|
||||
gcRecibos.SetCellValue(e.RowHandle, "FechaCreacion", Now)
|
||||
End Sub
|
||||
|
||||
Private Sub ucFacturaEmitida_CampoActualizado(sender As Object, e As DataTransferEventArgs) Handles Me.CampoActualizado
|
||||
Dim pts As PropiedadesTS = sender.parent.propiedadests
|
||||
If Not pts Is Nothing Then
|
||||
Select Case pts.NombreCampo.ToLower
|
||||
Case "porcentajeirpf"
|
||||
CalculaIRPF(ra)
|
||||
CalculaTotalesFinales(ra)
|
||||
Case "cuotaiva1", "cuotaiva2", "cuotaiva3", "irpf"
|
||||
CalculaTotalesFinales(ra)
|
||||
Case "idcliente_nulable"
|
||||
ra.idClienteNavigation = bd.entidades.First(Function(x) x.idEntidad = ra.idCliente)
|
||||
Case "idseriefactura_nulable"
|
||||
If ra.idSerieFactura_Nulable.HasValue Then
|
||||
Dim sf = bd.seriesfacturas.First(Function(x) x.idSerieFactura = ra.idSerieFactura_Nulable)
|
||||
ra.idSerieFacturaNavigation = sf
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub tvDetalle_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvDetalle.InitNewRow
|
||||
gcDetalle.SetCellValue(e.RowHandle, "idTipoIVA", ivas.OrderByDescending(Function(x) x.ValorNumerico2).First.idEnumeracion)
|
||||
Dispatcher.BeginInvoke(New Action(Function()
|
||||
Dim view = TryCast(sender, TableView)
|
||||
view.CommitEditing()
|
||||
End Function))
|
||||
End Sub
|
||||
|
||||
Private Sub tvDetalle_PreviewKeyDown(sender As Object, e As Input.KeyEventArgs) Handles tvDetalle.PreviewKeyDown
|
||||
If e.Key = Key.F6 Then
|
||||
Select Case gcDetalle.CurrentColumn.FieldName.ToLower
|
||||
Case "idproducto"
|
||||
tvDetalle.ShowEditor()
|
||||
BiBuscarProducto_Click(Nothing, Nothing)
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub cbRazonSocial_PreviewKeyDown(sender As Object, e As Input.KeyEventArgs) Handles cbRazonSocial.PreviewKeyDown
|
||||
If e.Key = Key.F6 Then
|
||||
BiBuscarCliente_Click(Nothing, Nothing)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub gcRecibos_AntesEliminar(gc As tsGridControl, ByRef Cancelar As Boolean) Handles gcRecibos.AntesEliminar
|
||||
Dim da As movimientoscaja = gc.CurrentItem
|
||||
If da.idMovimientoCierre.HasValue Then
|
||||
DXMessageBox.Show("No se puede eliminar un pago ya que está cerrado")
|
||||
Cancelar = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub tvRecibos_ShowingEditor(sender As Object, e As ShowingEditorEventArgs) Handles tvRecibos.ShowingEditor
|
||||
'If e.RowHandle <> DataControlBase.NewItemRowHandle Then
|
||||
' Dim rec As movimientoscaja = gcRecibos.GetRow(e.RowHandle)
|
||||
' If e.Column.FieldName.ToLower = "importe" OrElse e.Column.FieldName.ToLower = "idcaja" OrElse e.Column.FieldName.ToLower = "fecha" Then
|
||||
' If rec.idMovimientoCierre.HasValue OrElse rec.FechaSupervision.HasValue Then
|
||||
' e.Cancel = True
|
||||
' e.Handled = True
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Cargando As Boolean
|
||||
Private Sub gcDetalle_SelectedItemChanged(sender As Object, e As SelectedItemChangedEventArgs) Handles gcDetalle.SelectedItemChanged
|
||||
Try
|
||||
|
||||
Dim df As detallesfacturas = gcDetalle.CurrentItem
|
||||
If df IsNot Nothing Then
|
||||
recEditor.LoadDocument(df.DetalleRTF)
|
||||
recEditor.IsEnabled = True
|
||||
Else
|
||||
recEditor.CreateNewDocument()
|
||||
recEditor.IsEnabled = False
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Debug.WriteLine(ex.Message)
|
||||
'Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub recEditor_ContentChanged(sender As Object, e As EventArgs) Handles recEditor.ContentChanged
|
||||
Try
|
||||
If Cargando Then
|
||||
Cargando = False
|
||||
Else
|
||||
Dim df As detallesfacturas = gcDetalle.CurrentItem
|
||||
If df IsNot Nothing AndAlso tvDetalle.FocusedRowHandle >= 0 Then
|
||||
Dim doc = recEditor.Document
|
||||
If doc.GetText(doc.Range).Trim = "" Then
|
||||
df.DetalleRTF = Nothing
|
||||
Else
|
||||
df.DetalleRTF = recEditor.SaveDocument(DevExpress.XtraRichEdit.DocumentFormat.Rtf)
|
||||
End If
|
||||
df.DetalleRTFModificado = True
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Debug.WriteLine(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub recEditor_DocumentLoaded(sender As Object, e As EventArgs) Handles recEditor.DocumentLoaded
|
||||
Cargando = True
|
||||
End Sub
|
||||
|
||||
Private Sub tvDocumentos_ValidateRow(sender As Object, e As GridRowValidationEventArgs) Handles tvDocumentos.ValidateRow
|
||||
Dim ges As documentosfacturas = gcDocumentos.CurrentItem
|
||||
If ges.idUsuario.HasValue = False Then
|
||||
ges.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
|
||||
End If
|
||||
End Sub
|
||||
Private Sub VerDocumento(sender As System.Object, e As System.Windows.RoutedEventArgs)
|
||||
Try
|
||||
Dim exp As documentosfacturas = gcDocumentos.CurrentItem
|
||||
If exp IsNot Nothing AndAlso exp.idFicheroNavigation IsNot Nothing AndAlso exp.idFicheroNavigation.NombreFichero IsNot Nothing AndAlso exp.idFicheroNavigation.Fichero IsNot Nothing Then
|
||||
Dim sftmp As String = tsUtilidades.Utilidades.ObtieneDirectorioAleatorio("GrupoSanchoToro") & "\" & exp.idFicheroNavigation.NombreFichero
|
||||
tsUtilidades.Utilidades.ByteArrayAFichero(exp.idFicheroNavigation.Fichero, sftmp, True)
|
||||
tsUtilidades.Sistema.EjecutaFichero(sftmp)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub Examinar(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btFichero.DefaultButtonClick
|
||||
Try
|
||||
If gcDocumentos.CurrentItem Is Nothing Then tvDocumentos.AddNewRow()
|
||||
Dim exp As documentosfacturas = gcDocumentos.CurrentItem
|
||||
Dim ofd As New OpenFileDialog
|
||||
If ofd.ShowDialog() Then
|
||||
Dim fin As New FileInfo(ofd.FileName)
|
||||
If fin.Length > 1024 * 1024 * 50 Then
|
||||
DXMessageBox.Show("El fichero no puede ser mayor de 50 Mb", "Atención")
|
||||
Else
|
||||
Dim f() As Byte = IO.File.ReadAllBytes(ofd.FileName)
|
||||
Dim idTipoDocumentoExp = bd.enumeraciones.First(Function(x) x.Codigo = "TIPFIC.EXPENT").idEnumeracion
|
||||
If exp.idFicheroNavigation Is Nothing Then
|
||||
Dim fi As New db.ficheros
|
||||
exp.idFicheroNavigation = fi
|
||||
End If
|
||||
exp.idFicheroNavigation.NombreFichero = IO.Path.GetFileName(ofd.FileName)
|
||||
exp.idFicheroNavigation.Fichero = f
|
||||
exp.idFicheroNavigation.Fecha = Now
|
||||
exp.idFicheroNavigation.Descripcion = exp.Descripcion.Acortar(80)
|
||||
exp.idFicheroNavigation.idTipo = idTipoDocumentoExp
|
||||
exp.Fecha = Now
|
||||
Dim usu = bd.usuarios.First(Function(x) x.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario)
|
||||
exp.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
|
||||
exp.idUsuarioNavigation = usu
|
||||
tvDocumentos.MoveNextCell()
|
||||
gcDocumentos.RefreshRow(tvDocumentos.FocusedRowHandle)
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub tvDocumentos_PreviewKeyDown(sender As Object, e As KeyEventArgs)
|
||||
If e.Key = Key.F6 AndAlso gcDocumentos.CurrentColumn.FieldName.ToLower = "ficheros.nombrefichero" Then
|
||||
Examinar(Nothing, Nothing)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub tvDocumentos_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvDocumentos.InitNewRow
|
||||
gcDocumentos.SetCellValue(e.RowHandle, "Fecha", Now)
|
||||
End Sub
|
||||
|
||||
Private Sub ucFacturaEmitida_AntesEliminar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, ByRef OmitirPreguntaContinuar As Boolean) Handles Me.AntesEliminar
|
||||
If ra.idSerieFacturaNavigation.Tipo <> seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then
|
||||
DXMessageBox.Show("Las facturas que no son emitidas por los clientes no se pueden eliminar", "Atención")
|
||||
Cancelar = True
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
137
GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml
Normal file
137
GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml
Normal file
@@ -0,0 +1,137 @@
|
||||
<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:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore" x:Class="ucFacturasEmitidas"
|
||||
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="950" HorizontalAlignment="Left" >
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutGroup>
|
||||
|
||||
<tsWPF:tsLayoutItem Label="Fecha Inicio:" TabIndex="8" >
|
||||
<dxe:DateEdit x:Name="teFechaInicio" TabIndex="1" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Fecha Fin:" >
|
||||
<dxe:DateEdit x:Name="teFechaFin" TabIndex="2" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Incluir Facturas Pagadas:" HorizontalContentAlignment="Left" >
|
||||
<dxe:CheckEdit x:Name="cbIncluirTodos" TabIndex="3" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
<tsWPF:tsLayoutItem Label="Mostar solo las no Enviadas a la Asesoría:" HorizontalAlignment="Left" HorizontalContentAlignment="Left" >
|
||||
<dxe:CheckEdit x:Name="cbSoloPendientes" IsChecked="False" TabIndex="34" />
|
||||
</tsWPF:tsLayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<tsWPF:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
|
||||
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" 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="Razón Social, NIF, Nº Factura"/>
|
||||
<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" TabIndex="1" >
|
||||
<tsWPF:tsGridControl.PropiedadesTS>
|
||||
<tsWPF:PropiedadesTS Modificable="NoModificable" />
|
||||
</tsWPF:tsGridControl.PropiedadesTS>
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn FieldName="NumeroFactura" Width="120" IsSmart="True" Header="Nº Factura" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||
<dxg:GridColumn FieldName="idSerieFacturaNavigation.Descripcion" Header="Serie" Width="200" IsSmart="True" />
|
||||
<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="FechaFactura" Header="Fecha Factura" IsSmart="True" Width="100" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:DateEditSettings DisplayFormat="d"/>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="FechaEmision" Header="Fecha Emisión" IsSmart="True" Width="130" />
|
||||
<dxg:GridColumn FieldName="TotalBaseImponible" Header="Base Imponible" HorizontalHeaderContentAlignment="Right" Width="100" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="c2" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<!--<dxg:GridColumn FieldName="Descuento" HorizontalHeaderContentAlignment="Right" Width="100" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="c2" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>-->
|
||||
|
||||
<dxg:GridColumn FieldName="TotalIVA" HorizontalHeaderContentAlignment="Right" Width="100" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="c2" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="TotalFactura" HorizontalHeaderContentAlignment="Right" Width="100" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="c2" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="ImportePagado" HorizontalHeaderContentAlignment="Right" Width="100" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="c2" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="FechaPago" Header="Fecha Pago" IsSmart="True" Width="100" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:DateEditSettings DisplayFormat="d"/>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="ImportePendiente" HorizontalHeaderContentAlignment="Right" Width="120" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="c2" HorizontalContentAlignment="Right" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<tsWPF:tsGridColumn FieldName="FechaEnvioAsesoria" Header="Fecha Envío Asesoría" IsSmart="True" Width="150" AllowPrinting="False" >
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings MaskType="DateTime" MaskUseAsDisplayFormat="True" Mask="dd/MM/yyyy HH:mm" />
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</tsWPF:tsGridColumn>
|
||||
<dxg:GridColumn FieldName="Observaciones" Width="400" IsSmart="True" AllowPrinting="False" />
|
||||
<dxg:GridColumn FieldName="idUsuarioNavigation.Usuario" Header="Usuario" Width="150" IsSmart="True" AllowPrinting="False" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<tsWPF:tsTableView x:Name="tv" ShowSearchPanelMode="Always" ShowGroupPanel="True" ShowTotalSummary="True" ShowGroupFooters="True" />
|
||||
</dxg:GridControl.View>
|
||||
<tsWPF:tsGridControl.TotalSummary>
|
||||
<dxg:GridSummaryItem FieldName="TotalBaseImponible" SummaryType="Sum" ShowInColumn="TotalBaseImponible" DisplayFormat=" {0:c2}"/>
|
||||
<!--<dxg:GridSummaryItem FieldName="Descuento" SummaryType="Sum" ShowInColumn="Descuento" DisplayFormat=" {0:c2}"/>-->
|
||||
<dxg:GridSummaryItem FieldName="IVA" SummaryType="Sum" ShowInColumn="IVA" DisplayFormat=" {0:c2}"/>
|
||||
<dxg:GridSummaryItem FieldName="TotalFactura" SummaryType="Sum" ShowInColumn="TotalFactura" DisplayFormat=" {0:c2}"/>
|
||||
<dxg:GridSummaryItem FieldName="ImportePagado" SummaryType="Sum" ShowInColumn="ImportePagado" DisplayFormat=" {0:c2}"/>
|
||||
<dxg:GridSummaryItem FieldName="ImportePendiente" SummaryType="Sum" ShowInColumn="ImportePendiente" DisplayFormat=" {0:c2}"/>
|
||||
<dxg:GridSummaryItem SummaryType="Count" ShowInColumn="entidades.RazonSocial" DisplayFormat="Nº Facturas: {0:n0}" />
|
||||
</tsWPF:tsGridControl.TotalSummary>
|
||||
<dxg:GridControl.GroupSummary>
|
||||
<dxg:GridSummaryItem FieldName="TotalBaseImponible" SummaryType="Sum" ShowInGroupColumnFooter="TotalBaseImponible" DisplayFormat=" {0:c2}"/>
|
||||
<!--<dxg:GridSummaryItem FieldName="Descuento" SummaryType="Sum" ShowInGroupColumnFooter="Descuento" DisplayFormat=" {0:c2}"/>-->
|
||||
<dxg:GridSummaryItem FieldName="IVA" SummaryType="Sum" ShowInGroupColumnFooter="IVA" DisplayFormat=" {0:c2}"/>
|
||||
<dxg:GridSummaryItem FieldName="TotalFactura" SummaryType="Sum" ShowInGroupColumnFooter="TotalFactura" DisplayFormat=" {0:c2}"/>
|
||||
<dxg:GridSummaryItem FieldName="ImportePagado" SummaryType="Sum" ShowInGroupColumnFooter="ImportePagado" DisplayFormat=" {0:c2}"/>
|
||||
<dxg:GridSummaryItem FieldName="ImportePendiente" SummaryType="Sum" ShowInGroupColumnFooter="ImportePendiente" DisplayFormat=" {0:c2}"/>
|
||||
<dxg:GridSummaryItem SummaryType="Count" ShowInGroupColumnFooter="entidades.RazonSocial" DisplayFormat=" {0:n0}" />
|
||||
</dxg:GridControl.GroupSummary>
|
||||
</tsWPF:tsGridControl>
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</tsWPF:tsUserControl>
|
||||
347
GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml.vb
Normal file
347
GestionGrupoSanchoToro/Ventas/ucFacturasEmitidas.xaml.vb
Normal file
@@ -0,0 +1,347 @@
|
||||
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports tsWPFCore
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports bdGrupoSanchoToro.db.Utilidades
|
||||
Imports Microsoft.Win32
|
||||
Imports System.IO
|
||||
Imports tsEFCore8.Extensiones.StringExtensions
|
||||
Imports TSpdfUtils
|
||||
|
||||
|
||||
Public Class ucFacturasEmitidas
|
||||
|
||||
|
||||
Private bd As tscGrupoSanchoToro
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub New()
|
||||
|
||||
' Esta llamada es exigida por el diseñador.
|
||||
InitializeComponent()
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub Cargado()
|
||||
ContenedorAplicacion.btGuardar.IsVisible = False
|
||||
ContenedorAplicacion.siEstado.IsVisible = False
|
||||
'Dim Hoy = Date.Today
|
||||
'teFechaFin.EditValue = Hoy
|
||||
'teFechaInicio.EditValue = New Date(Hoy.Year, 1, 1)
|
||||
Me.GridSeleccion = Me.gc
|
||||
Me.HabilitarRefresco = True
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||
If Background OrElse Refrescar Then ObtienefacturasAsync(bd, Background)
|
||||
Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
|
||||
End Function
|
||||
|
||||
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||
Dim Acciones As New List(Of tsWPFCore.Accion)
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 4,
|
||||
.Descripcion = "ENVIA EXCEL Y FRAS. IMPRESAS SELECCIONADAS A ASESORIA"})
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 1,
|
||||
.Descripcion = "ENVIA FACTURAS SELECCIONADAS POR EMAIL AL CLIENTE"})
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 3,
|
||||
.Descripcion = "GENERA EXCEL DE FACTURAS SELECCIONADAS"})
|
||||
Acciones.Add(New Accion With {
|
||||
.idAccion = 5,
|
||||
.Descripcion = "GENERA PDF DE FACTURAS SELECCIONADAS"})
|
||||
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
|
||||
Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub EstableceTitulo()
|
||||
Me.docpanel.Caption = "Facturas A Clientes"
|
||||
End Sub
|
||||
|
||||
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||
Get
|
||||
Return "FacturasEmitidas"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||
Get
|
||||
Return "facturas"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||
Get
|
||||
Return "Facturas A Clientes"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||
bd = tscGrupoSanchoToro.NuevoContexto()
|
||||
Return bd
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||
Dim per = Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||
per.Eliminar = False
|
||||
Return per
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub Nuevo() Handles Me.BotonNuevoPulsado
|
||||
FuncionesDinamicas.AbrirAP(New ucFacturaEmitida, OtrosParametros)
|
||||
End Sub
|
||||
|
||||
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||
Dim ra = DirectCast(Me.gc.CurrentItem, facturas)
|
||||
Select Case Celda.Column.FieldName.ToLower
|
||||
Case "numerofactura"
|
||||
Dim id As Integer = ra.idFactura
|
||||
FuncionesDinamicas.AbrirAP(New ucFacturaEmitida(id), OtrosParametros)
|
||||
Case "razonsocial"
|
||||
Dim id As Integer = ra.idCliente
|
||||
FuncionesDinamicas.AbrirAP(New ucEntidad(id), OtrosParametros)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ap_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
|
||||
|
||||
End Sub
|
||||
Public Function ObtieneFacturasEmitidas(ByRef DataContext As Object, BackGround As Boolean, TextoBusqueda As String, FechaInicio As DateOnly?, FechaFin As DateOnly?, IncluirTodos As Boolean, Pendientes As Boolean) As List(Of facturas)
|
||||
Dim rs As IQueryable(Of facturas)
|
||||
Dim lf As New List(Of facturas)
|
||||
Dim iNumExc As Integer = 0
|
||||
Do
|
||||
Try
|
||||
rs = bd.facturas.Where(Function(x) x.idClienteNavigation.idEmpresa = EmpresaActual.idEmpresa).Include(Function(x) x.idSerieFacturaNavigation).Include(Function(x) x.movimientoscaja).Include(Function(x) x.idClienteNavigation).Include(Function(x) x.idEventoNavigation.CodigoMunicipioNavigation.CodigoProvinciaNavigation).Include(Function(x) x.idUsuarioNavigation).AsQueryable
|
||||
|
||||
If FechaInicio.HasValue Then
|
||||
rs = rs.Where(Function(x) x.FechaFactura >= FechaInicio.Value)
|
||||
End If
|
||||
|
||||
If FechaFin.HasValue Then
|
||||
rs = rs.Where(Function(x) x.FechaFactura <= FechaFin.Value)
|
||||
End If
|
||||
If IncluirTodos = False Then
|
||||
rs = rs.Where(Function(x) x.movimientoscaja.Count = 0 OrElse Math.Round(x.movimientoscaja.Sum(Function(y) y.Importe), 2) <> Math.Round(x.TotalFactura, 2))
|
||||
End If
|
||||
If Pendientes Then
|
||||
rs = rs.Where(Function(x) x.FechaEnvioAsesoria.HasValue = False)
|
||||
End If
|
||||
If TextoBusqueda <> "" Then
|
||||
Dim parametros(0) As Object
|
||||
Dim CamposBusquedaNumericos() As String = {"idFactura"}
|
||||
Dim CamposBusquedaAlfabeticos() As String = {"idClienteNavigation.RazonSocial", "idClienteNavigation.NIF", "NumeroFactura"}
|
||||
|
||||
Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, CamposBusquedaNumericos, CamposBusquedaAlfabeticos, Nothing)
|
||||
rs = rs.Where(Function(x) x.idClienteNavigation.idEmpresa = EmpresaActual.idEmpresa).Where(ExpresionBusqueda).AsQueryable
|
||||
End If
|
||||
lf = rs.OrderByDescending(Function(x) x.FechaFactura).ThenByDescending(Function(x) x.NumeroFactura).ToList
|
||||
Exit Do
|
||||
Catch ex As Exception
|
||||
iNumExc += 1
|
||||
If iNumExc > 3 Then
|
||||
rs = Nothing
|
||||
Exit Do
|
||||
End If
|
||||
End Try
|
||||
Loop
|
||||
Return lf
|
||||
End Function
|
||||
|
||||
Public Async Sub ObtienefacturasAsync(bd As tscGrupoSanchoToro, Background As Boolean)
|
||||
Try
|
||||
Dim rs As New List(Of facturas)
|
||||
Dim Busqueda = If(Me.teBusqueda.EditValue Is Nothing, "", Me.teBusqueda.EditValue)
|
||||
Dim fi As DateOnly? : If teFechaInicio.EditValue IsNot Nothing Then fi = DateOnly.FromDateTime(teFechaInicio.EditValue)
|
||||
Dim ff As DateOnly? : If teFechaFin.EditValue IsNot Nothing Then ff = DateOnly.FromDateTime(teFechaFin.EditValue)
|
||||
Dim it As Boolean = cbIncluirTodos.IsChecked
|
||||
Dim bPendientes As Boolean = cbSoloPendientes.IsChecked
|
||||
If Background Then
|
||||
Me.ContenedorAplicacion.IsEnabled = False
|
||||
Await Task.Run(Sub()
|
||||
rs = ObtieneFacturasEmitidas(bd, Background, Busqueda, fi, ff, it, bPendientes)
|
||||
End Sub)
|
||||
Else
|
||||
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
||||
DXSplashScreen.SetState("Buscando Facturas Emitidas ...")
|
||||
rs = ObtieneFacturasEmitidas(bd, Background, Busqueda, fi, ff, it, bPendientes)
|
||||
End If
|
||||
|
||||
gc.ItemsSource = rs
|
||||
DataContext = rs
|
||||
Catch ex As Exception
|
||||
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
Finally
|
||||
Me.ContenedorAplicacion.IsEnabled = True
|
||||
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
|
||||
ObtienefacturasAsync(bd, False)
|
||||
End Sub
|
||||
|
||||
Private Sub ucFacturasEmitidas_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
|
||||
Try
|
||||
' Dim ra As entidades = Me.DataContext
|
||||
Dim tf As List(Of facturas) = gc.ItemsSource
|
||||
Dim fras = gc.ElementosSeleccionados.Cast(Of facturas).ToList
|
||||
If fras.Count = 0 Then
|
||||
DXMessageBox.Show("Antes debe seleccionar alguna factura emitida", "Atención")
|
||||
Else
|
||||
If fras.Any(Function(x) x.TotalIVA = 0) Then
|
||||
DXMessageBox.Show("Atención alguna de las facturas seleccionadas no tienen IVA", "Atención")
|
||||
End If
|
||||
Select Case idAccion
|
||||
Case 1
|
||||
Dim sFacturas As String = ""
|
||||
Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
|
||||
Dim sMensaje As String = ""
|
||||
Dim grf = fras.GroupBy(Function(x) x.idCliente)
|
||||
Dim NumCorreos As Integer = 0
|
||||
If DXMessageBox.Show("Atención se van a enviar " & grf.Count.ToString & " correos. ¿Desea Continuar?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.Yes Then
|
||||
DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
||||
DXSplashScreen.SetState("Generando correos, por favor espere ...")
|
||||
For Each g In grf
|
||||
If g.First.idClienteNavigation.Email.NothingAVacio = "" Then
|
||||
sMensaje &= g.First.idClienteNavigation.RazonSocial & vbCrLf
|
||||
Else
|
||||
NumCorreos += 1
|
||||
Dim dArchivos As Dictionary(Of String, Byte()) = Nothing
|
||||
For Each fe In g
|
||||
DXSplashScreen.SetState("Generando archivos de la factura " & fe.NumeroFactura & ", por favor espere ...")
|
||||
Next
|
||||
DXSplashScreen.SetState("Comprimiendo Archivos, por favor espere ...")
|
||||
Dim bzip = tsUtilidades.zip.ComprimirArchivos(dArchivos)
|
||||
Dim Asunto, Cuerpo As String
|
||||
|
||||
Asunto = EmpresaActual.RazonSocial & " - Adjunto le remitimos facturas"
|
||||
Cuerpo = "Distinguidos Sres., adjunto le remitimos facturas"
|
||||
bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, Asunto, Cuerpo, cta, g.First.idClienteNavigation.Email, g.First.idClienteNavigation.Email2, cta.Remitente, bzip, "Facturas" & ".zip", g.First.idCliente, "ENTIDAD", g.First.idCliente)
|
||||
End If
|
||||
Next
|
||||
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||
End If
|
||||
If sMensaje <> "" Then
|
||||
DXMessageBox.Show("Los siguientes Clientes no tienen correo electrónico: " & sMensaje, "Generación de correos")
|
||||
End If
|
||||
DXMessageBox.Show("Se han generado " & NumCorreos.ToString & " correos electrónicos", "Generación de correos")
|
||||
Case 3
|
||||
Try
|
||||
Dim sfd As New SaveFileDialog
|
||||
sfd.FileName = IO.Path.GetDirectoryName("Exportacion") & ("Facturas.xlsx").Trim
|
||||
sfd.Filter = "Fichero Excel (*.xls, *.xlsx, *.csv)|*.xls;*.xlsx;*.csv"
|
||||
sfd.DefaultExt = ".xlsx"
|
||||
If sfd.ShowDialog Then
|
||||
gc.ItemsSource = fras
|
||||
Select Case IO.Path.GetExtension(sfd.FileName).ToLower
|
||||
Case ".xls"
|
||||
tv.ExportToXls(sfd.FileName)
|
||||
Case ".xlsx"
|
||||
tv.ExportToXlsx(sfd.FileName)
|
||||
Case ".csv"
|
||||
tv.ExportToCsv(sfd.FileName)
|
||||
End Select
|
||||
tsUtilidades.Sistema.EjecutaFichero(sfd.FileName)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
Finally
|
||||
gc.ItemsSource = tf
|
||||
End Try
|
||||
Case 4
|
||||
Try
|
||||
Dim sCorreo = bd.enumeraciones.First(Function(x) x.Codigo = "CONF.EMAILASESORIA").ValorAlfabeticoLargo
|
||||
Dim dxnc = New dxwEnvioCorreo(sCorreo, "", "", EmpresaActual.RazonSocial & " - Adjunto le remitimos listado de facturas solicitadas", "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos listado de facturas solicitadas", "Facturas.zip")
|
||||
If dxnc.ShowDialog Then
|
||||
Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO" AndAlso x.idEmpresa = EmpresaActual.idEmpresa)
|
||||
gc.ItemsSource = fras
|
||||
Dim ms As New MemoryStream
|
||||
tv.ExportToXlsx(ms)
|
||||
Dim bFacturas = ms.ToArray
|
||||
DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
||||
Dim dArchivos As New Dictionary(Of String, Byte())
|
||||
dArchivos.Add("FacturasEmitidas_" & Today.ToString("yyyy-MM-dd") & ".xlsx", bFacturas)
|
||||
For Each fe In fras
|
||||
DXSplashScreen.SetState("Generando archivos de la factura " & fe.NumeroFactura & ", por favor espere ...")
|
||||
Dim ff = fe.documentosfacturas.FirstOrDefault(Function(x) x.Tipo = documentosfacturas.TipoDocumentoFacturaEnum.FACTURA_IMPRESA)
|
||||
If ff IsNot Nothing Then
|
||||
dArchivos.Add(fe.NumeroFactura.Replace("/", "-") & ".pdf", ff.idFicheroNavigation.Fichero)
|
||||
Else
|
||||
If fe.idSerieFacturaNavigation.Tipo = seriesfacturas.TipoSerieFacturaEnum.EMITIDA_POR_CLIENTE Then Throw New Exception("No se ha adjuntado la factura impresa de la factura " & fe.NumeroFactura)
|
||||
Dim ds = New List(Of facturas)
|
||||
Dim idpl As Integer
|
||||
idpl = bd.plantillas.First(Function(x) x.Codigo = "FACTURA").idPlantilla
|
||||
ds.Add(fe)
|
||||
dArchivos.Add(fe.NumeroFactura.Replace("/", "-") & ".pdf", Informes.GuardaInformeEnPdf(bd, idpl, ds))
|
||||
End If
|
||||
Next
|
||||
DXSplashScreen.SetState("Comprimiendo Archivos, por favor espere ...")
|
||||
Dim bzip = tsUtilidades.zip.ComprimirArchivos(dArchivos)
|
||||
|
||||
bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, dxnc._Asunto, dxnc._Cuerpo, cta, dxnc._Destinatarios, dxnc._CC, dxnc._BCC, bzip, dxnc._Adjunto,, "FACTURASEMITIDAS")
|
||||
For Each f In fras
|
||||
f.FechaEnvioAsesoria = Now
|
||||
Next
|
||||
bd.GuardarCambios()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
If ex.Message.StartsWith("No se ha adjuntado la factura impresa") = False Then Throw New Exception(ex.Message, ex)
|
||||
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||
DXMessageBox.Show(ex.Message, "Atención")
|
||||
Finally
|
||||
gc.ItemsSource = tf
|
||||
End Try
|
||||
Case 5 'generación de pdf de facturas seleccionadas
|
||||
Dim sfd As New SaveFileDialog
|
||||
sfd.FileName = "Facturas.pdf"
|
||||
sfd.Filter = "Fichero PDF (*.pdf)|*.pdf"
|
||||
sfd.DefaultExt = ".pdf"
|
||||
If sfd.ShowDialog Then
|
||||
DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
||||
DXSplashScreen.SetState("Generando PDF, por favor espere ...")
|
||||
Dim lfras As New List(Of Byte())
|
||||
For Each factura In fras.OrderBy(Function(x) x.NumeroFactura).ToList
|
||||
DXSplashScreen.SetState("Generando Factura " & factura.NumeroFactura & " ...")
|
||||
Dim ds = New List(Of facturas)
|
||||
Dim idpl As Integer
|
||||
If factura.PorcentajeIVA1 > 0 Then
|
||||
idpl = bd.plantillas.First(Function(x) x.Codigo = "FACEMI").idPlantilla
|
||||
Else
|
||||
idpl = bd.plantillas.First(Function(x) x.Codigo = "NOTENT").idPlantilla
|
||||
End If
|
||||
ds.Add(factura)
|
||||
lfras.Add(Informes.GuardaInformeEnPdf(bd, idpl, ds))
|
||||
Next
|
||||
Dim lista = lfras.Select(Function(x) New MemoryStream(x)).ToArray
|
||||
TSpdfUtils.pdf.UnePdfs(lista, sfd.FileName)
|
||||
tsUtilidades.Sistema.EjecutaFichero(sfd.FileName)
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
Catch ex As Exception
|
||||
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||
'Comun.GeneraRegistroCorreoExcepcion(bd, ex, "ucEntidad_EjecutarAccion")
|
||||
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||
DXMessageBox.Show("Error " & ex.Message, "Error")
|
||||
Finally
|
||||
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub cbIncluirTodos_Checked(sender As Object, e As RoutedEventArgs) Handles cbIncluirTodos.Checked
|
||||
If Me.teFechaInicio.EditValue Is Nothing Then Me.teFechaInicio.EditValue = Now.Date
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user