From 4fabaf9783ba7303990667d5a93bb7dece4ce6f2 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Nov 2023 12:37:16 -0700 Subject: [PATCH 01/16] -option explicit --- Contratos/Contrato.aspx.vb | 125 ++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 65 deletions(-) diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 63649550f..1f9e235c0 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -590,8 +590,8 @@ Partial Class Contratos_Default 'TabContratosGastos.Visible = False 'DONDE OCUPA ALMACEN - Dim CveTipoAlmacenOrigen = "12,15" - Dim CveTipoAlmacenDestino = "11,12" + Dim CveTipoAlmacenOrigen As String = "12,15" + Dim CveTipoAlmacenDestino As String = "11,12" If TipoContrato.Contiene({7, 9, 13, 16, 18, 21, 27}) Then RowAlmacen.Visible = True If TipoContrato.Contiene(7, 9, 13, 21, 27) Then @@ -603,7 +603,7 @@ Partial Class Contratos_Default End If End If - Dim CveOrigen = DdlAlmacenOrigen.SelectedValue + Dim CveOrigen As String = DdlAlmacenOrigen.SelectedValue DdlAlmacenOrigen.Items.Clear() DdlAlmacenOrigen.SelectedValue = "-1" DdlAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -616,7 +616,7 @@ Partial Class Contratos_Default DdlAlmacenOrigen.SelectedValueExist(CveOrigen) End If - Dim CveDestino = DdlAlmacenDestino.SelectedValue + Dim CveDestino As String = DdlAlmacenDestino.SelectedValue DdlAlmacenDestino.Items.Clear() DdlAlmacenDestino.SelectedValue = "-1" DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -935,7 +935,7 @@ Partial Class Contratos_Default #Region " CARGA DATOS " Private Sub CargaDatos() Dim ObjContratos As New ClsContratos() - Dim Ruta = Request.ApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" + Dim Ruta As String = Request.ApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" DivTipoContrato.Visible = False If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then @@ -1339,11 +1339,11 @@ Partial Class Contratos_Default Exit Sub End If - Dim TieneError = False - Dim Modificado = False + Dim TieneError As Boolean = False + Dim Modificado As Boolean = False ' Dim Extension = Session("FileExtension").ToString - Dim Archivo = Session("FileUpload").ToString - Dim Ruta = Session("FileFolder").ToString + Dim Archivo As String = Session("FileUpload").ToString + Dim Ruta As String = Session("FileFolder").ToString Dim Minimo, Maximo, Total As Double 'If txtMinimo.Text.ToDouble > 0 Then Minimo = txtMinimo.Text.ToDouble Else Minimo = -1 @@ -1612,11 +1612,11 @@ Partial Class Contratos_Default For Ciclo As Integer = 1 To CiclosComercialesEnMeses Dim FechaRef As DateTime = FechaI.AddMonths(PeriodoMeses * Ciclo) - Dim lastDayOfMonth = DateTime.DaysInMonth(FechaRef.Year, FechaRef.Month) + Dim lastDayOfMonth As Integer = DateTime.DaysInMonth(FechaRef.Year, FechaRef.Month) Dim DiaMes As Integer = If(lastDayOfMonth < DdlDiaFact.SelectedValue.ToEntero(), lastDayOfMonth, DdlDiaFact.SelectedValue.ToEntero()) - Dim FechaFact = New DateTime(FechaRef.Year, FechaRef.Month, DiaMes) + Dim FechaFact As Date = New DateTime(FechaRef.Year, FechaRef.Month, DiaMes) FechaFact = If(FechaFact > FechaF, FechaF, FechaFact) If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaFact) Then TieneError = True : Exit For @@ -1644,7 +1644,7 @@ Partial Class Contratos_Default Dim DiaAnterior As Integer = 0 - For CicloDias = 1 To CiclosPorMes + For CicloDias As Integer = 1 To CiclosPorMes Dim DiaMes As Integer = 0 If CicloDias = 1 Then @@ -1994,8 +1994,8 @@ Partial Class Contratos_Default UpGV.Update() End Sub Protected Sub BtnAutorizar_Click(sender As Object, e As EventArgs) Handles BtnAutorizar.Click - Dim pinterno = TmpDT.SUM("Total", "CveTipoPresupuesto=1").ToString.ToDouble - Dim pventas = TmpDT.SUM("Total", "CveTipoPresupuesto=2").ToString.ToDouble + Dim pinterno As Double = TmpDT.SUM("Total", "CveTipoPresupuesto=1").ToString.ToDouble + Dim pventas As Double = TmpDT.SUM("Total", "CveTipoPresupuesto=2").ToString.ToDouble If (pinterno < pventas) Then Dim objContrato As New ClsContratos @@ -2038,7 +2038,7 @@ Partial Class Contratos_Default Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") TmpDT.Rows.Add(Row) TmpDT.AcceptChanges() - Dim TotalRow = Row("Total").ToString.ToDouble + Dim TotalRow As Double = Row("Total").ToString.ToDouble CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) @@ -2086,7 +2086,7 @@ Partial Class Contratos_Default Dim CveContratoDetalle As Integer = gvr.DataKey("CveContratoDetalle").ToString.ToEntero Dim objContrato As New ClsContratos If objContrato.UpdateContratosDetalleEstimacion(CveContratoDetalle, IIf(btn.Checked, 1, 0).ToString.ToEntero) Then - Dim row = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0) + Dim row As DataRow = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0) row("PermitirEstimacion") = IIf(btn.Checked, 1, 0).ToString.ToEntero Alert("Se ha permitido estimar", TipoMensaje.MsgInformacion) Else @@ -2103,7 +2103,7 @@ Partial Class Contratos_Default Dim CveContratoDetalle As Integer = gvr.DataKey("CveContratoDetalle").ToString.ToEntero Dim objContrato As New ClsContratos If objContrato.UpdateContratosDetalleAvance(CveContratoDetalle, IIf(btn.Checked, 1, 0).ToString.ToEntero) Then - Dim row = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0) + Dim row As DataRow = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0) row("PermitirAvance") = IIf(btn.Checked, 1, 0).ToString.ToEntero @@ -2169,7 +2169,7 @@ Partial Class Contratos_Default OCInterna = Gv.Rows(e.RowIndex).FCTextBox("TxtOCInternaEdit").Text.ToString LimitarCantidad = Gv.Rows(e.RowIndex).FCCheckBox("ChkLimitarCantidad").Checked Observaciones = Gv.Rows(e.RowIndex).FCTextBox("TxtObservacion").Text.ToString - Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) + Dim row As DataRow = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) Dim LimitarCantidadValidator As Boolean = row("LimitarCantidad").ToString = "True" If row("CantidadContratada").ToString.ToEntero <> Cantidad OrElse row("PU").ToString.ToEntero <> PU OrElse CveUM <> row("CveUM").ToString.ToEntero OrElse row("NoIdentificacion").ToString <> NoIdentificacion OrElse row("OCInterna").ToString <> OCInterna OrElse LimitarCantidadValidator <> LimitarCantidad Then @@ -2284,7 +2284,7 @@ Partial Class Contratos_Default End If Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") TmpDT.Rows.Add(Row) - Dim TotalRow = Row("Total").ToString.ToDouble + Dim TotalRow As Double = Row("Total").ToString.ToDouble CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) @@ -2354,7 +2354,7 @@ Partial Class Contratos_Default NoIdentificacion = GvInsumos.Rows(e.RowIndex).FCTextBox("TxtNoIdentificacion").Text.ToString LimitarCantidad = GvInsumos.Rows(e.RowIndex).FCCheckBox("ChkLimitarCantidad").Checked - Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) + Dim row As DataRow = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) If row("Cantidad").ToString.ToEntero <> Cantidad OrElse row("PU").ToString.ToEntero <> PU OrElse CveUM <> row("CveUM").ToString.ToEntero OrElse row("NoIdentificacion").ToString <> NoIdentificacion OrElse (row("LimitarCantidad").ToString = "True") <> LimitarCantidad Then @@ -2453,7 +2453,7 @@ Partial Class Contratos_Default End If Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") TmpDT.Rows.Add(Row) - Dim TotalRow = Row("Total").ToString.ToDouble + Dim TotalRow As Double = Row("Total").ToString.ToDouble GvInt.DataSource = TmpDT.FiltraParametros("CveTipoPresupuesto=1") GvInt.DataBind() @@ -2494,10 +2494,10 @@ Partial Class Contratos_Default CveUM = GvInt.Rows(e.RowIndex).FCDropDownList("DdlUMEdit").SelectedValue.ToEntero 'NoIdentificacion = GvInt.Rows(e.RowIndex).FCDropDownList("NoIdentificacion").ToString - Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) - Dim c1 = row("Cantidad").ToString.ToEntero - Dim p1 = row("PU").ToString.ToEntero - Dim cvum1 = row("CveUM").ToString.ToEntero + Dim row As DataRow = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalle))(0) + Dim c1 As Integer = row("Cantidad").ToString.ToEntero + Dim p1 As Decimal = row("PU").ToString.ToDecimal + Dim cvum1 As Integer = row("CveUM").ToString.ToEntero If c1 <> Cantidad OrElse p1 <> PU OrElse CveUM <> cvum1 Then Dim ObjContratos As New ClsContratos @@ -2573,7 +2573,7 @@ Partial Class Contratos_Default TabReporteAvance.Visible = True lbImprimirAvance.Visible = True - Dim Modalidad = IfNull(Request("Tipo"), 1, 2) + Dim Modalidad As Integer = IfNull(Request("Tipo"), 1, 2).ToString.ToEntero If Modalidad.ToString.ToEntero = 2 Then Tab.ActiveTabIndex = 2 @@ -2613,19 +2613,19 @@ Partial Class Contratos_Default e.Row.CssClass = "SubTotales" End If - Dim Liga1 = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|1" + Dim Liga1 As String = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|1" e.Row.FCLinkButton("LBAvanceCantidad").CommandArgument = Liga1 e.Row.FCLinkButton("LBAvanceImporte").CommandArgument = Liga1 - Dim Liga2 = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|2" + Dim Liga2 As String = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|2" e.Row.FCLinkButton("LBAvanceXFacturarCantidad").CommandArgument = Liga2 e.Row.FCLinkButton("LBAvanceXFacturarImporte").CommandArgument = Liga2 End If End Sub Protected Sub MuestaModalVentasAvance(sender As Object, e As EventArgs) - Dim Btn = CType(sender, LinkButton) - Dim Parametros = Btn.CommandArgument.Split("|"c) + Dim Btn As LinkButton = CType(sender, LinkButton) + Dim Parametros As String() = Btn.CommandArgument.Split("|"c) Dim ObjContratos As New ClsContratos @@ -2987,7 +2987,7 @@ Partial Class Contratos_Default e.Row.Cells(4).Text = "" e.Row.Cells(5).Text = "" - Dim Texto = $"Pedido: {e.Row.DBCampo("SerieFolio")} | " + Dim Texto As String = $"Pedido: {e.Row.DBCampo("SerieFolio")} | " Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: {e.Row.DBCampo("Folio")}") e.Row.Cells(0).ColumnSpan = 2 @@ -3014,7 +3014,7 @@ Partial Class Contratos_Default e.Row.Cells(4).Text = "" e.Row.Cells(5).Text = "" - Dim Texto = $"Devolución: {e.Row.DBCampo("SerieFolio")} | " + Dim Texto As String = $"Devolución: {e.Row.DBCampo("SerieFolio")} | " Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: {e.Row.DBCampo("Folio")}") e.Row.Cells(0).ColumnSpan = 2 @@ -3102,7 +3102,7 @@ Partial Class Contratos_Default LBLAFValorActivo.Text = DT.SUM("ValorImporte", "CveMovimientoDetalle > 0").ToString("###,###,###.00") - Dim Total = DT.SUM("Cantidad", "CveMovimientoDetalle > 0 AND TipoDocto = 'Ped'") - DT.SUM("Cantidad", "TipoDocto = 'DPe'") + Dim Total As Decimal = DT.SUM("Cantidad", "CveMovimientoDetalle > 0 AND TipoDocto = 'Ped'") - DT.SUM("Cantidad", "TipoDocto = 'DPe'") LBLAFTotal.Text = DT.SUM("Cantidad", "CveMovimientoDetalle > 0").ToString() UPAFResumen.Update() @@ -3119,7 +3119,7 @@ Partial Class Contratos_Default e.Row.Cells(4).Text = "" e.Row.Cells(5).Text = "" - Dim Texto = $"{If(e.Row.DBCampo("TipoDocto") = "Ped", "Pedido", "Devolución") }: {e.Row.DBCampo("SerieFolio")} | " + Dim Texto As String = $"{If(e.Row.DBCampo("TipoDocto") = "Ped", "Pedido", "Devolución") }: {e.Row.DBCampo("SerieFolio")} | " Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: {e.Row.DBCampo("Folio")}") @@ -3169,7 +3169,7 @@ Partial Class Contratos_Default For Each GRow As GridViewRow In GvDatosAlmacen.Rows Dim CveMovimientoDetalle As Integer = GRow.DataKey("CveMovimientoDetalle").ToEntero - Dim ChkEsInterno = GRow.FCCheckBox("ChkEsInterno") + Dim ChkEsInterno As CheckBox = GRow.FCCheckBox("ChkEsInterno") If CveMovimientoDetalle > 0 And ChkEsInterno.Checked And DdlEsInterno.SelectedValue.ToEntero > 0 Then Dim EsInterno As Boolean @@ -3221,7 +3221,7 @@ Partial Class Contratos_Default Protected Sub BtnDevolucionAlmacen_Click(sender As Object, e As EventArgs) Dim ObjVentas As New ClsVentas ObjVentas.IniciaTransacSQL() - Dim TieneError = False + Dim TieneError As Boolean = False For Each Dr As DataRow In DtMovimientos.FiltraParametros("CveVenta IS NOT NULL AND CveMovimiento IS NOT NULL AND EsDevolucionVenta = 0", "", {"CveVenta"}).Rows If Not ObjVentas.UpdateVentasDevolucionAlmacen(1, Dr("CveVenta").ToString.ToEntero) Then @@ -3229,7 +3229,6 @@ Partial Class Contratos_Default End If Next - If Not TieneError Then ObjVentas.Commit() Alert("La solicitud de devolución se guardo correctamente.", TipoMensaje.MsgInformacion) @@ -3241,9 +3240,6 @@ Partial Class Contratos_Default ObjVentas.Dispose() End Sub - - - Public Sub CargaDatosEncabezado() TablaUtilidad.Visible = True @@ -3466,7 +3462,7 @@ Partial Class Contratos_Default Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) Dim dt As New DataTable dt = ReadExcelFile(Ruta + FileName, True) - Dim ErrorArchivo = False + Dim ErrorArchivo As Boolean = False 'Dim Conexion As Odbc.OdbcConnection = Nothing 'Try @@ -3602,7 +3598,7 @@ Partial Class Contratos_Default guardarBitacora(msj) dr("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") TmpDT.Rows.Add(dr) - Dim TotalRow = dr("Total").ToString.ToDouble + Dim TotalRow As Double = dr("Total").ToString.ToDouble CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero @@ -3708,7 +3704,7 @@ Partial Class Contratos_Default End Sub Private Sub CargaDiasMes(Optional NumMaxDias As Integer = 31) DdlDiaFact.Items.Clear() - For i = 1 To NumMaxDias + For i As Integer = 1 To NumMaxDias DdlDiaFact.Items.Add(New ListItem(i.ToString(), i.ToString())) Next End Sub @@ -4019,7 +4015,7 @@ Partial Class Contratos_Default End Sub Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos) - Dim ListaTagsDocumentost = New List(Of TagsDocumentos) + Dim ListaTagsDocumentost As New List(Of TagsDocumentos) Dim ObjContratos As New ClsContratos If CveContrato <> -1 Then If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then @@ -4072,7 +4068,7 @@ Partial Class Contratos_Default #Region "CREAR A PARTIR DE" Private Sub BtnAgregarContratoHijo_Click(sender As Object, e As EventArgs) Handles BtnAgregarContratoHijo.Click - Dim TieneError = False + Dim TieneError As Boolean = False Dim ObjContratos As New ClsContratos ObjContratos.IniciaTransacSQL() @@ -4131,9 +4127,8 @@ Partial Class Contratos_Default End Sub - Private Function AgregarDetalleHijo(CveContratoHijo As Integer, ByRef ObjContratos As ClsContratos) As Boolean - Dim TieneError = False + Dim TieneError As Boolean = False Dim Cantidades As Double For Each Row As DataRow In TmpDT.Rows @@ -4600,8 +4595,8 @@ Partial Class Contratos_Default If Plantilla.Contains("{MES}") Then Dim fecha As DateTime = NowADS() - Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes) End If @@ -4616,16 +4611,16 @@ Partial Class Contratos_Default If Plantilla.Contains("{MESANTERIOR}") Then Dim fecha As DateTime = NowADS().AddMonths(-1) - Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes) End If If Plantilla.Contains("{INICIOMESANTERIOR}") Then Dim fecha As DateTime = NowADS().AddMonths(-1) - Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year) @@ -4634,10 +4629,10 @@ Partial Class Contratos_Default If Plantilla.Contains("{FINMESANTERIOR}") Then Dim fecha As DateTime = NowADS().AddMonths(-1) - Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() - Dim LastDayOfMonth = DateTime.DaysInMonth(fecha.Year, fecha.Month) + Dim LastDayOfMonth As Integer = DateTime.DaysInMonth(fecha.Year, fecha.Month) Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year) @@ -4655,8 +4650,8 @@ Partial Class Contratos_Default If Plantilla.Contains("{MES}") Then Dim fecha As DateTime = NowADS() - Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes) End If @@ -4671,16 +4666,16 @@ Partial Class Contratos_Default If Plantilla.Contains("{MESANTERIOR}") Then Dim fecha As DateTime = NowADS().AddMonths(-1) - Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes) End If If Plantilla.Contains("{INICIOMESANTERIOR}") Then Dim fecha As DateTime = NowADS().AddMonths(-1) - Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year) @@ -4689,10 +4684,10 @@ Partial Class Contratos_Default If Plantilla.Contains("{FINMESANTERIOR}") Then Dim fecha As DateTime = NowADS().AddMonths(-1) - Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim formatoFecha As DateTimeFormatInfo = Globalization.CultureInfo.CurrentCulture.DateTimeFormat + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() - Dim LastDayOfMonth = DateTime.DaysInMonth(fecha.Year, fecha.Month) + Dim LastDayOfMonth As Integer = DateTime.DaysInMonth(fecha.Year, fecha.Month) Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year) From 1e53d179ded66d60f56656ddd5bee47f6d060adc Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 15:53:33 -0700 Subject: [PATCH 02/16] -- cambio en las cuentas de bancos --- Bancos/Transferencias.aspx | 2 +- Bancos/Transferencias.aspx.vb | 23 ++++------------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/Bancos/Transferencias.aspx b/Bancos/Transferencias.aspx index 80800329a..32049484a 100644 --- a/Bancos/Transferencias.aspx +++ b/Bancos/Transferencias.aspx @@ -192,7 +192,7 @@ --%> - + diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index 7134865b9..c13bd152b 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -174,7 +174,7 @@ Partial Class Bancos_Transferencias Private Sub CargaGridTarjetas() Dim ObjCreditos As New ClsBancos - If ObjCreditos.GetTarjetasCreditos(DdlCuentaDestino.SelectedValue.ToEntero) Then + If ObjCreditos.GetTarjetasCreditos(DdlCuentaOrigen.SelectedValue.ToEntero) Then If ObjCreditos.DtResultados.Rows.Count > 0 Then GvTC.DataSource = ObjCreditos.DtResultados End If @@ -321,10 +321,6 @@ Partial Class Bancos_Transferencias If (CveIE > 0 AndAlso CveIEDestino > 0 Or CveIE > 0 AndAlso chkMovimientoTarjeta.Checked AndAlso SumaImportesTarjeta <> 0) Then - If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) - End If - 'inserto los movimientos de la conta para abonar al saldo If MsgError = "" Then @@ -354,7 +350,6 @@ Partial Class Bancos_Transferencias TipoCambio:=TC) Then MsgError = "Ocurrió un error al registrar el asiento del ingreso." End If - End If 'Agregamos los Movimientos de Acreedor cuando es tarjeta @@ -371,7 +366,6 @@ Partial Class Bancos_Transferencias MsgError = "Ocurrio un error al obtener el folio destino." Exit For End If - Dim PagueseA As String = $"Transferencia Cta: {If(DdlCuentaOrigen.SelectedItem Is Nothing, DdlCuentaDestino.SelectedItem.Text, DdlCuentaOrigen.SelectedItem.Text)}" CveIEDestino = ObjIE.AddBancos_IE(row.DataKey("CveCuenta").ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TxtFechaDocumento.Text.Trim.ToDate, FolioDestino, PagueseA, row.FCTextBox("TxtAbono").Text.ToDecimal, CveMonedaDestino, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) @@ -385,9 +379,6 @@ Partial Class Bancos_Transferencias AlertaGlobal.AppendFormat("{1}
", CveIEDestino, FolioDestino) End If End If - - - Next 'Agregamos la contraria a bancos cuando es cuenta @@ -408,7 +399,6 @@ Partial Class Bancos_Transferencias ImporteME:=ImporteDestino, TipoCambio:=TC) Then MsgError = "Ocurrió un error al registrar el asiento del ingreso." End If - End If End If @@ -433,13 +423,10 @@ Partial Class Bancos_Transferencias If Not chkMovimientoTarjeta.Checked Then AlertaGlobal.AppendFormat("

Recepción: {1}", CveIEDestino, FolioDestino) End If - - End If Else MsgError = "no se pudo insertar el detalle de la póliza2" End If - Else MsgError = "no se pudo insertar el detalle de la póliza" End If @@ -454,13 +441,11 @@ Partial Class Bancos_Transferencias MsgError = "Error al guardar" End If - - - - - If MsgError = "" Then ObjIE.Commit() + If filemove <> "" Then + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) + End If Alert(String.Format("El Movimiento se realizo correctamente.
{0}", AlertaGlobal), TipoMensaje.MsgInformacion) Anexo.Text = "" 'Enviar Correo a los usuarios que tienen acceso a las dos cuentas From 76d45f5af0fa68ec6859b280156c9e66e14b694d Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 15:54:31 -0700 Subject: [PATCH 03/16] - option explicit --- App_Code/modExtensiones.vb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index f0f2001cf..7ca31a268 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -326,7 +326,7 @@ Namespace Extensiones Public Sub GuardaLogAD(Mensaje As String, Optional Archivo As String = "Log") Dim ArchivoW As StreamWriter - Dim MensajeFormato = String.Format("{0}{1}Log: {2} | Fecha:{3}", Chr(13), Chr(10), Mensaje, ClsPaginas.NowADS().ToString("dd/MM/yyyy HH:mm")) + Dim MensajeFormato As String = String.Format("{0}{1}Log: {2} | Fecha:{3}", Chr(13), Chr(10), Mensaje, ClsPaginas.NowADS().ToString("dd/MM/yyyy HH:mm")) Try ArchivoW = New StreamWriter(String.Format("{0}\Log\{1}.txt", AppDomain.CurrentDomain.BaseDirectory, Archivo), True, System.Text.Encoding.UTF8) @@ -2893,7 +2893,7 @@ Namespace Extensiones 'CUERPO (TABLAS DEL REPORTE) 'Se tiene que convertir la salida en elementos y posteriormente agregarlos al documento para que se respeten los márgenes - Dim els = HtmlConverter.ConvertToElements(sw.ToString(), properties) + Dim els As IList(Of Element.IElement) = HtmlConverter.ConvertToElements(sw.ToString(), properties) For Each el As Element.IBlockElement In els document.Add(el) Next @@ -3867,19 +3867,19 @@ Namespace Extensiones End Sub Public Overrides Sub OnAuthorization(ByVal actionContext As HttpActionContext) - Dim authHeader = actionContext.Request.Headers.Authorization + Dim authHeader As Headers.AuthenticationHeaderValue = actionContext.Request.Headers.Authorization Dim noautorizado As Boolean = True If authHeader IsNot Nothing Then If Left(actionContext.Request.RequestUri.AbsolutePath, 11).ToUpper() = SigfoxPath.ToUpper() Then - Dim usernamePasswordArray = Encoding.UTF8.GetString(Convert.FromBase64String(authHeader.Parameter)).Split(":"c) - Dim userName = usernamePasswordArray(0) - Dim password = usernamePasswordArray(1) + Dim usernamePasswordArray As String() = Encoding.UTF8.GetString(Convert.FromBase64String(authHeader.Parameter)).Split(":"c) + Dim userName As String = usernamePasswordArray(0) + Dim password As String = usernamePasswordArray(1) noautorizado = Not (userName = Me.Usuario AndAlso password = Me.Contra) Else Try If actionContext.Request.RequestUri.AbsolutePath.ToUpper() <> LoginPath.ToUpper() Then - Dim dataArray = Extensiones.Decripta(authHeader.Parameter).Split("|"c) + Dim dataArray As String() = Extensiones.Decripta(authHeader.Parameter).Split("|"c) If dataArray.Length > 4 AndAlso IsNumeric(dataArray(0)) AndAlso IsNumeric(dataArray(1)) AndAlso IsNumeric(dataArray(4)) Then Dim CveUsuario As Integer = dataArray(0).ToEntero() From 8e3916dd32159c3f619f97fdeb05cdc08094e257 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 15:55:08 -0700 Subject: [PATCH 04/16] - --- App_Code/Modelos.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index ff11bd35f..ed7f81c9e 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -5,7 +5,6 @@ Imports System.Data Imports System.IO Imports System.Net.Http Imports System.Xml -Imports DocumentFormat.OpenXml.VariantTypes Imports Extensiones Imports Microsoft.Reporting.WebForms From 69349720b4052b8ed850909dfd70d85891603371 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 17:58:00 -0700 Subject: [PATCH 05/16] =?UTF-8?q?--=20Correcci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ashx/E119.ashx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx index 24e9e93bf..addea2096 100644 --- a/Ashx/E119.ashx +++ b/Ashx/E119.ashx @@ -444,8 +444,14 @@ Public Class E119 : Implements IHttpHandler Resp = ObjFactura.EmitirFactura(False, Transac:=ObjClientes.IniciaTransacSQL()) If Resp.CveVenta > 0 Then + Dim data As New JArray + Dim objSucursal As New JObject( + New JProperty("Cve", Resp.CveVenta), + New JProperty("SerieFolio", Resp.SerieFolio) + ) + data.Add(objSucursal) Respuesta.status = "success" - Respuesta.data = Resp.SerieFolio + Respuesta.data = data Else TieneError = True End If From 546e8012435deb7526bf0645ade17528441305d9 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 17:58:54 -0700 Subject: [PATCH 06/16] -- cambios en pago a tdc --- Bancos/Transferencias.aspx | 6 +- Bancos/Transferencias.aspx.vb | 102 +++++++++++++--------------------- 2 files changed, 41 insertions(+), 67 deletions(-) diff --git a/Bancos/Transferencias.aspx b/Bancos/Transferencias.aspx index 32049484a..02e1234d8 100644 --- a/Bancos/Transferencias.aspx +++ b/Bancos/Transferencias.aspx @@ -53,10 +53,10 @@ - + Cuenta Destino: - + @@ -182,7 +182,7 @@ - + <%-- diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index c13bd152b..bcfdd3191 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -60,12 +60,13 @@ Partial Class Bancos_Transferencias If Opcion = 1 Then LtlTitulo.Text = "Domicialización de tarjeta" RBLOpcion.Visible = True - TrCuentaOrigen.Visible = False + TrCuentaDestino.Visible = False chkMovimientoTarjeta.Checked = True chkMovimientoTarjeta.Enabled = False + CargaCuenta(-1, DdlCuentaOrigen) chkMovimientoTarjeta_CheckedChanged(Nothing, Nothing) - CargaCuenta(-1, DdlCuentaDestino) - CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) + + 'CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) Else CargaCuenta(-1, DdlCuentaOrigen) CargaCuenta(DdlCuentaOrigen.SelectedValue.ToEntero, DdlCuentaDestino) @@ -89,7 +90,7 @@ Partial Class Bancos_Transferencias End If Ddl.DataBind() - DdlCuentaDestino_SelectedIndexChanged(Nothing, Nothing) + 'DdlCuentaDestino_SelectedIndexChanged(Nothing, Nothing) If CveCuenta > 0 Then VerificaMonedas() @@ -155,43 +156,41 @@ Partial Class Bancos_Transferencias End Sub - Protected Sub DdlCuentaDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaDestino.SelectedIndexChanged + 'Protected Sub DdlCuentaDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaDestino.SelectedIndexChanged - VerificaMonedas() + ' VerificaMonedas() - If Opcion = 1 Then - CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) - End If + ' If Opcion = 1 Then + ' CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) + ' End If - If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then - CargaGridTarjetas() - Else - GvTC.Visible = False - End If + ' If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then + ' CargaGridTarjetas() + ' Else + ' GvTC.Visible = False + ' End If - End Sub + 'End Sub Private Sub CargaGridTarjetas() Dim ObjCreditos As New ClsBancos If ObjCreditos.GetTarjetasCreditos(DdlCuentaOrigen.SelectedValue.ToEntero) Then If ObjCreditos.DtResultados.Rows.Count > 0 Then GvTC.DataSource = ObjCreditos.DtResultados + GvTC.Visible = True End If - - GvTC.DataBind() UpGvTC.Update() - - GvTC.Visible = True End If ObjCreditos.Dispose() + GvTC.DataBind() End Sub Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click 'VALIDACIONES Dim SumaImportesTarjeta As Decimal = 0D - If GvTC.Visible Then + If GvTC.Visible AndAlso GvTC.Rows.Count > 0 Then For Each row As GridViewRow In GvTC.Rows SumaImportesTarjeta += row.FCTextBox("TxtAbono").Text.ToDecimal Next @@ -202,8 +201,8 @@ Partial Class Bancos_Transferencias End If End If - If DdlCuentaDestino.SelectedValue = "" Then - Alert("Seleccione cuenta destino", TipoMensaje.MsgAdvertencia) + If DdlCuentaOrigen.SelectedValue = "" Then + Alert("Seleccione cuenta origen", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -225,8 +224,7 @@ Partial Class Bancos_Transferencias Dim ObjIE As New ClsBancos() Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) - 'Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) - Dim TipoCambio As Double = If(TxtTipoCambio.Visible, TxtTipoCambio.Text.ToDecimal, 0) + Dim TipoCambio As Double = If(TxtTipoCambio.Visible, TxtTipoCambio.Text.ToDecimal, 1) Dim CveMonedaOrigen, CveMonedaDestino As Integer Dim FolioOrigen As String = TxtFolio.Text.Trim Dim FolioDestino As String = GetFolio(DdlCuentaDestino.SelectedValue.ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3)) @@ -246,15 +244,14 @@ Partial Class Bancos_Transferencias filemove = fileItem.filename Next - - dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue)) - If dr IsNot Nothing Then CveMonedaDestino = dr("CveMoneda").ToString.ToEntero + dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue)) + If dr IsNot Nothing Then CveMonedaOrigen = dr("CveMoneda").ToString.ToEntero If Opcion = -1 Then - dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue)) - If dr IsNot Nothing Then CveMonedaOrigen = dr("CveMoneda").ToString.ToEntero + dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue)) + If dr IsNot Nothing Then CveMonedaDestino = dr("CveMoneda").ToString.ToEntero Else - CveMonedaOrigen = CveMonedaDestino + CveMonedaDestino = CveMonedaOrigen End If If CveMonedaOrigen = 1 AndAlso CveMonedaDestino <> 1 Then @@ -275,21 +272,18 @@ Partial Class Bancos_Transferencias If CveMonedaOrigen = 2 AndAlso CveMonedaDestino = 2 Then TipoCambio = TxtTipoCambio.Text.ToDouble 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate) End If - - Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/Transferencias", 13, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TxtFechaDocumento.Text.ToDate, $"Transferencia entre cuentas {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If UsuarioActual.CveEmpresa = 48 Then CuentaDestino = "Alumbrado publico de Hermosillo S.A de C.V" Observaciones = String.Format("{0} {1}", DdlCuentaDestino.SelectedItem.Text, TxtObservaciones.Text.Trim) Else - CuentaDestino = String.Format("Transferencia Cta: {0}", DdlCuentaDestino.SelectedItem.Text) + CuentaDestino = String.Format("Transferencia Cta: {0}", If(DdlCuentaDestino.SelectedItem IsNot Nothing, DdlCuentaDestino.SelectedItem.Text, "")) Observaciones = TxtObservaciones.Text.Trim End If - If Opcion = 1 Then 'ESTO ES TRANSFERENCIA ENTRE - CveIE = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CveIE = ObjIE.AddBancos_IE(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = CveIE Else @@ -325,11 +319,6 @@ Partial Class Bancos_Transferencias If MsgError = "" Then If CvePrePoliza > 0 Then - - Dim alertaContabilizacion As String = "Se envió correctamente la siguiente póliza:

" - Dim CuentasContablesInvalidas As New StringBuilder - Dim RowCuentaOrigen As DataRow = Nothing - Dim TipoMovtoDetalle As Boolean = True If RBLOpcion.SelectedValue = "2" Then TipoMovtoDetalle = False ' cuando sea un reembolso/devolución, es ingreso a bancos Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal @@ -360,7 +349,7 @@ Partial Class Bancos_Transferencias For Each row As GridViewRow In GvTC.Rows If row.FCTextBox("TxtAbono").Text.ToDecimal > 0 Then - FolioDestino = GetFolio(row.DataKey("CveCuenta").ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TransaccioSQL:=ObjIE.IniciaTransacSQL()) + FolioDestino = GetFolio(row.DataKey("CveCuenta").ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TransaccionSQL:=ObjIE.IniciaTransacSQL()) If FolioDestino.Trim.Length = 0 Then MsgError = "Ocurrio un error al obtener el folio destino." @@ -414,18 +403,14 @@ Partial Class Bancos_Transferencias End If If MsgError = "" Then - If CveIE > 0 Then AlertaGlobal.AppendFormat("

Movimiento: {1}", CveIE, FolioOrigen) End If If CveIEDestino > 0 AndAlso CveIE <> CveIEDestino Then - If Not chkMovimientoTarjeta.Checked Then AlertaGlobal.AppendFormat("

Recepción: {1}", CveIEDestino, FolioDestino) End If End If - Else - MsgError = "no se pudo insertar el detalle de la póliza2" End If Else MsgError = "no se pudo insertar el detalle de la póliza" @@ -455,10 +440,7 @@ Partial Class Bancos_Transferencias CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) TxtImporte.Text = "" TxtObservaciones.Text = "" - - GeneraChequePDF(CveIEDestino, UsuarioActual.Empresa) - - + 'GeneraChequePDF(CveIEDestino, UsuarioActual.Empresa) Else ObjIE.RollBack() Alert(MsgError) @@ -466,7 +448,7 @@ Partial Class Bancos_Transferencias ObjIE.Dispose() ObjMov.Dispose() - 'If ObjComp IsNot Nothing Then ObjComp.Dispose() + End Sub Private Sub EnviaCorreo(Comprobante As String) @@ -592,24 +574,21 @@ Partial Class Bancos_Transferencias TxtFolio.Text = GetFolio(CveCuenta, CveTipoTransaccion) End Sub - Private Function GetFolio(CveCuenta As Integer, CveTipoTransaccion As Integer, Optional ByRef TransaccioSQL As SqlTransaction = Nothing) As String + Private Function GetFolio(CveCuenta As Integer, CveTipoTransaccion As Integer, Optional ByRef TransaccionSQL As SqlTransaction = Nothing) As String Dim Folio As String Dim Banco As ClsBancos - If TransaccioSQL Is Nothing Then + If TransaccionSQL Is Nothing Then Banco = New ClsBancos Else - Banco = New ClsBancos(TransaccioSQL) + Banco = New ClsBancos(TransaccionSQL) End If - Folio = Banco.GetNextFolio(CveCuenta, CveTipoTransaccion).ToString - If TransaccioSQL Is Nothing Then + If TransaccionSQL Is Nothing Then Banco.Dispose() End If - - Return Folio End Function @@ -629,18 +608,13 @@ Partial Class Bancos_Transferencias Private Sub DdlTipoMovto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoMovto.SelectedIndexChanged RFVTxtPaguese.Visible = False + CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) - If Opcion = 1 Then - CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) - Else - CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) - + If Not Opcion = 1 Then If DdlTipoMovto.SelectedValue.ToEntero = 1 And Opcion <> 1 Then 'CHEQUE ACTIVA EL REQUIRED DE TxtPaguese RFVTxtPaguese.Visible = True End If - End If - UPPDatos.Update() End Sub From e28efe5a3e5087ea388b4710dd39757c898059d9 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 17:59:21 -0700 Subject: [PATCH 07/16] =?UTF-8?q?--=20opcional=20parametro=20contabilizaci?= =?UTF-8?q?=C3=B3n=20contpaq?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsContabilidad.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 13fde3fbe..c68979dc6 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -2275,7 +2275,7 @@ Public Class ClsContabilidad - Public Function GetDiarioPagosCompras(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveCuenta As Integer, CveTipoTransaccion As Integer, CveEmpresa As Integer) As DataSet + Public Function GetDiarioPagosCompras(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveCuenta As Integer, CveTipoTransaccion As Integer, CveEmpresa As Integer, Optional CvePersonal As Integer = -1) As DataSet Dim Retorno As New DataSet DataAdapter("PA_Conta_DiarioPagosComprasGet33") @@ -2287,6 +2287,7 @@ Public Class ClsContabilidad .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveTipoTransaccion", SqlDbType.Int).Value = CveTipoTransaccion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal End With Try From a4c44ece1d477a81bce5a168a7603de3ceb10ee7 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 17:59:50 -0700 Subject: [PATCH 08/16] =?UTF-8?q?limpieza=20de=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bancos/IE.aspx | 2 -- Bancos/IE.aspx.vb | 28 ++-------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 9106c2511..544262f6e 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -247,10 +247,8 @@ - -
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 81155906e..150540823 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -606,7 +606,6 @@ Partial Class Bancos_IE CargaTipoTransaccion() CargaCuenta() - CargaDDLPersonal() DdlProveedores.setEsWebService(True) DdlProveedores.Attributes.Add("data-metodo", "getproveedores") @@ -628,11 +627,9 @@ Partial Class Bancos_IE If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then CveProveedor = Request("CveProveedor").ToEntero - CargaProveedor(CveProveedor, "-1") End If - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion") = "DevDinC" AndAlso Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then If Masivonotas Then 'CargaNotas() @@ -719,7 +716,6 @@ Partial Class Bancos_IE DdlProveedores.Enabled = False DdlPersonal.Visible = False - CargaDatos() BtnGuardar.Visible = False @@ -784,8 +780,6 @@ Partial Class Bancos_IE 'End If - - DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltraParametros("CveSATMotivoCancelacion IN (2,3)") DdlMotivoCancelacion.DataBind() DdlMotivoCancelacion.Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -794,7 +788,6 @@ Partial Class Bancos_IE DvFolioACCondiciones.Visible = True End If - If UsuarioActual.CveEmpresa.Contiene(13, 1) Then TRImporteDeduccionesPago.Visible = True End If @@ -816,7 +809,6 @@ Partial Class Bancos_IE End Try - CveIEDeposito = ObjIE.DtResultados(0)("CveIEDepositoPadre").ToString.ToEntero CuentaDepositoPadre = ObjIE.DtResultados(0)("CuentaDepositoPadre").ToString Cuenta = ObjIE.DtResultados(0)("NumCuenta").ToString @@ -1404,15 +1396,7 @@ Partial Class Bancos_IE DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlPersonal.DataBind() DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1")) - 'Dim ObjPersonal As New ClsRH - 'If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then - ' If ObjPersonal.DtResultados.Rows.Count > 0 Then - ' DdlPersonal.DataSource = ObjPersonal.DtResultados - ' DdlPersonal.DataBind() - ' DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1")) - ' End If - 'End If - 'ObjPersonal.Dispose() + End Sub Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) @@ -3601,7 +3585,7 @@ Partial Class Bancos_IE ChkAplicaViatico.Visible = False If RBL.SelectedValue = "FE" Then If UsuarioActual.CveRol = 1 Then ChkAplicaViatico.Visible = True - + If DdlPersonal.Items.Count = 0 Then CargaDDLPersonal() DdlPersonal.Visible = True DdlProveedores.Visible = False DdlCliente.Visible = False @@ -4301,24 +4285,16 @@ Partial Class Bancos_IE If Not ErrorCompra Then If ObjAC IsNot Nothing Then ObjAC.Commit() - If Banc.ExisteConexion Then Banc.Commit() Alert($"El documento bancario quedó eliminado. {MsgEliminar}", TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""") End If - Else - Alert($"El documento no ha sido eliminado. {If(UsuarioActual.CveRol = 1, MsgEliminar, "")}", TipoMensaje.MsgAdvertencia) - If ObjAC IsNot Nothing Then ObjAC.RollBack() - If Banc.ExisteConexion Then Banc.RollBack() - - End If - End If If ObjAC IsNot Nothing Then ObjAC.Dispose() From abe060839ad0c28ed4781b8a4de9b615e8c73af5 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 18:00:28 -0700 Subject: [PATCH 09/16] -- mejora --- General/SaldosIniciales.aspx.vb | 225 +++++++++++++------------------- 1 file changed, 89 insertions(+), 136 deletions(-) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 652a0a64a..cd96100cb 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -294,21 +294,6 @@ Partial Class General_SaldosIniciales Exit Sub End If - If Not dt.Columns(15).ColumnName = "IEPS" Then - Alert("El nombre de la decimosexta columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - - If Not dt.Columns(16).ColumnName = "RetIVAPorcentaje" Then - Alert("El nombre de la decimoséptima columna debe ser 'RetIVAPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - - If Not dt.Columns(17).ColumnName = "RetISRPorcentaje" Then - Alert("El nombre de la decimoctava columna debe ser 'RetISRPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - 'If RblFormato.SelectedValue = "4" Then ' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then ' Alert("El nombre de la diesciseisava columna debe ser 'ImpuestoLocal'. Favor de corregirlo", TipoMensaje.MsgError) @@ -716,7 +701,7 @@ Partial Class General_SaldosIniciales Dim NuevaClasificacion As Boolean = False - For Each Row As DataRow In dt.Rows + For Each Row As DataRow In dt.FiltraParametros("Descripcion <> ''").Rows Dim Codigo As String = Row("Codigo").ToString() Dim Descripcion As String = Row("Descripcion").ToString() Dim TipoPS As String = Row("Tipo").ToString().Trim.ToUpper @@ -1445,7 +1430,9 @@ Partial Class General_SaldosIniciales #Region "P R O V E E D O R E S - F A C T U R A S" + Dim ObjCompras As New ClsCompras Dim ErrorCompras As Boolean = False + Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL()) Dim CveCompra As Integer Dim Contador As Integer = 0 Dim ExisteCompra As Boolean = False @@ -1461,113 +1448,105 @@ Partial Class General_SaldosIniciales Dim dtsubp As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows - Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'") - RFC = Row("RFC").ToString().Trim - Dim Serie As String = Row("Serie").ToString() - Dim Folio As String = Row("Folio").ToString() - Dim Fecha As Date = Row("Fecha").ToString().ToDate - Dim SubTotal As Decimal = Row("SubTotal").ToString().ToDecimal - Dim IVA As Decimal = Row("IVA").ToString().ToDecimal - Dim Total As Decimal = Row("Total").ToString().ToDecimal - Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal - Dim TipoDocto As String = Row("Tipo Documento").ToString() - Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString().ToEntero() - GuardaLog(Sucursal + " - " + Row("Sucursal").ToString()) - Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal - Dim RetISR As Decimal = Row("Ret ISR").ToString().ToDecimal - Dim IEPS As Decimal = If(dt.Columns.Contains("IEPS"), Row("IEPS").ToString(), "0").ToDecimal - Dim Moneda As String = Row("Moneda").ToString() - Dim TipoCambio As String = If(dt.Columns.Contains("Tipo Cambio"), Row("Tipo Cambio").ToString(), "1") - Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate - Dim CveMoneda As Integer = 1 - Dim CveProveedorSucursal As Integer = If(dt.Columns.Contains("CveProveedorSucursal"), Row("CveProveedorSucursal").ToString(), "0").ToEntero - Dim PorcentajeIVA As String = If(dt.Columns.Contains("PorcentajeIVA"), Row("PorcentajeIVA").ToString(), "0") - Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocales"), Row("ImpuestosLocales").ToString(), "0").ToDecimal - Dim RetIVAPorcentaje As Decimal = If(dt.Columns.Contains("RetIVAPorcentaje"), Row("RetIVAPorcentaje").ToString(), "0").ToDecimal - Dim RetISRPorcentaje As Decimal = If(dt.Columns.Contains("RetISRPorcentaje"), Row("RetISRPorcentaje").ToString(), "0").ToDecimal - Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", String.Format("SubProyecto='{0}'", If(dt.Columns.Contains("SubProyecto"), Row("SubProyecto").ToString(), ""))).ToEntero - If CveSubProyecto = 0 Then CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero + Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'") + RFC = Row("RFC").ToString().Trim + Dim Serie As String = Row("Serie").ToString() + Dim Folio As String = Row("Folio").ToString() + Dim Fecha As Date = Row("Fecha").ToString().ToDate + Dim SubTotal As Decimal = Row("SubTotal").ToString().ToDecimal + Dim IVA As Decimal = Row("IVA").ToString().ToDecimal + Dim Total As Decimal = Row("Total").ToString().ToDecimal + Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal + Dim TipoDocto As String = Row("Tipo Documento").ToString() + Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString().ToEntero() + GuardaLog(Sucursal + " - " + Row("Sucursal").ToString()) + Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal + Dim RetISR As Decimal = Row("Ret ISR").ToString().ToDecimal + Dim IEPS As Decimal = If(dt.Columns.Contains("IEPS"), Row("IEPS").ToString(), "0").ToDecimal + Dim Moneda As String = Row("Moneda").ToString() + Dim TipoCambio As String = If(dt.Columns.Contains("Tipo Cambio"), Row("Tipo Cambio").ToString(), "1") + Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate + Dim CveMoneda As Integer = 1 + Dim CveProveedorSucursal As Integer = If(dt.Columns.Contains("CveProveedorSucursal"), Row("CveProveedorSucursal").ToString(), "0").ToEntero + Dim PorcentajeIVA As String = If(dt.Columns.Contains("PorcentajeIVA"), Row("PorcentajeIVA").ToString(), "0") + Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocales"), Row("ImpuestosLocales").ToString(), "0").ToDecimal + Dim RetIVAPorcentaje As Decimal = If(dt.Columns.Contains("RetIVAPorcentaje"), Row("RetIVAPorcentaje").ToString(), "0").ToDecimal + Dim RetISRPorcentaje As Decimal = If(dt.Columns.Contains("RetISRPorcentaje"), Row("RetISRPorcentaje").ToString(), "0").ToDecimal + Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", String.Format("SubProyecto='{0}'", If(dt.Columns.Contains("SubProyecto"), Row("SubProyecto").ToString(), ""))).ToEntero + If CveSubProyecto = 0 Then CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero - If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True - If Not CveUnidadMedida > 0 Then Alert(String.Format("No se encontró la Unidad de Medida."), TipoMensaje.MsgError) : ErrorCompras = True - If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For - If Not CveProveedorSucursal > 0 Then CveProveedorSucursal = -1 + If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True + If Not CveUnidadMedida > 0 Then Alert(String.Format("No se encontró la Unidad de Medida."), TipoMensaje.MsgError) : ErrorCompras = True + If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For + If Not CveProveedorSucursal > 0 Then CveProveedorSucursal = -1 - TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString() + TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString() + 'Temporalmente SE BORRARA + Dim Transaccion As String = "" 'Row("Transaccion2").ToString() + Dim Folio2 As String = "" 'Row("Folio2").ToString() + Dim CodProvee As String = "" 'Row("CodProvee2").ToString() + 'Moneda + If Moneda.ToUpper.Contiene("PESOS", "PESO", "MXN", "MONEDA NACIONAL") Then + CveMoneda = 1 + ElseIf Moneda.ToUpper.Contiene("DOLARES", "DOLAR", "USD", "DÓLARES") Then + CveMoneda = 2 + End If - 'Temporalmente SE BORRARA - Dim Transaccion As String = "" 'Row("Transaccion2").ToString() - Dim Folio2 As String = "" 'Row("Folio2").ToString() - Dim CodProvee As String = "" 'Row("CodProvee2").ToString() + 'Si no se especifica TC, se manda como pesos. + If TipoCambio = "" Then TipoCambio = "1" - 'Moneda - If Moneda.ToUpper.Contiene("PESOS", "PESO", "MXN", "MONEDA NACIONAL") Then - CveMoneda = 1 - ElseIf Moneda.ToUpper.Contiene("DOLARES", "DOLAR", "USD", "DÓLARES") Then - CveMoneda = 2 - End If + 'PrePóliza + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Compras/SaldoInicial", 1, Total, Total, CveMoneda, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If Not CvePrePoliza > 0 Then + ErrorCompras = True + Exit For + End If - 'Si no se especifica TC, se manda como pesos. - If TipoCambio = "" Then TipoCambio = "1" + If FechaVencimiento = "".ToDate Or FechaVencimiento < "1900/01/01".ToDate Then + FechaVencimiento = Fecha + End If - 'PrePóliza - Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Compras/SaldoInicial", 1, Total, Total, CveMoneda, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If Not CvePrePoliza > 0 Then - ErrorCompras = True - Exit For - End If - - If FechaVencimiento = "".ToDate Or FechaVencimiento < "1900/01/01".ToDate Then - FechaVencimiento = Fecha - End If + 'Compra If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio2, CveProveedor.ToEntero(), SubTotal, 0, 0, IVA, RetIVA, RetISR, IEPS, 0, 0, Total, Fecha, CveMoneda, TipoCambio.ToDecimal, FechaVencimiento, False, CodProvee, 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorSucursal:=CveProveedorSucursal, NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal, TotalOriginal:=Total, CveSubProyecto:=CveSubProyecto) Then ErrorCompras = True Exit For End If - CveCompra = ObjCompras.CveCompra + CveCompra = ObjCompras.CveCompra - 'Compra Detalle - If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, Sucursal.ToEntero(), -1, 0, 1, SubTotal, 0.16D, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA.ToDecimal, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then - ErrorCompras = True - Exit For - End If - Dim ConceptoContablePago As Integer = 17 - If TipoDocto = "NC" Then ConceptoContablePago = 60 + 'Compra Detalle + If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, Sucursal.ToEntero(), -1, 0, 1, SubTotal, 0.16D, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA.ToDecimal, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then + ErrorCompras = True + Exit For + End If + Dim ConceptoContablePago As Integer = 17 + If TipoDocto = "NC" Then ConceptoContablePago = 60 - 'PrePólizaDetalle - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Total, IIf(TipoDocto = "Fac", 5, 18).ToString().ToEntero(), Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, SubTotal, 6, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveClasificacion:=CveClasificacion, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For + 'PrePólizaDetalle + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Total, IIf(TipoDocto = "Fac", 5, 18).ToString().ToEntero(), Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, SubTotal, 6, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveClasificacion:=CveClasificacion, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For - If IVA > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, IVA, 14, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero(), CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeIVA.ToDecimal) Then ErrorCompras = True : Exit For - End If + If IVA > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, IVA, 14, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero(), CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeIVA.ToDecimal) Then ErrorCompras = True : Exit For + End If + If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, IEPS, 25, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For - - If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, IEPS, 25, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For - - If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetIVA, RetIVA, 15, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For - If RetISR > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetISR, RetISR, 16, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For - If ImpuestosLocales > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImpuestosLocales, ImpuestosLocales, 27, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For + If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetIVA, RetIVA, 15, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For + If RetISR > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetISR, RetISR, 16, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For + If ImpuestosLocales > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImpuestosLocales, ImpuestosLocales, 27, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For 'Saldo If Saldo < Total Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Total - Saldo, 17, $"{Folio} SALDO INICIAL", Folio, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Total - Saldo, 95, $"{Folio} SALDO INICIAL", Folio, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For End If Encontrados = Encontrados + 1 Next - If Not ErrorCompras Then - Next - - Catch ex As Exception - OnError("Ocurrió un error al cargar los datos", ex) - ErrorCompras = True - End Try - If Not ErrorCompras Then If Contador > 0 Then Alert(String.Format("Se agregaron: {0} Compras correctamente.
Se Omitieron: {1} Compras ya que ya se encuentran registradas.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion) @@ -1578,9 +1557,11 @@ Partial Class General_SaldosIniciales ObjCompras.Commit() TxtExcel.Text = "" UpDatos.Update() - 'C L I E N T E S - F A C T U R A S - End If - ObjCompras.Dispose() + Else + Alert(String.Format("NO Se agregaron: {0} Compras.", NumRows), TipoMensaje.MsgError) + ObjCompras.RollBack() + End If + ObjCompras.Dispose() #End Region @@ -2383,8 +2364,6 @@ Partial Class General_SaldosIniciales Dim ErrorProceso As Boolean = False - - Dim SBMensajesCuentasNoEncontradas As New StringBuilder For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows @@ -2419,26 +2398,21 @@ Partial Class General_SaldosIniciales Dim ObjConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL) Dim Contador As Integer = 0 - - Dim DTClasificaiones As New DataTable - If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then - DTClasificaiones = ObjClasificaciones.DtResultados - End If - - If Not DTClasificaiones.Rows.Count > 0 Then - ObjConta.Dispose() - Alert("Error a conusltar clasificaciones.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - + 'If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then + ' DTClasificaiones = ObjClasificaciones.DtResultados + 'End If + 'If Not DTClasificaiones.Rows.Count > 0 Then + ' ObjConta.Dispose() + ' Alert("Error a consultar clasificaciones.", TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If DTClasificaiones.CaseSensitive = False For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows - Dim Clasificacion As String = dRow("Clasificacion").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") Dim Categoria As String = dRow("Categoria").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") Dim UsoClasificacion As String = dRow("UsoClasificacion").ToString().Trim.ToUpper.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") @@ -2448,12 +2422,8 @@ Partial Class General_SaldosIniciales Dim CveClasificacion As Integer = -1 Dim CveUsoClasificacion As Integer = -1 Dim CveCategoria As Integer = -1 - - CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", $" Categoria = '{Categoria}' ").ToEntero() - - If Not CveCategoria > 0 Then CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToEntero() If Not CveCategoria > 0 Then @@ -2461,7 +2431,6 @@ Partial Class General_SaldosIniciales ErrorProceso = True Exit For End If - End If @@ -2503,34 +2472,24 @@ Partial Class General_SaldosIniciales If ObjClasificaciones.AddClasificaciones(Clasificacion, "", CveCategoria, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=0, UsoClasificacion:=CveUsoClasificacion, CveSATPS:=-1, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False, EsAcumulador:=False, TopVentas:=False, TopCompras:=False, PrecioBaseCosto:=-1) Then - CveClasificacion = ObjClasificaciones.CveClasificacion - If CveClasificacion > 0 Then If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then DTClasificaiones = ObjClasificaciones.DtResultados End If Else - ErrorProceso = True End If - - - Else ErrorProceso = True End If Else - If Not ObjClasificaciones.UpdateClasificacion(Clasificacion, "-1", True, True, CveCategoria, UsuarioActual.CveUsuario, CveClasificacion, UsoClasificacion:=CveUsoClasificacion) Then ErrorProceso = True End If - End If - If Not ErrorProceso Then - If CveCuentaContableIngreso > 0 Then If Not AsignacionCuenta(ObjConta, 4, CveCuentaContableIngreso, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion, OpActualizarClasificacion:=True) Then ErrorProceso = True @@ -2546,22 +2505,16 @@ Partial Class General_SaldosIniciales Exit For End If End If - End If - - Contador = Contador + 1 Next - If Not ErrorProceso Then ObjClasificaciones.Commit() Alert($"Se agregaron {Contador} Clasificaciones.") Else ObjClasificaciones.RollBack() End If - - ObjClasificaciones.Dispose() End Sub From 0d6a792a1cc051b9c1545986b6ef099cde264adc Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Nov 2023 18:03:34 -0700 Subject: [PATCH 10/16] =?UTF-8?q?--=20que=20se=20pueda=20editar=20el=20ven?= =?UTF-8?q?dedor=20de=20una=20remisi=C3=B3n,=20ya=20facturada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index a7488afa9..010f0caec 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2767,6 +2767,7 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then BtnCrearApartirDe.Visible = False If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True + If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then BtnPermisoEditarRemision.Visible = True DivFechaAnticipoCliente.Visible = True TxtFechaAnticipoCliente.Text = NowADS().ToShortDateString @@ -21211,6 +21212,7 @@ Partial Class Ventas DdlFormaPago33.Enabled = True UPCondicionesPago.Update() If Me.PermiteCredito Then RBLPago.Enabled = True + DdlVendedor.Enabled = True ModalidadEdicion = True From 609bb492358e9da23b0cfb446a3ec8f0b9e4de7e Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 28 Nov 2023 18:14:01 -0700 Subject: [PATCH 11/16] =?UTF-8?q?m=C3=B3dulo=20de=20cobranza=20en=20PV?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/PVCobranza.aspx | 289 ++++++++++++++++++++++++++++++++++++++ Ventas/PVCobranza.aspx.vb | 235 +++++++++++++++++++++++++++++++ 2 files changed, 524 insertions(+) create mode 100644 Ventas/PVCobranza.aspx create mode 100644 Ventas/PVCobranza.aspx.vb diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx new file mode 100644 index 000000000..629c9c0bb --- /dev/null +++ b/Ventas/PVCobranza.aspx @@ -0,0 +1,289 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PVCobranza.aspx.vb" Inherits="Ventas_PVCobranza" %> + + + + + + + + + + + Cobranza + + + + + + + +
+
+
+ + +
+
+
+
+ Sucursal: +
+
+ + + +
+
+
+
+ +
+
+
+ + +
+
+ + + + + + + + + + + +
+
+ +
+
+ + Nombre: + +           + + + + + +
+
+
+
+ +
+
+
+
+ +
+ $ + + +
+
+ + + +
+
+
+ +
+
+ +
+ $ + + +
+
+ + + +
+
+ + MSI + 3M + 6M + 9M + 12M + + <%-- + --%> +
+
+
+ +
+
+ +
+ $ + + +
+
+ + + +
+
+
+
+
+ +
+ $ + + +
+
+ + + +
+
+
+ +
+
+ +
+ $ + + +
+
+ + + +
+
+
+ +
+
+ +
+ + Otros + Credito + Debito + Cheque + +
+ +
+ $ + + +
+ +
+ + + +
+ +
+ + Meses + 3M + 6M + 9M + 12M + +
+ +
+
+ +
+
+ +
+ $ + + + +
+ +
+ $ + + +
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb new file mode 100644 index 000000000..ba2db00f7 --- /dev/null +++ b/Ventas/PVCobranza.aspx.vb @@ -0,0 +1,235 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports System.Runtime.Remoting +Imports Extensiones + +Partial Class Ventas_PVCobranza + Inherits ClsPaginas + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaFiltros() + End If + End Sub + + Private Sub CargaFiltros() + + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + DdlSubProyecto.DataBind() + + txtFechaI.Text = Now.AddYears(-1).ToShortDateString + txtFechaF.Text = Now.ToShortDateString + + 'DdlCuentaEfectivo.Items.Clear() + 'DdlCuentaTarjetaCredito.Items.Clear() + 'DdlCuentaTarjetaDebito.Items.Clear() + 'DdlCuentaCheque.Items.Clear() + 'DdlCuentaTransferencia.Items.Clear() + + Dim DtCC As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) + Dim CveMon As Integer = 1 + + 'MOSTRAR SOLO CUENTAS DE CONTADO EN BDH + 'If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 0", CveMon)) + DdlCuentaCheque.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 0", CveMon)) + 'Else + ' DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", CveMon)) + ' DdlCuentaCheque.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", CveMon)) + 'End If + + 'If UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", CveMon)) + DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", CveMon)) + 'Else + ' DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", CveMon)) + 'DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", CveMon)) + 'End If + + DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", CveMon)) + + DtCC.Dispose() + + DdlCuentaEfectivo.DataBind() + DdlCuentaTarjetaCredito.DataBind() + DdlCuentaTarjetaDebito.DataBind() + DdlCuentaCheque.DataBind() + DdlCuentaTransferencia.DataBind() + + End Sub + + Private Sub CargaDatos() + + Dim ObjMovtos As New ClsMovimientos() + Dim FechaI, FechaF As Date + FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) + FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) + + If ObjMovtos.GetCxCDetalle(FechaI, FechaF, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, "-1", "-1", -1, "-1", -1, + "-1", 1, UsuarioActual.CveEmpresa, -1, 1, + TipoDocto:="Rem", FechaCorte:=NowADS.AddDays(1), CveUsuarioConsulta:=UsuarioActual.CveUsuario, AplicaAnticiposPagados:=0) Then + + Dim dtt As DataTable = ObjMovtos.DSResultados.Tables(0).FiltraParametros("CveVenta > 0") + 'si hay ya asignado, solo la mostrará + Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario}") + If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta + GvDatos.DataSource = dtt + End If + ObjMovtos.Dispose() + GvDatos.DataBind() + UpL.Update() + + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + + Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DBCampo("CveUsuarioCobranza") <> "" Then + e.Row.BackColor = Drawing.ColorTranslator.FromHtml("#3598dc") + 'e.Row.CssClass = "blue-madison" + End If + End If + End Sub + + Private Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand + If e.CommandName = "Cobrar" Then + Dim ImgBtn As LinkButton = DirectCast(e.CommandSource, LinkButton) + Dim GvRow As GridViewRow = DirectCast(ImgBtn.BindingContainer, GridViewRow) + Dim TieneError As Boolean = False + + Dim CveVenta As Integer = e.CommandArgument.ToString.ToEntero + Dim ObjVentas As New ClsVentas + ObjVentas.IniciaTransacSQL() + If Not ObjVentas.UpdateAsignaVentaCobranza(CveVenta, 1, UsuarioActual.CveUsuario, -1, "", Now) Then + TieneError = True + End If + HdnCveVenta.Value = CveVenta.ToString + TxtImporteEfectivo.Text = GvRow.DataKey("Saldo") + TxtImporteEfectivo.Focus() + LtlNombre.Text = GvRow.DataKey("DescripcionVenta") + LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero + 'carga información para cobranza + + If Not TieneError Then + ObjVentas.Commit() + PnlContado.Visible = True + Else + ObjVentas.RollBack() + PnlContado.Visible = False + Alert("Hubo un error al asignar datos de cobranza", TipoMensaje.MsgInformacion) + End If + + ObjVentas.Dispose() + 'CargaDatos() + End If + End Sub + + Private Sub BtnPagar_Click(sender As Object, e As EventArgs) Handles BtnPagar.Click + 'registrar pago + + 'validaciones + If TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal = 0 Then + Alert("Favor de especificar importe", TipoMensaje.ToastAdventencia) + Exit Sub + End If + + Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero + Dim ObjVentas As New ClsVentas + If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then + Dim DbRowVenta As DataRow = ObjVentas.DtResultados.FiltroPrimero("") + + Dim VentaActual As New Venta(UsuarioActual) + VentaActual.CveVenta = CveVenta + + VentaActual.Fecha = DbRowVenta("Fecha").ToString.ToDate + VentaActual.CveCliente = DbRowVenta("CveCliente").ToString.ToEntero + VentaActual.CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero + VentaActual.SerieFolio = DbRowVenta("SerieFolio").ToString + VentaActual.ClienteNombre = DbRowVenta("ClienteNombre").ToString + VentaActual.TC = DbRowVenta("TipoCambio").ToString.ToDecimal + VentaActual.Total = DbRowVenta("Total").ToString.ToDecimal + VentaActual.IVA = DbRowVenta("IVA").ToString.ToDecimal + VentaActual.IEPS = DbRowVenta("IEPS").ToString.ToDecimal + VentaActual.RetIVA = DbRowVenta("RetIVA").ToString.ToDecimal + VentaActual.RetISR = DbRowVenta("RetISR").ToString.ToDecimal + + VentaActual.PorcentajeIVA = DbRowVenta("PorcentajeIVA").ToString.ToDecimal + VentaActual.UsuarioActual = UsuarioActual + VentaActual.CveSubProyecto = DbRowVenta("CveSubProyecto").ToString.ToEntero + + Dim ObjConta As New ClsContabilidad + Dim ObjIE As New ClsBancos(ObjConta.IniciaTransacSQL()) + + Dim CvePrePoliza As Integer + Dim Fecha As Date = NowADS() + Dim Mensaje As String = "" + + CvePrePoliza = ObjConta.AddPrePolizas("PVCobranza", 5, 0, 0, 1, Fecha, $"Pago {VentaActual.SerieFolio}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + If CvePrePoliza > 0 Then + + If TxtImporteEfectivo.Text.ToDecimal > 0 Then + Mensaje = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, TxtImporteEfectivo.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta) + End If + If TxtImporteCredito.Text.ToDecimal > 0 Then + Mensaje = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta) + End If + If TxtImporteDebito.Text.ToDecimal > 0 Then + Mensaje = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta) + End If + If TxtImporteCheque.Text.ToDecimal > 0 Then + Mensaje = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta) + End If + + Else + Mensaje = "Error al registrar prepólizas" + End If + + If Mensaje = "" Then + PnlContado.Visible = False + ObjConta.Commit() + CargaDatos() + Alert("Pago Registrado correctamente.", TipoMensaje.MsgInformacion) + Else + ObjConta.RollBack() + End If + + End If + + + + End Sub + + Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad) As String + Dim Retorno As String = "" + Dim CveIEPago As Integer = 0 + Dim ErrorConta As Boolean + CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, VentaActual.SerieFolio, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveIEPago > 0 Then + Dim Pago As New VentaPago + Pago.ImportePagoVenta = ImportePago + Pago.ImportePago = ImportePago + Pago.CveIE = CveIEPago + Pago.CveMonedaPago = VentaActual.CveMoneda + Pago.Fecha = NowADS() + Pago.Referencia = VentaActual.SerieFolio + + ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) + If ErrorConta Then + Retorno = "Error en aplicación de pago" + End If + Else + Retorno = "Pago en Bancos no registrado" + ErrorConta = True + End If + + Return Retorno + End Function + +End Class From 171d9feed868115f7077cb1b67e265a25216e827 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 28 Nov 2023 18:14:27 -0700 Subject: [PATCH 12/16] =?UTF-8?q?--=20validaci=C3=B3n=20de=20prepolizas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/TraspasoAlmacen.aspx.vb | 76 +++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 093ae37f1..0bda8fec3 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1083,6 +1083,17 @@ Partial Class Inventarios_TraspasoAlmacen ErrorMovInv = True End If + If Not ErrorMovInv Then + If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + 'MsgError = ObjMov.MensajePolizaDescuadre + ErrorMovInv = True + 'GuardaLogAD($"Bancos/Transferencias | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + ErrorMovInv = True + End If + End If End If End If End If @@ -1156,6 +1167,17 @@ Partial Class Inventarios_TraspasoAlmacen ErrorMovInv = True End If + If Not ErrorMovInv Then + If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + 'MsgError = ObjMov.MensajePolizaDescuadre + ErrorMovInv = True + 'GuardaLogAD($"Bancos/Transferencias | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + ErrorMovInv = True + End If + End If Else TextoError = "Ocurrió un error al generar el movimiento de salida virtual" ErrorMovInv = True @@ -1779,18 +1801,22 @@ Partial Class Inventarios_TraspasoAlmacen Else ErrorMovInv = True End If - + If Not ErrorMovInv Then + If ObjConta.ValidacionesPrePoliza(CvePrePolizaMovVirtual, UsuarioActual) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + 'MsgError = ObjMov.MensajePolizaDescuadre + ErrorMovInv = True + 'GuardaLogAD($"Bancos/Transferencias | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + ErrorMovInv = True + End If + End If End If - - 'Else ' TextoError = "La Sucursal no tiene creado un almacen virtual" ' ErrorMovInv = True End If - - - - End If If Not ErrorMovInv Then @@ -1812,7 +1838,17 @@ Partial Class Inventarios_TraspasoAlmacen TextoError = "Ocurrió un error al cancelar el traspaso" End If End If - + If Not ErrorMovInv Then + If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + 'MsgError = ObjMov.MensajePolizaDescuadre + ErrorMovInv = True + 'GuardaLogAD($"Bancos/Transferencias | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + ErrorMovInv = True + End If + End If End If End If @@ -2094,7 +2130,6 @@ Partial Class Inventarios_TraspasoAlmacen Exit Sub End If - Dim ObjInventario As New ClsInventarios Dim Dtt As DataTable = Nothing Dim CveMovimientoEntrada As Integer = 0 @@ -2216,11 +2251,21 @@ Partial Class Inventarios_TraspasoAlmacen If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, importe, 68, TxtObservaciones.Text, TxtObservaciones.Text, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then ErrorMovInv = True End If + If Not ErrorMovInv Then + If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + 'MsgError = ObjMov.MensajePolizaDescuadre + ErrorMovInv = True + 'GuardaLogAD($"Bancos/Transferencias | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + ErrorMovInv = True + End If + End If End If End If End If - 'VIRTUAL ENTRADA Dim CveMovimientoVirtualEntrada, CveMovimientoVirtualSalida As Integer Dim FolioVirtualEntrada, FolioVirtualSalida As Integer @@ -2281,6 +2326,17 @@ Partial Class Inventarios_TraspasoAlmacen If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, importe, 68, TxtObservaciones.Text, TxtObservaciones.Text, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, Contabilizable:=False) Then ErrorMovInv = True End If + If Not ErrorMovInv Then + If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + 'MsgError = ObjMov.MensajePolizaDescuadre + ErrorMovInv = True + 'GuardaLogAD($"Bancos/Transferencias | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + ErrorMovInv = True + End If + End If End If End If From 8ade0f28ac67f540b5fd05819f0f789651517f19 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 28 Nov 2023 18:16:01 -0700 Subject: [PATCH 13/16] =?UTF-8?q?-registrar=20prep=C3=B3lizas=20de=20virtu?= =?UTF-8?q?ales?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntradasSalidas.aspx.vb | 83 ++++++++++++++--------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 6e11b2adc..7088e71a2 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -2089,7 +2089,7 @@ Partial Class Inventarios_EntradasSalidas Dim RetornoVirtual As MMovimientoVirtual = Nothing If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - RetornoVirtual = GenerarMovimientoVirtual(CveMovimiento, ObjInventario) + RetornoVirtual = GenerarMovimientoVirtual(CveMovimiento, ObjInventario, ObjConta) End If If RetornoVirtual IsNot Nothing Then @@ -2968,7 +2968,7 @@ Partial Class Inventarios_EntradasSalidas #Region " CONTABILIZAR " - Public Function ContabilizaMovimientoAlmacen(ByRef ObjConta As ClsContabilidad, Fecha As Date, Concepto As String, Modulo As String, CveMovimientoSalida As Integer, CveMovimientoEntrada As Integer, Importe As Decimal, CveUsuario As Integer, CveEmpresa As Integer, Contabilizable As Boolean) As Integer + Public Function ContabilizaMovimientoAlmacen(ByRef ObjConta As ClsContabilidad, Fecha As Date, Concepto As String, Modulo As String, CveMovimientoSalida As Integer, CveMovimientoEntrada As Integer, Importe As Decimal, CveUsuario As Integer, CveEmpresa As Integer, Contabilizable As Boolean, Optional dttCostos As DataTable = Nothing, Optional CveSubProyecto As Integer = -1) As Integer Dim Retorno As Integer = -1 Dim ErrorMovInv As Boolean = False @@ -2977,9 +2977,22 @@ Partial Class Inventarios_EntradasSalidas ErrorMovInv = True End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, Importe, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then - ErrorMovInv = True + If CveMovimientoEntrada > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, Importe, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If End If + If dttCostos IsNot Nothing Then + For Each RowInv As DataRow In dttCostos.Rows + Dim ValorInventario As Decimal = dttCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorInventario, ValorInventario, 69, Concepto, Concepto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=CveSubProyecto, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + Exit For + End If + Next + End If + If Not ErrorMovInv Then Retorno = CvePrePoliza @@ -4634,11 +4647,11 @@ Partial Class Inventarios_EntradasSalidas Dim RetornoVirtual As MMovimientoVirtual = Nothing If Not ErrorMovInv AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - If CveMovimientoSalida > 0 Then RetornoVirtual = GenerarMovimientoVirtual(CveMovimientoSalida, ObjInventario) + If CveMovimientoSalida > 0 Then RetornoVirtual = GenerarMovimientoVirtual(CveMovimientoSalida, ObjInventario, ObjConta) If RetornoVirtual IsNot Nothing Then ErrorMovInv = RetornoVirtual.TieneError - If CveMovimientoEntrada > 0 AndAlso Not ErrorMovInv Then RetornoVirtual = GenerarMovimientoVirtual(CveMovimientoEntrada, ObjInventario) + If CveMovimientoEntrada > 0 AndAlso Not ErrorMovInv Then RetornoVirtual = GenerarMovimientoVirtual(CveMovimientoEntrada, ObjInventario, ObjConta) If RetornoVirtual IsNot Nothing Then ErrorMovInv = RetornoVirtual.TieneError End If @@ -5421,8 +5434,8 @@ Partial Class Inventarios_EntradasSalidas Protected Sub LnkGenerarVirtual_Click(sender As Object, e As EventArgs) If CveMovimiento > 0 Then Dim ObjInventario As New ClsInventarios - ObjInventario.IniciaTransacSQL() - Dim Retorno As MMovimientoVirtual = GenerarMovimientoVirtual(Me.CveMovimiento, ObjInventario) + Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) + Dim Retorno As MMovimientoVirtual = GenerarMovimientoVirtual(Me.CveMovimiento, ObjInventario, ObjConta) If Retorno.TieneError Then ObjInventario.RollBack() @@ -5440,7 +5453,7 @@ Partial Class Inventarios_EntradasSalidas End Sub - Private Function GenerarMovimientoVirtual(CveMovimiento As Integer, ByRef ObjInventario As ClsInventarios) As MMovimientoVirtual + Private Function GenerarMovimientoVirtual(CveMovimiento As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad) As MMovimientoVirtual Dim ErrorMovInv As Boolean = False Dim DtPSVirtual As New DataTable("DtTamanios") @@ -5449,14 +5462,20 @@ Partial Class Inventarios_EntradasSalidas Dim tCveAlmacen As Integer = -1 Dim tOrigen As Integer = -1 + Dim tCveSubProyecto As Integer = -1 Try If ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then tCveAlmacen = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero() tOrigen = ObjInventario.DtResultados.FiltroPrimeroValor("Origen").ToEntero() End If + Dim drAlmacenVirtual As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimero("") + Dim CveAlmacenVirtual As Integer + If drAlmacenVirtual IsNot Nothing Then + CveAlmacenVirtual = drAlmacenVirtual("CveAlmacenVirtual").ToString.ToEntero + tCveSubProyecto = drAlmacenVirtual("CveSubProyecto").ToString.ToEntero + End If - Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero() 'VERIFICA SI TIENE ALMACEN VIRTUAL If CveAlmacenVirtual > 0 Then @@ -5482,6 +5501,17 @@ Partial Class Inventarios_EntradasSalidas Next End If + If Not ErrorMovInv Then + Dim dttCosto As DataTable = Nothing + If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then + dttCosto = ObjInventario.DtResultados + End If + + If ContabilizaMovimientoAlmacen(ObjConta:=ObjConta, TxtFecha.Text.Replace(",", "").ToDate, "Virtual", "ES/GV", CveMovimientoVirtual, -1, DtPSVirtual.SUM("TotalCargo"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True, dttCosto, tCveSubProyecto) > 0 Then + ErrorMovInv = True + End If + End If + End If Catch ex As Exception ErrorMovInv = True @@ -5506,55 +5536,24 @@ Partial Class Inventarios_EntradasSalidas Private Function CreaObjetosVenta() As Modelos.Factura Dim ObjFactura As New Modelos.Factura - ObjFactura.Version = "3.3" ObjFactura.CveUsuario = UsuarioActual.CveUsuario ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa ObjFactura.TipoCambio = 0 - ObjFactura.ConvertirPesos = False - ObjFactura.TipoCambio = 0 ObjFactura.CveMoneda = 1 ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ") ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1") ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ") ObjFactura.TipoDocto = "Tra" - ObjFactura.RefDocto = "" ObjFactura.Folio = Folio.ToEntero ObjFactura.Serie = "Tra" 'ObjFactura.CveMesa = -1 ObjFactura.Fecha = NowADS() - ObjFactura.CvePrePoliza = -1 ObjFactura.FechaPago = NowADS() - ObjFactura.MotivoDescuento = "" - ObjFactura.Observaciones = "" ObjFactura.FechaEjecucion = NowADS() ObjFactura.UsuarioCreo = UsuarioActual.Usuario - ObjFactura.CveCondicionEntrega = -1 - ObjFactura.CondicionEntrega = "" - ObjFactura.NumeroCuenta = "" - ObjFactura.CondicionesPago = 0 - ObjFactura.FormaPago = 0 - ObjFactura.PedidoContrato = "" - ObjFactura.OrdenCompra = "" - ObjFactura.NumeroContrato = "" - ObjFactura.NumeroDescripcionContrato = "" - ObjFactura.DescripcionContrato = "" - ObjFactura.CveCorte = -1 ObjFactura.TipoDocumento = "Traspaso" - ObjFactura.Alfa1 = "" - ObjFactura.Alfa2 = "" - ObjFactura.Alfa3 = "" - ObjFactura.Descuento = 0 - ObjFactura.Amortizacion = 0 - ObjFactura.CveContrato = 0 - ObjFactura.CveVendedor = 0 ObjFactura.FechaVencimiento = NowADS() - ObjFactura.TipoEstatus = 0 - ObjFactura.Det_OrdenCompra = "" - ObjFactura.Inv_CveEstatusEntrega = 0 - ObjFactura.FormaPago33 = "" - ObjFactura.MetodoPago33 = "" - ObjFactura.UsoCFDI = "" - ObjFactura.CveClienteSucursal = 0 + Dim CveSubProyecto As Integer = -1 If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows.Count > 0 Then CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero From 105f0c9056993504e7a6da635e297b0a0a44e32c Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 Nov 2023 05:13:25 -0700 Subject: [PATCH 14/16] --nuevo modulo --- App_Code/ClsPaginas.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index bcc544f2b..ca1a663a7 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9342,7 +9342,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepVentasUtilidad.aspx".ToUpper(), 590) PaginaDict.Add("/Ventas/RepVentasUtilidadDetalle.aspx".ToUpper(), 590) PaginaDict.Add("/Ventas/PV.aspx".ToUpper(), 163) - PaginaDict.Add("/Ventas/PVRene.aspx".ToUpper(), 163) + PaginaDict.Add("/Ventas/PVCobranza.aspx".ToUpper(), 319) PaginaDict.Add("/Ventas/Corporativo.aspx".ToUpper(), 807) PaginaDict.Add("/Ventas/RepRecuperacion.aspx".ToUpper(), 88) PaginaDict.Add("/Ventas/RepRecuperacionDetalle.aspx".ToUpper(), 88) From fa2ed8d8e82d3ba31d62ca2273a523e95eb1be63 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 Nov 2023 05:15:18 -0700 Subject: [PATCH 15/16] -- cambio tipo de parametro de cxcdetalle --- App_Code/ClsMovimientos.vb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 123eec236..32eda4c1c 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -317,26 +317,23 @@ Public Class ClsMovimientos Return Retorno End Function - Public Function GetCxCDetalle(FechaI As String, FechaF As String, CveCliente As Integer, CveSubProyecto As Integer, CveVendedor As Integer, CveUsuario As Integer, Anio As Integer, Mes As Integer, + Public Function GetCxCDetalle(FechaInicio As Date, FechaFin As Date, CveCliente As Integer, CveSubProyecto As Integer, CveVendedor As Integer, CveUsuario As Integer, Anio As Integer, Mes As Integer, AnioMes As String, Fecha As String, CveClienteSucursal As Integer, Opcion As String, CveEstatus As Integer, IVA As String, Agrupador As Integer, CveEmpresa As Integer, CveResponsable As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1", - Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, + Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional LimiteCredito As Decimal = -1, Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1, Optional TieneLineaAdicional As Integer = -1, Optional CveContrato As Integer = -1) As Boolean Dim Retorno As Boolean = False - DS = New DataSet - 'Data = New DataTable - 'SqlAdapter = New SqlDataAdapter("PA_RepCxCDetalle", SqlConexion) - 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure - + DS = New DataSet + DataAdapter("PA_RepCxCDetalle") With SqlAdapter.SelectCommand.Parameters '.Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@FechaI", SqlDbType.VarChar).Value = FechaI - .Add("@FechaF", SqlDbType.VarChar).Value = FechaF + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor From 6942682a16b58c8263bbb063bf7ff6606a807df4 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 Nov 2023 05:15:36 -0700 Subject: [PATCH 16/16] - --- App_Code/Modelos.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index ed7f81c9e..df3cea594 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -7555,7 +7555,7 @@ Namespace Modelos Public Property ClaveUsoCFDI As String = "" Public Property CveTipoRelacion As Integer = -1 Public Property CveEstatusFactura As Integer - Public Property CveVendedor As Integer + Public Property CveVendedor As Integer = 0 Public Property VendedorCodigo As String = "" Public Property CveSucursalEjecucion As Integer Public Property FechaEjecucion As Date @@ -7570,7 +7570,7 @@ Namespace Modelos Public Property Entrega As String = "" Public Property TiempoEntrega As String = "" Public Property Vigencia As Date - Public Property TipoEstatus As Integer + Public Property TipoEstatus As Integer = 0 Public Property CveCondicionEntrega As Integer = -1 Public Property CondicionEntrega As String = ""