From fb43822e4835d8bb4014c236293a74143dc33eea Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 May 2024 05:23:13 -0700 Subject: [PATCH 1/6] =?UTF-8?q?--=20prep=C3=B3liza=20de=20cancelaci=C3=B3n?= =?UTF-8?q?=20de=20presupuesto.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OC/OC.aspx.vb | 108 ++++++++++++-------------------------------------- 1 file changed, 26 insertions(+), 82 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index c0c487db9..1c4726a8d 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -6,7 +6,6 @@ Imports System.Data.SqlClient Imports System.IO Imports Extensiones Imports GemBox.Spreadsheet -Imports Microsoft.Owin.Security.Provider Imports Newtonsoft.Json Partial Class OC_OC @@ -926,13 +925,13 @@ Partial Class OC_OC ChkEntregaDirecta.Checked = False End If - If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then - If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then - Alert("PrePoliza de Presupuesto Generada Correctamente") - Else - Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia) - End If - End If + 'If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then + ' If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then + ' Alert("PrePoliza de Presupuesto Generada Correctamente") + ' Else + ' Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia) + ' End If + 'End If End If @@ -2218,51 +2217,11 @@ Partial Class OC_OC Exit Sub End If - - Dim ValImporte As Decimal = (TxtCant.Text.ToDecimal * txtPrecioUnitario.Text.ToDecimal).RoundSQL(2) If Not ValidaPresupuesto(1, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, ValImporte) Then Exit Sub End If - 'If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then - - 'Dim ObjCon As New ClsContratos - 'Dim CvePresupuesto As Integer = 0 - 'Dim Autorizado As Decimal = 0 - 'Dim Ejercido As Decimal = 0 - 'If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then - ' If ObjCon.DtResultados.Rows.Count > 0 Then - ' CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero - ' If CvePresupuesto > 0 Then - ' If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then - ' If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then - ' Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDecimal - ' End If - ' End If - ' If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, - ' DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then - ' If ObjCon.DtResultados.Rows.Count > 0 Then - ' Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal - ' End If - ' End If - ' End If - ' End If - 'End If - 'ObjCon.Dispose() - - 'If CvePresupuesto > 0 And Autorizado > 0 Then - ' Dim Diferencia As Decimal = (Ejercido + If(txtPrecioUnitario.Text.ToDecimal > 0, (txtPrecioUnitario.Text.ToDecimal * TxtCant.Text.ToDecimal) - TxtDescuentoAdd.Text.ToDecimal, 0)) - Autorizado - ' If Diferencia > 0 Then - ' Alert($"No hay presupuesto disponible en el subproyecto {DdlSubProyecto.SelectedItem.Text} y la clasificación {DdlClasificacion.SelectedItem.Text} se excede por {Diferencia.FormatoNumero}", TipoMensaje.MsgAdvertencia) - ' Exit Sub - ' End If - 'End If - 'End If - - - - Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal @@ -3551,8 +3510,7 @@ Partial Class OC_OC End If - - If UsuarioActual.CveEmpresa.Contiene(13, 73) Then + If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then HuboError = True @@ -3560,7 +3518,6 @@ Partial Class OC_OC End If - Catch ex As Exception HuboError = True End Try @@ -3717,6 +3674,10 @@ Partial Class OC_OC TieneError = True End If + If (UsuarioActual.Empresa.Funcionalidad(532) = "1") Then + GeneraPrePolizaPresupuesto(CveOrdenCompra, objOrdenCompra.IniciaTransacSQL, True) + End If + If IDPolizaPresupuestal > 0 AndAlso UsuarioActual.Empresa.UsaAC Then PolizaCancelacion = CancelarAC(ObjAC) @@ -9187,32 +9148,24 @@ Partial Class OC_OC End Function - - Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing) As Boolean + Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing, Optional EsCancelacion As Boolean = False) As Boolean Dim Respuesta As Boolean = True - If UsuarioActual.CveEmpresa.Contiene(13, 73) Then + If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal) If CveMonedaPresupuesto > 1 AndAlso TC = 0 Then - Alert($"No se genero la prepoliza de presupuesto, no se pudo obtener el Tipo de Cambio de la fecha {TxtFecha.Text}", TipoMensaje.MsgAdvertencia) + Alert($"No se genero la póliza de presupuesto, no se pudo obtener el Tipo de Cambio de la fecha {TxtFecha.Text}", TipoMensaje.MsgAdvertencia) Return False End If - Dim ObjConta As New ClsContabilidad() + Dim ObjConta As New ClsContabilidad(transaccion) + Dim CvePrePolizaPresupuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If transaccion Is Nothing Then - ObjConta = New ClsContabilidad() - Else - ObjConta = New ClsContabilidad(transaccion) - End If - - Dim CvePrePolizaPreSuPuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - If CvePrePolizaPreSuPuesto > 0 Then + If CvePrePolizaPresupuesto > 0 Then Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable() Group row By @@ -9232,37 +9185,28 @@ Partial Class OC_OC For Each item In EnumAgrupado Dim SerieFolio = $"OC: {Folio}, Clasificación: {item.Clasificacion}" + Dim Multiplicador As Decimal = If(EsCancelacion, -1, 1) - Dim Importe As Decimal = item.TotalSum - Dim ImporteME As Decimal = If(CveMonedaPresupuesto = 1, 0, item.TotalSum) - Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC) + Dim Importe As Decimal = Multiplicador * item.TotalSum + Dim ImporteME As Decimal = Multiplicador * If(CveMonedaPresupuesto = 1, 0, item.TotalSum) + Dim ImporteMN As Decimal = Multiplicador * If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC) - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then - Respuesta = False - Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPresupuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then + Respuesta = False : Exit For End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, True, Importe, ImporteMN, 152, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then - Respuesta = False - Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPresupuesto, True, Importe, ImporteMN, 152, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then + Respuesta = False : Exit For End If - Next Else Respuesta = False End If - - - End If - Return Respuesta End Function - - #End Region From d4612cdc16c584baaf8dd96a847918c6783399f7 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 May 2024 06:40:08 -0700 Subject: [PATCH 2/6] =?UTF-8?q?--=20correcci=C3=B3n=20globalinvcamiones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b94f14de9..4089af8a5 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1952,12 +1952,18 @@ Public Class ClsPaginas If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjInventarios.DtResultados ObjInventarios.Dispose() End If - Dim Str As New StringBuilder - If CveCamion > 0 Then Str.AppendFormat("CveCamion = {0}", CveCamion) - If CveTipoCamion > 0 Then Str.AppendFormat("CveTipoCamion = {0}", CveTipoCamion) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTInvCamiones = Dv.ToTable - Dv.Dispose() + + Dim filtros As New List(Of String) + If CveCamion >= 0 Then filtros.Add($"CveCamion = {CveCamion} ") + If CveTipoCamion >= 0 Then filtros.Add($"CveTipoCamion = {CveTipoCamion} ") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + GlobalDTInvCamiones = Dv.ToTable + Dv.Dispose() + Else + GlobalDTInvCamiones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If + End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTInvCamiones-{CveEmpresa}" From 148df4f88f0d56c834a45f41af164e85e44c00c7 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 May 2024 06:41:04 -0700 Subject: [PATCH 3/6] =?UTF-8?q?--=20optimizaci=C3=B3n=20a=20utilizar=20Glo?= =?UTF-8?q?balDTInvCamiones=20y=20AutoTransportes=20en=20secci=C3=B3n=20de?= =?UTF-8?q?=20carta=20porte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 82 ++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 56 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 8fd465a2c..ff2980755 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -36045,39 +36045,20 @@ Partial Class Ventas DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa) DdlChofer.DataBind() - DdlChofer.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) - DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa) - DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa) - - 'Using ObjInv As New ClsInventarios - - ' If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then - ' DdlUnidadCamion.DataSource = ObjInv.DtResultados - ' End If - - ' If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then - ' DdlRemolque1.DataSource = ObjInv.DtResultados - ' End If - - 'End Using - + DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=1) DdlUnidadCamion.DataBind() DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) - DdlRemolque1.DataBind() - DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) - - Using ObjGrales As New ClsGenerales - If ObjGrales.GetCartaPorteConfigAutoTransportes() Then - DdlConfigAuto.DataSource = ObjGrales.DtResultados - End If - End Using - + DdlConfigAuto.DataSource = GlobalDTGralCartaPorteConfigAutoTransportes DdlConfigAuto.DataBind() DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1")) + DdlRemolque1.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=2) + DdlRemolque1.DataBind() + DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + UpEmitirTransitorio.Update() End Sub @@ -36091,12 +36072,10 @@ Partial Class Ventas DdlRemolque2.SelectedValueExist(-1) If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then - Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then - DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("CveConfigAutoTransporte")) - DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing) - End If - End Using + + Dim CveConfig As String = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveCamion:=DdlUnidadCamion.SelectedValue.ToEntero, CveTipoCamion:=1).FiltroPrimeroValor("CveConfigAutoTransporte") + DdlConfigAuto.SelectedValueExist(CveConfig) + DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing) End If UpEmitirTransitorio.Update() @@ -36222,27 +36201,24 @@ Partial Class Ventas If DdlConfigAuto.SelectedValue.ToEntero > 0 Then - Using ObjGrales As New ClsGenerales - If ObjGrales.GetCartaPorteConfigAutoTransportes() Then - Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'") + Dim Remolque As String = GlobalDTGralCartaPorteConfigAutoTransportes.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'") + If Remolque <> "" Then - If Remolque = "1" Then - RequiereRemolque = True - MostrarRemolques = True - End If - - If Remolque = "0, 1" Then - RequiereRemolque = False - MostrarRemolques = True - End If - - If Remolque = "0" Then - RequiereRemolque = False - MostrarRemolques = False - End If + If Remolque = "1" Then + RequiereRemolque = True + MostrarRemolques = True End If - End Using + If Remolque = "0, 1" Then + RequiereRemolque = False + MostrarRemolques = True + End If + + If Remolque = "0" Then + RequiereRemolque = False + MostrarRemolques = False + End If + End If Else RequiereRemolque = False MostrarRemolques = False @@ -36266,13 +36242,7 @@ Partial Class Ventas If DdlRemolque1.SelectedValue.ToEntero > 0 Then DvRemolque2.Visible = True - - Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then - DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}") - End If - End Using - + DdlRemolque2.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=2) DdlRemolque2.DataBind() Else DvRemolque2.Visible = False From 895fec5199e863d1d46f1ddb89609000b8e76f90 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 May 2024 07:41:43 -0700 Subject: [PATCH 4/6] -- ajustes para rep vencimientos --- Ventas/RepVencimientosCredito.aspx | 120 +--------------- Ventas/RepVencimientosCredito.aspx.cs | 196 ++------------------------ 2 files changed, 17 insertions(+), 299 deletions(-) diff --git a/Ventas/RepVencimientosCredito.aspx b/Ventas/RepVencimientosCredito.aspx index 4e0d07699..6e137229f 100644 --- a/Ventas/RepVencimientosCredito.aspx +++ b/Ventas/RepVencimientosCredito.aspx @@ -113,144 +113,38 @@ -
" style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
-
- -
-
- " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
-
- +
- - + + - - - + - - - - - - - - - - - - - - - - - -
-
- - -
-
- -
-
-
-
- - -
-
-
- -
- - - - - - - <%-- MODAL COMPROBANTE --%> - - <%-- FIN MODAL COMPROBANTE --%> - - - - - + diff --git a/Ventas/RepVencimientosCredito.aspx.cs b/Ventas/RepVencimientosCredito.aspx.cs index 8c7d13ece..bcd923158 100644 --- a/Ventas/RepVencimientosCredito.aspx.cs +++ b/Ventas/RepVencimientosCredito.aspx.cs @@ -88,58 +88,20 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas LnkDescargaExcel.Visible = false; ClsVentas objVentas = new ClsVentas(); - - int CveProveedor = -1; - - if(TipoLinea == 1) + + if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), -1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveEmpresa)) { - if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), 1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveEmpresa)) - { - GvD.DataSource = objVentas.DtResultados; + GvD.DataSource = objVentas.DtResultados; - if (objVentas.DtResultados.Rows.Count > 0) - { - DTDatosGvD = objVentas.DtResultados; - LnkDescargaExcel.Visible = true; - UpAcciones.Update(); - } - } - else + if (objVentas.DtResultados.Rows.Count > 0) { - GvD.DataSource = null; + DTDatosGvD = objVentas.DtResultados; + LnkDescargaExcel.Visible = true; + UpAcciones.Update(); } } - else - { - - if (DdlAgrupador.SelectedValue.ToEntero()== 1){ - GvLAPO.Columns[0].HeaderText = "Comercializador"; - } - else - { - GvLAPO.Columns[0].HeaderText = "Cliente"; - } - - if (objVentas.RepLineasAdicionales(DdlAgrupador.SelectedValue.ToEntero(), -1, DdlClientes.SelectedValue.ToEntero(), CveProveedor, 2, -1, MinFecha, MaxFecha, DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)) - { - GvLAPO.DataSource = objVentas.DtResultados; - - if (objVentas.DtResultados.Rows.Count > 0) - { - DTDatosGvD = objVentas.DtResultados; - LnkDescargaExcel.Visible = true; - UpAcciones.Update(); - } - } - else - { - GvLAPO.DataSource = null; - } - } - objVentas.Dispose(); GvD.DataBind(); - GvLAPO.DataBind(); UpLineasAdicionales.Update(); } @@ -155,116 +117,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas RegistraScript("$('#ModalComprobante').modal('show');",""); } - protected void BtnAddComprobante_Click(object sender, EventArgs e) - { - bool errorCargaComprobante = false; - string FileExtension = "-1"; - List filesgral = Anexo.getfiles().Archivos; - string filemove = ""; - FileInfo fiNuevo; - - DirectoryInfo df = new DirectoryInfo($@"{UsuarioActual.Empresa.Ruta}\LineasAdicionales\"); - - //Crea directorio si no existe - if (!df.Exists) - { - try - { - Directory.CreateDirectory(df.FullName); - } - catch - { - errorCargaComprobante = true; - } - } - - //borrar archivo anterior - if((!errorCargaComprobante) && LineaAdicionalComprobante.Length > 0) - { - FileInfo fiAnterior = new FileInfo($@"{df.FullName}{LineaAdicionalComprobante}"); - if (fiAnterior.Exists) - { - try - { - File.Delete(fiAnterior.FullName); - } - catch - { - errorCargaComprobante = true; - } - } - } - - if(!errorCargaComprobante){ - - string RutaArchivoTemp = ""; - foreach (Archivo fileItem in filesgral) - { - FileExtension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", ""); - filemove = fileItem.filename; - RutaArchivoTemp = $@"{AppDomain.CurrentDomain.BaseDirectory}\Temp\{fileItem.filename}"; - break; - } - - if((!errorCargaComprobante) && RutaArchivoTemp.Length > 0) - { - fiNuevo = new FileInfo(RutaArchivoTemp); - - if (fiNuevo.Exists) - { - try - { - if (File.Exists($@"{df.FullName}\{CveVenta}{fiNuevo.Extension}")) - { - File.Delete($@"{df.FullName}\{CveVenta}{fiNuevo.Extension}"); - } - File.Move(fiNuevo.FullName, $@"{df.FullName}\{CveVenta}{fiNuevo.Extension}"); - errorCargaComprobante = false; - } - catch - { - errorCargaComprobante = true; - } - if (!errorCargaComprobante) - { - ClsVentas objVentas = new ClsVentas(); - if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicional, CveVenta, $@"{CveVenta}{fiNuevo.Extension}", -1, UsuarioActual.CveEmpresa)) - { - errorCargaComprobante = true; - } - objVentas.Dispose(); - } - } - } - } - - if (!errorCargaComprobante) - { - CargaDatos(); - Anexo.Text = "[]"; - RegistraScript("$('#ModalComprobante').modal('hide');", ""); - Alert("Comprobante actualizado correctamente."); - } - UpAddComprobancte.Update(); - } - - protected void LnkCambiarEstatus_Click(object sender, EventArgs e) - { - GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer; - int CveLineaAdicionalActualzarEstatus = GvRow.DataKey("CveLineaAdicional").ToEntero(); - int CveVenta = GvRow.DataKey("CveVenta").ToEntero(); - bool errorCambioEstatus = false; - ClsVentas objVentas = new ClsVentas(); - if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicional, CveVenta, "", 2, UsuarioActual.CveEmpresa)) - { - errorCambioEstatus = true; - } - if (!errorCambioEstatus) - { - CargaDatos(); - } - objVentas.Dispose(); - } + protected void LnkDescargaExcel_Click(object sender, EventArgs e) { @@ -273,14 +126,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas GridView gvTemp = GvD; //gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString()); gvTemp.ExportToExcelGembox("RepLineasAdicionales", UsuarioActual, "Rep Lineas Adicionales", AnchoImagen: 150); - } - else if(TipoLinea == 2) - { - GridView gvTemp = GvLAPO; - gvTemp.Columns[12].Visible = false; - //gvTemp.ExportToExcelX("ReportePO" + NowADS().ToShortDateString()); - gvTemp.ExportToExcelGembox( "ReportePO", UsuarioActual, "Reporte PO ", AnchoImagen:150); - } + } } protected void GvLAPO_RowDataBound(object sender, GridViewRowEventArgs e) @@ -351,28 +197,6 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas } } - protected void GvLAPO_RowCommand(object sender, GridViewCommandEventArgs e) - { - if (e.CommandName == "Estatus") - { - GridViewRow GvRow = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer; - int CveLineaAdicionalActualizarEstatus = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero(); - int CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero(); - - bool errorCambioEstatus = false; - //int cveestatus = e.CommandArgument.ToEntero() + 2; //pasar al siguiente estatus - - ClsVentas objVentas = new ClsVentas(); - if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicionalActualizarEstatus, CveVenta,"", 2, UsuarioActual.CveEmpresa)) - { - errorCambioEstatus = true; - } - objVentas.Dispose(); - if (!errorCambioEstatus) - { - CargaDatos(); - } - } - } + } \ No newline at end of file From 31df51a525126bd631084c8614436e29df1cc262 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 28 May 2024 15:16:13 -0700 Subject: [PATCH 5/6] RegPrepolizas Ajustes tooltip modulo, Proveedores Abonar Pago de pesos en dolares ajuste tc --- Bancos/ProveedoresAbonar.aspx | 2 +- Bancos/ProveedoresAbonar.aspx.vb | 18 ++++++++++++++++-- Contabilidad/RegPrePolizaS.aspx | 4 ++-- Contabilidad/RegPrePolizaS.aspx.vb | 8 ++++---- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index 1e7945306..1f8fa17e7 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -67,7 +67,7 @@
T.C.: - + diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index a1791b726..3c3ba9bb5 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -327,9 +327,21 @@ Partial Class Bancos_ProveedoresAbonar Private Sub CambiaTipoMoneda() If DivTC.Visible Then + TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) - If ChkPagarDolares.Checked Then RegistraScript("CambiaPesosDolares();") - If ChkPagarPesos.Checked Then RegistraScript("CambiaDolaresPesos();") + + If ChkPagarDolares.Checked Then + 'RegistraScript("CambiaPesosDolares();") + RegistraScript("CambiaDolaresPesos();") + + End If + + If ChkPagarPesos.Checked Then + 'RegistraScript("CambiaDolaresPesos();") + RegistraScript("CambiaPesosDolares();") + + End If + End If UpDatos.Update() End Sub @@ -1343,6 +1355,7 @@ Partial Class Bancos_ProveedoresAbonar CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) + TxtTC.Attributes.Add("onblur", "CambiaPesosDolares()") Else DivTC.Visible = False CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) @@ -1362,6 +1375,7 @@ Partial Class Bancos_ProveedoresAbonar CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) + TxtTC.Attributes.Add("onblur", "CambiaDolaresPesos()") Else 'DivDolaresDolares.Visible = False CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 6e0db8830..8034c63ca 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -187,8 +187,8 @@
- - + +
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index f3cc6a70e..c8c47d2f5 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -324,7 +324,7 @@ Partial Class ContabilidadC_RegPrePolizaS TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy") TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy") TxtConcepto.Enabled = True - TxtUsuarioElaboro.Text = UsuarioActual.Nombre + LblUsuarioElaboro.Text = UsuarioActual.Nombre End If @@ -352,7 +352,7 @@ Partial Class ContabilidadC_RegPrePolizaS TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy") TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy") TxtConcepto.Enabled = True - TxtUsuarioElaboro.Text = UsuarioActual.Usuario + LblUsuarioElaboro.Text = UsuarioActual.Usuario End If @@ -453,13 +453,13 @@ Partial Class ContabilidadC_RegPrePolizaS Folio = dr("FolioPoliza").ToString TxtFolio.Text = dr("FolioPoliza").ToString - TxtUsuarioElaboro.Text = dr("UsuarioNombre").ToString + LblUsuarioElaboro.Text = dr("UsuarioNombre").ToString TxtFechaelaboracion.Text = dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy") TxtFechaelaboracion.ToolTip = dr("FechaIng").ToString.ToDate.ToString("HH:mm:ss") CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString.ToEntero DdlPlantilla.SelectedValueExist(CvePlantillaPoliza) - If UsuarioActual.CveRol = 1 Then TxtUsuarioElaboro.ToolTip = dr("Modulo").ToString + LblUsuarioElaboro.ToolTip = dr("Modulo").ToString If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then LnkAddConcepto.Visible = True From 4fe9b4cbbe8508b3c73fa89a9eda0b45da915dca Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 29 May 2024 08:24:49 -0700 Subject: [PATCH 6/6] Comisiones SMS --- App_Code/ClsVentas.vb | 72 +++++++++++++++++++++++++++++++ Ventas/RepComisionesSMS.aspx | 76 +++++++++++++++++++++++++++++++++ Ventas/RepComisionesSMS.aspx.vb | 22 ++++++++++ 3 files changed, 170 insertions(+) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 594d3d247..9c0166f39 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -6932,6 +6932,78 @@ Public Class ClsVentas #End Region +#Region "VENTAS MEDICAS COMISIONES ESPECIALES" + + Public Function GetComisionesMedicasEsPeciales(CveMedico As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ComisionesMedicasEspecialesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMedico", SqlDbType.Int).Value = CveMedico + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las comisiones especiales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + Public Function AddComisionesMedicasEspeciales(CveMedico As Integer, CvePS As Integer, TipoComision As Integer, Comision As Decimal, CveUsuario As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ComisionesMedicasEspecialesAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMedico", SqlDbType.Int).Value = CveMedico + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@TipoComision", SqlDbType.Int).Value = TipoComision + .Add("@Comision", SqlDbType.Money).Value = Comision + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agegar la comisión especial", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + Public Function RemoveComisionesMedicasEspeciales(CveMedicoComision As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ComisionesMedicasEspecialesRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMedicoComision", SqlDbType.Int).Value = CveMedicoComision + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la comision especial.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + +#End Region + #Region "DEVOLUICON" Public Function UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle As Integer, CantidadDevolucion As Decimal) As Boolean diff --git a/Ventas/RepComisionesSMS.aspx b/Ventas/RepComisionesSMS.aspx index 90ecbd1d1..06a549484 100644 --- a/Ventas/RepComisionesSMS.aspx +++ b/Ventas/RepComisionesSMS.aspx @@ -19,6 +19,9 @@
  • +
  • +
  • +
  • Excel @@ -280,6 +283,79 @@ + + + + + diff --git a/Ventas/RepComisionesSMS.aspx.vb b/Ventas/RepComisionesSMS.aspx.vb index ebee4433a..2e95951d9 100644 --- a/Ventas/RepComisionesSMS.aspx.vb +++ b/Ventas/RepComisionesSMS.aspx.vb @@ -248,4 +248,26 @@ Partial Class Ventas_RepComisionesSMS End If End Sub + +#Region "COMISIONES ESPECIALES" + + Protected Sub LnkComisionesEspeciales_Click(sender As Object, e As EventArgs) + + CargaComisionesEspeciales() + RegistraScript("$('#DvModalComisionesEspeciales').modal('show');") + + End Sub + + Private Sub CargaComisionesEspeciales() + + End Sub + + Protected Sub LnkEliminarComisionEspecial_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + End Sub + +#End Region + + + End Class