diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 29e08b635..24713eabf 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -794,6 +794,69 @@ Public Class ClsAcumuladores #End Region +#Region "P O L I Z A - V I R T U A L" + Public Function AddPolizaVirtual(CveVenta As Integer, CveVentaDetalle As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, Descuento As Decimal, Total As Decimal, + TipoServicio As Integer, TipoPoliza As Integer, CveModeloAuto As Integer, AnioVehiculo As Integer, TieneUsado As Boolean, FechaUsado As DateTime, + CvePSUsado As Integer, CveBCIUsado As Integer) As Boolean + Dim Retorno As Boolean = False + SqlDataAdapter("PA_Vta_PolizaVirtualAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Cantidad", SqlDbType.Float).Value = Cantidad + .Add("@PU", SqlDbType.Money).Value = PU + .Add("@Descuento", SqlDbType.Money).Value = Descuento + .Add("@Total", SqlDbType.Money).Value = Total + .Add("@TipoServicio", SqlDbType.Int).Value = TipoServicio + .Add("@TipoPoliza", SqlDbType.Int).Value = TipoPoliza + .Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto + .Add("@AnioVehiculo", SqlDbType.Int).Value = AnioVehiculo + .Add("@TieneUsado", SqlDbType.Bit).Value = TieneUsado + .Add("@FechaUsado", SqlDbType.DateTime).Value = FechaUsado + .Add("@CvePSUsado", SqlDbType.Int).Value = CvePSUsado + .Add("@CveBCIUsado", SqlDbType.Int).Value = CveBCIUsado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un al agregar la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetPolizasVirtuales(CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + SqlDataAdapter("PA_Vta_PolizaVirtualGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un al obtener la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function UpdateEnvioPolizaVirutal(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime) As Boolean + Dim Retorno As Boolean = False + SqlDataAdapter("PA_Vta_PolizaVirtualEnvioUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual + .Add("@Envio", SqlDbType.TinyInt).Value = Envio + .Add("@FechaEnvio", SqlDbType.DateTime).Value = FechaEnvio + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un al actualizar el envio de la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function +#End Region + Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer, CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, Optional CveMovimiento As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index f35f52a0b..f363d1dfe 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -191,7 +191,7 @@ Public Class ClsCompras AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional IdPoliza As Integer = -1, Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1, Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Double = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, - Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveConceptoContable As Integer = -1) As Boolean + Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1) As Boolean Dim Retorno As Boolean = False @@ -240,7 +240,7 @@ Public Class ClsCompras .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible .Add("@CveTipoCompra", SqlDbType.Int).Value = CveTipoCompra .Add("@TotalOriginal", SqlDbType.Money).Value = TotalOriginal - .Add("@CveTipoConcepto", SqlDbType.Int).Value = CveConceptoContable + .Add("@CveTipoConcepto", SqlDbType.Int).Value = CveTipoConcepto End With Try diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 02121ae13..2efbc2f65 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -1629,9 +1629,12 @@ Public Class ClsContratos #Region "T I P O S C O N T R A T O S" - Public Function GetContratosTipos() As Boolean + Public Function GetContratosTipos(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 18fbe3683..7b8d53ecf 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -4832,7 +4832,69 @@ Public Class ClsInventarios #End Region - +#Region "Camiones" + Public Function GetCamiones(CveCamion As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_CamionesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCamion", SqlDbType.Int).Value = CveCamion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de obtener el listado de camiones", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function AddCamiones(Placa As String, Especificacion As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_CamionesAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Placa", SqlDbType.VarChar).Value = Placa + .Add("@Especificacion", SqlDbType.VarChar).Value = Especificacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de insertar el nuevo camion", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function RemoveCamiones(CveCamion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_CamionesRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCamion", SqlDbType.Int).Value = CveCamion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de eliminar un camion", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_CamionesUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCamion", SqlDbType.Int).Value = CveCamion + .Add("@Placa", SqlDbType.VarChar).Value = Placa + .Add("@Especificacion", SqlDbType.VarChar).Value = Especificacion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de actualizar el camion", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function +#End Region #Region " IDisposable Support " ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 468f9e2d7..c096aacfe 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1673,12 +1673,27 @@ Public Class ClsPaginas Application("GlobalDTContratos") = value End Set End Property - Property GlobalDTContratosTipos() As DataTable + Property GlobalDTContratosTipos(CveEmpresa As Integer) As DataTable Get - GlobalDTContratosTipos = DirectCast(Application("GlobalDTContratosTipos"), DataTable) + Dim AppNombre As String = String.Format("GlobalDTContratosTipos{0}", CveEmpresa) + If Application(AppNombre) Is Nothing Then + Dim ObjContratos As New ClsContratos + If ObjContratos.GetContratosTipos(CveEmpresa) Then + Application(AppNombre) = ObjContratos.DtResultados + If CveEmpresa <> -1 Then + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + GlobalDTContratosTipos = Dv.ToTable + Dv.Dispose() + Else + GlobalDTContratosTipos = DirectCast(Application(AppNombre), DataTable) + End If + End If + End If + GlobalDTContratosTipos = DirectCast(Application("GlobalDTContratosTipos"), DataTable) End Get Set(value As DataTable) - Application("GlobalDTContratosTipos") = value + Dim AppNombre As String = String.Format("GlobalDTContratosTipos{0}", CveEmpresa) + Application(AppNombre) = value End Set End Property Property GlobalDTTipoAlmacen(CveEmpresa As Integer) As DataTable diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index eeffb9d57..06a030092 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1347,6 +1347,13 @@ Namespace Modelos Dim rowInv As DataRow = DtRecepcionUsados.Select($"CvePS={Row("CvePS").ToString.ToEntero}")(0) rowInv("CveVentaDetalle") = ObjVentas.CveVentaDetalle End If + End If + + If DtPolizasVirtuales IsNot Nothing Then + If DtPolizasVirtuales.Select($"CvePS={Row("CvePS").ToString.ToEntero}").Length > 0 Then + Dim RowPoliza As DataRow = DtPolizasVirtuales.Select($"CvePS={Row("CvePS").ToString.ToEntero}")(0) + RowPoliza("CveVentaDetalle") = ObjVentas.CveVentaDetalle + End If End If 'Agregamos el gasto de contrato @@ -1376,7 +1383,7 @@ Namespace Modelos End If Next - 'Bonificacion Usados + 'BONIFICACION USADOS If UsadosBonificacion IsNot Nothing AndAlso UsadosBonificacion.Count > 0 AndAlso TipoBonificacion > 0 Then For Each CveMovto In UsadosBonificacion If Not ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, TipoBonificacion, CveVenta) Then @@ -1385,7 +1392,7 @@ Namespace Modelos Next End If - 'Ajustes' + 'AJUSTES' If DtAjustes IsNot Nothing AndAlso DtAjustes.Rows.Count > 0 Then For Each Dr As DataRow In DtAjustes.Rows If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero, @@ -1396,7 +1403,14 @@ Namespace Modelos Next End If - 'Orden Produccion' + 'POLIZA VIRTUAL + If factura.DtPolizasVirtuales IsNot Nothing AndAlso factura.DtPolizasVirtuales.Rows.Count > 0 Then + If Not GuardarPolizasVirtuales(ObjVentas.IniciaTransacSQL(), ObjFactura:=factura) Then + ErrorList.Add("Ocurrió un error al actualizar el distribuidor.") + End If + End If + + 'ORDEN PRODUCCION' If UsuarioActual.CveEmpresa.Contiene(126) Then If ObjVentas.CveVenta > 0 And factura.CveOrdenProduccion > 0 Then If Not ObjCGame.UpdateOrdenProduccionVenta(factura.CveOrdenProduccion, ObjVentas.CveVenta) Then @@ -1861,6 +1875,27 @@ Namespace Modelos Return Resultado + End Function + Private Function GuardarPolizasVirtuales(SqlTransaccion As SqlClient.SqlTransaction, ObjFactura As Modelos.Factura) As Boolean + Dim Resultado As Boolean = True + + If UsuarioActual.Empresa.Funcionalidad(531).ToEntero > 0 AndAlso ObjFactura.TipoDocto.Contiene("Rem") Then + + Dim ObjAcum As New ClsAcumuladores(SqlTransaccion) + + For Each drow As DataRow In ObjFactura.DtPolizasVirtuales.Rows + If ObjAcum.AddPolizaVirtual(ObjFactura.CveVenta, drow("CveVentaDetalle").ToString().ToEntero(), drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("Descuento").ToString.ToDecimal, + drow("Total").ToString.ToDecimal, drow("TipoServicio").ToString.ToEntero, drow("TipoPoliza").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero, drow("AnioVehiculo").ToString.ToEntero, CBool(drow("TieneUsado").ToString), + drow("FechaUsado").ToString().ToDateTime, drow("CvePSUsado").ToString.ToEntero, drow("CveBCIUsado").ToString.ToEntero) Then + Else + Resultado = False + Exit For + End If + Next + End If + + Return Resultado + End Function Private Sub GuardarVentaPrePolizas(ByRef factura As Modelos.Factura, ByRef ObjConta As ClsContabilidad, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing) @@ -5131,7 +5166,8 @@ Namespace Modelos Public Property DtDetalle As Data.DataTable Public Property DtDetalleAC As Data.DataTable Public Property DtAjustes As Data.DataTable - Public Property DtRecepcionUsados As Data.DataTable + Public Property DtRecepcionUsados As Data.DataTable + Public Property DtPolizasVirtuales As Data.DataTable Public Property DtVentasNC As Data.DataTable Public Property DtDeduccion As Data.DataTable Public Property DtFirmas As Data.DataTable diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 2a531ef0d..4fe2b853f 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -890,13 +890,13 @@ Namespace Extensiones Public Function RoundSQL(Valor As Double, Optional Decimales As Integer = 2) As Double 'Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero) 'primero, se redondea a 4, para que concuerde al redondeo de sql, si se redondea a 2 decimales por ejemplo - Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, MidpointRounding.AwayFromZero)) + Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)) End Function Public Function RoundSQL(Valor As Decimal, Optional Decimales As Integer = 2) As Decimal 'primero, se redondea a 4, para que concuerde al redondeo de sql - Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, MidpointRounding.AwayFromZero)) + Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)) End Function Public Function Abs(Valor As Double) As Double diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index faf915fda..ec5a98394 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -41,6 +41,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState GetUser(context) Case "ActualizaPreP" ActualizaPrePoliza(context) + Case "getpersonal" + getpersonal(context) End Select Catch ex As Exception @@ -201,7 +203,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}") If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then - DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%'") + DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%' OR Nombre like '%{Name}%' ") End If End If @@ -686,4 +688,50 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState #End Region + +#Region "Get Personal" + Private Function getpersonal(ByVal context As HttpContext) As String + Dim retorno As String = "" + Dim DtRetorno As DataTable = Nothing + + Dim usuario As Usuario = UsuarioActual(context) + Dim CveEmpresa As String + If IsNothing(usuario) Then + context.Response.Write("") + Else + CveEmpresa = usuario.CveEmpresa + Dim Name = IfNull(context.Request("Name"), "-1").ToString + Dim AppNombre As String = String.Format("GlobalDTRHPersonal{0}", CveEmpresa) + 'sino existe, recarga los datos + If context.Application(AppNombre) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, CveEmpresa) Then + context.Application(AppNombre) = ObjPersonal.DtResultados + End If + ObjPersonal.Dispose() + End If + + 'Dim ObjProveedores As New ClsCompProveedores + 'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then + ' DtRetorno = ObjProveedores.DtResultados + 'End If + 'ObjProveedores.Dispose() + Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}") + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'") + End If + End If + + If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then + DtRetorno.Columns("CvePersonal").ColumnName = "id" + DtRetorno.Columns("NombreCompleto").ColumnName = "text" + retorno = JsonConvert.SerializeObject(DtRetorno).ToString + context.Response.Write(retorno) + Else + context.Response.Write("[]") + End If + + Return retorno + End Function +#End Region End Class \ No newline at end of file diff --git a/Bancos/RepEgresosSinComprobante.aspx.vb b/Bancos/RepEgresosSinComprobante.aspx.vb index 6f69c7760..9cbb22665 100644 --- a/Bancos/RepEgresosSinComprobante.aspx.vb +++ b/Bancos/RepEgresosSinComprobante.aspx.vb @@ -7,8 +7,8 @@ Imports Microsoft.Reporting.WebForms Imports System.Linq Partial Class Bancos_RepEgresosSinComprobante - Inherits ClsPaginas - + Inherits ClsPaginas + #Region " PROPIEDADES " Private Property DtDatos As DataTable Get @@ -25,9 +25,9 @@ Partial Class Bancos_RepEgresosSinComprobante Set(value As DataTable) ViewState("DtFuncionariosEmpleados") = value End Set - End Property + End Property #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then @@ -295,12 +295,16 @@ Partial Class Bancos_RepEgresosSinComprobante Dim CveCuenta As Integer = 0 Dim IdCtaContPersonal As Integer = 0 Dim CveConceptoContable As Integer + Dim TipoMovtoOtIngresos As Boolean = True + Dim TipoMovtoConcepto As Boolean = False Select Case gr.DataKey("CveConceptoContable").ToEntero Case 10 CveConceptoContable = 21 Case 28 CveConceptoContable = 29 + TipoMovtoOtIngresos = False + TipoMovtoConcepto = True Case 37 CveConceptoContable = 43 Case 42 @@ -324,14 +328,14 @@ Partial Class Bancos_RepEgresosSinComprobante CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldo de ExC por Sistema", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, gr.DataKey("Saldo").ToDecimal, "", CveConceptoContable, "Saldo de ExC por Sistema", Now, -1, -1, + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoConcepto, gr.DataKey("Saldo").ToDecimal, "", CveConceptoContable, "Saldo de ExC por Sistema", Now, -1, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=CveCuenta) Then MsgError = "Ocurrio un error al saldar el movimiento" Exit For End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de ExC por Sistema", Now, -1, -1, gr.DataKey("CveIE").ToEntero, + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOtIngresos, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de ExC por Sistema", Now, -1, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=CveCuenta) Then MsgError = "Ocurrio un error al saldar el movimiento" Exit For @@ -392,33 +396,33 @@ Partial Class Bancos_RepEgresosSinComprobante End If ImprimirPDF($"Empresas/Grales/Formatos/{Archivo}", DtDatos, params, String.Format("EgresosSinComprovante-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato) End If - End Sub - + End Sub + #Region "PROVEEDORES" - + Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click ImprimirReportePdf("RepEgresosSinComprobante.rdlc", DtDatos.FiltraParametros(" RazonSocial is not null "), "EXCEL") End Sub Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click ImprimirReportePdf("RepEgresosSinComprobante.rdlc", DtDatos.FiltraParametros(" RazonSocial is not null ")) - End Sub - + End Sub + #End Region - + #Region "FUNCIONARIOS/EMPLEADOS" - + Protected Sub LnkExportarFuncionarios_Click(sender As Object, e As EventArgs) ImprimirReportePdf("RepEgresosSinComprobanteFuncionarios.rdlc", DtFuncionariosEmpleados, "EXCEL") End Sub Protected Sub LnkPDFFuncionarios_Click(sender As Object, e As EventArgs) ImprimirReportePdf("RepEgresosSinComprobanteFuncionarios.rdlc", DtFuncionariosEmpleados) - End Sub - + End Sub + #End Region - + #End Region - - - + + + End Class diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index bac62de39..a08826ba7 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1102,12 +1102,12 @@ Partial Class Compras_Compras End Set End Property - Private Property CveConceptoContable As Integer + Private Property CveTipoConcepto As Integer Get - Return ViewState("CveConceptoContable").ToString.ToEntero + Return ViewState("CveTipoConcepto").ToString.ToEntero End Get Set(value As Integer) - ViewState("CveConceptoContable") = value + ViewState("CveTipoConcepto") = value End Set End Property @@ -1130,7 +1130,7 @@ Partial Class Compras_Compras SubTotalOriginal = 0 CveConceptoContableAlmacen = 0 EsNoDeducible = False - + CveTipoConcepto = 1 '******** Prorrateo ******************************************** If UsuarioActual.Empresa.Funcionalidad(117) <> "" Then btnProrateo.Visible = True @@ -1595,23 +1595,20 @@ Partial Class Compras_Compras HplAddClasificacion.Visible = False ImgClasificacion.Visible = False - End If - CveConceptoContable = 5 - - - - 'If CargoFactura Then - ' 'If UsuarioActual.Empresa.Funcionalidad(128) = "1" Then - ' ' If TmpDT.MAX("CvePS").ToEntero > 0 Then - ' ' BtnGuardar.Enabled = False - ' ' RegistraScript($"AbrirVentana('/OC/PopUpBuscarReq.aspx?V=VOCCOMP&P={CveProveedor}&Masterimpoup=true',1000,600,'S'); return false;") - - ' ' End If - ' 'End If - 'End If - - - 'RegistraScript("ScrollVentanaAddProducto();") + End If + + 'If CargoFactura Then + ' 'If UsuarioActual.Empresa.Funcionalidad(128) = "1" Then + ' ' If TmpDT.MAX("CvePS").ToEntero > 0 Then + ' ' BtnGuardar.Enabled = False + ' ' RegistraScript($"AbrirVentana('/OC/PopUpBuscarReq.aspx?V=VOCCOMP&P={CveProveedor}&Masterimpoup=true',1000,600,'S'); return false;") + + ' ' End If + ' 'End If + 'End If + + + 'RegistraScript("ScrollVentanaAddProducto();") End Sub #Region "C A R G A S" @@ -2244,7 +2241,7 @@ Partial Class Compras_Compras TxtDocumentoImporteCaja.Text = TotalTemp.FormatoNumero TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True - If OtrosImpuestosRetenciones > 0 Then TrOtrosImpuestos.Visible = True : TxtOtrosImpuestos.Text = OtrosImpuestosRetenciones.FormatoNumero + If OtrosImpuestosRetenciones > 0 Then TrOtrosImpuestos.Visible = True : TxtOtrosImpuestos.Text = (-OtrosImpuestosRetenciones).FormatoNumero HFDiferenciaCompra.Value = TxtTotal.Text HdnCompraSaldo.Value = TotalTemp.ToString CompraSaldo = TotalTemp @@ -2501,7 +2498,8 @@ Partial Class Compras_Compras DdlRetIVAConcepto.SelectedValueExist(dr("CveRetIVAConcepto").ToString) - DdlRetISRConcepto.SelectedValueExist(dr("CveRetISRConcepto").ToString) + DdlRetISRConcepto.SelectedValueExist(dr("CveRetISRConcepto").ToString) + If dr("CveTipoConcepto").ToString.ToEntero = 1 Then LblProveedor.Text = "Proveedor:" Else LblProveedor.Text = "Acreedor:" HdnCveEstatusFactura.Value = dr("CveEstatusFactura").ToString LblCompraEstatus.Text = dr("EstatusFactura").ToString @@ -4417,7 +4415,7 @@ Partial Class Compras_Compras TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen, - CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveConceptoContable:=CveConceptoContable) Then + CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto) Then ViewState("CveCompra") = ObjCompras.CveCompra If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString @@ -6624,32 +6622,36 @@ Partial Class Compras_Compras IdCtaContable = 0 CveCuenta = 0 End If - Case 5 'Proveedores + Case 5 'Proveedores + If CveTipoConcepto = 2 Then ConceptoContable = 305 'cuando es acreedor If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then importeMovimiento = importeProv importeMN = importeMovimiento * tipoCambioActual * Multiplicador If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" - - If tipoCambioActual = 1 Then - IdCtaContable = CtaProveedor - CveCuenta = CveCuentaProveedor - Else - IdCtaContable = CtaProveedorComplementaria - CveCuenta = CveCuentaProveedorComplementaria - If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0 Or UsuarioActual.CveEmpresa = 119) Then 'Cuando tiene complementaria lo dividimos en dos Then - importeMN = importeMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, 201, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * tipoCambioActual - importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then - ErrorPrepoliza = True - End If - End If - IdCtaContable = CtaProveedorExtranjera - CveCuenta = CveCuentaProveedorExtranjera - End If - End If - - Case 59 'Documentos + Dim CveConceptoComplementario As Integer = 201 + If CveTipoConcepto = 2 Then CveConceptoComplementario = 310 + + If tipoCambioActual = 1 Then + IdCtaContable = CtaProveedor + CveCuenta = CveCuentaProveedor + Else + IdCtaContable = CtaProveedorComplementaria + CveCuenta = CveCuentaProveedorComplementaria + If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0 Or UsuarioActual.CveEmpresa = 119) Then 'Cuando tiene complementaria lo dividimos en dos Then + importeMN = importeMovimiento + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, CveConceptoComplementario, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * tipoCambioActual - importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If + End If + IdCtaContable = CtaProveedorExtranjera + CveCuenta = CveCuentaProveedorExtranjera + End If + End If + + + Case 59 'Documentos importeMovimiento = importeCreditos importeMN = importeMovimiento * tipoCambioActual * Multiplicador If ObjConta.GetRetCuenta(ConceptoContable, CveProveedor) Then @@ -7452,7 +7454,7 @@ Partial Class Compras_Compras End If End If - If TxtOtrosImpuestos.Text.ToDouble > 0 Then + If TxtOtrosImpuestos.Text.ToDouble <> 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoImpuestos, TxtOtrosImpuestos.Text.ToDecimal, " ", CveConceptoRetOtrosImpuestos, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=TxtOtrosImpuestos.Text.ToDecimal) Then ErrorMovtosRetISR = True End If @@ -11958,7 +11960,7 @@ Partial Class Compras_Compras SubTotalConceptos = SubTotal GvPS.DataSource = TmpDT : GvPS.DataBind() - If TxtOtrosImpuestos.Text.ToDouble > 0 Then TxtOtrosImpuestos.Text = "" : TrOtrosImpuestos.Visible = False + 'If TxtOtrosImpuestos.Text.ToDouble > 0 Then TxtOtrosImpuestos.Text = "" : TrOtrosImpuestos.Visible = False 'EN ESPERA DE ALGUN CASO QUE LO NECESITE - IPP 5 DICIEMBRE 2016 'TempSubTotal = TempSubTotal - SubTotal @@ -16471,7 +16473,7 @@ Partial Class Compras_Compras TempIEPS = TxtIEPS.Text.ToDouble TempRetIVA = TxtRetIVA.Text.ToDouble TempRetISR = TxtRetISR.Text.ToDouble - TempTotal = Math.Round(TempSubTotal2 + TempIVA + TempIEPS - TempRetIVA - TempRetISR + TxtOtrosImpuestos.Text.ToDouble, 2) + TempTotal = Math.Round(TempSubTotal2 + TempIVA + TempIEPS - TempRetIVA - TempRetISR - TxtOtrosImpuestos.Text.ToDouble, 2) DifTotales = TxtTotal.Text.ToDouble - TempTotal Dim DiferenciaPermitida = 0.6 @@ -19367,12 +19369,12 @@ Partial Class Compras_Compras End Sub Public Sub LblProveedor_OnClick(sender As Object, e As EventArgs) Handles LblProveedor.Click - If LblProveedor.Text = "Proveedor:" Then + If CveTipoConcepto = 1 Then LblProveedor.Text = "Acreedor:" - CveConceptoContable = 305 + CveTipoConcepto = 2 Else LblProveedor.Text = "Proveedor:" - CveConceptoContable = 5 + CveTipoConcepto = 1 End If End Sub diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 636954eb7..1956cf894 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -2422,10 +2422,15 @@ Partial Class PopUpVerFactura ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Desarmado de Paquete - {0}", Folio.ToString), RDSName:="DsInventarios") - Case 21 'SALIDA POR PRESTAMO + Case 21, 22 'SALIDA POR PRESTAMO Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) + Dim Archivo As String = $"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntradaSalida.rdlc" + If Not File.Exists($"{Server.MapPath("~")}/{Archivo}") Then + Archivo = "Empresas/Grales/Formatos/EntradaSalida.rdlc" + End If + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", logouri)) @@ -2433,7 +2438,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("LogoPath", "")) End If - params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + 'params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Concepto", "Salida por Prestamo")) params.Add(New ReportParameter("Almacen", Almacen)) params.Add(New ReportParameter("Fecha", Fecha)) @@ -2447,37 +2452,43 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("FacturadoA", NombreCliente)) If (UsuarioActual.CveEmpresa = 72) Then params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) - End If - ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Salida por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") - - Case 22 'ENTRADA POR PRESTAMO - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim params As New List(Of ReportParameter) - - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) Else - params.Add(New ReportParameter("LogoPath", "")) + params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) End If - - params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("Concepto", "Entrada por Prestamo")) - params.Add(New ReportParameter("Almacen", Almacen)) - params.Add(New ReportParameter("Fecha", Fecha)) - params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) - params.Add(New ReportParameter("Folio", Folio)) - params.Add(New ReportParameter("Descuentos", "")) - params.Add(New ReportParameter("IVA", "")) - params.Add(New ReportParameter("Total", "")) - 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) - params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) - params.Add(New ReportParameter("FacturadoA", NombreCliente)) - If (UsuarioActual.CveEmpresa = 72) Then - params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) - End If - ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") - + If CveConcepto = 21 Then + ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Salida por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") + ElseIf CveConcepto = 22 Then + ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") + End If + + 'Case 22 'ENTRADA POR PRESTAMO + ' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + ' Dim params As New List(Of ReportParameter) + + ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + ' If Imagen.Exists Then + ' params.Add(New ReportParameter("LogoPath", logouri)) + ' Else + ' params.Add(New ReportParameter("LogoPath", "")) + ' End If + + ' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + ' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo")) + ' params.Add(New ReportParameter("Almacen", Almacen)) + ' params.Add(New ReportParameter("Fecha", Fecha)) + ' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) + ' params.Add(New ReportParameter("Folio", Folio)) + ' params.Add(New ReportParameter("Descuentos", "")) + ' params.Add(New ReportParameter("IVA", "")) + ' params.Add(New ReportParameter("Total", "")) + ' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) + ' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) + ' params.Add(New ReportParameter("FacturadoA", NombreCliente)) + ' If (UsuarioActual.CveEmpresa = 72) Then + ' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) + ' End If + ' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") + Case 24 'SALIDA POR RESGUARDO If DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 20 Or DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 19 Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 9ad938988..f68fe8254 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -688,9 +688,10 @@ Partial Class Compras_eFacturas GvD.DataSource = Nothing End If End If + ObjDatos.Dispose() LblRegistros.Text = String.Format("{0} Registros", ObjDatos.DtResultados.FiltraParametros("TipoComprobante <> 'P'").Rows.Count.ToString("N0")) LblTotalPagos.Text = String.Format("{0} Pagos", ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'P'").Rows.Count.ToString("N0")) - ObjDatos.Dispose() + If DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then GvPagos.DataSource = DtPagos @@ -1252,16 +1253,10 @@ Partial Class Compras_eFacturas If txtFechaF.Text = "" Then FechaF = "-1" Dim Folio = If(TxtFolio.Text.Trim.Length > 0, String.Format("%{0}%", TxtFolio.Text.Trim.ToUpper), "-1") Dim Proveedor = If(TxtProveedor.Text.Trim.Length > 0, String.Format("%{0}%", TxtProveedor.Text.Trim.ToUpper.Replace(" ", "%")), "-1") + Dim dt As DataTable = Nothing If ObjDatos.GetFacturas(-1, Folio, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, "-1", Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa) Then - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - - Dim dt As DataTable - - - If Tab.ActiveTabIndex = 0 Then dt = ObjDatos.DtResultados.FiltraParametros("TipoComprobante <> 'P'") Else @@ -1269,6 +1264,15 @@ Partial Class Compras_eFacturas End If + Else + Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) + End If + ObjDatos.Dispose() + + If DT IsNot Nothing Then + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) @@ -1283,8 +1287,6 @@ Partial Class Compras_eFacturas End If ImprimirPDF("Empresas/Grales/Formatos/RepFacturas.rdlc", dt, params, $"FacturasBuzon_{Now.ToString("yyyyMMyyddmmss")}", Tipo) - Else - Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) End If End Sub diff --git a/Contratos/CatContratosTipos.aspx b/Contratos/CatContratosTipos.aspx index 4eb20ced6..431a85ed2 100644 --- a/Contratos/CatContratosTipos.aspx +++ b/Contratos/CatContratosTipos.aspx @@ -12,110 +12,110 @@ - - - - - + +
- - - - -
- - Clave + + + + + + + + + + + + + + + +
+ + + + - + - + - - - - - - - - - - - -
+ + Clave - - - - Tipo Contrato + + + + Tipo Contrato - - - - Descripción + + + + Descripción - - Comandos
- - - - - - - - -
+ + +
Comandos
+ + + + + + + + +
- - - - - + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - -
+ + +
 
-
- - - -
+ + + + + - - - - - - - - - - - -
+ + + + + + + + +
+
+
diff --git a/Contratos/CatContratosTipos.aspx.vb b/Contratos/CatContratosTipos.aspx.vb index 254d6551d..044ce9b99 100644 --- a/Contratos/CatContratosTipos.aspx.vb +++ b/Contratos/CatContratosTipos.aspx.vb @@ -15,9 +15,9 @@ Partial Class Contratos_CatContratosTipos #Region " CARGAS " Private Sub CargaDatos() Dim Objeto As New ClsContratos - If Objeto.GetContratosTipos() Then + If Objeto.GetContratosTipos(UsuarioActual.CveEmpresa) Then GvContratos.DataSource = Objeto.DtResultados - GlobalDTContratosTipos = Objeto.DtResultados + GlobalDTContratosTipos(UsuarioActual.CveEmpresa) = Objeto.DtResultados End If GvContratos.DataBind() Objeto.Dispose() diff --git a/Empresas/146/Formatos/Factura.rdlc b/Empresas/146/Formatos/Factura.rdlc index ed8648fc9..c28587a0e 100644 --- a/Empresas/146/Formatos/Factura.rdlc +++ b/Empresas/146/Formatos/Factura.rdlc @@ -227,10 +227,10 @@ External =Parameters!QR.Value FitProportional - 5.87436in + 5.8661in 0.03915in - 0.95455in - 1.49755in + 1.10236in + 1.10236in 5 @@ -1573,6 +1576,12 @@ String ReportParameter1 + + String + true + true + ReportParameter1 + diff --git a/Empresas/Grales/Formatos/CartaPorte.rdlc b/Empresas/Grales/Formatos/CartaPorte.rdlc index fd0a990c1..3cff0be99 100644 --- a/Empresas/Grales/Formatos/CartaPorte.rdlc +++ b/Empresas/Grales/Formatos/CartaPorte.rdlc @@ -481,7 +481,7 @@ - REMITENTE O EXPEDIDOR: + REMITENTE O EXPEDIDOR: - - - - true - true - - - - - PLACA: - - - - =Parameters!Placa.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - CHOFER: - - - - =Parameters!ResponsableRecibio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ESPECIFICACIÓN DE LA UNIDAD: - - - - =Parameters!EspecifUnidad.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - 9.85744cm - 0cm - 0.91152cm - 19.6022cm - 13 - - =IIf((Parameters!Chofer.Value = "" or Parameters!Chofer.Value = "-1") And (Parameters!Placa.Value = "" Or Parameters!Placa.Value = "-1"),True,False) - - - - - true true @@ -1468,11 +1331,11 @@ Textbox21 - 13.24837cm - 2.21206cm + 13.69816cm + 2.20199cm 1.2cm 5.78664cm - 14 + 13 @@ -1503,11 +1366,11 @@ Textbox22 - 11.58471cm - 2.21206cm + 12.0345cm + 2.20199cm 0.6cm 5.78664cm - 15 + 14 @@ -1551,11 +1414,11 @@ Textbox21 - 13.24837cm - 11.60471cm + 13.69816cm + 11.59464cm 1.2cm 5.78664cm - 16 + 15 @@ -1586,11 +1449,11 @@ Textbox22 - 11.58471cm - 11.60471cm + 12.0345cm + 11.59464cm 0.6cm 5.78664cm - 17 + 16 @@ -1621,11 +1484,11 @@ Textbox22 - 12.88411cm - 2.21206cm + 13.3339cm + 2.20199cm 0.52062cm 5.78664cm - 18 + 17 @@ -1656,11 +1519,11 @@ Textbox22 - 12.88411cm - 11.60471cm + 13.3339cm + 11.59464cm 0.52062cm 5.78664cm - 19 + 18 @@ -1776,7 +1639,7 @@ 0.23022cm 2.22232cm 19.21855cm - 20 + 19 @@ -1819,7 +1682,7 @@ 0.23022cm 0.62599cm 19.21855cm - 21 + 20 @@ -1839,11 +1702,174 @@ 2pt + + + + + 5.06862cm + + + 3.10917cm + + + 10.93493cm + + + + + 0.6cm + + + + + true + true + + + + + CHOFER: + + + + =Parameters!ResponsableRecibio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + PLACA: + + + + =Parameters!Placa.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + ESPECIFICACION DE LA UNIDAD: + + + + =Parameters!EspecifUnidad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + 7.37959cm + 0.21008cm + 0.6cm + 19.11272cm + 21 + + + + 8.91698in - 1.23527cm + 1.23526cm true true - 0.03528cm + 0.03527cm 0.22015cm 0cm 19.22862cm @@ -2119,7 +2145,7 @@ Textbox13 - 0.14111cm + 0.1411cm 0.22015cm 0.54708cm 1.55632cm @@ -2153,7 +2179,7 @@ Textbox14 - 0.14111cm + 0.1411cm 1.77647cm 0.54708cm 4.96223cm @@ -2188,7 +2214,7 @@ Textbox13 - 0.14111cm + 0.1411cm 6.84454cm 0.54708cm 2.84562cm @@ -2223,7 +2249,7 @@ Textbox14 - 0.14111cm + 0.1411cm 9.69015cm 0.54708cm 4.68641cm @@ -2257,7 +2283,7 @@ Textbox14 - 0.17639cm + 0.17638cm 14.62633cm 0.54708cm 4.8023cm @@ -2289,7 +2315,7 @@ Textbox14 - 0.68819cm + 0.68818cm 0.22015cm 0.54708cm 6.21751cm diff --git a/GPS/RepArrastre.aspx b/GPS/RepArrastre.aspx index dbb648fe0..f265aa224 100644 --- a/GPS/RepArrastre.aspx +++ b/GPS/RepArrastre.aspx @@ -1,151 +1,151 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepArrastre.aspx.cs" Inherits="GPS_RepArrastre" %> - - - - - - - - Reporte de Arrastre - - - - -
  • - Apagar vehiculo -
  • -
    - - - - - -
    -
    -
    - - -
    -
    -
    -
    - Vehiculo: -
    -
    - - - -
    - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    -
    - - datos vehiculo -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - Alerta el vehiculo se encuentra en arrastre -
    -
    -
    -
    -
    - -
    - <%----%> -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - + + - - + // initMap(); + //}); + +
    + diff --git a/GPS/RepArrastre.aspx.cs b/GPS/RepArrastre.aspx.cs index 4d3e6ab7e..3da7065db 100644 --- a/GPS/RepArrastre.aspx.cs +++ b/GPS/RepArrastre.aspx.cs @@ -1,100 +1,100 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Extensiones; - -public partial class GPS_RepArrastre : ClsPaginas -{ - - public int CveDispositivo - { - get - { - if (ViewState["CveDispositivo"] != null) - { - return ViewState["CveDispositivo"].ToString().ToEntero(); - - } - else - { - return 0; - } - } - set { ViewState["CveDispositivo"] = value; } - } - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - // fijo borrar - //DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(263965, 1928) ; - DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario) ; - DdlDispositivo.DataBind(); - getArrastre(); - } - - } - private void getArrastre() - { - CveDispositivo = DdlDispositivo.SelectedValue.ToEntero(); - using (ClsGPS objgps = new ClsGPS()) - { - if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0) - { - DataRow dtrow = objgps.DtResultados.Rows[0]; - upInfo(dtrow); - } - - } - } - public void upInfo(DataRow dtrow) - { - if ( dtrow != null) - { - LblVelocidad.Text = $"{dtrow["Speed"]:N0}"; - LblEncApa.Text = $"{dtrow["EncendidoText"]}"; - LblFechaInfo.Text = $"{dtrow["FechaTrama"]:dd/MM/yyyy HH:mm:ss}"; - chkActivarArrastre.Checked = dtrow["ArrastreActivo"].ToString() == "1"; - pnlAlertaActiva.Visible = dtrow["AlertaArrastre"].ToString() == "1"; - //LblVelocidad.Text = $"{dtrow[""]}"; - //LblVelocidad.Text = $"{dtrow[""]}";addmarkerActual({ lat: -25.363, lng: 131.044 }) - string pVehiculo = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["Lat"], dtrow["Lng"]); - string parrastre = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["LatArrastre"], dtrow["LngArrastre"]); - TxtFunciones.Text = string.Format("addmarkerActual({0},{3}){1};setCenter({2})", pVehiculo, (dtrow["ArrastreActivo"].ToString() == "1" ? $" ;addmarkerarrastre({parrastre})" : ";addmarkerarrastre()"), (dtrow["ArrastreActivo"].ToString() == "1" ? parrastre : pVehiculo), dtrow["Encendido"].ToString().ToEntero()); - UpInfo.Update(); - } - } - - protected void BtnConsultar_Click(object sender, EventArgs e) - { - getArrastre(); - } - - protected void chkActivarArrastre_CheckedChanged(object sender, EventArgs e) - { - using (ClsGPS objgps = new ClsGPS()) - { - if (objgps.GPS_ArrastreActivarDesactivar(CveDispositivo, chkActivarArrastre.Checked)){ - - if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0) - { - DataRow dtrow = objgps.DtResultados.Rows[0]; - upInfo(dtrow); - } - if (chkActivarArrastre.Checked) - { - Alert("se ha activado la funcion de arrastre"); - } - else - { - Alert("se ha desactivado la funcion de arrastre"); - } - } - } - - } +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class GPS_RepArrastre : ClsPaginas +{ + + public int CveDispositivo + { + get + { + if (ViewState["CveDispositivo"] != null) + { + return ViewState["CveDispositivo"].ToString().ToEntero(); + + } + else + { + return 0; + } + } + set { ViewState["CveDispositivo"] = value; } + } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // fijo borrar + //DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(263965, 1928) ; + DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario) ; + DdlDispositivo.DataBind(); + getArrastre(); + } + + } + private void getArrastre() + { + CveDispositivo = DdlDispositivo.SelectedValue.ToEntero(); + using (ClsGPS objgps = new ClsGPS()) + { + if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0) + { + DataRow dtrow = objgps.DtResultados.Rows[0]; + upInfo(dtrow); + } + + } + } + public void upInfo(DataRow dtrow) + { + if ( dtrow != null) + { + LblVelocidad.Text = $"{dtrow["Speed"]:N0}"; + LblEncApa.Text = $"{dtrow["EncendidoText"]}"; + LblFechaInfo.Text = $"{dtrow["FechaTrama"]:dd/MM/yyyy HH:mm:ss}"; + chkActivarArrastre.Checked = dtrow["ArrastreActivo"].ToString() == "1"; + pnlAlertaActiva.Visible = dtrow["AlertaArrastre"].ToString() == "1"; + //LblVelocidad.Text = $"{dtrow[""]}"; + //LblVelocidad.Text = $"{dtrow[""]}";addmarkerActual({ lat: -25.363, lng: 131.044 }) + string pVehiculo = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["Lat"], dtrow["Lng"]); + string parrastre = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["LatArrastre"], dtrow["LngArrastre"]); + TxtFunciones.Text = string.Format("addmarkerActual({0},{3}){1};setCenter({2})", pVehiculo, (dtrow["ArrastreActivo"].ToString() == "1" ? $" ;addmarkerarrastre({parrastre})" : ";addmarkerarrastre()"), (dtrow["ArrastreActivo"].ToString() == "1" ? parrastre : pVehiculo), dtrow["Encendido"].ToString().ToEntero()); + UpInfo.Update(); + } + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + getArrastre(); + } + + protected void chkActivarArrastre_CheckedChanged(object sender, EventArgs e) + { + using (ClsGPS objgps = new ClsGPS()) + { + if (objgps.GPS_ArrastreActivarDesactivar(CveDispositivo, chkActivarArrastre.Checked)){ + + if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0) + { + DataRow dtrow = objgps.DtResultados.Rows[0]; + upInfo(dtrow); + } + if (chkActivarArrastre.Checked) + { + Alert("se ha activado la funcion de arrastre"); + } + else + { + Alert("se ha desactivado la funcion de arrastre"); + } + } + } + + } } \ No newline at end of file diff --git a/Global.asax b/Global.asax index ebb88fa8b..973a330a8 100644 --- a/Global.asax +++ b/Global.asax @@ -449,14 +449,14 @@ Dim ObjContratos As New ClsContratos If ObjContratos.GetContratos(-1, -1) Then Application("GlobalDTContratos") = ObjContratos.DtResultados Else Application("GlobalDTContratos") = Nothing - If ObjContratos.GetSecciones() Then Application("GlobalDTContratosSecciones") = ObjContratos.DtResultados Else Application("GlobalDTContratosSecciones") = Nothing - If ObjContratos.GetContratosTipos() Then Application("GlobalDTContratosTipos") = ObjContratos.DtResultados Else Application("GlobalDTContratosTipos") = Nothing - ObjContratos.Dispose() - - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'V E N D E D O R E S - + If ObjContratos.GetSecciones() Then Application("GlobalDTContratosSecciones") = ObjContratos.DtResultados Else Application("GlobalDTContratosSecciones") = Nothing + 'If ObjContratos.GetContratosTipos(-1) Then Application("GlobalDTContratosTipos") = ObjContratos.DtResultados Else Application("GlobalDTContratosTipos") = Nothing + ObjContratos.Dispose() + + + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'V E N D E D O R E S + Dim ObjVendedores As New ClsVtaVendedores If ObjVendedores.GetVendedores(-1) Then Application("GlobalDTVendedores") = ObjVendedores.DtResultados Else Application("GlobalDTVendedores") = Nothing ObjVendedores.Dispose() diff --git a/Inventarios/ResguardoMaterial.aspx b/Inventarios/ResguardoMaterial.aspx index 0d698fe82..9c089adf9 100644 --- a/Inventarios/ResguardoMaterial.aspx +++ b/Inventarios/ResguardoMaterial.aspx @@ -58,6 +58,7 @@
    información del movimiento +
    > @@ -79,29 +80,32 @@
    - - - + + <%-- + --%>
    - - - + + <%-- + --%>
    - + <%----%> <%----%>
    @@ -164,6 +168,7 @@
    @@ -306,7 +311,7 @@
    - +
    @@ -326,45 +331,48 @@
    -
    Fecha
    -
    -
    -
    - - - - - - - - - - -
    -
    +
    Personal/Responsable
    +
    + + <%-- + + --%>
    +
    Cliente
    +
    + + <%-- + + --%> +
    +
    Proveedor
    +
    + + <%----%> + <%----%> +
    +
    -
    Personal/Responsable
    -
    - - - -
    -
    Cliente
    -
    - - - -
    -
    Proveedor
    -
    - - <%----%> - <%----%> +
    Fecha
    +
    +
    +
    + + + + + + + + + + +
    +
    @@ -387,6 +395,7 @@
    información del movimiento +
    > @@ -423,6 +432,7 @@
    diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index 272fa5234..74c532c7d 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -4,8 +4,8 @@ Option Strict On Imports System.Data Imports Extensiones Partial Class Inventarios_ResguardoMaterial - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "Propiedades" Public Property DtMovimientos() As DataTable Get @@ -122,12 +122,12 @@ Partial Class Inventarios_ResguardoMaterial Set(value As Integer) ViewState("TipoSeccionAlmacen") = value End Set - End Property - - - + End Property + + + #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then @@ -156,11 +156,11 @@ Partial Class Inventarios_ResguardoMaterial Private Sub OcultarControles(CvePersonal As Integer) - DdlPersonal.SelectedValueExist(CvePersonal) + DdlPersonal.ddl.SelectedValueExist(CvePersonal) DdlPersonal.Enabled = False DVTipo.Visible = False - End Sub - + End Sub + #Region " INICIALIZA VALORES " Private Sub InicializaValores() CreaDT() @@ -213,21 +213,25 @@ Partial Class Inventarios_ResguardoMaterial End Sub Private Sub CargaCombos() - DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) - DdlPersonal.DataBind() - DdlPersonal.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlPersonal.setEsWebService(True) + DdlPersonal.Attributes.Add("data-metodo", "getpersonal") + DdlPersonal.SelectedValue = "-1" + DdlPersonal.SelectedText = "Seleccione" - DdlPersonalLiberacion.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) - DdlPersonalLiberacion.DataBind() - DdlPersonalLiberacion.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlPersonalLiberacion.setEsWebService(True) + DdlPersonalLiberacion.Attributes.Add("data-metodo", "getpersonal") + DdlPersonalLiberacion.SelectedValue = "-1" + DdlPersonalLiberacion.SelectedText = "Seleccione" - DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlCliente.DataBind() - DdlCliente.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlCliente.setEsWebService(True) + DdlCliente.Attributes.Add("data-metodo", "getcliente") + DdlCliente.SelectedValue = "-1" + DdlCliente.SelectedText = "Seleccione" - DdlClienteLiberacion.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClienteLiberacion.DataBind() - DdlClienteLiberacion.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlClienteLiberacion.setEsWebService(True) + DdlClienteLiberacion.Attributes.Add("data-metodo", "getcliente") + DdlClienteLiberacion.SelectedValue = "-1" + DdlClienteLiberacion.SelectedText = "Seleccione" DdlProveedor.setEsWebService(True) DdlProveedor.Attributes.Add("data-metodo", "getproveedores") @@ -304,14 +308,14 @@ Partial Class Inventarios_ResguardoMaterial End Sub Private Function isWhitFamily() As Boolean Return (UsuarioActual.CveEmpresa = 66) - End Function + End Function #End Region - - - + + + #Region " RESGUARDO " - - + + #Region " FUNCIONALIDAD 105 - CLASIFICACION PS" Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged CargaProductosPorClasificacion() @@ -371,21 +375,21 @@ Partial Class Inventarios_ResguardoMaterial DdlUnidad.DataBind() UPDatos.Update() - End Sub - + End Sub + #End Region - - + + #Region " EISTENCIAS " Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional SerieLote As String = "-1") As Double Dim Inv As New ClsInventarios Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=SerieLote) Inv.Dispose() Return Existencia - End Function + End Function #End Region - - + + #Region " AGREGAR " Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click AgregaProducto() @@ -443,10 +447,10 @@ Partial Class Inventarios_ResguardoMaterial DdlClasificacion.SelectedValue = "-1" txtCantidad.Text = "" TxtObservacionesdetalle.Text = "" - End Sub + End Sub #End Region - - + + #Region " GvM " Private Sub CargaGvM() @@ -483,10 +487,10 @@ Partial Class Inventarios_ResguardoMaterial e.Row.FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen" End If End If - End Sub + End Sub #End Region - - + + #Region " NUEVO " Protected Sub BtnNuevo_Click(sender As Object, e As EventArgs) LimpiarMovimiento() @@ -503,20 +507,20 @@ Partial Class Inventarios_ResguardoMaterial TxtObservaciones.Text = "" TxtFecha.Text = Now.ToShortDateString - DdlPersonal.SelectedIndex = 0 + DdlPersonal.ddl.SelectedIndex = 0 LimpiarAgregar() UPDatos.Update() UpGenerales.Update() - End Sub + End Sub #End Region - - + + #End Region - - + + #Region " LIBERACION " - - + + #Region " GV DATOS LIBERACION " Protected Sub GvMLiberacion_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then @@ -529,12 +533,12 @@ Partial Class Inventarios_ResguardoMaterial Dim Index = e.Row.RowIndex e.Row.FCTextBox("TxtCantidad").Attributes.Add("onKeyUp", String.Format("ValidarCantidad({0});", Index)) End If - End Sub + End Sub #End Region - - + + #Region " CARGA RESGUARDOS PARA LIBERACION " - + Protected Sub BtnVerificarExistencias_Click(sender As Object, e As EventArgs) If Not DdlProveedorLiberacion.SelectedValue.ToEntero > 0 AndAlso DdlTipo.SelectedValue.ToEntero = 3 Then Alert("Tiene que seleccionar un proveedor.", TipoMensaje.MsgAdvertencia) @@ -572,7 +576,7 @@ Partial Class Inventarios_ResguardoMaterial CargaGvMLiberacion() If DdlPersonalLiberacion.SelectedValue.ToEntero <> -1 Then LblTipo.InnerText = "Personal/Responsable:" - LbTipoLiberacion.Text = DdlPersonalLiberacion.SelectedItem.Text + LbTipoLiberacion.Text = DdlPersonalLiberacion.SelectedText End If If DdlProveedorLiberacion.SelectedValue.ToEntero <> -1 Then LblTipo.InnerText = "Proveedor:" @@ -580,7 +584,7 @@ Partial Class Inventarios_ResguardoMaterial End If If DdlClienteLiberacion.SelectedValue.ToEntero <> -1 Then LblTipo.InnerText = "Cliente:" - LbTipoLiberacion.Text = DdlClienteLiberacion.SelectedItem.Text + LbTipoLiberacion.Text = DdlClienteLiberacion.SelectedText End If CvePersonalLiberacion = DdlPersonalLiberacion.SelectedValue.ToEntero CveClienteLiberacion = DdlClienteLiberacion.SelectedValue.ToEntero @@ -613,10 +617,10 @@ Partial Class Inventarios_ResguardoMaterial GvMLiberacion.DataSource = DtMovimientosLiberacion GvMLiberacion.DataBind() UpGridLiberacion.Update() - End Sub - + End Sub + #End Region - + #Region " LIMPIAR LIBERACION " Private Sub LimpiarLiberacion() LbTipoLiberacion.Text = "" @@ -638,14 +642,14 @@ Partial Class Inventarios_ResguardoMaterial CargaGvMLiberacion() UpGeneralesLibreacion.Update() - End Sub + End Sub #End Region - - + + #End Region - - - + + + #Region " GUARDAR " Protected Sub BtnGuardarResguardo_Click(sender As Object, e As EventArgs) Handles BtnGuardarResguardo.Click @@ -963,17 +967,26 @@ Partial Class Inventarios_ResguardoMaterial DivCliente.Visible = False DivPersonal.Visible = False DivProveedor.Visible = False - If RbTipoCliente.Checked Then DivCliente.Visible = True - If RbTipoPersonal.Checked Then DivPersonal.Visible = True - If RbTipoProveedor.Checked Then DivProveedor.Visible = True + If RbTipoCliente.Checked Then + DivCliente.Visible = True + 'DdlPersonal.Attributes.Add("data-metodo", "getcliente") + End If + If RbTipoPersonal.Checked Then + DivPersonal.Visible = True + 'DdlPersonal.Attributes.Add("data-metodo", "getpersonal") + End If + If RbTipoProveedor.Checked Then + DivProveedor.Visible = True + 'DdlPersonal.Attributes.Add("data-metodo", "getproveedores") + End If UpGenerales.Update() End Sub Protected Sub DdlTipo_SelectedIndexChanged(sender As Object, e As EventArgs) - DdlPersonalLiberacion.SelectedIndex = 0 - DdlProveedorLiberacion.SelectedValue = "-1" - DdlProveedorLiberacion.SelectedText = "Seleccione" - DdlClienteLiberacion.SelectedIndex = 0 + 'DdlPersonalLiberacion.ddl.SelectedIndex = 0 + 'DdlProveedorLiberacion.SelectedValue = "-1" + 'DdlProveedorLiberacion.SelectedText = "Seleccione" + 'DdlClienteLiberacion.SelectedValue = "0" DivPersonalLiberacion.Visible = False DivPersonalLiberacion2.Visible = False DivClienteLiberacion.Visible = False @@ -993,10 +1006,10 @@ Partial Class Inventarios_ResguardoMaterial DivProveedorLiberacion2.Visible = True End If UpFiltraLiberacion.Update() - End Sub - + End Sub + #End Region - + #Region "SECCION ALMACEN" Private Sub CreaDtSeccionAlmacen() DtSeccionAlmacen = New DataTable @@ -1100,9 +1113,9 @@ Partial Class Inventarios_ResguardoMaterial DdlAlmacen.Enabled = True DdlAlmacen.ToolTip = "" End If - UpGenerales.Update() - - ElseIf TipoSeccionAlmacen = 2 Then + UpGenerales.Update() + + ElseIf TipoSeccionAlmacen = 2 Then If CantidadTotalSeccion > 0 Then GvMLiberacion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").Enabled = False GvMLiberacion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").ToolTip = "Cuenta con sección almacen" @@ -1172,32 +1185,32 @@ Partial Class Inventarios_ResguardoMaterial DtSeccionAlmacen.Rows.RemoveAt(Index) DtSeccionAlmacen.AcceptChanges() CargaSeccionAlmacen() - End Sub - - 'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs) - ' If Not CveVentaSurtir > 0 Then - ' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia) - ' Exit Sub - ' End If - - ' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then - ' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia) - ' Exit Sub - ' End If - - ' Dim ObjInv As New ClsInventarios - ' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - ' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados - ' End If - ' ObjInv.Dispose() - ' GvVerSeccionesAlmacen.DataBind() - ' UpVerSeccionesAlmacen.Update() - ' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()") - 'End Sub - + End Sub + + 'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs) + ' If Not CveVentaSurtir > 0 Then + ' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia) + ' Exit Sub + ' End If + + ' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then + ' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia) + ' Exit Sub + ' End If + + ' Dim ObjInv As New ClsInventarios + ' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + ' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados + ' End If + ' ObjInv.Dispose() + ' GvVerSeccionesAlmacen.DataBind() + ' UpVerSeccionesAlmacen.Update() + ' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()") + 'End Sub + #End Region - - - - + + + + End Class diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index f1c3f6634..dee55b849 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -1,866 +1,916 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="TraspasoAlmacen.aspx.vb" Inherits="Inventarios_TraspasoAlmacen" %> - - - - - - - - - - Traspaso de Almacén - - -
  • - Cargar Conceptos -
  • -
    - - - - - - - - -
    -
    - - - - - -
    -
    -
    - - TRASPASO ENTRE ALMACENES -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - - - -
    - - -
    - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - - - - -
    -
    -
    -
    -
    - - - - - -
    -
    -
    -
    - - Movimiento Entrada: -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - Ver Compra -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - -
    -
    - - - - - - -
    - - - - - - - -
    -
    -
    -
    -
    - - - - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="TraspasoAlmacen.aspx.vb" Inherits="Inventarios_TraspasoAlmacen" %> + + + + + + + + + + Traspaso de Almacén + + +
  • + Cargar Conceptos +
  • +
    + + + + + + + + +
    +
    + + + + + +
    +
    +
    + + TRASPASO ENTRE ALMACENES +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    + + + +
    + + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + + + + +
    +
    +
    +
    +
    + + + + + +
    +
    +
    +
    + + Movimiento Entrada: +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + Ver Compra +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + +
    +
    +
    #CantidadUnidad
    + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + - - - - - - - - - - - - - - - - - - - -
    #CantidadUnidad Clasificación -
    + +
    Producto -
    ObservacionesSerie - Lote LoteBatchSección AlmacenComandos
    - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    -
    -
    -
    - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - <%-- --%> - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    -
    - - -
    -
    -
    -
    - -
    - - - - - - - - - - -
    -
    -
    - -
    -
    -
      + + Observaciones + Serie - Lote + Lote + Batch + Sección Almacen + Comandos + + + + + + + + + + + + + + + + + + +
      +
      + + + +
      + +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + +
      + + + +
      + + + +
      +
      + + +
      +
      +
      +
      + +
    + + + + + + + + + + +
    +
    +
    + +
    +
    +
    • Almacén Recibe: - - <%----%> + + + <%----%> <%----%> -
    • +
    • Almacén Transitorio: - - - -
    • + + + + +
    • Folio: - - -
    • + + + + <%--
    • Transportista/Responsable: -
    • --%> -
    -
    -
    -
    -
    -
    -
    - -
    -
    - - - - -
    -
    -
    - - RECEPCIÓN DE TRASPASO -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    - - + --%> + +
    +
    +
    + + +
    + +
    +
    + + + + +
    +
    +
    + + RECEPCIÓN DE TRASPASO +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + +     - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - -
    -
    - - - - - - -
    - - - - - - - -
    -
    -
    -
    -
    - - - - - - + + + + +
    +
    +
    +
    + + +
    +
    +
    + + + + +
    +
    + + + + + + +
    + + + + + + + +
    +
    +
    +
    +
    + + + + + + <%-- - --%> - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - - - - -
    - - -
    - - +
    + <%--Modal para agregar camion--%> + + + + - - + + + diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 33aa8f9b5..34968bd47 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -422,7 +422,7 @@ Partial Class Inventarios_TraspasoAlmacen SiguienteFolio(If(ChkTransitorio.Checked, 9, 8)) 'DdlProducto.DataBind() - + CargarCamiones() End Sub Private Sub CargaAlmacenOrigen() DdlAlmacenOrigen.Enabled = True @@ -2779,4 +2779,22 @@ Partial Class Inventarios_TraspasoAlmacen Return dataTable End Function + Public Sub CargarCamiones() + Dim ObjInventarios As New ClsInventarios + If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then + DdlUnidadCamion.DataSource = ObjInventarios.DtResultados + End If + ObjInventarios.Dispose() + DdlUnidadCamion.DataBind() + End Sub + Public Sub BtnAgregarCamion_Click(sender As Object, e As EventArgs) Handles BtnAgregarCamion.Click + Dim ObjInventarios As New ClsInventarios + If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa) Then + RegistraScript("$('#DivAgregarNuevoCamion').modal('hide');") + CargarCamiones() + TxtPlacaNuevo.Text = "" + TxtEspecificacionNuevo.Text = "" + End If + ObjInventarios.Dispose() + End Sub End Class diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index f6eb8bf6f..4e74dad9d 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -1337,14 +1337,14 @@ Partial Class OC ChkCotizacion.Visible = True DdlProveedores.SelectedValue = objOC.CveProveedor.ToString If DdlProveedores.SelectedValue.ToEntero > 0 Then - DdlProveedores.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {objOC.CveProveedor}").Rows(0)("RazonSocial").ToString + DdlProveedores.SelectedText = GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {objOC.CveProveedor}").Rows(0)("RazonSocial").ToString Else DdlProveedores.SelectedText = "-" End If If objOC.CveProveedorSucursal.ToEntero > 0 Then DivProveedorSucursal.Visible = True - DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor, UsuarioActual.CveEmpresa) + DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor, CveEmpresaActual) DdlProveedorSucursal.DataBind() DdlProveedorSucursal.SelectedValueExist(objOC.CveProveedorSucursal.ToString) End If diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index a44f70cae..f5fb1f7eb 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1894,22 +1894,22 @@ Partial Class Clientes Protected Sub BtnVerMasBancos_Click(sender As Object, e As EventArgs) If BtnVerMasBancos.Text = "Ver Más" Then - CargaBancos(-1) + CargaBancos(1000000) BtnVerMasBancos.Text = "Ver Menos" Else - CargaBancos(11) + CargaBancos(51) BtnVerMasBancos.Text = "Ver Más" End If - End Sub - + End Sub + #End Region - + #Region "B A N C O S" - 'CuentasxCobrar Activas (Pagos Recibidos) - Private Sub CargaBancos(Optional SelectTop As Integer = 11, Optional CveClienteSucursal As Integer = -1) + 'CuentasxCobrar Activas (Pagos Recibidos) + Private Sub CargaBancos(Optional SelectTop As Integer = 51, Optional CveClienteSucursal As Integer = -1) Dim ObjMovtos As New ClsMovimientos() 'CxC Activas - If ObjMovtos.GetClienteAbonos(CveCliente, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then + If ObjMovtos.GetClienteAbonos(CveCliente, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero, SelectTop:=SelectTop) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then GvBancos.DataSource = ObjMovtos.DtResultados DTCobrosRealizados = ObjMovtos.DtResultados DTCobrosRealizados.Rows.Remove(DTCobrosRealizados.Rows(0)) @@ -9201,7 +9201,7 @@ Partial Class Clientes Dim Serie As String = "" If FolioNotaCredito(Tipo) Then - Folio = -1 + Folio = FolioNotaAcumulador Serie = SerieNotaAcumulador End If @@ -9220,8 +9220,8 @@ Partial Class Clientes ObjFactura.TipoDocto = "RNC" ObjFactura.Folio = Folio - ObjFactura.Serie = Serie + ObjFactura.Fecha = Now ObjFactura.CvePrePoliza = -1 ObjFactura.CveMetodoPago = DdlMetodoPago.SelectedValue.ToEntero diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index b392ba7ff..99e1f03d7 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -3,9 +3,9 @@ Imports System.Data Imports System.Linq Partial Class Ventas_ClientesAbonar - Inherits ClsPaginas - - + Inherits ClsPaginas + + #Region "Propiedades" Private ReadOnly Property CveCliente As Integer Get @@ -273,9 +273,9 @@ Partial Class Ventas_ClientesAbonar Set(value As Date) ViewState("Fecha") = value End Set - End Property + End Property #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then CveMonedaPago = -1 @@ -641,8 +641,10 @@ Partial Class Ventas_ClientesAbonar e.Row.FCRangeValidator("RVComision").MaximumValue = e.Row.DBCampo("Saldo") End If - If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() >= 0 Then + If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 Then e.Row.FCCheckBox("ChkGenerarNC").Visible = True + e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda)) + End If Else @@ -1876,12 +1878,12 @@ Partial Class Ventas_ClientesAbonar Dim DtVentasNC = InicializaDTVentasNC() - Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("TotalImporte").ToDecimal() - Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIVA").ToDecimal() - Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetIVA").ToDecimal() - Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetISR").ToDecimal() - Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIEPS").ToDecimal() - Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("Descuento").ToDecimal() + Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("TotalImporte") + Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIVA") + Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetIVA") + Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetISR") + Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIEPS") + Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("Descuento") Dim Amortizacion As Decimal = 0 Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion) @@ -1908,7 +1910,7 @@ Partial Class Ventas_ClientesAbonar DtVentasNC.AcceptChanges() ObjFacturaDevolucion.DtVentasNC = DtVentasNC - + ObjFacturaDevolucion.GenerarPDFFactura = True Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Trasac:=Trasac, ObjContPaqTransac:=ObjConta) Return Resp @@ -2056,21 +2058,25 @@ Partial Class Ventas_ClientesAbonar Dim ImporteReferencia As Decimal = Total Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100 Dim FiltroStr As String = "" + Dim ImporteTotalConcepto As Decimal = 0 For Each Dr As DataRow In DtImpuestosLocal.Rows FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto")) - Dr("ImporteTotal") = Math.Round(Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr)), 2) + ImporteTotalConcepto = Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)) - Dr("ImporteIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2) - Dr("ImporteRetIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2) - Dr("ImporteRetISR") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2) - Dr("ImporteIEPS") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2) + Dr("ImportePU") = ImporteTotalConcepto.RoundSQL(6) + Dr("ImporteTotal") = ImporteTotalConcepto.RoundSQL(2) + + Dr("ImporteIVA") = (ImporteTotalConcepto * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2) + Dr("ImporteRetIVA") = (ImporteTotalConcepto * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2) + Dr("ImporteRetISR") = (ImporteTotalConcepto * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2) + Dr("ImporteIEPS") = (ImporteTotalConcepto * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2) 'Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", FiltroStr), 2) 'Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", FiltroStr), 2) 'Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", FiltroStr), 2) 'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", FiltroStr), 2) - Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal) + '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal) Next 'codigo para ajuste de centavo, si el importe total no cuadra con los totales Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR")) @@ -2308,8 +2314,8 @@ Partial Class Ventas_ClientesAbonar UpDatos.Update() UPVentas.Update() - End Sub - + End Sub + #Region " PAGAR CON PESOS " Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs) If ChkPagarPesos.Checked Then @@ -2330,9 +2336,9 @@ Partial Class Ventas_ClientesAbonar CargaDatos(2) RegistraScript("CambiaPesosDolares();") - End Sub + End Sub #End Region - + #Region "PAGAR CON DOLARES" Protected Sub ChkPagarDolares_CheckedChanged(sender As Object, e As EventArgs) If ChkPagarDolares.Checked Then @@ -2353,9 +2359,9 @@ Partial Class Ventas_ClientesAbonar CargaDatos(1) RegistraScript("CambiaDolaresPesos();") - End Sub + End Sub #End Region - + #Region " CUENTAS DEPOSITOS" Private Sub CargaCuentasDepositos() DdlCuentaDeposito.Items.Clear() @@ -2422,9 +2428,9 @@ Partial Class Ventas_ClientesAbonar End If Dep.Dispose() UpCuentaDeposito.Update() - End Sub + End Sub #End Region - + #Region " COMPLEMENTOS PAGO " Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String If Not ChkComplementoPago.Checked Then @@ -2476,14 +2482,14 @@ Partial Class Ventas_ClientesAbonar ' Next Return Retorno.ToString - End Function - - + End Function + + #End Region - + #Region "SALDAR CUENTAS" - - + + Private Sub BtnSaldarCuentasIncobrables_Click(sender As Object, e As EventArgs) Handles BtnSaldarCuentasIncobrables.Click Dim ObjConta As New ClsContabilidad ObjConta.IniciaTransacSQL() @@ -2507,7 +2513,10 @@ Partial Class Ventas_ClientesAbonar End If End If - ObjIE.Dispose() + ObjIE.Dispose() + + CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, 0, 0, 1, TxtFechaIncobrable.Text.ToDate, TxtObsSaldarIncobrable.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + For Each gr As GridViewRow In GvCxC.Rows If gr.FCCheckBox("Chk").Checked Then @@ -2540,6 +2549,7 @@ Partial Class Ventas_ClientesAbonar Dim ImpuestosMovto As Boolean = False Dim IdCuentaContableNoDeducible As Integer = 0 Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero + Dim ConceptoPartida As String = TxtObsSaldarIncobrable.Text.Trim & " " & gr.DataKey("SerieFolio").ToString If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero If CveConceptoDeduccion = 211 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero @@ -2561,9 +2571,8 @@ Partial Class Ventas_ClientesAbonar UsaComplementaria = True End If - If MsgError = "" Then - CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, TxtFechaIncobrable.Text.ToDate, TxtObsSaldarIncobrable.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - + If MsgError = "" Then + If tCveMoneda = 2 Then IdCtaContable = IdCtaContMonedaExtranjera Else @@ -2572,16 +2581,16 @@ Partial Class Ventas_ClientesAbonar If UsaComplementaria AndAlso tCveMoneda = 2 Then 'normal - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If 'complementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, 207, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContComplementaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo), ImporteME:=Saldo, CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, 207, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContComplementaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo), ImporteME:=Saldo, CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If Else - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo * TCVenta), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo * TCVenta), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If @@ -2592,11 +2601,11 @@ Partial Class Ventas_ClientesAbonar Dim ImporteFluctuacion As Decimal = 0 ImporteFluctuacion = Saldo * (TCPago - TCVenta) If TCPago > TCVenta Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If Else - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If End If @@ -2620,18 +2629,18 @@ Partial Class Ventas_ClientesAbonar IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) CveCuenta = If(CveCuentaIVAxTrasladar > 0, CveCuentaIVAxTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar) - If IVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then + If IVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSxTrasladar - If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then + If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If 'al gasto,Subtotal - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, gr.DataKey("SerieFolio").ToString, CveConceptoDeduccion, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCuentaContableNoDeducible, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=SubTotal, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, gr.DataKey("SerieFolio").ToString, CveConceptoDeduccion, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCuentaContableNoDeducible, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=SubTotal, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If @@ -2772,10 +2781,10 @@ Partial Class Ventas_ClientesAbonar UpGuardar.Update() - End Sub - + End Sub + #End Region - + #Region "COMPLEMENTO DE PAGO - ELIMINAR POR SUSTITUCION" Protected Sub CargaIESustituir() Dim ObjIE As New ClsBancos() @@ -2952,10 +2961,10 @@ Partial Class Ventas_ClientesAbonar Private Sub BtnVincularIntermediario_Click(sender As Object, e As EventArgs) Handles BtnVincularIntermediario.Click RegistraScript("$('#ModalVincularIntermediario').modal('hide')", "hidemodal") - End Sub + End Sub #End Region - - + + Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) CambiaTipoMoneda() End Sub diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 656670d36..ae2bdbd52 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2664,12 +2664,30 @@
    -
    +

    +
    + +
    + +
    +
    +
    +
    + +
    + + + + + + +
    +

    diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 57b6bfab0..4e051e985 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -859,6 +859,14 @@ Partial Class PV ViewState("TmpDTRecepcionUsados") = value End Set End Property + Private Property TmpDTPolizaVirtual As DataTable + Get + Return If(IsNothing(ViewState("TmpDTPolizaVirtual")), Nothing, CType(ViewState("TmpDTPolizaVirtual"), DataTable)) + End Get + Set(value As DataTable) + ViewState("TmpDTPolizaVirtual") = value + End Set + End Property Private Property TmpDTImpuestos As DataTable Get Return If(IsNothing(ViewState("TmpDTImpuestos")), Nothing, CType(ViewState("TmpDTImpuestos"), DataTable)) @@ -2547,6 +2555,8 @@ Partial Class PV ObjFactura.DtRecepcionUsados = TmpDTRecepcionUsados + ObjFactura.DtPolizasVirtuales = TmpDTPolizaVirtual + ObjFactura.GenerarPDFFactura = False Dim CveTipoAlmacen As Integer = If(TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0, 6, 22) @@ -3734,13 +3744,14 @@ Partial Class PV ChkAgregar.Checked = False divagregrarotrops.Visible = False Ajuste() + AddPolizaVirtual(DdlPS.SelectedValue.ToEntero()) UpVenta.Update() RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddVenta"), "EdicionVenta") End Sub Protected Sub LnkAgregarPS_Click(sender As Object, e As EventArgs) If AgregarPS() Then If ChkAjuste.Checked Then GuardaAjuste() - + AddPolizaVirtual(DdlPS.SelectedValue.ToEntero()) CalculaTotalesVenta() If ChkAgregar.Checked = True And Modalidad = "A" Then @@ -5053,6 +5064,7 @@ Partial Class PV CreaDTmpDTAjustes() CreaDTmpDTRecepcionUsados() + CreaDTmpDTPolizaVirtual() CargaBCIAjuste() DdlDistribuidor.setEsWebService(True) DivChkAjuste.Visible = True @@ -5478,6 +5490,101 @@ Partial Class PV #End Region +#Region "P O L I Z A - V I R T U A L" + Private Sub CreaDTmpDTPolizaVirtual() + TmpDTPolizaVirtual = New DataTable + TmpDTPolizaVirtual.Columns.Add("CvePS", GetType(Integer)) + TmpDTPolizaVirtual.Columns.Add("Cantidad", GetType(Decimal)) + TmpDTPolizaVirtual.Columns.Add("PU", GetType(Decimal)) + TmpDTPolizaVirtual.Columns.Add("Descuento", GetType(Decimal)) + TmpDTPolizaVirtual.Columns.Add("Total", GetType(Decimal)) + TmpDTPolizaVirtual.Columns.Add("CveVentaDetalle", GetType(Integer)) + TmpDTPolizaVirtual.Columns.Add("TipoServicio", GetType(Integer)) + TmpDTPolizaVirtual.Columns.Add("TipoPoliza", GetType(Integer)) + TmpDTPolizaVirtual.Columns.Add("CveModeloAuto", GetType(Integer)) + TmpDTPolizaVirtual.Columns.Add("AnioVehiculo", GetType(Integer)) + TmpDTPolizaVirtual.Columns.Add("TieneUsado", GetType(Boolean)) + TmpDTPolizaVirtual.Columns.Add("FechaUsado", GetType(DateTime)) + TmpDTPolizaVirtual.Columns.Add("CvePSUsado", GetType(Integer)) + TmpDTPolizaVirtual.Columns.Add("CveBCIUsado", GetType(Integer)) + End Sub + Private Function AddPolizaVirtual(CvePS As Integer) As Boolean + Dim Retorno As Boolean = False + + 'Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero() + Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal() + Dim PU As Decimal = TxtPrecio.Text.ToDecimal() + Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal() + Dim ImporteAjuste As Decimal = TxtImporteAjuste.Text.ToDecimal().RoundSQL(2) + + If Modalidad = "U" Then + If TmpDTRecepcionUsados.Rows.Count > 0 Then + Dim Elimino As Boolean = False + For Each RowPoliza As DataRow In TmpDTPolizaVirtual.Rows + If RowPoliza("CvePS").ToString().ToEntero() = CvePS Then + RowPoliza.Delete() + Elimino = True + End If + Next + If Elimino Then + TmpDTRecepcionUsados.AcceptChanges() + End If + End If + End If + + Dim Total As Decimal = ((Cantidad * PU) - Descuento).RoundSQL(2) + Dim TipoServicio As Integer = DdlTipoServicio.SelectedValue.ToEntero() + Dim FechaUsado As DateTime = TxtFechaAjuste.Text.ToDateTime() + Dim CveModeloAuto As Integer = DdlModeloAuto.SelectedValue.ToEntero() + Dim AnioVehiculo As Integer = TxtAnioVehiculo.Text.ToEntero() + Dim TipoPoliza As Integer = 1 + + If ChkAjuste.Checked Then + If Total = ImporteAjuste Then + TipoPoliza = 3 + Else + TipoPoliza = 2 + End If + End If + + Dim TieneUsado As Boolean = GvRecepcionUsados.Rows.Cast(Of GridViewRow).Any(Function(GvRow) GvRow.RowType = DataControlRowType.DataRow AndAlso GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0) + Dim CvePSUsado As Integer = -1 + Dim CveBCIUsado As Integer = -1 + + If TieneUsado Then + For Each GvRow As GridViewRow In GvRecepcionUsados.Rows + If GvRow.RowType = DataControlRowType.DataRow Then + If GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0 Then + CvePS = GvRow.DataKey("CvePSCargo").ToEntero() + CveBCIUsado = GvRow.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero() + + Exit For + End If + End If + Next + End If + + Dim Row As DataRow = TmpDTPolizaVirtual.NewRow() + Row("CvePS") = CvePS + Row("Cantidad") = Cantidad + Row("PU") = PU + Row("Descuento") = Descuento + Row("Total") = Total + Row("CveVentaDetalle") = -1 + Row("TipoServicio") = TipoServicio + Row("TipoPoliza") = TipoPoliza + Row("CveModeloAuto") = CveModeloAuto + Row("AnioVehiculo") = AnioVehiculo + Row("TieneUsado") = TieneUsado + Row("FechaUsado") = FechaUsado + Row("CvePSUsado") = CvePSUsado + Row("CveBCIUsado") = CveBCIUsado + + TmpDTPolizaVirtual.Rows.Add(Row) + + Return Retorno + End Function +#End Region #Region "U S A D O S" Private Sub CreaDTmpDTRecepcionUsados() @@ -5492,6 +5599,7 @@ Partial Class PV TmpDTRecepcionUsados.Columns.Add("CveModeloAuto", GetType(Integer)) End Sub + Protected Sub BtnRecepcionUsados_Click(sender As Object, e As EventArgs) 'CalculaRecepcionUsados(GvRecepcionUsadosModal) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 63e308fac..959db35a3 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -356,6 +356,9 @@
  • Imprimir Formato Cicovisa
  • +
  • + Enviar Poliza Virtual +
  • @@ -1301,7 +1304,7 @@
    + DataKeyNames="CvePolizaVirtual,SerieLote,IdProductoPolizaVirtual,Total,Descuento,AnioVehiculo,FechaUsado,IdModeloAuto,IdMarcaAuto,IdBCI,TipoServicio,TipoPoliza,TieneUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None"> diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index b837eb7cd..48bc89e06 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4174,7 +4174,10 @@ Partial Class Ventas End If If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev", "Ant") Then - If ObjVentas.GetVentasAntNC(-1, CveVenta) Then + Dim AplicaAmortizacion As Boolean = False + If DdlTipoComprobante.SelectedValue.Contiene("Ant") Then AplicaAmortizacion = True + + If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then GvNC.DataSource = ObjVentas.DtResultados TmpDTNCVinculadas = ObjVentas.DtResultados GvNC.Caption = "
    Ventas Aplicadas
    " @@ -4187,7 +4190,7 @@ Partial Class Ventas Next End If End If - End If + End If If GvNC.Rows.Count > 0 Then ImgAntiPend.Visible = False @@ -5742,8 +5745,8 @@ Partial Class Ventas Dim Cantidad, PU, Descuento, CantidadInventario As Decimal Dim CuentaPredial As String Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal - PU = Math.Round(GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal, 6) - Descuento = Math.Round(GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal, NumeroDecimales) + PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6) + Descuento = (GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal).RoundSQL(NumeroDecimales) CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal() @@ -14125,7 +14128,7 @@ Partial Class Ventas Dim Row As DataRow = Nothing Dim TotalCalculableImpuestos As Decimal = 0 Dim TotalCalculableImpuestosIVA As Decimal = 0 - PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos + PU = PU.RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos Row = TmpDT.NewRow() Row("CveProyecto") = CveProyecto @@ -23935,11 +23938,20 @@ Partial Class Ventas #Region "P O L I Z A - V I R T U A L" Private Sub CargaCodigoUnico() - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then Dim ObjAcum As New ClsAcumuladores - If ObjAcum.GetGarantiasPolizaVirtual(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then - GvCodigosUnicos.DataSource = ObjAcum.DtResultados - DivCodigosUnicos.Visible = True + If ObjAcum.GetPolizasVirtuales(Me.CveVenta) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then + Dim RowPoliza As DataRow = ObjAcum.DtResultados.Rows(0) + + If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then + GvCodigosUnicos.DataSource = ObjAcum.DtResultados + DivCodigosUnicos.Visible = True + End If + + If Not CBool(RowPoliza("Enviada").ToString()) Then + LnkEnviarPolizaVirtual.Visible = True + End If + End If ObjAcum.Dispose() GvCodigosUnicos.DataBind() @@ -23947,47 +23959,56 @@ Partial Class Ventas End Sub Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura) Try + 'TipoPoliza: 01 Venta, 02 Ajuste, 03 Garantía + Dim TipoPoliza As Integer = 0 For Each Row As GridViewRow In GvCodigosUnicos.Rows If Row.RowType = DataControlRowType.DataRow Then + Dim CvePolizaVirtual As Integer = Row.DataKey("CvePolizaVirtual").ToEntero() + Dim obj As New Modelos.MPolizaVentaWS 'DATOS DEL CLIENTE obj.customer_name = ObjFactura.Cliente.Nombre - obj.customer_last_name1 = "" + obj.customer_last_name1 = "." obj.customer_last_name2 = "" obj.customer_birthday = Nothing obj.customer_phone = ObjFactura.Cliente.Telefono obj.customer_email = ObjFactura.Cliente.Mail obj.customer_gender = "03" 'OTRO GENERO obj.customer_advertising = False - obj.customer_car_brand = "00" - obj.customer_car_model = "00" - obj.customer_car_year = ObjFactura.Fecha.Year + obj.customer_car_brand = Row.DataKey("IdMarcaAuto").ToString().Trim() + obj.customer_car_model = Row.DataKey("IdModeloAuto").ToString().Trim() + obj.customer_car_year = Row.DataKey("AnioVehiculo").ToString().ToEntero() 'DATOS DE VENTA obj.sale_date = ObjFactura.Fecha obj.sale_paidby = "01" obj.sale_type = "01" 'PISO - obj.sale_type_service = "02" 'COMERCIAL - obj.sale_total = ObjFactura.Total - obj.sale_discount = ObjFactura.Descuento - obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta) + obj.sale_type_service = "0" & Row.DataKey("TipoServicio").ToString().Trim() + obj.sale_total = Row.DataKey("Total").ToString().ToDecimal() + obj.sale_discount = Row.DataKey("Descuento").ToString().ToDecimal() + obj.sale_id = ObjFactura.CveVenta.ToString 'DATOS DEL PRODUCTO - obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString() - obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE) - obj.product_sale_type = "01 " 'VENTA - - Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime() + obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString().Trim() + obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text.Trim() 'se indique el código único de la batería. (SERIE LOTE) + obj.product_sale_type = "0" & Row.DataKey("TipoPoliza").ToString().Trim() 'DATOS DE USADO - obj.used_product = True - obj.used_brand = Row.DataKey("IdModelo").ToString() 'MARCAR DEL USADO - obj.used_bci = Row.DataKey("IdBCI").ToString() 'VALOR DEL BCI - obj.used_month = FechaUsado.Month - obj.used_year = FechaUsado.Year - obj.used_sale_date = FechaUsado + obj.used_product = CBool(Row.DataKey("TieneUsado").ToString()) + + If obj.used_product Then + Dim FechaUsado As DateTime = Row.DataKey("FechaUsado").ToString().ToDateTime() + + obj.used_brand = Row.DataKey("IdModelo").ToString().Trim() 'MARCAR DEL USADO + obj.used_bci = Row.DataKey("IdBCI").ToString().Trim() 'VALOR DEL BCI + obj.used_month = FechaUsado.Month + obj.used_year = FechaUsado.Year + obj.used_sale_date = FechaUsado + End If + + + EnviarPolizaVentaWS(obj, CvePolizaVirtual) - EnviarPolizaVentaWS(obj) End If Next Catch ex As Exception @@ -23997,11 +24018,11 @@ Partial Class Ventas End Sub - Protected Function EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS) As Boolean + Protected Function EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS, CvePolizaVirtual As Integer) As Boolean Dim Retorno As Boolean = False Dim Respuesta As String = "[]" - Dim User As String = "cslth.2809@jcilink.com" + Dim User As String = "cslth.7777@lth.com" Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076" Try @@ -24048,13 +24069,22 @@ Partial Class Ventas Dim resp = JArray.Parse(Respuesta) If resp.Count > 0 Then - Dim Msg = resp(0)("Descripcion").ToString() + Dim Msg As New StringBuilder() + Msg.AppendFormat("Mensaje Poliza Virtual: {0}", resp(0)("Descripcion").ToString()) If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508") Then - Alert(Msg, TipoMensaje.MsgInformacion) Retorno = True + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, True, Now) Then + Alert(Msg.ToString(), TipoMensaje.MsgInformacion) + End If + ObjAcum.Dispose() Else - Alert(Msg, TipoMensaje.MsgAdvertencia) + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, False, Now) Then + Alert(Msg.ToString(), TipoMensaje.MsgAdvertencia) + End If + ObjAcum.Dispose() End If Else Alert("No se envió la poliza virtual", TipoMensaje.MsgAdvertencia) @@ -24068,6 +24098,13 @@ Partial Class Ventas Return Retorno End Function + + Protected Sub LnkEnviarPolizaVirtual_Click(sender As Object, e As EventArgs) + If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contains("Rem") Then + CreaObjetosVenta() + GeneraPolizaVentaWS(ObjFactura) + End If + End Sub #End Region Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs) @@ -24112,4 +24149,5 @@ Partial Class Ventas End Sub + End Class \ No newline at end of file diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx index 7beb67125..c834e2cd5 100644 --- a/asmx/WSGPSApp.asmx +++ b/asmx/WSGPSApp.asmx @@ -938,6 +938,26 @@ Public Class WSGPSApp End Function + + Public Function GetArrastre(CveDispositivo As Integer) As String + Dim Retorno As String = "[]" + Using ObjGPS As New ClsGPS + If ObjGPS.GPS_ArrastreGET(CveDispositivo) Then + Retorno = ObjGPS.DtResultados.DataTableToJSONIPP() + End If + End Using + Return Retorno + + End Function + + Public Function ActivarDesactivarArrastre(CveDispositivo As Integer, Activo As Boolean) As Boolean + Dim Retorno As Boolean = False + Using ObjGPS As New ClsGPS + Retorno = ObjGPS.GPS_ArrastreActivarDesactivar(CveDispositivo, Activo) + End Using + Return Retorno + End Function + Public Function GetTrayectos(CveCliente As Integer) As String Dim Retorno As String = "[]" diff --git a/asmx/WsTSoft.asmx b/asmx/WsTSoft.asmx index 94e8b0ab4..7d9e99ee5 100644 --- a/asmx/WsTSoft.asmx +++ b/asmx/WsTSoft.asmx @@ -62,9 +62,16 @@ Public Class WsTSoft Dim ObjGPS As New ClsGPS Dim Continuar As Boolean = ObjGPS.UltimaPosicionEquipoGetWS(DevID) Dim ObjPos As New LatLng - If Continuar Then + If Continuar Then + 'CONSULTA DIRECCIONES + Dim Direcciones As JArray = ConsultarDirecciones(ObjGPS.DtResultados, "Lat", "Lng") + For Each Dir As JObject In Direcciones + ObjGPS.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() + Next + ObjPos.Lat = ObjGPS.DtResultados.Rows("0")("Lat").ToString - ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString + ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString + ObjPos.Direccion = ObjGPS.DtResultados.Rows("0")("Direccion").ToString Else ObjPos.CurrentError = "No se pudo obtener la posición." End If @@ -95,8 +102,17 @@ Public Class WsTSoft Dim objTsoft As New ClsTSoft Dim Continuar As Boolean = objTsoft.GETRemisionesHistorial(FolioRemision, NoEconomico) Dim objRem As New GetRemisionHistorialesObj - If Continuar Then - objRem.Historial = objTsoft.DtResultados.DataTableToObject(Of GetRemisionHistorialsObj) + If Continuar Then + Dim Dt = objTsoft.DtResultados.Copy() + Dt.Columns.Add("Direccion", GetType(String)) + + 'CONSULTA DIRECCIONES + Dim Direcciones As JArray = ConsultarDirecciones(Dt, "Lat", "Lon") + For Each Dir As JObject In Direcciones + Dt.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() + Next + + objRem.Historial = Dt.DataTableToObject(Of GetRemisionHistorialsObj) objRem.CurrentError = "" Else objRem.Historial = New List(Of GetRemisionHistorialsObj) @@ -149,15 +165,15 @@ Public Class WsTSoft End Function - Public Function ConsultarDirecciones(Dt As DataTable) As JArray + Public Function ConsultarDirecciones(Dt As DataTable, Optional LatName As String = "Latitud", Optional LonName As String = "Longitud") As JArray Dim retorno As JArray = Nothing Dim posicionesArray = New JArray(From Row As DataRow In Dt Let index = Dt.Rows().IndexOf(Row) Select New JObject( New JProperty("indice", index), New JProperty("cveTrama", -1), - New JProperty("lat", Row("Latitud").ToString.ToDouble), - New JProperty("lon", Row("Longitud").ToString.ToDouble) + New JProperty("lat", Row(LatName).ToString.ToDouble), + New JProperty("lon", Row(LonName).ToString.ToDouble) )) Dim Base64array = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(posicionesArray.ToString())) @@ -193,9 +209,10 @@ Public Class WsTSoft End Class Public Class LatLng - Public Lat As String - Public Lng As String - Public CurrentError As String + Public Property Lat As String + Public Property Lng As String + Public Property Direccion As String + Public Property CurrentError As String End Class Public Class GetRemisionHistorialsObj @@ -203,7 +220,8 @@ Public Class WsTSoft Public Property FolioRemision As String Public Property NoEconomico As String Public Property Lat As String - Public Property Lon As String + Public Property Lon As String + Public Property Direccion As String Public Property Distancia As String Public Property TrackingNumber As String Public Property CveEstatus As Integer diff --git a/vwd.webinfo b/vwd.webinfo new file mode 100644 index 000000000..07746b18a --- /dev/null +++ b/vwd.webinfo @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file