This commit is contained in:
2020-01-20 19:06:39 -07:00
22 changed files with 972 additions and 172 deletions

View File

@@ -4653,7 +4653,11 @@ Public Class ClsContabilidad
Retorno = SqlAdapter.SelectCommand.Parameters("@CveCuenta").Value.ToString.ToEntero Retorno = SqlAdapter.SelectCommand.Parameters("@CveCuenta").Value.ToString.ToEntero
'Retorno = If(Data IsNot Nothing AndAlso Data.Rows.Count > 0, Data.Rows(0)("CveCuenta").ToString.ToEntero, 0) 'Retorno = If(Data IsNot Nothing AndAlso Data.Rows.Count > 0, Data.Rows(0)("CveCuenta").ToString.ToEntero, 0)
Catch Ex1 As SqlException Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al Guardar la cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) If Ex1.Message.Contains("IND_Conta_Cuentas_Codigo_CveEmpresa") Then
Me.OnError("No se puede registrar una cuenta ya existente", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al Guardar la cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception Catch ex As Exception
Me.OnError("Ocurrió un error al Guardar la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Me.OnError("Ocurrió un error al Guardar la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try End Try

View File

@@ -121,7 +121,39 @@ Public Class ClsGPS
Public Sub Commit() Public Sub Commit()
SqlTransacc.Commit() SqlTransacc.Commit()
End Sub End Sub
#Region "Arrastre"
Public Function GPS_ArrastreGET(CveDispositivo As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_GPS_ArrastreGET")
With SqlAdapter.SelectCommand.Parameters
addParameters("@CveDispositivo", SqlDbType.Int, CveDispositivo)
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los datos de Arrastre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GPS_ArrastreActivarDesactivar(CveDispositivo As Integer, ArrastreActivo As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_GPS_ArrastreActivarDesactivar")
With SqlAdapter.SelectCommand.Parameters
addParameters("@CveDispositivo", SqlDbType.Int, CveDispositivo)
addParameters("@ArrastreActivo", SqlDbType.Bit, ArrastreActivo)
End With
Try
Dataset = New DataSet()
SqlAdapter.Fill(Dataset)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al activar o desactivar la alerta de Arrastre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
Public Function GetTemperatura(CveDispositivo As Integer, CveSensor As Integer, strFechaInicio As String, strFechaFin As String, CveUsuario As Integer) As Boolean Public Function GetTemperatura(CveDispositivo As Integer, CveSensor As Integer, strFechaInicio As String, strFechaFin As String, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_GPS_TramaData") DataAdapter("PA_GPS_TramaData")

View File

@@ -3482,6 +3482,8 @@ Public Class ClsPaginas
PaginaDict = New System.Collections.Hashtable PaginaDict = New System.Collections.Hashtable
PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) PaginaDict.Add("/Inicio.aspx".ToUpper(), -1)
PaginaDict.Add("/reporteador.aspx".ToUpper(), -1)
PaginaDict.Add("/GPS/RepArrastre.aspx".ToUpper(), 718)
PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1)
PaginaDict.Add("/Ventas/RepConciliacionSat.aspx".ToUpper(), 716) PaginaDict.Add("/Ventas/RepConciliacionSat.aspx".ToUpper(), 716)
PaginaDict.Add("/Ventas/SolicitudesSAT.aspx".ToUpper(), 717) PaginaDict.Add("/Ventas/SolicitudesSAT.aspx".ToUpper(), 717)

View File

@@ -1829,7 +1829,7 @@ Namespace Modelos
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas, TipoDocto As String) As Boolean Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas, TipoDocto As String) As Boolean
Dim Resultado As Boolean = True Dim Resultado As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant") Then If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant", "Rem") Then
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion) Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)

View File

@@ -3,6 +3,112 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scrollFoot {
display: none;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.table table-striped table-hover dataTable no-footer {
margin-top: 0px !important;
}
.Excede {
overflow: hidden;
text-overflow: ellipsis;
}
.psagregar > div.comboxes {
display: inline-block;
width: 250px;
}
.psagregar > div.codigo input {
width: 79px;
}
.psagregar > div.codigo {
display: inline-block;
width: 80px;
}
.psagregar > div.codigo > input[type="submit"] {
display: none;
}
.widget-thumb {
padding: 15px;
border-radius: 4px;
}
.widget-thumb.bordered {
border: 3px solid whitesmoke;
}
.widget-thumb .widget-thumb-heading {
font-size: 14px;
font-weight: 700;
color: #8e9daa;
margin: 0px 5px;
text-align: center;
}
.widget-thumb .widget-thumb-wrap {
overflow: hidden;
}
.widget-thumb .widget-thumb-wrap .widget-thumb-icon {
float: left;
width: 60px;
height: 60px;
display: inline-block;
font-size: 20px;
line-height: 41px;
color: #fff;
text-align: center;
padding: 10px;
margin-right: 15px;
}
.widget-thumb .widget-thumb-body {
overflow: hidden;
padding: 5px;
}
.widget-thumb .widget-thumb-body .widget-thumb-subtitle {
padding-top: 2px;
display: block;
font-size: 14px;
font-weight: 600;
color: #8e9daa;
}
.widget-thumb .widget-thumb-body .widget-thumb-body-stat {
display: block;
font-size: 20px;
font-weight: 600;
color: #3e4f5e;
}
</style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
@@ -40,7 +146,7 @@
<h5>TC:<asp:Literal runat="server" ID="LtTipoCambioActual"></asp:Literal></h5> <h5>TC:<asp:Literal runat="server" ID="LtTipoCambioActual"></asp:Literal></h5>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<asp:TextBox ID="TxtConceptoFluctuacion" runat="server" ></asp:TextBox> <asp:TextBox ID="TxtConceptoFluctuacion" runat="server"></asp:TextBox>
</div> </div>
</div> </div>
</div> </div>
@@ -59,21 +165,78 @@
<ajax:TabContainer runat="server" ID="T"> <ajax:TabContainer runat="server" ID="T">
<ajax:TabPanel runat="server" ID="TabCompras" HeaderText="Compras"> <ajax:TabPanel runat="server" ID="TabCompras" HeaderText="Compras">
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel ID="UpIndicadores" UpdateMode="Conditional" runat="server" Visible="False">
<ContentTemplate>
<div id="DivIndicadores" visible="true" class="row" runat="server">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">PÉRDIDA</h4>
<div class="widget-thumb-wrap">
<i class="widget-thumb-icon bg-red fa fa-money"></i>
<div class="widget-thumb-body">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="LtIndicador_ExistenciaPerdida" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">GANANCIA</h4>
<div class="widget-thumb-wrap">
<i class="widget-thumb-icon bg-green fa fa-money"></i>
<div class="widget-thumb-body">
<div class="row">
<div class="col-md-6">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="LtIndicador_ValorPesosGanancia" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading"><asp:Label ID="LblComprasPerdidaGanancia" runat="server" Text=""></asp:Label></h4>
<div class="widget-thumb-wrap">
<i id="IImagenResultado" runat="server" class=""></i>
<div class="widget-thumb-body">
<div class="row">
<div class="col-md-6">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="LtIndicador_CPPesosFinal" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div style="float: right; margin-right: 50px;"> <div style="float: right; margin-right: 50px;">
<asp:Button Text="Generar Proveedores" runat="server" ID="BtnGeneraCompras" OnClick="BtnGeneraCompras_Click" Style="margin-left: 30px;" class="btn btn-primary" /> <asp:Button Text="Generar Proveedores" runat="server" ID="BtnGeneraCompras" OnClick="BtnGeneraCompras_Click" Style="margin-left: 30px;" class="btn btn-primary" />
</div> </div>
<br /> <br />
<br /> <br />
<asp:GridView ID="GvCompras" Width="99%" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvCompras" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio,FluctuacionTotal,GananciaPerdida" DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio,FluctuacionTotal,PerdidaGanancia"
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras" EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" /> <asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" />
<asp:BoundField HeaderText="# Facturas" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="# Facturas" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación Pesos" DataField="FluctuacionTotal" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Fluctuación Pesos" DataField="FluctuacionTotal" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Perdida o Ganancia" DataField="GananciaPerdida" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Perdida o Ganancia" DataField="PerdidaGanancia" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<%--<asp:Label ID="LblTotalCompras" runat="server" Text=""></asp:Label>--%> <%--<asp:Label ID="LblTotalCompras" runat="server" Text=""></asp:Label>--%>
@@ -81,6 +244,62 @@
</ajax:TabPanel> </ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Ventas"> <ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Ventas">
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel ID="UpIndicadoresVentas" UpdateMode="Conditional" runat="server" Visible="false">
<ContentTemplate>
<div id="DivIndicadoresVentas" visible="true" class="row" runat="server">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">PÉRDIDA</h4>
<div class="widget-thumb-wrap">
<i class="widget-thumb-icon bg-red fa fa-money"></i>
<div class="widget-thumb-body">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="LtIndicador_PerdidasVentas" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">GANANCIA</h4>
<div class="widget-thumb-wrap">
<i class="widget-thumb-icon bg-green fa fa-money"></i>
<div class="widget-thumb-body">
<div class="row">
<div class="col-md-6">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="LtIndicador_GanaciaVentas" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading"> <asp:Label ID="LblVentasPerdidaGanancia" runat="server" Text=""></asp:Label></h4>
<div class="widget-thumb-wrap">
<i id="IImagenFinalVentas" runat="server" class=""></i>
<div class="widget-thumb-body">
<div class="row">
<div class="col-md-6">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="LtIndicador_FinalVentas" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div style="float: right; margin-right: 50px;"> <div style="float: right; margin-right: 50px;">
<asp:Button Text="Generar Clientes" runat="server" ID="BtnGeneraVentas" OnClick="BtnGeneraVentas_Click" Style="margin-left: 30px;" class="btn btn-primary" /> <asp:Button Text="Generar Clientes" runat="server" ID="BtnGeneraVentas" OnClick="BtnGeneraVentas_Click" Style="margin-left: 30px;" class="btn btn-primary" />
</div> </div>
@@ -95,8 +314,9 @@
<asp:BoundField DataField="Fecha" HeaderText="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="Fecha" HeaderText="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Diferencia" HeaderText="Diferencia" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField DataField="Diferencia" HeaderText="Diferencia TC" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N4}" />
<asp:BoundField DataField="Fluctuacion" HeaderText="Fluctuacion Pesos" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField DataField="FluctuacionPesos" HeaderText="Fluctuacion Pesos" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PerdidaGanancia" HeaderText="Acción" ItemStyle-HorizontalAlign="Left" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<asp:Label ID="LblTotalVentas" runat="server" Text=""></asp:Label> <asp:Label ID="LblTotalVentas" runat="server" Text=""></asp:Label>
@@ -115,9 +335,9 @@
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias" EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:TemplateField ItemStyle-Width="50" > <asp:TemplateField ItemStyle-Width="50">
<ItemTemplate > <ItemTemplate>
<asp:CheckBox ID="ChkGenerarBancos" runat="server"/> <asp:CheckBox ID="ChkGenerarBancos" runat="server" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField HeaderText="Banco" DataField="Banco" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Banco" DataField="Banco" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
@@ -140,11 +360,12 @@
<asp:GridView ID="GvDeudores" Width="99%" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvDeudores" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,TipoCambio,Fluctuacion,RazonSocial,CveIE" DataKeyNames="IdCtaAfectable,TipoCambio,Fluctuacion,RazonSocial,CveIE"
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias" EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None" > CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Deudor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Deudor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString ="/Bancos/IE.aspx?CveIE={0}" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left" /> <asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
@@ -167,8 +388,10 @@
<Columns> <Columns>
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" /> <asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" />
<asp:BoundField HeaderText="# Facturas" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="# Facturas" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación Pesos" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Fluctuación Pesos" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PerdidaGanancia" HeaderText="Acción" ItemStyle-HorizontalAlign="Left" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<asp:Label ID="LblTotalAcreedores" runat="server" Text=""></asp:Label> <asp:Label ID="LblTotalAcreedores" runat="server" Text=""></asp:Label>
@@ -187,7 +410,7 @@
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Acreedor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Acreedor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString ="/Bancos/IE.aspx?CveIE={0}" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left" /> <asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />

View File

@@ -71,6 +71,21 @@ Partial Class Bancos_FluctuacionCambiaria
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then
GvCompras.DataSource = ObjBancos.DtResultados GvCompras.DataSource = ObjBancos.DtResultados
'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero 'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ")
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ")
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion")
Dim Final As Double = GanaciaAux - PerdidaAux
IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero
LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero
LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero
LblComprasPerdidaGanancia.Text = If(Final > 0, "Ganancia", "Pérdida")
LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else Else
GvCompras.DataSource = Nothing GvCompras.DataSource = Nothing
@@ -78,6 +93,7 @@ Partial Class Bancos_FluctuacionCambiaria
End If End If
ObjBancos.Dispose() ObjBancos.Dispose()
GvCompras.DataBind() GvCompras.DataBind()
UpIndicadores.Visible = True
If GvCompras.Rows.Count > 0 Then If GvCompras.Rows.Count > 0 Then
GvCompras.Rows(GvCompras.Rows.Count - 1).CssClass = "SubTotales2" GvCompras.Rows(GvCompras.Rows.Count - 1).CssClass = "SubTotales2"
End If End If
@@ -88,7 +104,25 @@ Partial Class Bancos_FluctuacionCambiaria
LblTotalVentas.Text = "0.00" LblTotalVentas.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 2, UsuarioActual.CveEmpresa) Then If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 2, UsuarioActual.CveEmpresa) Then
GvVentas.DataSource = ObjBancos.DtResultados GvVentas.DataSource = ObjBancos.DtResultados
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0")
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0")
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0")
Dim Final As Double = GanaciaAux - PerdidaAux
IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero
LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero
LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero
LblVentasPerdidaGanancia.Text = If(Final < 0, "Pérdida", "Ganancia")
LblTotalVentas.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero LblTotalVentas.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
UpIndicadoresVentas.Visible = True
Else Else
GvVentas.DataSource = Nothing GvVentas.DataSource = Nothing
Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia) Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
@@ -217,10 +251,12 @@ Partial Class Bancos_FluctuacionCambiaria
CveConceptoContable = 64 CveConceptoContable = 64
CveCuenta = CveCuentaGanancia CveCuenta = CveCuentaGanancia
idCta = IdCtaGanancia idCta = IdCtaGanancia
TipoMovto = True
Else Else
CveConceptoContable = 65 CveConceptoContable = 65
CveCuenta = CveCuentaPerdida CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida idCta = idCtaPerdida
TipoMovto = False
End If End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
ErrorRegistrar = True ErrorRegistrar = True
@@ -234,7 +270,7 @@ Partial Class Bancos_FluctuacionCambiaria
'movimiento de complementaria 'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
ErrorRegistrar = True ErrorRegistrar = True
Exit For Exit For
End If End If
@@ -242,7 +278,8 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar Then If Not ErrorRegistrar Then
Conta.Commit() Conta.Commit()
Alert("La Fluctuación se ha generado", TipoMensaje.MsgInformacion) Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else Else
Conta.RollBack() Conta.RollBack()
End If End If
@@ -275,7 +312,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotalVentas.Text.ToDecimal Total = LblTotalVentas.Text.ToDecimal
If Total < 0 Then If Total > 0 Then
CveConceptoContable = 64 CveConceptoContable = 64
CveCuenta = CveCuentaGanancia CveCuenta = CveCuentaGanancia
TipoMovto = True TipoMovto = True
@@ -294,7 +331,7 @@ Partial Class Bancos_FluctuacionCambiaria
'saco las cuentas de pérdida y ganancia 'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvVentas.Rows For Each gvr As GridViewRow In GvVentas.Rows
Total = gvr.DataKey("Fluctuacion").ToDecimal Total = -gvr.DataKey("Fluctuacion").ToDecimal
If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then
CveConconceptoCliente = 226 CveConconceptoCliente = 226
@@ -303,7 +340,7 @@ Partial Class Bancos_FluctuacionCambiaria
End If End If
'movimiento de complementaria 'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True ErrorRegistrar = True
Exit For Exit For
End If End If
@@ -311,7 +348,8 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar Then If Not ErrorRegistrar Then
Conta.Commit() Conta.Commit()
Alert("La Fluctuación se ha generado", TipoMensaje.MsgInformacion) Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else Else
Conta.RollBack() Conta.RollBack()
End If End If
@@ -399,7 +437,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar And SeContabilizo Then If Not ErrorRegistrar And SeContabilizo Then
Conta.Commit() Conta.Commit()
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion) Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
CargaDatosCuentas() CargaDatosCuentas()
Else Else
Conta.RollBack() Conta.RollBack()
@@ -591,8 +629,8 @@ Partial Class Bancos_FluctuacionCambiaria
Dim idCtaPerdida, IdCtaGanancia As Integer Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0 Dim CveConceptoContable As Integer = 0
Dim CveCuentaComplementaria As Integer = 0 Dim CveCuentaComplementaria As Integer = 55206
Dim IdCtaComplementaria As Integer = 0 Dim IdCtaComplementaria As Integer = 1081
Dim ErrorRegistrar As Boolean = False Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379 CveCuentaPerdida = 0 '55379
@@ -607,10 +645,12 @@ Partial Class Bancos_FluctuacionCambiaria
CveConceptoContable = 64 CveConceptoContable = 64
CveCuenta = CveCuentaGanancia CveCuenta = CveCuentaGanancia
idCta = IdCtaGanancia idCta = IdCtaGanancia
TipoMovto = True
Else Else
CveConceptoContable = 65 CveConceptoContable = 65
CveCuenta = CveCuentaPerdida CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida idCta = idCtaPerdida
TipoMovto = False
End If End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
ErrorRegistrar = True ErrorRegistrar = True
@@ -624,7 +664,7 @@ Partial Class Bancos_FluctuacionCambiaria
'movimiento de complementaria 'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
ErrorRegistrar = True ErrorRegistrar = True
Exit For Exit For
End If End If

View File

@@ -34,6 +34,7 @@ Partial Class Bancos_RepCxCCliente
'DdlSubProyecto.SelectedValueExist(UsuarioActual.CveSucursal.ToString) 'DdlSubProyecto.SelectedValueExist(UsuarioActual.CveSucursal.ToString)
'[IPP] 8 Enero 2018 - Se quito por que sera reemplazado al cargar solo los subproyectos del usuario '[IPP] 8 Enero 2018 - Se quito por que sera reemplazado al cargar solo los subproyectos del usuario
'If UsuarioActual.TienePermisoProceso(152) Then DdlSubProyecto.Enabled = False 'If UsuarioActual.TienePermisoProceso(152) Then DdlSubProyecto.Enabled = False
If UsuarioActual.Sesion("CobroCliente-Sucursal").ToString <> "" Then DdlSubProyecto.SelectedValueExist(UsuarioActual.Sesion("CobroCliente-Sucursal").ToString.Trim)
InicializaPersonalizarColumnas() InicializaPersonalizarColumnas()
@@ -57,6 +58,7 @@ Partial Class Bancos_RepCxCCliente
If Mov.GetCxCCliente(CveCliente, FechaI, FechaF, DdlMoneda.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then If Mov.GetCxCCliente(CveCliente, FechaI, FechaF, DdlMoneda.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
GvCxC.DataSource = Mov.DtResultados GvCxC.DataSource = Mov.DtResultados
End If End If
UsuarioActual.Sesion("CobroCliente-Sucursal") = DdlSubProyecto.SelectedValue
Mov.Dispose() Mov.Dispose()
GvCxC.DataBind() GvCxC.DataBind()

View File

@@ -2893,6 +2893,32 @@ Partial Class PopUpVerFactura
End If End If
End If End If
Case 42 'ENTRADAS USADOS
Dim ObjAcum As New ClsAcumuladores
Dim DatosEntradasUsados As New DataTable
Dim CveAlmacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", String.Format("Almacen = '{0}'", Almacen))
If ObjAcum.EntradasUsadosGet(UsuarioActual.CveEmpresa, CveAlmacen.ToEntero, Convert.ToDateTime(Fecha.ToString), Convert.ToDateTime(Today.ToString)) Then
DatosEntradasUsados = ObjAcum.DtResultados
End If
ObjAcum.Dispose()
Dim Dia As String = {"lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"}(If((Weekday(Today) - 2) = -1, 7, Weekday(Today) - 2))
Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1)
Dim FechaConFormato As String = String.Format("{0}, {1} de {2} de {3}", Dia, Day(Today), Mes, Year(Today))
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Direccion", Almacen))
params.Add(New ReportParameter("FechaConFormato", FechaConFormato))
params.Add(New ReportParameter("FechaInicial", Fecha))
params.Add(New ReportParameter("FechaFinal", Today.ToString))
params.Add(New ReportParameter("Sucursal", "Sucursal"))
ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepUsadosEntradas.rdlc", UsuarioActual.CveEmpresa), DtMovimientos, params, "Reporte entrada usados", "PDF", "DsInventarios")
End Select End Select
If CveConcepto = 2 Then If CveConcepto = 2 Then

View File

@@ -517,7 +517,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If End If
End If End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False)) CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
'AGREGO PREPOLIZA IE BANCOS 'AGREGO PREPOLIZA IE BANCOS
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
MsgError = "Error al registrar detalle de concepto bancario" MsgError = "Error al registrar detalle de concepto bancario"

243
GPS/RepArrastre.aspx Normal file
View File

@@ -0,0 +1,243 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepArrastre.aspx.cs" Inherits="GPS_RepArrastre" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
#map {
height: 450px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Arrastre
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LnkApagarvehiculo" runat="server">Apagar vehiculo</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle" style="">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<div class="col-md-1 truncate">
Vehiculo:
</div>
<div class="col-md-3 ">
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none;">
<asp:HiddenField ID="HdfVGrafica" ClientIDMode="Static" runat="server" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpInfo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding traspasorow bordered" style="">
<div class="portlet-title">
<div class="caption font-red">
<i class="fa fa-clock-o font-red"></i>
<span class="caption-subject bold uppercase">datos vehiculo</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div id="C_bodyreportes" class="portlet-body rowpadding">
<asp:TextBox ID="TxtFunciones" CssClass="hidden EvalRun" runat="server"></asp:TextBox>
<div class="row">
<div class="col-md-4">
<label style="font-weight: bold;">¿Activar funcion de arrastre?</label>
</div>
<div class="col-md-4">
<asp:CheckBox ID="chkActivarArrastre" CssClass="chksino " AutoPostBack="true" OnCheckedChanged="chkActivarArrastre_CheckedChanged" Text=" " runat="server" />
</div>
<div class="col-md-4">
</div>
</div>
<div class="row">
<div class="col-md-4">
<label style="font-weight: bold;">Velocidad</label>
</div>
<div class="col-md-4">
<asp:Label ID="LblVelocidad" runat="server" Text="Sin Información"></asp:Label>
</div>
<div class="col-md-4">
</div>
</div>
<div class="row">
<div class="col-md-4">
<label style="font-weight: bold;">¿Encendido / Apagado?</label>
</div>
<div class="col-md-4">
<asp:Label ID="LblEncApa" runat="server" Text="Sin Información"></asp:Label>
</div>
<div class="col-md-4">
</div>
</div>
<div class="row">
<div class="col-md-4">
<label style="font-weight: bold;">Fecha ultima Conexión</label>
</div>
<div class="col-md-4">
<asp:Label ID="LblFechaInfo" runat="server" Text="Sin Información"></asp:Label>
</div>
<div class="col-md-4">
</div>
</div>
</div>
</div>
</div>
<asp:Panel runat="server" ID="pnlAlertaActiva" Visible="false" CssClass="col-md-6">
<div id="pulsate-regular" class="portlet light smmallpadding traspasorow bordered" style="">
<div class="portlet-title">
<div class="caption font-red">
<i class="fa fa-clock-o font-red"></i>
<span class="caption-subject bold uppercase">Alerta el vehiculo se encuentra en arrastre</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<%--<a href="javascript:;" class="collapse" data-original-title="" title=""></a>--%>
</div>
</div>
<div class="portlet-body rowpadding">
</div>
</div>
</asp:Panel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="map">
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places"></script>
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
<script>
var image = '/Imagenes/rsz_11rsz_car.png';
var geocoder;
var map;
var markerArrastre;
var markerActual;
var directionsService;
var directionsDisplay;
var polylinesRoute = [];
var directionsDisplayArray = [];
if (jQuery('#pulsate-regular')) {
jQuery('#pulsate-regular').pulsate({
color: "#bf1c56"
});
}
var retorno;
function setCenter(myLatLn) {
map.setCenter(myLatLn);
}
function addmarkerarrastre(myLatLn) {//myLatLn = { lat: -25.363, lng: 131.044 }
if (markerArrastre) {
markerArrastre.setMap(null);
}
markerArrastre = new google.maps.Marker({
position: myLatLn,
map: map,
title: 'Activacion Arrastre'
});
}
function addmarkerActual(myLatLn, Encencido) {//myLatLn = { lat: -25.363, lng: 131.044 } ,addmarkerActual({ lat: -25.363, lng: 131.044 })
var imagen = Encencido == 1 ? '/Imagenes/rsz_11rsz_cargreen.png' : '/Imagenes/rsz_11rsz_car.png';
var markerIcon = { url: imagen, labelOrigin: new google.maps.Point(26, 43) };
if (markerActual) {
markerActual.setMap(null);
}
markerActual = new google.maps.Marker({
position: myLatLn,
map: map,
title: 'Posición Actual',
icon: markerIcon
});
}
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: { lat: 29.0628417, lng: -110.9872448 },
zoom: 13
});
//var ShowDiv1 = document.createElement('div');
//var ShowDivControl = new ShowDiv(ShowDiv1, map);
//ShowDiv1.index = 1;
//ShowDiv1.id = "showdiv1"
//map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1);
//var upControlDiv = document.createElement('div');
//var upControl = new ControlLabels(upControlDiv, map);
//upControlDiv.index = 1;
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(upControlDiv);
//var upGeoDiv = document.createElement('div');
//var upGeo = new ControlGeocercas(upGeoDiv, map);
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(upGeoDiv);
geocoder = new google.maps.Geocoder();
//google.maps.event.addListener(map, "click", function (event) {
// closeLastOpenedInfoWindow();
//});
directionsService = new google.maps.DirectionsService;
directionsDisplay = new google.maps.DirectionsRenderer;
directionsDisplay.setOptions({ suppressMarkers: true });
directionsDisplay.setMap(map);
}
function ADSBegin() {
eval($('.EvalRun').val());
}
initMap();
//$(document).ready(function () {
// initMap();
//});
</script>
</asp:Content>

100
GPS/RepArrastre.aspx.cs Normal file
View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class GPS_RepArrastre : ClsPaginas
{
public int CveDispositivo
{
get
{
if (ViewState["CveDispositivo"] != null)
{
return ViewState["CveDispositivo"].ToString().ToEntero();
}
else
{
return 0;
}
}
set { ViewState["CveDispositivo"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// fijo borrar
//DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(263965, 1928) ;
DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario) ;
DdlDispositivo.DataBind();
getArrastre();
}
}
private void getArrastre()
{
CveDispositivo = DdlDispositivo.SelectedValue.ToEntero();
using (ClsGPS objgps = new ClsGPS())
{
if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
{
DataRow dtrow = objgps.DtResultados.Rows[0];
upInfo(dtrow);
}
}
}
public void upInfo(DataRow dtrow)
{
if ( dtrow != null)
{
LblVelocidad.Text = $"{dtrow["Speed"]:N0}";
LblEncApa.Text = $"{dtrow["EncendidoText"]}";
LblFechaInfo.Text = $"{dtrow["FechaTrama"]:dd/MM/yyyy HH:mm:ss}";
chkActivarArrastre.Checked = dtrow["ArrastreActivo"].ToString() == "1";
pnlAlertaActiva.Visible = dtrow["AlertaArrastre"].ToString() == "1";
//LblVelocidad.Text = $"{dtrow[""]}";
//LblVelocidad.Text = $"{dtrow[""]}";addmarkerActual({ lat: -25.363, lng: 131.044 })
string pVehiculo = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["Lat"], dtrow["Lng"]);
string parrastre = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["LatArrastre"], dtrow["LngArrastre"]);
TxtFunciones.Text = string.Format("addmarkerActual({0},{3}){1};setCenter({2})", pVehiculo, (dtrow["ArrastreActivo"].ToString() == "1" ? $" ;addmarkerarrastre({parrastre})" : ";addmarkerarrastre()"), (dtrow["ArrastreActivo"].ToString() == "1" ? parrastre : pVehiculo), dtrow["Encendido"].ToString().ToEntero());
UpInfo.Update();
}
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
getArrastre();
}
protected void chkActivarArrastre_CheckedChanged(object sender, EventArgs e)
{
using (ClsGPS objgps = new ClsGPS())
{
if (objgps.GPS_ArrastreActivarDesactivar(CveDispositivo, chkActivarArrastre.Checked)){
if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
{
DataRow dtrow = objgps.DtResultados.Rows[0];
upInfo(dtrow);
}
if (chkActivarArrastre.Checked)
{
Alert("se ha activado la funcion de arrastre");
}
else
{
Alert("se ha desactivado la funcion de arrastre");
}
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -55,7 +55,8 @@ Partial Class Inicio
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
If UsuarioActual.CveUsuario = 100 Then 'Reporte de ventas sin registrar sig
If UsuarioActual.TienePermisoProceso(287) Then
Using objgral As New ClsGenerales Using objgral As New ClsGenerales
objgral.RepConciliacionSatDetalleGET(UsuarioActual.CveEmpresa, "I", "", "", 10) objgral.RepConciliacionSatDetalleGET(UsuarioActual.CveEmpresa, "I", "", "", 10)
@@ -67,7 +68,8 @@ Partial Class Inicio
End Using End Using
GvFoliosSAT.DataBind() GvFoliosSAT.DataBind()
End If End If
If UsuarioActual.CveUsuario = 100 Then 'Reporte de ventas pendientes de cancelar
If UsuarioActual.TienePermisoProceso(288) Then
Using objventas As New ClsVentas Using objventas As New ClsVentas
If (GetFacturasCanceladasPendientesWS(objventas, UsuarioActual.Empresa.RFC, UsuarioActual.CveEmpresa, False)) AndAlso objventas.DtResultados.Rows.Count > 0 Then If (GetFacturasCanceladasPendientesWS(objventas, UsuarioActual.Empresa.RFC, UsuarioActual.CveEmpresa, False)) AndAlso objventas.DtResultados.Rows.Count > 0 Then
RegistraScript("$('#ModalMitotereCancelaPendiente').modal();", "mitoterosatCanceladasPendientesWS") RegistraScript("$('#ModalMitotereCancelaPendiente').modal();", "mitoterosatCanceladasPendientesWS")

View File

@@ -89,11 +89,17 @@ Partial Class Inventarios_Default
If dr IsNot Nothing Then If dr IsNot Nothing Then
LtPs.Text = $"Producto: <b>{dr("PSCodigo").ToString}</b>" LtPs.Text = $"Producto: <b>{dr("PSCodigo").ToString}</b>"
Dim CvePrecioLista As Integer = -1
If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista
CvePrecioLista = -2
End If
Dim ObjVta As New ClsVentas Dim ObjVta As New ClsVentas
Dim objPS As New ClsProductosServicios Dim objPS As New ClsProductosServicios
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
If ObjVta.DtResultados.Rows.Count > 0 Then If ObjVta.DtResultados.Rows.Count > 0 Then
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero, -1, DDlPS.SelectedValue.ToEntero) Then If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
If objPS.DtResultados.Rows.Count > 0 Then If objPS.DtResultados.Rows.Count > 0 Then
LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>" LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>"
End If End If

View File

@@ -314,7 +314,7 @@
</div> </div>
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<asp:GridView ID="GVPendientes" runat="server" DataKeyNames="CveVenta" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="200" data-freezerows="1" GridLines="None"> <asp:GridView ID="GVPendientes" runat="server" DataKeyNames="CveVenta,NombreComercial" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="200" data-freezerows="1" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="Serie-Folio" ItemStyle-Width="20%"> <asp:TemplateField HeaderText="Serie-Folio" ItemStyle-Width="20%">
<ItemTemplate> <ItemTemplate>

View File

@@ -1010,7 +1010,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
If DdlClientes.SelectedValue.ToEntero <= 0 Then If DdlClientes.SelectedValue.ToEntero <= 0 Then
Alert("No se ha especificado el cliente", TipoMensaje.MsgError) Alert("No se ha especificado el cliente", TipoMensaje.MsgError)
Exit Sub Exit Sub
@@ -1934,6 +1933,10 @@ Partial Class Inventarios_RecepcionUsados
If ObjVentas.GetVenta(CveRemisionRecibida, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.GetVenta(CveRemisionRecibida, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
EsDistribuidor = CBool(ObjVentas.DtResultados.Rows(0)("EsDistribuidor").ToString()) EsDistribuidor = CBool(ObjVentas.DtResultados.Rows(0)("EsDistribuidor").ToString())
CveCliente = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString().ToEntero() CveCliente = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString().ToEntero()
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCliente = {0}", CveCliente))
DdlClientes.DataBind()
DdlClientes.SelectedValueExist(CveCliente)
End If End If
'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO 'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO
@@ -1959,10 +1962,9 @@ Partial Class Inventarios_RecepcionUsados
DivTotal.Visible = True DivTotal.Visible = True
End If End If
Else Else
DivCliente.Visible = False 'DivCliente.Visible = False
'DivFactura.Visible = False 'DivFactura.Visible = False
End If End If
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
DtUsados = ObjVentas.DtResultados.Copy() DtUsados = ObjVentas.DtResultados.Copy()
End If End If
@@ -2646,7 +2648,7 @@ Partial Class Inventarios_RecepcionUsados
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
If ObjAcum.DtResultados.Rows.Count > 0 Then If ObjAcum.DtResultados.Rows.Count > 0 Then
TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100.0).FormatoNumero
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero

View File

@@ -2651,7 +2651,8 @@ Partial Class Ventas_ClientesAbonar
ObjConta.Commit() ObjConta.Commit()
CargaDatos(CveMonedaFiltro) CargaDatos(CveMonedaFiltro)
RegistraScript("$('#ModalSaldarCuentaIncobrable').modal('hide')") RegistraScript("$('#ModalSaldarCuentaIncobrable').modal('hide')")
Alert("Los movimientos se saldaron correctamente.") Alert(String.Format("Los movimientos se saldaron correctamente. <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else Else
ObjConta.RollBack() ObjConta.RollBack()
Alert(MsgError, TipoMensaje.MsgError) Alert(MsgError, TipoMensaje.MsgError)

View File

@@ -568,8 +568,8 @@
<label for="<%= DdlIEPSPorcentaje.ClientID.ToString()%>">IEPS Porcentaje:</label> <label for="<%= DdlIEPSPorcentaje.ClientID.ToString()%>">IEPS Porcentaje:</label>
</div> </div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright" title="Esta retención tendrá efecto en la facturación siempre y cuando el cliente al cual se facturará tenga activada la opción de Retiene 6% de iva por servicio">
<label>Es OutSourcing </label> <label>Retiene 6% de IVA por Servicios</label>
<asp:CheckBox ID="ChkEsOutSourcing" CssClass="make-switchsd" data-size="small" runat="server" Checked="False" /> <asp:CheckBox ID="ChkEsOutSourcing" CssClass="make-switchsd" data-size="small" runat="server" Checked="False" />
</div> </div>
</div> </div>

View File

@@ -30,28 +30,6 @@ public partial class Ventas_RepConciliacionSat : ClsPaginas
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
//CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
//cryRpt.Load(String.Format("C:\\Proyectos\\wwwSIG\\Empresas\\Grales\\Formatos\\CatPS.rpt", UsuarioActual.Empresa.Ruta));
//System.Data.DataTable DtDatos = new System.Data.DataTable();
//using (ClsProductosServicios ObjPS = new ClsProductosServicios())
//{
// if (ObjPS.GetPSLite(-1, 119, "-1", "-1", "02541", -1, -1, -1, -1))
// {
// DtDatos = ObjPS.DtResultados;
// }
//}
//cryRpt.SetDataSource(DtDatos);
//CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo coninfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
//cryRpt.
////cryRpt.SetDatabaseLogon("JCaudillo", "JCau127*953");// 293357
//reports.ReportSource = cryRpt;
//reports.RefreshReport();
//// reports.Refresh();
DateTime fecha; DateTime fecha;
DateTime fechaInicio = DateTime.Now; DateTime fechaInicio = DateTime.Now;
DateTime fechaFin = DateTime.Now; DateTime fechaFin = DateTime.Now;

View File

@@ -4701,7 +4701,12 @@ Partial Class Ventas
LblTelefono.Text = ObjCliente.Telefono LblTelefono.Text = ObjCliente.Telefono
LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5) LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5)
LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5) LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5)
If UsuarioActual.Empresa.MostrarRetISR AndAlso ObjCliente.RetISR > 0 Then TrRetISR.Style.Add("display", "none") If UsuarioActual.Empresa.MostrarRetISR AndAlso ObjCliente.RetISR > 0 Then
' TrRetISR.Style.Add("display", "none")
TrRetISR.Visible = True
Else
TrRetISR.Visible = False
End If
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
@@ -5935,7 +5940,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
ClienteRetIVA = 0.0D ClienteRetIVA = 0.0D
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
ClienteRetIVA = 0.1D ClienteRetIVA = 0.106667D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then
@@ -6378,7 +6383,8 @@ Partial Class Ventas
Continue For Continue For
End If End If
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then ' si tiene relacionada una OC,
'VALIDA EXISTENCIA 'VALIDA EXISTENCIA
CveProducto = dr("CvePS").ToString.ToEntero CveProducto = dr("CvePS").ToString.ToEntero
CveUnidad = dr("CveUM").ToString.ToEntero CveUnidad = dr("CveUM").ToString.ToEntero
@@ -6908,7 +6914,8 @@ Partial Class Ventas
'ENVIAR POLIZA VIRTUAL 'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
GeneraPolizaVentaWS(ObjFactura) Dim TipoPoliza As Integer = 1
GeneraPolizaVentaWS(ObjFactura, TipoPoliza)
End If End If
End If End If
@@ -10767,7 +10774,7 @@ Partial Class Ventas
Exit For Exit For
End If End If
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") Then If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString.ToEntero < 1 Then
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < Cantidad Then If Existencia < Cantidad Then
OcurrioError = True OcurrioError = True
@@ -14255,7 +14262,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
ClienteRetIVA = 0.0D ClienteRetIVA = 0.0D
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
ClienteRetIVA = 0.1D ClienteRetIVA = 0.106667D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then
@@ -15472,7 +15479,7 @@ Partial Class Ventas
If ConSalida AndAlso Not OcurrioError Then If ConSalida AndAlso Not OcurrioError Then
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura) OcurrioError = GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
End If End If
If Not OcurrioError Then If Not OcurrioError Then
@@ -15739,30 +15746,40 @@ Partial Class Ventas
Try Try
Dim CveMovimientoVirtual As Integer = -1 Dim CveMovimientoVirtual As Integer = -1
Dim CveAlmacenVirtual As Integer = -1 Dim CveAlmacenVirtual As Integer = -1
Dim CveConceptoMovimientoVirtual As Integer = 3 Dim CveConceptoMovimientoVirtual As Integer = 36
Dim DtPSVirtual As DataTable = Nothing Dim DtPSVirtual As DataTable = Nothing
Dim DtTamanios As DataTable = Nothing Dim DtTamanios As DataTable = Nothing
Dim CveMovimientoEntradaDev As Integer = -1 Dim CveMovimientoEntradaDev As Integer = -1
If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then
Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND CveTipoAlmacen = 24 AND CveConcepto = 2 AND CveVenta > 0") Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND ((CveTipoAlmacen = 24 AND CveConcepto = 2) OR (CveTipoAlmacen = 1 AND CveConcepto = 8)) AND CveVenta > 0")
If RowMovimiento IsNot Nothing Then
CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero()
CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero()
Else
OcurrioError = True
End If
CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero()
CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero()
Else Else
OcurrioError = True OcurrioError = True
End If End If
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then
'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then
DtPSVirtual = ObjInventario.DtResultados.Copy() DtPSVirtual = ObjInventario.DtResultados.Copy()
Else Else
OcurrioError = True OcurrioError = True
End If End If
'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
'If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then
' DtPSVirtual = ObjInventario.DtResultados.Copy()
'Else
' OcurrioError = True
'End If
If Not OcurrioError AndAlso DtPSVirtual.Rows.Count > 0 Then If Not OcurrioError AndAlso DtPSVirtual.Rows.Count > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/V") CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/V", CveMovimientoRelacionado:=CveMovimientoEntradaDev)
If CveMovimientoVirtual > 0 Then If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows For Each RowUsado As DataRow In DtPSVirtual.Rows
@@ -15787,7 +15804,7 @@ Partial Class Ventas
OcurrioError = True OcurrioError = True
End Try End Try
Return Not OcurrioError Return OcurrioError
End Function End Function
Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
@@ -23921,22 +23938,23 @@ Partial Class Ventas
GvCodigosUnicos.DataBind() GvCodigosUnicos.DataBind()
End If End If
End Sub End Sub
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura) Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura, TipoPoliza As Integer)
'TipoPoliza: 01 Venta, 02 Ajuste, 03 Garantía
Try Try
For Each Row As GridViewRow In GvCodigosUnicos.Rows For Each Row As GridViewRow In GvCodigosUnicos.Rows
If Row.RowType = DataControlRowType.DataRow Then If Row.RowType = DataControlRowType.DataRow Then
Dim obj As New Modelos.MPolizaVentaWS Dim obj As New Modelos.MPolizaVentaWS
'DATOS DEL CLIENTE 'DATOS DEL CLIENTE
obj.customer_name = ObjFactura.Cliente.Nombre obj.customer_name = ObjFactura.Cliente.Nombre
obj.customer_last_name1 = "" obj.customer_last_name1 = "."
obj.customer_last_name2 = "" obj.customer_last_name2 = ""
obj.customer_birthday = Nothing obj.customer_birthday = Nothing
obj.customer_phone = ObjFactura.Cliente.Telefono obj.customer_phone = ObjFactura.Cliente.Telefono
obj.customer_email = ObjFactura.Cliente.Mail obj.customer_email = ObjFactura.Cliente.Mail
obj.customer_gender = "03" 'OTRO GENERO obj.customer_gender = "03" 'OTRO GENERO
obj.customer_advertising = False obj.customer_advertising = False
obj.customer_car_brand = "00" obj.customer_car_brand = "01"
obj.customer_car_model = "00" obj.customer_car_model = "01"
obj.customer_car_year = ObjFactura.Fecha.Year obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA 'DATOS DE VENTA
@@ -23946,12 +23964,12 @@ Partial Class Ventas
obj.sale_type_service = "02" 'COMERCIAL obj.sale_type_service = "02" 'COMERCIAL
obj.sale_total = ObjFactura.Total obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.Descuento obj.sale_discount = ObjFactura.Descuento
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta) obj.sale_id = ObjFactura.CveVenta.ToString
'DATOS DEL PRODUCTO 'DATOS DEL PRODUCTO
obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString() obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString()
obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE) obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE)
obj.product_sale_type = "01 " 'VENTA obj.product_sale_type = "0" & TipoPoliza 'VENTA
Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime() Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()
@@ -24052,7 +24070,7 @@ Partial Class Ventas
For Each RowServicio As DataRow In TmpDT.Rows For Each RowServicio As DataRow In TmpDT.Rows
Dim ClienteRetIVA = 0.0D Dim ClienteRetIVA = 0.0D
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
ClienteRetIVA = 0.1D ClienteRetIVA = 0.106667D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then

51
reporteador.aspx Normal file
View File

@@ -0,0 +1,51 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="reporteador.aspx.cs" Inherits="reporteador" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="row">
<div class="col-sm-6"></div>
<div class="col-sm-6 text-right">
<asp:LinkButton ID="LnkImprime" CssClass="btn btn-primary " OnClick="LnkImprime_Click" runat="server" >Imprime reporte</asp:LinkButton>
</div>
</div>
<asp:UpdatePanel ID="upDatosRepC" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVParametros" runat="server" GridLines="None" CssClass=" Widthall GVParametros" AutoGenerateColumns="False"
DataKeyNames="Name,EnableNullValue" OnRowDataBound="GVParametros_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Campo">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Name")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Valor">
<ItemTemplate>
<asp:TextBox ID="TxtValor" CssClass="form-control" runat="server" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="No Enviar">
<ItemTemplate>
<asp:CheckBox ID="ChkIsNull" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<%--<CR:CrystalReportViewer ID="reports" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>--%>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

70
reporteador.aspx.cs Normal file
View File

@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class reporteador : ClsPaginas
{
public string rutaArchivo
{
get
{
return ViewState["rutaArchivo"].ToString();
}
set { ViewState["rutaArchivo"] = value; }
}
protected void Page_PreInit(object sender, EventArgs e)
{
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
rutaArchivo = Server.MapPath("~/Empresas/Grales/Formatos/CatPS.rpt");
CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
cryRpt.Load(rutaArchivo);
GVParametros.DataSource = cryRpt.DataDefinition.ParameterFields;
GVParametros.DataBind();
}
}
protected void GVParametros_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CrystalDecisions.Shared.ParameterValues defaultValues = ((CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition)e.Row.DataItem).DefaultValues;
if (defaultValues.Count > 0)
{
e.Row.FCTextBox("TxtValor").Text = defaultValues[0].Description;
}
//CrystalDecisions.Shared.ParameterValues. DefaultValues
}
}
protected void LnkImprime_Click(object sender, EventArgs e)
{
string Formato = "PDF";
List<CrystalParametro> lista = new List<CrystalParametro>();
CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
cryRpt.Load(rutaArchivo);
foreach (GridViewRow gvRow in GVParametros.Rows)
{
if (gvRow.RowType == DataControlRowType.DataRow)
{
lista.Add(new CrystalParametro(gvRow.DataKey("Name"), gvRow.FCTextBox("TxtValor").Text));
}
}
ImprimirbytesPDF(ImprimirPDFCrystal(rutaArchivo, (new System.Data.DataTable()), lista, "Productos y Servicios", Formato), "Productos y Servicios", Formato);
}
}