From 2d15b9ef55459ad6b468090eb74d648dc50b9f45 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 13 Mar 2020 18:40:43 -0700 Subject: [PATCH] -- parametro de cvecorte --- Bancos/PopIEVentas.aspx.vb | 88 ++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 7a3e359f8..1395d747c 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -322,6 +322,15 @@ Partial Class Bancos_PopIEVentas End Set End Property + Private Property CveCorte As Integer + Get + Return ViewState("CveCorte").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveCorte") = value + End Set + End Property + Private Property TipoCambioOriginal As Decimal Get Return ViewState("TipoCambioOriginal").ToString.ToDecimal @@ -527,7 +536,7 @@ Partial Class Bancos_PopIEVentas ViewState("IdCtaAnticipo") = 0 ViewState("IdCtaContMonedaExtranjeraAnticipo") = 0 ViewState("IdCtaContMonedaComplementariaAnticipo") = 0 - + CveCorte = -1 IdCuentaBancariaComplementaria = 0 @@ -672,48 +681,46 @@ Partial Class Bancos_PopIEVentas If ObjVenta.DtResultados IsNot Nothing AndAlso ObjVenta.DtResultados.Rows.Count > 0 Then - - 'CargaProveedor Dim dr As DataRow = ObjVenta.DtResultados.Rows(0) Dim Validada As Boolean = True 'JJMQ:20190606 Se cancela código de validacion ante el SAT por lentitud en el servicio. 'Sustituir la línea anterior por todo lo siguiente hasta donde termina el end if para que valide de nueva cuenta 'Dim Validada As Boolean = False - 'If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then + If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then - ' Dim Valida As New ClsValidaCFDi(dr("FolioFiscal").ToString(), dr("ClienteRFC").ToString, UsuarioActual.Empresa.RFC) + Dim Valida As New ClsValidaCFDi(dr("FolioFiscal").ToString(), dr("ClienteRFC").ToString, UsuarioActual.Empresa.RFC) - ' If Valida.EsValida > 0 Then - ' If Valida.EsValida = 2 Then - ' Validada = False - ' 'Dim ObjDatos As New ClsCompras + If Valida.EsValida > 0 Then + If Valida.EsValida = 2 Then + Validada = False + 'Dim ObjDatos As New ClsCompras - ' 'If ObjDatos.UpdateEstatus(Valida.EsValida, gvr.DataKey("CveFactura").ToEntero) Then + 'If ObjDatos.UpdateEstatus(Valida.EsValida, gvr.DataKey("CveFactura").ToEntero) Then - ' 'End If - ' 'ObjDatos.Dispose() + 'End If + 'ObjDatos.Dispose() - ' BtnGuardar.Enabled = False + BtnGuardar.Enabled = False - ' If UsuarioActual.Empresa.UsaAC Then - ' RegistraScript("if (confirm('La factura está cancelada ante el SAT., ¿Desea eliminar la compra?')) { $get('BtnEliminarCompra').click();}") - ' Else - ' Alert("La factura está cancelada ante el SAT.") - ' End If + If UsuarioActual.Empresa.UsaAC Then + RegistraScript("if (confirm('La factura está cancelada ante el SAT., ¿Desea eliminar la compra?')) { $get('BtnEliminarCompra').click();}") + Else + Alert("La factura está cancelada ante el SAT.") + End If - ' Else - ' Validada = True - ' End If - ' Else - ' 'no se pudo validar, pero ya tuvo la primera vuelta de validacion - ' Validada = True - ' End If - ' Valida.Dispose() - 'Else - ' Validada = True - 'End If + Else + Validada = True + End If + Else + 'no se pudo validar, pero ya tuvo la primera vuelta de validacion + Validada = True + End If + Valida.Dispose() + Else + Validada = True + End If If Validada Then @@ -725,7 +732,7 @@ Partial Class Bancos_PopIEVentas CveMoneda = dr("CveMoneda").ToString.ToEntero CveMonedaVenta = dr("CveMoneda").ToString.ToEntero CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero - NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) + NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) SerieFolio = dr("SerieFolio").ToString TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero @@ -777,6 +784,12 @@ Partial Class Bancos_PopIEVentas FechaVenta = dr("Fecha").ToString.ToDate SaldoVenta = dr("Saldo").ToString.ToDouble + + + 'Cortes de Caja + If UsuarioActual.TienePermisoProceso(160) Then + CargaCorteCaja() + End If End If @@ -786,6 +799,19 @@ Partial Class Bancos_PopIEVentas ObjVenta.Dispose() End Sub + Private Sub CargaCorteCaja() + 'Checar si hay un Turno Abierto + Dim ObjPVenta As New ClsPuntoVenta + + If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then + + If ObjPVenta.DtResultados.Rows.Count > 0 Then + CveCorte = ObjPVenta.CveCorte + End If + End If + ObjPVenta.Dispose() + End Sub + Private Sub CargaCliente(ByVal CveCliente As Integer, RFC As String) Dim ObjCliente As New ClsClientes @@ -1497,7 +1523,7 @@ Partial Class Bancos_PopIEVentas Select Case RBLContado.SelectedValue Case "1" ' Banco - CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, tipoCambioPago, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1")) + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, tipoCambioPago, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCorte:=CveCorte) If CveIE > 0 Then If CveVenta > 0 Then CveConcepto = 2