From 949fda338c701ca318da63cef600c674d66975e5 Mon Sep 17 00:00:00 2001 From: MLopez Date: Fri, 13 Jan 2023 09:24:30 -0700 Subject: [PATCH 01/16] =?UTF-8?q?E141=20Kardex=20Almacen=20Proceso=20349?= =?UTF-8?q?=20Bloqueo=20opci=C3=B3n=20"No"=20en=20tr=C3=A1nsito?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/KardexAlmacenHorizontal.aspx.vb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index dc2f229a8..b01a8ac17 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -30,6 +30,10 @@ Partial Class Inventarios_KardexAlmacen txtFechaI.Text = Now.ToShortDateString End If + If UsuarioActual.TienePermisoProceso(349) Then + DdlIncluyeTransitorios.Items.RemoveAt(0) 'oculta opción "No" en tránsito + End If + If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero) ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1") End If @@ -147,8 +151,9 @@ Partial Class Inventarios_KardexAlmacen Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM) Dim GPO As Integer = Ddlgrupo.SelectedValue.ToEntero + Dim IncluyeTransitorios As Integer = DdlIncluyeTransitorios.SelectedValue.ToEntero - If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), + If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), IncluyeTransitorios, DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes, GPO:=GPO) Then If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then From 0c1f0f56fbb26cee44a9e012a47771d85187a393 Mon Sep 17 00:00:00 2001 From: MLopez Date: Fri, 13 Jan 2023 14:31:24 -0700 Subject: [PATCH 02/16] E172 Cargar PS Empacados/TipoOrganicos desde GlobalDT --- App_Code/ClsPaginas.vb | 36 +++++++++++++++++++++++++++++-- Ventas/ProductosServicios.aspx.vb | 13 ++--------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 887b33ddb..7c3dfc1d2 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4313,6 +4313,40 @@ Public Class ClsPaginas End Set End Property +#Region "CITRUS GAME" + Property GlobalDTGralEmpacados(CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTGralEmpacados-{CveEmpresa}" + If Application(AppNombre) Is Nothing Then + Dim ObjGenerales As New ClsGenerales() + If ObjGenerales.GetEmpacados(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() + End If + + GlobalDTGralEmpacados = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTGralEmpacados-{CveEmpresa}" + Application(AppNombre) = value + End Set + End Property + Property GlobalDTGralTipoOrganicos(CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTGralTipoOrganicos-{CveEmpresa}" + If Application(AppNombre) Is Nothing Then + Dim ObjGenerales As New ClsGenerales() + If ObjGenerales.GetTipoOrganicos(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() + End If + + GlobalDTGralTipoOrganicos = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTGralTipoOrganicos-{CveEmpresa}" + Application(AppNombre) = value + End Set + End Property +#End Region #End Region @@ -4321,8 +4355,6 @@ Public Class ClsPaginas DirectorioSitio = 2 eFacturasCaptcha = 3 - - RutaEmpresasJM = 500 RutaEmpresasRM = 501 RutaEmpresasPC = 502 diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 3d24b25b9..dd685d23e 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -438,21 +438,12 @@ Partial Class ProductosyServicios End Sub Private Sub CargaPanelCitricos() - Dim ObjGral As New ClsGenerales() - If ObjGral.GetEmpacados(UsuarioActual.CveEmpresa) Then - DdlEmpacado.DataSource = ObjGral.DtResultados - End If - If ObjGral.GetTipoOrganicos(UsuarioActual.CveEmpresa) Then - DdlTipoOrganico.DataSource = ObjGral.DtResultados - End If - ObjGral.Dispose() - + DdlEmpacado.DataSource = GlobalDTGralEmpacados(UsuarioActual.CveEmpresa) + DdlTipoOrganico.DataSource = GlobalDTGralTipoOrganicos(UsuarioActual.CveEmpresa) DdlEmpacado.DataBind() DdlTipoOrganico.DataBind() - End Sub - Private Sub MuestraPanel(Optional AfterPageLoad As Boolean = False) If AfterPageLoad Then RegistraScript("window.onload = function MuestraPanel() { document.getElementById(""C_BtnMostrarPanel"").click(); }") From 19cdedbfd4b814319c5d8b48ff3516de3d570eb2 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Sat, 14 Jan 2023 09:17:38 -0700 Subject: [PATCH 03/16] Clientes busqueda cuenta, correcion descarga documentos cat documentos, ajustes servicio domicilio --- App_Code/ClsClientes.vb | 5 ++- Bancos/RepCxCCliente.aspx | 6 +-- Bancos/RepCxCCliente.aspx.vb | 12 +++--- Compras/Compras.aspx.vb | 60 ++++++++++++++++++++++----- Inventarios/EntradasSalidas.aspx.vb | 2 +- OS/RepServicioDomicilio.aspx | 18 +------- OS/RepServicioDomicilio.aspx.vb | 5 --- RH/CatDocumentos.aspx | 6 ++- RH/CatDocumentos.aspx.vb | 64 +++++++++++++++++++++-------- Ventas/PopUpBuscarClientes.aspx | 13 ++++++ Ventas/PopUpBuscarClientes.aspx.vb | 9 +++- 11 files changed, 137 insertions(+), 63 deletions(-) diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index f71c30878..e7a7280d6 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -264,7 +264,8 @@ Public Class ClsClientes End Sub Public Function GetClientes(CveCliente As Integer, Nombre As String, Codigo As String, NombreCorto As String, RFC As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional Notificar As String = "-1", Optional CvePrecioLista As Integer = -1, Optional CveClienteClasificacion As Integer = -1, - Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveUsuarioConsulta As Integer = -1, + Optional Cuenta As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClientesGet") @@ -287,6 +288,8 @@ Public Class ClsClientes .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@PermiteCredito", SqlDbType.Int).Value = PermiteCreditoFiltro .Add("@TopSelect", SqlDbType.Int).Value = TopSelect + .Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta + End With Try SqlAdapter.Fill(Data) diff --git a/Bancos/RepCxCCliente.aspx b/Bancos/RepCxCCliente.aspx index 283a6e5ba..4c4067ef2 100644 --- a/Bancos/RepCxCCliente.aspx +++ b/Bancos/RepCxCCliente.aspx @@ -59,7 +59,7 @@ -
+
@@ -124,10 +124,10 @@
  • Cuenta:     - +
  • Moneda: - +
  • diff --git a/Bancos/RepCxCCliente.aspx.vb b/Bancos/RepCxCCliente.aspx.vb index ffa1a3378..960811766 100644 --- a/Bancos/RepCxCCliente.aspx.vb +++ b/Bancos/RepCxCCliente.aspx.vb @@ -69,13 +69,13 @@ Partial Class Bancos_RepCxCCliente Mov.Dispose() GvCxC.DataBind() - If (GvCxC.Rows.Count > 0) Then - GvCxC.UseAccessibleHeader = True - GvCxC.HeaderRow.TableSection = TableRowSection.TableHeader - RegistraScript("OrdenarGV();") + 'If (GvCxC.Rows.Count > 0) Then + GvCxC.UseAccessibleHeader = True + GvCxC.HeaderRow.TableSection = TableRowSection.TableHeader + RegistraScript("OrdenarGV();") + UPDatos.Update() - UPDatos.Update() - End If + 'End If End Sub Protected Sub GvCxC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCxC.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 405c5dcb1..479eefe24 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1084,6 +1084,7 @@ Partial Class Compras_Compras #End Region + Dim DTConceptos As DataTable Private Property EmpresasOC As List(Of Integer) Get @@ -1185,6 +1186,18 @@ Partial Class Compras_Compras End Property + Private Property EsDevolucionApoyoLogistico As Boolean + Get + + If ViewState("EsDevolucionApoyoLogistico") Is Nothing Then + ViewState("EsDevolucionApoyoLogistico") = False + End If + Return CType(ViewState("EsDevolucionApoyoLogistico"), Boolean) + End Get + Set(value As Boolean) + ViewState("EsDevolucionApoyoLogistico") = value + End Set + End Property Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load @@ -1610,7 +1623,13 @@ Partial Class Compras_Compras NCSeleccionFacturasRelacionadas(UUIDSList) End If + If CveFactura > 0 AndAlso Serie Isnot nothing AndAlso Serie.ToUpper = "NL" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + EsDevolucionApoyoLogistico = True + DdlTipoComprobante.Items.Clear() + DdlTipoComprobante.Items.Add(New ListItem("Devolución", "DEV")) + DdlTipoComprobante.SelectedValueExist("DEV") + End If End If @@ -5527,6 +5546,8 @@ Partial Class Compras_Compras If DdlTipoComprobante.SelectedValue = "Fac" Then + + For Each tCveAlmacen As Integer In ListAlmacenes If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then Continue For @@ -5553,7 +5574,7 @@ Partial Class Compras_Compras ListaMovimientosAlmacen.Add(CveMovimientoInventario) - + Dim contadorAlamcen As Integer = 0 For Each Dr As DataRow In DtInv.Rows CveProducto = Dr("CvePS").ToString.ToEntero @@ -5594,22 +5615,26 @@ Partial Class Compras_Compras End If End If - 'si no es por serie lote + ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar) + 'si no es por serie lote ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto) - If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then - ErrorMovInv = True - Exit For + If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then + ErrorMovInv = True + Exit For + End If End If + End If - End If - - i = i + 1 + i = i + 1 + contadorAlamcen = contadorAlamcen + 1 Next End If + + Next End If @@ -10988,7 +11013,16 @@ Partial Class Compras_Compras e.Row.FCCheckBox("cbInv").Enabled = False End If - e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(If(DdlTipoCompra.SelectedValue.ToEntero = 9, "CveTipoAlmacen IN (21)", "CveTipoAlmacen IN (1,2,7,14,19)")) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) + + If EsDevolucionApoyoLogistico Then + e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen = 27") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) + + Else + e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(If(DdlTipoCompra.SelectedValue.ToEntero = 9, "CveTipoAlmacen IN (21)", "CveTipoAlmacen IN (1,2,7,14,19)")) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) + End If + + + e.Row.FCDropDownList("ddlEAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlEAlmacen").DataBind() 'e.Row.FCDropDownList("ddlEAlmacen").SelectedValue = If(e.Row.DBCampo("CveAlmacen").ToEntero <= 0, "-1", e.Row.DBCampo("CveAlmacen")) @@ -11100,6 +11134,10 @@ Partial Class Compras_Compras StrAlmacenes = $"Modalidad = 0" End If + If EsDevolucionApoyoLogistico Then + StrAlmacenes = " CveTipoAlmacen = 27" + End If + e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlAlmacen").DataBind() @@ -17625,6 +17663,8 @@ Partial Class Compras_Compras 'If GlobalDTProductosServiciosEquivalencias(CvePS, CveUM).Rows.Count = 0 Then Row("CveEq") = 1 Else Row("CveEq") = 0 Row("NoDeducible") = NoDeducible + + Total = Math.Round(PU, DecimalesPermitidos) * Cantidad - Descuento Row("PU") = Math.Round(PU, DecimalesPermitidos) If CargaXml And (Version = "3.3" Or Version = "4.0") Then diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 32792b00f..8db28f336 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -2042,7 +2042,7 @@ Partial Class Inventarios_EntradasSalidas If Not ErrorAC And Not ErrorMovInv Then - If Not DdlDireccionEnvio.SelectedValue.ToEntero > 0 Then + If ChkEmitirTimbrado.Checked AndAlso Not DdlDireccionEnvio.SelectedValue.ToEntero > 0 Then ErrorMovInv = True Alert("La direccion destino es requerida.", TipoMensaje.MsgAdvertencia) End If diff --git a/OS/RepServicioDomicilio.aspx b/OS/RepServicioDomicilio.aspx index 8b9b087d3..cca9c7ac9 100644 --- a/OS/RepServicioDomicilio.aspx +++ b/OS/RepServicioDomicilio.aspx @@ -1180,24 +1180,10 @@ function InitCalendar() { $(document).ready(function () { - //$("#TxtModalFechaOS").on("change paste keyup", function () { - // console.log('TxtModalFechaOS Modificado'); - //}); - - //jQuery('#TxtModalFechaOS').on('input', function () { - // console.log('TxtModalFechaOS Modificado'); - //}); - - //$("#TxtModalFechaOS").change(function () { - // console.log('TxtModalFechaOS Modificado'); - //}); + Calendario(); - - // CargaPickers(); - - - // $("#TxtModalFechaOS").val("" + start.format("DD/MM/YYYY 08:00 tt")); + }); diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb index 2b5459bb0..33a77efd2 100644 --- a/OS/RepServicioDomicilio.aspx.vb +++ b/OS/RepServicioDomicilio.aspx.vb @@ -1358,11 +1358,6 @@ Partial Class OS_RepServicioDomicilio If DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then - 'If ViewState("Validando") Is Nothing Then - ' ViewState("Validando") = True - 'Else - ' Exit Sub - 'End If Dim objOS As New ClsOS diff --git a/RH/CatDocumentos.aspx b/RH/CatDocumentos.aspx index 39c160e78..8b286199b 100644 --- a/RH/CatDocumentos.aspx +++ b/RH/CatDocumentos.aspx @@ -50,7 +50,8 @@ + DataKeyNames="CveDocumentacion,Documentacion,DocumentacionFormato,Orden,Estatus,CveDocumentacionTipo,DocumentacionTipo,Requerido,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento" + EmptyDataText="No se encontraron registros de documentos" CssClass="table table-hover table-advance Widthall" GridLines="None" > @@ -111,7 +112,8 @@ - + diff --git a/RH/CatDocumentos.aspx.vb b/RH/CatDocumentos.aspx.vb index 61d32c97d..530066dbc 100644 --- a/RH/CatDocumentos.aspx.vb +++ b/RH/CatDocumentos.aspx.vb @@ -418,8 +418,11 @@ Partial Class RH_CatDocumentos If e.Row.RowType = DataControlRowType.DataRow Then Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero - Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString - Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString + + 'Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato") + Dim separado As Char() = {"."} Dim array() As String = DocumetacionFormato.Split(separado) Dim extencion As String = "" @@ -430,27 +433,50 @@ Partial Class RH_CatDocumentos If DocumetacionFormato.Trim.Length > 0 Then - Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & DocumetacionFormato - Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato - If File.Exists(linkDescargaArchivo) Then - ImgDownLoad.Visible = True - If extencion.Length > 0 Then - ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) - Else - ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) - End If - Else - ImgDownLoad.Visible = False - End If - - Else - ImgDownLoad.Visible = False - End If + Dim PathDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato + Dim FileD = New FileInfo(PathDescargaArchivo) + If FileD.Exists Then + ImgDownLoadFormato.Visible = True + ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato) + End If + + + End If + + + End If End Sub + Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs) + + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + 'Dim Adjunto As String = GvRow.DataKey("Adjunto") + + Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero + Dim DocumetacionFormato As String = GvRow.DataKey("DocumentacionFormato").ToString + + Dim PathDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato + + Dim FileD = New FileInfo(PathDescargaArchivo) + + If FileD.Exists Then + + Response.Clear() + Response.AddHeader("Content-Disposition", "attachment; filename=" + FileD.Name) + Response.AddHeader("Content-Length", FileD.Length.ToString()) + Response.ContentType = "text/octet-stream" + Response.Flush() + Response.TransmitFile(FileD.FullName) + Response.End() + + End If + + End Sub + #End Region @@ -670,5 +696,7 @@ Partial Class RH_CatDocumentos RegistraScript(String.Format("$('#{0}').modal('show');", "DVParametros")) End Sub + + End Class diff --git a/Ventas/PopUpBuscarClientes.aspx b/Ventas/PopUpBuscarClientes.aspx index 11b583660..727fb9ca2 100644 --- a/Ventas/PopUpBuscarClientes.aspx +++ b/Ventas/PopUpBuscarClientes.aspx @@ -73,6 +73,19 @@ + + + + Cuenta: + + + + + + + + + diff --git a/Ventas/PopUpBuscarClientes.aspx.vb b/Ventas/PopUpBuscarClientes.aspx.vb index fa8690108..58141167d 100644 --- a/Ventas/PopUpBuscarClientes.aspx.vb +++ b/Ventas/PopUpBuscarClientes.aspx.vb @@ -2,6 +2,8 @@ Option Strict On Imports Extensiones +Imports Microsoft.Owin.Security.Provider + Partial Class PopUpBuscarClientes Inherits ClsPaginas @@ -74,13 +76,17 @@ Partial Class PopUpBuscarClientes Dim ObjClientes As New ClsClientes() Dim CveUsuarioConsulta As Integer + + Dim Cuenta As String = If(TxtCuenta.Text = "", "-1", TxtCuenta.Text) + If UsuarioActual.TienePermisoProceso(322) Then CveUsuarioConsulta = UsuarioActual.CveVendedor Else CveUsuarioConsulta = -1 End If If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, - DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente, TopSelect:=100, CveUsuarioConsulta:=CveUsuarioConsulta) Then + DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente, TopSelect:=100, CveUsuarioConsulta:=CveUsuarioConsulta, Cuenta:=Cuenta) Then + If ObjClientes.DtResultados.Rows.Count > 0 Then LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0) GV.DataSource = ObjClientes.DtResultados @@ -150,6 +156,7 @@ Partial Class PopUpBuscarClientes If TxtMail.Text.Trim <> String.Empty Then Return True If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + If TxtCuenta.Text.Trim.Length > 0 Then Return True Return False End Function From 793dc80866c69fa1fab347ab2806e3bcc7d64fcd Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Sat, 14 Jan 2023 14:07:54 -0700 Subject: [PATCH 04/16] =?UTF-8?q?Ajsute=20almacen=20prorrateo,=20Clientes?= =?UTF-8?q?=20dise=C3=B1o=20perdido=20parametros=20estados=20de=20cuenta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntradasSalidas.aspx.vb | 43 ++- Ventas/Clientes.aspx | 471 ++++++++++++++++++++++------ Ventas/Clientes.aspx.vb | 13 +- 3 files changed, 420 insertions(+), 107 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 8db28f336..25c18b4f9 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -4404,6 +4404,11 @@ Partial Class Inventarios_EntradasSalidas Exit Sub End If + If Not TxtIFDescripcion.Text.Trim.Length > 0 Then + Alert("La descripción es requerida", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim ObjInventario As New ClsInventarios Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) @@ -4426,6 +4431,14 @@ Partial Class Inventarios_EntradasSalidas Dim idCtaContableEntrada As Integer = 0 Dim idCtaContableSalida As Integer = 0 + Dim Prorratear As Boolean = If(UsuarioActual.CveEmpresa = 172 AndAlso DtMovimientosSalidaInvFisico.Rows.Count > 0 AndAlso DtMovimientosEntradaInvFisico.Rows.Count > 0, True, False) + Dim ProPU As Decimal = 0 + 'Dim ImporteSalida As Decimal = + + 'DtMovimientosSalidaInvFisico + 'DtMovimientosEntradaInvFisico + + Dim IdCuentaOtrosIngresos As Integer = UsuarioActual.Empresa.IdCuentaOtrosIngresos Select Case UsuarioActual.CveEmpresa Case 119 @@ -4438,6 +4451,8 @@ Partial Class Inventarios_EntradasSalidas Dim EsContabilizable As Boolean = (CveModalidad = 1) + + 'MOVIMIENTO DE ENTRADA If DtMovimientosEntradaInvFisico.Rows.Count > 0 Then 'FolioEntrada = ObjInventario.GetFolioSiguiente(32, UsuarioActual.CveEmpresa) @@ -4484,9 +4499,35 @@ Partial Class Inventarios_EntradasSalidas End If Next + + + + If Prorratear Then + If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then + + Dim ProTotalSalida As Decimal = ObjInventario.DtResultados.SUMD("Total", "") + Dim ProCantidadEntrada As Decimal = DtMovimientosEntradaInvFisico.SUMD("Cantidad", "") + + ProPU = (ProTotalSalida / ProCantidadEntrada).RoundSQL(6) + + If Not ProPU > 0 Then + ErrorMovInv = True + Mensaje = $"Ocurrió un error al obtener el PU proraterado, pu {ProPU}" + End If + + Else + ErrorMovInv = True + Mensaje = "Ocurrió un error al obtener el PU proraterado" + End If + End If + End If + + + If Not ErrorMovInv Then For Each Dr As DataRow In DtMovimientosEntradaInvFisico.Rows - ImporteConcepto = Dr("PU").ToString.ToDecimal + ImporteConcepto = If(Prorratear, ProPU, Dr("PU").ToString.ToDecimal) If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index b638c446e..ba8e4ec33 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -1641,7 +1641,346 @@
    -
    + + +
    + +
    +
    +
    + + Parametros +
    + +
    + + +
    + +
    +
    + + + + + +
    +
    +
    + +
    +
    +
    +
    + + Estado de Cuenta +
    +
    + +
    +
    +
    + + +
    +
    + +
    + + + + + + + +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    + + + + + +
    + +
    + + + + + + + + + + + <%-- + + + + + --%> +
    +
    +
    +
    + +
    +
    +
    +
    + +    +
    +
    + + + + +
    +
    +
    + +
    +
    + + + <%--
    @@ -1668,7 +2007,7 @@ - <%-- --%> +
    @@ -1783,66 +2122,13 @@
    - <%-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --%> +
    - - <%----%> +
    @@ -1851,8 +2137,7 @@
    - - <%----%> +
    @@ -1867,8 +2152,7 @@
    - - <%----%> +
    @@ -1877,45 +2161,21 @@
    - <%--
    - - -
    - -
    - - -
    - -
    - -
    - - -
    - - -
    - -
    -
    --%> +
    - - <%----%> +
    - - <%----%> +
    - - <%----%> +
    @@ -1947,10 +2207,7 @@
    - <%-- - Cuentas por Cobrar - Anticipos / NC - --%> +
    @@ -2021,12 +2278,7 @@ - <%-- - - - - - --%> +
    @@ -2052,11 +2304,13 @@
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    + --%> + + + +
    +
    @@ -2085,6 +2339,15 @@
    + +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + +
    +
    - <%----%> + diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index b40560271..ec502615f 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -764,9 +764,11 @@ Partial Class Clientes If UsuarioActual.TienePermisoProceso(162) Then ChkPermiteCredito.Enabled = True TxtLimiteCreditoSucursal.Enabled = True + TxtFechaLimiteCredito.Enabled = True Else ChkPermiteCredito.Enabled = False TxtLimiteCreditoSucursal.Enabled = False + TxtFechaLimiteCredito.Enabled = False End If ChkEstado.Enabled = False If UsuarioActual.TienePermisoProceso(180) Then @@ -1635,6 +1637,9 @@ Partial Class Clientes ChkRequiereOC.Checked = ObjClientes.RequiereOC ChkEsDistribuidor.Checked = Boolean.Parse(ObjClientes.DtResultados(0)("EsDistribuidor").ToString()) CobranzaTelefono = ObjClientes.CobranzaTelefono + + TxtFechaLimiteCredito.Text = If(ObjClientes.DtResultados.Rows(0)("FechaLimiteCredito").ToString.ToDate = New Date(1900, 1, 1), "", ObjClientes.DtResultados.Rows(0)("FechaLimiteCredito").ToString.ToDate.ToString("dd/MM/yyyy")) + If CobranzaTelefono.Length = 10 Then BtnCobranzaSMS.ToolTip = $"El mensaje SMS será enviado al número celular {CobranzaTelefono}
    con #referencia ""{If(UsuarioActual.CveEmpresa = 4, TxtNombreCorto.Text, CodigoCliente)}""" End If @@ -2684,6 +2689,10 @@ Partial Class Clientes Dim TipoPersona As Boolean = If(RdTipoPersona.SelectedValue.ToEntero = 1, True, False) + + Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.Trim.Length > 0, TxtFechaLimiteCredito.Text.ToDate, New Date(1900, 1, 1)) + + If CveCliente = -1 Then Dim ErrorAC As Boolean = False Dim CtaCliente As Integer = DdlCtaContableClientes.SelectedValue.ToEntero() @@ -2747,7 +2756,7 @@ Partial Class Clientes CvePais:=DdlPais.SelectedValue.ToEntero(), CveEstado:=DdlEstado.SelectedValue.ToEntero(), CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero(), CveColonia:=DdlColonia.SelectedValue.ToEntero(), CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero(), NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(), ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), - CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim()) Then + CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito) Then ViewState("CveCliente") = ObjClientes.CveCliente @@ -2844,7 +2853,7 @@ Partial Class Clientes ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), - NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim()) Then + NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito) Then ObjClientes.LimpiaImpuestosLocales(CveCliente) From 9f737154d55e92d3919f10359ff67c24ab7c407b Mon Sep 17 00:00:00 2001 From: MLopez Date: Sat, 14 Jan 2023 14:34:13 -0700 Subject: [PATCH 05/16] E172 ClsGenerales agregar "Estatus" a AddEmpacado y AddTipoOrganico --- App_Code/ClsGenerales.vb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 6af4ed287..77f4301c1 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -4223,15 +4223,16 @@ Public Class ClsGenerales Return Retorno End Function - Public Function AddTipoOrganico(TipoOrganico As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddTipoOrganico(TipoOrganico As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_TipoOrganicosAdd") With SqlAdapter.SelectCommand.Parameters .Add("@TipoOrganico", SqlDbType.VarChar).Value = TipoOrganico - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -4317,15 +4318,16 @@ Public Class ClsGenerales Return Retorno End Function - Public Function AddEmpacado(TipoEmpacado As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddEmpacado(TipoEmpacado As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_EmpacadosAdd") With SqlAdapter.SelectCommand.Parameters .Add("@TipoEmpacado", SqlDbType.VarChar).Value = TipoEmpacado - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try From ec9f4983f30234987f4f7abf10a046ef6c92d136 Mon Sep 17 00:00:00 2001 From: MLopez Date: Sat, 14 Jan 2023 17:14:30 -0700 Subject: [PATCH 06/16] E172 FIX Error ClsProductosServicios UpdatePS() --- App_Code/ClsProductosServicios.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index a6c62f462..f3ae17edc 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -762,8 +762,8 @@ Public Class ClsProductosServicios .Add("@VigenciaIndeterminadaRSCO", SqlDbType.Bit).Value = VigenciaIndeterminadaRSCO 'Nuevo MLopez 18/11/2022 - .Add("@CveTipoEmpacado", SqlDbType.Int).Value = CveTipoOrganico - .Add("@CveTipoOrganico", SqlDbType.Int).Value = CveTipoEmpacado + .Add("@CveTipoEmpacado", SqlDbType.Int).Value = CveTipoEmpacado + .Add("@CveTipoOrganico", SqlDbType.Int).Value = CveTipoOrganico End With From 9f628a46e7549e15070516e8cb324591f8479fc8 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Jan 2023 06:06:29 -0700 Subject: [PATCH 07/16] -- cambio en clientes --- Ventas/Clientes.aspx | 356 ++-------------------------------------- Ventas/Clientes.aspx.vb | 32 +--- 2 files changed, 19 insertions(+), 369 deletions(-) diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index ba8e4ec33..97e44ab27 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -1643,7 +1643,7 @@
    -
    +
    @@ -1813,7 +1813,7 @@
    - +
    @@ -1864,7 +1864,7 @@
    -
    +
    @@ -1879,9 +1879,9 @@
    -
    +
    -
    +
    @@ -1892,9 +1892,9 @@
    -
    +
    - + @@ -1905,7 +1905,7 @@
    -
    +
    @@ -1916,7 +1916,7 @@
    -
    +
    @@ -1957,11 +1957,11 @@
    -
    +
    -
    +
       @@ -1978,337 +1978,7 @@
    - - - <%--
    - -
    -
    -
    - - Parametros -
    -
    - -
    -
    -
    - - - - - -
    -
    -
    - -
    -
    -
    -
    - - Estado de Cuenta -
    -
    - -
    -
    -
    - - -
    -
    - -
    - - - - - - -
    -
    -
    - -
    - - - - - - -
    -
    -
    -
    -
    - -
    - - - - - - -
    -
    -
    - -
    - - - - - - -
    -
    -
    - -
    -
    - - - - - -
    - -
    - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    - -    -
    -
    - - - - -
    -
    -
    - -
    -
    - - --%> - - - - +
    @@ -5448,7 +5118,7 @@
    - +
    diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index ec502615f..e0fab1824 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -2963,30 +2963,14 @@ Partial Class Clientes #Region "G R I D V I E W S" Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - Dim HLSendMail As HtmlAnchor = DirectCast(e.Row.FindControl("HLSendMail"), HtmlAnchor) - 'Dim HLRemision As HtmlAnchor = DirectCast(e.Row.FindControl("HLRemision"), HtmlAnchor) - - - e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right - - + Dim HLSendMail As HtmlAnchor = DirectCast(e.Row.FindControl("HLSendMail"), HtmlAnchor) + 'Dim HLRemision As HtmlAnchor = DirectCast(e.Row.FindControl("HLRemision"), HtmlAnchor) + If e.Row.RowIndex = 0 Then e.Row.BackColor = Drawing.Color.LightGray HLSendMail.Visible = False 'HLRemision.Visible = False - End If - - - 'If e.Row.RowIndex > 0 AndAlso e.Row.DBCampo("TipoDocto") <> "Rem" Then - ' HLRemision.Visible = False - 'ElseIf e.Row.RowIndex > 0 AndAlso e.Row.DBCampo("TipoDocto") = "Rem" AndAlso e.Row.DBCampo("CveVentaFacturada") <> String.Empty Then - ' HLRemision.Visible = False - 'End If - 'HLRemision.HRef = $"/Ventas/Ventas.aspx?CveRemision={e.Row.DBCampo("CveVenta")}" - + End If Dim Liga As String = String.Format("< a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">", e.Row.DBCampo("CveVenta")) HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();void(0);}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto")) e.Row.FCLiteral("LtlFactura").Text = String.Format("{1}", e.Row.DBCampo("CveVenta"), e.Row.DBCampo("Folio")) @@ -3007,12 +2991,8 @@ Partial Class Clientes e.Row.Cells(7).Width = Unit.Pixel(90) e.Row.Cells(8).Width = Unit.Pixel(80) e.Row.Cells(9).Width = Unit.Pixel(70) - End If - - e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right - + End If + If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(6).ForeColor = Drawing.Color.Red If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxC" Then e.Row.Cells(4).ForeColor = Drawing.Color.Red If e.Row.DBCampo("Original").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldoOriginal"), Literal).Text = "" From 96886e2689b9c00d3756aa8997ecff1e338848d9 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Jan 2023 06:22:59 -0700 Subject: [PATCH 08/16] - mejora --- Ventas/RepLineasAdicionales.aspx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Ventas/RepLineasAdicionales.aspx b/Ventas/RepLineasAdicionales.aspx index 3953c6bda..d0682f9df 100644 --- a/Ventas/RepLineasAdicionales.aspx +++ b/Ventas/RepLineasAdicionales.aspx @@ -113,7 +113,7 @@ - + @@ -129,9 +129,9 @@ OnRowDataBound="GvLAPO_RowDataBound"> - - - + + + @@ -141,7 +141,7 @@ - +
    From 47f1ae8925ebbe432d1d5c48515aa991a3ba7d8b Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Jan 2023 06:23:12 -0700 Subject: [PATCH 09/16] =?UTF-8?q?--=20correcci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/TraspasoAlmacen.aspx.vb | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index b4088ea7e..076f9ac39 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -3354,29 +3354,6 @@ Partial Class Inventarios_TraspasoAlmacen Return Respuesta End Function - Private Sub CargaDireccionesEnvio() - Dim ObjClientes As New ClsClientes - Dim TieneError = False - - DdlDireccionEnvio.Items.Clear() - If ObjClientes.DireccionEnvioGet(-1, CveCliente, -1) Then - DdlDireccionEnvio.DataSource = ObjClientes.DtResultados.FiltraParametros(String.Format("Estatus = 1")) - DdlDireccionEnvio.DataBind() - 'DdlDireccionEnvio.Items.Insert(0, New ListItem("Seleccione", "-1")) - TmpDTEnvioDireccion = ObjClientes.DtResultados - Else - TieneError = True - End If - - If TieneError Then - Alert("Ocurrió un error al obtener las direcciones de envío", TipoMensaje.MsgError) - End If - - ObjClientes.Dispose() - UpCliente.Update() - - End Sub - #End Region End Class From 6f345a5e8a37033fb1ed27afa575bd1a10c2f41b Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Jan 2023 06:23:25 -0700 Subject: [PATCH 10/16] -- limpieza de archivos --- .../RadScheduler.Main.es-MX.resx | 456 ------------------ App_GlobalResources/RadScheduler.Main.resx | 456 ------------------ .../RadSchedulerRecurrenceEditor.resx | 219 --------- 3 files changed, 1131 deletions(-) delete mode 100644 App_GlobalResources/RadScheduler.Main.es-MX.resx delete mode 100644 App_GlobalResources/RadScheduler.Main.resx delete mode 100644 App_GlobalResources/RadSchedulerRecurrenceEditor.resx diff --git a/App_GlobalResources/RadScheduler.Main.es-MX.resx b/App_GlobalResources/RadScheduler.Main.es-MX.resx deleted file mode 100644 index 4c9d7a4dd..000000000 --- a/App_GlobalResources/RadScheduler.Main.es-MX.resx +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Please do not remove this key. - - - Todo el día - - - Diario - - - Día - - - día(s) - - - Título - - - Descripción - - - Fin despues - - - Fin en - - - Cada - - - Cada día - - - first - - - fourth - - - Inicio - - - Cada Hora - - - hora(s) - - - last - - - día - - - weekday - - - weekend day - - - Mensual - - - mes(es) - - - Más Detalles - - - Sin Fin - - - Veces - - - de - - - de cada - - - Range of recurrence: - - - Repetir cada - - - Perioricidad - - - Recurring task - - - reset exceptions - - - second - - - The - - - third - - - Fin - - - Semanal - - - semana(s) en - - - Anual - - - todo el día - - - Cancelar - - - Cancelar - - - Are you sure you want to delete this appointment? - - - Confirmar eliminar - - - OK - - - Delete only this occurrence. - - - Delete the series. - - - Deleting a recurring appointment - - - Editar solo la cita. - - - Editar la serie. - - - Editar la cita - - - Modificar la cita. - - - Resize the series. - - - Resizing a recurring appointment - - - Move only this occurrence. - - - Move the series. - - - Moving a recurring appointment - - - Día - - - Mes - - - Timeline - - - Multi-day - - - next day - - - previous day - - - hoy - - - Semana - - - Ver 24 horas... - - - Opciones - - - Ver horas trabajo... - - - más... - - - OK - - - Cancelar - - - Hoy - - - Please provide appointment subject - - - Start time must be before end time - - - Start time is required - - - Start date is required - - - End time is required - - - End date is required - - - Invalid number - - - Cargando... - - - Listo - - - New Cita - - - Editar Cita - - - Close - - - Confirm reset exceptions - - - Do you want to delete all existing recurrence exceptions? - - - Guardar - - - Nueva Cita - - - New Recurring Appointment - - - Delete - - - Editar - - - Go to today - - - Recordatorio - - - Recordatorios - - - due in - - - overdue - - - minuto - - - minutos - - - hora - - - horas - - - día - - - días - - - semana - - - semanas - - - - - - - Snooze - - - Dismiss - - - Dismiss All - - - Open Item - - - Click Snooze to be reminded again in: - - - before start - - - Time zone - - \ No newline at end of file diff --git a/App_GlobalResources/RadScheduler.Main.resx b/App_GlobalResources/RadScheduler.Main.resx deleted file mode 100644 index c2873eac0..000000000 --- a/App_GlobalResources/RadScheduler.Main.resx +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Please do not remove this key. - - - All day - - - Daily - - - Day - - - day(s) - - - Subject - - - Description - - - End after - - - End by - - - Every - - - Every weekday - - - first - - - fourth - - - Start time - - - Hourly - - - hour(s) - - - last - - - day - - - weekday - - - weekend day - - - Monthly - - - month(s) - - - More details - - - No end date - - - occurrences - - - of - - - of every - - - Range of recurrence: - - - Recur every - - - Recurrence - - - Recurring task - - - reset exceptions - - - second - - - The - - - third - - - End time - - - Weekly - - - week(s) on - - - Yearly - - - all day - - - Cancel - - - Cancel - - - Are you sure you want to delete this appointment? - - - Confirm delete - - - OK - - - Delete only this occurrence. - - - Delete the series. - - - Deleting a recurring appointment - - - Edit only this occurrence. - - - Edit the series. - - - Editing a recurring appointment - - - Resize only this occurrence. - - - Resize the series. - - - Resizing a recurring appointment - - - Move only this occurrence. - - - Move the series. - - - Moving a recurring appointment - - - Day - - - Month - - - Timeline - - - Multi-day - - - next day - - - previous day - - - today - - - Week - - - Show 24 hours... - - - Options - - - Show business hours... - - - more... - - - OK - - - Cancel - - - Today - - - Please provide appointment subject - - - Start time must be before end time - - - Start time is required - - - Start date is required - - - End time is required - - - End date is required - - - Invalid number - - - Working... - - - Done - - - New Appointment - - - Edit Appointment - - - Close - - - Confirm reset exceptions - - - Do you want to delete all existing recurrence exceptions? - - - Save - - - New Appointment - - - New Recurring Appointment - - - Delete - - - Edit - - - Go to today - - - Reminder - - - Reminders - - - due in - - - overdue - - - minute - - - minutes - - - hour - - - hours - - - day - - - days - - - week - - - weeks - - - None - - - Snooze - - - Dismiss - - - Dismiss All - - - Open Item - - - Click Snooze to be reminded again in: - - - before start - - - Time zone - - \ No newline at end of file diff --git a/App_GlobalResources/RadSchedulerRecurrenceEditor.resx b/App_GlobalResources/RadSchedulerRecurrenceEditor.resx deleted file mode 100644 index 7baa4911c..000000000 --- a/App_GlobalResources/RadSchedulerRecurrenceEditor.resx +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Please do not remove this key. - - - Recurrence - - - Hourly - - - Daily - - - Weekly - - - Monthly - - - Yearly - - - Every - - - hour(s) - - - day(s) - - - week(s) on - - - month(s) - - - Every weekday - - - Recur every - - - Day - - - of every - - - first - - - second - - - third - - - fourth - - - last - - - day - - - weekday - - - weekend day - - - The - - - of - - - No end date - - - End after - - - End by - - - occurrences - - - OK - - - Cancel - - - Today - - \ No newline at end of file From b6dbbb031aacf67ee4b5203f250e488145b72212 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Jan 2023 06:23:43 -0700 Subject: [PATCH 11/16] =?UTF-8?q?--=20correcci=C3=B3n=20de=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SAT/SolicitudesIngresoSat.aspx.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SAT/SolicitudesIngresoSat.aspx.cs b/SAT/SolicitudesIngresoSat.aspx.cs index 4e9d4ba09..6b5e5f4df 100644 --- a/SAT/SolicitudesIngresoSat.aspx.cs +++ b/SAT/SolicitudesIngresoSat.aspx.cs @@ -616,6 +616,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas } catch (Exception ex) { + string a = ex.Message; try { var oReader = new System.IO.StreamReader(f.FullName, System.Text.Encoding.GetEncoding("ISO-8859-1")); @@ -859,6 +860,7 @@ namespace ADSNetLibraryzI.HelpersI.ConexionesI.SIGAPII } catch (Exception e) { + string a = e.Message; //ModExtensiones.GuardaLog(string.Format("{0}{1}{2}{1}{3}{1}{4}{1}", tituloLog, ModVars.NewLine, route, e, strjsonreq), ModVars.ADSNetLibraryLog); } From 5f9ad5f01fc12661afff953279e2a02278ed158c Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Jan 2023 06:24:42 -0700 Subject: [PATCH 12/16] -- mejora en manejo de error al autocontabilizar --- Bancos/IE.aspx.vb | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 94533a423..d3b746536 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -3850,22 +3850,28 @@ Partial Class Bancos_IE 'Conta ContPAQ If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - If IDCtaBeneficiario > 0 And IDCtaContable > 0 Then + Dim AutoConta As Boolean = True + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If Not (IDCtaBeneficiario > 0 And IDCtaContable > 0) Then + AutoConta = False + If IDCtaContable < 1 Then + Alert("No se puede contabilizar la Prepoliza debido a que la cuenta de Bancos es invalida", TipoMensaje.MsgAdvertencia) + End If + If IDCtaBeneficiario < 1 Then + Alert("No se puede contabilizar la Prepoliza debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) + End If + End If + End If + + If AutoConta Then If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then IDPoliza = ObjMov.ContaIdPoliza - 'Alert(alertaContabilizacion & ObjMov.AlertaMensaje, ModExtensiones.TipoMensaje.MsgInformacion) Else Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) MsgError = "Error al contabilizar." End If - Else - If IDCtaContable < 1 Then - Alert("No se puede contabilizar la Prepoliza debido a que la cuenta de Bancos es invalida", TipoMensaje.MsgAdvertencia) - End If - If IDCtaBeneficiario < 1 Then - Alert("No se puede contabilizar la Prepoliza debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) - End If End If + End If If MsgError = "" Then From 0acafb7056047ffc4d665d3ae64337a2006ba1c1 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 16 Jan 2023 07:32:37 -0700 Subject: [PATCH 13/16] --- AF/AF.aspx | 12 ++++++++++++ App_Code/ClsAF.vb | 8 +++++--- App_Code/ClsNominas.vb | 2 +- Nomina/Nomina.aspx.cs | 7 ++++++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/AF/AF.aspx b/AF/AF.aspx index f89764e5b..15b22ec92 100644 --- a/AF/AF.aspx +++ b/AF/AF.aspx @@ -489,6 +489,18 @@
    + +
    +
    + +
    + +
    +
    + +
    +
    +
    diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index 9e5a61305..2a68ffb0a 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -401,7 +401,7 @@ Public Class ClsAF CveSubProyecto As Integer, Cuenta As Integer, CveEstadoActivoFijo As Integer, IdCtaContDepreciacion As Integer, PorDepreciacion As Double, Observaciones As String, CveCliente As Integer, CveMovimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveModelo As Integer = -1, Optional CveGrupo As Integer = -1, Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1, Optional FechaBaja As Date = MinFecha, - Optional Lat As String = "", Optional Longi As String = "") As Integer + Optional Lat As String = "", Optional Longi As String = "", Optional AgroCuenta As String = "") As Integer Dim Retorno As Integer = -1 @@ -437,6 +437,7 @@ Public Class ClsAF .Add("@Lat", SqlDbType.VarChar).Value = Lat .Add("@Long", SqlDbType.VarChar).Value = Longi + .Add("@AgroCuenta", SqlDbType.VarChar).Value = AgroCuenta .Add("@CveActivoFijo", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue @@ -455,7 +456,7 @@ Public Class ClsAF Alert("Capture un SubTipo de Activo Fijo Valido", TipoMensaje.MsgAdvertencia) Else - Alert("Ya existe un Activo Fijo con el mismo nombre: " & Descripcion & ".", TipoMensaje.MsgAdvertencia) + Alert("Ya existe un Activo Fijo con el mismo nombre: " & Descripcion & ".", TipoMensaje.MsgAdvertencia) End If Else @@ -472,7 +473,7 @@ Public Class ClsAF CveEstadoActivoFijo As Integer, IdCtaContDepreciacion As Integer, PorDepreciacion As Double, Observaciones As String, CveCliente As Integer, CveUsuarioModifico As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveModelo As Integer = -1, Optional CveGrupo As Integer = -1, Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1, Optional FechaBaja As Date = MinFecha, - Optional Lat As String = "", Optional Longi As String = "") As Boolean + Optional Lat As String = "", Optional Longi As String = "", Optional AgroCuenta As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_ActivosFijosUpdate") @@ -507,6 +508,7 @@ Public Class ClsAF .Add("@FechaBaja", SqlDbType.Date).Value = FechaBaja .Add("@Lat", SqlDbType.VarChar).Value = Lat .Add("@Long", SqlDbType.VarChar).Value = Longi + .Add("@AgroCuenta", SqlDbType.VarChar).Value = AgroCuenta End With Try diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 78225137a..8bfdbc021 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2624,7 +2624,7 @@ Public Class ClsNominas Dim retorno As Boolean = False Try DTSet = New DataSet() - DataAdapter("PA_Nom_NominaEmpleadosz", CommandType.StoredProcedure) + DataAdapter("PA_Nom_NominaEmpleados", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 2bf50e4a2..186a58525 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -492,7 +492,12 @@ public partial class Nomina_Nomina2 : ClsPaginas CveTipoTrabajador = DdlTipoTrabajador.SelectedValue.ToEntero(); HypPDFSTimbrados.Attributes.Add("onclick", string.Format("GETPDF({0},{1})", -1, FiltCvePeriodo)); cargaDatos(); - LtlPeriodoseleccionado.Text = string.Format("{0} ({1} Empleados)", DdlPeriodo.SelectedItem.Text, dtempleados.COUNT("CvePersonal", " CvePersonal >0 ")); + int empleados = 0; + if(dtempleados != null && dtempleados.Rows.Count>0) + { + empleados = dtempleados.COUNT("CvePersonal", " CvePersonal >0 "); + } + LtlPeriodoseleccionado.Text = string.Format("{0} ({1} Empleados)", DdlPeriodo.SelectedItem.Text, empleados); LtlPeriodoseleccionadoASis.Text = LtlPeriodoseleccionado.Text; } From 1898abc9e76912b2bc45c89bbede6850cc42e9d2 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Jan 2023 08:07:19 -0700 Subject: [PATCH 14/16] --solo mostrar linea adicional, si tiene dato --- Ventas/Clientes.aspx.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index e0fab1824..bff2d9844 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1974,6 +1974,7 @@ Partial Class Clientes If ObjMovtos.GetCxCClienteDetalle(CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero()) Then DtCxCActivas = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda, OrdenVencimiento, FechaVencimiento") GvCxC.DataSource = DtCxCActivas + If DtCxCActivas.MAX("LineaAdicional") = "" Then GvCxC.Columns(6).Visible = False 'solo tomo los 10 ultimos mas el totalizador general Dim dt As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Hist'") DtHistorialCxC = dt From 1a8d92b949ad0bc303be7a88812a25e9ef5fc39a Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 16 Jan 2023 08:53:04 -0700 Subject: [PATCH 15/16] pozo cuenta --- AF/AF.aspx.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 05955771f..c78db8b2b 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -945,6 +945,7 @@ Partial Class AF_AF CargaSubTipoActivoFijo() DdlSubTipoActivoFijo.SelectedValue = ObjActivoFijo.CveSubTipoActivoFijo.ToString() LatLong.Visible = UsuarioActual.CveEmpresa = 158 And ((DdlTipoActivoFijo.SelectedItem.Text.ToUpper() = "POZO") Or (DdlSubTipoActivoFijo.SelectedItem.Text.ToUpper() = "POZO") Or (DdlTipoActivoFijo.SelectedItem.Text.ToUpper() = "POZOS") Or (DdlSubTipoActivoFijo.SelectedItem.Text.ToUpper() = "POZOS")) + TxtAgroCuenta.Text = ObjActivoFijo.DtResultados.Rows(0)("AgroCuenta").ToString() TxtLatitud.Text = ObjActivoFijo.DtResultados.Rows(0)("Lat").ToString() TxtLongitud.Text = ObjActivoFijo.DtResultados.Rows(0)("Long").ToString() @@ -2490,7 +2491,7 @@ Partial Class AF_AF DdlEstadoActivoFijo.SelectedValue.ToEntero, DdlCtaContableDepreciacion.SelectedValue.ToEntero, TxtPorDepreciacion.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, Ddlclientes.SelectedValue.ToEntero, CveMovimientoSalidaInv, UsuarioActual.CveUsuario, CveEmpresaActual, CveMarca:=DdlMarcas.SelectedValue.ToEntero, CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero, - FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text) > 0 Then + FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) > 0 Then ViewState("CveActivoFijo") = ObjAF.CveActivoFijo Else ErrorGuardar = True @@ -2596,7 +2597,7 @@ Partial Class AF_AF DdlSubProyecto.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.Trim.ToEntero, DdlEstadoActivoFijo.SelectedValue.ToEntero, DdlCtaContableDepreciacion.SelectedValue.ToEntero, TxtPorDepreciacion.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, Ddlclientes.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveEmpresaActual, CveMarca:=DdlMarcas.SelectedValue.ToEntero, CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero, - FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text) Then + FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) Then 'Comentado porque te redirecciona no se ocupa - 22 Enero 2016 - Israel Piña 'CargaDatos() From afa022087e7d5caecfe8d59d3944d8fdfda8118c Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Mon, 16 Jan 2023 16:18:37 -0700 Subject: [PATCH 16/16] Actualziar Compra con cambio de tipo de compra --- App_Code/ClsCompras.vb | 3 +- Compras/Compras.aspx.vb | 68 +++++++++++++++++++++++++---- Inventarios/EntradasSalidas.aspx.vb | 12 +++-- 3 files changed, 70 insertions(+), 13 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 5d751b497..e92fdf12d 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -1931,7 +1931,7 @@ Public Class ClsCompras #Region " REFACTURACION " - Public Function GetRefacturacion(CveProveedor As Integer, SubTotal As Double, IVA As Double, Total As Double, Opcion As Integer, CveEmpresa As Integer) As Boolean + Public Function GetRefacturacion(CveProveedor As Integer, SubTotal As Double, IVA As Double, Total As Double, Opcion As Integer, CveEmpresa As Integer, Optional Top As Integer = 100000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_RefacturacionGet") @@ -1942,6 +1942,7 @@ Public Class ClsCompras .Add("@Total", SqlDbType.Float).Value = Total .Add("@Opcion", SqlDbType.Int).Value = Opcion ' 1. Exácta, 2. Con diferencia .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Top", SqlDbType.Int).Value = Top End With Try diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 8c2a90d53..b68c99bc0 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1199,6 +1199,22 @@ Partial Class Compras_Compras End Set End Property + Private Property TipoCompraOriginal As Integer + Get + + If ViewState("TipoCompraOriginal") Is Nothing Then + ViewState("TipoCompraOriginal") = -1 + End If + + Return ViewState("TipoCompraOriginal").ToString.ToEntero + + End Get + Set(value As Integer) + ViewState("TipoCompraOriginal") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -2616,6 +2632,7 @@ Partial Class Compras_Compras CvePrePoliza = dr("CvePrePoliza").ToString.ToEntero EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero DdlTipoCompra.SelectedValueExist(dr("CveTipoCompra")) + TipoCompraOriginal = dr("CveTipoCompra").ToString.ToEntero CveTipoConcepto = dr("CveTipoConcepto").ToString.ToEntero ChkEsNoDeducible.Checked = Boolean.Parse(dr("NoDeducible").ToString) @@ -6391,6 +6408,7 @@ Partial Class Compras_Compras 'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN 'SI LA COMPRA ES DE TIPO GASTO CON ALMACEN DEBE REGISTRAR MOVIMIENTO Dim AlmacenSoloExistencia As Boolean = False + If DdlTipoCompra.SelectedValue <> "10" Then For Each Dr As DataRow In DT.Rows If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then @@ -6400,6 +6418,7 @@ Partial Class Compras_Compras Dr.AcceptChanges() Next End If + DT.AcceptChanges() DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0") If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then @@ -9433,6 +9452,8 @@ Partial Class Compras_Compras Msg.Append("La Compra se actualizó correctamente") Alert(Msg.ToString()) + TipoCompraOriginal = DdlTipoCompra.SelectedValue.ToEntero + Else ObjCompra.RollBack() If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() @@ -9468,7 +9489,8 @@ Partial Class Compras_Compras (row1("CveActivoFijo").ToString.ToEntero <> row2("CveActivoFijo").ToString.ToEntero) Or (row1("AFMedida").ToString.ToEntero <> row2("AFMedida").ToString.ToEntero) Or (row1("TipoAF").ToString.ToEntero <> row2("TipoAF").ToString.ToEntero) Or - (row1("CvePS").ToString.ToEntero <> row2("CvePS").ToString.ToEntero) Then + (row1("CvePS").ToString.ToEntero <> row2("CvePS").ToString.ToEntero Or + DdlTipoCompra.SelectedValue.ToEntero <> TipoCompraOriginal) Then Return False End If End If @@ -9582,6 +9604,7 @@ Partial Class Compras_Compras 'Removemos los conceptos de la prepoliza If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 6, CveCompra, 1) Then ErrorPrepoliza = True 'GASTO If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 68, CveCompra, 1) Then ErrorPrepoliza = True 'ALMACEN + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 95, CveCompra, 1) Then ErrorPrepoliza = True 'GASTO CON ALMACEN RELLENO If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 49, CveCompra, 1) Then ErrorPrepoliza = True 'AF If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 205, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 230, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO @@ -9590,6 +9613,15 @@ Partial Class Compras_Compras If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 228, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 229, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO + + 'SI ES GASTO CON ALMACEN REGISTRA EL CONCEPTO 95 + If DdlTipoCompra.SelectedValue = "10" Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMN, Referencia, 95, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=False) Then + ErrorPrepoliza = True + End If + End If + + 'OBTIENE METODO DE CONTABILIZACIÓN AL GUARDAR Dim ConceptoContabilizacionAlmacen = 0 If ObjCompra.GetCompras(CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then @@ -9659,8 +9691,11 @@ Partial Class Compras_Compras importeMovimiento = 0 IdCtaContable = 0 + + + 'INV [MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA) ] - If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(176, 205) Then + If DdlTipoCompra.SelectedValue.ToEntero <> 10 AndAlso UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(176, 205) Then importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador @@ -9713,18 +9748,29 @@ Partial Class Compras_Compras DT.AcceptChanges() DtAlmacenes.Dispose() - 'QUITA 1-[MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA)] 2-[NC CON PRODUCTOS] - If UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen > 0 Then - DT = DT.FiltraParametros("CveTipoPS <> 2") + + If DdlTipoCompra.SelectedValue.ToEntero <> 10 Then + 'QUITA 1-[MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA)] 2-[NC CON PRODUCTOS] + If UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen > 0 Then + DT = DT.FiltraParametros("CveTipoPS <> 2") + End If End If + Dim DTDistinct = DT.Copy - If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then - DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"}) + + If DdlTipoCompra.SelectedValue.ToEntero = 10 Then + DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto", "CveAlmacen"}) Else - DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"}) + + If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"}) + Else + DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"}) + End If End If + If DTDistinct.Rows.Count > 0 Then For Each Row2 As DataRow In DTDistinct.Rows @@ -9734,6 +9780,12 @@ Partial Class Compras_Compras Else importeMovimiento = DT.SUM("Total", String.Format("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveClasificacion = {0} AND CveSubProyecto = {1} AND ISNULL(CveTipoGasto,0) = {2}", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal End If + + If DdlTipoCompra.SelectedValue.ToEntero = 10 Then + importeMovimiento = DT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"CveAlmacen > 0 ").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen > 0").ToString.ToDecimal + End If + + importeMN = importeMovimiento * tipoCambioActual * Multiplicador 'CLASIFICACION diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 25c18b4f9..c62b4a2ae 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -4623,12 +4623,16 @@ Partial Class Inventarios_EntradasSalidas tIdCtaGasto = 1321 End Select - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorSalida + ValorEntrada, "", 290, tConcepto, Fecha, tIdCtaGasto, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=tCveClasificacion, CveSubProyecto:=tCveSubProyectoSalida, ImporteMX:=ValorSalida + ValorEntrada, Contabilizable:=EsContabilizable) Then - ErrorMovInv = True - Mensaje = "Ocurrió un error al guardar los movimientos contables de ajuste de salida" + If Math.Abs((ValorSalida + ValorEntrada)) <> 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorSalida + ValorEntrada, "", 290, tConcepto, Fecha, tIdCtaGasto, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=tCveClasificacion, CveSubProyecto:=tCveSubProyectoSalida, ImporteMX:=ValorSalida + ValorEntrada, Contabilizable:=EsContabilizable) Then + ErrorMovInv = True + Mensaje = "Ocurrió un error al guardar los movimientos contables de ajuste de salida" + End If End If End If - End If + + + End If If Not ErrorMovInv Then If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then