From 46f3cf342a26ce99539ed2f495ab6855799d064c Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Tue, 21 Jan 2020 13:26:01 -0700 Subject: [PATCH 01/17] - porcentaje RetIVa servicios --- Ventas/ClientesAbonar.aspx.vb | 77 ++++++++++++++++++----------------- Ventas/Ventas.aspx.vb | 55 ++++++++++++++----------- 2 files changed, 71 insertions(+), 61 deletions(-) diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index b392ba7ff..37cd442b5 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 @@ -2308,8 +2308,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 +2330,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 +2353,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 +2422,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 +2476,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 +2507,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 +2543,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 +2565,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 +2575,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 +2595,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 +2623,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 +2775,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 +2955,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/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7660824e9..d3fb8d54f 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5938,16 +5938,17 @@ Partial Class Ventas Dim ClienteRetIVA = Me.ClienteRetIVA If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - ClienteRetIVA = 0.0D - If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.106667D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then - ClienteRetIVA = 0.04D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then - ClienteRetIVA = 0.06D + 'ClienteRetIVA = 0.0D + If ClienteRetIVA <= 0 Then + If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then + ClienteRetIVA = 0.106667D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then + ClienteRetIVA = 0.04D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then + ClienteRetIVA = 0.06D + End If End If - - LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero + ' LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero DdlTipoRetencion.Visible = True End If @@ -14260,16 +14261,19 @@ Partial Class Ventas Dim ClienteRetIVA = Me.ClienteRetIVA If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - ClienteRetIVA = 0.0D - If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.106667D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then - ClienteRetIVA = 0.04D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then - ClienteRetIVA = 0.06D + 'ClienteRetIVA = 0.0D + If ClienteRetIVA <= 0 Then + If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then + ClienteRetIVA = 0.106667D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then + ClienteRetIVA = 0.04D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then + ClienteRetIVA = 0.06D + End If + End If - LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero + ' LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero DdlTipoRetencion.Visible = True End If @@ -24068,13 +24072,16 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then For Each RowServicio As DataRow In TmpDT.Rows - Dim ClienteRetIVA = 0.0D - If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.106667D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then - ClienteRetIVA = 0.04D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then - ClienteRetIVA = 0.06D + Dim tClienteRetIVA = ClienteRetIVA + If tClienteRetIVA <= 0 Then + If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then + tClienteRetIVA = 0.106667D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then + tClienteRetIVA = 0.04D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then + tClienteRetIVA = 0.06D + End If + ViewState("ClienteRetIVA") = tClienteRetIVA End If Dim TotalCalculableImpuestos As Decimal = (RowServicio("Cantidad").ToString().ToDecimal() * RowServicio("PU").ToString().ToDecimal()) - RowServicio("Descuento").ToString().ToDecimal() From 64422caab8bfc74f074686ffc3eda8f2822763e0 Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Wed, 22 Jan 2020 16:18:46 -0700 Subject: [PATCH 02/17] -compras retenciones otros impuestos - sigweb, que filtre nombre y nombrecomercial del cliente - ventas, que se visualice la amortizacion --- Ashx/SIGWeb.ashx | 2 +- Compras/Compras.aspx.vb | 8 ++++---- Ventas/Ventas.aspx.vb | 7 +++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index faf915fda..a3b5e8ba8 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -201,7 +201,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 diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index b52e68192..3815cc13b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2235,7 +2235,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 @@ -7443,7 +7443,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 @@ -11945,7 +11945,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 @@ -16458,7 +16458,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 diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d3fb8d54f..ad6b37a86 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 From 200e0b2ee17ae6c7d1b3834fcb219f0514e74b0f Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Wed, 22 Jan 2020 18:41:56 -0700 Subject: [PATCH 03/17] -clientesabonar, descuento pronto pago - extensiones, redondeo mayor a 4 --- App_Code/modExtensiones.vb | 4 ++-- Ventas/ClientesAbonar.aspx.vb | 34 ++++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 16 deletions(-) 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/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 37cd442b5..99e1f03d7 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -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")) From 8b6fad60ba05998162d282b1b9554caaad20128f Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 22 Jan 2020 20:06:45 -0700 Subject: [PATCH 04/17] Poliza Virtual en Ventas --- App_Code/ClsAcumuladores.vb | 63 +++++++++++++++++++++ App_Code/Modelos.vb | 44 +++++++++++++-- Ventas/Clientes.aspx.vb | 4 +- Ventas/PV.aspx | 20 ++++++- Ventas/PV.aspx.vb | 110 +++++++++++++++++++++++++++++++++++- Ventas/Ventas.aspx | 5 +- Ventas/Ventas.aspx.vb | 93 ++++++++++++++++++++---------- 7 files changed, 301 insertions(+), 38 deletions(-) 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/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/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index a44f70cae..3a31e3939 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -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/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 2d40eee5b..f0d4d7800 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -23931,11 +23931,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() @@ -23943,47 +23952,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 @@ -23993,11 +24011,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 @@ -24044,13 +24062,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) @@ -24064,6 +24091,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) @@ -24102,4 +24136,5 @@ Partial Class Ventas End If End Sub + End Class \ No newline at end of file From 88519c471718cc4faf9be2b20f6a998828016ebd Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Wed, 22 Jan 2020 20:14:41 -0700 Subject: [PATCH 05/17] - acreedor/proveedor --- App_Code/ClsCompras.vb | 4 ++-- Compras/Compras.aspx.vb | 51 ++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 28 deletions(-) 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/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index fe5277c09..d7784b57e 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" @@ -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 @@ -6648,6 +6646,7 @@ Partial Class Compras_Compras CveCuenta = CveCuentaProveedorExtranjera End If End If + If CveTipoConcepto = 2 Then ConceptoContable = 305 'cuando es acreedor Case 59 'Documentos importeMovimiento = importeCreditos @@ -19363,12 +19362,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 From 601ccedb44badf0b85719c4380b303e212356b76 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 22 Jan 2020 20:30:56 -0700 Subject: [PATCH 06/17] saldar fye --- Bancos/RepEgresosSinComprobante.aspx.vb | 42 ++++++++++++++----------- 1 file changed, 23 insertions(+), 19 deletions(-) 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 From 58eed4766ce200051e5adab187fcd6240a5d8366 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 22 Jan 2020 20:31:25 -0700 Subject: [PATCH 07/17] Arrastre en APP --- GPS/RepArrastre.aspx | 370 ++++++++++++++++++++-------------------- GPS/RepArrastre.aspx.cs | 198 ++++++++++----------- asmx/WSGPSApp.asmx | 20 +++ 3 files changed, 304 insertions(+), 284 deletions(-) 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/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 = "[]" From 2fcfdad4cdfce52aab885e07a16557b9736d8c83 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 23 Jan 2020 12:07:11 -0700 Subject: [PATCH 08/17] agregando dropdownlost al resguardo material --- Ashx/SIGWeb.ashx | 48 ++++++ Empresas/146/Formatos/NotaCredito.rdlc | 4 +- Inventarios/ResguardoMaterial.aspx | 90 +++++----- Inventarios/ResguardoMaterial.aspx.vb | 221 +++++++++++++------------ 4 files changed, 217 insertions(+), 146 deletions(-) diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index a3b5e8ba8..b4e505574 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 @@ -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("GlobalDTCompProveedores{0}", CveEmpresa) + 'sino existe, recarga los datos + If context.Application(AppNombre) Is Nothing Then + Dim ObjProveedores As New ClsRH + If ObjProveedores.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, usuario.CveEmpresa) Then + context.Application(AppNombre) = ObjProveedores.DtResultados + End If + ObjProveedores.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($"Nombre like '%{Name}%'") + End If + End If + + If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then + DtRetorno.Columns("CvePersonal").ColumnName = "id" + DtRetorno.Columns("Nombre").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/Empresas/146/Formatos/NotaCredito.rdlc b/Empresas/146/Formatos/NotaCredito.rdlc index 8044cb5cc..4cbb34b50 100644 --- a/Empresas/146/Formatos/NotaCredito.rdlc +++ b/Empresas/146/Formatos/NotaCredito.rdlc @@ -1447,9 +1447,9 @@ External =Parameters!QR.Value FitProportional - 3.15082in + 3.13693in 0.15526in - 0.95455in + 1.06738in 1.49755in 6 - - - - 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/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 From 06e57efeedcbbff471c95b80afd6cab2455b84fa Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 24 Jan 2020 17:34:37 -0700 Subject: [PATCH 17/17] cambios en los reportes --- Compras/PopUpVerFactura.aspx.vb | 73 ++++++++++++++----------- Empresas/72/Formatos/EntradaSalida.rdlc | 9 +++ 2 files changed, 51 insertions(+), 31 deletions(-) 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/Empresas/72/Formatos/EntradaSalida.rdlc b/Empresas/72/Formatos/EntradaSalida.rdlc index 367195937..e490dca7f 100644 --- a/Empresas/72/Formatos/EntradaSalida.rdlc +++ b/Empresas/72/Formatos/EntradaSalida.rdlc @@ -992,6 +992,9 @@ 0.6cm 1.57396cm 9 + + =IIF(Parameters!FacturaProveedor.Value<>"",False,True) + @@ -1573,6 +1576,12 @@ String ReportParameter1 + + String + true + true + ReportParameter1 +