diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 6b6fce855..c1a58b3fb 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -4062,6 +4062,29 @@ Public Class ClsContabilidad Dim Retorno As Boolean = False DataAdapter("PA_Sis_InconsistenciasGet") + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener inconsistencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function GetPolizasDescuadre(Optional Ejercicio As Integer = -1, Optional Periodo As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_PolizasConDescuadreGet") + + + With SqlAdapter.SelectCommand.Parameters + .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio + .Add("@Periodo", SqlDbType.Int).Value = Periodo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 8f576a8d9..d33475899 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -5176,7 +5176,7 @@ Public Class ClsInventarios #Region "INVENTARIOS - REPORTE DE MOVIMIENTOS DE PROVEEDOR" - Public Function GetRepMovimientosProveedor(CveEmpresa As Integer, CveConcepto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date) As Boolean + Public Function GetRepMovimientosProveedor(CveEmpresa As Integer, CveConcepto As Integer, CveProveedor As Integer, CvePS As Integer, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, FechaI As Date, FechaF As Date) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_ProductosProveedor") @@ -5184,6 +5184,9 @@ Public Class ClsInventarios .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen + .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF End With diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 2499c1de1..466e394c5 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -3479,9 +3479,17 @@ Public Class Timbrado Try Dim RutaCBB As String = $"{UsuarioActual.Empresa.Ruta}CBB\{ObjCFDITimbre.Comprobante.SerieFolio}.jpg" - Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Comprobante.Total, FolioFiscal, RutaCBB) - CBB = Nothing + 'Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() + 'CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Comprobante.Total, FolioFiscal, RutaCBB) + 'CBB = Nothing + + Dim qrCode As New GoFac.QrCode() + 'String cadenaqrCode = qrCode.GenerarCadenaQrCode(txtXml.Text) + + Dim bCBB As Byte() = qrCode.GenerarQrCode($"{LigaVerificacionSAT}?re={UsuarioActual.Empresa.RFC}&rr={ObjCFDITimbre.Receptor.RFC}&tt={String.Format("{0,12:F6}", ObjCFDITimbre.Comprobante.Total).Trim()}&id={FolioFiscal}&fe=ELleDg==") + File.WriteAllBytes(RutaCBB, bCBB) + bCBB = Nothing + Catch ex As Exception OnError("Ocurrió un error al generar el QR", ex) End Try diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index c4e0fa5cd..caed3305f 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -20229,6 +20229,8 @@ Partial Class Compras_Compras If FleteImportacionOpcion > 0 Then RblFleteImportacionOpcion.SelectedValue = FleteImportacionOpcion.ToString RegistraScript("$('#ModalFletesImportaciones').modal()") UpModalFletesImportaciones.Update() + + End Sub Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) CambiaTipo() diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 979dc9b22..c482c796d 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1963,10 +1963,10 @@ Partial Class ContabilidadC_RegPrePolizaS Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) RowIndex = GvRow.RowIndex - If GvRow.FCTextBox("TxtAbono").Text = "" Then - CargaTipoTransaccion("Ing") - Else + If GvRow.FCTextBox("TxtAbono").Visible Then CargaTipoTransaccion("Egs") + Else + CargaTipoTransaccion("Ing") End If Dim IdMov As Integer = GvRow.DataKey("IdMov").ToString.ToEntero diff --git a/Contabilidad/RepPolizasCuadre.aspx b/Contabilidad/RepPolizasCuadre.aspx index 35aeef321..cad8bb655 100644 --- a/Contabilidad/RepPolizasCuadre.aspx +++ b/Contabilidad/RepPolizasCuadre.aspx @@ -15,19 +15,44 @@
- <%----%> +
- <%--
- -
-
-
--%> + +
+ + +
+ + +
+ +
+ + + + + + + + + + + + + + +
+ +
+ +
+ @@ -57,6 +82,42 @@ + + +<%-- FechaMovto Mensaje CveIE CveCompra CveVenta CvePrePoliza FolioPoliza--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Contabilidad/RepPolizasCuadre.aspx.vb b/Contabilidad/RepPolizasCuadre.aspx.vb index 3dc07cc5d..5f8e52790 100644 --- a/Contabilidad/RepPolizasCuadre.aspx.vb +++ b/Contabilidad/RepPolizasCuadre.aspx.vb @@ -4,12 +4,21 @@ Option Strict On Imports System.Data Imports System.Linq Imports Extensiones + Partial Class Contabilidad_RepPolizasCuadre Inherits ClsPaginas Private Sub Contabilidad_RepPolizasCuadre_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then - CargaGrid() + + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + CargaEjercicios() + MuestraControlesContabilidadSIG() + CargaDatosContabilidaSIG() + Else + CargaGrid() + End If + End If End Sub @@ -25,6 +34,7 @@ Partial Class Contabilidad_RepPolizasCuadre UpDatos.Update() End Sub + Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim Liga1 As String = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", e.Row.DBCampo("IdPoliza")) @@ -32,4 +42,72 @@ Partial Class Contabilidad_RepPolizasCuadre End If End Sub + + +#Region " C O N T A B L I D A D S I G" + Private Sub MuestraControlesContabilidadSIG() + + GvDatos.Visible = False + + GvDatosSIG.Visible = True + + BtnConsultar.Visible = True + DvRowFiltrosContanSig1.Visible = True + + End Sub + + Private Sub CargaDatosContabilidaSIG() + + + Dim ObjP As New ClsContabilidad + + If ObjP.GetPolizasDescuadre(DdlEjercicio.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + + If ObjP.DtResultados.Rows.Count > 0 Then + GvDatosSIG.DataSource = ObjP.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") + Else + GvDatosSIG.DataSource = Nothing + End If + Else + GvDatosSIG.DataSource = Nothing + End If + + ObjP.Dispose() + + GvDatosSIG.DataBind() + UpDatos.Update() + + + + End Sub + + + Private Sub CargaEjercicios() + + Dim Clsconta As New ClsContabilidad + If Clsconta.GetEjercicios(UsuarioActual.CveEmpresa) Then + DdlEjercicio.DataSource = Clsconta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + Clsconta.Dispose() + + DdlEjercicio.DataBind() + DdlEjercicio.SelectedValue = Now.Year.ToString + + DdlPeriodo.SelectedValue = Now.Month.ToString + + End Sub + + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatosContabilidaSIG() + End Sub + + +#End Region + + + + End Class diff --git a/CxC/RepCxC.aspx.vb b/CxC/RepCxC.aspx.vb index d7bda4f73..c0d5100a4 100644 --- a/CxC/RepCxC.aspx.vb +++ b/CxC/RepCxC.aspx.vb @@ -105,7 +105,7 @@ Partial Class RepCxC CargaCombos() CargaGvPersonalizarRaqngoColumnas() CargaDatos() - If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then ChkAnticipos.visible = True + If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True ActivaEnviarEstadoCuenta() If UsuarioActual.CveRol = 1 Or UsuarioActual.TienePermisoProceso(243) Then LnkDescargarSegmentos.Visible = True CreaDataTableColor() @@ -380,55 +380,57 @@ Partial Class RepCxC If e.Row.DBCampo("CveCliente").ToString.ToEntero > 0 Then e.Row.FCLiteral("LtlGrupo").Text = $"{e.Row.DBCampo("GPO")}" End If - End If + End If + + Dim AplicaAnticipos As Integer = If(ChkAnticipos.Checked, 1, 0) - Dim Liga1 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C1&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}", + Dim Liga1 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C1&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga2 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C2&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga2 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C2&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga3 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C3&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga3 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C3&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga4 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C4&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga4 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C4&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga5 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C5&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente{26}", + Dim Liga5 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C5&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente{26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga6 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C6&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga6 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C6&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga7 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C7&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga7 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C7&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga8 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C8&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga8 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C8&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga9 As String = String.Format("/CxC/RepCxCDetalle.aspx.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga9 As String = String.Format("/CxC/RepCxCDetalle.aspx.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga10 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga10 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga11 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TPV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga11 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TPV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim LigaTot As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim LigaTot As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) e.Row.FCHyperLink("HplSaldo").NavigateUrl = LigaTot diff --git a/CxC/RepCxCDetalle.aspx b/CxC/RepCxCDetalle.aspx index 72a3d882d..cc3e6ad6f 100644 --- a/CxC/RepCxCDetalle.aspx +++ b/CxC/RepCxCDetalle.aspx @@ -312,6 +312,10 @@ +
+ +
+ @@ -324,11 +328,11 @@
-
-
+
+ " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
+
diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index 976ec6d4f..8bc46cf4e 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -348,6 +348,11 @@ Partial Class RepCxCDetalle DdlSubProyecto.SelectedValueExist(CveSubProyecto) + + If Request("AplicaAnticiposPagados") IsNot Nothing Then + ChkAnticipos.Checked = If(Request("AplicaAnticiposPagados").ToEntero = 1, True, False) + End If + DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion) CargaClientes() If CveCliente > 0 Then @@ -410,7 +415,7 @@ Partial Class RepCxCDetalle DdlClientesWS.Attributes.Add("style", "!important width: 100%;") End If - + If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True End Sub Private Function CargaDatos() As DataTable Dim dt As DataTable = Nothing @@ -427,6 +432,7 @@ Partial Class RepCxCDetalle FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") FechaVI = If(IsDate(txtFechaVI.Text.Trim()), txtFechaVI.Text.Trim(), "-1") FechaVF = If(IsDate(txtFechaVF.Text.Trim()), txtFechaVF.Text.Trim(), "-1") + 'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero Dim CveCliente = If(DdlClientesWS.SelectedValue.ToEntero > 0, DdlClientesWS.SelectedValue.ToEntero, -1) If ObjMovtos.GetCxCDetalle(FechaI, FechaF, CveCliente, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, @@ -435,7 +441,7 @@ Partial Class RepCxCDetalle RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=DdlCobranzaEstatusFiltro.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, LimiteCredito:=LimiteCredito, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, - CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero) Then + CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=If(ChkAnticipos.Checked, 1, 0)) Then GvDatos.DataSource = ObjMovtos.DtResultados dt = ObjMovtos.DtResultados diff --git a/Inventarios/RepMovimientosProveedor.aspx b/Inventarios/RepMovimientosProveedor.aspx index 3ee552289..6db0eea7e 100644 --- a/Inventarios/RepMovimientosProveedor.aspx +++ b/Inventarios/RepMovimientosProveedor.aspx @@ -31,11 +31,8 @@
-
- - - - +
+
@@ -72,11 +69,25 @@
diff --git a/Inventarios/RepMovimientosProveedor.aspx.cs b/Inventarios/RepMovimientosProveedor.aspx.cs index a349a1c1f..785ce0dd5 100644 --- a/Inventarios/RepMovimientosProveedor.aspx.cs +++ b/Inventarios/RepMovimientosProveedor.aspx.cs @@ -38,19 +38,39 @@ public partial class Inventarios_RepMovimientosProveedor : ClsPaginas public void CargaCombos() { - DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); - DdlProveedor.Items.Insert(0, new ListItem("Seleccione", "-1")); - DdlProveedor.DataBind(); + //DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); + //DdlProveedor.Items.Insert(0, new ListItem("Seleccione", "-1")); + //DdlProveedor.DataBind(); + DdlProveedor.setEsWebService(true); + DdlProveedor.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedor.SelectedText = "Todos"; + DdlProveedor.SelectedValue = "-1"; + DdlConcepto.DataSource = GlobalDTInvConceptos; DdlConcepto.Items.Insert(0, new ListItem("Todos", "-1")); DdlConcepto.DataBind(); + + DdlAlmacenOrigen.DataSource = get_GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + DdlAlmacenOrigen.DataBind(); + DdlAlmacenOrigen.Items.Insert(0, new ListItem("Todos", "-1")); + + DdlAlmacenDestino.DataSource = get_GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + DdlAlmacenDestino.DataBind(); + DdlAlmacenDestino.Items.Insert(0, new ListItem("Todos", "-1")); + + DdlPS.setEsWebService(true); + DdlPS.SelectedText = "Todos"; + DdlPS.SelectedValue = "-1"; } public void CargaDatos() { + int CvePS = DdlPS.SelectedValue.ToEntero(); ClsInventarios ObjInv = new ClsInventarios(); - if (ObjInv.GetRepMovimientosProveedor(UsuarioActual.CveEmpresa, DdlConcepto.SelectedValue.ToEntero(), DdlProveedor.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate())) + if (ObjInv.GetRepMovimientosProveedor(UsuarioActual.CveEmpresa, DdlConcepto.SelectedValue.ToEntero(), DdlProveedor.SelectedValue.ToEntero(), + CvePS, DdlAlmacenOrigen.SelectedValue.ToEntero(), DdlAlmacenDestino.SelectedValue.ToEntero(), + txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate())) { DtDatos = ObjInv.DtResultados; GvDatos.DataSource = DtDatos; @@ -74,7 +94,7 @@ public partial class Inventarios_RepMovimientosProveedor : ClsPaginas String FechaI; if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $" Fecha Inicial: {txtFechaI.Text}"; } String Proveedor; - if (DdlProveedor.SelectedValue != "-1") { Proveedor = $" Proveedor: {DdlProveedor.SelectedItem.Text}"; } else { Proveedor = ""; } + if (DdlProveedor.SelectedValue != "-1") { Proveedor = $" Proveedor: {DdlProveedor.SelectedText}"; } else { Proveedor = ""; } String Concepto; if (DdlConcepto.SelectedValue != "-1") { Concepto = $" Concepto: {DdlConcepto.SelectedItem.Text}"; } else { Concepto = ""; } System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); diff --git a/Inventarios/ResguardoMaterial.aspx b/Inventarios/ResguardoMaterial.aspx index 1d8247bd6..024e8ee0b 100644 --- a/Inventarios/ResguardoMaterial.aspx +++ b/Inventarios/ResguardoMaterial.aspx @@ -493,13 +493,13 @@ - +
- + diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index 5392156b9..74e36dff3 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -986,7 +986,7 @@ Partial Class Inventarios_ResguardoMaterial Cont = 0 Importe = ObjInventario.DtResultados.SUMD("Total").RoundAD For Each Dr As DataRow In ObjInventario.DtResultados.Rows - Dim CveSeccionAlmacen As Integer = DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero + Dim CveSeccionAlmacen As Integer = -1 'DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero Dim Lote As String = "-1" Dim FechaCaducidad As Date = MinFecha If DiccionarioLote(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString <> "" Then Lote = DiccionarioLote(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString @@ -1013,6 +1013,7 @@ Partial Class Inventarios_ResguardoMaterial End If If Not TieneError Then + ObjInventario.Commit() Dim Msg As New StringBuilder If Concepto = 23 Then 'FolioEntrada @@ -1035,7 +1036,6 @@ Partial Class Inventarios_ResguardoMaterial DdlSubProyecto.SelectedValueExist("-1") End If - ObjInventario.Commit() If Concepto = 23 Then LimpiarMovimiento() diff --git a/Site.master b/Site.master index bfa552c03..5431b7312 100644 --- a/Site.master +++ b/Site.master @@ -257,6 +257,15 @@ Buscar Acercamientos + +
  • + + + Buscar Activo Fijo + +
  • + +
    +
    +
    +
    Anticipo:
    +
    + +
    + + +
    Liquidación:
    +
    + +
    +
    @@ -239,37 +252,35 @@
    - +
    - - +
    +
    + + " style="display: inline-block; margin-right: -20px; width: 125px;" /> + " style="margin-top: -3px; margin-right: 20px" class="btn btn-circle btn-sm label-info"> + +
    -
    - -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px; margin-right: 20px" class="btn btn-circle btn-sm label-info"> -
    -
    + + CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None" HeaderStyle-CssClass="ADtr"> <%--0--%> @@ -338,7 +349,7 @@ <%--9--%> - +   @@ -399,55 +410,56 @@ <%--17--%> - + <%--18--%> - + <%--19--%> - + <%--20--%> - + <%--21--%> - + <%--22--%> - + <%--23--%> - + <%--24--%> - + <%--25--%> - + + @@ -616,21 +628,14 @@ } else { txt.value = ""; - let ClsSelLiquidacionVenta = ".ClsSelLiquidacionVenta" + CveVenta; - let ClsSelLiquidacionVentaTotal = ".ClsSelLiquidacionVentaTotal" + CveVenta; + let ClsSelLiqVenta = ".ClsSelLiqVenta" + CveVenta; + let ClsSelLiqVentaTotal = ".ClsSelLiqVentaTotal" + CveVenta; - $(ClsSelLiquidacionVenta).val(''); - $(ClsSelLiquidacionVentaTotal).val(''); - + $(ClsSelLiqVenta).val(''); + $(ClsSelLiqVentaTotal).val(''); } - //if (typeof t2 === "undefined") { - - //} else { - - //} - - + if (chkPesosBancos) { CambiaPesosDolares() } else if (chkDolaresBancos) { @@ -654,6 +659,7 @@ var div = document.getElementById("DivTC") let totalLiquidacion = 0.0; + let totalAnti = 0.0; if ($get('TxtTC') != null) { tc = ToDouble($get('TxtTC').value); @@ -709,21 +715,29 @@ } $get('TxtObservaciones').value = $get('HdnObs').value + ' Ventas: ' + Ventas; + $(".ClsSelLiq").each(function () { - - - $(".ClsSelLiquidacion").each(function () { - - let valorString = $(this).val(); - valorString = valorString.replace(/,/g, ''); - - if (valorString.trim().length > 0) { - totalLiquidacion = totalLiquidacion + parseFloat(valorString); - } - + totalLiquidacion = totalLiquidacion + ToDouble($(this).val()); + }); + $(".ClsSelLiqAnt").each(function () { + totalAnti = totalAnti + ToDouble($(this).val()); + + }); + + totalLiquidacion = totalLiquidacion + totalAnti; + + if ($get('TxtAnticipo') != null) { + + if ($get('TxtAnticipo').value == '') { + $get('TxtAnticipo').value = 0.00 + } + else { + Importe = Importe + ToDouble($get('TxtAnticipo').value); + } + } if ($get('TxtOtrosImportes') != null) { if (pagoMultiple != 0) { @@ -737,11 +751,10 @@ else { return Importe + parseFloat(Comision) - totalLiquidacion; } - } else { return Importe - totalLiquidacion - } + } } function FnCambia(chk, txt, saldo, op, pagoMultiple, monedaPago) { @@ -912,34 +925,35 @@ $get("BtnCambiaTipoMoneda").click(); TipoCambioActual = TipoCambioTxt; } - } + } + function SumaLiq(txt, CveVenta, pagoMultiple, monedaPago) { + let ClsSelLiqVenta = ".ClsSelLiqVenta" + CveVenta; + let ClsSelLiqVentaTotal = ".ClsSelLiqVentaTotal" + CveVenta; + let ClsSelLiqAnticipo = ".ClsSelLiqAnt" + CveVenta; - function SumaLiquidacion(txt, CveVenta, pagoMultiple, monedaPago) { - - let ClsSelLiquidacionVenta = ".ClsSelLiquidacionVenta" + CveVenta; - let ClsSelLiquidacionVentaTotal = ".ClsSelLiquidacionVentaTotal" + CveVenta; let Total = 0.0; + let Anticipos = 0.0; + $( ClsSelLiqVenta).each(function () { - $( ClsSelLiquidacionVenta).each(function () { - - let valorString = $(this).val(); - valorString = valorString.replace(/,/g, ''); - - if (valorString.trim().length > 0) { - Total = Total + parseFloat(valorString); - } + Total = Total + ToDouble($(this).val()); }); + $(ClsSelLiqAnticipo).each(function () { - $(ClsSelLiquidacionVentaTotal).each(function () { + Anticipos = Anticipos + ToDouble($(this).val()); + + }); + + Total = Total + Anticipos; + + $(ClsSelLiqVentaTotal).each(function () { $(this).val(Total); FormatoMoneda2($(this)); }); - - + FormatoMoneda(txt); var Suma = SumaValores(pagoMultiple, monedaPago); diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index c83c43171..6057c02a7 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -62,6 +62,15 @@ Partial Class Ventas_ClientesAbonar End Set End Property + Private Property DtIngresos As DataTable + Get + Return CType(ViewState("DtIngresos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtIngresos") = value + End Set + End Property + Private Property IdCuentaBancaria As Integer Get Return ViewState("IdCuentaBancaria").ToString.ToEntero @@ -258,6 +267,7 @@ Partial Class Ventas_ClientesAbonar IdCuentaBancaria = 0 TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1},-1);", "TxtTotal", 0)) + 'TxtAnticipo.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1},-1);", "null", 0)) If CveMoneda > 0 Then LbTipoMoneda.Text = String.Format("Pago en {0}", GlobalDTMonedas.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)).Rows(0)("Moneda")) @@ -292,28 +302,6 @@ Partial Class Ventas_ClientesAbonar RVTxtFechaDocumento.MaximumValue = Now.ToString("dd/MM/yyyy") - If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then - - 'Dim CveClasificacionCol1 As Integer = 21514 - 'Dim CveClasificacionCol2 As Integer = 21916 - 'Dim CveClasificacionCol3 As Integer = 21520 - 'Dim CveClasificacionCol4 As Integer = 21519 - 'Dim CveClasificacionCol5 As Integer = 21547 - 'Dim CveClasificacionCol6 As Integer = 21572 - 'Dim CveClasificacionCol7 As Integer = 21571 - - GvCxC.Columns(17).HeaderText = "Comisión
    Venta" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol1).FiltroPrimeroValor("Clasificacion").Substring(0, 10) - GvCxC.Columns(18).HeaderText = "Gastos
    Manejo" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol2).FiltroPrimeroValor("Clasificacion").Substring(0, 12) - GvCxC.Columns(19).HeaderText = "Servicio
    Inspección" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol3).FiltroPrimeroValor("Clasificacion").Substring(0, 12) - GvCxC.Columns(20).HeaderText = "Seguro" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol4).FiltroPrimeroValor("Clasificacion").Substring(0, 12) - GvCxC.Columns(21).HeaderText = "Aduana
    Mex" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol5).FiltroPrimeroValor("Clasificacion").Substring(0, 12) - GvCxC.Columns(22).HeaderText = "Diversos" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol6).FiltroPrimeroValor("Clasificacion").Substring(0, 12) - GvCxC.Columns(23).HeaderText = "Aduana
    USA" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol7).FiltroPrimeroValor("Clasificacion").Substring(0, 12) - 'GvCxC.Columns(24).HeaderText = "Material
    Empaque" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol7).FiltroPrimeroValor("Clasificacion").Substring(0, 12) - - DvLiquidacion1.Visible = True - DvLiquidacion2.Visible = True - End If End If @@ -385,6 +373,32 @@ Partial Class Ventas_ClientesAbonar If Request("FechaI") IsNot Nothing Then ViewState("FechaI") = Request("FechaI") Else ViewState("FechaI") = "-1" If Request("FechaF") IsNot Nothing Then ViewState("FechaF") = Request("FechaF") Else ViewState("FechaF") = "-1" + If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then + + 'Dim CveClasificacionCol1 As Integer = 21514 + 'Dim CveClasificacionCol2 As Integer = 21916 + 'Dim CveClasificacionCol3 As Integer = 21520 + 'Dim CveClasificacionCol4 As Integer = 21519 + 'Dim CveClasificacionCol5 As Integer = 21547 + 'Dim CveClasificacionCol6 As Integer = 21572 + 'Dim CveClasificacionCol7 As Integer = 21571 + divAnticipo.Visible = True + + GvCxC.Columns(17).HeaderText = "Comisión
    Venta" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol1).FiltroPrimeroValor("Clasificacion").Substring(0, 10) + GvCxC.Columns(18).HeaderText = "Gastos
    Manejo" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol2).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(19).HeaderText = "Servicio
    Inspección" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol3).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(20).HeaderText = "Seguro" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol4).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(21).HeaderText = "Aduana
    Mex" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol5).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(22).HeaderText = "Diversos" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol6).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(23).HeaderText = "Aduana
    USA" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol7).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + 'GvCxC.Columns(24).HeaderText = "Material
    Empaque" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol7).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + + DvLiquidacion1.Visible = True + DvLiquidacion2.Visible = True + + DtIngresos = CargaIngresos(2) + End If + CargaDatos(tCveMoneda) Else Alert("El Cliente Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) @@ -525,15 +539,7 @@ Partial Class Ventas_ClientesAbonar If e.Row.RowType = DataControlRowType.DataRow Then Dim moneda As Integer = 0 If e.Row.RowIndex = 0 Then - ' e.Row.Cells(0).ColumnSpan = 5 - ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right - ' e.Row.Cells(1).Visible = False - ' e.Row.Cells(2).Visible = False - ' e.Row.Cells(3).Visible = False - ' e.Row.Cells(4).Visible = False - e.Row.BackColor = Drawing.Color.LightGray - e.Row.FCDropDownList("DdlTG").Visible = False e.Row.FCTextBox("TxtLiqCol1").Visible = False e.Row.FCTextBox("TxtLiqCol2").Visible = False @@ -543,6 +549,8 @@ Partial Class Ventas_ClientesAbonar e.Row.FCTextBox("TxtLiqCol6").Visible = False e.Row.FCTextBox("TxtLiqCol7").Visible = False e.Row.FCTextBox("TxtLiqCol8").Visible = False + e.Row.FCTextBox("TxtAmort").Visible = False + e.Row.FCDropDownList("DdlAnti").Visible = False End If If e.Row.RowIndex = 1 Then @@ -553,9 +561,9 @@ Partial Class Ventas_ClientesAbonar e.Row.Cells(6).Width = Unit.Pixel(50) e.Row.Cells(7).Width = Unit.Pixel(70) e.Row.Cells(8).Width = Unit.Pixel(50) - e.Row.Cells(9).Width = Unit.Pixel(90) - e.Row.Cells(10).Width = Unit.Pixel(80) - e.Row.Cells(11).Width = Unit.Pixel(60) + 'e.Row.Cells(9).Width = Unit.Pixel(90) + 'e.Row.Cells(10).Width = Unit.Pixel(80) + 'e.Row.Cells(11).Width = Unit.Pixel(60) End If e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right @@ -614,40 +622,42 @@ Partial Class Ventas_ClientesAbonar e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); 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, e.Row.DBCampo("CveVenta"))) End If - If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then '' si es empresa agrícola e.Row.FCDropDownList("DdlTG").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlTG").DataBind() - e.Row.FCTextBox("TxtLiqCol1").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiqCol2").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiqCol3").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiqCol4").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiqCol5").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiqCol6").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiqCol7").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiqCol8").Attributes.Add("class", $"ClsSelLiquidacionVentaTotal{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol1").Attributes.Add("class", $"ClsSelLiq ClsSelLiqVenta{e.Row.DBCampo("CveVenta")}") + e.Row.FCTextBox("TxtLiqCol2").Attributes.Add("class", $"ClsSelLiq ClsSelLiqVenta{e.Row.DBCampo("CveVenta")}") + e.Row.FCTextBox("TxtLiqCol3").Attributes.Add("class", $"ClsSelLiq ClsSelLiqVenta{e.Row.DBCampo("CveVenta")}") + e.Row.FCTextBox("TxtLiqCol4").Attributes.Add("class", $"ClsSelLiq ClsSelLiqVenta{e.Row.DBCampo("CveVenta")}") + e.Row.FCTextBox("TxtLiqCol5").Attributes.Add("class", $"ClsSelLiq ClsSelLiqVenta{e.Row.DBCampo("CveVenta")}") + e.Row.FCTextBox("TxtLiqCol6").Attributes.Add("class", $"ClsSelLiq ClsSelLiqVenta{e.Row.DBCampo("CveVenta")}") + e.Row.FCTextBox("TxtLiqCol7").Attributes.Add("class", $"ClsSelLiq ClsSelLiqVenta{e.Row.DBCampo("CveVenta")}") + e.Row.FCTextBox("TxtLiqCol8").Attributes.Add("class", $"ClsSelLiqVentaTotal{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtAmort").Attributes.Add("class", $"ClsSelLiqAnt") + e.Row.FCTextBox("TxtLiqCol1").Attributes.Add("onkeyup", $"SumaLiq (this,{e.Row.DBCampo("CveVenta")},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol2").Attributes.Add("onkeyup", $"SumaLiq(this,{e.Row.DBCampo("CveVenta")},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol3").Attributes.Add("onkeyup", $"SumaLiq(this,{e.Row.DBCampo("CveVenta")},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol4").Attributes.Add("onkeyup", $"SumaLiq(this,{e.Row.DBCampo("CveVenta")},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol5").Attributes.Add("onkeyup", $"SumaLiq(this,{e.Row.DBCampo("CveVenta")},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol6").Attributes.Add("onkeyup", $"SumaLiq(this,{e.Row.DBCampo("CveVenta")},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol7").Attributes.Add("onkeyup", $"SumaLiq(this,{e.Row.DBCampo("CveVenta")},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtAmort").Attributes.Add("onkeyup", $"SumaLiq(this,{e.Row.DBCampo("CveVenta")},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiqCol1").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiqCol2").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiqCol3").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiqCol4").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiqCol5").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiqCol6").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiqCol7").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCDropDownList("DdlAnti").DataSource = DtIngresos + e.Row.FCDropDownList("DdlAnti").DataBind() + e.Row.FCDropDownList("DdlAnti").Items.Insert(0, New ListItem("-", "-1")) End If - Else e.Row.FCTextBox("TxtAbonar").Visible = False e.Row.FCTextBox("TxtComision").Visible = False e.Row.FCCheckBox("Chk").Visible = False End If - If e.Row.DBCampo("CveVenta").ToEntero > 0 Then If e.Row.DataKey("ClaveMetodoPagoSAT") = "PUE" Then e.Row.FCLiteral("LtlComplemento").Text = "" @@ -656,7 +666,6 @@ Partial Class Ventas_ClientesAbonar e.Row.FCLiteral("LtlComplemento").Visible = False End If - End If End Sub @@ -929,7 +938,7 @@ Partial Class Ventas_ClientesAbonar Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False) Dim ImporteMovimiento As Decimal = 0 - Dim importeMX As Decimal + Dim ImporteMN As Decimal Dim FechaMovimiento As Date = TxtFechaDocumento.Text Dim IdCtaContable As Integer = 0 Dim ConceptoMovimiento As String = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreComercial, gvr.DataKey("SerieFolio").ToString, TxtFolio.Text.Trim) @@ -942,21 +951,9 @@ Partial Class Ventas_ClientesAbonar Select Case ConceptoContable Case 2 'Pago Cliente If gvr.DataKey("CveMoneda").ToEntero > 1 Then ConceptoContable = 292 - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaValuacion - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = ImporteMovimiento * tipoCambioVentaValuacion - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal).RoundSQL + ImporteMN = (ImporteMovimiento * tipoCambioVentaValuacion).RoundSQL TipoCambioGeneral = tipoCambioVentaValuacion CveSubProyectoContabilizar = CveSubProyecto @@ -967,7 +964,7 @@ Partial Class Ventas_ClientesAbonar ConceptoMovimiento += $" TC:{tipoCambioVentaValuacion} ${ImporteMovimiento.FormatoNumero(2)}" IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaComplementariaAnticipo, IdCtaContComplementaria) If ImporteMovimiento <> 0 Then - importeMX = ImporteMovimiento + ImporteMN = ImporteMovimiento If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, If(gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158), 226, 207), ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=(ImporteMovimiento * tipoCambioVentaValuacion - ImporteMovimiento).RoundSQL, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioVentaValuacion) Then MsgError = "No se pudo insertar la póliza" End If @@ -977,8 +974,8 @@ Partial Class Ventas_ClientesAbonar End If If EsAnticipoEspecial Then - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, Referencia, 2, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Referencia, 95, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, Referencia, 2, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Referencia, 95, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then MsgError = "No se pudo insertar la póliza" End If Else @@ -986,29 +983,14 @@ Partial Class Ventas_ClientesAbonar End If End If - Case 8 'Ret IVA x Trasladar If EsAnticipoEspecial Then Exit Select If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then Exit Select End If - 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 - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioVenta - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL TipoCambioGeneral = tipoCambioVenta CveSubProyectoContabilizar = CveSubProyecto @@ -1025,27 +1007,12 @@ Partial Class Ventas_ClientesAbonar End If End If - Case 313 'Ret Iva Servicios If EsAnticipoEspecial Then Exit Select If gvr.DataKey("CveTipoRetencion").ToEntero = 4 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 - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioVenta - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL TipoCambioGeneral = tipoCambioVenta CveSubProyectoContabilizar = CveSubProyecto @@ -1064,23 +1031,9 @@ Partial Class Ventas_ClientesAbonar Case 9 'Ret ISR x Trasladar If EsAnticipoEspecial Then Exit Select - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento * tipoCambioVenta - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL TipoCambioGeneral = tipoCambioVenta CveSubProyectoContabilizar = CveSubProyecto @@ -1100,23 +1053,9 @@ Partial Class Ventas_ClientesAbonar Case 13 'Iva por Trasladar If EsAnticipoEspecial Then Exit Select - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL() ' se ajusta por la parcialidad de pago, afecta en el redondeo - importeMX = ImporteMovimiento * tipoCambioVenta - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL() + + ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL TipoCambioGeneral = tipoCambioVenta CveSubProyectoContabilizar = CveSubProyecto @@ -1134,24 +1073,9 @@ Partial Class Ventas_ClientesAbonar If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then Exit Select End If - 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 - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) CveSubProyectoContabilizar = CveSubProyecto @@ -1167,29 +1091,12 @@ Partial Class Ventas_ClientesAbonar End If End If End If - - Case 314 'Ret Iva Servicios Traslado If EsAnticipoEspecial Then Exit Select If gvr.DataKey("CveTipoRetencion").ToEntero = 4 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 - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) CveSubProyectoContabilizar = CveSubProyecto @@ -1200,30 +1107,15 @@ Partial Class Ventas_ClientesAbonar If ObjMov.DtResultados.Rows.Count > 0 Then 'Conta ContPAQ IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - End If End If End If Case 63 'Ret ISR Trasladado If EsAnticipoEspecial Then Exit Select - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) CveSubProyectoContabilizar = CveSubProyecto @@ -1243,23 +1135,9 @@ Partial Class Ventas_ClientesAbonar Case 61 'Iva Trasladado If EsAnticipoEspecial Then Exit Select - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) CveSubProyectoContabilizar = CveSubProyecto @@ -1274,47 +1152,20 @@ Partial Class Ventas_ClientesAbonar If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" Case 38 'IEPS por trasladar If EsAnticipoEspecial Then Exit Select - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("IEPS").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * tipoCambioVenta - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL - importeMX = ImporteMovimiento * tipoCambioVenta - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL TipoCambioGeneral = tipoCambioVenta CveSubProyectoContabilizar = CveSubProyecto IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar Case 39 'IEPS Trasladado If EsAnticipoEspecial Then Exit Select - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.DataKey("IEPS").ToDecimal * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - End If - ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + + ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL + ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) + CveSubProyectoContabilizar = CveSubProyecto IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado @@ -1369,7 +1220,7 @@ Partial Class Ventas_ClientesAbonar End If ImporteMovimiento = Math.Abs(Diferencia) - importeMX = ImporteMovimiento + ImporteMN = ImporteMovimiento CveSubProyectoContabilizar = CveSubProyecto @@ -1381,32 +1232,18 @@ Partial Class Ventas_ClientesAbonar Case 78 'Otros Ingresos If ChkAjusteOI.Checked Then ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal - importeMX = Math.Round(ImporteMovimiento * tipoCambioPago, 2) - - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal - importeMX = ImporteMovimiento - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal - importeMX = ImporteMovimiento * tipoCambioPago - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal - importeMX = ImporteMovimiento - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal - importeMX = ImporteMovimiento * tipoCambioPago - End If + ImporteMN = ImporteMovimiento * tipoCambioPago.RoundSQL If gvr.FCTextBox("TxtComision").Text.ToDecimal < 0 Then TipoMovimiento = False ImporteMovimiento = ImporteMovimiento * -1 - importeMX = importeMX * -1 + ImporteMN = ImporteMN * -1 Else TipoMovimiento = True End If ImporteMovimiento = ImporteMovimiento.RoundSQL - importeMX = importeMX.RoundSQL + ImporteMN = ImporteMN.RoundSQL TipoCambioGeneral = tipoCambioPago CveSubProyectoContabilizar = CveSubProyecto @@ -1419,12 +1256,12 @@ Partial Class Ventas_ClientesAbonar Case 134 'Pago Intermediario If RblTipoPago.SelectedValue = "2" Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - gvr.FCTextBox("TxtComision").Text.ToDecimal - importeMX = Math.Round(ImporteMovimiento * tipoCambioPago, 2) + ImporteMN = Math.Round(ImporteMovimiento * tipoCambioPago, 2) CveSubProyectoContabilizar = CveSubProyecto If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ConceptoMovimiento, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero, ImporteMX:=importeMX) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ConceptoMovimiento, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero, ImporteMX:=ImporteMN) Then MsgError = "No se pudo insertar la póliza" End If End If @@ -1446,7 +1283,7 @@ Partial Class Ventas_ClientesAbonar idCuentaContabilizacion = 0 End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then MsgError = "No se pudo insertar la póliza" Exit For End If @@ -1480,51 +1317,44 @@ Partial Class Ventas_ClientesAbonar Dim ConceptoPartida As String = gvr.DataKey("SerieFolio") & " " & gvr.FCDropDownList("DdlTG").SelectedItem.Text If ImporteLiq1 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq1, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq1 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1, ImporteME:=If(CveMoneda > 1, ImporteLiq1, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq1, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq1 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1, ImporteME:=If(CveMoneda > 1, ImporteLiq1, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For End If End If If ImporteLiq2 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq2 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq2 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For End If End If If ImporteLiq3 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq3 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq3 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For End If End If If ImporteLiq4 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq4 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq4 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For End If End If If ImporteLiq5 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq5 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq5 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For End If End If If ImporteLiq6 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq6 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq6 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For End If End If If ImporteLiq7 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq7 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq7 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For End If End If @@ -1534,6 +1364,16 @@ Partial Class Ventas_ClientesAbonar ' Exit For ' End If 'End If + + If gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero > 0 Then + Dim TCP As Decimal = 0 + If DtIngresos IsNot Nothing Then + TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue)) + End If + MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVenta) + End If + + End If If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal() @@ -1577,47 +1417,65 @@ Partial Class Ventas_ClientesAbonar End If End If - If RblTipoPago.SelectedValue = "3" AndAlso MsgError = "" Then - If CveMonedaPago = 2 Then - 'rmf faltan las cuentas - If IdCtaContMonedaComplementariaAnticipo > 0 Then - If CveMonedaPago = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES - tipoCambioPago = TxtTCDolares.Text.ToDecimal - ElseIf CveMonedaPago = 2 AndAlso CveMonedaFiltro = 2 Then - tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal - End If - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=TxtImporte.Text.Trim.ToDecimal, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then - MsgError = "No se pudo insertar la póliza" - End If - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), TxtObservaciones.Text, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (TxtImporte.Text.Trim.ToDecimal * tipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then - MsgError = "No se pudo insertar la póliza" - End If - Else - If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES - tipoCambioPago = TxtTCDolares.Text.ToDecimal - ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then - tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal - End If - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal * tipoCambioPago, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then - MsgError = "No se pudo insertar la póliza" - End If - End If - Else - If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES - tipoCambioPago = TxtTCDolares.Text.ToDecimal - ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then - tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal - End If - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCtaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal * tipoCambioPago, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola + If TxtAnticipo.Text.ToDecimal <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtAnticipo.Text.ToDecimal, TxtFolio.Text, 66, TxtObservaciones.Text, Now, -1, -1, CveIE, -1, -1, CveSubProyecto, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=TxtAnticipo.Text.ToDecimal, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=0, ImporteME:=If(CveMoneda > 1, TxtAnticipo.Text.ToDecimal, 0)) Then MsgError = "No se pudo insertar la póliza" End If + + If CveMoneda > 1 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtAnticipo.Text.ToDecimal, TxtFolio.Text, 226, TxtObservaciones.Text, Now, -1, -1, CveIE, -1, -1, CveSubProyecto, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=(TxtAnticipo.Text.ToDecimal * tipoCambioPago).RoundSQL, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=0, ImporteME:=If(CveMoneda > 1, TxtAnticipo.Text.ToDecimal, 0)) Then + MsgError = "No se pudo insertar la póliza" + End If + End If + End If End If + If RblTipoPago.SelectedValue = "3" AndAlso MsgError = "" Then + + MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta) + + 'If CveMonedaPago = 2 Then + ' 'rmf faltan las cuentas + ' If IdCtaContMonedaComplementariaAnticipo > 0 Then + ' If CveMonedaPago = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + ' tipoCambioPago = TxtTCDolares.Text.ToDecimal + ' ElseIf CveMonedaPago = 2 AndAlso CveMonedaFiltro = 2 Then + ' tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal + ' End If + + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=TxtImporte.Text.Trim.ToDecimal, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), TxtObservaciones.Text, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (TxtImporte.Text.Trim.ToDecimal * tipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + ' Else + ' If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + ' tipoCambioPago = TxtTCDolares.Text.ToDecimal + ' ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then + ' tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal + ' End If + + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal * tipoCambioPago, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + ' End If + 'Else + ' If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + ' tipoCambioPago = TxtTCDolares.Text.ToDecimal + ' ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then + ' tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal + ' End If + + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCtaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal * tipoCambioPago, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + 'End If + End If + If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then If Not ObjMov.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then MsgError = "No se pudo simplificar los movimientos" @@ -1810,6 +1668,51 @@ Partial Class Ventas_ClientesAbonar End Sub + Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, tipoCambioVenta As Decimal) As String + Dim MsgError As String = "" + If CveMonedaPago = 2 Then + 'rmf faltan las cuentas + 'If IdCtaContMonedaComplementariaAnticipo > 0 Then + If CveMonedaPago = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + tipoCambioPago = TxtTCDolares.Text.ToDecimal + ElseIf CveMonedaPago = 2 AndAlso CveMonedaFiltro = 2 Then + tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal + End If + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, CveCliente, ImporteMX:=Importe, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + MsgError = "No se pudo insertar la póliza" + End If + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), TxtObservaciones.Text, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + MsgError = "No se pudo insertar la póliza" + End If + 'Else + ' If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + ' tipoCambioPago = TxtTCDolares.Text.ToDecimal + ' ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then + ' tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal + ' End If + + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, CveCliente, ImporteMX:=If(CveMoneda = 2, Importe * tipoCambioPago, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + 'End If + Else + If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + tipoCambioPago = TxtTCDolares.Text.ToDecimal + ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then + tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal + End If + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCtaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, Importe * tipoCambioPago, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + MsgError = "No se pudo insertar la póliza" + End If + End If + + Return MsgError + + End Function + #Region " N O T A - D E - C R E D I T O" Private Function GenerarNC(SqlTransaccion As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As Modelos.Factura.MMensajeFactura @@ -1837,16 +1740,6 @@ Partial Class Ventas_ClientesAbonar Dim Folio As Integer = -1 Dim Serie As String = "-1" - 'Dim ObjFolios As New ClsGralFolios() - 'If ObjFolios.GetFolios("Egs", UsuarioActual.CveEmpresa) Then - ' Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" Estado = 'Activo' AND CveSubProyecto = {0}", Me.CveSubProyecto)) - ' If DT.Rows.Count > 0 Then - ' Serie = DT.Rows(0)("Serie").ToString() - ' Folio = DT.Rows(0)("FActual").ToString() - ' End If - ' DT.Dispose() - 'End If - 'ObjFolios.Dispose() ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal()) @@ -2370,17 +2263,19 @@ Partial Class Ventas_ClientesAbonar UpDatos.Update() End Sub - Private Sub CargaIngresos(tCveMoneda As Integer) - + Private Function CargaIngresos(tCveMoneda As Integer) As DataTable + Dim dtt As DataTable = Nothing Dim Deudores As New ClsMovimientos If Deudores.GetIngresosSaldosDetalle(CveCliente, tCveMoneda, UsuarioActual.CveEmpresa) Then DdlIngreso.DataSource = Deudores.DtResultados.FiltraParametros("CveCliente > 0 AND Saldo > 0 AND CveIE > 0") + dtt = Deudores.DtResultados.FiltraParametros("CveCliente > 0 AND Saldo > 0 AND CveIE > 0") End If Deudores.Dispose() DdlIngreso.DataBind() DdlIngreso.Items.Insert(0, New ListItem("Seleccione", "-1")) - End Sub + Return dtt + End Function Protected Sub ChkAjusteOI_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ChkAjusteOI.CheckedChanged @@ -2475,13 +2370,9 @@ Partial Class Ventas_ClientesAbonar End If End If - End If Dep.Dispose() - - DdlCuentaDeposito.DataBind() - Else trCuentaDeposito.Visible = False DdlCuentaDeposito.Items.Clear() @@ -2542,8 +2433,6 @@ Partial Class Ventas_ClientesAbonar End If End If - - ObjBancos.IniciaTransacSQL() @@ -2615,22 +2504,6 @@ Partial Class Ventas_ClientesAbonar End If End If - 'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then - ' If ObjIE.DtResultados.Rows.Count > 0 Then - ' Dim tFecha As Date = TxtFechaIncobrable.Text.ToDate - ' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day) - ' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC") - - ' If drr IsNot Nothing Then - ' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate - ' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal - ' End If - - ' End If - 'End If - - 'ObjIE.Dispose() - CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, 0, 0, 1, TxtFechaIncobrable.Text.ToDate, TxtObsSaldarIncobrable.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) @@ -2918,193 +2791,6 @@ Partial Class Ventas_ClientesAbonar #End Region -#Region "COMPLEMENTO DE PAGO - ELIMINAR POR SUSTITUCION" - - 'Protected Sub CargaIESustituir() - ' Dim ObjIE As New ClsBancos() - ' If ObjIE.GetBancosIE(CveIESustitucion, UsuarioActual.CveEmpresa) Then - ' If ObjIE.DtResultados.Rows.Count > 0 Then - ' FechaCorteIE = ObjIE.FechaDocumento - ' CveMoneda = ObjIE.CveMoneda - ' CveMonedaFiltro = CveMoneda - ' IDPoliza = ObjIE.IDPoliza - ' FolioIECancelado = ObjIE.Folio - ' End If - ' End If - ' ObjIE.Dispose() - ' UpDatos.Update() - 'End Sub - - 'Function CancelarIE() As Boolean - ' Dim ErrorCancelar = False - - ' If Not IsDate(TxtFechaDocumento.Text.ToDate) Then - ' Alert("El campo fecha cancelación es incorrecto. Por favor verifique y vuelva a intentar") - ' Return True - ' End If - - ' Dim Banc As New ClsBancos - ' Banc.IniciaTransacSQL() - - ' Dim ObjAC As ClsContPAQi = Nothing - ' If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad Then - ' ObjAC = New ClsContPAQi(UsuarioActual.Empresa) - ' ObjAC.IniciaTransacSQL() - ' End If - - ' Dim IdPolizaNueva = -1 - ' Dim FolioPolizaNueva = -1 - - ' Try - ' 'CANCELA IE CONTABILIZADO - ' If IDPoliza > 0 Then - ' If ObjAC Is Nothing Then - ' ErrorCancelar = True - ' End If - - ' If Not ErrorCancelar Then - ' Dim dt As DataTable - ' If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then - ' dt = ObjAC.DtResultados - - ' ' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS) - ' If dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaDocumento.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaDocumento.Text.ToDate.Year Then - ' IdPolizaNueva = ObjAC.AddPoliza(3, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaDocumento.Text.ToDate) - - ' If IdPolizaNueva > 0 Then - ' FolioPolizaNueva = ObjAC.Folio - - ' 'CREA POLIZA NEGATIVA - ' For Each dr As DataRow In dt.Rows - ' If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaDocumento.Text.ToDate, "") Then - ' ErrorCancelar = True : Exit For - ' End If - ' Next - - ' 'AJUSTA POLIZA - ' If Not ErrorCancelar Then - ' If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then - ' ErrorCancelar = True - ' End If - ' End If - - ' 'CANCELA IE - ' If Not ErrorCancelar Then - ' If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then - ' ErrorCancelar = True - ' End If - ' End If - - ' Else - ' ErrorCancelar = True - ' End If - - ' Else - - ' 'LIMPIA POLIZA PONIENDO IMPORTE EN CEROS - ' For Each dr As DataRow In dt.Rows - ' If Not ObjAC.UpdateMovimiento(dr("Id").ToString.ToEntero, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "1", 0, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegNeg").ToString.ToEntero, dr("Fecha").ToString.ToDate) Then - ' ErrorCancelar = True : Exit For - ' End If - ' Next - - ' 'AJUSTA POLIZA - ' If Not ErrorCancelar Then - ' If Not ObjAC.AjustaPoliza(IDPoliza) Then - ' ErrorCancelar = True - ' End If - ' End If - - ' 'CANCELA IE - ' If Not ErrorCancelar Then - ' If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then - ' ErrorCancelar = True - ' End If - ' End If - - ' End If - - ' End If - ' End If - ' Else - - ' If FechaCorteIE.Month < TxtFechaDocumento.Text.ToDate.Month Or FechaCorteIE.Year < TxtFechaDocumento.Text.ToDate.Year Then - ' 'CANCELA IE MES ANTERIOR - ' If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then - ' ErrorCancelar = True - ' End If - ' Else - ' 'CANCELA IE MES ACTUAL - ' If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then - ' ErrorCancelar = True - ' End If - ' End If - - ' End If - - ' If Not ErrorCancelar Then - ' If Banc.GetComplementoPagos(-1, CveIESustitucion, -1, UsuarioActual.CveEmpresa) Then - - ' Dim CveComplementoPago As Integer = -1 - - ' If Banc.DtResultados.Rows.Count > 0 Then - ' 'OBTENEMOS EL UUID DEL COMPLEMENTO A CANCELAR POR SUSTITUCION - ' CFDIRelacionadoSustitucion = Banc.DtResultados.Rows(0)("FolioFiscal") - ' CveComplementoPago = Banc.DtResultados(0)("CveComplementoPago").ToString().ToEntero - ' End If - - ' 'ACTUALIZA FOLIOS CANCELADOS - ' If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then - ' If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then - ' ErrorCancelar = True - ' Else - ' Dim FolioCancelado = $"{FolioIECancelado}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}" - - ' If Not Banc.UpdateFolioCancelado(CveIESustitucion.ToEntero, Folio:=FolioCancelado) Then - ' ErrorCancelar = True - ' End If - ' End If - ' End If - - ' 'ACTUALIZA ESTATUS DE COMPLEMENTO DE PAGO A CANCELADO = 2 - ' If Not ErrorCancelar And CveComplementoPago > 0 Then - ' If Not Banc.UpdateComplementoPagoCancelado(CveComplementoPago, 2, UsuarioActual.Empresa.CvePAC, UsuarioActual.CveEmpresa, DateTime.Now) Then - ' ErrorCancelar = True - ' End If - ' End If - ' End If - ' End If - ' Catch ex As Exception - ' ErrorCancelar = True - ' OnError("Ocurrió un error al cancelar el IE", ex) - ' End Try - - ' If Not ErrorCancelar Then - ' Banc.Commit() - ' If ObjAC IsNot Nothing Then ObjAC.Commit() - - ' Dim Msg As New StringBuilder - ' Msg.Append("El movimiento bancario quedó cancelado exitosamente.") - - ' If IdPolizaNueva > 0 Then Msg.AppendFormat("

    Ver Póliza de cancelación", IdPolizaNueva) - ' Alert(Msg.ToString, TipoMensaje.MsgInformacion) - ' Else - ' Banc.RollBack() - ' If ObjAC IsNot Nothing Then ObjAC.RollBack() - ' Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError) - ' End If - - ' If ObjAC IsNot Nothing Then ObjAC.Dispose() - ' Banc.Dispose() - ' Return ErrorCancelar - 'End Function - - Private Sub BtnVincularIntermediario_Click(sender As Object, e As EventArgs) Handles BtnVincularIntermediario.Click - RegistraScript("$('#ModalVincularIntermediario').modal('hide')", "hidemodal") - End Sub -#End Region - - Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) CambiaTipoMoneda() End Sub @@ -3199,11 +2885,12 @@ Partial Class Ventas_ClientesAbonar GvCxC.Columns(22).Visible = True GvCxC.Columns(23).Visible = True GvCxC.Columns(24).Visible = True - 'GvCxC.Columns(25).Visible = True + GvCxC.Columns(25).Visible = True 'anticipos GvCxC.Columns(26).Visible = False GvCxC.Columns(27).Visible = False + Else GvCxC.Columns(4).Visible = True GvCxC.Columns(5).Visible = True diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index aba64a680..5267d6fce 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -22334,6 +22334,7 @@ Partial Class Ventas DivNombreCliente.Visible = False DivTipoPersona.Visible = False DivDireccionCliente.Visible = False + DivNumeroCPCliente.Visible = False DivColoniaTelefonoCliente.Visible = False DivCiudadLocalidadCliente.Visible = False @@ -34349,5 +34350,21 @@ Partial Class Ventas End Sub #End Region + + Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs) + + DVRegimenSociedad.Visible = False + DivRazonSocial2.Attributes.Add("class", "col-md-12") + + If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then + + DivRazonSocial2.Attributes.Add("class", "col-md-8") + DVRegimenSociedad.Visible = True + + End If + + UpAgregarCliente.Update() + End Sub + End Class