This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-02-20 11:52:28 -07:00
39 changed files with 3708 additions and 881 deletions

View File

@@ -3,6 +3,11 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Derecha {
text-align: right;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte Entradas Usados Clientes
@@ -72,15 +77,78 @@
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView runat="server" ID="GvDatos" data-sort="true" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros seleccionados" ToolTip="Listado de Movimientos" DataKeyNames="Codigo,Codigo_Clientes,Total" CssClass="Widthall table table-striped table-hover ScrollAD" GridLines="None">
<asp:GridView runat="server" ID="GvDatos" data-sort="true" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros seleccionados"
ToolTip="Listado de Movimientos" DataKeyNames="Codigo,Codigo_Clientes,Total,CveCliente,NombreComercial" CssClass="Widthall table table-striped table-hover ScrollAD" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Tipo" DataField="Codigo"/>
<asp:BoundField HeaderText="Clientes/Grupos" DataField="Codigo_Clientes"/>
<asp:BoundField HeaderText="Cantidad" DataField="Total" DataFormatString="{0:N0}"/>
<asp:BoundField HeaderText="Tipo" DataField="Codigo" />
<asp:BoundField HeaderText="Clientes/Grupos" DataField="Codigo_Clientes" />
<asp:BoundField HeaderText="Cantidad" DataField="Total" DataFormatString="{0:N0}" />
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<%--OnClick="CargarVentasGrupo"--%>
<asp:LinkButton ID="LnkCantidad" CommandName="Mostrar" OnCommand="CargarVentasGrupo" Text='<%# Eval("Total", "{0:N0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div id="ModalVentasAvance" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" style="width: 700px;">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label Text="Ventas del agrupador" ID="LbTituloModalVentasAvance" runat="server" /></h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpVentasAvance" UpdateMode="Conditional">
<ContentTemplate>
<table>
<tr>
<td>Cliente: </td>
<td>
<asp:Label ID="LbCliente" Text="123" Font-Bold="true" runat="server" /></td>
</tr>
<tr>
<td>Tamaño: </td>
<td>
<asp:Label ID="LbTam" Text="123" Font-Bold="true" runat="server" /></td>
</tr>
</table>
<div style="overflow-y: auto; height: 400px;">
<asp:GridView ID="GvVentas" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados"
CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:HyperLinkField HeaderText="Folio" DataTextField="SerieFolio" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Fecha" DataTextField="Fecha" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Sucursal" DataTextField="SubProyecto" Target="_blank" ItemStyle-Width="15%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Cantidad" DataTextField="Cantidad" Target="_blank" ItemStyle-Width="5%" ItemStyle-CssClass="Derecha" DataTextFormatString="{0:###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Total" DataTextField="Total" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Derecha" DataTextFormatString="{0:###,###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -49,7 +49,7 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
Dim Acum As New ClsAcumuladores
If Acum.EntradasUsadosClientesRep(CveAlmacen, FechaI, FechaF, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = Acum.DtResultados.FiltraParametros("Codigo_Clientes <> 'Total:'") 'los renglones generados con esta caracteriztica son con un grouping set en la consulta, se pueden quitar
GvDatos.DataSource = Acum.DtResultados.FiltraParametros("Codigo_Clientes <> 'Total:'") 'los renglones generados con esta caracteriztica son con un grouping set en la consulta, se pueden quitar
DatosEntradasUsadosClientes = Acum.DtResultados.FiltraParametros("Codigo_Clientes <> 'Total:'")
End If
@@ -61,18 +61,11 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'If e.Row.DBCampo("EsHeader").ToString = "-1" Or e.Row.DBCampo("Codigo").ToString = "" Then
' e.Row.CssClass = "SubTotales2"
'End If
If e.Row.DBCampo("TipoHeader").ToString = "1" Then
e.Row.CssClass = "Totales"
ElseIf e.Row.DBCampo("TipoHeader").ToString = "2" Then
e.Row.CssClass = "SubTotales"
ElseIf e.Row.DBCampo("TipoHeader").ToString = "3" Then
e.Row.CssClass = "SubTotales2"
End If
End If
If e.Row.DBCampo("EsHeader").ToString = "-1" Or e.Row.DBCampo("Codigo").ToString = "" Then
e.Row.CssClass = "SubTotales2"
End If
End If
End Sub
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs)
@@ -96,4 +89,19 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
End Sub
Public Sub CargarVentasGrupo(sender As Object, e As EventArgs)
Dim tempLink As LinkButton = CType(sender, LinkButton)
Dim renglon As GridViewRow = CType(tempLink.NamingContainer, GridViewRow)
LbCliente.Text = renglon.DataKey("NombreComercial")
LbTam.Text = renglon.DataKey("Codigo")
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetUsadosClasificacionVentas(renglon.DataKey("CveCliente"), renglon.DataKey("Codigo"), TxtFechaI.Text, TxtFechaF.Text) Then
GvVentas.DataSource = ObjAcum.DtResultados
End If
ObjAcum.Dispose()
GvVentas.DataBind()
RegistraScript("$('#ModalVentasAvance').modal();")
End Sub
End Class

View File

@@ -1039,6 +1039,29 @@ Public Class ClsAcumuladores
Return Retorno
End Function
Public Function GetUsadosClasificacionVentas(CveCliente As Integer, Codigo As String, FechaInicio As String, FechaFin As String) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_UsadosClasificacionVentas")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los datos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#Region " IDisposable Support "

View File

@@ -3341,11 +3341,11 @@ Public Class ClsBancos
End Try
Return Retorno
End Function
End Function
#End Region
#Region "PagosCajaChica"
Public Function GetPagosCajaChica(FechaI As String, FechaF As String, CveEmpresa As Integer, CveCuenta As Integer) As Boolean
Public Function GetPagosCajaChica(FechaI As String, FechaF As String, CveEmpresa As Integer, CveCuenta As Integer, Optional TipoPago As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_BancosCajaChicaPagosGet")
@@ -3354,6 +3354,7 @@ Public Class ClsBancos
.Add("@FechaF", SqlDbType.VarChar).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@TipoChequeEfectivo", SqlDbType.Int).Value = TipoPago
End With
Try
@@ -3364,10 +3365,10 @@ Public Class ClsBancos
End Try
Return Retorno
End Function
End Function
#End Region
#Region "ACTIVOS FIJOS"
Public Function GetActivosFijosCreditos(CveCredito As Integer, CveActivoFijo As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -1605,7 +1605,7 @@ Public Class ClsCompProveedores
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
.Add("@CveTipoContrato", SqlDbType.VarChar).Value = TipoContrato
.Add("@TipoContrato", SqlDbType.VarChar).Value = TipoContrato
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -1684,6 +1684,228 @@ Public Class ClsCompProveedores
Return Retorno
End Function
Public Function AddContrato(Contrato As String, CveTipoContrato As Integer, CveSubProyecto As Integer, CveProveedor As Integer, CveRepresentanteLegal As Integer, FechaInicio As Date, FechaFin As Date, Estatus As Boolean,
CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Prov_SAT_ContratosAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@Contrato", SqlDbType.VarChar).Value = Contrato
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al guardar el contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateContrato(CveContrato As Integer, Contrato As String, CveTipoContrato As Integer, CveSubProyecto As Integer, CveProveedor As Integer, CveRepresentanteLegal As Integer, FechaInicio As Date,
FechaFin As Date, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Prov_SAT_ContratosUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@Contrato", SqlDbType.VarChar).Value = Contrato
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetContrato(CveContrato As Integer, CveSubProyecto As Integer, CveProveedor As Integer, CveTipoContrato As Integer, CveRepresentanteLegal As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Prov_SAT_ContratosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
.Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al Obtener los contratos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveContrato(CveContrato As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Prov_SAT_ContratosRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AddRePresentanteLegal(RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Prov_SAT_CatRepresentanteLegalAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@RepresentanteLegal", SqlDbType.VarChar).Value = RepresentanteLegal
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar el representante.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateRePresentanteLegal(CveRepresentanteLegal As Integer, RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Prov_SAT_CatRepresentanteLegalUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
.Add("@RepresentanteLegal", SqlDbType.VarChar).Value = RepresentanteLegal
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el representante.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetRePresentanteLegal(CveRepresentanteLegal As Integer, CveEmpresa As Integer, Optional CveProveedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Prov_SAT_CatRepresentanteLegalGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los representantes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveRePresentanteLegal(CveRepresentanteLegal As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Prov_SAT_CatRepresentanteLegalRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el representante.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
' IDisposable

View File

@@ -1074,7 +1074,7 @@ Public Class ClsContPAQi
StrSQL.AppendLine(" INNER JOIN Polizas p ON mp.IdPoliza = p.Id ")
StrSQL.AppendLine(" INNER JOIN Cuentas c ON c.Id = mp.IdCuenta ")
StrSQL.AppendLine(" INNER JOIN TiposPolizas t ON mp.TipoPol = t.Codigo ")
StrSQL.AppendLine(" LEFT JOIN SIG_Resp_OIC.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ")
StrSQL.AppendLine(" LEFT JOIN SERVIDOR.Ventas.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ")
StrSQL.AppendLine(" LEFT JOIN SegmentosNegocio s ON mp.IdSegNeg = s.id ")
StrSQL.AppendLine(" WHERE (@IdPoliza = -1 OR mp.IdPoliza = @IdPoliza) ")
StrSQL.AppendLine(" AND (@Eje = -1 OR mp.Ejercicio = @Eje) ")

View File

@@ -4671,8 +4671,9 @@ Public Class ClsPaginas
PaginaDict.Add("/PortalProveedor/PortalProveedor.aspx".ToUpper(), 1201)
PaginaDict.Add("/Edoc/CatDocumentos.aspx".ToUpper(), 1205)
PaginaDict.Add("/Edoc/CatTipoContratos.aspx".ToUpper(), -1)
PaginaDict.Add("/Edoc/CatDocumentosContratos.aspx".ToUpper(), -1)
PaginaDict.Add("/Edoc/CatTipoContratos.aspx".ToUpper(), 1207)
PaginaDict.Add("/Edoc/CatDocumentosContratos.aspx".ToUpper(), 1208)
PaginaDict.Add("/Edoc/Contratos.aspx".ToUpper(), 1209)
'Portal
PaginaDict.Add("/AIMMGM/ConsultaCliente.aspx".ToUpper(), -1)

View File

@@ -3914,14 +3914,14 @@ Public Class ClsVentas
#End Region
Public Function RepIngresos(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoDocto As String, CveSubProyecto As Integer) As Boolean
Public Function RepIngresos(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoDocto As String, Cves_Subprotectos As String) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Ventas_RepIngresos", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@TipoDoc", SqlDbType.VarChar).Value = TipoDocto
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Cves_Subprotectos", SqlDbType.VarChar).Value = Cves_Subprotectos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try

View File

@@ -14,6 +14,7 @@ Imports System.Net
Imports System.IO.Compression
Imports System.Text
Imports System.Net.Http
Imports System.Collections.Generic
Namespace Modelos
@@ -539,7 +540,64 @@ Namespace Modelos
Public Property CveEstatus As Integer
End Class
Public Function RegenerarPrePolizas(Optional TransaccionCompartida As SqlClient.SqlTransaction = Nothing, Optional ObjACTransac As ClsContPAQi = Nothing) As Boolean
Dim ErrorPrePolizas As Boolean = False
Dim ObjVentas As ClsVentas = Nothing
If TransaccionCompartida IsNot Nothing Then
ObjVentas = New ClsVentas(TransaccionCompartida)
Else
ObjVentas = New ClsVentas()
ObjVentas.IniciaTransacSQL()
End If
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
Dim ObjAC As ClsContPAQi = Nothing
If ObjACTransac Is Nothing Then
If UsuarioActual.Empresa.UsaAC Then
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
End If
Else
ObjAC = ObjACTransac
End If
ErrorPrePolizas = Not RegeneracionPolizas(Me, ObjVentas, ObjAC, ObjConta, ObjBancos, ObjEventos)
If TransaccionCompartida Is Nothing Then
ObjVentas.Commit()
ObjVentas.Dispose()
ObjBancos.Dispose()
ObjEventos.Dispose()
End If
If ObjACTransac Is Nothing Then
If ObjAC IsNot Nothing Then
ObjAC.Commit()
ObjAC.Dispose()
End If
End If
Return Not ErrorPrePolizas
End Function
Private Function RegeneracionPolizas(ObjFactura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos, ObjEventos As ClsOIEventos) As Boolean
Dim ErrorPrePolizas As Boolean = False
'REMOVEMOS LOS CONCEPTOS DE LA PREPOLIZA
ErrorPrePolizas = Not ObjConta.RemovePrePolizasDetalle(ObjFactura.CvePrePoliza, -1, ObjFactura.CveVenta, 2)
'VUELVE A GENERAR LAS PREPOLIZAS
If Not ErrorPrePolizas Then
ErrorPrePolizas = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, ValorMultiplicador:=1, ObjBancos:=ObjBancos, ObjVentas:=ObjVentas, ObjEventos:=ObjEventos, DtRemisionesRelacionadas:=New DataTable, SeCancelaRemisionProceso:=False,
CancelarRemisiones:=False, ListaRemisionesCancelar:=New List(Of Integer))
End If
If Not ErrorPrePolizas Then ErrorPrePolizas = GuardarVentaImpuestosLocales(ObjFactura, ObjVentas, ObjConta, 1)
Return Not ErrorPrePolizas
End Function
Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional ObjContPaqTransac As ClsContPAQi = Nothing) As MMensajeFactura
Dim Retorno As New MMensajeFactura()
@@ -1059,7 +1117,7 @@ Namespace Modelos
Return Retorno
End Function
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = true) As Byte()
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try
@@ -6067,7 +6125,7 @@ Namespace Modelos
End Set
End Property
Public ReadOnly Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
Public ReadOnly Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
@@ -6085,7 +6143,7 @@ Namespace Modelos
GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
End Property
Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable
Get

View File

@@ -70,6 +70,15 @@
</div>
<label class="col-md-1 truncate" style="width: 80px;">Tipo Pago:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipoPago" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
<asp:ListItem Value="13" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="3" Text="Cheque"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
@@ -114,7 +123,8 @@
<asp:label runat="server">Importe seleccionado: $</asp:label><asp:label runat="server" ID="lblValorTotal">00.00</asp:label>
</div>
<br />
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, IdCtaContableBancos, IdCtaContClientes, Importe" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None">
<div style="height:575px;overflow-x:scroll">
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, IdCtaContableBancos, IdCtaContClientes, Importe" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
@@ -141,6 +151,12 @@
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Pago">
<ItemTemplate>
<asp:Literal ID="LtTipoPago" runat="server" ClientIDMode="Static" Text='<%# Eval("TipoPago")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Literal ID="LtImporte" runat="server" ClientIDMode="Static" Text='<%# Eval("Importe", "{0:N2}")%>'></asp:Literal>
@@ -152,6 +168,7 @@
<RowStyle Font-Size="Smaller" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -41,7 +41,7 @@ Partial Class Bancos_DepositosCaja
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero)
ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero, DdlTipoPago.SelectedValue.ToEntero)
GvFacturas.DataSource = ObjBancos.DtResultados
ObjBancos.Dispose()

View File

@@ -617,8 +617,8 @@ Partial Class Bancos_PopIECompras
MovimientoPagar = New IEMovimiento
MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal
MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal
MovimientoPagar.IVADeducible = dr("IVADeducible").ToString.ToDecimal
MovimientoPagar.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal
MovimientoPagar.IVADeducible = dr("IVADeducible").ToString.ToDecimal.RoundSQL
MovimientoPagar.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal.RoundSQL
MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal
MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal
MovimientoPagar.Total = dr("Total").ToString.ToDecimal
@@ -1982,6 +1982,75 @@ Partial Class Bancos_PopIECompras
End If
End If
End If
Case 285 'Ret IVA x Acreditar Acreditable Servicios
If MovimientoPagar.ConceptoRetIVA = 5 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 286 'Ret IVA Acreditable Servicio
If MovimientoPagar.ConceptoRetIVA = 5 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(582).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(582).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
'Case 16 'Ret ISR X Acreditar
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
@@ -2280,7 +2349,7 @@ Partial Class Bancos_PopIECompras
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVADeducible * PorcentajePago
ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago).RoundSQL
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago)
@@ -2579,8 +2648,8 @@ Partial Class Bancos_PopIECompras
End If
ObjCreditos.Dispose()
Else
IdCtaContable = CtaProveedor
CveCuenta = CveCuentaProveedor
IdCtaContable = IdCuentaBancaria
CveCuenta = CveCuentaCliente
End If
Else
IdCtaContable = IdCtaContComplementaria
@@ -2675,6 +2744,8 @@ Partial Class Bancos_PopIECompras
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = tipoCambioPago
IdCtaContable = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal).FiltroPrimeroValor("IdCtaContPersonal", "").ToEntero
Else
ImporteMovimiento = 0
End If
@@ -3146,7 +3217,7 @@ Partial Class Bancos_PopIECompras
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
'MsgError = ObjMov.MensajePolizaDescuadre
MsgError = ObjMov.MensajePolizaDescuadre
GuardaLogAD($"Bancos/PopIECompras | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If
End If

View File

@@ -1261,6 +1261,72 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
End If
Case 285 'Ret IVA x Acreditar Acreditable Servicios
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
importeMX = Math.Round(importeMX, 2)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 286 'Ret IVA Acreditable Servicio
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
importeMX = Math.Round(importeMX, 2)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(582).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(582).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
'Case 16 'Ret ISR X Acreditar
' If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then

View File

@@ -104,6 +104,15 @@ Partial Class Compras_Compras
Set(ByVal value As List(Of String))
ViewState("ListaDocumentos") = value
End Set
End Property
Public Property TieneAnticiposXML As Boolean
Get
TieneAnticiposXML = DirectCast(ViewState("TieneAnticiposXML"), Boolean)
End Get
Set(ByVal value As Boolean)
ViewState("TieneAnticiposXML") = value
End Set
End Property
Private Property DTOCTemp As DataTable
@@ -873,6 +882,7 @@ Partial Class Compras_Compras
Private Property Descuentos As Decimal = 0
Private Property Amortizaciones As Decimal = 0
Private Property EmisorRFC As String
Private Property ReceptorRFC As String
Private Property TrasladoIVA As Decimal = 0
@@ -1116,6 +1126,7 @@ Partial Class Compras_Compras
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
'ImgBtnBuscarOC.Attributes.Add("data-placement", "top")
CargaDatosAgregarPS()
TieneAnticiposXML = False
Modalidad = ""
Version = ""
CveMetodoPago = -1
@@ -1405,8 +1416,11 @@ Partial Class Compras_Compras
End If
'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
LblSaldoFactura.Text = If(CveCompra > 0, Saldo.FormatoNumero, TxtTotal.Text.FormatoNumero)
LblSaldoFactura.Text = If(CveCompra > 0, Saldo.FormatoNumero, TxtTotal.Text.FormatoNumero)
'cuando es factura con amortizacion, el importe a descontar es el saldo que se debe de aplicar para la amortizacion
If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 Then
LblSaldoFactura.Text = TmpDT.SUMD("Descuento").ToString
End If
If UsuarioActual.CveEmpresa = 126 And CveCompra > 0 Then
LnkExportaGv.Visible = True
@@ -1829,6 +1843,20 @@ Partial Class Compras_Compras
VerVales.Visible = True
End If
If TieneAnticiposXML Then 'si tiene anticipos, limpia los descuentos
'LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
TxtDescuento.Text = "0.00"
LblAmortizacion.Text = Descuentos.FormatoNumero
'limpia los descuentos
For Each drr As DataRow In TmpDT.Rows
'drr("Total") = drr("Total").ToString.ToDecimal + drr("Descuento").ToString.ToDecimal
drr("Amortizacion") = drr("Descuento") 'pasamos el importe de descuento a amortizacion
drr("Descuento") = 0.00
Next
Amortizaciones = Descuentos
Descuentos = 0
End If
Dim Msg As String = ""
@@ -2127,7 +2155,7 @@ Partial Class Compras_Compras
Private Sub ValidacionesTotalesXml()
Dim Msg As String = ""
Dim SubtotalTemp = TmpDT.SUM("Total") + Math.Round(TmpDT.SUM("Descuento"), 2)
Dim SubtotalTemp = TmpDT.SUM("Total") + Math.Round(TmpDT.SUM("Descuento") + Math.Round(TmpDT.SUM("Amortizacion")), 2)
Dim DescuentosTemp = TmpDT.SUM("Descuento")
Dim Subtotal2Temp = TmpDT.SUM("Total")
Dim IVATemp = TmpDT.SUM("IVA")
@@ -4369,7 +4397,7 @@ Partial Class Compras_Compras
'METODO DE PREPOLIZA DE ALMACEN
If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
If ImporteAlmacen > 0 Then
If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
If (CveImportacion > 0 Or CveFlete > 0) Then
@@ -4403,10 +4431,17 @@ Partial Class Compras_Compras
End If
'hay amortización directa como descuento. RMF Temporal
If UsuarioActual.CveEmpresa = 119 Then
If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then
TxtDescuento.Text = LblAmortizacion.Text
LblAmortizacion.Text = "0.00"
End If
'If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then
' TxtDescuento.Text = LblAmortizacion.Text
' LblAmortizacion.Text = "0.00"
'End If
'o si el descuento es igual a la amortizacion
'If LblAmortizacion.Text.ToDouble = TxtDescuento.Text.ToDouble Then
' TxtDescuento.Text = LblAmortizacion.Text
' LblAmortizacion.Text = "0.00"
'End If
End If
'Compra
@@ -6175,36 +6210,31 @@ Partial Class Compras_Compras
Else
importeMovimiento = 0
End If
Case 285 'Perdida
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero
Case 285 'Ret IVA 6% Servicios
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
'If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' If ObjConta.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
' CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero
' End If
'End If
If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
If CveMoneda = 2 Then
importeMN = TmpDT.SUMD("RetIVA") * TxtTC.Text.ToDecimal
Else
importeMN = TmpDT.SUMD("RetIVA")
importeMovimiento = TmpDT.SUMD("RetIVA")
End If
Else
importeMovimiento = 0
End If
If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
If CveMoneda = 2 Then
importeMN = TmpDT.SUMD("RetIVA") * TxtTC.Text.ToDecimal
Else
importeMN = TmpDT.SUMD("RetIVA")
importeMovimiento = TmpDT.SUMD("RetIVA")
End If
Else
importeMovimiento = 0
End If
Case 6 'Compra
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
@@ -6784,6 +6814,7 @@ Partial Class Compras_Compras
Else
ErrorPrepoliza = True
Exit For
Exit For
End If
' FLUCTUACION CAMBIARIA
@@ -7014,7 +7045,7 @@ Partial Class Compras_Compras
Exit For
End If
If TxtTotal.Text.ToDouble > 0 Then
If TxtTotal.Text.ToDouble > 0 AndAlso TieneAnticiposXML = False Then
importeMNNC = importeMovimientoNC * tipoCambioActual * Multiplicador
IdCtaContable = CtaProveedorExtranjera ' CtaProveedorAnticiposExtranjera
CveCuenta = CveCuentaProveedorExtranjera 'CveCuentaProveedorAnticiposExtranjera
@@ -7116,7 +7147,7 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
End If
If TxtTotal.Text.ToDouble > 0 Then
If TxtTotal.Text.ToDouble > 0 AndAlso TieneAnticiposXML = False Then
Dim IdCtaContablePago As Integer = CtaProveedor
Dim CveCuentaPago As Integer = CveCuentaProveedor
Dim usacomplementariaProveedor As Boolean = False
@@ -7177,15 +7208,19 @@ Partial Class Compras_Compras
Dim PorcentajePagoAnt As Decimal = importeMovimiento / If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDecimal)
Dim ImporteIVA As Decimal = Math.Round(PorcentajePagoAnt * TxtIVA.Text.ToDecimal, 2)
'Agregamos el 14
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
'Agregamos el 19
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
If ImporteIVA <> 0 Then
'Agregamos el 14
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
'Agregamos el 19
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
End If
End If
@@ -7210,7 +7245,19 @@ Partial Class Compras_Compras
Next
importeMovimiento = 0
End If
End If
'Case 205
' If TxtTotal.Text.ToDecimal = 0 And DdlTipoComprobante.SelectedValue = "Fac" Then
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=True) Then
' ErrorPrepoliza = True
' Exit For
' End If
' End If
End Select
If ErrorPrepoliza Then
@@ -7490,10 +7537,11 @@ Partial Class Compras_Compras
End Select
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Ant.Importe, " ", CveConceptoAnt, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=Ant.Importe) Then
' ImporteAnticipo += Ant.Importe ' RESTO DEL IMPORTE POR SI QUEDA DIFERENCIA DE LA SUMA DE LOS ANTICIPOS Y EL PROVEEDOR TIENE QUE PAGAR
'movimiento de pago proveedor, --no se regisra porque no se registra el total de la compra como deuda del proveedor, solo lo que queda a deber
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, Ant.Importe, " ", CveConceptoPago, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=Ant.Importe) Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Ant.Importe, " ", CveConceptoAnt, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=Ant.Importe) Then
' ImporteAnticipo += Ant.Importe ' RESTO DEL IMPORTE POR SI QUEDA DIFERENCIA DE LA SUMA DE LOS ANTICIPOS Y EL PROVEEDOR TIENE QUE PAGAR
'movimiento de pago proveedor, --no se regisra porque no se registra el total de la compra como deuda del proveedor, solo lo que queda a deber
'si es l moviemiento es de amortizacion con descuento, no registra el pago, ya esta descontado
If TieneAnticiposXML = False AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, Ant.Importe, " ", CveConceptoPago, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=Ant.Importe) Then
ErrorMovtosCxP = True
End If
PorcentajePago = (Ant.Importe) / TxtTotal.Text.ToDecimal
@@ -7861,8 +7909,8 @@ Partial Class Compras_Compras
'ACTUALIZA CVEFACTURA
If Request("CveFactura") IsNot Nothing Then
If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then
ErrorOC = True
If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then
TieneError = True
End If
If UsuarioActual.Empresa.UsaAC Then
@@ -8119,9 +8167,11 @@ Partial Class Compras_Compras
Contador += 1
'If gvr.DataKey("Fecha").ToDate > Fecha Then Fecha = gvr.DataKey("Fecha").ToDate 'guardo la fecha mayor
Importe += gvr.FCTextBox("TxtAnticipo").Text.ToDouble
If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then gvr.FCTextBox("TxtAnticipo").Text = "" : gvr.FCCheckBox("Chk").Checked = False
If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then gvr.FCTextBox("TxtAnticipo").Text = "" : gvr.FCCheckBox("Chk").Checked = False
End If
Next
Next
Else
Contador = 1
End If
@@ -9055,7 +9105,8 @@ Partial Class Compras_Compras
Next
End If
LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
UpPS.Update()
End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAnticipos"))
@@ -10107,6 +10158,7 @@ Partial Class Compras_Compras
If documento.Attributes("UUID").Value <> "" Then
ListaDocumentos.Add(documento.Attributes("UUID").Value)
End If
TieneAnticiposXML = True
Next
End If
End If
@@ -10275,10 +10327,11 @@ Partial Class Compras_Compras
e.Row.BackColor = Drawing.Color.LightGray
Else
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(3).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Saldo").ToDouble = 0 Then e.Row.FCLiteral("LtlAnticipos").Text = ""
If e.Row.DBCampo("Saldo").ToDouble = 0 Then e.Row.FCLiteral("LtlAnticipos").Text = ""
Dim ImporteAmortizacion As Decimal = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDecimal)
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDouble)), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDouble)), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
If ChkNCInv.Checked Then
e.Row.FCCheckBox("Chk").CssClass = "ChkAntNC"
@@ -10291,6 +10344,8 @@ Partial Class Compras_Compras
Entro = True
End If
Next
'permite vincular otro folio fiscal.
Entro = True
If Not Entro Then e.Row.FCCheckBox("Chk").Enabled = False
End If
End If
@@ -10602,6 +10657,7 @@ Partial Class Compras_Compras
DTConceptos.Columns.Add("Descuento", GetType(Double))
DTConceptos.Columns.Add("IVA", GetType(Double))
DTConceptos.Columns.Add("Total", GetType(Double))
DTConceptos.Columns.Add("Amortizacion", GetType(Double))
End Sub
'Private Sub AddPS(Cantidad As Double, UM As String, PS As String, PU As Double, IVA As Double, Descuento As Double, Optional Total As Double = 0)
' Dim Row As DataRow = Nothing
@@ -11949,14 +12005,19 @@ Partial Class Compras_Compras
#End Region
#Region " AJUSTA IMPORTES "
Private Sub AjustaImporteUltimoConcepto(ImporteAjuste As Decimal, Optional EsCarga As Boolean = False)
'Dim TempSubTotal = TxtSubTotal.Text.ToDouble
Private Sub AjustaImporteUltimoConcepto(ImporteAjuste As Decimal, Optional EsCarga As Boolean = False)
'Dim TempSubTotal = TxtSubTotal.Text.ToDouble
Dim Amortizacion As Decimal = 0
If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
Amortizacion = LblAmortizacion.Text.ToDecimal
End If
If TmpDT.Rows.Count > 0 Then ' si hay movimientos y si esta afectando al total, que se haga el ajuste
'Dim ImporteAjuste As Decimal = Total - (SubTotal2 + IVA - RetencionIVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos)
Dim Indice As Integer = If(TmpDT.Rows(TmpDT.Rows.Count - 1)("CvePS").ToString = UsuarioActual.Empresa.Funcionalidad(112).ToString, TmpDT.Rows.Count - 2, TmpDT.Rows.Count - 1)
Dim tPU As Decimal
Dim tPU As Decimal
If TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal > 0 Then
tPU = ImporteAjuste / TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal
Else
@@ -11973,7 +12034,7 @@ Partial Class Compras_Compras
Descuentos = TmpDT.SUM("Descuento").ToString.ToDecimal
End If
TxtSubTotal.Text = (SubTotal + Descuentos).FormatoNumero()
TxtSubTotal2.Text = SubTotal.FormatoNumero
TxtSubTotal2.Text = (SubTotal - Amortizacion).FormatoNumero
TxtDescuento.Text = Descuentos.FormatoNumero()
SubTotalConceptos = SubTotal
GvPS.DataSource = TmpDT : GvPS.DataBind()
@@ -14851,8 +14912,12 @@ Partial Class Compras_Compras
'If DdlOCVinculaInv.SelectedValue.ToEntero = 237 And Not CveFlete > 0 Then Alert("Necesita vincular un flete si selecciona Factura de Flete", TipoMensaje.MsgAdvertencia) : Exit Sub
'If DdlOCVinculaInv.SelectedValue.ToEntero = 240 And Not CveImportacion > 0 Then Alert("Necesita vincular una Importación si selecciona Factura de Importación", TipoMensaje.MsgAdvertencia) : Exit Sub
Dim SubTotalGV = 0.0D
Dim SubTotalCompra = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteSinImpuestos"), TmpDT.SUM("Total").ToString.ToDecimal)
Dim SubTotalGV = 0.0D
Dim Amortizacion As Decimal = TmpDT.SUMD("Total")
If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
Amortizacion = TmpDT.SUMD("ImporteSinImpuestos")
End If
Dim SubTotalCompra As Decimal = Amortizacion
Dim DiferenciaPermitida = 1
Dim Cont = 0
For Each gvr As GridViewRow In GvOC1.Rows
@@ -14919,7 +14984,14 @@ Partial Class Compras_Compras
If gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Or VinculacionCompleta Then
TotalRows += 1
End If
Next
Next
Dim TieneAmortizacion As Boolean = False
If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
TieneAmortizacion = True
End If
For Each gvr As GridViewRow In GvOC1.Rows
If gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Or VinculacionCompleta Then
dr = DTOCGV.Rows(gvr.RowIndex)
@@ -14951,7 +15023,7 @@ Partial Class Compras_Compras
Dim RetISR As Double = dr("RetISRPorcentaje").ToString.ToDecimal
Dim IEPSPS As Double = dr("IEPSPSPorcentaje").ToString.ToDecimal
Dim IEPSPSIVA As Double = dr("IEPSPSIVAPorcentaje").ToString.ToDecimal
Dim Descuento As Double = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TxtDescuento.Text.ToDouble / TotalRows, gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal)
Dim Descuento As Double = If(TieneAmortizacion, TxtDescuento.Text.ToDouble / TotalRows, gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal)
'Dim Descuento As Double = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal
Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero
Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero
@@ -15000,11 +15072,10 @@ Partial Class Compras_Compras
AddPS2(False)
'AJUSTE DE REDONDEO O DIFERENCIA PERMITIDA DE IMPORTE
AjustaImporteUltimoConcepto((If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal2.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal))
'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal))
AjustaImporteUltimoConcepto((If(TieneAmortizacion, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal2.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(TieneAmortizacion, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal))
'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal))
BtnGuardar.Enabled = True
If Not CierrePeriodo Then
BtnGuardar.Visible = True
@@ -16480,6 +16551,16 @@ Partial Class Compras_Compras
Dim Amortizacion As Decimal = 0
If UsuarioActual.CveEmpresa = 119 Then
Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
TxtSubTotal.Text = (TxtSubTotal.Text.ToDouble + Amortizacion).ToString
End If
Dim TieneAmortizacion As Boolean = False
If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
TieneAmortizacion = True
End If
If CveCompra < 0 AndAlso Not TieneAmortizacion Then
LblAmortizacion.Text = "0.00"
End If
TempSubTotal = TxtSubTotal.Text.ToDouble
@@ -16491,7 +16572,7 @@ Partial Class Compras_Compras
TempIEPS = TxtIEPS.Text.ToDouble
TempRetIVA = TxtRetIVA.Text.ToDouble
TempRetISR = TxtRetISR.Text.ToDouble
TempTotal = Math.Round(TempSubTotal2 + TempIVA + TempIEPS - TempRetIVA - TempRetISR - TxtOtrosImpuestos.Text.ToDouble, 2)
TempTotal = Math.Round(TempSubTotal2 + TempIVA + TempIEPS - TempRetIVA - TempRetISR - TxtOtrosImpuestos.Text.ToDouble - Amortizacion, 2)
DifTotales = TxtTotal.Text.ToDouble - TempTotal
Dim DiferenciaPermitida = 0.6

View File

@@ -603,6 +603,51 @@
</div>
</div>
</div>--%>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Representastes Legales</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="reload" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
<a href="javascript:;" class="remove" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<asp:GridView ID="GvRepresentante" runat="server" AutoGenerateColumns="False" DataKeyNames="CveRepresentanteLegal" EmptyDataText="No se encontraron Representantes" Width="100%"
ToolTip="Listado de representantes" CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Representante" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlProveedor" runat="server" Text='<%# Eval("RepresentanteLegal") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%--
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton runat="server" ID="LnkEliminar" OnClick="LnkGvRepresentantesEliminar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>--%>
</Columns>
</asp:GridView>
</div>
</div>
</div>

View File

@@ -380,6 +380,9 @@ Partial Class Compras_Proveedores
End If
HlEvento.Visible = True
HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveProveedor=" & CveProveedor & "&TB_iframe=true&height=370&width=600;"
CargaRepresentantes()
Else
'Configuración de Modalidad Insert
@@ -500,6 +503,30 @@ Partial Class Compras_Proveedores
'ViewState("OUsuario") = "Usuario DESC"
End Sub
Private Sub CargaRepresentantes()
If CveProveedor > 0 Then
Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa, CveProveedor) Then
GvRepresentante.DataSource = ObjProveedores.DtResultados
Else
GvRepresentante.DataSource = Nothing
End If
ObjProveedores.Dispose()
GvRepresentante.DataBind()
End If
End Sub
Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1)
If UsuarioActual.Empresa.UsaContabilidad Then
Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)

View File

@@ -424,7 +424,7 @@ Partial Class Compras_ReembolsosComprobaciones
If UsuarioActual.CveEmpresa.Contiene(119) Then
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones1", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveCajaChica > 0 Then
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
@@ -448,7 +448,7 @@ Partial Class Compras_ReembolsosComprobaciones
Else
If drp IsNot Nothing Then
If drp("IdPoliza").ToString.ToEntero > 0 Then
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones2", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
IdPoliza = drp("IdPoliza").ToString.ToEntero
Else
CvePrePolizaIERegistrado = drp("CvePrePoliza").ToString.ToEntero
@@ -464,14 +464,14 @@ Partial Class Compras_ReembolsosComprobaciones
End If
If ChkChequeExcedente.Checked Then
CvePrePolizaExcedente = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CvePrePolizaExcedente = ObjMov.AddPrePolizas("Compras/Comprobaciones3", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIEExcedente = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaExcedente, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, If(CveCajaChica > 0, 30, 29), TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEExcedente, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
MsgError = "Error al registrar detalle de concepto bancario"
End If
End If
ElseIf Not ChkReembolsarSinBancos.Checked Then
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones4", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIERegistrado = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
'AGREGO PREPOLIZA IE BANCOS
@@ -506,7 +506,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
Else
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones5", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'SI ES CAJA CHICA REGISTRO IE CAJA CHICA
If CveCajaChica > 0 Then
@@ -635,7 +635,7 @@ Partial Class Compras_ReembolsosComprobaciones
CvePrePolizaPago = CvePrePolizaIERegistrado
'SE USARA PARA PODER ELIMINAR UNA COMPROBACION
CvePrePolizaPagoOriginal = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, ImporteMovto, ImporteMovto, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", $"Compra: { gvr.DataKey("SerieFolio").ToString }", TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CvePrePolizaPagoOriginal = ObjMov.AddPrePolizas("Compras/Comprobaciones6", 9, ImporteMovto, ImporteMovto, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", $"Compra: { gvr.DataKey("SerieFolio").ToString }", TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'registramos el nuevo IE
@@ -979,7 +979,7 @@ Partial Class Compras_ReembolsosComprobaciones
ImporteMovto = ImportePagar
If ImportePagar = ImporteOriginal Then
CvePrePolizaPago = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, ImporteMovto, ImporteMovto, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", $"Compra: { gvr.DataKey("SerieFolio").ToString }", TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CvePrePolizaPago = ObjMov.AddPrePolizas("Compras/Comprobaciones7", 9, ImporteMovto, ImporteMovto, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", $"Compra: { gvr.DataKey("SerieFolio").ToString }", TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'registramos el nuevo IE
If CveCajaChica > 0 Then
CveIEPago = 0

View File

@@ -61,11 +61,11 @@
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvTxtFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpRL"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="rfvTxtFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo es requerido por la aplicación, por favor ingrese una fecha."></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvTxtFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ></asp:CompareValidator>
<%-- <asp:RequiredFieldValidator ID="rfvTxtFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo es requerido por la aplicación, por favor ingrese una fecha."></asp:RequiredFieldValidator>--%>
<ajax:ValidatorCalloutExtender ID="cvcTxtFechaI" runat="server" HighlightCssClass="vco" TargetControlID="cvTxtFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="rfvcTxtFechaI" runat="server" HighlightCssClass="vco" TargetControlID="rfvTxtFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<%--<ajax:ValidatorCalloutExtender ID="rfvcTxtFechaI" runat="server" HighlightCssClass="vco" TargetControlID="rfvTxtFechaI" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
@@ -80,11 +80,11 @@
<%-- <ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>--%>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvImgFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpRL"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="rfvImgFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo es requerido por la aplicación, por favor ingrese una fecha."></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvImgFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ></asp:CompareValidator>
<%--<asp:RequiredFieldValidator ID="rfvImgFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo es requerido por la aplicación, por favor ingrese una fecha."></asp:RequiredFieldValidator>--%>
<ajax:ValidatorCalloutExtender ID="cvcImgFechaF" runat="server" HighlightCssClass="vco" TargetControlID="cvImgFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="rfvcImgFechaF" runat="server" HighlightCssClass="vco" TargetControlID="rfvImgFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<%--<ajax:ValidatorCalloutExtender ID="rfvcImgFechaF" runat="server" HighlightCssClass="vco" TargetControlID="rfvImgFechaF" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
@@ -158,7 +158,7 @@
<asp:TemplateField ControlStyle-CssClass="template" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100" HeaderText="Vencimiento" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlVencimiento" runat="server" Text='<%# Eval("Vencimiento") %>'></asp:Literal>
<asp:Literal ID="LtlVencimiento" runat="server" Text='<%# Eval("Vencimiento", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
@@ -226,7 +226,7 @@
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" HeaderText="Cargar">
<ItemTemplate>
<asp:LinkButton ID="ImgUpload" runat="server" AlternateText="Editar" CausesValidation="False"
<asp:LinkButton ID="ImgUpload" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="UploadModal_ClickDocumentacion"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload' title='Subir documento' ></i>" />
</ItemTemplate>
</asp:TemplateField>
@@ -281,6 +281,55 @@
</asp:UpdatePanel>
<div id="ModalUploadDoc" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalReferenciasVerificacion" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<asp:UpdatePanel ID="UpModalTitleUploadDocumento" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<h4 class="modal-title">
<asp:Literal ID="LtlModalUploadTitulo" runat="server"></asp:Literal></h4>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UPModalUploadDoc" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtFileDocumentacion" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="btnUploadFileDoc" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Scripts/DataTables.js"></script>

View File

@@ -37,9 +37,160 @@ Partial Class Proveedores_RepDocumentacionProveedor
Set(value As DataTable)
ViewState("DTHeaders") = value
End Set
End Property
End Property
#Region "UPLOAD"
Property CveDocumentacionElectronica As Integer
Get
If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CvePersonalClienteDocumentacion") = value
End Set
End Property
Property CveDocumentacion As Integer
Get
If ViewState("CveDocumentacion") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CveDocumentacion"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CveDocumentacion") = value
End Set
End Property
Property Documentacion As String
Get
If ViewState("Documentacion") Is Nothing Then
Return "-1"
Else
Return ViewState("Documentacion").ToString
End If
End Get
Set(value As String)
ViewState("Documentacion") = value
End Set
End Property
Property AdjuntoDocumentacion As String
Get
If ViewState("AdjuntoDocumentacion") Is Nothing Then
Return ""
Else
Return ViewState("AdjuntoDocumentacion").ToString
End If
End Get
Set(value As String)
ViewState("AdjuntoDocumentacion") = value
End Set
End Property
Property DiasVigencia As Integer
Get
If ViewState("DiasVigencia") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("DiasVigencia"), Integer)
End If
End Get
Set(value As Integer)
ViewState("DiasVigencia") = value
End Set
End Property
Property AplicaFechaVencimiento As Boolean
Get
If ViewState("AplicaFechaVencimiento") Is Nothing Then
Return True
Else
Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean)
End If
End Get
Set(value As Boolean)
ViewState("AplicaFechaVencimiento") = value
End Set
End Property
Private Property FechaVigencia As Date
Get
If ViewState("FechaVigencia") Is Nothing Then
Return Nothing
Else
Return ViewState("FechaVigencia").ToString.ToDate
End If
End Get
Set(value As Date)
ViewState("FechaVigencia") = value
End Set
End Property
Property Estatus As Integer
Get
If ViewState("Estatus") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("Estatus"), Integer)
End If
End Get
Set(value As Integer)
ViewState("Estatus") = value
End Set
End Property
Property ObservacionDocumentacion As String
Get
If ViewState("ObservacionDocumentacion") Is Nothing Then
Return ""
Else
Return ViewState("ObservacionDocumentacion").ToString
End If
End Get
Set(value As String)
ViewState("ObservacionDocumentacion") = value
End Set
End Property
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
Return Date.Now.AddDays(15)
Else
Return ViewState("FechaLimite").ToString.ToDate
End If
End Get
Set(value As Date)
ViewState("FechaLimite") = value
End Set
End Property
Property CveProveedor As Integer
Get
If ViewState("CveProveedor") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("CveProveedor"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CveProveedor") = value
End Set
End Property
#End Region
Private Sub Proveedores_RepDocumentacionProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
@@ -125,7 +276,7 @@ Partial Class Proveedores_RepDocumentacionProveedor
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
Dim Documentacion As String = e.Row.DataKey("Documentacion")
Dim CveDocumentacionElectronica As Integer = e.Row.DataKey("CveDocumentacionElectronica").ToEntero
Dim ImgRechazar As LinkButton = e.Row.FCLinkButton("ImgRechazar")
@@ -185,9 +336,9 @@ Partial Class Proveedores_RepDocumentacionProveedor
ImgDownLoad.Visible = True
If extencion.Length > 0 Then
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, Documentacion & "." & extencion)
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica & "." & extencion)
Else
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, Documentacion)
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica)
End If
@@ -324,56 +475,149 @@ Partial Class Proveedores_RepDocumentacionProveedor
End Function
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
'Protected Sub BrnProcesar_Click(sender As Object, e As EventArgs)
' Dim chkEstatus As CheckBox
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
Documentacion = GvRow.DataKey("Documentacion")
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
CveProveedor = GvRow.DataKey("CveProveedor").ToEntero
'DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero
Dim x As String = GvRow.DataKey("AplicaFechaVencimiento")
If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False
If GvRow.DataKey("Adjunto").ToString.Length > 0 Then
FechaVigencia = GvRow.DataKey("Adjunto").ToString.ToDate
Else
FechaVigencia = Nothing
End If
Estatus = GvRow.DataKey("Estatus").ToEntero
'If chkEstatus.Checked Then
' Estatus = 1
'Else
' Estatus = 0
'End If
ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
LtlModalUploadTitulo.Text = "Subir " & Documentacion
UpModalTitleUploadDocumento.Update()
RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
End Sub
' Dim objEdoc As New ClsEdocumentacion
' objEdoc.IniciaTransacSQL()
Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click
' Dim ErrorProceso As Boolean = False
Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
Dim Filename As String = ""
Dim ErrorProceso As Boolean = False
' For Each GvRow As GridViewRow In GvDocumentos.Rows
If AplicaFechaVencimiento And DiasVigencia > 0 Then
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
End If
For Each fileItem As Archivo In Filesgral
' Dim RDBAcptar As RadioButton = GvRow.FCRadioButton("RDBAcptar")
' Dim RDBRechazar As RadioButton = GvRow.FCRadioButton("RDBRechazar")
' Dim ContactoMail As String = GvRow.DataKey("ContactoMail")
Try
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Dim tempArray() As String
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
' If RDBAcptar.Checked Or RDBRechazar.Checked Then
' Dim Estatus As Integer = If(RDBAcptar.Checked, 3, 1)
' Dim Obsebaciones As String = If(RDBAcptar.Checked, "", GvRow.FCTextBox("TxtObservaciones").Text)
Dim TempCveDocumentacionElectronica As Integer = 0
Dim objEdoc As New ClsEdocumentacion
objEdoc.IniciaTransacSQL()
If CveDocumentacionElectronica = -1 Then
CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
If CveDocumentacionElectronica > 0 Then
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
ErrorProceso = True
End If
End If
Else
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
ErrorProceso = True
End If
End If
' If Not objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, Estatus,
' If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate,
' GvRow.DataKey("FechaVigencia").ToDate) Then
' ErrorProceso = True
' Exit For
' Else
If Not ErrorProceso = True Then
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
Try
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\")
End If
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
File.Delete(rutaAdjuntoAnterior)
End If
If System.IO.File.Exists(rutaDestino) Then
System.IO.File.Delete(rutaDestino)
End If
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
Catch ex As Exception
GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
ErrorProceso = True
End Try
End If
If Not ErrorProceso Then
objEdoc.Commit()
Alert("Documento cargado correctamente")
Else
objEdoc.RollBack()
Alert("Error al cargar archivo", TipoMensaje.MsgError)
End If
objEdoc.Dispose()
CargaDocumentacion()
TxtFileDocumentacion.Text = ""
UPModalUploadDoc.Update()
Catch ex As Exception
OnError("Error al cargar archivo", ex)
End Try
Next
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
End Sub
' If Estatus = 1 Then
' 'Enviar correo rechazo con obserbación
' End If
' End If
' Else
' 'Enviar correo archivo pediente
' End If
' Next
' If ErrorProceso Then
' objEdoc.RollBack()
' Else
' objEdoc.Commit()
' Alert("Proceso Terminado correctamente.")
' End If
' objEdoc.Dispose()
'End Sub

View File

@@ -1,4 +1,4 @@
<%@ Page Title="RH - Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentos.aspx.vb" Inherits="RH_CatDocumentos" %>
<%@ Page Title="Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentos.aspx.vb" Inherits="RH_CatDocumentos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">

View File

@@ -1,4 +1,4 @@
<%@ Page Title="RH - Catálogo de Géneros" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoContratos.aspx.vb" Inherits="Edoc_CatTipoContrato" %>
<%@ Page Title="Tipo De Contrato" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoContratos.aspx.vb" Inherits="Edoc_CatTipoContrato" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
@@ -57,7 +57,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkActualizar" runat="server" OnClick="LnkGvActualizar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
<asp:LinkButton ID="LnkActualizar" runat="server" OnClick="LnkGvActualizar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ValidationGroup="GrpGV" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">

View File

@@ -43,6 +43,7 @@ Partial Class Edoc_CatTipoContrato
GvDatos.DataBind()
UpDatos.Update()
End Sub
@@ -89,7 +90,9 @@ Partial Class Edoc_CatTipoContrato
If Not ErrorProceso Then
RegistraScript(String.Format("$('#{0}').modal('HIDE');", "DivAgregarTiposContrato"))
Alert($"Tipo Contrato { If(CveTipoContrato > 0, "Actualizado", "Agregado") } correctamente.")
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposContrato"))
CargaDatos()
End If

285
Edoc/Contratos.aspx Normal file
View File

@@ -0,0 +1,285 @@
<%@ Page Title="Contratos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Contratos.aspx.vb" Inherits="Proveedores_Contratos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<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="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Contratos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="BtnAgregarContratoModal" data-toggle="tooltip" data-placement="left" title="Agregar Contrato " Text="<i class='fa fa-plus'></i> Agregar Contrato"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveContrato,Contrato,CveProveedor,NombreComercial,CveSubProyecto,CveTipoContrato,CveRepresentanteLegal,FechaInicio, FechaFin,Estatus" EmptyDataText="No se encontraron contratos" Width="100%"
ToolTip="Listado Contratos" CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlNombreComercial" runat="server" Text='<%# Eval("NombreComercial") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sub Proyecto">
<ItemTemplate>
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Contrato">
<ItemTemplate>
<asp:Literal ID="LtlContrato" runat="server" Text='<%# Eval("Contrato") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Contrato">
<ItemTemplate>
<asp:Literal ID="LtlTipocontrato" runat="server" Text='<%# Eval("Tipocontrato") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha I." ItemStyle-Width="100" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlFechaInicio" runat="server" Text='<%# Eval("FechaInicio", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha F." ItemStyle-Width="100" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlFechaFin" runat="server" Text='<%# Eval("FechaFin", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Representante">
<ItemTemplate>
<asp:Literal ID="LtlRepresentanteLegal" runat="server" Text='<%# Eval("RepresentanteLegal") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkActualizar" runat="server" OnClick="LnkGvActualizar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ValidationGroup="GrpGV" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton runat="server" ID="LnkEliminar" OnClick="LnkGvEliminar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div id="DivAgregarContrato" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalContrato" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Contrato</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtContrato" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true" Width="500px" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtContrato" runat="server" ControlToValidate="TxtContrato" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Contrato''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardaContrato"></asp:RequiredFieldValidator>
<label for="TxtContrato" >Contrato:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright" style="width:500px!important">
<label for="DdlProveedores" >Proveedor:</label>
<ADS:Dropdownlost ID="DdlProveedores" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" ></ADS:Dropdownlost>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="DdlTipoContrato">Tipo Contrato:</label> <br />
<asp:DropDownList ID="DdlTipoContrato" CssClass="form-control input-sm select2me" runat="server" DataTextField="TipoContrato" DataValueField="CveTipoContrato" Width="500px" AutoPostBack="True">
<asp:ListItem Selected="true" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlTipoContrato" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlTipoContrato" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardaContrato"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="DdlSubProyecto">Sub Proyecto:</label><br />
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="500px" AutoPostBack="True">
<asp:ListItem Selected="true" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlSubProyecto" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardaContrato"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="DdlSubProyecto">Representante Legal:</label><br />
<asp:DropDownList ID="DDlRePresentanteLegal" CssClass="form-control input-sm select2me" runat="server" DataTextField="RepresentanteLegal" DataValueField="CveRepresentanteLegal" Width="500px" >
<asp:ListItem Selected="true" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDDlRePresentanteLegal" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DDlRePresentanteLegal" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardaContrato"></asp:RequiredFieldValidator>
<i></i>
<asp:Button ID="BtnCatRepresentantes" OnClick="BtnCatRepresentantes_Click" runat="server" CssClass="btn btn-primary btn-sm" Text="+" CommandArgument="Clientes" Visible="true" style="vertical-align:bottom!important" />
</div>
<br />
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="col-md-2" for="<%= TxtFechaInicio.ClientID.ToString()%>">Fecha Inicio:</label>
<div class=" input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="margin-right: 10px!important">
<asp:TextBox ID="TxtFechaInicio" Style="margin-top: 10px" Width="100" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<span class="input-group-btn " style="position: absolute; right: 41px; top: 0px;">
<asp:LinkButton ID="ImgCalendarTxtFechaInicio" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:CalendarExtender runat="server" ID="CalendarTxtFechaInicio" TargetControlID="TxtFechaInicio" PopupButtonID="ImgCalendarTxtFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<asp:RequiredFieldValidator ID="RfvtxtFechaInicio" runat="server" ControlToValidate="txtFechaInicio" Display="None" ErrorMessage="El campo <b>''Fecha Inicio''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardaContrato" ></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="RfvctxtFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RfvtxtFechaInicio" Width="100px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-2" for="<%= TxtFechaFin.ClientID.ToString()%>">Fecha Fin:</label>
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFechaFin" Width="100" Style="margin-top: 10px" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<span class="input-group-btn " style="position: absolute; right: 41px; top: 0px;">
<asp:LinkButton ID="ImgCalendarTxtFechaFin" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaFin" PopupButtonID="ImgCalendarTxtFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvTxtFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="El campo <b>''Fecha Fin''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardaContrato" ></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CXRfvTxtFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaFin" Width="100px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div ID="CheckActiveSection" runat="server" class="form-group form-md-line-input input-iconright">
<label for="ChkEstatus">Activo:</label>&nbsp;
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
<i></i>
</div>
</div>
<br />
<div class="modal-footer">
<asp:Button ID="BtnAgregarModalContrato" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpGuardaContrato" />
<button id="Button" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="DivAgregarContrato2" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalRepresentante" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal1" runat="server">Representante Legal</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRepresentanteLegal" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtRepresentanteLegal" runat="server" ControlToValidate="TxtRepresentanteLegal" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Representante''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardaRepresentante"></asp:RequiredFieldValidator>
<label for="TxtContrato">Representante:</label>
<i></i>
</div>
<br />
<asp:GridView ID="GvRepresentante" runat="server" AutoGenerateColumns="False" DataKeyNames="CveRepresentanteLegal" EmptyDataText="No se encontraron Representantes" Width="100%"
ToolTip="Listado de representantes" CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Representante" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlProveedor" runat="server" Text='<%# Eval("RepresentanteLegal") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton runat="server" ID="LnkEliminar" OnClick="LnkGvRepresentantesEliminar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
</div>
<div class="modal-footer">
<asp:Button ID="BtnAgregarRepresentante" OnClick="BtnAgregarRepresentante_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpGuardaRepresentante" />
<button id="BtnCancelar" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script>
</script>
</asp:Content>

277
Edoc/Contratos.aspx.vb Normal file
View File

@@ -0,0 +1,277 @@
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Proveedores_Contratos
Inherits ClsPaginas
Protected Property CveContrato As Integer
Get
If ViewState("CveContrato") Is Nothing Then
Return -1
Else
Return ViewState("CveContrato").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveContrato") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
CargaCombos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjProv As New ClsCompProveedores
If ObjProv.GetContrato(-1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjProv.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjProv.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
Private Sub CargaCombos()
'CargaProveedores
DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
DdlProveedores.SelectedText = "Todos"
DdlProveedores.SelectedValue = "-1"
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoContrato.Items.Clear()
Dim ObjProveedor As New ClsCompProveedores
If ObjProveedor.GetTiposContratos(-1, UsuarioActual.CveEmpresa, 1) Then
DdlTipoContrato.DataSource = ObjProveedor.DtResultados
End If
ObjProveedor.Dispose()
DdlTipoContrato.DataBind()
DdlTipoContrato.Items.Insert(0, New ListItem("Seleccione", "-1"))
CargaRepresentantes()
End Sub
Protected Sub BtnAgregarContratoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarContratoModal.Click
CveContrato = -1
ChkEstatus.Checked = True
TxtContrato.Text = ""
DdlProveedores.txtValue.Value = ""
DdlProveedores.txtText.Value = ""
DdlTipoContrato.SelectedValueExist("-1")
DdlSubProyecto.SelectedValueExist("-1")
DDlRePresentanteLegal.SelectedValueExist("-1")
TxtFechaInicio.Text = ""
TxtFechaFin.Text = ""
ChkEstatus.Checked = True
BtnAgregarModalContrato.Text = "Agregar"
UpModalContrato.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarContrato"))
End Sub
Protected Sub LnkGvActualizar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveContrato = GvRow.DataKey("CveContrato").ToEntero
TxtContrato.Text = GvRow.DataKey("Contrato")
DdlProveedores.txtValue.Value = GvRow.DataKey("CveProveedor")
DdlProveedores.txtText.Value = GvRow.DataKey("NombreComercial")
DdlTipoContrato.SelectedValueExist(GvRow.DataKey("CveTipoContrato"))
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DDlRePresentanteLegal.SelectedValueExist(GvRow.DataKey("CveRepresentanteLegal"))
TxtFechaInicio.Text = GvRow.DataKey("FechaInicio").ToString.ToDate().ToString("dd/MM/yyyy")
TxtFechaFin.Text = GvRow.DataKey("FechaFin").ToString.ToDate().ToString("dd/MM/yyyy")
ChkEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus"))
BtnAgregarModalContrato.Text = "Actualizar"
UpModalContrato.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarContrato"))
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarModalContrato.Click
If DdlProveedores.txtValue.Value.ToEntero <= 0 Then
Alert("Debe seleccionar un proveedor", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjProv As New ClsCompProveedores
ObjProv.IniciaTransacSQL()
Dim ErrorProceso As Boolean = False
If CveContrato = -1 Then
If Not ObjProv.AddContrato(TxtContrato.Text, DdlTipoContrato.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlProveedores.txtValue.Value.ToEntero, DDlRePresentanteLegal.SelectedValue.ToEntero,
TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
End If
Else
If Not ObjProv.UpdateContrato(CveContrato, TxtContrato.Text, DdlTipoContrato.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlProveedores.txtValue.Value.ToEntero, DDlRePresentanteLegal.SelectedValue.ToEntero,
TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
End If
End If
If Not ErrorProceso Then
ObjProv.Commit()
ObjProv.Dispose()
If CveContrato > 0 Then
Alert("Contrato Actualizado Correctamente.")
Else
Alert("Contrato Agregado Correctamente.")
End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarContrato"))
CargaDatos()
Else
ObjProv.RollBack()
ObjProv.Dispose()
End If
End Sub
Protected Sub LnkGvEliminar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim ErrorProceso As Boolean = False
Dim CveTipoContratoEliminar As Integer = GvRow.DataKey("CveTipoContrato").ToEntero
Dim ObjProv As New ClsCompProveedores
If ObjProv.RemoveContrato(CveTipoContratoEliminar, UsuarioActual.CveEmpresa) Then
Alert("Tipo Contrato eliminado correctamente")
Else
ErrorProceso = True
End If
ObjProv.Dispose()
If Not ErrorProceso Then
CargaDatos()
End If
End Sub
Protected Sub BtnCatRepresentantes_Click(sender As Object, e As EventArgs)
TxtRepresentanteLegal.Text = ""
RegistraScript(String.Format("$('#{0}').modal('show');", "DivAgregarContrato2"), "frm2")
UpModalRepresentante.Update()
End Sub
Protected Sub BtnAgregarRepresentante_Click(sender As Object, e As EventArgs)
Dim ObjProv As New ClsCompProveedores
If ObjProv.AddRePresentanteLegal(TxtRepresentanteLegal.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("Se agrego representante correctamente.")
TxtRepresentanteLegal.Text = ""
End If
ObjProv.Dispose()
CargaRepresentantes()
End Sub
Private Sub CargaRepresentantes()
Dim ObjProv As New ClsCompProveedores
If ObjProv.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa) Then
GvRepresentante.DataSource = ObjProv.DtResultados
DDlRePresentanteLegal.DataSource = ObjProv.DtResultados
Else
GvRepresentante.DataSource = Nothing
End If
ObjProv.Dispose()
DDlRePresentanteLegal.Items.Clear()
DDlRePresentanteLegal.DataBind()
DDlRePresentanteLegal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
GvRepresentante.DataBind()
UpModalRepresentante.Update()
UpModalContrato.Update()
End Sub
Protected Sub LnkGvRepresentantesEliminar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveRepresentanteLegal As Integer = GvRow.DataKey("CveRepresentanteLegal").ToEntero
Dim ObjProv As New ClsCompProveedores
If ObjProv.RemoveRePresentanteLegal(CveRepresentanteLegal, UsuarioActual.CveEmpresa) Then
Alert("Representante eliminado correctamente.")
End If
ObjProv.Dispose()
CargaRepresentantes()
End Sub
End Class

View File

@@ -490,6 +490,215 @@
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.44125cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox20">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Sum(Fields!Cantidad.Value)</Value>
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
<Format>#,0;(#,0)</Format>
<Language>es-MX</Language>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox20</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox21">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Total Productos</Value>
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox23">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox23</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox37">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox37</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox41">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontSize>8pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox41</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox42">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontSize>8pt</FontSize>
<Format>#,0.00;(#,0.00)</Format>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox42</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
@@ -509,13 +718,19 @@
</TablixMember>
<TablixMember>
<Group Name="Details" />
<TablixMembers>
<TablixMember />
</TablixMembers>
</TablixMember>
<TablixMember>
<KeepWithGroup>Before</KeepWithGroup>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>DsInventarios</DataSetName>
<Top>0.07056cm</Top>
<Left>0.00711cm</Left>
<Height>0.73434cm</Height>
<Height>1.17559cm</Height>
<Width>19.56807cm</Width>
<Style>
<Border>
@@ -524,10 +739,10 @@
</Style>
</Tablix>
</ReportItems>
<Height>0.42708in</Height>
<Height>0.68252in</Height>
<Style />
</Body>
<Width>7.70923in</Width>
<Width>7.72259in</Width>
<Page>
<PageHeader>
<Height>5.08094cm</Height>

View File

@@ -15,6 +15,9 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LnkPDF" OnClick="LnkPDF_Click" runat="server"><i class="fa fa-ad-pdf "></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel "></i> Excel</asp:LinkButton>
</li>

View File

@@ -5,7 +5,9 @@ using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class General_CATIEPSxEntidadFed : ClsPaginas
using Microsoft.Reporting.WebForms;
using System.Data;
public partial class General_CATIEPSxEntidadFed : ClsPaginas
{
#region Propiedades
private int RAgrupador
@@ -25,15 +27,18 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
}
private string RfechaInicio
{
get { return (ViewState["RfechaInicio"] == null) ? "-1": (ViewState["RfechaInicio"]).ToString(); }
get { return (ViewState["RfechaInicio"] == null) ? "-1" : (ViewState["RfechaInicio"]).ToString(); }
set { ViewState["RfechaInicio"] = value; }
}
private string RfechaFin
{
get { return (ViewState["RfechaFin"] == null) ? "-1": (ViewState["RfechaFin"]).ToString(); }
get { return (ViewState["RfechaFin"] == null) ? "-1" : (ViewState["RfechaFin"]).ToString(); }
set { ViewState["RfechaFin"] = value; }
}
private DataTable DtIEPS{
get { return (ViewState["DtIEPS"] == null) ? null : (DataTable)(ViewState["DtIEPS"]); }
set { ViewState["DtIEPS"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
@@ -50,8 +55,8 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
RtasaIEPS = Request["tasaIEPS"] == null ? -1 : Request["tasaIEPS"].ToString().ToDecimal();
RfechaInicio = Request["fechaInicio"] == null ? string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1)) : Request["fechaInicio"].ToString();
RfechaFin = Request["fechaFin"] == null ? string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth()) : Request["fechaFin"].ToString();
DdlEstado .SelectedValueExist( RcveEstado.ToString());
DdlIeps.SelectedValueExist ( RtasaIEPS.ToString());
DdlEstado.SelectedValueExist(RcveEstado.ToString());
DdlIeps.SelectedValueExist(RtasaIEPS.ToString());
TxtIEPSfechaInicio.Text = $"{RfechaInicio:dd/MM/yyyy}";
TxtIEPSfechaFin.Text = $"{RfechaFin:dd/MM/yyyy}";
@@ -65,6 +70,7 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
ClsGenerales ObjIEPS = new ClsGenerales();
ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, 119, RAgrupador);
GVIEPSxEntidadFed.DataSource = ObjIEPS.DtResultados;
DtIEPS = ObjIEPS.DtResultados;
ObjIEPS.Dispose();
GVIEPSxEntidadFed.DataBind();
upDatosIEPS.Update();
@@ -73,7 +79,7 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
protected void GVIEPSxEntidadFed_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
if (e.Row.RowType == DataControlRowType.DataRow)
{
int cveGrupo = e.Row.DBCampo("CveGrupo").ToEntero();
if (cveGrupo == 1)
@@ -92,14 +98,28 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
RAgrupador = DdlAgrupador.SelectedValue.ToEntero();
RcveEstado = DdlEstado.SelectedValue.ToEntero();
RtasaIEPS = DdlIeps.SelectedValue.ToDecimal();
RfechaInicio = TxtIEPSfechaInicio.Text.ToDate().ToString("yyyy/MM/dd") ;
RfechaInicio = TxtIEPSfechaInicio.Text.ToDate().ToString("yyyy/MM/dd");
RfechaFin = TxtIEPSfechaFin.Text.ToDate().ToString("yyyy/MM/dd");
CargaIEPSxEntidadFed();
CargaIEPSxEntidadFed();
}
protected void LnkExcel_Click(object sender, EventArgs e)
{
GVIEPSxEntidadFed.ExportToExcelx("IEPS porEntidad Federativa");
}
protected void LnkPDF_Click(object sender, EventArgs e)
{
List<ReportParameter> paramList = new List<ReportParameter>();
paramList.Add(new ReportParameter("Logo", String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)));
paramList.Add(new ReportParameter("FechaInicio", TxtIEPSfechaInicio.Text));
paramList.Add(new ReportParameter("FechaFin", TxtIEPSfechaFin.Text));
paramList.Add(new ReportParameter("Agrupador", DdlAgrupador.SelectedValue));
paramList.Add(new ReportParameter("Empresa", UsuarioActual.Empresa.Empresa));
paramList.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
paramList.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString("d/M/yyyy")));
ImprimirPDF("Empresas/Grales/Formatos/CatIepsEntidadFed.rdlc", DtIEPS, paramList,"IEPS por entidades federativa",RDSName:"DsInventarios");
}
}

View File

@@ -787,7 +787,7 @@ Partial Class Inventarios_TraspasoAlmacen
CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble,
CveChofer:=If(ChkTransitorio.Checked, DdlChofer.SelectedValue.ToEntero, -1), Placa:=If(ChkTransitorio.Checked, TxtPlaca.Text.Trim, "-1"), FechaEntrega:=If(ChkTransitorio.Checked, TxtFechaEntrega.Text.Trim.ToDateTime.ToString("dd/MM/yyyy"), "-1"), EspecifUnidad:=If(ChkTransitorio.Checked, TxtEspecifUnidad.Text.Trim, "-1"),
ResponsableCarga:=If(ChkTransitorio.Checked, TxtResponsableCarga.Text.Trim, "-1"), ResponsableRecibio:=If(ChkTransitorio.Checked, TxtResponsableRecibio.Text.Trim, "-1"), Identificacion:=If(ChkTransitorio.Checked, TxtIdentificacion.Text.Trim, "-1"), Domicilio:=If(ChkTransitorio.Checked, TxtDomicilio.Text.Trim, "-1"),
Telefono:=If(ChkTransitorio.Checked, TxtTelefono.Text.Trim, "-1"), Ciudad:=If(ChkTransitorio.Checked, TxtCiudad.Text.Trim, "-1"), Licencia:=If(ChkTransitorio.Checked, TxtLicencia.Text.Trim, "-1"), Modulo:="TA/G")
Telefono:=If(ChkTransitorio.Checked, TxtTelefono.Text.Trim, "-1"), Ciudad:=If(ChkTransitorio.Checked, TxtCiudad.Text.Trim, "-1"), Licencia:=If(ChkTransitorio.Checked, TxtLicencia.Text.Trim, "-1"), Modulo:="TA/G2")
FolioSalida = ObjInventario.Folio
Folio = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
@@ -852,7 +852,7 @@ Partial Class Inventarios_TraspasoAlmacen
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G")
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
TextoError = "Ocurrió un error al generar el movimiento de entrada"
@@ -1039,7 +1039,7 @@ Partial Class Inventarios_TraspasoAlmacen
'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, CveConceptoInventario, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""),
GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble, Modulo:="TA/G")
GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble, Modulo:="TA/G4")
Dim FolioMov As Integer = ObjInventario.Folio
If CveMovimiento <= 0 Then
@@ -1508,96 +1508,118 @@ Partial Class Inventarios_TraspasoAlmacen
If Not GvDatosRecepcion.Rows.Count > 0 Then
Alert("No hay movimientos para el traspaso", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim CveMovimientoEntrada As Integer = 0
Dim Folio As Integer = 0
Dim ErrorMovInv As Boolean = False
Dim TextoError As String = ""
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
Dim ObjInventario As New ClsInventarios
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
ObjInventario.IniciaTransacSQL()
Dim CveMovimientoEntrada As Integer = 0
Dim Folio = 0
Dim ErrorMovInv As Boolean = False
Dim TextoError = ""
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
CveMovimientoEntrada = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, Recibio:=TxtRecibio.Text, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero,
CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G")
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, TxtObservacionesRecepcion.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza <= 0 Then
TextoError = "No se pudo generar la Poliza para la cancelacion"
ErrorMovInv = True
End If
Folio = ObjInventario.Folio
If CveMovimientoEntrada <= 0 And Not ErrorMovInv Then
TextoError = "No se pudo generar el movimiento de entrada correctamente"
ErrorMovInv = True
Else
Dim CveMovimientoDetalleSalida As Integer = 0
Dim importe As Double = 0
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
CveMovimientoDetalleSalida = Dr("CveMovimientoDetalle").ToString.ToEntero
Dim Cantidad As Double = Dr("Cantidad").ToString.ToDouble
Dim PrecioUnitario As Double = Dr("PU").ToString.ToDouble
If CveMovimientoDetalleSalida <= 0 Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PrecioUnitario, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
End If
importe += Cantidad * PrecioUnitario
Next
End If
If Not ErrorMovInv Then
Dim ImporteDecimal As Decimal = importe.ToDecimal
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
Try
CveMovimientoEntrada = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, Recibio:=TxtRecibio.Text, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero,
CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/C")
If CveMovimientoEntrada <= 0 Then
TextoError = "No se pudo generar el movimiento"
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then
Dim CvePrePoliza As Integer = -1
If Not ErrorMovInv Then
Folio = ObjInventario.Folio
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, TxtObservacionesRecepcion.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza <= 0 Then
TextoError = "No se pudo generar la Poliza para la cancelación"
ErrorMovInv = True
End If
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then
If CveMovimientoEntrada <= 0 And Not ErrorMovInv Then
TextoError = "No se pudo generar el movimiento de entrada correctamente"
ErrorMovInv = True
Else
Dim CveMovimientoDetalleSalida As Integer = 0
Dim importe As Double = 0
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
CveMovimientoDetalleSalida = Dr("CveMovimientoDetalle").ToString.ToEntero
Dim Cantidad As Double = Dr("Cantidad").ToString.ToDouble
Dim PrecioUnitario As Double = Dr("PU").ToString.ToDouble
If CveMovimientoDetalleSalida <= 0 Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PrecioUnitario, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
End If
importe += Cantidad * PrecioUnitario
Next
Else
ErrorMovInv = True
End If
End If
End If
If Not ErrorMovInv Then
ObjInventario.Commit()
TxtRecibio.Text = ""
TxtFechaRecepcion.Text = Now.ToShortDateString
TxtObservacionesRecepcion.Text = ""
Dim Mensaje As StringBuilder = New StringBuilder
Mensaje.AppendFormat("Se realizo correctamente la cancelación. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoEntrada)
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()'
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
DivCodigoSeriePSRecepcion.Visible = False
GvDatosRecepcion.DataBind()
UpDatosRecepcion.Update()
UPDatosAlmacen.Update()
Else
ObjInventario.RollBack()
ObjConta.RollBack()
Alert(TextoError, TipoMensaje.MsgError)
End If
TextoError = "Ocurrió un error al obtener los movimientos de salida"
End If
If Not ErrorMovInv Then
Dim ImporteDecimal As Decimal = importe.ToDecimal
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso"
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso"
End If
End If
End If
Catch ex As Exception
ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso"
OnError(TextoError, ex)
End Try
If Not ErrorMovInv Then
ObjInventario.Commit()
TxtRecibio.Text = ""
TxtFechaRecepcion.Text = Now.ToShortDateString
TxtObservacionesRecepcion.Text = ""
Dim Mensaje As StringBuilder = New StringBuilder
Mensaje.AppendFormat("Se realizo correctamente la cancelación. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoEntrada)
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()'
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
DivCodigoSeriePSRecepcion.Visible = False
GvDatosRecepcion.DataBind()
UpDatosRecepcion.Update()
UPDatosAlmacen.Update()
Else
ObjInventario.RollBack()
Alert(TextoError, TipoMensaje.MsgError)
End If
ObjConta.Dispose()
ObjInventario.Dispose()
CargaRecepcion()
End Sub
@@ -1648,7 +1670,7 @@ Partial Class Inventarios_TraspasoAlmacen
'AGREGAMOS LA ENTRADA
CveMovimientoSalida = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G")
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G1")
Folio = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then

View File

@@ -839,7 +839,7 @@
<asp:TemplateField ControlStyle-CssClass="template" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100" HeaderText="Vencimiento" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlVencimiento" runat="server" Text='<%# Eval("Vencimiento") %>'></asp:Literal>
<asp:Literal ID="LtlVencimiento" runat="server" Text='<%# Eval("Vencimiento", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
@@ -905,6 +905,12 @@
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField ControlStyle-CssClass="template" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="275" HeaderText="CveDocumentacionElectronica">
<ItemTemplate>
<asp:Literal ID="LtlCveDocumentacionElectronica" runat="server" Text='<%# Eval("CveDocumentacionElectronica") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>--%>
<%-- <asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px">
<ItemTemplate>
<asp:LinkButton ID="ImgE" OnClick="Update_ClickDocumentacion" runat="server" AlternateText="Editar" ToolTip="Aplicar Cambios" CausesValidation="False"

View File

@@ -107,6 +107,145 @@ Partial Class Portal_PortalProveedor
#End Region
#Region " D O C U M E N T A C I O N"
Property CveDocumentacionElectronica As Integer
Get
If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CvePersonalClienteDocumentacion") = value
End Set
End Property
Property CveDocumentacion As Integer
Get
If ViewState("CveDocumentacion") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CveDocumentacion"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CveDocumentacion") = value
End Set
End Property
Property Documentacion As String
Get
If ViewState("Documentacion") Is Nothing Then
Return "-1"
Else
Return ViewState("Documentacion").ToString
End If
End Get
Set(value As String)
ViewState("Documentacion") = value
End Set
End Property
Property AdjuntoDocumentacion As String
Get
If ViewState("AdjuntoDocumentacion") Is Nothing Then
Return ""
Else
Return ViewState("AdjuntoDocumentacion").ToString
End If
End Get
Set(value As String)
ViewState("AdjuntoDocumentacion") = value
End Set
End Property
Property DiasVigencia As Integer
Get
If ViewState("DiasVigencia") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("DiasVigencia"), Integer)
End If
End Get
Set(value As Integer)
ViewState("DiasVigencia") = value
End Set
End Property
Property AplicaFechaVencimiento As Boolean
Get
If ViewState("AplicaFechaVencimiento") Is Nothing Then
Return True
Else
Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean)
End If
End Get
Set(value As Boolean)
ViewState("AplicaFechaVencimiento") = value
End Set
End Property
Private Property FechaVigencia As Date
Get
If ViewState("FechaVigencia") Is Nothing Then
Return Nothing
Else
Return ViewState("FechaVigencia").ToString.ToDate
End If
End Get
Set(value As Date)
ViewState("FechaVigencia") = value
End Set
End Property
Property Estatus As Integer
Get
If ViewState("Estatus") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("Estatus"), Integer)
End If
End Get
Set(value As Integer)
ViewState("Estatus") = value
End Set
End Property
Property ObservacionDocumentacion As String
Get
If ViewState("ObservacionDocumentacion") Is Nothing Then
Return ""
Else
Return ViewState("ObservacionDocumentacion").ToString
End If
End Get
Set(value As String)
ViewState("ObservacionDocumentacion") = value
End Set
End Property
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
Return Date.Now.AddDays(15)
Else
Return ViewState("FechaLimite").ToString.ToDate
End If
End Get
Set(value As Date)
ViewState("FechaLimite") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -1289,138 +1428,6 @@ Partial Class Portal_PortalProveedor
End Sub
Property CveDocumentacionElectronica As Integer
Get
If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CvePersonalClienteDocumentacion") = value
End Set
End Property
Property CveDocumentacion As Integer
Get
If ViewState("CveDocumentacion") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CveDocumentacion"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CveDocumentacion") = value
End Set
End Property
Property Documentacion As String
Get
If ViewState("Documentacion") Is Nothing Then
Return "-1"
Else
Return ViewState("Documentacion").ToString
End If
End Get
Set(value As String)
ViewState("Documentacion") = value
End Set
End Property
Property AdjuntoDocumentacion As String
Get
If ViewState("AdjuntoDocumentacion") Is Nothing Then
Return ""
Else
Return ViewState("AdjuntoDocumentacion").ToString
End If
End Get
Set(value As String)
ViewState("AdjuntoDocumentacion") = value
End Set
End Property
Property DiasVigencia As Integer
Get
If ViewState("DiasVigencia") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("DiasVigencia"), Integer)
End If
End Get
Set(value As Integer)
ViewState("DiasVigencia") = value
End Set
End Property
Property AplicaFechaVencimiento As Boolean
Get
If ViewState("AplicaFechaVencimiento") Is Nothing Then
Return True
Else
Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean)
End If
End Get
Set(value As Boolean)
ViewState("AplicaFechaVencimiento") = value
End Set
End Property
Private Property FechaVigencia As Date
Get
If ViewState("FechaVigencia") Is Nothing Then
Return Nothing
Else
Return ViewState("FechaVigencia").ToString.ToDate
End If
End Get
Set(value As Date)
ViewState("FechaVigencia") = value
End Set
End Property
Property Estatus As Integer
Get
If ViewState("Estatus") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("Estatus"), Integer)
End If
End Get
Set(value As Integer)
ViewState("Estatus") = value
End Set
End Property
Property ObservacionDocumentacion As String
Get
If ViewState("ObservacionDocumentacion") Is Nothing Then
Return ""
Else
Return ViewState("ObservacionDocumentacion").ToString
End If
End Get
Set(value As String)
ViewState("ObservacionDocumentacion") = value
End Set
End Property
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
Return Date.Now.AddDays(15)
Else
Return ViewState("FechaLimite").ToString.ToDate
End If
End Get
Set(value As Date)
ViewState("FechaLimite") = value
End Set
End Property
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
@@ -1479,7 +1486,7 @@ Partial Class Portal_PortalProveedor
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
Dim Documentacion As String = e.Row.DataKey("Documentacion")
Dim CveDocumentacionElectronica As String = e.Row.DataKey("CveDocumentacionElectronica")
Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido"))
@@ -1537,9 +1544,9 @@ Partial Class Portal_PortalProveedor
ImgDownLoad.Visible = True
If extencion.Length > 0 Then
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, Documentacion & "." & extencion)
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica & "." & extencion)
Else
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, Documentacion)
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica)
End If
Else
ImgDownLoad.Visible = False
@@ -1564,7 +1571,8 @@ Partial Class Portal_PortalProveedor
Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
Dim Filename As String = ""
Dim ErrorProceso As Boolean = False
If AplicaFechaVencimiento And DiasVigencia > 0 Then
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
End If
@@ -1575,55 +1583,150 @@ Partial Class Portal_PortalProveedor
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Dim tempArray() As String
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & Documentacion & "." & FileExtension
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\")
End If
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
File.Delete(rutaAdjuntoAnterior)
End If
If System.IO.File.Exists(rutaDestino) Then
System.IO.File.Delete(rutaDestino)
End If
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
Dim objEdoc As New ClsEdocumentacion
objEdoc.IniciaTransacSQL()
If CveDocumentacionElectronica = -1 Then
If objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then
CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
If CveDocumentacionElectronica > 0 Then
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
ErrorProceso = True
End If
End If
Else
If objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
Else
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
ErrorProceso = True
End If
End If
If Not ErrorProceso = True Then
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
Try
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\")
End If
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
File.Delete(rutaAdjuntoAnterior)
End If
If System.IO.File.Exists(rutaDestino) Then
System.IO.File.Delete(rutaDestino)
End If
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
Catch ex As Exception
GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
ErrorProceso = True
End Try
End If
If Not ErrorProceso Then
objEdoc.Commit()
Alert("Documento cargado correctamente")
Else
objEdoc.RollBack()
Alert("Error al cargar archivo", TipoMensaje.MsgError)
End If
objEdoc.Dispose()
'GuardarDocumentos(CveDocumentacion)
CargaDocumentacion()
TxtFileDocumentacion.Text = ""
UPModalUploadDoc.Update()
Alert("Archivo cargado correctamente.")
UPModalUploadDoc.Update()
Catch ex As Exception
OnError("Error al cargar archivo", ex)
End Try
Next
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
'Dim FileExtension As String = "-1"
'Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
'Dim Filename As String = ""
'If AplicaFechaVencimiento And DiasVigencia > 0 Then
' FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
'End If
'For Each fileItem As Archivo In Filesgral
' Try
' FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
' Dim tempArray() As String
' tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
' Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & Documentacion & "." & FileExtension
' Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
' If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then
' System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\")
' End If
' If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
' File.Delete(rutaAdjuntoAnterior)
' End If
' If System.IO.File.Exists(rutaDestino) Then
' System.IO.File.Delete(rutaDestino)
' End If
' System.IO.File.Move(fileItem.FileUrl, rutaDestino)
' Dim objEdoc As New ClsEdocumentacion
' If CveDocumentacionElectronica = -1 Then
' If objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then
' End If
' Else
' If objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
' End If
' End If
' objEdoc.Dispose()
' 'GuardarDocumentos(CveDocumentacion)
' CargaDocumentacion()
' TxtFileDocumentacion.Text = ""
' UPModalUploadDoc.Update()
' Alert("Archivo cargado correctamente.")
' Catch ex As Exception
' OnError("Error al cargar archivo", ex)
' End Try
'Next
'RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
End Sub

View File

@@ -51,7 +51,7 @@ Partial Class CatUnidadesMedida
TxtAlias.Text = ""
Alert("El nueva Alias Unidad de Medida se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatosAlias.Update()
GlobalDTUnidadesMedidaAlias = ObjUnidadesMedida.DtResultados
GlobalDTUnidadesMedidaAlias(UsuarioActual.CveEmpresa) = Nothing
ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).FiltraParametros("CveUnidadMedida = " & cve)
End If
CargaGridAlias()
@@ -281,7 +281,7 @@ Partial Class CatUnidadesMedida
TxtAbreviatura.Text = ""
Alert("La nueva Unidad de Medida se guardó correctamente.", TipoMensaje.MsgInformacion)
UpAddUnidadMedida.Update()
GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing
ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid()
@@ -344,7 +344,7 @@ Partial Class CatUnidadesMedida
UpDatos.Update()
If ObjUnidadesMedida.RemoveUnidadMedida(HdnID.Value.ToEntero) Then
GvDatos.EditIndex = -1
GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing
ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Alert("La Unidad de Medida se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If

View File

@@ -648,7 +648,8 @@
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaConversion, 2) + ' MXN';
}
}
function FnSeleccionaNC(chk, chkNC)
function FnSeleccionaNC(chk, chkNC,txtImporte)
{
if (chk.checked) {
chkNC.disabled = false;
@@ -659,6 +660,11 @@
chkNC.click();
}
}
txtImporte.disabled = chkNC.checked;
}
function FnEditarImporte(chkNC, txtImporte) {
txtImporte.disabled = chkNC.checked;
}
function FnLimites(chk, txt, limiteInferior, limiteSuperior) {

View File

@@ -616,7 +616,7 @@ Partial Class Ventas_ClientesAbonar
End Select
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 Then
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4}); FnSeleccionaNC({5},{6});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("ChkGenerarNC").ClientID))
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4}); FnSeleccionaNC({5},{6},{0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("ChkGenerarNC").ClientID))
Else
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda))
End If
@@ -646,8 +646,7 @@ Partial Class Ventas_ClientesAbonar
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 Then
e.Row.FCCheckBox("ChkGenerarNC").Visible = True
e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda))
e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4}); FnEditarImporte({2}, {0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda))
End If
Else
@@ -1540,12 +1539,26 @@ Partial Class Ventas_ClientesAbonar
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If MsgError = "" Then
If ListaFacturasGenerarNC.Count > 0 Then
Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaFacturasGenerarNC)
If Resp.CveVenta > 0 Then
NCGeneradas.Add(Resp)
Else
MsgError = "No se pudo generar la nota de credito"
For Each Fac As Modelos.Factura In ListaFacturasGenerarNC
Dim ListaNC As New List(Of Modelos.Factura)
ListaNC.Add(Fac)
Dim Resp As Modelos.Factura.MMensajeFactura = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC)
If Resp.CveVenta > 0 Then
NCGeneradas.Add(Resp)
Else
MsgError = "No se pudo generar la nota de crédito"
Exit For
End If
Next
If MsgError = "" Then
If NCGeneradas.Count <> ListaFacturasGenerarNC.Count Then
MsgError = "No se generaron las notas de crédito seleccionadas"
End If
End If
End If
End If
End If
@@ -1641,21 +1654,14 @@ Partial Class Ventas_ClientesAbonar
If ObjConta IsNot Nothing Then ObjConta.Commit()
Dim StrMsg As New StringBuilder
StrMsg.Append("Abono Registrado Correctamente.<br/>")
StrMsg.AppendFormat("Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b>", CveIE, ObjIE.Folio)
StrMsg.AppendFormat("Abono Registrado Correctamente. Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b> <br/>", CveIE, ObjIE.Folio)
If IDPoliza > 0 Then StrMsg.AppendFormat("<br/> Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a>", IDPoliza, FolioPoliza)
If IDPoliza > 0 Then StrMsg.AppendFormat("Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a> <br/>", IDPoliza, FolioPoliza)
Dim TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
Dim SbMensaje As New StringBuilder
SbMensaje.Append(String.Format("Abono Registrado Correctamente.<br/><br/> Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a><br/><br/>{2}", IDPoliza, FolioPoliza, TextoComplementoPago))
For Each NC In NCGeneradas
For Each msg In NC.Mensajes
StrMsg.Append(msg)
Next
StrMsg.Append("</br>")
StrMsg.AppendFormat("Nota de crédito generada correctamente.<br/><br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", NC.CveVenta, NC.SerieFolio)
Next
Alert($"{StrMsg.ToString}<br/><br/>{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
@@ -1680,7 +1686,7 @@ Partial Class Ventas_ClientesAbonar
#Region " N O T A - D E - C R E D I T O"
Private Function GenerarNC(Trasac As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As Modelos.Factura.MMensajeFactura
Private Function GenerarNC(SqlTransaccion As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As Modelos.Factura.MMensajeFactura
Dim ObjFacturaDevolucion = New Modelos.Factura(UsuarioActual)
ObjFacturaDevolucion.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
ObjFacturaDevolucion.CveUsuario = UsuarioActual.CveUsuario
@@ -1844,8 +1850,8 @@ Partial Class Ventas_ClientesAbonar
DtVentasNC.AcceptChanges()
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
'ObjFacturaDevolucion.GenerarPDFFactura = True
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=Trasac, ObjContPaqTransac:=ObjConta)
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion, ObjContPaqTransac:=ObjConta)
ObjFacturaDevolucion.Dispose()
@@ -2370,7 +2376,12 @@ Partial Class Ventas_ClientesAbonar
#End Region
#Region " COMPLEMENTOS PAGO "
Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String
Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String
If Not UsuarioActual.Empresa.FacturaProduccion Then
Return ""
End If
If Not ChkComplementoPago.Checked Then
Return ""
End If
@@ -2492,7 +2503,7 @@ Partial Class Ventas_ClientesAbonar
If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero
If CveConceptoDeduccion = 211 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero
If CveConceptoDeduccion = 263 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(537).ToEntero
If CveConceptoDeduccion = 252 Then IdCuentaContableNoDeducible = 0
If CveConceptoDeduccion = 252 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(581).ToEntero
If CveConceptoDeduccion = 78 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.IdCuentaOtrosIngresos
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then

View File

@@ -621,7 +621,8 @@
<th runat="server" visible="false" id="nomostrar2"></th>
</tr>
</table>
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False" DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem" CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
DataKeyNames="CveVentaDetalle,Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,EsCargo" CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
<Columns>
<%--0--%>
<asp:TemplateField ItemStyle-Font-Size="6pt">
@@ -1331,12 +1332,18 @@
</div>
<div class="portlet-body formnombottom">
<table border="0" align="center">
<tr>
<tr id="TrEmitir" runat="server">
<td>
<asp:Button ID="BtnEmitirImprimir" runat="server" Text="Emitir e Imprimir" Style="width: 170px; padding-right: 30px;" CssClass="btn btn-primary" ValidationGroup="GrpEmitirImprimir" />
<i class=" fa-print fa " style="margin-left: -30px; margin-top: 10px; color: white;"></i>
</td>
</tr>
<tr>
<td>
<asp:Button ID="BtnEditarRemision" runat="server" Text="Actualizar Remision" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:Button ID="BtnPermisoEditarRemision" runat="server" Text="Editar Remision" CssClass="btn myventasbutton btn-primary" Visible="false" />
</td>
</tr>
</table>
</div>
</ContentTemplate>
@@ -2556,7 +2563,7 @@
</div>
</div>
<div id="DivAddVenta" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpModalVenta" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -2671,9 +2678,9 @@
<label>Año:</label>
<br />
<asp:TextBox ID="TxtAnioVehiculo" runat="server" Height="100%" Width="100%" CssClass="form-control" CausesValidation="true" MaxLength="500"></asp:TextBox>
</div>
</div>
</div>
<div class ="row">
<div class="row">
<div class="col-md-6">
<label>Tipo Servicio:</label>
<br />
@@ -2807,7 +2814,7 @@
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="row" style="display:none;">
<div class="row" style="display: none;">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFacturas" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="SerieFolio" DataValueField="CveVenta" OnSelectedIndexChanged="DdlFacturas_SelectedIndexChanged" Width="100%" AutoPostBack="true">
@@ -2818,7 +2825,7 @@
</div>
<div class="row">
<div class="col-md-5">
<div >
<div>
<label for="<%= DdlDistribuidor.ClientID.ToString()%>">Distribuidor:</label><br />
<ADS:Dropdownlost ID="DdlDistribuidor" data-metodo="getcliente" CssStyle="width:100%" CssClassDdl="select2me" runat="server" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="300px"></ADS:Dropdownlost>
</div>
@@ -2827,8 +2834,7 @@
<div class="row">
<div class="col-md-9">
<div class="form-group form-md-line-input input-iconright">
<ADS:DropDownLost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange" >
</ADS:DropDownLost>
<ADS:Dropdownlost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange"></ADS:Dropdownlost>
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
<asp:HiddenField ID="HdnPSAjusteClasificacion" ClientIDMode="Static" runat="server" Value="-1" />
<label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label>
@@ -2876,7 +2882,7 @@
<div class="col-md-8">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator id="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div>
</div>
@@ -2895,7 +2901,7 @@
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodLinea" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator id="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodLinea.ClientID.ToString()%>">Cod.Linea:</label>
</div>
</div>
@@ -2917,8 +2923,8 @@
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator id="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<%-- <asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator>--%>
<asp:CustomValidator ID="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<%-- <asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator>--%>
<%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%>
<label for="<%= TxtCodInspeccion.ClientID.ToString()%>">Cod. Inspección:</label>
@@ -2963,7 +2969,7 @@
</div>
</div>
</div>
<div class="row" style="margin-top:17px;">
<div class="row" style="margin-top: 17px;">
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPoliza" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
@@ -2980,7 +2986,7 @@
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Importe:</label>
</div>
</div>
</div>
<div class="col-md-4">
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />
</div>
@@ -3021,7 +3027,7 @@
if (CveClasificacion = "20517") {
regex = "[1X]|"
//regex = "[*]|"
//SI ES OPTIMA
//SI ES OPTIMA
} else if (CveClasificacion = "20511") {
regex = "[1X]|"
}
@@ -3692,7 +3698,7 @@
}
function showDivEC() {
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');

File diff suppressed because it is too large Load Diff

View File

@@ -1,182 +1,214 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIngresos.aspx.vb" Inherits="Ventas_RepIngresos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
/*.GVRepIngresos tr > td a {
display: block;
}
.GVRepIngresos tr > td:nth-child(n+2) a {
text-align: right;
}
.form-group.form-md-line-input.form-md-floating-label .form-control ~ label {
color: #fff;
}
.form-group.form-md-line-input.form-md-floating-label .form-control ~ label {
top: 0;
}
.form-group.form-md-line-input.form-md-floating-label .form-control[value=""] ~ label,
.form-group.form-md-line-input.form-md-floating-label .form-control:not([value]) ~ label {
top: 25px;
}
.form-group.form-md-line-input.form-md-floating-label select.form-control ~ span ~ label, .form-group.form-md-line-input.form-md-floating-label select.form-control ~ label,
.form-group.form-md-line-input.form-md-floating-label .Dropdownlost.form-control ~ span ~ label, .form-group.form-md-line-input.form-md-floating-label .Dropdownlost.form-control ~ label {
top: 0 !important;
}
.form-group.form-md-line-input .form-control {
color: #fff;
}
.lbltitle {
padding-top: 6px;
}*/
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ingresos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkPDF" OnClick="LnkPDF_Click" runat="server"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkPDF" />
<asp:PostBackTrigger ControlID="LnkExcel" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosRepI" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT portletfiltrostitlee">
<div class="tools">
<asp:Button ID="LnkFiltrar" OnClick="LnkFiltrar_Click" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:Button>
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<div class="row ">
<div class="col-md-1 lbltitle">
<asp:Label runat="server" Text="Fecha Inicio" AssociatedControlID="TxtFechaInicio"></asp:Label>
</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaInicio" Width="80" CssClass="form-control" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaInicio" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEEFechaInicio" TargetControlID="TxtFechaInicio" PopupButtonID="LnkFechaInicio" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
</div>
<div class="col-md-1 lbltitle">
<asp:Label runat="server" Text="Fecha Fin" AssociatedControlID="TxtFechaFin"></asp:Label>
</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaFin" Width="80" CssClass="form-control" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaFin" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEEFechaFin" TargetControlID="TxtFechaFin" PopupButtonID="LnkFechaFin" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
</div>
<div class="col-md-1 lbltitle">
<asp:Label runat="server" Text="Tipo" AssociatedControlID="DdlTipoDocto"></asp:Label>
</div>
<div class="col-md-1">
<asp:DropDownList ID="DdlTipoDocto" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIngresos.aspx.vb" Inherits="Ventas_RepIngresos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.btnopaco {
background-color: rgba(0,0,0,0.2);
color: #FFF;
}
.btnopaco:hover {
background-color: rgba(0,0,0,0.4);
color: #FFF;
font-weight: bold;
}
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ingresos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkPDF" OnClick="LnkPDF_Click" runat="server"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkPDF" />
<asp:PostBackTrigger ControlID="LnkExcel" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosRepI" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="LnkFiltrar" OnClick="LnkFiltrar_Click" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:Button>
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<div class="row " style="height: 32px;">
<div class="col-md-1 lbltitle">
<asp:Label runat="server" Text="Fecha Inicio" AssociatedControlID="TxtFechaInicio"></asp:Label>
</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaInicio" Width="80" CssClass="form-control" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaInicio" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEEFechaInicio" TargetControlID="TxtFechaInicio" PopupButtonID="LnkFechaInicio" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
</div>
<div class="col-md-1 lbltitle">
<asp:Label runat="server" Text="Fecha Fin" AssociatedControlID="TxtFechaFin"></asp:Label>
</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaFin" Width="80" CssClass="form-control" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaFin" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEEFechaFin" TargetControlID="TxtFechaFin" PopupButtonID="LnkFechaFin" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
</div>
<div class="col-md-1 lbltitle">
<asp:Label runat="server" Text="Tipo" AssociatedControlID="DdlTipoDocto"></asp:Label>
</div>
<div class="col-md-2">
<asp:ListBox ID="DdlTipoDocto" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Value="Ant" Text="Anticipos"></asp:ListItem>
<asp:ListItem Value="Dev" Text="Devolución"></asp:ListItem>
<asp:ListItem Value="Egs" Text="Egresos"></asp:ListItem>
<asp:ListItem Value="Ing" Text="Ingresos"></asp:ListItem>
</asp:ListBox>
<%-- <asp:DropDownList ID="DdlTipoDocto" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Value="Ant" Text="Anticipos"></asp:ListItem>
<asp:ListItem Value="Dev" Text="Devolución"></asp:ListItem>
<asp:ListItem Value="Egs" Text="Egresos"></asp:ListItem>
<asp:ListItem Value="Ing" Text="Ingresos"></asp:ListItem>
</asp:DropDownList>--%>
</div>
<div class="col-md-1 lbltitle ">
<asp:Label runat="server" Text="Sub Proyecto" AssociatedControlID="DdlSubProyecto"></asp:Label>
</div>
<div class="col-md-2">
<%-- <asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Value="Ant" Text="Anticipos"></asp:ListItem>
<asp:ListItem Value="Dev" Text="Devolución"></asp:ListItem>
<asp:ListItem Value="Egs" Text="Egresos"></asp:ListItem>
<asp:ListItem Value="Ing" Text="Ingresos"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 lbltitle ">
<asp:Label runat="server" Text="Sub Proyecto" AssociatedControlID="DdlSubProyecto"></asp:Label>
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
<asp:GridView ID="GVRepIngresos" runat="server" GridLines="None" CssClass="table table-hover table-striped GVRepIngresos ScrollAD Widthall" AutoGenerateColumns="False"
DataKeyNames="Importe,Descuento,Amortizacion,IVA,IEPS,ImpuestoLocal,Total">
<Columns>
<asp:TemplateField HeaderText="Titulo">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("ConceptoContable")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sub Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Importe", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Descuento" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Descuento", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Amortización" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Amortizacion", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("IVA", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("IEPS", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto Local" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("ImpuestoLocal", "${0:N2}")%>' NavigateUrl='<%# Eval("CveConceptoContable", String.Format("/Ventas/RepIngresosDetalle.aspx?GTipoDocto={{0}}{0}", Filtros))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Total", "${0:N2}")%>' NavigateUrl='<%# Eval("CveConceptoContable", String.Format("/Ventas/RepIngresosDetalle.aspx?GTipoDocto={{0}}{0}", Filtros))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>
</asp:DropDownList>--%>
<asp:ListBox ID="DdlSubProyecto" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
</div>
</div>
</div>
</div>
</div>
<asp:GridView ID="GVRepIngresos" runat="server" GridLines="None" CssClass="table table-hover table-striped GVRepIngresos ScrollAD Widthall" AutoGenerateColumns="False"
DataKeyNames="Importe,Descuento,Amortizacion,IVA,IEPS,ImpuestoLocal,Total">
<Columns>
<asp:TemplateField HeaderText="Titulo">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("ConceptoContable")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sub Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Importe", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Descuento" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Descuento", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Amortización" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Amortizacion", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("IVA", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("IEPS", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto Local" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("ImpuestoLocal", "${0:N2}")%>' NavigateUrl='<%# Eval("CveConceptoContable", String.Format("/Ventas/RepIngresosDetalle.aspx?GTipoDocto={{0}}{0}", Filtros))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Total", "${0:N2}")%>' NavigateUrl='<%# Eval("CveConceptoContable", String.Format("/Ventas/RepIngresosDetalle.aspx?GTipoDocto={{0}}{0}", Filtros))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -83,8 +83,14 @@ Partial Class Ventas_RepIngresos
End Sub
Protected Sub CargaRepIngresos(Optional tipoReporte As Integer = -1)
Dim ObjRepI As New ClsVentas()
ObjRepI.RepIngresos(UsuarioActual.CveEmpresa, If(RsFechaI = "-1", MinFecha, RsFechaI.ToDate), If(RsFechaF = "-1", MaxFecha, RsFechaF.ToDate), TipoDoc, DdlSubProyecto.SelectedValue.ToEntero)
Dim ObjRepI As New ClsVentas()
Dim Cves_Subprotectos As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM)
Dim TiposDoc As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM)
ObjRepI.RepIngresos(UsuarioActual.CveEmpresa, If(RsFechaI = "-1", MinFecha, RsFechaI.ToDate), If(RsFechaF = "-1", MaxFecha, RsFechaF.ToDate), TiposDoc, Cves_Subprotectos)
GVRepIngresos.DataSource = ObjRepI.DtResultados
DtDatos = ObjRepI.DtResultados
ObjRepI.Dispose()

View File

@@ -5272,35 +5272,30 @@
</div>
<asp:UpdatePanel runat="server" ID="UpClasificacionPyME" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<%-- <%--<asp:HiddenField ID="HdnUnidadMedida" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField1" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField2" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField3" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField4" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField5" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField6" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField7" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField8" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField9" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField10" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField11" runat="server" Value="-1" />--%>
<div id="DivAddClasificacionPyME" runat="server" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacionPyME" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="50%">
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlClasificacionPyME.ClientID.ToString()%>">Clasificacion:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost runat="server" ID="DdlPSPyME" CssStyle="width: 50%;" CssClass=" form-control input-sm DdlPS" CssClassDdl=" select2me " DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" />
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= DdlPSPyME.ClientID.ToString()%>">Producto/Servicio:</label>
<ADS:Dropdownlost runat="server" ID="DdlPSPyME" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" />
</div>
</div>
</div>
<%-- <div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost runat="server" ID="DdlPSPyME" CssStyle="width: 50%;" CssClass="form-control input-sm DdlPS" CssClassDdl="select2me " IncluyeTodos="false" DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" />
<label for="<%= DdlPSPyME.ClientID.ToString()%>">
Productos / Servicio:
<label>
</div>
</div>--%>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="form-group form-md-line-input input-iconright">
<div id="DivAddUMPyME" runat="server" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlUMPyME" AppendDataBoundItems="true" CssClass="form-control input-sm select2me " runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Style="width: 50%; max-width: 150px;"></asp:DropDownList>
<label for="<%= DdlUMPyME.ClientID.ToString()%>">Unidad de Medida:</label>
</div>
@@ -5308,7 +5303,7 @@
<div>
<label>Observación:</label>
<br />
<asp:TextBox ID="TxtObsPyME" runat="server" Height="50" Width="503px" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox>
<asp:TextBox ID="TxtObsPyME" runat="server" CssClass="form-control input-sm" Height="50" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox>
</div>
<div id="divproyectos" runat="server">
<asp:UpdatePanel ID="UPPProyecto" runat="server" UpdateMode="Conditional">
@@ -5328,12 +5323,23 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecioPyME" runat="server" CausesValidation="true" lang="nb" ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpAddVenta" CssClass="form-control"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server" TargetControlID="TxtPrecioPyME" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPrecioPyME" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<label for="<%= TxtPrecioPyME.ClientID.ToString()%>">Precio:</label>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecioPyME" runat="server" CausesValidation="true" lang="nb" ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpAddVenta" CssClass="form-control"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server" TargetControlID="TxtPrecioPyME" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPrecioPyME" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<label for="<%= TxtPrecioPyME.ClientID.ToString()%>">Precio:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDescuentoPyME" runat="server" Enabled="false" CausesValidation="true" lang="nb" ClientIDMode="Static" MaxLength="12" CssClass="form-control"></asp:TextBox>
<label for="<%= TxtDescuentoPyME.ClientID.ToString()%>">Descuento:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<div class="row">
<div class="col-md-6">
@@ -7016,17 +7022,17 @@
function SetDisabledTxtTotal(valor) {
DisabledTxtTotal = valor;
$('#<%= TxtTotal.ClientID %>').prop('readonly', DisabledTxtTotal);
}
}
function loadpage() {
$('.AjustaT').each(function () {
AjustaTotales($(this));
})
$('.AjustaT').change(function () {
AjustaTotales($(this));
});
function loadpage() {
$('.AjustaT').each(function () {
AjustaTotales($(this));
})
$('.AjustaT').change(function () {
AjustaTotales($(this));
});
$('#<%= TxtTotal.ClientID %>').prop('readonly', DisabledTxtTotal);
$('#<%= TxtTotal.ClientID %>').prop('readonly', DisabledTxtTotal);
}
@@ -7050,9 +7056,9 @@
$get(Row).style.backgroundColor = "#82b6db";
$get(Obj).focus();
var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', ''));
$get(Obj).value = 0;
var suma = 0;
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
$get(Obj).value = 0;
var suma = 0;
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
@@ -7068,7 +7074,7 @@
$get(Obj).value = "";
$get(Row).style.backgroundColor = "#ffffff";
}
//if ($("input:checkbox:not(:checked)"))
//if ($("input:checkbox:not(:checked)"))
SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
}
function imprimircotizacion() {
@@ -7346,6 +7352,8 @@
}
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
var $this = $(this);
var ind = $this.index();

View File

@@ -2446,7 +2446,7 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.CvePlataforma = 2 Then
If UsuarioActual.Empresa.CvePlataforma = 2 OrElse UsuarioActual.CveRol = 1 Then
ImgOtrosConceptos.Visible = False
TrFormaEntrega.Visible = False
TabDetalleVentas.Visible = False
@@ -2461,6 +2461,9 @@ Partial Class Ventas
Next
LnkAddVenta.Visible = True
divproyectos.Visible = False
DivAddClasificacionPyME.Visible = False
DivAddUMPyME.Visible = False
End If
TabVentaAF.Visible = False
@@ -5824,9 +5827,9 @@ Partial Class Ventas
Dim objPS As New ClsProductosServicios
If objPS.GetPSSucursalesALL(CvePS, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero) Then
PrecioMinimo = objPS.DtResultados.FiltroPrimeroValor("PrecioMinimo", "").ToDecimal
If PrecioMinimo > 0 Then
Costo = PrecioMinimo
End If
'If PrecioMinimo > 0 Then
' Costo = PrecioMinimo
'End If
End If
objPS.Dispose()
@@ -5835,7 +5838,7 @@ Partial Class Ventas
If ValidaExistencia AndAlso DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False AndAlso Not RegistroxOC Then
'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS}") < TxtCantidad.Text.ToDouble Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -13642,6 +13645,10 @@ Partial Class Ventas
CargarAlmacenes()
DdlPS.Attributes.Remove("data-cvesubproyecto")
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
DdlPSPyME.Attributes.Remove("data-cvesubproyecto")
DdlPSPyME.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
UpPS.Update()
End Sub
Private Sub CargaFolios()
@@ -14014,9 +14021,14 @@ Partial Class Ventas
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
Dim ValidaCondicionesComerciales As Boolean = True
If DrPS IsNot Nothing AndAlso DrPS("CveClasificacion").ToString.ToEntero = 20636 Then
ValidaCondicionesComerciales = False
End If
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
If DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
If ValidaCondicionesComerciales AndAlso DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA
If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then
Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}")
@@ -14100,9 +14112,65 @@ Partial Class Ventas
Dim CveSubProyecto As Integer = IIf(DdlSubProyectoPyME.SelectedValue <> "-1", DdlSubProyectoPyME.SelectedValue, "0").ToString.ToEntero
Dim SubProyecto As String = IIf(DdlSubProyectoPyME.SelectedValue <> "-1", DdlSubProyectoPyME.SelectedItem.Text, "").ToString
AgregarProductoServicio(TxtCantidadPyME.Text.ToDecimal, DdlUMPyME.SelectedValue.ToEntero, DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero, DdlClasificacionPyME.SelectedItem.Text,
DdlPSPyME.SelectedValue.ToEntero, DdlPSPyME.SelectedText, TxtObsPyME.Text, TxtPrecioPyME.Text.ToDecimal, 0, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Dim Descuento As Decimal = 0
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
Dim CvePS As Integer = DdlPSPyME.SelectedValue.ToEntero
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
Dim ValidaCondicionesComerciales As Boolean = True
If DrPS IsNot Nothing AndAlso DrPS("CveClasificacion").ToString.ToEntero = 20636 Then
ValidaCondicionesComerciales = False
End If
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
If ValidaCondicionesComerciales AndAlso DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA
If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then
Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}")
'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA
If RowPorcentaje IsNot Nothing Then
Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D
Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D
Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D
Dim TotalInicial As Decimal = (Cantidad * (PU)) - Descuento
Dim TotalFinal = TotalInicial
'SI APLICA EL PRIMER DESCUENTO
If PorcentajeProducto > 0 Then
Dim Descuento1 As Decimal = (TotalInicial * PorcentajeProducto).RoundSQL(2)
Dim Total2 = (TotalInicial - Descuento1)
'SI APLICA EL SEGUNDO DESCUENTO
If PorcentajeProducto2 > 0 Then
Dim Descuento2 As Decimal = (Total2 * PorcentajeProducto2).RoundSQL(2)
Dim Total3 = (Total2 - Descuento2)
'SI APLICA EL TERCER DESCUENTO
If PorcentajeProducto3 > 0 Then
Dim Descuento3 As Decimal = (Total3 * PorcentajeProducto3).RoundSQL(2)
TotalFinal = Total3 - Descuento3
Else
TotalFinal = Total3
End If
Else
TotalFinal = Total2
End If
Else
TotalFinal = TotalInicial
End If
Descuento += ((Cantidad * PU) - TotalFinal)
End If
End If
End If
AgregarProductoServicio(Cantidad, DdlUMPyME.SelectedValue.ToEntero, DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero, DdlClasificacionPyME.SelectedItem.Text,
CvePS, DdlPSPyME.SelectedText, TxtObsPyME.Text, PU, Descuento, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
CalculaUsados()
CalculaTotalesVenta()
@@ -14624,7 +14692,7 @@ Partial Class Ventas
TmpDT.Columns.Add("CveConcepto", GetType(Integer))
TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean))
TmpDT.Columns.Add("EsUsado", GetType(Boolean))
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
End Sub
Private Sub CreaDTmpC()
@@ -19545,9 +19613,10 @@ Partial Class Ventas
Private Sub LnkAddVenta_Click(sender As Object, e As EventArgs) Handles LnkAddVenta.Click
Modalidad = "A"
LnkAgregarPyME.Text = "Agregar"
TxtCantidadPyME.Text = ""
TxtCantidadPyME.Text = "1"
TxtObsPyME.Text = ""
TxtPrecioPyME.Text = "0.00"
TxtDescuentoPyME.Text = "0.00"
LblTotalPyME.Text = "0.00"
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
DdlPSPyME.SelectedValue = "-1"
@@ -19631,18 +19700,12 @@ Partial Class Ventas
Private Sub CargaPSPyME(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
DdlPSPyME.setEsWebService(If(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1", True, False))
DdlPSPyME.setEsWebService(True)
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
Objeto.ddl.Items.Clear()
'Objeto.ddl.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
Objeto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
Objeto.ddl.DataBind()
Objeto.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
Objeto.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
Else
DdlPSPyME.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
End If
DdlPSPyME.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
DdlPSPyME.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString)
DdlPSPyME.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
DdlPSPyME.ddlWS.Attributes.Add("data-Estatus", "1")
End Sub
@@ -19673,6 +19736,62 @@ Partial Class Ventas
'LblUnidadMedida.Text = PS.Rows(0)("UnidadMedida").ToString
TxtPrecioPyME.Text = drPS("Precio").ToString.FormatoNumero(2).Replace(","c, "")
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
Dim Descuento As Decimal = 0
Dim ValidaCondicionesComerciales As Boolean = True
If drPS IsNot Nothing AndAlso drPS("CveClasificacion").ToString.ToEntero = 20636 Then
ValidaCondicionesComerciales = False
End If
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
If ValidaCondicionesComerciales AndAlso DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA
If Not String.IsNullOrEmpty(drPS("CveMarca").ToString()) AndAlso drPS("CveMarca").ToString().ToEntero() > 0 Then
Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={drPS("CveMarca").ToString()}")
'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA
If RowPorcentaje IsNot Nothing Then
Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D
Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D
Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D
Dim TotalInicial As Decimal = (Cantidad * (PU)) - Descuento
Dim TotalFinal = TotalInicial
'SI APLICA EL PRIMER DESCUENTO
If PorcentajeProducto > 0 Then
Dim Descuento1 As Decimal = (TotalInicial * PorcentajeProducto).RoundSQL(2)
Dim Total2 = (TotalInicial - Descuento1)
'SI APLICA EL SEGUNDO DESCUENTO
If PorcentajeProducto2 > 0 Then
Dim Descuento2 As Decimal = (Total2 * PorcentajeProducto2).RoundSQL(2)
Dim Total3 = (Total2 - Descuento2)
'SI APLICA EL TERCER DESCUENTO
If PorcentajeProducto3 > 0 Then
Dim Descuento3 As Decimal = (Total3 * PorcentajeProducto3).RoundSQL(2)
TotalFinal = Total3 - Descuento3
Else
TotalFinal = Total3
End If
Else
TotalFinal = Total2
End If
Else
TotalFinal = TotalInicial
End If
Descuento += ((Cantidad * PU) - TotalFinal)
End If
End If
End If
TxtDescuentoPyME.Text = Descuento.FormatoNumero(2).Replace(","c, "")
LblTotalPyME.Text = ((Cantidad * PU) - Descuento).FormatoNumero(2).Replace(","c, "")
If UsuarioActual.CveEmpresa = 80 Then
'busca el precio de la sucursal
Dim ObjPS As New ClsProductosServicios
@@ -21765,7 +21884,7 @@ Partial Class Ventas
Dim AplicaPUEditado As Boolean = UsuarioActual.TienePermisoProceso(253)
Dim DtUsados As DataTable = TmpDT.FiltraParametros("EsUsado = True")
Dim DtUsados As DataTable = TmpDT.FiltraParametros("EsCargo = True")
TmpDT.Clear()
For Each Gv As GridViewRow In GvAplicaDevolucion.Rows
@@ -23939,6 +24058,10 @@ Partial Class Ventas
Private Sub CalculaUsados(Optional DtUsadosDevolucion As DataTable = Nothing)
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then
If ViewState("CargoUsado").ToString = "False" Then
Exit Sub
End If
Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
Dim DTCvePSCostos As DataTable
@@ -23948,7 +24071,17 @@ Partial Class Ventas
TmpDT.Columns.Add("Eliminar", GetType(Integer))
End If
For Each drow As DataRow In TmpDT.Rows
Dim TmpDTCalculo As DataRow() = Nothing
'SI ES VENTA NUEVA O SI VA SER DEVOLUCION CONSIDERAR TODOS
If Me.CveVenta <= 0 OrElse DtUsadosDevolucion IsNot Nothing Then
TmpDTCalculo = TmpDT.Rows.Cast(Of DataRow).ToArray()
'SI ES EDICION DE REMISION SOLO CONSIDERAR LOS PRODUCTOS NUEVOS
ElseIf Me.CveVenta > 0 AndAlso DtUsadosDevolucion Is Nothing AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
TmpDTCalculo = TmpDT.Select("CveVentaDetalle IS NULL OR CveVentaDetalle <=0")
End If
For Each drow As DataRow In TmpDTCalculo
If DTCvePSCostos IsNot Nothing Then
For Each drow2 As DataRow In DTCvePSCostos.Rows
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
@@ -23957,7 +24090,6 @@ Partial Class Ventas
End If
Next
End If
Next
Dim TmpDTView As New DataView(TmpDT)
@@ -23967,11 +24099,19 @@ Partial Class Ventas
dRowEliminar.Delete()
Next
TmpDT.AcceptChanges()
If ViewState("CargoUsado").ToString = "False" Then
Exit Sub
'SI ES VENTA NUEVA O SI VA SER DEVOLUCION CONSIDERAR TODOS
If Me.CveVenta <= 0 OrElse DtUsadosDevolucion IsNot Nothing Then
TmpDTCalculo = TmpDT.Rows.Cast(Of DataRow).ToArray()
'SI ES EDICION DE REMISION SOLO CONSIDERAR LOS PRODUCTOS NUEVOS
ElseIf Me.CveVenta > 0 AndAlso DtUsadosDevolucion Is Nothing AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
TmpDTCalculo = TmpDT.Select("CveVentaDetalle IS NULL OR CveVentaDetalle <=0")
End If
TmpDT.AcceptChanges()
Dim CveUnidadMedidaPSA As Integer = -1
Dim UnidadMedidaPSA As String = "Unidad"
Dim CveClasificacionPSA As Integer = -1
@@ -23996,7 +24136,7 @@ Partial Class Ventas
DTPSTemp.Columns.Add("CveSubProyecto", GetType(Integer))
DTPSTemp.Columns.Add("SubProyecto", GetType(String))
For Each DrowPartidas As DataRow In TmpDT.Rows
For Each DrowPartidas As DataRow In TmpDTCalculo
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString.ToEntero
If CveTamanioTemp > 0 Then
@@ -24527,26 +24667,26 @@ Partial Class Ventas
' Dim facBytes = DescargarFactura(Me.CveVenta, UsuarioActual.CveEmpresa)
' ImprimirbytesPDF(facBytes, "Factura")
'End Sub
'Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer) As Byte()
' Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "https://sig.adssistemas.mx/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
' Dim File As Byte() = Nothing
' Try
' Using httpClient = New HttpClient()
' httpClient.Timeout = New TimeSpan(0, 15, 0)
' Using request = New HttpRequestMessage(HttpMethod.Get, Url)
' request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
' Dim response = httpClient.SendAsync(request).Result
' If response.StatusCode = Net.HttpStatusCode.OK Then
' File = response.Content.ReadAsByteArrayAsync().Result
' End If
' End Using
' End Using
' Catch ex As Exception
' File = Nothing
' OnError("Ocurrió un error al descargar la factura", ex)
' End Try
' Return File
'Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer) As Byte()
' Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "https://sig.adssistemas.mx/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
' Dim File As Byte() = Nothing
' Try
' Using httpClient = New HttpClient()
' httpClient.Timeout = New TimeSpan(0, 15, 0)
' Using request = New HttpRequestMessage(HttpMethod.Get, Url)
' request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
' Dim response = httpClient.SendAsync(request).Result
' If response.StatusCode = Net.HttpStatusCode.OK Then
' File = response.Content.ReadAsByteArrayAsync().Result
' End If
' End Using
' End Using
' Catch ex As Exception
' File = Nothing
' OnError("Ocurrió un error al descargar la factura", ex)
' End Try
' Return File
'End Function
'Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
' Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))