From 3d9016c2252790d4594eea704f48720fbbf1d9f7 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:07:21 -0700 Subject: [PATCH 01/42] -- MEJORA --- Bancos/RepCortes.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index f5e4ccba6..fd52292fd 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -172,7 +172,7 @@ Partial Class Bancos_RepCortes DtCortesVentas = Vent.DtResultados divDetalle.Visible = True End If - If DtCortesVentasResumen.Rows.Count > 0 Or DtCortesVentas.Rows.Count > 0 Then + If (DtCortesVentasResumen IsNot Nothing AndAlso DtCortesVentasResumen.Rows.Count > 0) Or (DtCortesVentas IsNot Nothing AndAlso DtCortesVentas.Rows.Count > 0) Then HplDownPDF.Visible = True HplDownEXCEL.Visible = True HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}&CVESUBPROYECTO={2}", CveCorte, "PDF", DdlSubProyectos.SelectedValue.ToEntero))) From a4d7903dc6f85aceef81aab2e2edef02c45227d3 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:07:46 -0700 Subject: [PATCH 02/42] -cambio de conceptos --- Acumuladores/RepRecolecciones.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Acumuladores/RepRecolecciones.aspx.vb b/Acumuladores/RepRecolecciones.aspx.vb index a54114ae5..0fd8d43d1 100644 --- a/Acumuladores/RepRecolecciones.aspx.vb +++ b/Acumuladores/RepRecolecciones.aspx.vb @@ -220,9 +220,9 @@ Partial Class Acumuladores_RepRecolecciones Dim ErrorMovInv As Boolean = False Dim Fecha As DateTime = NowADS() Dim Concepto As String = "Traspaso Recolección" - Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 26, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveEntregaAlmacen:=CveEntregaAlmacen) + Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 45, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados") Dim FolioSalida As Integer = ObjInventario.Folio - Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida, CveEntregaAlmacen:=CveEntregaAlmacen) + Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 42, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados") Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=HdnPSRecoleccion.Value.ToEntero).FiltroPrimeroValor("CveUnidadMedida", "").ToEntero If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, HdnCantidadRecoleccion.Value.ToDecimal, CveUM, HdnPSRecoleccion.Value.ToEntero, 0) Then ErrorMovInv = True From c19142ed323b0c7e2b1e451a6c89516d50b2b8ce Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:07:58 -0700 Subject: [PATCH 03/42] -- pac 4 --- Inventarios/CartaPorteManual.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/CartaPorteManual.aspx.vb b/Inventarios/CartaPorteManual.aspx.vb index 784e26323..71f333a2a 100644 --- a/Inventarios/CartaPorteManual.aspx.vb +++ b/Inventarios/CartaPorteManual.aspx.vb @@ -781,7 +781,7 @@ Partial Class Inventarios_CartaPorteManual Exit Sub End If - If ObjTimbres.Timbrar() Then + If ObjTimbres.Timbrar(4) Then Try PdfFactura(ObjTimbres.ObjFactura) From cd59cdc37f54d8ef76b5ca87c997ff84cc5e11eb Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:14:05 -0700 Subject: [PATCH 04/42] -- mejora en descarga xml para econo --- Ventas/RepProductosServiciosDetalle.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/RepProductosServiciosDetalle.aspx.vb b/Ventas/RepProductosServiciosDetalle.aspx.vb index b4747a7da..60ac4617d 100644 --- a/Ventas/RepProductosServiciosDetalle.aspx.vb +++ b/Ventas/RepProductosServiciosDetalle.aspx.vb @@ -788,7 +788,7 @@ Partial Class Ventas_RepProductosServiciosDetalle Archivo = String.Format("{0}PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString) If File.Exists(Archivo) Then archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".pdf") - If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa = 119 Then + If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(119, 141) Then Archivo = String.Format("{0}XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString) If File.Exists(Archivo) Then archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".xml") From 66181a66c84fc93201417fc0eeebd2d6694fd71f Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:14:16 -0700 Subject: [PATCH 05/42] - --- Ventas/RepProductosServiciosDetalle.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/RepProductosServiciosDetalle.aspx.vb b/Ventas/RepProductosServiciosDetalle.aspx.vb index 60ac4617d..4338b5057 100644 --- a/Ventas/RepProductosServiciosDetalle.aspx.vb +++ b/Ventas/RepProductosServiciosDetalle.aspx.vb @@ -788,7 +788,7 @@ Partial Class Ventas_RepProductosServiciosDetalle Archivo = String.Format("{0}PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString) If File.Exists(Archivo) Then archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".pdf") - If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(119, 141) Then + If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(119, 141, 152, 159, 160, 161, 162, 166) Then Archivo = String.Format("{0}XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString) If File.Exists(Archivo) Then archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".xml") From f99941f756fa70b77789b96376fde034ef911b0a Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:14:27 -0700 Subject: [PATCH 06/42] - mejora --- Ventas/PVCobranza.aspx | 29 +++++++++++------------------ Ventas/PVCobranza.aspx.vb | 21 ++++++++++++++++++--- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx index 820691846..bc89fc143 100644 --- a/Ventas/PVCobranza.aspx +++ b/Ventas/PVCobranza.aspx @@ -292,9 +292,9 @@ + DataKeyNames="CveVenta,TipoDocto,Saldo,AtencionA"> - + @@ -310,14 +310,15 @@
- Nombre: - -           +
+
Nombre:
+
         
+ - - - - +
+
+
+
@@ -514,15 +515,7 @@ - - - - - - - - - +     diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index b07564e1a..2da8d426b 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -93,7 +93,7 @@ Partial Class Ventas_PVCobranza If ObjPVenta.DtResultados.Rows.Count > 0 Then CveCorte = ObjPVenta.CveCorte Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-5) - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < NowADS().Date Then + If FechaICorte < NowADS().Date Then DebeCerrarCorte = True LblMotivoBloqueo.Text = $"Existe un corte del día {FechaICorte.ToString("dd/MM/yyyy")}. Favor de cerrarlo para iniciar un nuevo corte." Else @@ -244,7 +244,7 @@ Partial Class Ventas_PVCobranza TxtImporteContado.Text = GvRow.DataKey("Saldo").FormatoNumero HdnTotal.Value = GvRow.DataKey("Saldo") TxtImporteEfectivo.Focus() - LtlNombre.Text = GvRow.DataKey("DescripcionVenta") + LtlNombre.Text = GvRow.DataKey("AtencionA") LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero Catch ex As Exception TieneError = True @@ -340,6 +340,10 @@ Partial Class Ventas_PVCobranza PagoEfectivo = TxtImporteCheque.Text.ToDecimal End If + If Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, CveCorte) Then + MsgError = "Error al aplicar el corte" + End If + Else MsgError = "Error al registrar prepólizas" End If @@ -503,7 +507,7 @@ Partial Class Ventas_PVCobranza Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click Dim ObjPVenta As New ClsPuntoVenta - ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa) + ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, "", UsuarioActual.CveEmpresa) CveCorte = ObjPVenta.CveCorte LblTurno.Text = NowADS().ToShortDateString UpTurno.Visible = True @@ -561,4 +565,15 @@ Partial Class Ventas_PVCobranza End If End Sub + + Protected Sub LnkLiberar_Click(sender As Object, e As EventArgs) + Dim ObjVentas As New ClsVentas + + If ObjVentas.UpdateAsignaVentaCobranza(HdnCveVenta.Value.ToEntero, -1, -1, -1, "", Now) Then + PnlContado.Visible = False + HdnCveVenta.Value = "" + CargaDatos() + End If + ObjVentas.Dispose() + End Sub End Class From f2ef32a7b6480c30dcc88a7de3059ca0c4764072 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:14:53 -0700 Subject: [PATCH 07/42] - permite descuento al 100% --- Ventas/Ventas.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 65aa3a9ca..527c0b11f 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -9840,7 +9840,7 @@ console.log("evento descuento"); if ($get("TxtPorPS").value != "") { let PorcentajeDescuento = parseFloat($get("TxtPorPS").value); - if (PorcentajeDescuento < 0 || PorcentajeDescuento > 99) { + if (PorcentajeDescuento < 0 || PorcentajeDescuento > 100) { alert("No se puede aplicar ese porcentaje de descuento"); $get("TxtPorPS").value = "0"; recalcularUtilidad(0); From a9b4672bc6c8d099447d3f09a8e2f8776598ca37 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:15:30 -0700 Subject: [PATCH 08/42] - descuento al 100 y bloqueo de pantalla --- Ventas/Ventas.aspx.vb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d0c65fca6..5fad3f3ff 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2671,6 +2671,7 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(714).ToEntero() > 0 Then ViewState("CveCliente") = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() HdnCveCliente.Value = UsuarioActual.Empresa.Funcionalidad(714) + RBLPago.SelectedValue = "2" CargaCliente(CveCliente) End If End If @@ -3532,11 +3533,11 @@ Partial Class Ventas Private Sub ValidaUsuarioAcceso() 'VERIFICAR SI LA SESION SE ENCUENTRA BLOQUEADA If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then - Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0) + Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("") - If DrUsuario("CodigoAcceso").ToString() <> "" Then + If DrUsuario IsNot Nothing AndAlso DrUsuario("CodigoAcceso").ToString() <> "" Then If UsuarioActual.SesionBloqueada Then - DivBloqueoacceso.Visible = False + DivBloqueoAcceso.Visible = False Dim strScript As New StringBuilder strScript.Append("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueoAcceso"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); ") If UsuarioActual.ErrorDesbloqueo Then @@ -3553,10 +3554,10 @@ Partial Class Ventas BtnEmitirImprimir.Visible = False Exit Sub Else - DivBloqueoacceso.Visible = True + DivBloqueoAcceso.Visible = True End If Else - DivBloqueoacceso.Visible = False + DivBloqueoAcceso.Visible = False End If Else DivBloqueoacceso.Visible = False @@ -12903,6 +12904,13 @@ Partial Class Ventas 'si el codigo objeto impuesto es 02 y no tiene desglose de impuestos por el descuento, debe asignar el valor 04 - Si objeto de impuesto y no causa impuesto If concepto.Impuestos.Count = 0 AndAlso concepto.ObjetoImpuesto = "02" AndAlso (concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional).RoundSQL(2) = 0.00D Then concepto.ObjetoImpuesto = "04" + 'se ajusta a un centavo, para que se pueda emitir con un centavo. + If UsuarioActual.CveEmpresa = 140 Then + concepto.ObjetoImpuesto = "02" + concepto.Descuento = concepto.Descuento - 0.01D + Obj.SubTotal = Obj.SubTotal + 0.01D + Obj.Total = Obj.Total + 0.01D + End If End If Timbre.Conceptos.Add(concepto) @@ -37164,7 +37172,7 @@ Partial Class Ventas If HdnDescPS.Value.ToEntero() > 0 Then Dim RowUpdate As DataRow = TmpDT.Select($"Consec = {HdnConsecPS.Value}").FirstOrDefault() If RowUpdate IsNot Nothing Then - If HdnDescPS.Value.ToDecimal().RoundSQL(2) < RowUpdate("Total").ToString().ToDecimal() Then + If HdnDescPS.Value.ToDecimal().RoundSQL(2) <= RowUpdate("Total").ToString().ToDecimal() Then RowUpdate("Descuento") = HdnDescPS.Value.ToDecimal().RoundSQL(2) Dim TotalCalculableImpuestos = (RowUpdate("Cantidad").ToString().ToDecimal * RowUpdate("PU").ToString().ToDecimal) - RowUpdate("Descuento").ToString().ToDecimal() @@ -37177,7 +37185,7 @@ Partial Class Ventas CalculaTotalesVenta() RegistraScript("$('#ModalDescPS').modal('hide');") Else - Alert("El descuento no puede ser mayor o igual al total.", TipoMensaje.MsgAdvertencia) + Alert("El descuento no puede ser mayor al total.", TipoMensaje.MsgAdvertencia) End If End If From 27a12e381951a399d356cd0865c90d2e1e3cbdf5 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:17:04 -0700 Subject: [PATCH 09/42] - mejora texto --- Ventas/ActualizarPrecios.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index 0222be5d3..de07ebba7 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -425,7 +425,7 @@ Partial Class Ventas_ActualizarPrecios .Precio = row.FCTextBox("TxtPrecio").Text.ToDecimal() }).QueryToDataTable(True) If DtExcel.Rows.Count < 1 Then - Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia) + Alert("No hay resultados en la busqueda.", TipoMensaje.MsgAdvertencia) Exit Sub End If From f82d12f9a5ed0e90a1503e6ee8a7b0f5c7ec315f Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Feb 2024 20:17:26 -0700 Subject: [PATCH 10/42] - mejora en mensaje --- Contabilidad2/CatCuentas.aspx.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/Contabilidad2/CatCuentas.aspx.vb b/Contabilidad2/CatCuentas.aspx.vb index 531d8780a..7d7b7887c 100644 --- a/Contabilidad2/CatCuentas.aspx.vb +++ b/Contabilidad2/CatCuentas.aspx.vb @@ -497,6 +497,7 @@ Partial Class Contabilidad2_CatCuentas Exit Sub End If Else + Alert("El traspaso de movimientos en la cuenta tuvo un error.", TipoMensaje.MsgError) TieneError = True ObjConta.RollBack() ObjConta.Dispose() From efeb1740744d76d9ed92ef767b8a871425f7e321 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 29 Feb 2024 08:32:51 -0700 Subject: [PATCH 11/42] Correcion OS material utilizado --- OS/OrdenesServicios.aspx.vb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index ac79814f3..36cd8ca2f 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -3037,18 +3037,20 @@ Partial Class OS_OrdenesServicios Select Case DdlTipoVenta.SelectedValue.ToEntero - Case 1, 2 + Case 1, 2 ' *1 *pago directo Opcion = 1 Exit Select Case 3 ' por el momento ya no se usa Opcion = 2 Exit Select - Case 5 - Opcion = 3 - Exit Select - Case 6 + Case 5 ' consignacion uso + 'Opcion = 3 Opcion = 4 Exit Select + Case 6 ' a vista uso de material + 'Opcion = 4 + Opcion = 3 + Exit Select Case Else Opcion = 1 Exit Select From cec5f48473218d3483f82bf8ab70475ef3b87663 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 29 Feb 2024 08:39:22 -0700 Subject: [PATCH 12/42] OS correcion materia surtido v2 --- OS/OrdenesServicios.aspx.vb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 36cd8ca2f..453c99c5d 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -3037,19 +3037,17 @@ Partial Class OS_OrdenesServicios Select Case DdlTipoVenta.SelectedValue.ToEntero - Case 1, 2 ' *1 *pago directo + Case 1, 2 ' *Fuera de liena *pago directo Opcion = 1 Exit Select Case 3 ' por el momento ya no se usa Opcion = 2 Exit Select Case 5 ' consignacion uso - 'Opcion = 3 - Opcion = 4 + Opcion = 3 Exit Select Case 6 ' a vista uso de material - 'Opcion = 4 - Opcion = 3 + Opcion = 4 Exit Select Case Else Opcion = 1 From ce0b57a1ab64bf6ad91de048570696fa10a7fbbf Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Thu, 29 Feb 2024 10:05:18 -0700 Subject: [PATCH 13/42] error en codigos duplicados --- Nomina/Nomina.aspx.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 85ebb9a3a..9285ca71e 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -2519,7 +2519,14 @@ public partial class Nomina_Nomina2 : ClsPaginas if (dconr != null) { CveConcepto = dconr["CveConcepto"].ToString(); - dtxz.Columns[i].ColumnName = CveConcepto; + if (dtxz.Columns.Contains(CveConcepto)) + { + stringError = string.Format("Ocurrio un Error al procesar el excel código duplicado '{0}'({1}).", conceptocodigo, i); + } + else + { + dtxz.Columns[i].ColumnName = CveConcepto; + } } else { From c9da910f6c9a09c4d6b6b7b04757534a806e277b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 29 Feb 2024 12:06:57 -0700 Subject: [PATCH 14/42] --remisiones con aplicacion de devoluciones --mostrar tipo docto default despues de bloquear --mostrar AtencionA en ingresos func 190 --- Ventas/Ventas.aspx.vb | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ae52c43a7..e05c849bc 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3435,7 +3435,7 @@ Partial Class Ventas HlAgregarExcel.Visible = True End If - If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then + If DdlTipoComprobante.SelectedValue.Contiene("Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(109) <> "1" Then ' IPP 15 Julio 2017 - ERA FALSE ImgAntiPend.Visible = False UpPS.Update() @@ -3655,7 +3655,7 @@ Partial Class Ventas End If - UsuarioActual.Empresa = ObjEmpresa.Empresa + Usuario.Empresa = ObjEmpresa.Empresa ADSSession.ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa) @@ -5060,6 +5060,10 @@ Partial Class Ventas Select Case DbRowVenta("TipoDocto").ToString() Case "Ing" + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + TxtAtencionA.Text = DbRowVenta("AtencionA").ToString() + End If + Trsaldo.Visible = True HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) @@ -7163,6 +7167,12 @@ Partial Class Ventas CalculaLineasAdicionales() HabilitaRemisionPublicoGeneral = 0 HabilitarRemisionesPublicoGeneral() + + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + If Not String.IsNullOrEmpty(UsuarioActual.CveTipoDocumento) Then + DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento) + End If + End If End If @@ -7171,6 +7181,8 @@ Partial Class Ventas End If + + 'If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then ' Using ObjVentas As New ClsVentas ' If ObjVentas.GetLineasAdicionales(-1, CveCliente, -1, -1, DdlMoneda.SelectedValue.ToEntero(), MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa) Then @@ -17569,6 +17581,10 @@ Partial Class Ventas ImgAntiPend.Visible = False End If + If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then + ImgAntiPend.Visible = True + End If + TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString @@ -17600,6 +17616,10 @@ Partial Class Ventas ImgAntiPend.Visible = True End If + If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then + ImgAntiPend.Visible = True + End If + MostrarOpcionesPaqueteria() TrAtencionA.Visible = True @@ -30621,7 +30641,7 @@ Partial Class Ventas divAnticipoMsg.Visible = False If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then - If DdlTipoComprobante.SelectedValue = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'NC' ", "")}") divAmortizacionTipoRelacion.Visible = False GVAnticipos.DataSource = DtMovtos @@ -37357,6 +37377,23 @@ Partial Class Ventas DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty) divAmortizacionTipoRelacion.Visible = False + + If DdlTipoComprobante.SelectedValue = "Rem" Then + If DdlTipoAmortizacionAnticipo.Items.FindByValue("1") IsNot Nothing Then + DdlTipoAmortizacionAnticipo.Items.Remove(DdlTipoAmortizacionAnticipo.Items.FindByValue("1")) + End If + If DdlTipoAmortizacionAnticipo.Items.FindByValue("2") IsNot Nothing Then + DdlTipoAmortizacionAnticipo.Items.Remove(DdlTipoAmortizacionAnticipo.Items.FindByValue("2")) + End If + Else + If DdlTipoAmortizacionAnticipo.Items.FindByValue("1") Is Nothing Then + DdlTipoAmortizacionAnticipo.Items.Add(New ListItem("Amortización anticipo en descuento", "1")) + End If + If DdlTipoAmortizacionAnticipo.Items.FindByValue("2") Is Nothing Then + DdlTipoAmortizacionAnticipo.Items.Add(New ListItem("Amortización anticipo con nota de crédito", "2")) + End If + End If + End If UpAnticipos.Update() From 4bfadd8d2ce9bbe217d11b1d3c04ceb8731b9b91 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 29 Feb 2024 13:41:38 -0700 Subject: [PATCH 15/42] --Descarga de etiquetas desde productos servicios --- Ventas/ProductosServicios.aspx | 6 +++++ Ventas/ProductosServicios.aspx.vb | 38 ++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index 596dacc42..e7eeed0e6 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -64,6 +64,9 @@ + + +
  • @@ -74,6 +77,9 @@
  • Bitacora Ecommerce
  • +
  • + +
  • diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 4b87baa9e..8294ff03c 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -5,6 +5,7 @@ Imports System.Data Imports System.Data.SqlClient Imports System.IO Imports Extensiones +Imports Microsoft.Reporting.WebForms Imports ZXing Partial Class ProductosyServicios @@ -1083,6 +1084,10 @@ Partial Class ProductosyServicios LnkUnificar.Visible = True ChkPrecioLibre.Checked = ObjProductosServicios.PrecioLibre + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + LnkGenerarEtiqueta.Visible = True + End If + If UsuarioActual.Empresa.Funcionalidad(143) = "1" Then TxtRegistroRSCO.Text = ObjProductosServicios.DtResultados.Rows(0)("RegistroRSCO").ToString @@ -3542,12 +3547,12 @@ Partial Class ProductosyServicios 'If DdlMaterialPeligroso.SelectedValue.ToEntero > 0 And DdlEmbalaje.SelectedValue.ToEntero > 0 And DdlClaveSectorCOFEPRIS.SelectedValue.ToEntero > 0 And CamposStringCCP.Length > 0 Then Dim ObjPS As New ClsProductosServicios(transaccionSQL) - If Not ObjPS.AddUpdateProductosServiciosComplementos(CvePS, TxtPesoKg.Text.ToDecimal, DdlMaterialPeligroso.SelectedValue.ToEntero, DdlEmbalaje.SelectedValue.ToEntero, TxtDimensiones.Text, DdlClaveSectorCOFEPRIS.SelectedValue.ToEntero, - TxtNombreIngredienteActivo.Text.Trim, TxtNomQuimico.Text.Trim, TxtDenominacionGenerica.Text.Trim, TxtDenominacionDistintiva.Text.Trim, TxtFabricante.Text.Trim, DdlClaveFormaFarmaceutica.SelectedValue.ToEntero, DdlCondicionesEspTransporte.SelectedValue.ToEntero, - TxtRegistroSanitarioAutorizacion.Text.Trim, TxtPermisoImportacion.Text.Trim, TxtFolioImportacionVUCEM.Text.Trim, TxtNumCAS.Text.Trim, TxtRazonSocialEmpImportacion.Text, TxtNumRegistroPlagCOFEPRIS.Text.Trim, TxtDatosFabricante.Text.Trim, - TxtDatosFormulador.Text.Trim, TxtDatosMaquilador.Text.Trim, TxtUsoAutorizado.Text, DdlTipoMateria.SelectedValue.ToEntero) Then - Respuesta = False - End If + If Not ObjPS.AddUpdateProductosServiciosComplementos(CvePS, TxtPesoKg.Text.ToDecimal, DdlMaterialPeligroso.SelectedValue.ToEntero, DdlEmbalaje.SelectedValue.ToEntero, TxtDimensiones.Text, DdlClaveSectorCOFEPRIS.SelectedValue.ToEntero, + TxtNombreIngredienteActivo.Text.Trim, TxtNomQuimico.Text.Trim, TxtDenominacionGenerica.Text.Trim, TxtDenominacionDistintiva.Text.Trim, TxtFabricante.Text.Trim, DdlClaveFormaFarmaceutica.SelectedValue.ToEntero, DdlCondicionesEspTransporte.SelectedValue.ToEntero, + TxtRegistroSanitarioAutorizacion.Text.Trim, TxtPermisoImportacion.Text.Trim, TxtFolioImportacionVUCEM.Text.Trim, TxtNumCAS.Text.Trim, TxtRazonSocialEmpImportacion.Text, TxtNumRegistroPlagCOFEPRIS.Text.Trim, TxtDatosFabricante.Text.Trim, + TxtDatosFormulador.Text.Trim, TxtDatosMaquilador.Text.Trim, TxtUsoAutorizado.Text, DdlTipoMateria.SelectedValue.ToEntero) Then + Respuesta = False + End If ' End If 'End If @@ -3566,4 +3571,25 @@ Partial Class ProductosyServicios + Protected Sub LnkGenerarEtiqueta_Click(sender As Object, e As EventArgs) + Dim CvePrecioListaPredeterminada = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "Predeterminada = True").ToEntero() + Dim DtPrecios As DataTable = Nothing + + Dim ObjVentas As New ClsProductosServicios + If ObjVentas.GetPSPrecios(CvePrecioListaPredeterminada, Me.CvePS.ToString()) AndAlso ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then + DtPrecios = ObjVentas.DtResultados.Copy() + End If + ObjVentas.Dispose() + + If DtPrecios IsNot Nothing Then + Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt" + If System.IO.File.Exists(UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt") Then + DirectorioArchivo = UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt" + End If + Dim params As New List(Of ReportParameter) + + ImprimirPDFStimul(DirectorioArchivo, DtPrecios, params, "Precios") + End If + + End Sub End Class From 66900b46fb52b869e7f849fb9c92899f6ccd64f8 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 29 Feb 2024 15:08:37 -0700 Subject: [PATCH 16/42] --Ferretera, multiples listas de precio --- Ventas/ActualizarPrecios.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index de07ebba7..a280a08e7 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -91,7 +91,7 @@ Partial Class Ventas_ActualizarPrecios LblModalidad.Visible = True DivModalidad.Visible = True End If - If UsuarioActual.CveEmpresa = 189 Then + If UsuarioActual.CveEmpresa.Contiene(189, 190, 192) Then LblModalidad.Visible = True DivModalidad.Visible = True End If From 2324bf20b7bd88b43d1a4621b9e270fd41fd4570 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 29 Feb 2024 17:15:38 -0700 Subject: [PATCH 17/42] --ajustes de concepto 04 con activos fijos --- Ventas/Ventas.aspx.vb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 07b0c9773..d3dfe6ad5 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3584,7 +3584,7 @@ Partial Class Ventas DivBloqueoAcceso.Visible = False End If Else - DivBloqueoacceso.Visible = False + DivBloqueoAcceso.Visible = False End If End Sub @@ -12955,13 +12955,13 @@ Partial Class Ventas 'si el codigo objeto impuesto es 02 y no tiene desglose de impuestos por el descuento, debe asignar el valor 04 - Si objeto de impuesto y no causa impuesto If concepto.Impuestos.Count = 0 AndAlso concepto.ObjetoImpuesto = "02" AndAlso (concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional).RoundSQL(2) = 0.00D Then concepto.ObjetoImpuesto = "04" - 'se ajusta a un centavo, para que se pueda emitir con un centavo. - If UsuarioActual.CveEmpresa = 140 Then - concepto.ObjetoImpuesto = "02" - concepto.Descuento = concepto.Descuento - 0.01D - Obj.SubTotal = Obj.SubTotal + 0.01D - Obj.Total = Obj.Total + 0.01D - End If + ''se ajusta a un centavo, para que se pueda emitir con un centavo. + 'If UsuarioActual.CveEmpresa = 140 Then + ' concepto.ObjetoImpuesto = "02" + ' concepto.Descuento = concepto.Descuento - 0.01D + ' Obj.SubTotal = Obj.SubTotal + 0.01D + ' Obj.Total = Obj.Total + 0.01D + 'End If End If Timbre.Conceptos.Add(concepto) @@ -14969,6 +14969,12 @@ Partial Class Ventas CveVentaAplicar = CveDevolucion CveVentaAmortizacionAplicar = ObjFactura.CveVenta End If + 'verifico que el AF, tenga valores iguales cuando esté vacío o "-1" + Dim drs As DataRow() = TmpDTDetalle.Select(" CveActivoFijo IS NULL") + For Each dr As DataRow In drs + dr("CveActivoFijo") = "-1" + Next + TmpDTDetalle.AcceptChanges() DT = TmpDTDetalle.FiltraParametros($"CvePS <> {CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA", "CveActivoFijo"}) From 295f1884fa6b7a38790c46291b219dfe6aa5e604 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 1 Mar 2024 16:14:23 -0700 Subject: [PATCH 18/42] Ferretera. Recalculo de precios, segun es credito o contado --- Ventas/CatPreciosLista.aspx | 7 ++++- Ventas/Ventas.aspx.vb | 62 ++++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 8 deletions(-) diff --git a/Ventas/CatPreciosLista.aspx b/Ventas/CatPreciosLista.aspx index 15b3eb16f..d694e50f9 100644 --- a/Ventas/CatPreciosLista.aspx +++ b/Ventas/CatPreciosLista.aspx @@ -30,11 +30,16 @@ - + + + + + + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d3dfe6ad5..ed75d8147 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12955,13 +12955,13 @@ Partial Class Ventas 'si el codigo objeto impuesto es 02 y no tiene desglose de impuestos por el descuento, debe asignar el valor 04 - Si objeto de impuesto y no causa impuesto If concepto.Impuestos.Count = 0 AndAlso concepto.ObjetoImpuesto = "02" AndAlso (concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional).RoundSQL(2) = 0.00D Then concepto.ObjetoImpuesto = "04" - ''se ajusta a un centavo, para que se pueda emitir con un centavo. - 'If UsuarioActual.CveEmpresa = 140 Then - ' concepto.ObjetoImpuesto = "02" - ' concepto.Descuento = concepto.Descuento - 0.01D - ' Obj.SubTotal = Obj.SubTotal + 0.01D - ' Obj.Total = Obj.Total + 0.01D - 'End If + 'se ajusta a un centavo, para que se pueda emitir con un centavo. + If UsuarioActual.CveEmpresa = 140 Then + concepto.ObjetoImpuesto = "02" + concepto.Descuento = concepto.Descuento - 0.01D + Obj.SubTotal = Obj.SubTotal + 0.01D + Obj.Total = Obj.Total + 0.01D + End If End If Timbre.Conceptos.Add(concepto) @@ -17341,6 +17341,15 @@ Partial Class Ventas Alert("No hay una lista de precios predeterminada", TipoMensaje.MsgAdvertencia) End If + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + If RBLPago.SelectedValue = "1" Then + Dim CvePrecioListaCredito = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "ISNULL(Credito,False) = True").ToEntero() + If CvePrecioListaCredito > 0 Then + CvePrecioListaPS = CvePrecioListaCredito + End If + End If + End If + If CvePrecioListaPS > 0 Then Dim ObjPS As New ClsProductosServicios If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then @@ -23256,6 +23265,9 @@ Partial Class Ventas End Sub Private Sub RBLPago_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLPago.SelectedIndexChanged LimpiaEscondeContado() + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + RecalculaPrecios() + End If End Sub Private Function ValidaPagosContado(Optional MostrarAlertas As Boolean = True, Optional TipoDoctoViejo As String = "") As Boolean Dim Retorno As Boolean = False @@ -37414,5 +37426,41 @@ Partial Class Ventas RegistraScript("MuestraAnticipos();", "AE") End Sub + + Private Sub RecalculaPrecios() + If TmpDT IsNot Nothing Then + For Each Row As DataRow In TmpDT.Rows + Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() + Dim CveClasificacion As Integer = Row("CveClasificacion").ToString().ToEntero + Dim CvePS As Integer = Row("CvePS").ToString().ToEntero + + Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion) + If ObjPrecioSugerido.PrecioSugerido > 0 Then + Dim PU As Decimal = ObjPrecioSugerido.PrecioSugerido.RoundSQL(6) + + Dim ObjDescuento As Modelos.VentaDescuentos = CalcularDescuentos(CvePS, Cantidad, PU) + If ObjDescuento.EsPUModificado Then + PU = ObjDescuento.PU + End If + + Row("PU") = PU + + Dim TotalCalculableImpuestos As Decimal = ((Cantidad * PU) - (ObjDescuento.ImporteDescuento)) + Dim TotalCalculableImpuestosIVA As Decimal = 0 + TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + Row("PorcentajeIEPS").ToString().ToDecimal) + + Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales) + + Row("Descuento") = (ObjDescuento.ImporteDescuento).RoundSQL(NumeroDecimales) + Row("Total") = (Cantidad * PU) + Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales) + End If + Next + + Me.CalculaTotalesVenta() + End If + + End Sub + End Class From 9f23b56e0cede0266e1353895bb6e9b214b720fb Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 1 Mar 2024 17:14:16 -0700 Subject: [PATCH 19/42] Checador correcion dia de decanso y se agrega codigo de empleado --- RH/RepChecadorPreAsistencia.aspx | 5 +- RH/RepChecadorPreAsistencia.aspx.vb | 398 +++++++++++++++------------- Ventas/Ventas.aspx.vb | 23 +- 3 files changed, 232 insertions(+), 194 deletions(-) diff --git a/RH/RepChecadorPreAsistencia.aspx b/RH/RepChecadorPreAsistencia.aspx index 4e5443f3d..e20f1db0b 100644 --- a/RH/RepChecadorPreAsistencia.aspx +++ b/RH/RepChecadorPreAsistencia.aspx @@ -91,7 +91,6 @@
    -
    @@ -106,9 +105,9 @@ - + - + diff --git a/RH/RepChecadorPreAsistencia.aspx.vb b/RH/RepChecadorPreAsistencia.aspx.vb index a4d324905..685d93bec 100644 --- a/RH/RepChecadorPreAsistencia.aspx.vb +++ b/RH/RepChecadorPreAsistencia.aspx.vb @@ -327,7 +327,7 @@ Partial Class RH_RepChecadorPreAsistencia Resultados.Columns.Add("CvePersonal") Resultados.Columns.Add("NombreCompleto") - 'Resultados.Columns.Add("Codigo") + Resultados.Columns.Add("Codigo") Resultados.Columns.Add("CveSubProyecto") Resultados.Columns.Add("SalarioDiario") Resultados.Columns.Add("CveAsistenciasInasistencias") @@ -349,7 +349,7 @@ Partial Class RH_RepChecadorPreAsistencia Resultados.Columns.Add("TipoCorto") Resultados.Columns.Add("Sancion") - If DdlTurno.SelectedValue.ToEntero > 0 And DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlRango.SelectedValue.ToEntero > 0 Then + If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlRango.SelectedValue.ToEntero > 0 Then Dim FiltroSubProyecto As String = "" Dim filtroturno = If(DdlTurno.SelectedValue = "-1", "", $"AND CveTurno = { DdlTurno.SelectedValue}") @@ -422,6 +422,10 @@ Partial Class RH_RepChecadorPreAsistencia Dim ContadorFaltas As Integer = 0 Dim registrosPersonal As DataTable = DTChecadorRegistros.FiltraParametros(" CvePersonal = " & dRow(0).ToString()) + Dim CveTurno As Integer = dRow("CveTurno").ToString.ToEntero + Dim DiaDescanso As Integer = GlobalDTTurno(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DiaDescanso", $" CveTurno = {CveTurno} ").ToEntero - 1 'El -1 es por que en .net el domingo empieza 0 y en la sql en 1 + Dim Codigo As String = dRow("Codigo").ToString + If registrosPersonal.Rows.Count > 0 Then DTHorarioPersonal = DTHorarios.FiltraParametros(" CveChecadorHorario = " & registrosPersonal(0)("CveHorario").ToString() & "") Retardos = 0 @@ -431,7 +435,7 @@ Partial Class RH_RepChecadorPreAsistencia Dim ReRow As DataRow = Resultados.NewRow ReRow("CvePersonal") = dRow(0).ToString() ReRow("NombreCompleto") = dRow("NombreCompleto").ToString() - 'ReRow("Codigo") = dRow("Codigo").ToString() + ReRow("Codigo") = Codigo ReRow("CveSubProyecto") = dRow("CveSubProyecto").ToString() ReRow("SalarioDiario") = dRow("SalarioDiario").ToString() ReRow("CveAsistenciasInasistencias") = "-1" @@ -458,7 +462,7 @@ Partial Class RH_RepChecadorPreAsistencia Dim diaSemana As Integer = Fecha.DayOfWeek Dim Asistencia As Boolean = True - Dim Horario As DataTable = HorarioDiario(Fecha, DTHorarioPersonal) + Dim Horario As DataTable = HorarioDiario(Fecha, DTHorarioPersonal, DiaDescanso) Dim DiaLaboral As Boolean = Boolean.Parse(Horario(0)(0).ToString()) Dim HorarioEntrada As TimeSpan = TimeSpan.Parse(Horario(0)(1).ToString()) @@ -615,7 +619,7 @@ Partial Class RH_RepChecadorPreAsistencia ReRow("CvePersonal") = dRow(0).ToString() ReRow("NombreCompleto") = dRow("NombreCompleto").ToString() - 'ReRow("Codigo") = dRow("Codigo").ToString() + ReRow("Codigo") = Codigo ReRow("CveSubProyecto") = dRow("CveSubProyecto").ToString() ReRow("SalarioDiario") = dRow("SalarioDiario").ToString() @@ -651,7 +655,7 @@ Partial Class RH_RepChecadorPreAsistencia ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaFalta End If - Dim Horario As DataTable = HorarioDiario(Fecha, DTHorarioPersonal) + Dim Horario As DataTable = HorarioDiario(Fecha, DTHorarioPersonal, DiaDescanso) Dim DiaLaboral As Boolean = Boolean.Parse(Horario(0)(0).ToString()) If Not DiaLaboral Then @@ -705,6 +709,8 @@ Partial Class RH_RepChecadorPreAsistencia Dim ContadorFaltas As Integer = 0 Dim registrosPersonal As DataTable = DTAsistenciasInasistenciasReg.FiltraParametros(" CvePersonal = " & dRow(0).ToString()) + + Dim Codigo As String = dRow("Codigo").ToString If registrosPersonal.Rows.Count > 0 Then For x As Integer = 1 To (DiasPeriodo) @@ -712,7 +718,7 @@ Partial Class RH_RepChecadorPreAsistencia Dim ReRow As DataRow = Resultados.NewRow ReRow("CvePersonal") = dRow(0).ToString() ReRow("NombreCompleto") = dRow("NombreCompleto").ToString() - 'ReRow("Codigo") = dRow("Codigo").ToString() + ReRow("Codigo") = Codigo ReRow("CveSubProyecto") = dRow("CveSubProyecto").ToString() ReRow("SalarioDiario") = dRow("SalarioDiario").ToString() @@ -765,7 +771,7 @@ Partial Class RH_RepChecadorPreAsistencia ReRow("NombreCompleto") = dRow("NombreCompleto").ToString() ReRow("CveSubProyecto") = dRow("CveSubProyecto").ToString() ReRow("SalarioDiario") = dRow("SalarioDiario").ToString() - 'ReRow("Codigo") = dRow("Codigo").ToString() + ReRow("Codigo") = Codigo ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaFalta ReRow("PorcentajePago") = "0" ReRow("Asistio") = "False" @@ -802,8 +808,8 @@ Partial Class RH_RepChecadorPreAsistencia DtResultados = Resultados dt.Columns.Add("CvePersonal") + dt.Columns.Add("Codigo") dt.Columns.Add("NombreCompleto") - 'dt.Columns.Add("Codigo") dt.Columns.Add("Fecha1") dt.Columns.Add("Fecha2") dt.Columns.Add("Fecha3") @@ -836,6 +842,7 @@ Partial Class RH_RepChecadorPreAsistencia dt.Columns.Add("Fecha30") dt.Columns.Add("Fecha31") + Dim DTFechas As DataTable Dim DTUPersonal As DataTable @@ -845,7 +852,7 @@ Partial Class RH_RepChecadorPreAsistencia Dim ColumN As Integer = (dt.Columns.Count) - 2 - For x As Integer = 3 To dt.Columns.Count + For x As Integer = 3 To dt.Columns.Count-1 GVRegDatos.Columns(x).HeaderText = "" GVRegDatos.Columns(x).Visible = False Next @@ -866,9 +873,9 @@ Partial Class RH_RepChecadorPreAsistencia Dim RRow As DataRow = dt.NewRow RRow("CvePersonal") = pRow("CvePersonal") RRow("NombreCompleto") = pRow("NombreCompleto") - 'RRow("Codigo") = pRow("Codigo") + RRow("Codigo") = pRow("Codigo") - ColumN = 2 + ColumN = 3 Dim ResumenDia As New DataTable Dim DTTempAsistencias As New DataTable @@ -970,170 +977,219 @@ Partial Class RH_RepChecadorPreAsistencia End Sub Private Sub ReprocesarTabla() - Dim dt As New DataTable - Dim DtPersonal As New DataTable - Dim DTAsistenciasInasistencias As New DataTable - Dim objRH As New ClsRH + If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlRango.SelectedValue.ToEntero > 0 Then - If objRH.GetPersonalAsistenciaRegistros(FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa) Then - DTAsistenciasInasistencias = objRH.DtResultados - End If + Dim dt As New DataTable + Dim DtPersonal As New DataTable + Dim DTAsistenciasInasistencias As New DataTable - DtPersonal = GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros($" CveTipoPeriodo = { DdlTipoPeriodo.SelectedValue} AND CveEstado = 1 " & If(DdlTurno.SelectedValue = "-1", "", $" AND CveTurno = {DdlTurno.SelectedValue}")) - dt.Columns.Add("CvePersonal") - dt.Columns.Add("NombreCompleto") - 'dt.Columns.Add("Codigo") - dt.Columns.Add("Fecha1") - dt.Columns.Add("Fecha2") - dt.Columns.Add("Fecha3") - dt.Columns.Add("Fecha4") - dt.Columns.Add("Fecha5") - dt.Columns.Add("Fecha6") - dt.Columns.Add("Fecha7") - dt.Columns.Add("Fecha8") - dt.Columns.Add("Fecha9") - dt.Columns.Add("Fecha10") - dt.Columns.Add("Fecha11") - dt.Columns.Add("Fecha12") - dt.Columns.Add("Fecha13") - dt.Columns.Add("Fecha14") - dt.Columns.Add("Fecha15") - dt.Columns.Add("Fecha16") - dt.Columns.Add("Fecha17") - dt.Columns.Add("Fecha18") - dt.Columns.Add("Fecha19") - dt.Columns.Add("Fecha20") - dt.Columns.Add("Fecha21") - dt.Columns.Add("Fecha22") - dt.Columns.Add("Fecha23") - dt.Columns.Add("Fecha24") - dt.Columns.Add("Fecha25") - dt.Columns.Add("Fecha26") - dt.Columns.Add("Fecha27") - dt.Columns.Add("Fecha28") - dt.Columns.Add("Fecha29") - dt.Columns.Add("Fecha30") - dt.Columns.Add("Fecha31") + Dim objRH As New ClsRH - Dim DTFechas As DataTable - Dim DTUPersonal As DataTable - Dim DTVFechas As New DataView(DtResultados) - DTFechas = DTVFechas.ToTable(True, "Fecha") - DTUPersonal = DTVFechas.ToTable(True, {"CvePersonal", "NombreCompleto"}) + If objRH.GetPersonalAsistenciaRegistros(FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa) Then + DTAsistenciasInasistencias = objRH.DtResultados + End If - Dim ColumN As Integer = (dt.Columns.Count) - 2 + DtPersonal = GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros($" CveTipoPeriodo = { DdlTipoPeriodo.SelectedValue} AND CveEstado = 1 " & If(DdlTurno.SelectedValue = "-1", "", $" AND CveTurno = {DdlTurno.SelectedValue}")) - For x As Integer = 3 To ColumN - 1 - GVRegDatos.Columns(x).HeaderText = "" - GVRegDatos.Columns(x).Visible = False - Next + dt.Columns.Add("CvePersonal") + dt.Columns.Add("NombreCompleto") + 'dt.Columns.Add("Codigo") + dt.Columns.Add("Fecha1") + dt.Columns.Add("Fecha2") + dt.Columns.Add("Fecha3") + dt.Columns.Add("Fecha4") + dt.Columns.Add("Fecha5") + dt.Columns.Add("Fecha6") + dt.Columns.Add("Fecha7") + dt.Columns.Add("Fecha8") + dt.Columns.Add("Fecha9") + dt.Columns.Add("Fecha10") + dt.Columns.Add("Fecha11") + dt.Columns.Add("Fecha12") + dt.Columns.Add("Fecha13") + dt.Columns.Add("Fecha14") + dt.Columns.Add("Fecha15") + dt.Columns.Add("Fecha16") + dt.Columns.Add("Fecha17") + dt.Columns.Add("Fecha18") + dt.Columns.Add("Fecha19") + dt.Columns.Add("Fecha20") + dt.Columns.Add("Fecha21") + dt.Columns.Add("Fecha22") + dt.Columns.Add("Fecha23") + dt.Columns.Add("Fecha24") + dt.Columns.Add("Fecha25") + dt.Columns.Add("Fecha26") + dt.Columns.Add("Fecha27") + dt.Columns.Add("Fecha28") + dt.Columns.Add("Fecha29") + dt.Columns.Add("Fecha30") + dt.Columns.Add("Fecha31") - ColumN = 3 - For Each drow As DataRow In DTFechas.Rows - GVRegDatos.Columns(ColumN).HeaderText = String.Format("
    {1}
    {0}
    ", drow(0).ToString().ToDate.ToString("dd/MM/yyyy"), ObtenerDiaSemana(drow(0).ToString().ToDate)) - GVRegDatos.Columns(ColumN).Visible = True - ColumN = ColumN + 1 - Next + Dim DTFechas As DataTable + Dim DTUPersonal As DataTable + Dim DTVFechas As New DataView(DtResultados) + DTFechas = DTVFechas.ToTable(True, "Fecha") + DTUPersonal = DTVFechas.ToTable(True, {"CvePersonal", "NombreCompleto"}) - For Each pRow As DataRow In DtPersonal.Rows + Dim ColumN As Integer = (dt.Columns.Count) - 2 - Dim RRow As DataRow = dt.NewRow - RRow("CvePersonal") = pRow("CvePersonal") - RRow("NombreCompleto") = pRow("NombreCompleto") - 'RRow("Codigo") = pRow("Codigo") + For x As Integer = 3 To ColumN - 1 + GVRegDatos.Columns(x).HeaderText = "" + GVRegDatos.Columns(x).Visible = False + Next - ColumN = 2 + ColumN = 3 For Each drow As DataRow In DTFechas.Rows + GVRegDatos.Columns(ColumN).HeaderText = String.Format("
    {1}
    {0}
    ", drow(0).ToString().ToDate.ToString("dd/MM/yyyy"), ObtenerDiaSemana(drow(0).ToString().ToDate)) + GVRegDatos.Columns(ColumN).Visible = True + ColumN = ColumN + 1 + Next - Dim filtro As String = " CvePersonal = " & pRow("CvePersonal").ToString() & " AND Fecha ='" & drow(0).ToString() & "' " - Dim ResumenDia As DataTable = DtResultados.FiltraParametros(" CvePersonal = " & pRow("CvePersonal").ToString() & " AND Fecha ='" & drow(0).ToString() & "' ") + For Each pRow As DataRow In DtPersonal.Rows - Dim DTTempAsistencias As DataTable = DTAsistenciasInasistencias.FiltraParametros(" CvePersonal = " & pRow("CvePersonal").ToString() & " AND Fecha ='" & drow(0).ToString() & "' ") - Dim TipoCorto As String = "" + Dim RRow As DataRow = dt.NewRow + RRow("CvePersonal") = pRow("CvePersonal") + RRow("NombreCompleto") = pRow("NombreCompleto") + 'RRow("Codigo") = pRow("Codigo") - If DTTempAsistencias.Rows.Count > 1 Then - TipoCorto = DTTempAsistencias(0)("TipoCorto").ToString() - End If + ColumN = 2 + For Each drow As DataRow In DTFechas.Rows - If TipoCorto <> "" Then + Dim filtro As String = " CvePersonal = " & pRow("CvePersonal").ToString() & " AND Fecha ='" & drow(0).ToString() & "' " + Dim ResumenDia As DataTable = DtResultados.FiltraParametros(" CvePersonal = " & pRow("CvePersonal").ToString() & " AND Fecha ='" & drow(0).ToString() & "' ") - If TipoCorto = "F" Then - RRow(ColumN) = "F" & "|" & filtro + Dim DTTempAsistencias As DataTable = DTAsistenciasInasistencias.FiltraParametros(" CvePersonal = " & pRow("CvePersonal").ToString() & " AND Fecha ='" & drow(0).ToString() & "' ") + Dim TipoCorto As String = "" + + If DTTempAsistencias.Rows.Count > 1 Then + TipoCorto = DTTempAsistencias(0)("TipoCorto").ToString() End If - If TipoCorto = "R" Then - RRow(ColumN) = "R" & "|" & filtro - Else - If TipoCorto = "A" Then - RRow(ColumN) = "A" & "|" & filtro + If TipoCorto <> "" Then + + If TipoCorto = "F" Then + RRow(ColumN) = "F" & "|" & filtro + End If + + If TipoCorto = "R" Then + RRow(ColumN) = "R" & "|" & filtro Else - If TipoCorto = "D" Then - RRow(ColumN) = "D" & "|" & filtro + If TipoCorto = "A" Then + RRow(ColumN) = "A" & "|" & filtro Else - - If TipoCorto = "V" Then - RRow(ColumN) = "V" & "|" & filtro + If TipoCorto = "D" Then + RRow(ColumN) = "D" & "|" & filtro Else - If TipoCorto = "I" Then - RRow(ColumN) = "I" & "|" & filtro - Else - If TipoCorto = "S" Then - RRow(ColumN) = "S" & "|" & filtro - End If + If TipoCorto = "V" Then + RRow(ColumN) = "V" & "|" & filtro + Else + If TipoCorto = "I" Then + RRow(ColumN) = "I" & "|" & filtro + Else + If TipoCorto = "S" Then + RRow(ColumN) = "S" & "|" & filtro + End If + + End If End If End If End If End If - End If - Else + Else - RRow(ColumN) = "-" + RRow(ColumN) = "-" - If ResumenDia(0)("TipoCorto").ToString() = "" Then + If ResumenDia(0)("TipoCorto").ToString() = "" Then - If ResumenDia(0)("Asistio").ToString() = "True" Then - RRow(ColumN) = "A|" & filtro - End If + If ResumenDia(0)("Asistio").ToString() = "True" Then + RRow(ColumN) = "A|" & filtro + End If - If ResumenDia(0)("DiaVacacion").ToString() = "True" Then - RRow(ColumN) = "V" & "|" & filtro - Else - If ResumenDia(0)("Asistio").ToString() = "False" Then - RRow(ColumN) = "F" & "|" & filtro + If ResumenDia(0)("DiaVacacion").ToString() = "True" Then + RRow(ColumN) = "V" & "|" & filtro Else - If ResumenDia(0)("Retraso").ToString() = "True" Then - RRow(ColumN) = "R" & "|" & filtro + If ResumenDia(0)("Asistio").ToString() = "False" Then + RRow(ColumN) = "F" & "|" & filtro Else - If ResumenDia(0)("FaltaRetraso").ToString() = "True" Then - RRow(ColumN) = "FR" & "|" & filtro - lblModalMensaje.Text = "Falta por retardo" + If ResumenDia(0)("Retraso").ToString() = "True" Then + RRow(ColumN) = "R" & "|" & filtro Else - If ResumenDia(0)("Descanso").ToString() = "True" Then - RRow(ColumN) = "D" & "|" & filtro + If ResumenDia(0)("FaltaRetraso").ToString() = "True" Then + RRow(ColumN) = "FR" & "|" & filtro + lblModalMensaje.Text = "Falta por retardo" Else - If ResumenDia(0)("Inconsistencia").ToString() = "True" Then - RRow(ColumN) = "IN" & "|" & filtro + If ResumenDia(0)("Descanso").ToString() = "True" Then + RRow(ColumN) = "D" & "|" & filtro + Else + If ResumenDia(0)("Inconsistencia").ToString() = "True" Then + RRow(ColumN) = "IN" & "|" & filtro - If ResumenDia(0)("Descanso").ToString() = "True" Then - RRow(ColumN) = "IND" & "|" & filtro + If ResumenDia(0)("Descanso").ToString() = "True" Then + RRow(ColumN) = "IND" & "|" & filtro + Else + + If ResumenDia(0)("TipoCorto").ToString() = "S" Then + RRow(ColumN) = "S" & "|" & filtro + + Else + If ResumenDia(0)("TipoCorto").ToString() = "M" Then + RRow(ColumN) = "M" & "|" & filtro + + End If + End If + + + End If + End If + End If + End If + End If + End If + End If + Else + + If ResumenDia(0)("TipoCorto").ToString() = "A" Then + RRow(ColumN) = "A" & "|" & filtro + End If + + If ResumenDia(0)("TipoCorto").ToString() = "V" Then + RRow(ColumN) = "V" & "|" & filtro + Else + If ResumenDia(0)("TipoCorto").ToString() = "F" Then + RRow(ColumN) = "F" & "|" & filtro + Else + + If ResumenDia(0)("TipoCorto").ToString() = "R" Then + RRow(ColumN) = "R" & "|" & filtro + Else + If TipoCorto = "FR" Then + RRow(ColumN) = "FR" & "|" & filtro + lblModalMensaje.Text = "Falta por retardo" + Else + If ResumenDia(0)("TipoCorto").ToString() = "D" Then + RRow(ColumN) = "D" & "|" & filtro + + End If + If ResumenDia(0)("TipoCorto").ToString() = "I" Then + RRow(ColumN) = "I" & "|" & filtro + Else + If ResumenDia(0)("TipoCorto").ToString() = "C" Then + RRow(ColumN) = "C" & "|" & filtro Else - If ResumenDia(0)("TipoCorto").ToString() = "S" Then RRow(ColumN) = "S" & "|" & filtro - Else If ResumenDia(0)("TipoCorto").ToString() = "M" Then RRow(ColumN) = "M" & "|" & filtro - End If End If - End If End If End If @@ -1141,62 +1197,21 @@ Partial Class RH_RepChecadorPreAsistencia End If End If End If - Else - If ResumenDia(0)("TipoCorto").ToString() = "A" Then - RRow(ColumN) = "A" & "|" & filtro - End If - - If ResumenDia(0)("TipoCorto").ToString() = "V" Then - RRow(ColumN) = "V" & "|" & filtro - Else - If ResumenDia(0)("TipoCorto").ToString() = "F" Then - RRow(ColumN) = "F" & "|" & filtro - Else - - If ResumenDia(0)("TipoCorto").ToString() = "R" Then - RRow(ColumN) = "R" & "|" & filtro - Else - If TipoCorto = "FR" Then - RRow(ColumN) = "FR" & "|" & filtro - lblModalMensaje.Text = "Falta por retardo" - Else - If ResumenDia(0)("TipoCorto").ToString() = "D" Then - RRow(ColumN) = "D" & "|" & filtro - - End If - If ResumenDia(0)("TipoCorto").ToString() = "I" Then - RRow(ColumN) = "I" & "|" & filtro - Else - If ResumenDia(0)("TipoCorto").ToString() = "C" Then - RRow(ColumN) = "C" & "|" & filtro - Else - If ResumenDia(0)("TipoCorto").ToString() = "S" Then - RRow(ColumN) = "S" & "|" & filtro - Else - If ResumenDia(0)("TipoCorto").ToString() = "M" Then - RRow(ColumN) = "M" & "|" & filtro - End If - End If - - End If - End If - End If - End If - End If - End If End If - - End If - ColumN = ColumN + 1 + ColumN = ColumN + 1 + Next + dt.Rows.Add(RRow) Next - dt.Rows.Add(RRow) - Next - Dim stopp As Integer = 0 - DtDatosTabla = dt + Dim stopp As Integer = 0 + DtDatosTabla = dt + + End If + + End Sub - Private Function HorarioDiario(Fecha As Date, DTHorarioPersonal As DataTable) As DataTable + Private Function HorarioDiario(Fecha As Date, DTHorarioPersonal As DataTable, DiaDescanso As Integer) As DataTable Dim respuesta As New DataTable respuesta.Columns.Add("TRABAJO", System.Type.GetType("System.Boolean")) @@ -1212,9 +1227,12 @@ Partial Class RH_RepChecadorPreAsistencia Dim diaSemana As Integer = Fecha.DayOfWeek + DiaDescanso = If(DiaDescanso > -1, DiaDescanso, 0) + Select Case diaSemana Case 0 - Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Domingo").ToString())) + Drow(0) = Boolean.Parse(If(IsNothing(drp), $"{(DiaDescanso <> diaSemana).ToString}", drp("Domingo").ToString())) + 'Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Domingo").ToString())) Drow(1) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("DomingoEntrada").ToString())) Drow(2) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("DomingoSalidaComida").ToString())) Drow(3) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("DomingoEntradaComida").ToString())) @@ -1222,42 +1240,48 @@ Partial Class RH_RepChecadorPreAsistencia Exit Select Case 1 - Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Lunes").ToString())) + Drow(0) = Boolean.Parse(If(IsNothing(drp), $"{(DiaDescanso <> diaSemana).ToString}", drp("Lunes").ToString())) + 'Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Lunes").ToString())) Drow(1) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("LunesEntrada").ToString())) Drow(2) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("LunesSalidaComida").ToString())) Drow(3) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("LunesEntradaComida").ToString())) Drow(4) = TimeSpan.Parse(If(IsNothing(drp), "09:00", drp("LunesSalida").ToString())) Exit Select Case 2 - Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Martes").ToString())) + Drow(0) = Boolean.Parse(If(IsNothing(drp), $"{(DiaDescanso <> diaSemana).ToString}", drp("Martes").ToString())) + 'Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Martes").ToString())) Drow(1) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("MartesEntrada").ToString())) Drow(2) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("MartesSalidaComida").ToString())) Drow(3) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("MartesEntradaComida").ToString())) Drow(4) = TimeSpan.Parse(If(IsNothing(drp), "09:00", drp("MartesSalida").ToString())) Exit Select Case 3 - Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Miercoles").ToString())) + Drow(0) = Boolean.Parse(If(IsNothing(drp), $"{(DiaDescanso <> diaSemana).ToString}", drp("Miercoles").ToString())) + 'Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Miercoles").ToString())) Drow(1) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("MiercolesEntrada").ToString())) Drow(2) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("MiercolesSalidaComida").ToString())) Drow(3) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("MiercolesEntradaComida").ToString())) Drow(4) = TimeSpan.Parse(If(IsNothing(drp), "09:00", drp("MiercolesSalida").ToString())) Exit Select Case 4 - Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Jueves").ToString())) + Drow(0) = Boolean.Parse(If(IsNothing(drp), $"{(DiaDescanso <> diaSemana).ToString}", drp("Jueves").ToString())) + 'Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Jueves").ToString())) Drow(1) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("JuevesEntrada").ToString())) Drow(2) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("JuevesSalidaComida").ToString())) Drow(3) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("JuevesEntradaComida").ToString())) Drow(4) = TimeSpan.Parse(If(IsNothing(drp), "09:00", drp("JuevesSalida").ToString())) Exit Select Case 5 - Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Viernes").ToString())) + Drow(0) = Boolean.Parse(If(IsNothing(drp), $"{(DiaDescanso <> diaSemana).ToString}", drp("Viernes").ToString())) + 'Drow(0) = Boolean.Parse(If(IsNothing(drp), "true", drp("Viernes").ToString())) Drow(1) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("ViernesEntrada").ToString())) Drow(2) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("ViernesSalidaComida").ToString())) Drow(3) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("ViernesEntradaComida").ToString())) Drow(4) = TimeSpan.Parse(If(IsNothing(drp), "09:00", drp("ViernesSalida").ToString())) Exit Select Case 6 - Drow(0) = Boolean.Parse(If(IsNothing(drp), "False", drp("Sabado").ToString())) + Drow(0) = Boolean.Parse(If(IsNothing(drp), $"{(DiaDescanso <> diaSemana).ToString}", drp("Sabado").ToString())) + 'Drow(0) = Boolean.Parse(If(IsNothing(drp), "False", drp("Sabado").ToString())) Drow(1) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("SabadoEntrada").ToString())) Drow(2) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("SabadoSalidaComida").ToString())) Drow(3) = TimeSpan.Parse(If(IsNothing(drp), "00:00", drp("SabadoEntradaComida").ToString())) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ed75d8147..d7c1d5273 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -18127,15 +18127,30 @@ Partial Class Ventas End If ' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR - If Not UsuarioActual.TienePermisoProceso(169) Then + If Not UsuarioActual.TienePermisoProceso(169) AndAlso RBLTipoVenta.SelectedValue.ToEntero <> 5 Then 'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") OrElse ((DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119)) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ped") And UsuarioActual.CveEmpresa.Contiene(186)))) Then Dim ObjInventarios As New ClsInventarios Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False) - Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), - CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, - RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla) + + + Dim Existencia As Decimal = 0D + ''CveAlamcenFiltroDdl + + If RBLTipoVenta.SelectedValue.ToEntero = 6 Then + Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlamcenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1, + CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=0, PendientePorSurtir:=1, + RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla) + Else + Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), + CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, + RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla) + End If + + + + Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal From ed3574f1bab202c76e3bd1614087050125849ca5 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 09:11:23 -0700 Subject: [PATCH 20/42] -- mejora en garantias --- App_Code/Modelos.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 56b3d1290..916eac813 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2303,7 +2303,7 @@ Namespace Modelos End If 'AJUSTES' - If DtAjustes IsNot Nothing AndAlso DtAjustes.Rows.Count > 0 Then + If DtAjustes IsNot Nothing AndAlso DtAjustes.FiltraParametros("CveVentaDetalle > 0").Rows.Count > 0 Then For Each Dr As DataRow In DtAjustes.Rows If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero, Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero, Dr("CodigoTD").ToString, Dr("TipoComprobante").ToString.ToEntero(), From 21592151a619331ca00930259ceb3dfdf390720d Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 09:11:36 -0700 Subject: [PATCH 21/42] =?UTF-8?q?--=20correcci=C3=B3=20de=20texto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsContabilidad.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 03a863762..86a7d6533 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1776,7 +1776,7 @@ Public Class ClsContabilidad SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al obtener lod datos de Concepto Contables.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al obtener los datos de Concepto Contables.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno @@ -1893,7 +1893,7 @@ Public Class ClsContabilidad SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al obtener lod datos de Concepto Contables.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al obtener los datos de Concepto Contables.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno From f980a9921e593625a22ca1d2ff1ed5fafc598a90 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 09:11:51 -0700 Subject: [PATCH 22/42] =?UTF-8?q?--=20redireccionamiento=20correcci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contabilidad/RegPoliza.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index 9ade722b9..d8e1ffc2b 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -153,7 +153,7 @@ Partial Class RegPoliza Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.LoadComplete If Not IsPostBack Then If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 Then - Response.Redirect("/Contabilidad2/RegPrePolizaS.aspx") + Response.Redirect("/Contabilidad/RegPrePolizaS.aspx") End If ViewState("Orden0") = "" From c7e7e682275f6778f600e1d8c4ff4516ec159fae Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 09:12:20 -0700 Subject: [PATCH 23/42] =?UTF-8?q?--=20manejo=20de=20garant=C3=ADa,=20que?= =?UTF-8?q?=20tengan=20un=20centavo=20de=20diferencia,=20para=20el=20tema?= =?UTF-8?q?=20de=20timbrado=20objetoimpuesto=3D02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/PV.aspx.vb | 62 ++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index dcf8f8b3d..29ad9b268 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -7378,50 +7378,56 @@ Partial Class PV Dim strDate As Date = ($"20{TxtEtiqueta.Text.Substring(2, 2)}/{TxtEtiqueta.Text.Substring(0, 2)}/01").ToDate Dim drg As DataRow = dtt.FiltroPrimero($" #{strDate.ToString("yyyy/MM/dd")}# >= FechaInicioVigencia ", "FechaInicioVigencia DESC") If drg IsNot Nothing Then - - TxtPorcentajeAjuste.Text = (drg("Valor").ToString.ToDouble / 100).ToString + Dim PorcentajeAjuste As Decimal = drg("Valor").ToString.ToDecimal + TxtPorcentajeAjuste.Text = (PorcentajeAjuste / 100).ToString TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero ImportePagarCliente = TxtImporteAjuste.Text.ToDecimal + ''ajustar un centavo + If PorcentajeAjuste = 0 Then 'PONE UN PAGO DE UN CENTAVO, PARA EL TIMBRADO + ' TxtImporteAjuste.Text = (TxtImporteAjuste.Text.ToDecimal - 0.01D).FormatoNumero + TxtImporteAjuste.Text = "0.01" + End If + Dim CargoVendido As Decimal = 0 - Dim CargoGarantia As Decimal = 0 + Dim CargoGarantia As Decimal = 0 Dim CveTamaño As Integer = 0 If DdlPSAjuste.SelectedValue.ToEntero > 0 Then - Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimero("") - If Dr IsNot Nothing Then - CargoGarantia = Dr("Cargo").ToString.ToDecimal + Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimero("") + If Dr IsNot Nothing Then + CargoGarantia = Dr("Cargo").ToString.ToDecimal + End If End If - End If - If DdlPS.SelectedValue.ToEntero > 0 Then - Dim Dr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("") - If Dr IsNot Nothing Then - CveTamaño = Dr("CveTamaño").ToString.ToEntero + If DdlPS.SelectedValue.ToEntero > 0 Then + Dim Dr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("") + If Dr IsNot Nothing Then + CveTamaño = Dr("CveTamaño").ToString.ToEntero + End If End If - End If - Dim DrCargo As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CveTamaño = {CveTamaño}") - If DrCargo IsNot Nothing Then + Dim DrCargo As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CveTamaño = {CveTamaño}") + If DrCargo IsNot Nothing Then - CargoVendido = DrCargo("Cargo").ToString.ToDecimal + CargoVendido = DrCargo("Cargo").ToString.ToDecimal - End If + End If - 'el ajuste no puede ser mayor al precio de lo vendido de nuevo - If (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))) < 0 Then + 'el ajuste no puede ser mayor al precio de lo vendido de nuevo + If (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))) < 0 Then - TxtImporteAjuste.Text = "0.00" - CargoGarantia = CargoVendido - ImportePagarCliente = 0 - End If - ImportePagarCliente = (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))).ToDecimal + TxtImporteAjuste.Text = "0.00" + CargoGarantia = CargoVendido + ImportePagarCliente = 0 + End If + ImportePagarCliente = (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))).ToDecimal - TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}." - TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero - 'TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero - Else - Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia) + TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}." + TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero + 'TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero + Else + Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia) 'cuando no está registrada, no da ajuste TxtImporteAjuste.ToolTip = "El producto no tiene ajuste en ese periodo" TxtImporteAjuste.Text = "0.00" From dade1b7ac4440a30c1fc09d7c26c37572d23c914 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 09:12:50 -0700 Subject: [PATCH 24/42] =?UTF-8?q?--=20mejora=20en=20acomodo=20de=20informa?= =?UTF-8?q?ci=C3=B3n=20de=20correos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sistemas/DefinicionEmpresa.aspx | 57 ++++++++++++++++----------------- Sistemas/Empresa.aspx | 24 +++++++------- Sistemas/Empresa.aspx.vb | 3 +- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Sistemas/DefinicionEmpresa.aspx b/Sistemas/DefinicionEmpresa.aspx index 741dd2086..96eb85e2f 100644 --- a/Sistemas/DefinicionEmpresa.aspx +++ b/Sistemas/DefinicionEmpresa.aspx @@ -414,7 +414,7 @@
    - Recepción de Correos + Envío de Correos
    @@ -464,20 +464,6 @@
    - -
    -
    - - - - - - - -
    -
    - -
    @@ -495,7 +481,7 @@
    - Envío de Correos + Recepción de Correos
    @@ -528,20 +514,33 @@
    -
    + +
    - - - - -
    -
    -
    -
    - - -
    -
    + + + + + + + +
    +
    +
    +
    + + + + +
    +
    +
    +
    + + +
    +
    +
    diff --git a/Sistemas/Empresa.aspx b/Sistemas/Empresa.aspx index 38b124da9..97f0d7354 100644 --- a/Sistemas/Empresa.aspx +++ b/Sistemas/Empresa.aspx @@ -546,7 +546,7 @@
    - Recepción de Correos + Envío de Correos
    @@ -583,16 +583,7 @@ - - - Protocolo: - - - - - - - + SSL: @@ -606,7 +597,7 @@
    - Envío de Correos + Recepción de Correos
    @@ -632,6 +623,15 @@ + + Protocolo: + + + + + + + Puerto: diff --git a/Sistemas/Empresa.aspx.vb b/Sistemas/Empresa.aspx.vb index fc997687c..9c40b1774 100644 --- a/Sistemas/Empresa.aspx.vb +++ b/Sistemas/Empresa.aspx.vb @@ -277,6 +277,7 @@ Partial Class Sistemas_Empresa TxtMailSoporte.Text = .Soporte_Mail TxtServidorSoporte.Text = .Soporte_Server TxtPuertoSoporte.Text = .Soporte_Puerto.ToString + DdlProtocolo.Text = .Buzon_Tipo ChkSSLSoporte.Checked = .Soporte_SSL TxtUsuarioSoporte.Text = .Soporte_USR DdlProtocoloSoporte.SelectedValue = .Soporte_Tipo @@ -311,7 +312,7 @@ Partial Class Sistemas_Empresa 'NUEVOS TxtAreaGeografica.Text = .AreaGeografica - DdlProtocolo.Text = .Buzon_Tipo + 'Fiel LblPfx.Text = .FielPFX From c9767352a0c17356b6fe938942169b3333bc70af Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 09:14:22 -0700 Subject: [PATCH 25/42] =?UTF-8?q?--=20manejo=20de=20centavo=20para=20tema?= =?UTF-8?q?=20de=20garant=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d40ab3a28..cd845a3a1 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14957,10 +14957,17 @@ Partial Class Ventas CveVentaAplicar = CveDevolucion CveVentaAmortizacionAplicar = ObjFactura.CveVenta End If + 'verifico que el AF, tenga valores iguales cuando esté vacío o "-1" + Dim drs As DataRow() = TmpDTDetalle.Select(" CveActivoFijo IS NULL") + For Each dr As DataRow In drs + dr("CveActivoFijo") = "-1" + Next + TmpDTDetalle.AcceptChanges() DT = TmpDTDetalle.FiltraParametros($"CvePS <> {CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA", "CveActivoFijo"}) If DT.Rows.Count > 0 Then + 'Se agrega movimiento separado por la cuenta de ventas (ER) For Each Row2 As DataRow In DT.Rows importeMovimiento = (TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1} AND PorcentajeIVA = {2} AND ISNULL(CveActivoFijo,-1) = {3}", Row2("CveClasificacion"), Row2("CveSubProyecto"), Row2("PorcentajeIVA"), If(Row2("CveActivoFijo").ToString().ToEntero() > 0, Row2("CveActivoFijo").ToString().ToEntero(), -1))).ToString().ToDecimal()) * ValorMultiplicador @@ -23276,7 +23283,12 @@ Partial Class Ventas 'VALIDA PAGOS EN FACTURAS DE ING,ANT NUEVAS O FACTURACION DE REM O COTIZACIONES If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso RBLPago.SelectedValue = "2" AndAlso ((CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant")) OrElse TipoDoctoViejo.Contiene("Rem", "Cot")) Then - + Dim TotalPagadoGarantia As Decimal = 0 + If TxtTotal.Text.ToDecimal = 0.01 AndAlso Me.EsGarantia = True Then + TotalPagadoGarantia = 0.01D + TienePagos = True + ViewState("SaldoVenta") = SaldoVenta - TotalPagadoGarantia + End If If Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then If MostrarAlertas Then Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) @@ -23294,7 +23306,7 @@ Partial Class Ventas Dim TotalRNC As Decimal = If((ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) OrElse (ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0), LblDescuentosRNC.Text.Trim().ToDecimal(), 0) Dim ImporteTotal As Decimal = (TxtTotal.Text.ToDecimal).RoundSQL(2) - Dim TotalPagado As Decimal = (TotalPagoContado + TotalRNC + TotalProntoPago).RoundSQL(2) + Dim TotalPagado As Decimal = (TotalPagoContado + TotalRNC + TotalProntoPago + TotalPagadoGarantia).RoundSQL(2) If TotalPagado <> ImporteTotal Then If MostrarAlertas Then @@ -23316,10 +23328,7 @@ Partial Class Ventas Return Retorno End If End If - - End If - End If 'SI TIENE SALDO PENDIENTE VALIDA SI TIENE PAGOS From 8f340f55172d5aa0379cd42ad470f33dd7045ac5 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 11:47:10 -0700 Subject: [PATCH 26/42] - --- Planeacion/CatSubProyectos.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index 3df377a95..959ac61db 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -93,7 +93,7 @@ Partial Class CatSubProyectos End If BtnGuardar.OnClientClick = $"ValidaGuardar();" - If UsuarioActual.Empresa.Funcionalidad(404) = "20" Then + If UsuarioActual.Empresa.Funcionalidad(404).Contiene("10", "20") Then DVModalPrecioLista.Visible = True End If From 4d9f4f0d19bf08f4799180bd855759e8994d3706 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 14:52:56 -0700 Subject: [PATCH 27/42] - vista --- RH/RepChecadorPreAsistencia.aspx | 12 ++++++------ RH/RepChecadorPreAsistencia.aspx.vb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/RH/RepChecadorPreAsistencia.aspx b/RH/RepChecadorPreAsistencia.aspx index e20f1db0b..f8612603b 100644 --- a/RH/RepChecadorPreAsistencia.aspx +++ b/RH/RepChecadorPreAsistencia.aspx @@ -35,11 +35,11 @@
    • Tipo Periodo: - +
    • Periodo: - +
    • <%--
    • Fecha Inicio: @@ -73,18 +73,18 @@
    • --%>
    • SubProyecto: - +
    • Turno: - +
    • Checador - +
    • Lista Asistencia - +
    diff --git a/RH/RepChecadorPreAsistencia.aspx.vb b/RH/RepChecadorPreAsistencia.aspx.vb index 685d93bec..7885505c1 100644 --- a/RH/RepChecadorPreAsistencia.aspx.vb +++ b/RH/RepChecadorPreAsistencia.aspx.vb @@ -154,7 +154,7 @@ Partial Class RH_RepChecadorPreAsistencia objNom.Dispose() DdlTipoPeriodo.DataBind() - DdlTipoPeriodo.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + DdlTipoPeriodo.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlTurno.DataSource = GlobalDTTurno(UsuarioActual.CveEmpresa) DdlTurno.DataBind() From d00230813d4361b6586443d59c44e669d2507351 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 15:18:50 -0700 Subject: [PATCH 28/42] --filtrado de almacen --- Acumuladores/RepRecolecciones.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Acumuladores/RepRecolecciones.aspx.vb b/Acumuladores/RepRecolecciones.aspx.vb index 0fd8d43d1..aa2843c47 100644 --- a/Acumuladores/RepRecolecciones.aspx.vb +++ b/Acumuladores/RepRecolecciones.aspx.vb @@ -62,7 +62,7 @@ Partial Class Acumuladores_RepRecolecciones CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (4)") DdlAlmacenOrigen.DataBind() - DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22) and Almacen like '%sado%'") + DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22) and Almacen like '%sado%' and CveAlmacen IN (449,616,628)") ' alm,. matriz,nav,obr recep sados DdlAlmacenDestino.DataBind() End Sub From 9182e4c09197af7aa8396797282f145b1d97a078 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Sun, 3 Mar 2024 10:31:56 -0700 Subject: [PATCH 29/42] RepChecadorPreAsistencia Correciones --- RH/RepChecadorPreAsistencia.aspx.vb | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/RH/RepChecadorPreAsistencia.aspx.vb b/RH/RepChecadorPreAsistencia.aspx.vb index 7885505c1..636d3956a 100644 --- a/RH/RepChecadorPreAsistencia.aspx.vb +++ b/RH/RepChecadorPreAsistencia.aspx.vb @@ -359,7 +359,19 @@ Partial Class RH_RepChecadorPreAsistencia FiltroSubProyecto = $" CveTipoPeriodo = {DdlTipoPeriodo.SelectedValue } {filtroturno} " End If - DtPersonal = GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto) + 'DtPersonal = GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto) + + Dim DtTempPeriodo As DataTable = DTPeridos.FiltraParametros("CvePeriodo = " & DdlRango.SelectedValue.ToEntero) + Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate + + Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto).AsEnumerable() + Let Inicio = fila.Field(Of Date)("FechaInicio") + Let FechaFinOriginal = fila.Field(Of Date?)("FechaFin") + Let FechaFin = If(FechaFinOriginal.HasValue, FechaFinOriginal.Value, Now) + Where Inicio <= FechaInicioPeriodoFiltro AndAlso FechaInicioPeriodoFiltro <= FechaFin + Select fila + + DtPersonal = FilasFiltradas.CopyToDataTable() If objRH.ChecadorHorariosGet(-1, 1, UsuarioActual.Empresa.CveEmpresa) Then DTHorarios = objRH.DtResultados @@ -992,6 +1004,18 @@ Partial Class RH_RepChecadorPreAsistencia DTAsistenciasInasistencias = objRH.DtResultados End If + Dim DtTempPeriodo As DataTable = DTPeridos.FiltraParametros("CvePeriodo = " & DdlRango.SelectedValue.ToEntero) + Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate + + Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros($" CveTipoPeriodo = { DdlTipoPeriodo.SelectedValue} AND CveEstado = 1 " & If(DdlTurno.SelectedValue = "-1", "", $" AND CveTurno = {DdlTurno.SelectedValue}")).AsEnumerable() + Let Inicio = fila.Field(Of Date)("FechaInicio") + Let FechaFinOriginal = fila.Field(Of Date?)("FechaFin") + Let FechaFin = If(FechaFinOriginal.HasValue, FechaFinOriginal.Value, Now) + Where Inicio <= FechaInicioPeriodoFiltro AndAlso FechaInicioPeriodoFiltro <= FechaFin + Select fila + + 'DtPersonal = FilasFiltradas.CopyToDataTable() + DtPersonal = GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros($" CveTipoPeriodo = { DdlTipoPeriodo.SelectedValue} AND CveEstado = 1 " & If(DdlTurno.SelectedValue = "-1", "", $" AND CveTurno = {DdlTurno.SelectedValue}")) dt.Columns.Add("CvePersonal") From c0901efc61d865ca5bb157b4e9bb6ca2c4c2de0f Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Mar 2024 11:17:50 -0700 Subject: [PATCH 30/42] --- globaldttipoventas --- Sistemas/CatSesiones.aspx.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index b024433df..ef6bbf838 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -267,6 +267,7 @@ Partial Class Sistemas_CatSesiones If ObjVentas.GetCondicionesEntrega(-1) Then Application("GlobalDTVtaCondicionesEntrega") = ObjVentas.DtResultados Else Application("GlobalDTVtaCondicionesEntrega") = Nothing ObjVentas.Dispose() + GlobalDTTipoVenta(-1) = Nothing End Sub Private Sub CargaProductosServicios() From bc44998bb25a223b9e10f9d2674ecd6fb269b0dc Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 4 Mar 2024 18:13:21 -0700 Subject: [PATCH 31/42] --Ferretera. Mostrar total con impuestos --- Ventas/Ventas.aspx | 2 +- Ventas/Ventas.aspx.vb | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 25bdaabd5..5a677a9e8 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1386,7 +1386,7 @@ <%--16--%> - + <%--17--%> diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ed75d8147..dfdc87632 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -8835,6 +8835,7 @@ Partial Class Ventas TmpDT.Rows(e.RowIndex)("Descuento") = ObjDescuento.ImporteDescuento TmpDT.Rows(e.RowIndex)("Total") = (Cantidad * PU) TmpDT.Rows(e.RowIndex)("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales) + TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) @@ -8844,6 +8845,8 @@ Partial Class Ventas TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial + TmpDT.Rows(e.RowIndex)("TotalConImpuestos") = (TmpDT.Rows(e.RowIndex)("Total").ToString().ToDecimal() - TmpDT.Rows(e.RowIndex)("Descuento").ToString().ToDecimal() + TmpDT.Rows(e.RowIndex)("ImporteIVA").ToString().ToDecimal()).RoundSQL(2) + Dim NumTurnos As Decimal = 0 If UsuarioActual.CveEmpresa.Contiene(7, 122) Then NumTurnos = GvPS.Rows(e.RowIndex).FCTextBox("TxtNumTurnosEditar").Text.ToDecimal() @@ -16646,6 +16649,7 @@ Partial Class Ventas dr("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) dr("PorcentajeRetIVA") = ClienteRetIVA dr("PorcentajeRetISR") = ClienteRetISR + dr("TotalConImpuestos") = (dr("Total").ToString().ToDecimal() - dr("Descuento").ToString().ToDecimal() + dr("ImporteIVA").ToString().ToDecimal()).RoundSQL(2) Next @@ -18929,6 +18933,8 @@ Partial Class Ventas Row("CvePromocionDetalle") = CvePromocionDetalle Row("Total") = (Cantidad * PU) Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales) + Row("TotalConImpuestos") = (Row("Total").ToString().ToDecimal() - Row("Descuento").ToString().ToDecimal() + Row("ImporteIVA").ToString().ToDecimal()).RoundSQL(2) + Row("SATClaveProdServ") = DrPS("SATClavePS") Row("SATClaveUM") = DrPS("SATClaveUnidadMedida") @@ -19097,6 +19103,7 @@ Partial Class Ventas DrPoliza("TipoDescuento") = HdnTipoDescuento.Value DrPoliza("Total") = (DrPoliza("Cantidad").ToString().ToDecimal * PU) DrPoliza("TotalImporte") = (DrPoliza("Cantidad").ToString().ToDecimal * PU).RoundSQL(NumeroDecimales) + DrPoliza("TotalConImpuestos") = (DrPoliza("Total").ToString().ToDecimal() - DrPoliza("Descuento").ToString().ToDecimal() + DrPoliza("ImporteIVA").ToString().ToDecimal()).RoundSQL(2) DrPoliza("SATClaveProdServ") = DrPSAdicional("SATClavePS") DrPoliza("SATClaveUM") = DrPSAdicional("SATClaveUnidadMedida") DrPoliza("CveActivoFijo") = -1 @@ -19234,6 +19241,8 @@ Partial Class Ventas 'USO PARA COMERCIO EXTERIOR TmpDT.Columns.Add("CantidadConversion", GetType(Decimal)) TmpDT.Columns("CantidadConversion").DefaultValue = 0 + + TmpDT.Columns.Add("TotalConImpuestos", GetType(Decimal)) End Sub Private Sub CreaDTmpC() DTmpC = New DataTable @@ -29747,7 +29756,7 @@ Partial Class Ventas Row("Descuento") = Math.Round(Descuento, NumeroDecimales) Row("Total") = Math.Round(Total, NumeroDecimales) Row("TotalImporte") = Math.Round(Total, NumeroDecimales) - + Row("TotalConImpuestos") = (Row("Total").ToString().ToDecimal() - Row("Descuento").ToString().ToDecimal() + Row("ImporteIVA").ToString().ToDecimal()).RoundSQL(2) Row("Serie") = Serie Row("TiempoEntrega") = TiempoEntrega @@ -34715,6 +34724,7 @@ Partial Class Ventas Row("Descuento") = Math.Round(Descuento, 2) Row("Total") = Math.Round(Total, 2) Row("TotalImporte") = Math.Round(Total, 2) + Row("TotalConImpuestos") = (Row("Total").ToString().ToDecimal() - Row("Descuento").ToString().ToDecimal() + Row("ImporteIVA").ToString().ToDecimal()).RoundSQL(2) Row("Serie") = Serie Row("TiempoEntrega") = TiempoEntrega @@ -37454,6 +37464,7 @@ Partial Class Ventas Row("Descuento") = (ObjDescuento.ImporteDescuento).RoundSQL(NumeroDecimales) Row("Total") = (Cantidad * PU) Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales) + Row("TotalConImpuestos") = (Row("Total").ToString().ToDecimal() - Row("Descuento").ToString().ToDecimal() + Row("ImporteIVA").ToString().ToDecimal()).RoundSQL(2) End If Next From 57664c8a9d4b0d3161ef46b4ba9fc2f48d3ccb75 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 4 Mar 2024 18:14:57 -0700 Subject: [PATCH 32/42] --Impresion de libro diario --- Contabilidad2/RepLibroDiario.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contabilidad2/RepLibroDiario.aspx.vb b/Contabilidad2/RepLibroDiario.aspx.vb index 425085a8f..0f488f8de 100644 --- a/Contabilidad2/RepLibroDiario.aspx.vb +++ b/Contabilidad2/RepLibroDiario.aspx.vb @@ -180,7 +180,7 @@ Partial Class Contabilidad2_RepLibroDiario lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre)) lista.Add(New CrystalParametro("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) - ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/LibroDiario.rpt"), DtDatos, lista, "LibroDiario", Formato), "LibroDiario", Formato) + ImprimirbytesPDF(ImprimirPDFCrystal(DirectorioEmpresas + "\Grales\Formatos\LibroDiario.rpt", DtDatos, lista, "LibroDiario", Formato), "LibroDiario", Formato) End Sub #End Region End Class From a4b8095761de82d31d832fb2947d6b8eecb2924e Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 4 Mar 2024 18:15:47 -0700 Subject: [PATCH 33/42] --Total en 0 si el total es 1 centavo --- Empresas/140/Formatos/Factura.rdlc | 4 ++-- Empresas/140/Formatos/Remision.rdlc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Empresas/140/Formatos/Factura.rdlc b/Empresas/140/Formatos/Factura.rdlc index 495426efa..90554a4fd 100644 --- a/Empresas/140/Formatos/Factura.rdlc +++ b/Empresas/140/Formatos/Factura.rdlc @@ -2321,7 +2321,7 @@ - =Fields!Importe.Value + =IIf(Fields!Importe.Value = 0.01 ,0.00,Fields!Importe.Value) - 21.0638cm + 21.06381cm 0.5327cm diff --git a/Empresas/140/Formatos/Remision.rdlc b/Empresas/140/Formatos/Remision.rdlc index d6b8d4dd0..f3ae0410a 100644 --- a/Empresas/140/Formatos/Remision.rdlc +++ b/Empresas/140/Formatos/Remision.rdlc @@ -1677,7 +1677,7 @@ - =Fields!Importe.Value + =IIf(Fields!Importe.Value = 0.01 ,0.00,Fields!Importe.Value)