From 15c760b72840c33bb04b33691ab9241faea21e2a Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 8 Feb 2021 09:03:48 -0700 Subject: [PATCH 01/11] --- App_Code/CFDITimbre.vb | 5 +++++ App_Code/LogicNominas.vb | 25 ++++++++++++++++++------- App_Code/Timbrado.vb | 18 ++++++++++++------ RH/Personal.aspx.vb | 13 ++++++++++--- 4 files changed, 45 insertions(+), 16 deletions(-) diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index a9509a624..4648e11e5 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -365,6 +365,11 @@ Public Class CFDINominaOtrosPagos Public Property Concepto As String Public Property Importe As Decimal Public Property Subsidiocausado As Decimal + Public Property RemanenteSalFav As Decimal + Public Property ejercicio As Integer + Public Property SaldoAFavor As Integer + + End Class diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 430dc0473..c8fd108b0 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -145,8 +145,17 @@ Public Class LogicNominas If continuar AndAlso objNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then If objNomina.DtResultados.Rows.Count > 0 Then DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 AND SoloVisible =0") - DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 AND SoloVisible =0") + DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 AND SoloVisible =0 AND (TipoConceptoSAT<>'O' OR TipoConceptoSAT IS NULL)") DtOtrosPagos = objNomina.DtResultados.FiltraParametros(" TipoConceptoSAT='O'") + Dim disrcomp As DataRow = DtOtrosPagos.FiltroPrimero("Codigo ='D999'") + For Each drow As DataRow In DtDeducciones.Rows + If drow("Codigo").ToString() = "D038" Then + + End If + Next + + + TotalPercepciones = DtPercepciones.SUM("Importe").ToString().ToDecimal() TotalDeducciones = DtDeducciones.SUM("Importe").ToString().ToDecimal() Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal) @@ -230,7 +239,7 @@ Public Class LogicNominas .ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()}) End If 'RMF, falta poner el numero de horas pagadas - If Row("CveSATConcepto").ToString().ToEntero() = 19 AndAlso DtHorasExtras IsNot Nothing Then 'cuando son horas extras + If Row("SATCveConcepto").ToString().ToEntero() = 19 AndAlso DtHorasExtras IsNot Nothing Then 'cuando son horas extras 'Obtengo el desglose de horas extras Dim dr As DataRow = DtHorasExtras.FiltroPrimero("") If dr IsNot Nothing Then @@ -256,7 +265,7 @@ Public Class LogicNominas ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()}) - ElseIf Row("Importe").ToString().ToDecimal() < 0 AndAlso Row("Concepto").ToString() = "Ajuste al neto" Then + ElseIf Row("Importe").ToString().ToDecimal() < 0 AndAlso Row("Concepto").ToString() = "Ajuste al neto" Then ' corregir ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "999", .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal() * -1}) Else @@ -279,12 +288,14 @@ Public Class LogicNominas If DtOtrosPagos IsNot Nothing AndAlso DtOtrosPagos.Rows.Count > 0 Then For Each Row As DataRow In DtOtrosPagos.Rows - If (Row("Importe").ToString().ToDecimal() > 0) OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 2 AndAlso Row("Importe").ToString().ToDecimal() < 0) Then + If (Row("Importe").ToString().ToDecimal() > 0) OrElse + (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 2 AndAlso (CveRegimenContratacion.ToEntero() = 2 OrElse Row("Importe").ToString().ToDecimal() <> 0)) OrElse + (Row("SATCveConcepto").ToString().ToEntero().ToEntero().Contiene(2, 4) AndAlso Row("Importe").ToString().ToDecimal() < 0) Then If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For - - ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), - .Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteGravado").ToString().ToDecimal().Abs()}) + Dim otrp = New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), + .Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteGravado").ToString().ToDecimal().Abs()} + ObjOtrosPagos.Add(otrp) If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 7 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index bed33b7e6..26418aaed 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -1987,7 +1987,7 @@ Public Class Timbrado 'cfdi.Esquema.AgregarEsquema("http://www.sat.gob.mx/nomina12 http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xsd") cfdi.Nomina12(ObjCFDITimbre.Nomina.TipoNomina, ObjCFDITimbre.Nomina.FechaPago.ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaInicio.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaFin.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.NumDiasPagados, If(ObjCFDITimbre.Nomina.Percepciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Percepciones.Count > 0, ObjCFDITimbre.Nomina.TotalPercepciones, 0), If(ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0, ObjCFDITimbre.Nomina.TotalDeducciones, 0), If(ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing AndAlso ObjCFDITimbre.Nomina.OtrosPagos.Count > 0, ObjCFDITimbre.Nomina.TotalOtrosPagos, 0)) - cfdi.Nomina12Emisor(ObjCFDITimbre.Emisor.CURP, If(ObjCFDITimbre.Nomina.Receptor.TipoContrato = "99", "", ObjCFDITimbre.Emisor.RegistroPatronal), ObjCFDITimbre.Emisor.RFC) + cfdi.Nomina12Emisor(ObjCFDITimbre.Emisor.CURP, If(ObjCFDITimbre.Nomina.Receptor.TipoContrato.Contiene("09", "10", "99"), "", ObjCFDITimbre.Emisor.RegistroPatronal), ObjCFDITimbre.Emisor.RFC) If UsuarioActual.Empresa.UsaAC Then cfdi.Nomina12EntidadSNCF("IF", 90) @@ -2029,6 +2029,11 @@ Public Class Timbrado Next End If + If ObjCFDITimbre.Nomina.HorasExtras IsNot Nothing AndAlso ObjCFDITimbre.Nomina.HorasExtras.Count > 0 Then + For Each HoraExtra As CFDINominaHorasExtras In ObjCFDITimbre.Nomina.HorasExtras + cfdi.Nomina12HorasExtra(HoraExtra.Dias.ToEntero, HoraExtra.TipoHoras, HoraExtra.HorasExtra, HoraExtra.ImportePagado) + Next + End If 'deducciones al final If ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0 Then cfdi.Nomina12Deducciones(ObjCFDITimbre.Nomina.TotalDeduccionesOtras, Math.Round(ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos, 2)) @@ -2037,11 +2042,6 @@ Public Class Timbrado Next End If - If ObjCFDITimbre.Nomina.HorasExtras IsNot Nothing AndAlso ObjCFDITimbre.Nomina.HorasExtras.Count > 0 Then - For Each HoraExtra As CFDINominaHorasExtras In ObjCFDITimbre.Nomina.HorasExtras - cfdi.Nomina12HorasExtra(HoraExtra.Dias.ToEntero, HoraExtra.TipoHoras, HoraExtra.HorasExtra, HoraExtra.ImportePagado) - Next - End If If ObjCFDITimbre.Nomina.Incapacidades IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Incapacidades.Count > 0 Then For Each Incap As CFDINominaIncapacidades In ObjCFDITimbre.Nomina.Incapacidades @@ -2059,6 +2059,12 @@ Public Class Timbrado cfdi.Nomina12SubsidioAlEmpleo(otpag.Subsidiocausado) End If + If otpag.TipoOtroPago = "004" AndAlso otpag.Importe > 0 Then + If otpag.ejercicio > 0 Then + cfdi.CompensacionSaldosAFavor(otpag.Importe, otpag.ejercicio, otpag.RemanenteSalFav) 'otpag.SaldoAFavor + End If + End If + Next End If End If diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 55f7be7e1..ccf42b83d 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -1172,8 +1172,14 @@ Partial Class RH_Personal DdlMetodoPago.DataBind() End Sub - Private Sub CargaTipoRegimen() - DdlRegimenContratacion.DataSource = GlobalDTNomSatRegimenContratacion + Private Sub CargaTipoRegimen() + Dim dt As DataTable = GlobalDTNomSatRegimenContratacion.Copy() + For Each item As DataRow In dt.Rows + item("RegimenContratacion") = String.Format("{1}{0} {2}", item("CveSATRegimenContratacion"), If(item("CveSATRegimenContratacion").ToString().Length > 1, "", "0"), item("RegimenContratacion")) + Next + dt.AcceptChanges() + + DdlRegimenContratacion.DataSource = dt.FiltraParametros("", "RegimenContratacion") DdlRegimenContratacion.DataBind() End Sub @@ -1365,7 +1371,8 @@ Partial Class RH_Personal CHKRFCValidado.Checked = drow("RFCValidado").ToString() = "1" TxtMailrecibonomina.Text = drow("MaiReciboNomina").ToString() 'Carga Datos Personales - LtlPersonal.Text = ObjPersonal.NombreCompleto + + LtlPersonal.Text = String.Format("{0} - {1}", ObjPersonal.Codigo, ObjPersonal.NombreCompleto) NombreCompleto = ObjPersonal.NombreCompleto 'TxtNombre.Text = ObjPersonal.Nombre TxtAPaterno.Text = ObjPersonal.APaterno From 4a55c65abfe735b489ab1bf6ff7726e521955432 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:49:20 -0700 Subject: [PATCH 02/11] Refacturacion de anticipos --- App_Code/ClsVentas.vb | 3 ++- App_Code/Modelos.vb | 8 ++++++-- Ventas/Ventas.aspx.vb | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index a4b949dfd..391461856 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4202,13 +4202,14 @@ Public Class ClsVentas Return retorno End Function - Public Function TraspasaVentasAplicadasAnt(CveVentaNueva As Integer, CveVentaAnterior As Integer, CveEmpresa As Integer) As Boolean + Public Function TraspasaVentasAplicadasAnt(CveVentaNueva As Integer, CveVentaAnterior As Integer, CveEmpresa As Integer, CvePrePoliza As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Vta_TraspasaVentasAplicadasAnt", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveVentaNueva", SqlDbType.Int).Value = CveVentaNueva .Add("@CveVentaAnterior", SqlDbType.Int).Value = CveVentaAnterior .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 09b93ff06..2e54a07c1 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2652,7 +2652,7 @@ Namespace Modelos Case 11 'Anticipo '[IPP] SI ES REFACTURACION LOS ANTICIPOS NO LOS DEBE APLICAR EN EL INGRESO REFACTURADO (VIEJO) - If NuevaFactura = 1 And ObjFactura.CveVenta = CveDevolucion Then + If CveEstatusRefacturacion > 0 Then Exit Select End If @@ -4458,6 +4458,10 @@ Namespace Modelos Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion) + If Not EsRefacturacion Then + CveEstatusRefacturacion = 0 + End If + Dim CancelacionFecha As Date Dim FolioFiscal As String = ObjFactura.FolioFiscal Dim CancelacionAcuse As String = "" @@ -4485,7 +4489,7 @@ Namespace Modelos If CveEstatusFacturaAsignado <= 0 Then Try - If ObjFactura.FolioFiscal <> "" Then + If ObjFactura.FolioFiscal <> "" AndAlso UsuarioActual.Empresa.FacturaProduccion Then If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then 'VERIFICA SI DEBE VALIDAR ANTE EL SAT diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1fc29203d..119df860e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12728,7 +12728,7 @@ Partial Class Ventas 'EN CASO DE SER REFACTURACION DE ANTICIPO SE ACTUALIZAN LAS VENTAS APLICADAS HACIA EL NUEVO If NuevaFactura = 1 AndAlso CveDevolucion > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ant") Then - If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa) Then + If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa, ObjFactura.CvePrePoliza) Then ErrorPrepoliza = True End If End If @@ -26625,6 +26625,7 @@ Partial Class Ventas If Not DtCotizaciones.Columns.Contains("Aplicado") Then DtCotizaciones.Columns.Add("Aplicado", Type.GetType("System.Boolean")) End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0 AND EsAcumulador = False") Else @@ -26699,6 +26700,7 @@ Partial Class Ventas CotizacionesLista.Add(row("CveVenta").ToString().ToEntero()) Next + 'CARGA LOS USADOS RELACIONADOS A LOS PRODUCTOS SELECCIONADOS DE LA COTIZACION If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones) End If From 08cab5526a838ef53a7a0590219cd7792fd38f91 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:51:50 -0700 Subject: [PATCH 03/11] Empresa de notificaciones para GPS --- App_Code/ClsPaginas.vb | 2 ++ App_Code/ClsSisNotificaciones.vb | 2 +- Global.asax | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ec50c30d6..ba7d8f608 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -36,6 +36,8 @@ Public Class ClsPaginas Public Shared Property EmpresaNotificaciones() As Empresa + Public Shared Property EmpresaNotificacionesGPS() As Empresa + Public ReadOnly Property EsProduccion As Boolean diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb index b63c12e88..be0a9a61e 100644 --- a/App_Code/ClsSisNotificaciones.vb +++ b/App_Code/ClsSisNotificaciones.vb @@ -221,7 +221,7 @@ Public Class ClsSisNotificaciones Try Dim ResultadoMail As Integer = 0 Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) - If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Mail, Asunto, Cuerpo, MailCC, LSRutasMail) Then + If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Mail, Asunto, Cuerpo, MailCC, LSRutasMail) Then ObjNotificacion.UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1) End If Catch ex As Exception diff --git a/Global.asax b/Global.asax index f0d2b275e..11258feff 100644 --- a/Global.asax +++ b/Global.asax @@ -620,6 +620,9 @@ Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "sig123987", .SendMailServer = "mail.adssistemas.mx", .SendMailPuerto = 587} ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones + Dim EmpresaNotificacionesGPS As New Empresa With {.SendMail = "ALERTAS@SIGNALSGPS.com", .SendMailPassword = "STJ180705IV42021ad", .SendMailServer = "mail.signalsgps.com", .SendMailPuerto = 587} + ClsPaginas.EmpresaNotificacionesGPS = EmpresaNotificacionesGPS + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'I M P U E S T O S L O C A L E S From 27a32d5d6dc9b77f765e0415301b7c2ae2e4d530 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:52:31 -0700 Subject: [PATCH 04/11] =?UTF-8?q?BDH.=20Generaci=C3=B3n=20de=20txt=20en=20?= =?UTF-8?q?Reporte=20de=20Ajustes/Garantia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Acumuladores/CatFoliosGarantia.aspx | 9 +++-- Acumuladores/CatFoliosGarantia.aspx.vb | 50 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index 81001388a..5ca6a7a2a 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -385,12 +385,13 @@
- + - + @@ -408,9 +409,13 @@
diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb index 9172d5c1e..512e7e593 100644 --- a/Acumuladores/CatFoliosGarantia.aspx.vb +++ b/Acumuladores/CatFoliosGarantia.aspx.vb @@ -255,4 +255,54 @@ Partial Class Acumuladores_CatFoliosGarantia Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) End Sub + Protected Sub BtnGenerarTxt_Click(sender As Object, e As EventArgs) + Dim SbTxt As New StringBuilder + + For Each GvRow As GridViewRow In GvGarantiasDetalle.Rows + If GvRow.RowType = DataControlRowType.DataRow Then + '1.- Consecutivo Partida-->1 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("Consecutivo")) + '2.- Cliente-->100407 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoCliente")) + '3. Codigo De Articulo --> 171402 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoProducto")) + '4. Tipo De Uso --> A + SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoUso")) + '5. Defecto --> P + SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoDefecto")) + '6. Codigo De Ensamble --> 1X + SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoEnsamble")) + '7. Codigo De Linea/Termico --> 9000 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoLinea")) + '8. Codigo De Inspeccion --> J8K + SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoInspeccion")) + '9. Fecha De Venta --> 05/09/2009 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("FechaVenta").ToDateTime().ToString("dd/MM/yyyy")) + '10. Fecha De Reclamacion --> 05/07/2010 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("FechaReclamacion").ToDateTime().ToString("dd/MM/yyyy")) + '11. TipoComprobante --> 1 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("TipoComprobante")) + '12. Comprobante --> N/A + SbTxt.AppendFormat("{0}@", GvRow.DataKey("Comprobante")) + '13. Autorizo --> STAN7490 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("Autorizo")) + '14. Comentarios --> Cliente 100407 + SbTxt.AppendFormat("{0}@", GvRow.DataKey("Comentarios")) + '15. Clave De Autorizacion / Codigo Error --> P05TRBGX + SbTxt.AppendFormat("{0}", GvRow.DataKey("ClaveAutorizacion")) + + SbTxt.Append(vbCrLf) + End If + Next + + Dim text As String = SbTxt.ToString + Response.Clear() + Response.ClearHeaders() + Response.AddHeader("Content-Length", text.Length.ToString) + Response.ContentType = "text/plain" + Response.AppendHeader("content-disposition", $"attachment;filename=""{LblFolio.Text}.txt""") + Response.Write(text) + Response.End() + + End Sub End Class From 2e6d6ee9d3da7cad86ea3979079184a8c2a1f007 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:53:14 -0700 Subject: [PATCH 05/11] Refacturacion de compras --- Compras/Compras.aspx.vb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 12b6e23e7..6dbca516f 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -7082,11 +7082,11 @@ Partial Class Compras_Compras CveCuenta = CveCuentaProveedorExtranjera End If End If - - If CveCompraRefacturacion > 0 Then - importeMovimiento = 0 - importeMN = 0 - End If + + 'If CveCompraRefacturacion > 0 Then + ' importeMovimiento = 0 + ' importeMN = 0 + ' End If Case 59 'Documentos From 1d87768d8618d11cf99c64a9956940d55274acd5 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:53:42 -0700 Subject: [PATCH 06/11] Reporte de puntos de interes --- GPS/RepPuntosDeInteres.aspx | 374 ++++++++++++++++++++++++++++++++- GPS/RepPuntosDeInteres.aspx.vb | 144 +++++++++---- 2 files changed, 471 insertions(+), 47 deletions(-) diff --git a/GPS/RepPuntosDeInteres.aspx b/GPS/RepPuntosDeInteres.aspx index 5aed250b6..adbe38c9f 100644 --- a/GPS/RepPuntosDeInteres.aspx +++ b/GPS/RepPuntosDeInteres.aspx @@ -3,6 +3,7 @@ + @@ -66,8 +199,11 @@ + + + - + @@ -83,8 +219,11 @@ + + + - + @@ -148,6 +287,43 @@
+ +
  • @@ -158,18 +334,36 @@ - + + + diff --git a/GPS/RepPuntosDeInteres.aspx.vb b/GPS/RepPuntosDeInteres.aspx.vb index 0886eacb8..3b818619e 100644 --- a/GPS/RepPuntosDeInteres.aspx.vb +++ b/GPS/RepPuntosDeInteres.aspx.vb @@ -2,9 +2,11 @@ Imports Extensiones Imports System.Data +Imports Microsoft.Reporting.WebForms + Partial Class GPS_RepPuntosDeInteres - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "P R O P I E D A D E S " Private Property DispositivosLista As List(Of String) Get @@ -13,29 +15,34 @@ Partial Class GPS_RepPuntosDeInteres Set(value As List(Of String)) ViewState("DispositivosLista") = value End Set - End Property + End Property + Private Property DtDatosReporte As DataTable + Get + Return If(IsNothing(ViewState("DtDatosReporte")), Nothing, CType(ViewState("DtDatosReporte"), DataTable)) + End Get + Set(value As DataTable) + ViewState("DtDatosReporte") = value + End Set + End Property #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then CargaDatos() End If End Sub Private Sub CargaDatos() + txtFechaF.Text = Now.ToString("dd/MM/yyyy") + txtFechaI.Text = Now.AddDays(-7).ToString("dd/MM/yyyy") + CargaDispositivos() - Dim gps As New ClsGPS - 'If gps.PuntoDeInteresGrupoGet(-1, 1) Then - ' GvGrupos.DataSource = gps.DtResultados - 'Else - ' GvGrupos.DataSource = Nothing - 'End If - If gps.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then - GvPuntos.DataSource = gps.DtResultados + Dim ObjGPS As New ClsGPS + If ObjGPS.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then + GvPuntos.DataSource = ObjGPS.DtResultados Else GvPuntos.DataSource = Nothing End If - gps.Dispose() - 'GvGrupos.DataBind() + ObjGPS.Dispose() GvPuntos.DataBind() End Sub @@ -58,8 +65,8 @@ Partial Class GPS_RepPuntosDeInteres RegistraScript("$('#dvConsulta').modal('hide');", "00") End Sub - Private Sub ReportePuntos(Dispositivos As String) - Dim GPS As New ClsGPS + Private Sub ReportePuntos(Dispositivos As String) + Dim FechaI, FechaF As Date Dim SBBody As New StringBuilder Dim CoordsPoligono = "" @@ -70,35 +77,48 @@ Partial Class GPS_RepPuntosDeInteres Dim GeoCercas = "" Dim Color = "" FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate) - FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate) - For Each row As GridViewRow In GvPuntos.Rows - SBBody.Clear() - If row.FCCheckBox("chkGR").Checked Then - If GPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then - Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT") - SBBody.Append($"
    ") - SBBody.Append($"
    Punto: {row.DataKey("PuntoDeInteres")}
    ") + FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate) + + Dim ObjGPS As New ClsGPS + Try + For Each row As GridViewRow In GvPuntos.Rows + SBBody.Clear() + If row.FCCheckBox("chkGR").Checked Then + If ObjGPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then + + DtDatosReporte = ObjGPS.DtResultados.Copy() + GvBarra.DataSource = DtDatosReporte + + Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT") + SBBody.Append($"
    ") + SBBody.Append($"
    Punto: {row.DataKey("PuntoDeInteres")}
    ") + + If ObjGPS.DtResultados.Rows.Count > 0 Then + Color = "#26C281" + SBBody.Append($"
    ") + For Each Cve As String In DispositivosLista + If ObjGPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then + SBBody.Append($"") + SBBody.Append($"") + End If + Next + SBBody.Append($"
    {ObjGPS.DtResultados.FiltroPrimeroValor("Vehiculo", $"CveDispositivo = {Cve}")}: {ObjGPS.DtResultados.FiltroPrimeroValor("Visitas", $"CveDispositivo = {Cve}")} visitas
    Última Visita: {ObjGPS.DtResultados.FiltroPrimeroValor("UltimaVisita", $"CveDispositivo = {Cve}")}
    ") + Else + Color = "#e82929" + SBBody.Append($"Este punto de interés no fue visitado en las fechas seleccionadas.") + End If + SBBody.Append($"
    ") + RegistraScript($"CreaCirculo({Coords},'{Color}');CreaMarcador({Coords},'{row.DataKey("PuntoDeInteres")}','{SBBody.ToString}');", row.DataKey("CvePuntoDeInteres")) + End If + End If + Next + Catch ex As Exception + OnError("Ocurrió un error al consultar los puntos de interes", ex) + End Try - If GPS.DtResultados.Rows.Count > 0 Then - Color = "#26C281" - SBBody.Append($"
    ") - For Each Cve As String In DispositivosLista - If GPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then - SBBody.Append($"") - SBBody.Append($"") - End If - Next - SBBody.Append($"
    {GPS.DtResultados.FiltroPrimeroValor("Vehiculo", $"CveDispositivo = {Cve}")}: {GPS.DtResultados.FiltroPrimeroValor("Visitas", $"CveDispositivo = {Cve}")} visitas
    Última Visita: {GPS.DtResultados.FiltroPrimeroValor("UltimaVisita", $"CveDispositivo = {Cve}")}
    ") - Else - Color = "#e82929" - SBBody.Append($"Este punto de interés no fue visitado en las fechas seleccionadas.") - End If - SBBody.Append($"
    ") - RegistraScript($"CreaCirculo({Coords},'{Color}');CreaMarcador({Coords},'{row.DataKey("PuntoDeInteres")}','{SBBody.ToString}');", row.DataKey("CvePuntoDeInteres")) - End If - End If - Next - GPS.Dispose() + ObjGPS.Dispose() + GvBarra.DataBind() + UPGV.Update() End Sub 'If GPS.GeoReferenciasEntradasSalidas(GVRow.DataKey("CveDispositivo").ToString.ToEntero, row.DataKey("CveGeoReferencia").ToString.ToEntero, FechaI, FechaF) Then @@ -152,5 +172,41 @@ Partial Class GPS_RepPuntosDeInteres GVHistorico.DataBind() UpdatePanel3.Update() RegistraScript("$('#dvHistorico').modal()") + End Sub + + 'Protected Sub GvBarra_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBarra.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' Dim RowID As String = $"row{e.Row.RowIndex}" + ' e.Row.Attributes("id") = RowID + ' Dim IndexGvBarra As Integer = If(String.IsNullOrEmpty(HdnIndexGvBarra.Value), -1, HdnIndexGvBarra.Value.ToEntero) + + ' RegistraScript($"GetDireccionesGV({e.Row.DBCampo("Posicion").ToString}, {e.Row.RowIndex}, 1);", $"{RowID}") + + ' End If + 'End Sub + + Protected Sub btnImprimir_Click(sender As Object, e As EventArgs) + Dim Btn As Button = CType(sender, Button) + Dim Format = Btn.CommandArgument + EnviarReporteProgramado(Format) + + End Sub + Public Sub EnviarReporteProgramado(Format As String) + Dim RutaReporte = "Empresas/Grales/ReportesProgramados/RPTPuntosInteres.rdlc" + Dim NombreReporte = "ReportePuntosInteres" + + Try + Dim RptParametro As New List(Of ReportParameter) + RptParametro.Add(New ReportParameter("FechaInicio", txtFechaI.Text)) + RptParametro.Add(New ReportParameter("FechaFin", txtFechaF.Text)) + RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) + RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString)) + + Dim retorno = StreamPDF(RutaReporte, DtDatosReporte, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC") + + ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}", Format) + Catch ex As Exception + GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex)) + End Try End Sub End Class From ed419a3a046eb46dd1a6ab6393caa4f95c622f05 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:54:37 -0700 Subject: [PATCH 07/11] Facturacion de usados de cotizaciones --- Ventas/Ventas.aspx | 4 +- Ventas/Ventas.aspx.vb | 88 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 3ea56173b..0bc461505 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -3493,7 +3493,9 @@ Kilometraje  - + + + Correo Notificación Usuario Final:   diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 119df860e..fe76a8aab 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1290,6 +1290,15 @@ Partial Class Ventas End Set End Property + Private Property CveVentaUsadoDevolucionEfectivo As Integer + Get + Return If(IsNothing(ViewState("CveVentaUsadoDevolucionEfectivo")), 0, CType(ViewState("CveVentaUsadoDevolucionEfectivo"), Integer)) + End Get + Set(value As Integer) + ViewState("CveVentaUsadoDevolucionEfectivo") = value + End Set + End Property + #End Region #Region "Propiedades PuntoVenta" @@ -7236,6 +7245,13 @@ Partial Class Ventas End If End If + If UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 AndAlso TrKilometraje.Visible Then + If TxtKilometraje.Text.Length < 6 Then + Alert("El kilometraje debe tener 6 digitos.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + 'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then DdlTipoComprobante.SelectedValue = "Ing" @@ -10774,6 +10790,13 @@ Partial Class Ventas Me.AplicaRelacionManual = False End If + 'SI SE SELECCIONO UNA FACTURA PARA DEVOLUCION DE EFECTIVO DEBE ASOCIARLA A LA NOTA DE CREDITO + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso factura.TipoDocto = "Egs" AndAlso Me.CveVentaUsadoDevolucionEfectivo > 0 Then + If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVentaUsadoDevolucionEfectivo) Then + ErrorList.Add("Ocurrió un error al relacionar la venta de devolución de efectivo entre si.") + End If + End If + If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" And Not factura.TipoDocto.Contiene("Rem", "Ped") Then NotificarPaqueteria() End If @@ -19123,7 +19146,7 @@ Partial Class Ventas If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then Dim sb As New StringBuilder() - If Not String.IsNullOrEmpty(FolioFiscal) Then + If Not String.IsNullOrEmpty(FolioFiscal) AndAlso Not (UsuarioActual.Empresa.Funcionalidad(529) = "1") Then sb.Append("La factura se encuentra en el siguiente estatus del SAT:
    ") Dim TotalT As Decimal = TxtTotal.Text.ToDecimal @@ -24675,9 +24698,14 @@ Partial Class Ventas End If 'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR - If UsuarioActual.CveEmpresa = 140 Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then - Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="    Si    ", TextoCancelacion:="    No    ") + If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then + Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia) + Else + Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="    Si    ", TextoCancelacion:="    No    ") + End If + Else AplicarNotaCreditoDesdeVenta() End If @@ -24694,6 +24722,8 @@ Partial Class Ventas Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False) RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC") + CveVentaUsadoDevolucionEfectivo = -1 + DdlTipoComprobante.SelectedValue = "Egs" Dim AplicaImpuestosLocales As Boolean = False @@ -24722,6 +24752,11 @@ Partial Class Ventas End If ObjVentas.Dispose() + 'SI SE SELECCIONO UNA FACTURA PARA DEVOLUCION DE EFECTIVO DEBE ASOCIARLA A LA NOTA DE CREDITO + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso AplicaNuevoDocumento AndAlso DdlVentaUsado.SelectedValue.ToEntero() > 0 AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then + CveVentaUsadoDevolucionEfectivo = DdlVentaUsado.SelectedValue.ToEntero() + End If + AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento, AplicoNCFacturaActual:=True) End Sub @@ -26688,6 +26723,9 @@ Partial Class Ventas Dim Cves As New StringBuilder Dim CveMetodoPago As Integer = -1 Dim MetodoPagoDif As Boolean = False + + Dim ListaVentaDetalleCotizacion As List(Of MVentaDetalleCotizacion) = Nothing + If ChkCotProductos.Checked Then For Each row As DataRow In DTSeleccionadas.Rows If CveMetodoPago <> -1 And row("CveMetodoPago33").ToString().ToEntero() <> CveMetodoPago Then @@ -26702,7 +26740,7 @@ Partial Class Ventas 'CARGA LOS USADOS RELACIONADOS A LOS PRODUCTOS SELECCIONADOS DE LA COTIZACION If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones) + ListaVentaDetalleCotizacion = CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones) End If Else @@ -26728,6 +26766,18 @@ Partial Class Ventas ObjClientes.Dispose() Cves.Clear() + 'SI SE CALCULARON USADOS LA CANTIDAD DEBE ASIGNARSE A PARTIR DEL CALCULO + If ListaVentaDetalleCotizacion IsNot Nothing AndAlso ListaVentaDetalleCotizacion.Count > 0 Then + + For Each Dr As DataRow In DtCotizacionesPS.Rows + Dim VentaDetalle = ListaVentaDetalleCotizacion.FirstOrDefault(Function(cot) cot.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero()) + If VentaDetalle IsNot Nothing Then + Dr("Cantidad") = VentaDetalle.Cantidad + End If + Next + + End If + If Not AgregaPSCotizacion() Then Alert("Ocurrió un error validar las partidas de las cotizaciones seleccionadas. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -26749,14 +26799,29 @@ Partial Class Ventas UpPS.Update() UpParametros.Update() End Sub + Private Class MVentaDetalleCotizacion + Public Property CveVentaDetalle As Integer + Public Property Cantidad As Decimal + End Class + + Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of MVentaDetalleCotizacion) + Dim Retorno As New List(Of MVentaDetalleCotizacion) - Private Sub CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then Dim DTTamanios As DataTable = GlobalDTAcumTamaños() Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"}) + + For Each Dr As DataRow In DTSeleccionadas.Rows + Dim tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal + Dr("Cantidad") = tCantidad + + Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad}) + + Next + Dim TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray() Dim DTPSTemp As New DataTable '= TmpDT.Clone @@ -26812,11 +26877,15 @@ Partial Class Ventas Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero() SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado) + Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()}) + End If Next End If - End Sub + + Return Retorno + End Function Private Sub VerificaCotizaciones(ByRef dt As DataTable) If ChkCotProductos.Checked Then For Each Gvr As GridViewRow In GvCotPS.Rows @@ -26862,7 +26931,12 @@ Partial Class Ventas If DtCotizacionesPS IsNot Nothing Then Dim tCantidad As Decimal = 0 For Each Dr As DataRow In DtCotizacionesPS.Select() - tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + tCantidad = Dr("Cantidad").ToString().ToDecimal() + Else + tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal + End If + AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(), Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal, Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(), From ced240737ac3720110751f4e6fe65e8eea775d98 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:54:56 -0700 Subject: [PATCH 08/11] Movimientos virtuales --- Inventarios/TraspasoAlmacen.aspx.vb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 021418dfa..6f5438acc 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -934,7 +934,7 @@ Partial Class Inventarios_TraspasoAlmacen If Not ErrorMovInv Then 'VIRTUAL ENTRADA - If RealizarMovimientoVirtual Then + If RealizarMovimientoVirtual AndAlso CveAlmacenVirtualEntrada > 0 Then Dim dtvirtual As DataTable = Nothing @@ -963,6 +963,7 @@ Partial Class Inventarios_TraspasoAlmacen ErrorMovInv = True End If End If + Dim Concepto As String = TxtObservaciones.Text If Concepto = "" Then Concepto = "Traspaso" 'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO: @@ -1743,13 +1744,13 @@ Partial Class Inventarios_TraspasoAlmacen If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then ErrorMovInv = True - TextoError = "Ocurrió un erro al cancelar el traspaso" + TextoError = "Ocurrió un error al cancelar el traspaso" End If If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then ErrorMovInv = True - TextoError = "Ocurrió un erro al cancelar el traspaso" + TextoError = "Ocurrió un error al cancelar el traspaso" End If End If @@ -2967,7 +2968,7 @@ Partial Class Inventarios_TraspasoAlmacen Else Str = String.Format(" AND CveSubProyecto = {0} ", DrAlmO("CveSubProyecto")) End If - DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,27,28) AND Estatus = 'Activo' {0} ", Str)) + DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,25,28) AND Estatus = 'Activo' {0} ", Str)) DdlAlmacenDestino.DataBind() DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) From f867104d5d40e30d94b961d81a3bd57a82d73736 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:55:13 -0700 Subject: [PATCH 09/11] Descuentos de efectivo por NC en reporte de cortes --- Bancos/RepCortes.aspx | 9 +++++++++ Compras/PopUpVerFactura.aspx.vb | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Bancos/RepCortes.aspx b/Bancos/RepCortes.aspx index e76a349bd..c1a194e31 100644 --- a/Bancos/RepCortes.aspx +++ b/Bancos/RepCortes.aspx @@ -231,6 +231,15 @@ + + + + + + + + + diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 1cd5bf0c5..94dc00a5d 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1327,7 +1327,7 @@ Partial Class PopUpVerFactura Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero 'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO - If UsuarioActual.CveEmpresa = 140 AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero() If CveConcepto.Contiene(2, 3, 26, 27) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual") @@ -1361,7 +1361,7 @@ Partial Class PopUpVerFactura If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then DtMovimientos = ObjInventarios.DtResultados.Copy() CantidadProductos = DtMovimientos.SUM("Cantidad").ToDecimal() - If UsuarioActual.CveEmpresa = 140 AndAlso CveMovimientoRelacionado > 0 Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveMovimientoRelacionado > 0 Then If ObjInventarios.GetMovimientos(CveMovimientoRelacionado, -1, -1, UsuarioActual.CveEmpresa) Then Dim CveAlmacenRelacionado As Integer = ObjInventarios.CveAlmacen Dim CveTipoAlmacenRelacionado As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenRelacionado}").ToString.ToEntero @@ -1393,7 +1393,7 @@ Partial Class PopUpVerFactura End If End If - If UsuarioActual.CveEmpresa = 140 AndAlso CveCompra > 0 Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCompra > 0 Then If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then Dim DtFaltante As DataTable = ObjInventarios.DtResultados.FiltraParametros("CantidadF > 0") If DtFaltante.Rows.Count > 0 Then From b29d81b472305a5db745f549e8abde6b437e3804 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 10 Feb 2021 12:55:45 -0700 Subject: [PATCH 10/11] BDH ScoreCard --- Ventas/CatMetasVendedores.aspx | 2 +- Ventas/CatMetasVendedores.aspx.vb | 15 +++++++++------ Ventas/MetasVendedores.aspx | 23 +++++++++++++++++++---- Ventas/MetasVendedores.aspx.vb | 8 +++++--- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Ventas/CatMetasVendedores.aspx b/Ventas/CatMetasVendedores.aspx index 366e385c0..98b8d61e6 100644 --- a/Ventas/CatMetasVendedores.aspx +++ b/Ventas/CatMetasVendedores.aspx @@ -22,7 +22,7 @@ - + diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb index 0f1e9f8f5..5a956cdb6 100644 --- a/Ventas/CatMetasVendedores.aspx.vb +++ b/Ventas/CatMetasVendedores.aspx.vb @@ -42,13 +42,14 @@ Partial Class CatMetasVendedores DdlMarcas.DataBind() DdlMarcas.Items.Insert(0, New ListItem("Todos", "-1")) - DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacionSup.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacionSup.DataBind() + DdlClasificacionSup.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlClasificacion.DataSource = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) - DdlClasificacionSup.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) - DdlClasificacionSup.DataBind() - DdlClasificacionSup.Items.Insert(0, New ListItem("Todos", "-1")) End Sub Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click @@ -100,8 +101,10 @@ Partial Class CatMetasVendedores CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor") TxtFechaI.Text = GvRow.DataKey("MesAño") - DdlClasificacionSup.SelectedValue = GvRow.DataKey("CveClasificacionSup") - DdlClasificacion.SelectedValue = GvRow.DataKey("CveClasificacion") + + DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup")) + DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion")) + DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca") TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad") TxtMetaImporte.Text = GvRow.DataKey("MetaImporte") diff --git a/Ventas/MetasVendedores.aspx b/Ventas/MetasVendedores.aspx index efb1b7674..54b52aa47 100644 --- a/Ventas/MetasVendedores.aspx +++ b/Ventas/MetasVendedores.aspx @@ -154,6 +154,11 @@ + + + + + @@ -164,14 +169,24 @@ + + + + + + + + + + - + - + @@ -184,11 +199,11 @@ - +<%-- - + --%> diff --git a/Ventas/MetasVendedores.aspx.vb b/Ventas/MetasVendedores.aspx.vb index 41c71e9c0..458f35336 100644 --- a/Ventas/MetasVendedores.aspx.vb +++ b/Ventas/MetasVendedores.aspx.vb @@ -47,7 +47,7 @@ Partial Class MetasVendedores DdlClasificaciones.DataBind() DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1")) - DdlClasificacion2.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacion2.DataSource = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) DdlClasificacion2.DataBind() DdlClasificacion2.Items.Insert(0, New ListItem("Todos", "-1")) @@ -75,8 +75,10 @@ Partial Class MetasVendedores Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.FCLabel("lblRealMesPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealMesPorcentaje").Text, "%") - e.Row.FCLabel("lblVarVSAAPerc").Text = String.Format("{0}{1}", e.Row.FCLabel("lblVarVSAAPerc").Text, "%") + e.Row.FCLabel("lblRealMesPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealMesPorcentaje").Text, "%") + e.Row.FCLabel("lblRealAcumuladoPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealAcumuladoPorcentaje").Text, "%") + 'e.Row.FCLabel("lblVarVSAAPerc").Text = String.Format("{0}{1}", e.Row.FCLabel("lblVarVSAAPerc").Text, "%") + Select Case e.Row.DataKey("Etiqueta") Case "GrupoSuperior" e.Row.CssClass = "GrupoSuperior" From 7b13acd7d73edc2ad1ed3765f7815869debf42d0 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 11 Feb 2021 15:12:50 -0700 Subject: [PATCH 11/11] No duplicar empresas en listado --- Sistemas/PopUpSeleccionarEmpresa.aspx.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb index 32de18d83..c097bc7a7 100644 --- a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb +++ b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb @@ -22,7 +22,8 @@ Partial Class PopUpSeleccionarEmpresa If Dt IsNot Nothing Then If Dt.Rows.Count > 0 Then Dim NumRegistros As Integer = 0 - GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa") + GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa", {"CveEmpresa", "Empresa", "CveUsuario", "Contraseña", "Usuario"}) + 'GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa") NumRegistros += DirectCast(GvEmpresas.DataSource, System.Data.DataTable).Rows.Count GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")