This commit is contained in:
Raul Pimienta
2019-08-24 13:14:35 -07:00
5 changed files with 398 additions and 377 deletions

View File

@@ -228,9 +228,9 @@ Public Class ClsContabilidad
Public Function AddPrePolizasNegativa(CvePrePoliza As Integer, CveUsuario As Integer, Concepto As String, CveEmpresa As Integer, Fecha As Date) As Boolean Public Function AddPrePolizasNegativa(CvePrePoliza As Integer, CveUsuario As Integer, Concepto As String, CveEmpresa As Integer, Fecha As Date) As Integer
Dim Retorno As Boolean = False Dim Retorno As Integer = -1
DataAdapter("PA_Conta_PrePolizasNegativaAdd") DataAdapter("PA_Conta_PrePolizasNegativaAdd")
@@ -240,11 +240,12 @@ Public Class ClsContabilidad
.Add("@Concepto", SqlDbType.VarChar).Value = Concepto .Add("@Concepto", SqlDbType.VarChar).Value = Concepto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Fecha", SqlDbType.Date).Value = Fecha .Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CvePrePolizaNueva", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
Retorno = True Retorno = SqlAdapter.SelectCommand.Parameters("@CvePrePolizaNueva").Value.ToString.ToEntero
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try End Try

View File

@@ -689,7 +689,7 @@ Partial Class Bancos_IE
LnkAjustarMovimiento.Visible = True LnkAjustarMovimiento.Visible = True
End If End If
If Not VerificaComplementos(True) Then If UsuarioActual.CveEmpresa = 72 OrElse Not VerificaComplementos(True) Then 'No entrara para la empresa 72 porque tarda mucho el load
LnkCancelarComplemento.Visible = False LnkCancelarComplemento.Visible = False
LnkCancelarComplementoImporte.Visible = False LnkCancelarComplementoImporte.Visible = False

View File

@@ -1,371 +1,371 @@
Option Explicit On Option Explicit On
Option Strict On Option Strict On
Imports Extensiones Imports Extensiones
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Imports System.Data Imports System.Data
Partial Class PopUpAuxiliar Partial Class PopUpAuxiliar
Inherits ClsPaginas Inherits ClsPaginas
Private Property Tipo As String Private Property Tipo As String
Get Get
Return ViewState("Tipo").ToString Return ViewState("Tipo").ToString
End Get End Get
Set(value As String) Set(value As String)
ViewState("Tipo") = value ViewState("Tipo") = value
End Set End Set
End Property End Property
Private Property CveCliente As Integer Private Property CveCliente As Integer
Get Get
Return ViewState("CveCliente").ToString.ToEntero Return ViewState("CveCliente").ToString.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveCliente") = value ViewState("CveCliente") = value
End Set End Set
End Property End Property
Private Property CveVenta As Integer Private Property CveVenta As Integer
Get Get
Return ViewState("CveVenta").ToString.ToEntero Return ViewState("CveVenta").ToString.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveVenta") = value ViewState("CveVenta") = value
End Set End Set
End Property End Property
Private Property CveProveedor As Integer Private Property CveProveedor As Integer
Get Get
Return ViewState("CveProveedor").ToString.ToEntero Return ViewState("CveProveedor").ToString.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveProveedor") = value ViewState("CveProveedor") = value
End Set End Set
End Property End Property
Private Property CveCompra As Integer Private Property CveCompra As Integer
Get Get
Return ViewState("CveCompra").ToString.ToEntero Return ViewState("CveCompra").ToString.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveCompra") = value ViewState("CveCompra") = value
End Set End Set
End Property End Property
Private Property DTDatos As DataTable Private Property DTDatos As DataTable
Get Get
Return CType(ViewState("DTDatos"), DataTable) Return CType(ViewState("DTDatos"), DataTable)
End Get End Get
Set(value As DataTable) Set(value As DataTable)
ViewState("DTDatos") = value ViewState("DTDatos") = value
End Set End Set
End Property End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True CType(Me.Master, BaseMasterPage).EsPopup = True
CType(Me.Master, BaseMasterPage).PopupWidth = 915 CType(Me.Master, BaseMasterPage).PopupWidth = 915
RegistraScript("$get('tdContenido').style.height='1000'") RegistraScript("$get('tdContenido').style.height='1000'")
Tipo = Request("Tipo") Tipo = Request("Tipo")
CveCliente = 0 CveCliente = 0
CveProveedor = 0 CveProveedor = 0
CargaDatos() CargaDatos()
End If End If
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
GVAuxiliar.Columns(10).Visible = UsuarioActual.TienePermisoProceso(94) GVAuxiliar.Columns(10).Visible = UsuarioActual.TienePermisoProceso(94)
'GVAuxiliar.Columns(11).Visible = UsuarioActual.TienePermisoProceso(94) 'GVAuxiliar.Columns(11).Visible = UsuarioActual.TienePermisoProceso(94)
GVAuxiliar.Columns(12).Visible = UsuarioActual.TienePermisoProceso(94) GVAuxiliar.Columns(12).Visible = UsuarioActual.TienePermisoProceso(94)
Select Case Tipo Select Case Tipo
Case "CxCClientes" Case "CxCClientes"
CveCliente = Request("CveCliente").ToEntero CveCliente = Request("CveCliente").ToEntero
CveVenta = Request("CveVenta").ToEntero CveVenta = Request("CveVenta").ToEntero
CargaAuxiliarClienteCxC(CveCliente, CveVenta) CargaAuxiliarClienteCxC(CveCliente, CveVenta)
LtlTipo1.Text = "Cuentas por Cobrar" LtlTipo1.Text = "Cuentas por Cobrar"
LtlTipo2.Text = "Folio de la Venta" LtlTipo2.Text = "Folio de la Venta"
LtlTipo3.Text = "Fecha de la Venta" LtlTipo3.Text = "Fecha de la Venta"
Case "AnticiposClientes" Case "AnticiposClientes"
CveCliente = Request("CveCliente").ToEntero CveCliente = Request("CveCliente").ToEntero
CveVenta = Request("CveVenta").ToEntero CveVenta = Request("CveVenta").ToEntero
CargaAuxiliarClienteAnticipos(CveCliente, CveVenta) CargaAuxiliarClienteAnticipos(CveCliente, CveVenta)
LtlTipo1.Text = "Anticipo de Clientes" LtlTipo1.Text = "Anticipo de Clientes"
LtlTipo2.Text = "Folio de la Venta" LtlTipo2.Text = "Folio de la Venta"
LtlTipo3.Text = "Fecha de la Venta" LtlTipo3.Text = "Fecha de la Venta"
Case "CxPProveedor" Case "CxPProveedor"
CveProveedor = Request("CveProveedor").ToEntero CveProveedor = Request("CveProveedor").ToEntero
CveCompra = Request("CveCompra").ToEntero CveCompra = Request("CveCompra").ToEntero
CargaAuxiliarProveedor(CveProveedor, CveCompra) CargaAuxiliarProveedor(CveProveedor, CveCompra)
LtlTipo1.Text = "Cuentas por Pagar" LtlTipo1.Text = "Cuentas por Pagar"
LtlTipo2.Text = "Folio de la Compra" LtlTipo2.Text = "Folio de la Compra"
LtlTipo3.Text = "Fecha de la Compra" LtlTipo3.Text = "Fecha de la Compra"
End Select End Select
UpDatos.Update() UpDatos.Update()
End Sub End Sub
Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveVenta As Integer) Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveVenta As Integer)
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetCxCClienteAuxiliar(CveCliente, CveVenta) Then If ObjMovtos.GetCxCClienteAuxiliar(CveCliente, CveVenta) Then
DTDatos = ObjMovtos.DtResultados DTDatos = ObjMovtos.DtResultados
GVAuxiliar.DataSource = ObjMovtos.DtResultados GVAuxiliar.DataSource = ObjMovtos.DtResultados
If ObjMovtos.DtResultados.Rows.Count > 0 Then If ObjMovtos.DtResultados.Rows.Count > 0 Then
LtlFechaVenta.Text = ObjMovtos.DtResultados.Rows(1)("FechaVenta").ToString.ToDate.ToShortDateString() LtlFechaVenta.Text = ObjMovtos.DtResultados.Rows(1)("FechaVenta").ToString.ToDate.ToShortDateString()
LtlFolio.Text = ObjMovtos.DtResultados.Rows(1)("Folio").ToString LtlFolio.Text = ObjMovtos.DtResultados.Rows(1)("Folio").ToString
LtlImporte.Text = ObjMovtos.DtResultados.Rows(1)("Total").ToString.FormatoNumero(2) LtlImporte.Text = ObjMovtos.DtResultados.Rows(1)("Total").ToString.FormatoNumero(2)
LtlSaldo.Text = ObjMovtos.DtResultados.Rows(1)("Saldo").ToString.FormatoNumero(2) LtlSaldo.Text = ObjMovtos.DtResultados.Rows(1)("Saldo").ToString.FormatoNumero(2)
End If End If
Else Else
GVAuxiliar.DataSource = Nothing GVAuxiliar.DataSource = Nothing
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
GVAuxiliar.DataBind() GVAuxiliar.DataBind()
End Sub End Sub
Private Sub CargaAuxiliarClienteAnticipos(CveCliente As Integer, CveVenta As Integer) Private Sub CargaAuxiliarClienteAnticipos(CveCliente As Integer, CveVenta As Integer)
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposClienteAuxiliar(CveCliente, CveVenta) Then If ObjMovtos.GetAnticiposClienteAuxiliar(CveCliente, CveVenta) Then
DTDatos = ObjMovtos.DtResultados DTDatos = ObjMovtos.DtResultados
GVAuxiliar.DataSource = ObjMovtos.DtResultados GVAuxiliar.DataSource = ObjMovtos.DtResultados
If ObjMovtos.DtResultados.Rows.Count > 0 Then If ObjMovtos.DtResultados.Rows.Count > 0 Then
LtlFechaVenta.Text = ObjMovtos.DtResultados.Rows(1)("FechaVenta").ToString.ToDate.ToShortDateString() LtlFechaVenta.Text = ObjMovtos.DtResultados.Rows(1)("FechaVenta").ToString.ToDate.ToShortDateString()
LtlFolio.Text = ObjMovtos.DtResultados.Rows(1)("Folio").ToString LtlFolio.Text = ObjMovtos.DtResultados.Rows(1)("Folio").ToString
'LtlImporte.Text = ObjMovtos.DtResultados.Rows(1)("Total").ToString.FormatoNumero(2) 'LtlImporte.Text = ObjMovtos.DtResultados.Rows(1)("Total").ToString.FormatoNumero(2)
'LtlSaldo.Text = ObjMovtos.DtResultados.Rows(1)("Saldo").ToString.FormatoNumero(2) 'LtlSaldo.Text = ObjMovtos.DtResultados.Rows(1)("Saldo").ToString.FormatoNumero(2)
End If End If
Else Else
GVAuxiliar.DataSource = Nothing GVAuxiliar.DataSource = Nothing
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
GVAuxiliar.DataBind() GVAuxiliar.DataBind()
End Sub End Sub
Private Sub CargaAuxiliarProveedor(CveProveedor As Integer, CveCompra As Integer) Private Sub CargaAuxiliarProveedor(CveProveedor As Integer, CveCompra As Integer)
Dim ObjMovtos As New ClsContabilidad() Dim ObjMovtos As New ClsContabilidad()
If ObjMovtos.GetProveedorAuxiliar(CveProveedor, CveCompra) Then If ObjMovtos.GetProveedorAuxiliar(CveProveedor, CveCompra) Then
DTDatos = ObjMovtos.DtResultados DTDatos = ObjMovtos.DtResultados
GVAuxiliar.DataSource = ObjMovtos.DtResultados GVAuxiliar.DataSource = ObjMovtos.DtResultados
If ObjMovtos.DtResultados.Rows.Count > 0 Then If ObjMovtos.DtResultados.Rows.Count > 0 Then
LtlFechaVenta.Text = ObjMovtos.DtResultados.Rows(1)("FechaVenta").ToString.ToDate.ToShortDateString() LtlFechaVenta.Text = ObjMovtos.DtResultados.Rows(1)("FechaVenta").ToString.ToDate.ToShortDateString()
LtlFolio.Text = ObjMovtos.DtResultados.Rows(1)("Folio").ToString LtlFolio.Text = ObjMovtos.DtResultados.Rows(1)("Folio").ToString
LtlImporte.Text = ObjMovtos.DtResultados.Rows(1)("Total").ToString.FormatoNumero(2) LtlImporte.Text = ObjMovtos.DtResultados.Rows(1)("Total").ToString.FormatoNumero(2)
LtlSaldo.Text = ObjMovtos.DtResultados.Rows(1)("Saldo").ToString.FormatoNumero(2) LtlSaldo.Text = ObjMovtos.DtResultados.Rows(1)("Saldo").ToString.FormatoNumero(2)
End If End If
Else Else
GVAuxiliar.DataSource = Nothing GVAuxiliar.DataSource = Nothing
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
GVAuxiliar.DataBind() GVAuxiliar.DataBind()
End Sub End Sub
Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAuxiliar.RowDataBound Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAuxiliar.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then If e.Row.RowIndex = 0 Then
e.Row.BackColor = Drawing.Color.LightGray e.Row.BackColor = Drawing.Color.LightGray
e.Row.FCLiteral("LtlFechaMovto").Text = "Totales: " e.Row.FCLiteral("LtlFechaMovto").Text = "Totales: "
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(0).ColumnSpan = 2 e.Row.Cells(0).ColumnSpan = 2
e.Row.Cells(1).Visible = False e.Row.Cells(1).Visible = False
e.Row.Cells(4).ColumnSpan = 3 e.Row.Cells(4).ColumnSpan = 3
e.Row.Cells(5).Visible = False e.Row.Cells(5).Visible = False
e.Row.Cells(6).Visible = False e.Row.Cells(6).Visible = False
e.Row.Cells(7).Visible = False e.Row.Cells(7).Visible = False
e.Row.Cells(8).Visible = False e.Row.Cells(8).Visible = False
e.Row.Cells(12).Visible = False e.Row.Cells(12).Visible = False
ElseIf e.Row.RowIndex = 1 Then ElseIf e.Row.RowIndex = 1 Then
e.Row.Cells(0).Width = Unit.Pixel(95) e.Row.Cells(0).Width = Unit.Pixel(95)
e.Row.Cells(1).Width = Unit.Pixel(180) e.Row.Cells(1).Width = Unit.Pixel(180)
e.Row.Cells(2).Width = Unit.Pixel(80) e.Row.Cells(2).Width = Unit.Pixel(80)
e.Row.Cells(3).Width = Unit.Pixel(80) e.Row.Cells(3).Width = Unit.Pixel(80)
e.Row.Cells(4).Width = Unit.Pixel(83) e.Row.Cells(4).Width = Unit.Pixel(83)
e.Row.Cells(5).Width = Unit.Pixel(93) e.Row.Cells(5).Width = Unit.Pixel(93)
e.Row.Cells(6).Width = Unit.Pixel(85) e.Row.Cells(6).Width = Unit.Pixel(85)
e.Row.Cells(7).Width = Unit.Pixel(95) e.Row.Cells(7).Width = Unit.Pixel(95)
e.Row.Cells(8).Width = Unit.Pixel(70) e.Row.Cells(8).Width = Unit.Pixel(70)
End If End If
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Right e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left
If e.Row.FCLiteral("LtlContabilizado").Text = "Si" Then If e.Row.FCLiteral("LtlContabilizado").Text = "Si" Then
Dim Liga As String = String.Format("<a class=""Texto"" href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">", e.Row.DBCampo("IdPoliza")) Dim Liga As String = String.Format("<a class=""Texto"" href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">", e.Row.DBCampo("IdPoliza"))
e.Row.FCLiteral("LtlPoliza").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("Poliza")) e.Row.FCLiteral("LtlPoliza").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("Poliza"))
End If End If
If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(2) AndAlso e.Row.DBCampo("CvePersonal").ToEntero > 0 Then If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(2) AndAlso e.Row.DBCampo("CvePersonal").ToEntero > 0 Then
Dim Liga As String = String.Format("<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal={0}"">", e.Row.DBCampo("CvePersonal")) Dim Liga As String = String.Format("<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal={0}"">", e.Row.DBCampo("CvePersonal"))
e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable")) e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable"))
End If End If
If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DBCampo("CveReferencia").ToEntero}" e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DBCampo("CveReferencia").ToEntero}"
'If e.Row.DBCampo("CveReferencia").ToEntero > 0 Then 'If e.Row.DBCampo("CveReferencia").ToEntero > 0 Then
' e.Row.Cells(10).Text = "" ' e.Row.Cells(10).Text = ""
'End If 'End If
ElseIf e.Row.DBCampo("TipoReferencia").ToEntero = 2 Then ElseIf e.Row.DBCampo("TipoReferencia").ToEntero = 2 Then
Select Case Tipo Select Case Tipo
Case "CxCClientes" Case "CxCClientes"
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveReferencia").ToEntero}" e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveReferencia").ToEntero}"
Case "CxPProveedor" Case "CxPProveedor"
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Compras/Compras.aspx?CveCompra={e.Row.DBCampo("CveReferencia").ToEntero}" e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Compras/Compras.aspx?CveCompra={e.Row.DBCampo("CveReferencia").ToEntero}"
End Select End Select
End If End If
'If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(272) AndAlso e.Row.DBCampo("CveCompraAmortizacion").ToEntero > 0 Then 'If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(272) AndAlso e.Row.DBCampo("CveCompraAmortizacion").ToEntero > 0 Then
' Dim Liga As String = String.Format("<a class=""Texto"" href=""/Compras/Compras.aspx?CveCompra={0}"">", e.Row.DBCampo("CveCompraAmortizacion")) ' Dim Liga As String = String.Format("<a class=""Texto"" href=""/Compras/Compras.aspx?CveCompra={0}"">", e.Row.DBCampo("CveCompraAmortizacion"))
' e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable")) ' e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable"))
'End If 'End If
If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(275) AndAlso e.Row.DBCampo("CveVenta").ToEntero > 0 Then If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(275) AndAlso e.Row.DBCampo("CveVenta").ToEntero > 0 Then
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta").ToEntero}" e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta").ToEntero}"
'Dim Liga As String = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">", e.Row.DBCampo("CveVenta")) 'Dim Liga As String = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">", e.Row.DBCampo("CveVenta"))
'e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable")) 'e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable"))
End If End If
End If End If
End Sub End Sub
Protected Sub GvDatos_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GVAuxiliar.RowDeleting Protected Sub GvDatos_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GVAuxiliar.RowDeleting
Dim ObjContPaq As ClsContPAQi = Nothing Dim ObjContPaq As ClsContPAQi = Nothing
Dim Conta As New ClsContabilidad() Dim Conta As New ClsContabilidad()
Conta.IniciaTransacSQL() Conta.IniciaTransacSQL()
Dim ClavePrePoliza = GVAuxiliar.Rows(e.RowIndex).DataKey("CvePrePolizaOriginal").ToEntero Dim ClavePrePoliza = GVAuxiliar.Rows(e.RowIndex).DataKey("CvePrePolizaOriginal").ToEntero
Dim IdPoliza = GVAuxiliar.Rows(e.RowIndex).DataKey("IdPoliza").ToEntero Dim IdPoliza = GVAuxiliar.Rows(e.RowIndex).DataKey("IdPoliza").ToEntero
Dim TieneError = False Dim TieneError = False
If Not TieneError Then If Not TieneError Then
If Not Conta.UpdatePrePolizasDetalleBloquear(ClavePrePoliza, False) Then If Not Conta.UpdatePrePolizasDetalleBloquear(ClavePrePoliza, False) Then
TieneError = True TieneError = True
End If End If
End If End If
If Not Conta.RemovePrePolizas(ClavePrePoliza, UsuarioActual.CveEmpresa) Then If Not Conta.RemovePrePolizas(ClavePrePoliza, UsuarioActual.CveEmpresa) Then
TieneError = True TieneError = True
End If End If
If Conta.ValidacionPrePolizaCuadre(ClavePrePoliza, -1) Then If Conta.ValidacionPrePolizaCuadre(ClavePrePoliza, -1) Then
If Conta.ValorPolizaDescuadre > 0 Then If Conta.ValorPolizaDescuadre > 0 Then
TieneError = True TieneError = True
End If End If
End If End If
If Not TieneError Then If Not TieneError Then
If IdPoliza > 0 Then If IdPoliza > 0 Then
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad Then If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad Then
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa) ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
ObjContPaq.IniciaTransacSQL() ObjContPaq.IniciaTransacSQL()
If Not ObjContPaq.RemovePoliza(IdPoliza) Then If Not ObjContPaq.RemovePoliza(IdPoliza) Then
TieneError = True TieneError = True
End If End If
End If End If
End If End If
End If End If
If Not TieneError Then If Not TieneError Then
Alert("Movimiento Eliminado", TipoMensaje.MsgInformacion, "window.opener.location.reload(); window.close();") Alert("Movimiento Eliminado", TipoMensaje.MsgInformacion, "window.opener.location.reload(); window.close();")
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit() If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
Conta.Commit() Conta.Commit()
Else Else
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack() If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
Conta.RollBack() Conta.RollBack()
End If End If
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
Conta.Dispose() Conta.Dispose()
CargaDatos() CargaDatos()
End Sub End Sub
Private Sub GVAuxiliar_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GVAuxiliar.RowUpdating Private Sub GVAuxiliar_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GVAuxiliar.RowUpdating
Dim CvePrePoliza As Integer Dim CvePrePoliza As Integer
Dim ObjConta As New ClsContabilidad Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL() ObjConta.IniciaTransacSQL()
Dim CvePlantillaPoliza As Integer = 0 Dim CvePlantillaPoliza As Integer = 0
Dim Importe As Decimal Dim Importe As Decimal
Dim MsgError As String = "" Dim MsgError As String = ""
If GVAuxiliar.Rows(e.RowIndex).DataKey("Cargo").ToDecimal > GVAuxiliar.Rows(e.RowIndex).DataKey("Abono").ToDecimal Then If GVAuxiliar.Rows(e.RowIndex).DataKey("Cargo").ToDecimal > GVAuxiliar.Rows(e.RowIndex).DataKey("Abono").ToDecimal Then
Importe = GVAuxiliar.Rows(e.RowIndex).DataKey("Cargo").ToDecimal Importe = GVAuxiliar.Rows(e.RowIndex).DataKey("Cargo").ToDecimal
Else Else
Importe = GVAuxiliar.Rows(e.RowIndex).DataKey("Abono").ToDecimal Importe = GVAuxiliar.Rows(e.RowIndex).DataKey("Abono").ToDecimal
End If End If
If CveCliente > 0 Then CvePlantillaPoliza = 11 If CveCliente > 0 Then CvePlantillaPoliza = 11
If CveProveedor > 0 Then CvePlantillaPoliza = 2 If CveProveedor > 0 Then CvePlantillaPoliza = 2
CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/PopUpAuxiliar", CvePlantillaPoliza, Importe, Importe, 1, Now, "Cancelacion de Pago", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/PopUpAuxiliar", CvePlantillaPoliza, Importe, Importe, 1, Now, "Cancelacion de Pago", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePlantillaPoliza = 2 Then If CvePlantillaPoliza = 2 Then
If Not ObjConta.CancelarPagoCompraConAnticipo(CvePrePoliza, CveCompra, GVAuxiliar.Rows(e.RowIndex).DataKey("CveReferencia").ToEntero) Then If Not ObjConta.CancelarPagoCompraConAnticipo(CvePrePoliza, CveCompra, GVAuxiliar.Rows(e.RowIndex).DataKey("CveReferencia").ToEntero) Then
MsgError = "Ocurrió un error al cancelar el pago de la compra" MsgError = "Ocurrió un error al cancelar el pago de la compra"
End If End If
End If End If
If CvePlantillaPoliza = 11 Then If CvePlantillaPoliza = 11 Then
If Not ObjConta.CancelarPagoVentaConAnticipo(CvePrePoliza, CveVenta, GVAuxiliar.Rows(e.RowIndex).DataKey("CveReferencia").ToEntero) Then If Not ObjConta.CancelarPagoVentaConAnticipo(CvePrePoliza, CveVenta, GVAuxiliar.Rows(e.RowIndex).DataKey("CveReferencia").ToEntero) Then
MsgError = "Ocurrió un error al cancelar el pago de la venta" MsgError = "Ocurrió un error al cancelar el pago de la venta"
End If End If
End If End If
If MsgError = "" Then If MsgError = "" Then
ObjConta.Commit() ObjConta.Commit()
Alert("El movimiento se canceló exitosamente.") Alert("El movimiento se canceló exitosamente.")
Else Else
ObjConta.RollBack() ObjConta.RollBack()
Alert(MsgError, TipoMensaje.MsgError) Alert(MsgError, TipoMensaje.MsgError)
End If End If
ObjConta.Dispose() ObjConta.Dispose()
End Sub End Sub
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosExcel.Click Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosExcel.Click
GenerarPDF("Excel") GenerarPDF("Excel")
End Sub End Sub
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosPDF.Click Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosPDF.Click
GenerarPDF() GenerarPDF()
End Sub End Sub
Private Sub GenerarPDF(Optional Formato As String = "PDF") Private Sub GenerarPDF(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
If DTDatos IsNot Nothing And DTDatos.Rows.Count > 0 Then If DTDatos IsNot Nothing And DTDatos.Rows.Count > 0 Then
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Tipo", LtlTipo1.Text)) params.Add(New ReportParameter("Tipo", LtlTipo1.Text))
params.Add(New ReportParameter("Folio", LtlFolio.Text)) params.Add(New ReportParameter("Folio", LtlFolio.Text))
params.Add(New ReportParameter("Fecha", LtlFechaVenta.Text)) params.Add(New ReportParameter("Fecha", LtlFechaVenta.Text))
params.Add(New ReportParameter("Importe", LtlImporte.Text)) params.Add(New ReportParameter("Importe", LtlImporte.Text))
params.Add(New ReportParameter("Saldo", LtlSaldo.Text)) params.Add(New ReportParameter("Saldo", LtlSaldo.Text))
If Imagen.Exists Then If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri)) params.Add(New ReportParameter("LogoPath", logouri))
Else Else
params.Add(New ReportParameter("LogoPath", "")) params.Add(New ReportParameter("LogoPath", ""))
End If End If
ImprimirPDF("Empresas\Grales\Formatos\RepAuxiliarContable.rdlc", DTDatos, params, "RepAuxiliarContable_" & LtlFolio.Text, Formato:=Formato) ImprimirPDF("Empresas\Grales\Formatos\RepAuxiliarContable.rdlc", DTDatos, params, "RepAuxiliarContable_" & LtlFolio.Text, Formato:=Formato)
Else Else
Alert("No se encontró información suficiente.", TipoMensaje.MsgAdvertencia) Alert("No se encontró información suficiente.", TipoMensaje.MsgAdvertencia)
End If End If
End Sub End Sub
Property CvePrePolizaNegativa As Integer Property CvePrePolizaNegativa As Integer
@@ -390,23 +390,37 @@ Partial Class PopUpAuxiliar
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
ObjContabilidad.IniciaTransacSQL() ObjContabilidad.IniciaTransacSQL()
If ObjContabilidad.AddPrePolizasNegativa(CvePrePoliza, UsuarioActual.CveUsuario, TxtConceptoCancelacion.Text, UsuarioActual.CveEmpresa, TxtFechaCancelacion.Text.ToDate) Then Dim CvePrePolizaNueva As Integer = ObjContabilidad.AddPrePolizasNegativa(CvePrePoliza, UsuarioActual.CveUsuario, TxtConceptoCancelacion.Text, UsuarioActual.CveEmpresa, TxtFechaCancelacion.Text.ToDate)
Alert("Se agrego polzia negativa correctamente.")
Else If Not CvePrePolizaNueva > 0 Then
TieneError = True TieneError = True
End If End If
If TieneError Then If Not TieneError Then
ObjContabilidad.RollBack()
Else
ObjContabilidad.Commit() ObjContabilidad.Commit()
Dim Str As New StringBuilder
Str.Append("Se agrego la póliza de cancelación correctamente.<br/>")
RegistraScript(" $('#DivCancelar').modal('hide'); ") RegistraScript(" $('#DivCancelar').modal('hide'); ")
CargaDatos() If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If ObjContabilidad.ContabilizarPrePoliza(CvePrePolizaNueva, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
Str.AppendFormat("<a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", ObjContabilidad.ContaIdPoliza)
End If
End If
Alert(Str.ToString)
Else
ObjContabilidad.RollBack()
End If End If
ObjContabilidad.Dispose()
ObjContabilidad.Dispose()
CargaDatos()
End Sub End Sub
@@ -424,4 +438,4 @@ Partial Class PopUpAuxiliar
End Class End Class

View File

@@ -1419,7 +1419,7 @@
</td> </td>
<td><b>T.C.:</b></td> <td><b>T.C.:</b></td>
<td> <td>
<asp:TextBox ID="TxtTipoCambio" onkeyup="ConvertirDllsPesos();" runat="server" CssClass="form-control input-sm" MaxLength="7" Text="1" Enabled="true" Width="70px" ClientIDMode="Static"></asp:TextBox> <asp:TextBox ID="TxtTipoCambio" onkeyup="ConvertirDllsPesos();" runat="server" CssClass="form-control input-sm" MaxLength="7" Text="1" Enabled="true" Width="70px" ClientIDMode="Static" Readonly ="true"></asp:TextBox>
<asp:CompareValidator ID="CVTipoCambio" runat="server" ControlToValidate="TxtTipoCambio" Display="None" ErrorMessage="El campo <b>''Tipo de Cambio''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator> <asp:CompareValidator ID="CVTipoCambio" runat="server" ControlToValidate="TxtTipoCambio" Display="None" ErrorMessage="El campo <b>''Tipo de Cambio''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOTipoCambio" runat="server" HighlightCssClass="vco" TargetControlID="CVTipoCambio" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCOTipoCambio" runat="server" HighlightCssClass="vco" TargetControlID="CVTipoCambio" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" ID="LblTCValuacion" ToolTip="Última Valuación" Text="" Visible="false"></asp:Label> <asp:Label runat="server" ID="LblTCValuacion" ToolTip="Última Valuación" Text="" Visible="false"></asp:Label>

View File

@@ -20758,13 +20758,19 @@ Partial Class Ventas
CalculaTotalesVenta(True) CalculaTotalesVenta(True)
'condicióon, en la que se verifica que el importe total de aplicación de la nota de crédito sea igual al del total de la nota de crédito, ej. saldo de la factura 1000.01 y la nota de crédito se generó po 1000.00 'condicióon, en la que se verifica que el importe total de aplicación de la nota de crédito sea igual al del total de la nota de crédito, ej. saldo de la factura 1000.01 y la nota de crédito se generó po 1000.00
If Not AplicaNCMasiva Then If Not AplicaNCMasiva Then
Dim TT As Decimal = TxtNCImporte.Text.ToDecimal Dim TT As Decimal = TxtNCImporte.Text.ToDecimal
If TT > TxtTotal.Text.ToDecimal Then TT = TxtTotal.Text.ToDecimal If TT > TxtTotal.Text.ToDecimal Then TT = TxtTotal.Text.ToDecimal
CargaNCDT(CveVenta, TT) CargaNCDT(CveVenta, TT)
End If
End If
'verifica el tipo de cambio que se actualice
If DdlMoneda.SelectedValue <> "1" Then
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString
End If
LblTCValuacion.Visible = False
UpPS.Update() UpPS.Update()
LBNotaCredito.Visible = False LBNotaCredito.Visible = False