From c519951a5a35c2bf1d8a23e78cbe77f186e998ba Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 29 Nov 2019 11:51:19 -0700 Subject: [PATCH 01/10] varios --- App_Code/Modelos.vb | 2 +- Bancos/IE.aspx | 2 +- Bancos/IE.aspx.vb | 15 ++++--- Bancos/ProveedoresAbonar.aspx.vb | 8 +++- Compras/RepNotasCredito.aspx.vb | 4 +- Contabilidad/RegPrePoliza.aspx.vb | 26 ++++++++--- Inventarios/RecepcionUsados.aspx | 2 +- OC/CotizacionEnLinea.aspx.vb | 35 +++++++++++++++ Ventas/PV.aspx.vb | 9 ++-- Ventas/Ventas.aspx.vb | 72 ++++++++++++++++--------------- 10 files changed, 119 insertions(+), 56 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 86fdecdd5..c345bb6fb 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4998,7 +4998,7 @@ Namespace Modelos Public Property EsInterno As Integer = -1 Public Property CveEmpresaCRM As Integer = -1 Public Property EmpresaCRM As String = "" - Public Property TotalImpuestoLocal As Double = 0 + Public Property TotalImpuestoLocal As Decimal = 0 Public Property AplicaDevolucion As Boolean Public Property CveVentaDevolucion As Integer Public Property ObservacionesAlmacen As String diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index f6da1935f..e929eccf0 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -1549,7 +1549,7 @@ function ValidarCantidad(t, c) { var Ot = 0.00; // considera importe de OT ingresos, para que se peuda exceder - if ($get('TxtOtrosIngresosEgresos')) { Ot = -ToDouble($get('TxtOtrosIngresosEgresos').value);} + if ($get('TxtOtrosIngresosEgresos')) { Ot = ToDouble($get('TxtOtrosIngresosEgresos').value);} t.value = (ToDouble(t.value) > ToDouble(c) + Ot ? c : t.value) } diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 12328b592..ef2efaaaa 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1381,11 +1381,8 @@ Partial Class Bancos_IE Dim Banco As New ClsBancos Folio = Banco.GetNextFolio(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero) Banco.Dispose() - TxtFolio.Text = Folio.ToString - - If Opcion = "DevDinC" Then - TxtFolio.Enabled = False - End If + TxtFolio.Text = Folio.ToString + Else TxtFolio.Text = "" End If @@ -2335,6 +2332,9 @@ Partial Class Bancos_IE CveConceptoContable = 30 'Bancos CvePlantillaPoliza = 12 End If + End If + If Opcion = "DevDinC" Then + CvePlantillaPoliza = 2 End If 'Cuando es Egreso sin factura, se registra una compra tipo anticipo @@ -2689,10 +2689,12 @@ Partial Class Bancos_IE TipoMovtoIE = True Impo = Math.Abs(Impo) CveConcIE = 78 + IdCtaContableAplicar = UsuarioActual.Empresa.IdCuentaOtrosIngresos Else TipoMovtoIE = False Impo = Math.Abs(Impo) CveConcIE = 211 + IdCtaContableAplicar = UsuarioActual.Empresa.Funcionalidad(266).ToEntero End If If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=Impo, ImporteME:=0) Then @@ -2815,12 +2817,15 @@ Partial Class Bancos_IE TipoMovtoIE = True Impo = Math.Abs(Impo) CveConcIE = 78 + IdCtaContableAplicar = UsuarioActual.Empresa.IdCuentaOtrosIngresos Else TipoMovtoIE = False Impo = Math.Abs(Impo) CveConcIE = 211 + IdCtaContableAplicar = UsuarioActual.Empresa.Funcionalidad(266).ToEntero End If + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=Impo, ImporteME:=0, CveCuenta:=CveCuentaConta, TipoCambio:=TCDocumento) Then MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" Exit Select diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 07d75b7e3..4190ddce9 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -2777,8 +2777,14 @@ Partial Class Bancos_ProveedoresAbonar If gr.DataKey("IEPS").ToDecimal > 0 Then Dim IEPS As Decimal = PorcentajePago * gr.DataKey("IEPS").ToDecimal + If ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditarSIG").ToString.ToEntero + End If + End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, gr.DataKey("SerieFolio").ToString, 25, ConceptoPartida, Now, IdCtaContable:=CtaProveedor, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, IEPS, IEPS * If(FuncionalidadFluctuacionImpuestos, TCPago, TCCompra)), CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, gr.DataKey("SerieFolio").ToString, 25, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, IEPS, IEPS * If(FuncionalidadFluctuacionImpuestos, TCPago, TCCompra)), CveCuenta:=CveCuenta) Then MsgError = "Ocurrio un error al saldar el movimiento" End If diff --git a/Compras/RepNotasCredito.aspx.vb b/Compras/RepNotasCredito.aspx.vb index 126a82d29..de2e1c43d 100644 --- a/Compras/RepNotasCredito.aspx.vb +++ b/Compras/RepNotasCredito.aspx.vb @@ -159,12 +159,12 @@ Partial Class Compras_RepNotasCredito If UsaComplementaria AndAlso CveMoneda > 1 Then ImporteComplementaria = (Importe * TCCompra - Importe).RoundSQL IdCtaContableComplementaria = gr.DataKey("IdCtaContComplementaria").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-ImporteComplementaria, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-Importe, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then MsgError = "Ocurrio un Error al saldar el movimiento" End If End If - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(564).ToString.ToEntero + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(266).ToString.ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then MsgError = "Ocurrio un Error al saldar el movimiento" End If diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index f982fbcdd..6f9bc23e5 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -210,6 +210,10 @@ Partial Class ContabilidadC_RegPrePoliza GvConcepto.Columns(4).Visible = False GvMov.Columns(5).Visible = False End If + + If IfNull(Request("Conta"), "").ToString = "1" Then + Contabilizar() + End If Exit Sub Else @@ -1454,8 +1458,17 @@ Partial Class ContabilidadC_RegPrePoliza Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click + Contabilizar() + + End Sub + + Private Sub Contabilizar() Dim ObjConta As New ClsContabilidad + If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero + ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) + End If + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1)) Then Alert(String.Format("Prepóliza contabilizada.

Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) Else @@ -1463,14 +1476,13 @@ Partial Class ContabilidadC_RegPrePoliza Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) End If - ObjConta.Dispose() - - - End Sub - - + ObjConta.Dispose() + End Sub + + + #Region "COMPLEMENTO DE PAGO" - + Private Sub GeneraTimbre(CvePrePoliza As Integer) Dim Str As New StringBuilder Dim Banco As New ClsBancos diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index b638735ae..44fcd83b9 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -321,7 +321,7 @@ - + diff --git a/OC/CotizacionEnLinea.aspx.vb b/OC/CotizacionEnLinea.aspx.vb index 25a94b4e7..24b9e12cf 100644 --- a/OC/CotizacionEnLinea.aspx.vb +++ b/OC/CotizacionEnLinea.aspx.vb @@ -115,6 +115,15 @@ Partial Class OC_CotizacionEnLinea CType(Me.Master, Site).EsPopup = True CType(Me.Master, Site).PopupWidth = 670 + + If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then + + If IfNull(Request("Conta"), "").ToString = "1" Then + Contabilizar(Request("CveEmpresa").ToEntero, Request("CvePrePoliza").ToEntero, Request("IdPoliza").ToEntero) + End If + Exit Sub + End If + 'Validar que este activo aun el link 'ViewState("CveOrdenCompra") = If(Not Request("CveOrdenCompra") Is Nothing AndAlso Request("CveOrdenCompra").ToString.ToEntero > 0, Request("CveOrdenCompra").ToEntero, 0) 'ViewState("CveProveedor") = If(Not Request("CveProveedor") Is Nothing AndAlso Request("CveProveedor").ToString.ToEntero > 0, Request("CveProveedor").ToEntero, 0) @@ -147,6 +156,32 @@ Partial Class OC_CotizacionEnLinea End If End Sub + + Private Sub Contabilizar(CveEmpresa As Integer, CvePrePoliza As Integer, IdPoliza As Integer) + Dim ObjConta As New ClsContabilidad + + If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero + ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) + End If + Dim Emp As Empresa = Nothing + Dim Empr As New ClsSisEmpresas + If Empr.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then + Emp = Empr.Empresa + End If + + Empr.Dispose() + + + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, 100, Emp, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1)) Then + ' Alert(String.Format("Prepóliza contabilizada.

Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + Else + + 'Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + End If + + ObjConta.Dispose() + End Sub + Protected Sub CargaMonedas() Dim objMonedas As New ClsMonedas diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index bc113f964..cb08d6e99 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -5206,7 +5206,8 @@ Partial Class PV If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then If ObjAcum.DtResultados.Rows.Count > 0 Then TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString - TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * TxtPUFactura.Text.ToDouble).FormatoNumero + + TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero Dim CargoVendido As Decimal = 0 Dim CargoGarantia As Decimal = 0 @@ -5240,7 +5241,7 @@ Partial Class PV CargoGarantia = CargoVendido End If TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}." - TxtImporteAjuste.Text = ((TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero + TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero End If End If @@ -5297,7 +5298,7 @@ Partial Class PV TmpDTAjustes.Rows(IndexAjuste)("Consecutivo") = TxtConsecutivoAjuste.Text TmpDTAjustes.Rows(IndexAjuste)("FechaAjuste") = TxtFechaAjuste.Text.ToDate TmpDTAjustes.Rows(IndexAjuste)("Meses") = TxtMesesUso.Text.ToDouble - TmpDTAjustes.Rows(IndexAjuste)("PorcentajeAjuste") = TxtPorcentajeAjuste.Text + TmpDTAjustes.Rows(IndexAjuste)("PorcentajeAjuste") = TxtPorcentajeAjuste.Text.ToDecimal TmpDTAjustes.Rows(IndexAjuste)("NumPoliza") = TxtPoliza.Text.ToDouble TmpDTAjustes.Rows(IndexAjuste)("Importe") = TxtImporteAjuste.Text.ToDouble TmpDTAjustes.Rows(IndexAjuste)("ConsecutivoVenta") = ConsecutivoVenta @@ -5331,7 +5332,7 @@ Partial Class PV End If End If - Dr("Descuento") = Math.Round(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble, NumeroDecimales) + Dr("Descuento") = Math.Round(TxtImporteAjuste.Text.ToDouble, NumeroDecimales) 'Dr("Descuento") = Math.Round((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) + (CargoActual - CargoAnterior), NumeroDecimales) If Dr("Descuento").ToString.ToDouble > TxtPrecio.Text.ToDouble Then Dr("Descuento") = TxtPrecio.Text.ToDouble diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index c6ab85b0f..70e645bed 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -7235,27 +7235,6 @@ Partial Class Ventas ObjFacturaDevolucion.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim ObjFacturaDevolucion.MonedaAbreviatura = "" - 'DETALLES - If NCDescuento Then - PreparaNCDescuento(ObjFacturaDevolucion) - Else - ObjFacturaDevolucion.DtDetalle = TmpDT - - ObjFacturaDevolucion.SubTotal = TxtSubTotal.Text.ToDecimal - ObjFacturaDevolucion.Descuento = LblDescuentos.Text.Trim.ToDecimal - ObjFacturaDevolucion.Amortizacion = LblAmortizacion.Text.Trim.ToDecimal - ObjFacturaDevolucion.IVA = TxtIVA.Text.ToDecimal - ObjFacturaDevolucion.RetIVA = TxtRetIVA.Text.ToDecimal - ObjFacturaDevolucion.RetISR = TxtRetISR.Text.ToDecimal - ObjFacturaDevolucion.IEPS = TxtIEPS.Text.ToDecimal - ObjFacturaDevolucion.Total = TxtTotal.Text.ToDecimal - End If - 'Totales, Y se llena TmpDTImpuestos - - 'ObjFactura.BZDescripcion = TxtBZDescripcion.Text.Trim - 'ObjFactura.BZNombreCorto = TxtBZNombreCorto.Text.Trim - 'ObjFactura.BZTotalLetra = TxtBZTotalLetra.Text.Trim - If TmpDTImpuestos Is Nothing Then CreaDTImpuestos() Else @@ -7302,6 +7281,30 @@ Partial Class Ventas ObjFacturaDevolucion.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC") + 'DETALLES + If NCDescuento Then + PreparaNCDescuento(ObjFacturaDevolucion) + Else + ObjFacturaDevolucion.DtDetalle = TmpDT + + ObjFacturaDevolucion.SubTotal = TxtSubTotal.Text.ToDecimal + ObjFacturaDevolucion.Descuento = LblDescuentos.Text.Trim.ToDecimal + ObjFacturaDevolucion.Amortizacion = LblAmortizacion.Text.Trim.ToDecimal + ObjFacturaDevolucion.IVA = TxtIVA.Text.ToDecimal + ObjFacturaDevolucion.RetIVA = TxtRetIVA.Text.ToDecimal + ObjFacturaDevolucion.RetISR = TxtRetISR.Text.ToDecimal + ObjFacturaDevolucion.IEPS = TxtIEPS.Text.ToDecimal + ObjFacturaDevolucion.TotalImpuestoLocal = ObjFacturaDevolucion.DtDeduccion.SUMD("Importe", "TipoImpuesto = 1") + ObjFacturaDevolucion.Total = TxtTotal.Text.ToDecimal + End If + 'Totales, Y se llena TmpDTImpuestos + + 'ObjFactura.BZDescripcion = TxtBZDescripcion.Text.Trim + 'ObjFactura.BZNombreCorto = TxtBZNombreCorto.Text.Trim + 'ObjFactura.BZTotalLetra = TxtBZTotalLetra.Text.Trim + + + 'otros ObjFacturaDevolucion.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim ObjFacturaDevolucion.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim @@ -7473,7 +7476,7 @@ Partial Class Ventas Dim TotalRetIVA As Decimal = tmpcon.SUM("ImporteRetIVA").ToDecimal Dim TotalRetISR As Decimal = tmpcon.SUM("ImporteRetISR").ToDecimal Dim Total As Decimal = 0 - Dim TotalImpuestosLocales As Decimal = 0 + Dim TotalImpuestosLocales As Decimal = factura.TotalImpuestoLocal.ToString.ToDecimal Total = (TotalSubTotal - TotalDescuentos + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales) factura.SubTotal = TotalSubTotal @@ -9146,7 +9149,8 @@ Partial Class Ventas 'Contratos If factura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing") Then GuardarContratoAvanceEstimaciones(ObjContr, factura, ErrorList, 1) - ElseIf factura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Then + 'CUANDO ES NOTA DE CRÉDITO, NO DEBE DE CONSIDERAR AVANCE, CUANDO ES NOTA DE CRÉDITO POR AMORTIZACIÓN + ElseIf factura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then GuardarContratoAvanceEstimaciones(ObjContr, factura, ErrorList, -1) End If @@ -23436,19 +23440,19 @@ Partial Class Ventas Private Sub CalculaUsados() - If ClienteEsDistribuidor Then + '' If ClienteEsDistribuidor Then - Dim DTTamanios As New DataTable - Dim ObjAcum As New ClsAcumuladores + Dim DTTamanios As DataTable = Nothing + ' Dim ObjAcum As New ClsAcumuladores - If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then + 'If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then - DTTamanios = ObjAcum.DtResultados + DTTamanios = GlobalDTAcumTamaños() 'ObjAcum.DtResultados - Dim DTCvePSCostos As New DataTable - DTCvePSCostos = ObjAcum.DtResultados.FiltraParametros("", "", {"CvePSCargo"}) + Dim DTCvePSCostos As DataTable + DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"}) - If Not TmpDT.Columns.Contains("Eliminar") Then + If Not TmpDT.Columns.Contains("Eliminar") Then TmpDT.Columns.Add("Eliminar", GetType(Integer)) End If @@ -23573,10 +23577,10 @@ Partial Class Ventas Next ObjProductosServicios.Dispose() - End If + 'End If - ObjAcum.Dispose() - End If + ' ObjAcum.Dispose() + 'End If End Sub From 75f211ba01f9a207a629c26553c6acdd787dac15 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 29 Nov 2019 15:44:33 -0700 Subject: [PATCH 02/10] se agrego el dropdown de clientes en los ajustes al igual que su respectivo campo en el reporte --- Ventas/PV.aspx | 11 ++++++++++- Ventas/PV.aspx.vb | 30 ++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 1daa1f978..bbe006ae8 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2802,6 +2802,15 @@ +
+
+
+ + + +
+
+
@@ -2933,7 +2942,7 @@
-
+
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index bc113f964..19f3c25a7 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -2764,6 +2764,10 @@ Partial Class PV CargaPSAjuste() End Sub + Protected Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) + CargaPSAjuste() + End Sub + Private Sub DdlPSIndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost) If Not CveCliente > 0 Then @@ -4973,6 +4977,16 @@ Partial Class PV UpAjuste.Update() End Sub + Private Sub CargaClienteAjuste() + DdlClientes.Items.Clear() + + DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + DdlClientes.Items.Insert(0, New ListItem("Sin Factura", "-1")) + + DdlClientes.DataBind() + UpAjuste.Update() + End Sub + Private Sub CargaAjuste() Dim ObjAcum As New ClsAcumuladores If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa) Then @@ -5007,6 +5021,7 @@ Partial Class PV CreaDTmpDTAjustes() CreaDTmpDTRecepcionUsados() + CargaClienteAjuste() DivChkAjuste.Visible = True End Sub @@ -5723,9 +5738,20 @@ Partial Class PV Dim DtDatos As New DataTable Dim params As New List(Of ReportParameter) + + If DdlClientes.SelectedValue.ToEntero = -1 Then + params.Add(New ReportParameter("NombreCliente", LtlCliente.Text)) + params.Add(New ReportParameter("CiudadEstado", LblCiudad.Text.Trim + ", " + LblEstado.Text)) + Else + Dim Ciudad As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Ciudad", String.Format("CveCliente = {0}", DdlClientes.SelectedValue.ToEntero)).Trim + Dim Estado As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Estado", String.Format("CveCliente = {0}", DdlClientes.SelectedValue.ToEntero)) + params.Add(New ReportParameter("NombreCliente", DdlClientes.SelectedItem.Text)) + params.Add(New ReportParameter("CiudadEstado", String.Format("{0}, {1}", Ciudad, Estado))) + End If + 'Informacion Distribuidor - params.Add(New ReportParameter("NombreCliente", LtlCliente.Text)) - params.Add(New ReportParameter("CiudadEstado", LblCiudad.Text.Trim + ", " + LblEstado.Text)) + 'params.Add(New ReportParameter("NombreCliente", If(DdlClientes.SelectedValue.ToEntero = -1, LtlCliente.Text, DdlClientes.SelectedItem.Text))) + 'params.Add(New ReportParameter("CiudadEstado", LblCiudad.Text.Trim + ", " + LblEstado.Text)) params.Add(New ReportParameter("TelCliente", LblTelefono.Text)) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Consec", TxtConsecutivoAjuste.Text.Trim)) From 6fb19d2cfecd968892ea2f8c1d26a937b6a34155 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 29 Nov 2019 16:36:47 -0700 Subject: [PATCH 03/10] cambios en factura para bdh --- Empresas/140/Formatos/Factura.rdlc | 169 ++++++----------------------- 1 file changed, 34 insertions(+), 135 deletions(-) diff --git a/Empresas/140/Formatos/Factura.rdlc b/Empresas/140/Formatos/Factura.rdlc index fde3d230b..02372f4e0 100644 --- a/Empresas/140/Formatos/Factura.rdlc +++ b/Empresas/140/Formatos/Factura.rdlc @@ -595,11 +595,10 @@ - =Parameters!ClienteNombre.Value + =Parameters!ClienteCodigo.Value @@ -833,52 +832,6 @@ Left - - - - Pedido/Contrato: - - - - =Parameters!PedidoContrato.Value - - - - - - - - - Orden Compra: - - - - =Parameters!OrdenCompra.Value - - - - - Textbox2 0.05159in @@ -1376,6 +1329,29 @@ + + Vencimiento + + + + : + + + + =Parameters!Vencimiento.Value + + - - =iif(Parameters!TipoCambio.Value <= 1, "", "Tipo Cambio: " & Parameters!TipoCambio.Value) - - + Forma de pago: - - - - - - Textbox4 - - - #3a4173 - 2pt - 2pt - 2pt - 2pt - - - - @@ -2216,7 +2152,7 @@ - =Fields!ImporteIVA.Value & iif(Fields!PorcentajeIVA.Value = "0.16", " (16%)"," (0%)") + =Fields!ImporteIVA.Value - - - - - - ImporteIEPS - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -2330,7 +2230,6 @@ - From 7f6c8843899736587b9437da3570e441a034156b Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 30 Nov 2019 11:38:07 -0700 Subject: [PATCH 04/10] - --- Inventarios/PrestamosdeProveedor.aspx.vb | 2 +- Inventarios/RecepcionUsados.aspx.vb | 65 +----------------------- 2 files changed, 3 insertions(+), 64 deletions(-) diff --git a/Inventarios/PrestamosdeProveedor.aspx.vb b/Inventarios/PrestamosdeProveedor.aspx.vb index 8b04d2dc5..33b9f89ba 100644 --- a/Inventarios/PrestamosdeProveedor.aspx.vb +++ b/Inventarios/PrestamosdeProveedor.aspx.vb @@ -179,7 +179,7 @@ Partial Class Inventarios_PrestamosdeProveedor If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, TxtObservacionesEntrega.Text.Trim, 68, TxtObservacionesEntrega.Text.Trim, Fecha, idCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=tValorInventario) Then ErrorMovInv = True Else - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, -tValorInventario, TxtObservacionesEntrega.Text.Trim, CveConceptoContable, TxtObservacionesEntrega.Text.Trim, Fecha, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=CveClasifCosto, ImporteMX:=tValorInventario) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, -tValorInventario, TxtObservacionesEntrega.Text.Trim, CveConceptoContable, TxtObservacionesEntrega.Text.Trim, Fecha, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=CveClasifCosto, ImporteMX:=-tValorInventario) Then ErrorMovInv = True End If End If diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 7569691b3..ee62afd3a 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -1071,10 +1071,10 @@ Partial Class Inventarios_RecepcionUsados ErrorMovInv = True Exit For End If - + 'si es selectedvalue = 2, es entrada ,3 -salida Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2) - If RBLOpcion.SelectedValue.ToEntero <> 3 AndAlso Not GenerarRNC Then + If RBLOpcion.SelectedValue.ToEntero = 2 Then If EsDistribuidor Then If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then @@ -1638,51 +1638,6 @@ Partial Class Inventarios_RecepcionUsados End Sub #End Region -#Region " CONSUMO INTERNO " - 'Private Sub ActivaConsumoInterno() - ' EsConsumoInterno = True - - - - ' DdlAlmacen.AutoPostBack = False - ' DivFolio1.Visible = False - ' DivFolio2.Visible = False - - ' divMonedaSeccion.Visible = False - ' divGuia.Visible = False - ' TrResponsable.Visible = False - ' CargaPersonal() - - - ' 'RECARGA ALMACENES SOLO DE CONSUMO INTERNO - ' DdlAlmacen.Items.Clear() - ' DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 22) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) - ' DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) - ' DdlAlmacen.SelectedValue = "-1" - ' DdlAlmacen.DataBind() - ' If IsNothing(Request("CveMovimiento")) Then - ' DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen) - ' End If - - 'End Sub -#End Region - -#Region "PAQUETERIA GUIA" - 'Protected Sub LnkAgregarGuia_Click(sender As Object, e As EventArgs) - ' RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimiento)) - 'End Sub - - - - - - - - - - - -#End Region #Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED" @@ -1844,22 +1799,6 @@ Partial Class Inventarios_RecepcionUsados #End Region - Private Sub GuardarBitacora(CveVenta As Integer, RutaAdjunto As String, Obser As String) - Dim ObjEventos As New ClsOIEventos() - - - Try - If ObjEventos.AddEventoBitacora(Obser, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then - - - End If - Catch ex As Exception - OnError("Se presento un error al guardar la Bitacora", ex) - End Try - - ObjEventos.Dispose() - - End Sub Protected Sub LnkAgregarUsado_Click(sender As Object, e As EventArgs) AgregarUsado = True From 99d550107844272a244cfc71a546a2f2fe75cbf8 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 2 Dec 2019 09:30:20 -0700 Subject: [PATCH 05/10] actualizacion previa a agregar el campo "etiqueta" en Ajuste.rdlc --- Empresas/Grales/Formatos/Ajuste.rdlc | 24 ++++++++++++++++-- Ventas/PV.aspx | 11 +++++++- Ventas/PV.aspx.vb | 38 +++++++++++++++++++--------- 3 files changed, 58 insertions(+), 15 deletions(-) diff --git a/Empresas/Grales/Formatos/Ajuste.rdlc b/Empresas/Grales/Formatos/Ajuste.rdlc index 79d6d2dcf..2dbdcb959 100644 --- a/Empresas/Grales/Formatos/Ajuste.rdlc +++ b/Empresas/Grales/Formatos/Ajuste.rdlc @@ -861,7 +861,11 @@ - Tipo: + Tipo: +