From 65cae62f11c3beb2c7e706e6689be38975b54993 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 2 May 2022 06:58:56 -0700 Subject: [PATCH 01/19] -- descuetno de filtros de 27 a 25 --- Ventas/PV.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 1f22a90b7..dd24d323b 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -697,7 +697,7 @@ Partial Class PV Get Return New Dictionary(Of Integer, Decimal) From { {20516, 0.23D}, 'Descuento para lubricantes LTH - {20515, 0.274D} 'Descuento para filtros LTH + {20515, 0.25D} 'Descuento para filtros LTH } End Get End Property From 3d1d0e2c1c6ea11249443ae1c965b7debe69d0f9 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 2 May 2022 14:01:03 -0700 Subject: [PATCH 02/19] -- mejora en el registro. para NC, si cambian el tipomovto en la plantilla --- Compras/Compras.aspx.vb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 276ae8b3c..f858d76c4 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -5934,9 +5934,6 @@ Partial Class Compras_Compras Select Case ConceptoContable - - - Case 17 'Pago Proveedores If CveTipoConcepto = 2 Then ConceptoContable = 308 'cuando es acreedor @@ -7256,11 +7253,6 @@ Partial Class Compras_Compras Case 18 'NC - Notas de Credito - - - - - importeMovimiento = importeNC importeMN = importeMovimiento * tipoCambioActual * Multiplicador If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" @@ -7365,14 +7357,14 @@ Partial Class Compras_Compras Else IdCtaContable = CtaProveedor - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then For Each Gvr As GridViewRow In GvFacturaNC.Rows If Gvr.FCCheckBox("ChkFacturaNC").Checked Then 'Dim CvePrePolizaTemp = ObjConta.AddPrePolizas("Compras/Registrar", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa)) Dim importeMovimientoNC = Gvr.FCTextBox("TxtImporte").Text.ToDecimal Dim importeMNNC = importeMovimientoNC * tipoCambioActual * Multiplicador - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimientoNC, Referencia, 272, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMNNC, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimientoNC), CveCompraAmortizacion:=CveCompra, Contabilizable:=SeContabiliza) Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimientoNC, Referencia, 60, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMNNC, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimientoNC), Contabilizable:=SeContabiliza) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimientoNC, Referencia, 272, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMNNC, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimientoNC), CveCompraAmortizacion:=CveCompra, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimientoNC, Referencia, 60, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMNNC, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimientoNC), Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If Else From 921b0541287fe8721007f87b0feaec00fb68414e Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 2 May 2022 14:01:24 -0700 Subject: [PATCH 03/19] -- mejor en RFC destinatario --- App_Code/Timbres.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index 9c2c63e61..a38dffefe 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -122,8 +122,8 @@ Public Class Timbres Dim DtMovimientos As DataTable = Nothing Dim drT As DataRow = ObjGrales.DtResultados.Rows(0) - Timbre.Receptor.RFC = drT("DestinatarioRFC").ToString - Timbre.Receptor.Nombre = drT("DestinatarioNombre").ToString + Timbre.Receptor.RFC = drT("RemitenteRFC").ToString + Timbre.Receptor.Nombre = drT("RemitenteNombre").ToString Timbre.Receptor.DomicilioFiscalReceptor = drT("DirDesCP").ToString Timbre.Receptor.RegimenFiscalReceptor = drT("CodigoRegimenFiscalReceptor").ToString From 394d286eb83a418484fc05933f275d969daa968b Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 3 May 2022 06:17:13 -0700 Subject: [PATCH 04/19] -- multiplicador en concepto NC --- Compras/Compras.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index f858d76c4..4974cfbfb 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6951,7 +6951,7 @@ Partial Class Compras_Compras ErrorPrepoliza = True End If Else - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If End If From 00afd382280e8b15d129ffd6ca9df8dc1d3bc698 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 3 May 2022 06:17:31 -0700 Subject: [PATCH 05/19] tipo poliza E140 --- Ventas/Ventas.aspx.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 521472341..1c5732c3b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12030,13 +12030,13 @@ Partial Class Ventas factura.Alfa3 = "DEV" factura.DevolucionImportePagado = ObjFacturaNC.Total / ObjFacturaNC.PagadoBancos 'falta tomar el dato End If - Dim tCvePlantillaPoliza As Integer = factura.CvePlantillaPoliza + Dim tCveTipoPoliza As Integer = -1 If UsuarioActual.CveEmpresa = 140 Then - tCvePlantillaPoliza = 1 ' que sea siempre ingreso. + tCveTipoPoliza = 1 ' que sea siempre ingreso. End If - factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", tCvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa) + factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa, CveTipoPoliza:=tCveTipoPoliza) Dim RFCReceptor As String = "" From 356d9f39758579d90d111e3c922920a3d1f3b270 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 3 May 2022 06:18:01 -0700 Subject: [PATCH 06/19] =?UTF-8?q?--=20amortizaci=C3=B3n=20de=20pago?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/ClientesAbonar.aspx.vb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 3a61273de..911dc6847 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -1068,7 +1068,7 @@ Partial Class Ventas_ClientesAbonar End If 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo FluctuacionAnticipo = ((TCP - tipoCambioVenta) * gvr.FCTextBox("TxtAmort").Text.ToDecimal).RoundSQL - MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVenta) + MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVenta, gvr.DataKey("SerieFolio").ToString) End If @@ -1450,7 +1450,7 @@ Partial Class Ventas_ClientesAbonar If RblTipoPago.SelectedValue = "3" AndAlso MsgError = "" Then - MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta) + MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta, TxtObservaciones.Text) 'If CveMonedaPago = 2 Then ' 'rmf faltan las cuentas @@ -1684,7 +1684,7 @@ Partial Class Ventas_ClientesAbonar End Sub - Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, tipoCambioVenta As Decimal) As String + Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, tipoCambioVenta As Decimal, Referencia As String) As String Dim MsgError As String = "" If CveMonedaPago = 2 Then 'rmf faltan las cuentas @@ -1695,11 +1695,11 @@ Partial Class Ventas_ClientesAbonar tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, CveCliente, ImporteMX:=Importe, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then - MsgError = "No se pudo insertar la póliza" - End If + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, Referencia, TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, CveCliente, ImporteMX:=Importe, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + MsgError = "No se pudo insertar la póliza" + End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), TxtObservaciones.Text, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), Referencia, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then MsgError = "No se pudo insertar la póliza" End If From fd2a951e259860eae62b1589192e052338e74302 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 3 May 2022 06:18:50 -0700 Subject: [PATCH 07/19] -- regenerar entregas al cancelar --- Inventarios/RepEntregaAlmacenRuta.aspx.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs index 6d5380160..517334ba5 100644 --- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs +++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs @@ -532,11 +532,16 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { - //regenero el tmbre + //regenero el timbre if (TimbreTipoDocto == "Tra") { CveTimbre = ObjGenerales.AddGralTimbre("Tra", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true); } + //regenero el timbre + if (TimbreTipoDocto == "Ent") + { + CveTimbre = ObjGenerales.AddGralTimbre("Ent", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true); + } ProcesoOK = true; } } @@ -868,10 +873,10 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas using (ClsInventarios ObjInv = new ClsInventarios()) { - if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1)) + if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus : 1)) DdlModalCamion.DataSource = ObjInv.DtResultados; - if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2)) + if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus: 1)) DdlRemolque1.DataSource = ObjInv.DtResultados; } From 45cedf4e7893b4a6bd16dc9bfd2fe34a81e38ff7 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 3 May 2022 06:19:14 -0700 Subject: [PATCH 08/19] -- cvetipoalmacen --- Inventarios/RecepcionAlmacen.aspx.vb | 40 +++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 2c7a86278..13e274982 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -36,6 +36,14 @@ Partial Class Inventarios_RecepcionAlmacen ViewState("ValidaLoteCaducidad") = value End Set End Property + Private Property CveTipoAlmacen As Integer + Get + Return CType(ViewState("CveTipoAlmacen"), Integer) + End Get + Set(value As Integer) + ViewState("CveTipoAlmacen") = value + End Set + End Property Private Property DtInv As DataTable Get If ViewState("DtInv") Is Nothing Then @@ -557,18 +565,26 @@ Partial Class Inventarios_RecepcionAlmacen End Sub Private Sub RecargaporAlmacenes() - + CveTipoAlmacen = -1 If DdlAlmacen.SelectedValue <> "-1" Then - Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToEntero - 'RMF condición temporal - If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then - ValidaLoteCaducidad = True - Else - ValidaLoteCaducidad = False + Dim drr As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimero("") + If drr IsNot Nothing Then + '("CveSubProyecto").ToEntero + Dim CveSubProyecto As Integer = drr("CveSubProyecto").ToString.ToEntero + 'RMF condición temporal + If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then + ValidaLoteCaducidad = True + Else + ValidaLoteCaducidad = False + End If + + CveTipoAlmacen = drr("CveTipoAlmacen").ToString.ToEntero + End If + CargaGVInv() 'For Each Gvr As GridViewRow In GvInv.Rows ' If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then @@ -1421,6 +1437,16 @@ Partial Class Inventarios_RecepcionAlmacen e.Row.FCCheckBox("cbInv").Enabled = False Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DataKey("Consec"))).Rows.Count e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString + + '' Empresa Acumuladores + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + If CveTipoAlmacen = 21 Then + e.Row.FCButton("BtnSerie").Visible = False + e.Row.FCTextBox("TbCantidadF").Enabled = True + e.Row.FCCheckBox("cbInv").Enabled = True + End If + End If + 'ElseIf e.Row.DBCampo("CveMetodoInventario").ToString = "6" Then ' e.Row.FCButton("BtnLote").Visible = True ' e.Row.FCButton("BtnLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec")) From 5135e41bffeab22f64c3ff59eb30a748d40592c4 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 3 May 2022 06:19:43 -0700 Subject: [PATCH 09/19] -- estatus en camiones --- Inventarios/TraspasoAlmacen.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index cf368ca73..1ad42b785 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -3023,12 +3023,12 @@ Partial Class Inventarios_TraspasoAlmacen Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then DdlUnidadCamion.DataSource = ObjInv.DtResultados End If - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then DdlRemolque1.DataSource = ObjInv.DtResultados End If From 432011922fbd0388e77162891060ad1a0f1c9927 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 3 May 2022 12:54:52 -0700 Subject: [PATCH 10/19] -- descarga de excel --- Acumuladores/RepEntradasUsadosClientes.aspx | 4 ++++ .../RepEntradasUsadosClientes.aspx.vb | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx b/Acumuladores/RepEntradasUsadosClientes.aspx index 5bb9a18ac..8756cdd42 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx +++ b/Acumuladores/RepEntradasUsadosClientes.aspx @@ -18,9 +18,13 @@
  • +
  • + +
  • + diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb index ed0a413f1..6efd21697 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx.vb +++ b/Acumuladores/RepEntradasUsadosClientes.aspx.vb @@ -110,8 +110,31 @@ Partial Class Acumuladores_RepEntradasUsadosClientes ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepEntradasUsadosClientes.rdlc", UsuarioActual.CveEmpresa), DatosEntradasUsadosClientes, params, "Entradas usados clientes", "PDF") + End Sub + + Protected Sub BtnExcel_Click(sender As Object, e As EventArgs) + + + Dim Dia As String = {"lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"}(If((Weekday(Today) - 2) = -1, 7, Weekday(Today) - 2)) + Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1) + + Dim FechaConFormato As String = String.Format("{0}, {1} de {2} de {3}", Dia, Day(Today), Mes, Year(Today)) + + Dim params As New List(Of ReportParameter) + + params.Add(New ReportParameter("Direccion", "Tamaulipas Esq. con Guadalupe Victoria")) + params.Add(New ReportParameter("FechaConFormato", FechaConFormato)) + params.Add(New ReportParameter("FechaInicial", TxtFechaI.Text)) + params.Add(New ReportParameter("FechaFinal", TxtFechaF.Text)) + + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DatosEntradasUsadosClientes} + + ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepEntradasUsadosClientes.rdlc", UsuarioActual.CveEmpresa), DatosEntradasUsadosClientes, params, "Entradas usados clientes", "Excel") + End Sub + + Public Sub CargarVentasGrupo(sender As Object, e As EventArgs) Dim tempLink As LinkButton = CType(sender, LinkButton) Dim renglon As GridViewRow = CType(tempLink.NamingContainer, GridViewRow) From 821dc0df6c36a775150230c9af13c790de7e8a37 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 4 May 2022 08:36:51 -0700 Subject: [PATCH 11/19] Carta Porte CatUnidades Esatatus --- App_Code/ClsCompras.vb | 2 ++ App_Code/ClsContabilidad.vb | 16 ++++++++-------- App_Code/ClsInventarios.vb | 6 ++++-- Compras/Compras.aspx.vb | 4 ++-- Inventarios/CartaPorteManual.aspx | 4 ++-- Inventarios/CartaPorteManual.aspx.vb | 6 +++--- Inventarios/CatUnidades.aspx | 16 +++++++++++++--- Inventarios/CatUnidades.aspx.vb | 9 +++++---- Inventarios/RepEntregaAlmacenRuta.aspx.cs | 8 ++++---- Inventarios/TraspasoAlmacen.aspx.vb | 6 +++--- Ventas/Ventas.aspx.vb | 6 +++--- 11 files changed, 49 insertions(+), 34 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 95802d410..35d8638ea 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -1980,6 +1980,7 @@ Public Class ClsCompras End With Try + SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception @@ -2023,6 +2024,7 @@ Public Class ClsCompras End With Try + SqlAdapter.SelectCommand.CommandTimeout = 0 SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index c6e6a1d11..069c2aaa3 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -996,14 +996,14 @@ Public Class ClsContabilidad ' Strr = Strr + " - Clasificación: " + DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("", "") 'End If OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", dr("ConceptoContable").ToString), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") Then - Dim Concepto2 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable)) - OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ElseIf ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then - Dim Concepto3 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable)) - OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al Guardar", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") Then + Dim Concepto2 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable)) + OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ElseIf ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then + Dim Concepto3 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable)) + OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al Guardar", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End If ' Catch ex As Exception If ex.Message.Contains("50015;") Then diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 00613e593..8b89df8a6 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -5567,7 +5567,7 @@ Public Class ClsInventarios Public Function AddCamiones(Placa As String, Especificacion As String, CveEmpresa As Integer, CveConfigAutoTransporte As Integer, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String, NumPolizaSeguro As String, CveUsuario As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String, NumPolizaSeguroCarga As String, Optional CveTipoCamion As Integer = 1, Optional LongitudCaja As String = "", Optional LineaTransportacion As String = "", Optional SCAC As String = "", Optional CAAT As String = "", - Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "") As Boolean + Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "", Optional Estatus As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_CamionesAdd") @@ -5593,6 +5593,7 @@ Public Class ClsInventarios .Add("@SCAC", SqlDbType.VarChar).Value = SCAC .Add("@CAAT", SqlDbType.VarChar).Value = CAAT .Add("@NumeroTrailer", SqlDbType.VarChar).Value = NumeroTrailer + .Add("@Estatus", SqlDbType.Bit).Value = Estatus End With Try SqlAdapter.Fill(Data) @@ -5620,7 +5621,7 @@ Public Class ClsInventarios Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String, CveConfigAutoTransporte As Integer, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String, NumPolizaSeguro As String, CveUsuario As Integer, CveEmpresa As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String, NumPolizaSeguroCarga As String, Optional CveTipoCamion As Integer = -1, Optional LongitudCaja As String = "", Optional LineaTransportacion As String = "", Optional SCAC As String = "", Optional CAAT As String = "", - Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "") As Boolean + Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "", Optional Estatus As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_CamionesUpdate") With SqlAdapter.SelectCommand.Parameters @@ -5646,6 +5647,7 @@ Public Class ClsInventarios .Add("@SCAC", SqlDbType.VarChar).Value = SCAC .Add("@CAAT", SqlDbType.VarChar).Value = CAAT .Add("@NumeroTrailer", SqlDbType.VarChar).Value = NumeroTrailer + .Add("@Estatus", SqlDbType.Bit).Value = Estatus End With Try SqlAdapter.Fill(Data) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index eb7aa91c3..9d3db4aa4 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -17538,8 +17538,8 @@ Partial Class Compras_Compras 'RETENCIONES Dim Retenciones = 0D - Retenciones = TxtRetIVA.Text.ToDecimal - Retenciones += TxtRetISR.Text.ToDecimal + Retenciones = RetIVA.ToDecimal + Retenciones += RetISR.ToDecimal SubTotal2 = SubTotal - Descuentos ' - Amortizacion '[IPP] COMENTADO CASO JAM 12653 CON NC 27122 | 23/MAYO/2018 diff --git a/Inventarios/CartaPorteManual.aspx b/Inventarios/CartaPorteManual.aspx index fc0b9f4de..e290b9bca 100644 --- a/Inventarios/CartaPorteManual.aspx +++ b/Inventarios/CartaPorteManual.aspx @@ -221,7 +221,7 @@
    - +
    @@ -232,7 +232,7 @@
    - +
    diff --git a/Inventarios/CartaPorteManual.aspx.vb b/Inventarios/CartaPorteManual.aspx.vb index 8c47ee8c4..9bca2d2ec 100644 --- a/Inventarios/CartaPorteManual.aspx.vb +++ b/Inventarios/CartaPorteManual.aspx.vb @@ -958,12 +958,12 @@ Partial Class Inventarios_CartaPorteManual Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, Estatus:=1) Then DdlUnidadCamion.DataSource = ObjInv.DtResultados End If - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then DdlRemolque1.DataSource = ObjInv.DtResultados End If @@ -1508,7 +1508,7 @@ Partial Class Inventarios_CartaPorteManual DvRemolque2.Visible = True Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}") End If End Using diff --git a/Inventarios/CatUnidades.aspx b/Inventarios/CatUnidades.aspx index fe91310cf..73f3e234f 100644 --- a/Inventarios/CatUnidades.aspx +++ b/Inventarios/CatUnidades.aspx @@ -31,7 +31,8 @@ - @@ -41,7 +42,7 @@ - + @@ -249,7 +250,8 @@
    -
    + +
    @@ -258,6 +260,14 @@
    +
    +
    + + +
    +
    + +
    <%----%> diff --git a/Inventarios/CatUnidades.aspx.vb b/Inventarios/CatUnidades.aspx.vb index 8478b71dd..38720e266 100644 --- a/Inventarios/CatUnidades.aspx.vb +++ b/Inventarios/CatUnidades.aspx.vb @@ -37,10 +37,9 @@ Partial Class Inventarios_CatUnidades Public Sub CargaDatos() - Dim ObjInventarios As New ClsInventarios - If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then + If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa, Estatus:=-1) Then GvDatos.DataSource = ObjInventarios.DtResultados Else GvDatos.DataSource = Nothing @@ -110,6 +109,7 @@ Partial Class Inventarios_CatUnidades TxtNumeroTrailer.Text = "" TxtSCAC.Text = "" TxtCAAT.Text = "" + ChkEstatus.Checked = False RdTipoUnidad.SelectedValue = "1" LtlTituloModal.Text = "Agregar Unidad" @@ -153,6 +153,7 @@ Partial Class Inventarios_CatUnidades TxtLineaTransportacion.Text = GvRow.DataKey("LineaTransportacion") TxtSCAC.Text = GvRow.DataKey("SCAC") TxtCAAT.Text = GvRow.DataKey("CAAT") + ChkEstatus.Checked = If(Boolean.Parse(GvRow.DataKey("Estatus")), True, False) 'ChkesRemolque.Checked = (GvRow.DataKey("CveTipoCamion") = "2") @@ -206,14 +207,14 @@ Partial Class Inventarios_CatUnidades If CveCamion <= 0 Then If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue.ToEntero, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero(), TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, - TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text) Then + TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text, ChkEstatus.Checked) Then Alert("Unidad agregada correctamente") Else ErrorPrceso = True End If Else If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue.ToEntero, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero(), TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text) Then + TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text, ChkEstatus.Checked) Then Alert("Unidad actualizada correctamente") Using objbase = New ClsClaseBase() objbase.runQuerystr(String.Format("UPDATE Inv_Camiones SET CveProveedor={1} WHERE CveCamion={0}", CveCamion, DdlProveedor.SelectedValue)) diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs index 6d5380160..6bf95f172 100644 --- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs +++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs @@ -279,7 +279,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas { ClsInventarios ObjInventarios = new ClsInventarios(); - if (ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) && ObjInventarios.DtResultados.Rows.Count > 0) + if (ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa,Estatus:1) && ObjInventarios.DtResultados.Rows.Count > 0) { DdlModalCamion.DataSource = ObjInventarios.DtResultados; } @@ -829,7 +829,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas using (ClsInventarios ObjInv = new ClsInventarios()) { - if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2)) + if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2,Estatus:1)) DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero()}"); } try @@ -868,10 +868,10 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas using (ClsInventarios ObjInv = new ClsInventarios()) { - if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1)) + if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:1)) DdlModalCamion.DataSource = ObjInv.DtResultados; - if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2)) + if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2,Estatus:1)) DdlRemolque1.DataSource = ObjInv.DtResultados; } diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index cf368ca73..284874758 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -3023,12 +3023,12 @@ Partial Class Inventarios_TraspasoAlmacen Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then DdlUnidadCamion.DataSource = ObjInv.DtResultados End If - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then DdlRemolque1.DataSource = ObjInv.DtResultados End If @@ -3334,7 +3334,7 @@ Partial Class Inventarios_TraspasoAlmacen DvRemolque2.Visible = True Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}") End If End Using diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 521472341..715e89848 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -34126,12 +34126,12 @@ Partial Class Ventas Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then DdlUnidadCamion.DataSource = ObjInv.DtResultados End If - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then DdlRemolque1.DataSource = ObjInv.DtResultados End If @@ -34265,7 +34265,7 @@ Partial Class Ventas DvRemolque2.Visible = True Using ObjInv As New ClsInventarios - If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then + If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}") End If End Using From 53275c23880f7eac9846ea41f148ca96434e0136 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 6 May 2022 14:08:19 -0700 Subject: [PATCH 12/19] -- el candado para eliminar un movimiento cancelado. --- Bancos/IE.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 92b0c29b6..1c2ca9a0c 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -4844,7 +4844,7 @@ Partial Class Bancos_IE End Sub Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs) Handles LnkEliminar.Click - If CveIECancelado > 0 Or CveIECancelacion > 0 Then + If CveIECancelado > 0 Then Alert("El Movimiento no se puede eliminar porque tiene una cancelación relacionada, se tiene que eliminar primero la cancelación", TipoMensaje.MsgAdvertencia) Else RegistraScript(String.Format("$('#{0}').modal('show');", "divDescripcion")) From 61e54bb9bcfe396beb0b7d4248e15a6e94364191 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 7 May 2022 13:42:34 -0700 Subject: [PATCH 13/19] -- mejora en el caso de material peligroso, que no valla etiqueta seguro medio ambiente --- App_Code/Timbres.vb | 215 +++++++++++++++++++++++--------------------- 1 file changed, 113 insertions(+), 102 deletions(-) diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index a38dffefe..23070a859 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -122,8 +122,8 @@ Public Class Timbres Dim DtMovimientos As DataTable = Nothing Dim drT As DataRow = ObjGrales.DtResultados.Rows(0) - Timbre.Receptor.RFC = drT("RemitenteRFC").ToString - Timbre.Receptor.Nombre = drT("RemitenteNombre").ToString + Timbre.Receptor.RFC = drT("EmpresaRFC").ToString + Timbre.Receptor.Nombre = drT("EmpresaNombre").ToString Timbre.Receptor.DomicilioFiscalReceptor = drT("DirDesCP").ToString Timbre.Receptor.RegimenFiscalReceptor = drT("CodigoRegimenFiscalReceptor").ToString @@ -166,8 +166,14 @@ Public Class Timbres CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString - CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente = drT("NombreAseguradoraMedioAmbiente").ToString - CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente = drT("NumPolizaSeguroMedioAmbiente").ToString + + If Obj.DtDetalle IsNot Nothing AndAlso Obj.DtDetalle.Rows.Count > 0 Then + If Obj.DtDetalle.MAX("ClaveMaterialPeligroso") <> "" Then + CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente = drT("NombreAseguradoraMedioAmbiente").ToString + CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente = drT("NumPolizaSeguroMedioAmbiente").ToString + End If + End If + CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroCarga = drT("NombreAseguradoraCarga").ToString CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroCarga = drT("NumPolizaSeguroCarga").ToString CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular = drT("ConfigCartaPorte").ToString @@ -204,104 +210,109 @@ Public Class Timbres .Municipio = drT("DirDesClaveSATMunicipio").ToString, .Localidad = drT("DirDesClaveSATLocalidad").ToString} - - Dim Ubica As New CFDICartaPorteUbicacion - Ubica.TipoEstacion = "" - Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString, - .FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", - .NombreRemitenteDestinatario = drT("RemitenteNombre").ToString, - .Domicilio = DomOrigen} - CartaPorte.Ubicaciones.Add(Ubica) - Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = drT("DestinatarioRFC").ToString, - .FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"), - .NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString, - .Domicilio = DomDestino, - .DistanciaRecorrida = Distancia} - - CartaPorte.Ubicaciones.Add(Ubica) - CartaPorte.FiguraTransporte.ClaveTransporte = "01" - - Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = drT("FiguraDomicilio").ToString, - .NumeroExterior = drT("FiguraNumeroExterior").ToString, - .NumeroInterior = drT("FiguraNumeroInterior").ToString, - .Colonia = drT("FiguraClaveSATColonia").ToString, - .Municipio = drT("FiguraClaveSATMunicipio").ToString, - .Estado = drT("FiguraClaveSATEstado").ToString, - .CP = drT("FiguraCP").ToString} - - - - CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With { - .RFCFigura = drT("FiguraRFC").ToString, - .NombreFigura = drT("FiguraChofer").ToString, - .NumLicencia = drT("FiguraLicencia").ToString, - .NumRegidTribFigura = drT("FiguraNumRegidTribFigura").ToString, - .ResidenciaFiscalFigura = drT("FiguraResidenciaFiscalFigura").ToString, - .Domicilio = DomicilioOperador}) - - - 'concepto único - Dim concepto As New CFDIConceptos With {.Cantidad = 1, - .Descripcion = "Traslado", - .ValorUnitario = 0, - .Importe = 0, - .Descuento = 0, - .Unidad = "Servicio", - .ClaveUnidad = "E48", - .ClaveProdServ = "78101802", - .Noidentificacion = "", - .CuentaPredial = ""} - - Timbre.Conceptos.Add(concepto) - - For Each drr As DataRow In Obj.DtDetalle.Rows - - If drr("PS").ToString.Length = 1 Then - tPS = drr("Obs").ToString - Else - If drr("PS").ToString.Length = 0 Then - tPS = "" - Else - tPS = String.Format("{0} {1}", drr("PS"), drr("Obs")) - End If - End If - Dim conceptoCarta As New CFDICartaPorteMercancia With { - .BienesTransp = drr("SATClaveProdServ").ToString, - .ClaveSTCC = "", 'para metodo ferroviario - .Cantidad = drr("Cantidad").ToString.ToDecimal, - .Descripción = tPS, - .ClaveUnidad = drr("SATClaveUM").ToString, - .Unidad = drr("UM").ToString, - .Dimensiones = drr("Dimensiones").ToString, - .PesoenKg = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, - .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""), - .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString, - .Embalaje = drr("ClaveEmbalaje").ToString, - .DescripEmbalaje = drr("Embalaje").ToString, - .ValorMercancia = drr("PU").ToString.ToDecimal, - .Moneda = "MXN", 'temporal - .FraccionArrancelaria = "", - .UUIDComercioExt = "" - } - - Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal} - conceptoCarta.DetalleMercancia = DetalleMercancia - - Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"} - conceptoCarta.MercanciasCantidadTransporta.Add(MercanciaTransporta) - - totSubTotal = totSubTotal - concepto.Importe - CartaPorte.Mercancias.Mercancias.Add(conceptoCarta) - - i += 1 - Next - Timbre.Complementos.CartaPorte = CartaPorte - - Else - '' T R A S L A D O S - - 'DETALLES - If Obj.DtDetalle IsNot Nothing Then + Dim NumRegIdTrib As String = "" + If drT("DestinatarioRFC").ToString.Contiene("XEXX010101000") Then ' cuando es Extranjero, debe de llevar un numregidtrib + NumRegIdTrib = "121585958" + End If + + Dim Ubica As New CFDICartaPorteUbicacion + Ubica.TipoEstacion = "" + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString, + .FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", + .NombreRemitenteDestinatario = drT("RemitenteNombre").ToString, + .Domicilio = DomOrigen} + CartaPorte.Ubicaciones.Add(Ubica) + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = drT("DestinatarioRFC").ToString, + .FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"), + .NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString, + .Domicilio = DomDestino, + .DistanciaRecorrida = Distancia, + .NumRegIdTrib = NumRegIdTrib} + + CartaPorte.Ubicaciones.Add(Ubica) + CartaPorte.FiguraTransporte.ClaveTransporte = "01" + + Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = drT("FiguraDomicilio").ToString, + .NumeroExterior = drT("FiguraNumeroExterior").ToString, + .NumeroInterior = drT("FiguraNumeroInterior").ToString, + .Colonia = drT("FiguraClaveSATColonia").ToString, + .Municipio = drT("FiguraClaveSATMunicipio").ToString, + .Estado = drT("FiguraClaveSATEstado").ToString, + .CP = drT("FiguraCP").ToString} + + + + CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With { + .RFCFigura = drT("FiguraRFC").ToString, + .NombreFigura = drT("FiguraChofer").ToString, + .NumLicencia = drT("FiguraLicencia").ToString, + .NumRegidTribFigura = drT("FiguraNumRegidTribFigura").ToString, + .ResidenciaFiscalFigura = drT("FiguraResidenciaFiscalFigura").ToString, + .Domicilio = DomicilioOperador}) + + + 'concepto único + Dim concepto As New CFDIConceptos With {.Cantidad = 1, + .Descripcion = "Traslado", + .ValorUnitario = 0, + .Importe = 0, + .Descuento = 0, + .Unidad = "Servicio", + .ClaveUnidad = "E48", + .ClaveProdServ = "78101802", + .Noidentificacion = "", + .CuentaPredial = ""} + + Timbre.Conceptos.Add(concepto) + + For Each drr As DataRow In Obj.DtDetalle.Rows + + If drr("PS").ToString.Length = 1 Then + tPS = drr("Obs").ToString + Else + If drr("PS").ToString.Length = 0 Then + tPS = "" + Else + tPS = String.Format("{0} {1}", drr("PS"), drr("Obs")) + End If + End If + Dim conceptoCarta As New CFDICartaPorteMercancia With { + .BienesTransp = drr("SATClaveProdServ").ToString, + .ClaveSTCC = "", 'para metodo ferroviario + .Cantidad = drr("Cantidad").ToString.ToDecimal, + .Descripción = tPS, + .ClaveUnidad = drr("SATClaveUM").ToString, + .Unidad = drr("UM").ToString, + .Dimensiones = drr("Dimensiones").ToString, + .PesoenKg = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, + .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""), + .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString, + .Embalaje = drr("ClaveEmbalaje").ToString, + .DescripEmbalaje = drr("Embalaje").ToString, + .ValorMercancia = drr("PU").ToString.ToDecimal, + .Moneda = "MXN", 'temporal + .FraccionArrancelaria = "", + .UUIDComercioExt = "" + } + + Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal} + conceptoCarta.DetalleMercancia = DetalleMercancia + + Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"} + conceptoCarta.MercanciasCantidadTransporta.Add(MercanciaTransporta) + + totSubTotal = totSubTotal - concepto.Importe + CartaPorte.Mercancias.Mercancias.Add(conceptoCarta) + + i += 1 + Next + Timbre.Complementos.CartaPorte = CartaPorte + + Else + '' T R A S L A D O S + + 'DETALLES + If Obj.DtDetalle IsNot Nothing Then For Each drr As DataRow In Obj.DtDetalle.Rows If drr("PS").ToString.Length = 1 Then From ab0069b16ac960ba1f8d1df4b92eeed0f4d17c48 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 7 May 2022 19:47:03 -0700 Subject: [PATCH 14/19] -- nuevos documentos BDH --- Inicio.aspx | 87 ++++++++++++++++++++++++++++---------------------- Inicio.aspx.vb | 1 - 2 files changed, 49 insertions(+), 39 deletions(-) diff --git a/Inicio.aspx b/Inicio.aspx index b614c7c9a..5a586ad33 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -492,9 +492,7 @@
    - - - +
    @@ -509,21 +507,19 @@
    - - - +
    - AMERICA + AMERICA
    - CRONOS + CRONOS
    @@ -531,12 +527,12 @@
    - DIENER + DIENER
    - FULL POWER + FULL POWER
    @@ -545,12 +541,12 @@
    - LTH AGM + LTH AGM
    - LTH ESPECIALES + LTH ESPECIALES
    @@ -558,12 +554,12 @@
    - LTH HEAVY DUTY + LTH HEAVY DUTY
    - LTH HI-TEC + LTH HI-TEC
    @@ -572,50 +568,66 @@
    - LTH SUV-VAN-MINIVAN + LTH SUV-VAN-MINIVAN
    - LTH TAXI + LTH TAXI
    +
    +
    + LTH +
    +
    +
    +
    + OPTIMA +
    +
    +
    + +
    +
    +
    + FILTROS PISOS + +
    +
    +
    +
    + FILTROS MAYOREO + +
    +
    +
    +
    - LTH + MOTOBATERIAS LTH +
    - OPTIMA + MOTOBATERIAS AMERICA +
    - - -
    - - +
    - Cat APS AGM-HT-LTH-CR 2021 + Cat APS AGM-HT-LTH-CR 2021
    -
    - - - - - - - - - - - +
    + +
    @@ -1399,8 +1411,7 @@
    -
    -
    +
    diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index c81970688..3902d593d 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -231,7 +231,6 @@ Partial Class Inicio 'Evaluacion del proveedor CargaEvaluacionProveedor() - If UsuarioActual.CveEmpresa = 140 Then DVDescargasBDH.Visible = True End If From 57a006032bc47ced5b2a61021a1dead59e72f2b9 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 9 May 2022 09:08:15 -0700 Subject: [PATCH 15/19] -- mejora en cambio de preciosugerido, en la carga por excel --- Ventas/Ventas.aspx.vb | 227 +++++++++++++++++------------------------- 1 file changed, 93 insertions(+), 134 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1c5732c3b..a82e7bd00 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -16800,84 +16800,14 @@ Partial Class Ventas End If 'SUGIERE PRECIO - Dim PrecioSugerido = 0.0 - PrecioSugerido = drPS("Precio").ToString().ToDouble + Dim PrecioSugerido As Decimal = 0 + Dim tPrecioSugerido As Decimal = 0 + tPrecioSugerido = drPS("Precio").ToString().ToDecimal + PrecioSugerido = CalculaPrecioSugerido(CvePSParametro, drPS("CveClasificacion").ToString().ToEntero()) - If UsuarioActual.CveEmpresa.Contiene(1) Then - Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPorcentajeProductos(CveCliente) Then - Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble - If PrecioAplicado > 0 Then - PrecioSugerido = PrecioAplicado - End If - End If - ObjPS.Dispose() - End If - - If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente - Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero - ' si es 10. primero el cliente - Dim CvePrecioListaPS As Integer - Dim PorcentajePrecio As Double = 0 - - If TipoPrecioLista = 10 Then - - CvePrecioListaPS = Me.CvePrecioListaCliente 'GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero() - If CvePrecioListaPS <= 0 Then - - CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero() - - End If - - Else - - CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero() - If CvePrecioListaPS <= 0 Then - - CvePrecioListaPS = Me.CvePrecioListaCliente 'GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero() - - End If - - End If - - If CvePrecioListaPS > 0 Then - Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then - PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble - PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble - End If - ObjPS.Dispose() - End If - - If PrecioSugerido = 0 Then - Dim ObjInventarios As New ClsInventarios - Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) - 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal - If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) - ObjInventarios.Dispose() - If CostoPS > 0 And PorcentajePrecio > 0 Then - PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS - End If - End If - CvePrecioLista = CvePrecioListaPS - End If - - - 'Dim ObjClasificaciones As New ClsClasificaciones - 'If ObjClasificaciones.GetClasificaciones() Then - ' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal - 'End If - - If PrecioSugerido > 0 Then - Dim PrecioBaseCosto As Decimal = 0 - PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString().ToEntero()).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal - - If PrecioBaseCosto > 0 Then - PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1) - End If - TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere - End If + If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido + TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere If IsNumeric(TxtCantidad.Text.Trim) Then LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2) @@ -16912,6 +16842,76 @@ Partial Class Ventas UpPS.Update() End Sub + + Private Function CalculaPrecioSugerido(CvePSParametro As Integer, CveClasificacion As Integer) As Decimal + Dim PrecioSugerido As Decimal = 0 + + If UsuarioActual.CveEmpresa.Contiene(1) Then + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetPorcentajeProductos(CveCliente) Then + Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDecimal + If PrecioAplicado > 0 Then + PrecioSugerido = PrecioAplicado + End If + End If + ObjPS.Dispose() + End If + + If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente + Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero + ' si es 10. primero el cliente + Dim CvePrecioListaPS As Integer + Dim PorcentajePrecio As Decimal = 0 + + If TipoPrecioLista = 10 Then + + CvePrecioListaPS = Me.CvePrecioListaCliente + If CvePrecioListaPS <= 0 Then + CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero() + + End If + Else + CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero() + If CvePrecioListaPS <= 0 Then + CvePrecioListaPS = Me.CvePrecioListaCliente 'GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero() + + End If + + End If + + If CvePrecioListaPS > 0 Then + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then + PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal + PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal + End If + ObjPS.Dispose() + End If + + If PrecioSugerido = 0 Then + Dim ObjInventarios As New ClsInventarios + Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) + 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal + If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) + ObjInventarios.Dispose() + If CostoPS > 0 And PorcentajePrecio > 0 Then + PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS + End If + End If + CvePrecioLista = CvePrecioListaPS + End If + + + If PrecioSugerido > 0 Then + Dim PrecioBaseCosto As Decimal = 0 + PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal + + If PrecioBaseCosto > 0 Then + PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1) + End If + End If + Return PrecioSugerido + End Function Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange DdlPSIndexChange(DdlPS.SelectedValue.ToEntero(), DdlPS) End Sub @@ -18127,15 +18127,6 @@ Partial Class Ventas Row("Orden") = ConsecutivoActual + 1 End If - Row("Cantidad") = Cantidad - Row("CveUM") = CveUM - Row("UM") = UM - Row("CveClasificacion") = CveClasificacion - Row("Clasificacion") = Clasificacion - Row("CvePS") = CvePS - Row("Obs") = Obs - - Dim DrPS As DataRow = Nothing DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1 @@ -18179,6 +18170,14 @@ Partial Class Ventas End If End If + Row("Cantidad") = Cantidad + Row("CveUM") = CveUM + Row("UM") = DrPS("UnidadMedida") + Row("CveClasificacion") = DrPS("CveClasificacion") + Row("Clasificacion") = DrPS("Clasificacion") + Row("CvePS") = CvePS + Row("Obs") = Obs + 'VERIFICA SI EN LA FACTURA PADRE SE DESGLOSO EL IEPS Dim FacturaDesglosoIEPS As Boolean = ((CveDevolucion > 0 AndAlso NuevaFactura = 1) AndAlso (Me.ObjFacturaNC IsNot Nothing AndAlso Not Me.ObjFacturaNC.VentaDesglosaIEPS)) @@ -24284,6 +24283,7 @@ Partial Class Ventas Dim Observaciones As String = Row("Observaciones").ToString().Trim.ToUpper Dim TiempoEntrega As String = Row("Tiempo Entrega").ToString() Dim CvePS As Integer = 0 + Dim CveClasificacion As Integer = 0 Dim CveUM As Integer = 0 Dim CodigoPS As Integer = 0 Dim DrProyecto As DataRow @@ -24311,7 +24311,7 @@ Partial Class Ventas If ObjPS.CvePS > 0 Then CvePS = ObjPS.CvePS CveUM = ObjPS.CveUnidadMedida - + CveClasificacion = ObjPS.CveClasificacion Else RowNoEncontrados = String.Format("{3}    - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados) End If @@ -24320,14 +24320,6 @@ Partial Class Ventas End If End Using - 'Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c) - 'If StrArray.Length > 0 Then - ' If CBool(StrArray(0)) = True Then - ' CvePS = StrArray(1).ToEntero() - ' Else - ' RowNoEncontrados &= StrArray(1) & "<\BR>" - ' End If - 'End If ElseIf CodigoBarras <> "" Then Using ObjPS As New ClsProductosServicios @@ -24335,7 +24327,7 @@ Partial Class Ventas If ObjPS.CvePS > 0 Then CvePS = ObjPS.CvePS CveUM = ObjPS.CveUnidadMedida - + CveClasificacion = ObjPS.CveClasificacion Else RowNoEncontrados = String.Format("{3}    - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados) End If @@ -24343,14 +24335,7 @@ Partial Class Ventas RowNoEncontrados = String.Format("{3}    - No se encontró {0} en la fila {1}, columna {2}<\BR>(NoBD)", Codigo, NumRow, "Codigo", RowNoEncontrados) End If End Using - 'Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c) - 'If StrArray.Length > 0 Then - ' If CBool(StrArray(0)) = True Then - ' CvePS = StrArray(1).ToEntero() - ' Else - ' RowNoEncontrados &= StrArray(1) & "<\BR>" - ' End If - 'End If + ElseIf ProductoServicio <> "" Then Using ObjPS As New ClsProductosServicios @@ -24358,6 +24343,7 @@ Partial Class Ventas If ObjPS.CvePS > 0 Then CvePS = ObjPS.CvePS CveUM = ObjPS.CveUnidadMedida + CveClasificacion = ObjPS.CveClasificacion Else RowNoEncontrados = String.Format("{3}    - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados) End If @@ -24365,50 +24351,23 @@ Partial Class Ventas RowNoEncontrados = String.Format("{3}    - No se encontró {0} en la fila {1}, columna {2}<\BR>(NoBD)", Codigo, NumRow, "Codigo", RowNoEncontrados) End If End Using - 'Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c) - 'If StrArray.Length > 0 Then - ' If CBool(StrArray(0)) = True Then - ' CvePS = StrArray(1).ToEntero() - ' Else - ' RowNoEncontrados &= StrArray(1) & "<\BR>" - ' End If - 'End If Else RowNoEncontrados &= "<\BR>    - En la fila " & NumRow & " no se especificó código, código de barras ó descripción." End If If CvePS > 0 Then - 'CveUM = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"CvePS = '{CvePS}'").ToString().ToEntero() + + If PrecioUnitario <= 0 Then + PrecioUnitario = CalculaPrecioSugerido(CvePS, CveClasificacion) + End If AgregarProductoServicio(Cantidad, CveUM, UM, -1, "", CvePS, HdnPS.Value, Observaciones, PrecioUnitario, HdnDescuento.Value.ToDecimal, CveProyecto, Proyecto, CveSubProyecto, SubProyecto, TiempoEntrega:=TiempoEntrega) - - - 'If TmpDT IsNot Nothing Then - ' Dim dr As DataRow = TmpDT.NewRow - ' TxtCantidad.Text = Cantidad.ToString() - ' DdlPS.SelectedValue = CvePS.ToString() - ' DdlPS_SelectedIndexChanged(Nothing, Nothing) - ' DdlUnidadMedida.SelectedValueExist(CveUM.ToString()) - ' TxtObsPS.Text = Observaciones - ' DdlProyecto.SelectedValue = CveProyecto.ToString() - ' DdlProyecto_SelectedIndexChanged(Nothing, Nothing) - ' DdlSubProyecto.SelectedValue = CveSubProyecto.ToString() - ' TxtPrecio.Text = PrecioUnitario.ToString() - ' TxtTiempoEntrega.Text = TiempoEntrega.ToString() - ' RegistraScript("Recalcula();") - ' LbAgregar_Click(Nothing, Nothing) - ' NumAgregados = NumAgregados + 1 - 'End If End If - - Next - - CalculaTotalesVenta() If RowNoEncontrados.Length > 0 Then From 686f356ceaae1518ab6f9da878319e45659df58a Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 9 May 2022 09:29:53 -0700 Subject: [PATCH 16/19] Timbrado se quita SA de CV en nombre de empresa de prueabs, ClsPaginas validacion carpeta CBB --- App_Code/ClsPaginas.vb | 15 +++++++++++++++ App_Code/Timbrado.vb | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c6d4a2ed1..ffa920110 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6956,7 +6956,22 @@ Public Class ClsPaginas RFCReceptor = Vta.RFCReceptor End If + + Dim RutaCarpetaCBB As String = String.Format("{0}CBB\", Ruta) + Dim FinfoCarpetaCBB As New IO.DirectoryInfo(RutaCarpetaCBB) + + If Not FinfoCarpetaCBB.Exists Then + Try + IO.Directory.CreateDirectory(RutaCarpetaCBB) + Catch ex As Exception + GuardaLogAD($"CveEmpresa {UsuarioActual.CveEmpresa} Vta {Vta.SerieFolio} Error al crear directorio CBB {ex.Message}") + + End Try + End If + + Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio) + Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) Dim ImgCBB As String '= String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 7fc90d47b..98a1e5553 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -5548,7 +5548,7 @@ Public Class Timbrado If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then EmisorRFC = "EKU9003173C9" - UsuarioActual.Empresa.Empresa = "ESCUELA KEMPER URGATE SA DE CV" + UsuarioActual.Empresa.Empresa = "ESCUELA KEMPER URGATE" ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\EKU9003173C9.key" ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\EKU9003173C9.cer" From d45afc913196f3f14c1a15765bc53b28753f23b5 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 9 May 2022 09:38:05 -0700 Subject: [PATCH 17/19] =?UTF-8?q?--agregar=20prep=C3=B3liza?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/TraspasoAlmacen.aspx.vb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 1ad42b785..9113b0ca7 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -2255,6 +2255,27 @@ Partial Class Inventarios_TraspasoAlmacen Exit For End If Next + + If Not ErrorMovInv Then + Dim Concepto As String = TxtObservaciones.Text + If Concepto = "" Then Concepto = "Traspaso" + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TA22", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtualEntrada, UsuarioActual.CveEmpresa) Then + + Dim resultado As DataTable = ObjInventario.DtResultados + Dim importe As Decimal = resultado.SUMD("Total").RoundAD + Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, ImporteMX:=importe, Contabilizable:=False) Then + ErrorMovInv = True + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, ImporteMX:=importe, Contabilizable:=False) Then + ErrorMovInv = True + End If + End If + End If + End If Else From e2900eae42bf59c348c15ab63416c02994fe4700 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 9 May 2022 09:38:18 -0700 Subject: [PATCH 18/19] --cambios en TC al registrar --- Contabilidad/RegPrePolizaS.aspx | 178 +++------- Contabilidad/RegPrePolizaS.aspx.vb | 531 ++++++++++------------------- 2 files changed, 217 insertions(+), 492 deletions(-) diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index b3c7a652c..b3bfd9b46 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -86,7 +86,7 @@
  • - Agregar Concepto + Agregar Concepto
  • Crear a partir de @@ -178,14 +178,7 @@ - - - - - - - - + @@ -226,9 +219,7 @@ - - - + @@ -249,101 +240,22 @@ - - - - + - - - - - - - - - - - - -
    - <%--
    -
    - -
    -
    - - - - -
    - - - - - - - -
    - - - -
    - -
    - - -
    - -
    - -
    - - - - - -
    -
    -
    --%> - - <%--
    - - -
    - -
    - -
    - - -
    - - -
    - -
    - - -
    - -
    - - - - -
    -
    -
    --%> - - - - - + + + + + + +
    +
    + +
    -
    +
    @@ -402,22 +314,8 @@ - - - - - - - - - - -
    - - - - - + + @@ -434,7 +332,7 @@
    Cuenta
    -
    +
    @@ -546,6 +444,7 @@
    +
    @@ -557,7 +456,7 @@
    - Movimientos + Movimientos2
    @@ -576,7 +475,7 @@
    + DataKeyNames="CvePrePolizaDetalle,IdMov, CveConceptoContable, IdCtaContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra, CveProveedor, CveCliente, CvePersonal, CveCuenta, PorcentajeImpuesto,TipoMovto,EsComplementaria,Concepto,CveClasificacion,ContadoCuenta,ContadoTipoTransaccion,ContadoNumeroFolio,ContadoBeneficiario,ContadoObservaciones,ContadoImporte,TC,EsComplementaria" Width="100%" > Movimiento @@ -888,8 +787,7 @@
    Cliente:
    - - +
    @@ -920,7 +818,7 @@
    -
    Procentaje IVA:
    +
    Porcentaje IVA:
    @@ -934,6 +832,16 @@
    +
    +
    + TC: +
    +
    +
    + + +
    +

    @@ -990,6 +898,15 @@

    +
    +
    +
    + Mon Extrajera: +
    +
    +
    + +
    @@ -1010,16 +927,7 @@
    -
    -
    - Tipo de Cambio: -
    -
    -
    - - -
    -
    +
    diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 299004330..79dcf305f 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -276,7 +276,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If ValidaCrearAPartirDe() DvPlantilla.Visible = False - UPPDocumento.Visible = False + If UsuarioActual.Empresa.TipoContabilidad = 1 Then @@ -318,9 +318,9 @@ Partial Class ContabilidadC_RegPrePolizaS TxtConcepto.Enabled = True TxtUsuarioElaboro.Text = UsuarioActual.Usuario DvPlantilla.Visible = True - LnkAddConcepto.Visible = False + 'LnkAddConcepto.Visible = False - UpPrePoliza.Visible = False + 'UpPrePoliza.Visible = False End If @@ -366,7 +366,9 @@ Partial Class ContabilidadC_RegPrePolizaS .Add("Concepto", Type.GetType("System.String")) .Add("Cargo", Type.GetType("System.Double")) .Add("Abono", Type.GetType("System.Double")) - .Add("TipoMovto", Type.GetType("System.Int32")) + .Add("TipoMovto", Type.GetType("System.Boolean")) + .Add("ImporteMN", Type.GetType("System.Decimal")) + .Add("ImporteME", Type.GetType("System.Decimal")) .Add("EsComodin", Type.GetType("System.Int32")) .Add("CveConcepto", Type.GetType("System.Int32")) .Add("CveSubProyecto", Type.GetType("System.Int32")) @@ -384,6 +386,10 @@ Partial Class ContabilidadC_RegPrePolizaS .Add("IdCtaContable", Type.GetType("System.Int32")) .Add("ConceptoContable", Type.GetType("System.String")) .Add("CveCuenta", Type.GetType("System.Int32")) + .Add("CodigoNombreCuenta", Type.GetType("System.String")) + .Add("SubProyecto", Type.GetType("System.String")) + .Add("FolioFactura", Type.GetType("System.String")) + .Add("TipoGasto", Type.GetType("System.String")) .Add("ContadoTipoTransaccion", Type.GetType("System.Int32")) .Add("ContadoCuenta", Type.GetType("System.Int32")) @@ -396,6 +402,7 @@ Partial Class ContabilidadC_RegPrePolizaS .Add("EsComplementaria", Type.GetType("System.Boolean")) .Add("TC", Type.GetType("System.Decimal")) + End With @@ -547,9 +554,6 @@ Partial Class ContabilidadC_RegPrePolizaS DtMovimientos.Columns.Add("Abono", GetType(Decimal)) End If - - - GvPrePoliza.DataBind() If UsuarioActual.CveRol = 1 AndAlso DtMovimientos.COUNT("TC", "TC > 1") > 0 Then @@ -584,9 +588,7 @@ Partial Class ContabilidadC_RegPrePolizaS 'divDatosPrincipales.Visible = False 'divObservaciones.Visible = False - UPMovs.Visible = False - UPMovs.Update() - UPPDocumento.Update() + UpPrePoliza.Update() RegistraScript("comparar();") @@ -847,12 +849,25 @@ Partial Class ContabilidadC_RegPrePolizaS If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada DivAgregarConceptos.Visible = True + LnkAddConcepto.Visible = True + If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then + 'DivAgregarConceptos.Visible = True + LnkAddConcepto.Visible = True + CargaConceptos() + CargaSubProyectos() + CargaCuentasContables() + End If + GvPrePoliza.Visible = True + DivAgregarConceptos.Visible = False + divMovtos.Visible = False + UPMovs.Update() + Else DivAgregarConceptos.Visible = False + divMovtos.Visible = True + UPMovs.Update() End If - - Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") @@ -919,7 +934,7 @@ Partial Class ContabilidadC_RegPrePolizaS e.Row.Height = Unit.Pixel(1) e.Row.Cells(0).ToolTip = e.Row.DBCampo("CveCuenta") - If e.Row.DBCampo("TipoMovto") = "1" Then + If e.Row.DBCampo("TipoMovto") = "True" Then e.Row.FCTextBox("TxtAbono").Visible = True Else e.Row.FCTextBox("TxtCargo").Visible = True @@ -957,8 +972,8 @@ Partial Class ContabilidadC_RegPrePolizaS End If If e.Row.DBCampo("EsComplementaria") = "True" Then - If e.Row.DBCampo("TipoMovto") = "0" Then e.Row.FindControl("divCargoME").Visible = True - If e.Row.DBCampo("TipoMovto") = "1" Then e.Row.FindControl("divAbonoME").Visible = True + If e.Row.DBCampo("TipoMovto") = "False" Then e.Row.FindControl("divCargoME").Visible = True + If e.Row.DBCampo("TipoMovto") = "True" Then e.Row.FindControl("divAbonoME").Visible = True End If @@ -1000,7 +1015,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim CvePrePolizaInsertada As Integer = -1 If CvePrePolizaOrigen > 0 Then - CrarPrePolizaApartirDe() + CrearPrePolizaApartirDe() Exit Sub End If @@ -1039,9 +1054,6 @@ Partial Class ContabilidadC_RegPrePolizaS End If - - - 'terminan validaciones If CvePrePoliza > 0 Then @@ -1102,7 +1114,7 @@ Partial Class ContabilidadC_RegPrePolizaS ImporteME = 0 TipoCambio = 1 - If gvr.DataKey("TipoMovto").ToDouble > 0 Then + If gvr.DataKey("TipoMovto") = "True" Then Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble TmpAbono = TmpAbono + Importe TipoMovto = True @@ -1173,9 +1185,6 @@ Partial Class ContabilidadC_RegPrePolizaS End If End If - - - Else MsgError = "No se pudo insertar la póliza" End If @@ -1204,8 +1213,6 @@ Partial Class ContabilidadC_RegPrePolizaS ObjIE.Commit() If Conta IsNot Nothing Then Conta.Commit() - UPPDocumento.Update() - TxtConcepto.Text = "" 'GvMov.DataBind() DdlPlantilla_SelectedIndexChanged(Nothing, Nothing) @@ -1331,7 +1338,7 @@ Partial Class ContabilidadC_RegPrePolizaS DdlConceptosContablesE.SelectedValueExist(CveConceptoContable) DdlConceptosContablesE_SelectedIndexChanged(DdlConceptosContablesE, e) - TxtModalConceptoTipoCambio.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("TC").ToString.ToDouble.ToString("###,###,###.00") + TxtTipoCambio.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("TC").ToString.ToDouble.ToString("###,###,###.00") DdlModalConceptoTipoTransaccion.SelectedValueExist(GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoTipoTransaccion")) DdlModalConceptoCuenta.SelectedValueExist(GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoCuenta")) TxtModalConceptoDocumentoFolio.Text = GvPrePoliza.Rows(IndiceGrid).DataKey("ContadoNumeroFolio") @@ -1341,16 +1348,6 @@ Partial Class ContabilidadC_RegPrePolizaS DdlPorcentajeIVAE.SelectedValueExist(PorcentajeImpuesto) - 'GvPrePoliza.Rows(IndiceGrid).DataKey("") - - 'dr("ContadoTipoTransaccion") = DdlModalConceptoTipoTransaccion.SelectedValue.ToEntero - 'dr("ContadoCuenta") = DdlModalConceptoCuenta.SelectedValue.ToEntero - 'dr("ContadoNumeroFolio") = TxtModalConceptoDocumentoFolio.Text - 'dr("ContadoBeneficiario") = TxtModalConceptoDocumentoBeneficiario.Text - 'dr("ContadoObservaciones") = TxtModalConceptoDocumentoObservaciones.Text - 'dr("ContadoImporte") = TxtModalConceptoDocumentoImporte.Text.ToDecimal - - DdlProveedoresE.SelectedValueExist(CveProveedor) DdlProveedoresE_SelectedIndexChanged(DdlProveedoresE, e) DdlComprasE.SelectedValueExist(CveCompra) @@ -1358,12 +1355,16 @@ Partial Class ContabilidadC_RegPrePolizaS DdlPersonalE.SelectedValueExist(CvePersonal) If CveCliente > 0 Then + DvModalconceptoCliente.Visible = True DdlClientesE.SelectedValue = CveCliente - DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}") + DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", "") DdlClientesE_SelectedIndexChanged(DdlClientesE, e) End If - DdlVentasE.SelectedValueExist(CveVenta) + If CveVenta > 0 Then + DdlVentasE.SelectedValueExist(CveVenta) + End If + If CveClasificacion > 0 Then DdlClasificacionesE.SelectedValue = CveClasificacion @@ -1391,10 +1392,6 @@ Partial Class ContabilidadC_RegPrePolizaS Else CargaModalConceptoTipoTransaccion("Egs") End If - - - - UpModalConcepto.Update() End Sub @@ -1457,6 +1454,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim AplicaSubProyecto As Boolean = False Dim AplicaTC As Boolean = False 'ok Dim AplicaVenta As Boolean = False + Dim AplicaComplementaria As Boolean = False 'ok AplicaActivoFijo = Boolean.Parse(DT_Concepto.Rows(0)("AplicaActivoFijo").ToString) AplicaAlmacen = Boolean.Parse(DT_Concepto.Rows(0)("AplicaAlmacen").ToString) @@ -1473,7 +1471,7 @@ Partial Class ContabilidadC_RegPrePolizaS AplicaSubProyecto = Boolean.Parse(DT_Concepto.Rows(0)("AplicaSubProyecto").ToString) AplicaTC = Boolean.Parse(DT_Concepto.Rows(0)("AplicaTC").ToString) AplicaVenta = Boolean.Parse(DT_Concepto.Rows(0)("AplicaVenta").ToString) - + AplicaComplementaria = Boolean.Parse(DT_Concepto.Rows(0)("EsComplementaria").ToString) If AplicaImpuesto Then @@ -1514,26 +1512,19 @@ Partial Class ContabilidadC_RegPrePolizaS 'DdlClasificacionesE.Visible = False End If + If AplicaVenta Then + DvModalconceptoVenta.Visible = True + Else + DvModalconceptoVenta.Visible = False + End If If AplicaCliente Then CargaClientesE() - DvModalconceptoCliente.Visible = True - DvModalconceptoVenta.Visible = True - - - 'DdlClientesE.Visible = True - 'DdlVentasE.Visible = True Else - DvModalconceptoCliente.Visible = False - DvModalconceptoVenta.Visible = False - - 'DdlClientesE.Visible = False - 'DdlVentasE.Visible = False End If - If AplicaBancos Then CargaModalConceptoTipoTransaccion("Egs") 'DvMoldalConceptoAncho.Attributes.Add("style", "width:1000px") @@ -1553,71 +1544,15 @@ Partial Class ContabilidadC_RegPrePolizaS DVmodalConceptoTipoCambio.Visible = False End If + If AplicaComplementaria Then + DivMonedaExtranjera.Visible = True + Else + DivMonedaExtranjera.Visible = False + End If End If - - - - 'Dim dr As DataRow = GlobalDTContaConceptosContables(DdlConceptosContablesE.SelectedValue.ToEntero).FiltroPrimero("") - - 'If dr IsNot Nothing Then - ' DdlPorcentajeIVAE.Visible = dr("AplicaImpuesto") = "True" - - 'End If - - 'If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then - ' CargaProveedoresE() - ' DdlProveedoresE.Visible = True - ' DdlComprasE.Visible = True - 'Else - ' DdlProveedoresE.Visible = False - ' DdlComprasE.Visible = False - 'End If - - 'If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(28, 29) Then - ' CargaPersonalE() - ' DdlPersonalE.Visible = True - 'Else - ' DdlPersonalE.Visible = False - 'End If - - 'If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(51) Then - ' CargaClasificacionesE() - ' DdlClasificacionesE.Visible = True - 'Else - ' DdlClasificacionesE.Visible = False - 'End If - - 'If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then - ' CargaClientesE() - ' DdlClientesE.Visible = True - ' DdlVentasE.Visible = True - 'Else - ' DdlClientesE.Visible = False - ' DdlVentasE.Visible = False - 'End If - - 'If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(30) Then - - ' DvMoldalConceptoAncho.Attributes.Add("style", "width:1000px") - ' DvMoldalConceptoSeccion1.Attributes.Add("class", "col-md-6") - ' DvMoldalConceptoSeccion2.Visible = True - 'Else - - ' DvMoldalConceptoAncho.Attributes.Add("style", "width:450px") - ' DvMoldalConceptoSeccion1.Attributes.Add("class", "col-md-12") - ' DvMoldalConceptoSeccion2.Visible = False - 'End If - - - - - - UpModalConcepto.Update() - - End Sub Private Sub CargaProveedoresE() DdlProveedoresE.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) @@ -1648,12 +1583,18 @@ Partial Class ContabilidadC_RegPrePolizaS DdlClientesE.DataBind() ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) End Sub - Private Sub CargaVentasE(CveCliente As Integer) + Private Sub CargaVentasE(CveCliente As Integer, Optional CveMoneda As Integer = -1) + DvModalconceptoVenta.Visible = True Dim ObjVentas As New ClsVentas DdlVentasE.ClearSelection() If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - DdlVentasE.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") + If CveMoneda = 2 Then + DdlVentasE.DataSource = ObjVentas.DtResultados.FiltraParametros("CveMoneda = 2") + Else + DdlVentasE.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") + End If + DdlVentasE.DataBind() DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) Else @@ -1678,7 +1619,8 @@ Partial Class ContabilidadC_RegPrePolizaS CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero) End Sub Private Sub DdlClientesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientesE.selectedindexchange - CargaVentasE(DdlClientesE.SelectedValue.ToEntero) + + CargaVentasE(DdlClientesE.SelectedValue.ToEntero, IIf(DdlConceptosContablesE.SelectedValue.Contiene("291", "292"), 2, -1)) End Sub @@ -1691,181 +1633,121 @@ Partial Class ContabilidadC_RegPrePolizaS If DtMovimientos Is Nothing Then CreaDT() - If CvePrePoliza > 0 Then - - Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) - Dim dr As DataRow = DtMovimientos.NewRow - dr("IdCtaContable") = IdCtaContable - dr("CveCuenta") = DdlCuentaContableE.SelectedValue - 'dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta - dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text - dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - dr("Concepto") = TxtConceptoE.Text - dr("Referencia") = TxtReferenciaE.Text - dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - dr("Cargo") = TxtCargoE.Text.ToDouble - dr("Abono") = TxtAbonoE.Text.ToDouble - dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) - dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text - dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - If DdlComprasE.Visible = True AndAlso DdlComprasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlComprasE.SelectedItem.ToString() - If DdlVentasE.Visible = True AndAlso DdlVentasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlVentasE.SelectedItem.ToString() - dr("Modificado") = True - - If DdlPorcentajeIVAE.Visible Then - dr("PorcentajeImpuesto") = DdlPorcentajeIVAE.SelectedValue.ToDecimal - End If - - - - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - - If CvePrePoliza > 0 Or CvePrePolizaOrigen Then - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - UpPrePoliza.Update() - End If - - - - TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero - TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero - UpTotalCargo.Update() - UpTotalAbono.Update() - Else - 'Dim dr As DataRow = DtMovimientos.NewRow - 'Dim CodigoCuenta As String = "" - 'Dim NombreCuenta As String = "" - - 'dr("IdCuenta") = DdlCtaContableE.SelectedValue - - 'If DdlCtaContableE.SelectedValue.ToEntero > 0 Then - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContableE.SelectedValue)) - ' If drr IsNot Nothing Then - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() - ' End If - 'End If - - 'dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta - 'dr("Cuenta") = DdlConceptosContablesE.SelectedItem.Text - 'dr("Referencia") = TxtReferenciaE.Text - 'dr("Concepto") = TxtConceptoE.Text - 'dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - 'dr("EsComodin") = 0 - 'dr("CveConcepto") = DdlConceptosContablesE.SelectedValue - 'dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - 'dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - 'dr("Cargo") = TxtCargoE.Text.ToDouble - 'dr("Abono") = TxtAbonoE.Text.ToDouble - ''dr("Descripcion") = TxtDescripcionE.Text - 'dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - 'dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - 'dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - 'dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - 'dr("CveClasificacion") = -1 - 'dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - 'dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero - 'DtMovimientos.Rows.Add(dr) - 'DtMovimientos.AcceptChanges() - - 'GvMov.DataSource = DtMovimientos - 'GvMov.DataBind() - 'UPMovs.Update() - 'Actualizar = False + Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) + Dim dr As DataRow = DtMovimientos.NewRow + dr("IdCtaContable") = IdCtaContable + dr("CveCuenta") = DdlCuentaContableE.SelectedValue + 'dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta + dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text + dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text + dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue + dr("Concepto") = TxtConceptoE.Text + dr("Referencia") = TxtReferenciaE.Text + dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, False, True) + dr("Cargo") = TxtCargoE.Text.ToDouble + dr("Abono") = TxtAbonoE.Text.ToDouble + dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) + dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue + dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text + dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero + dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero + dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero + dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero + If DdlComprasE.Visible = True AndAlso DdlComprasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlComprasE.SelectedItem.ToString() + If DdlVentasE.Visible = True AndAlso DdlVentasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlVentasE.SelectedItem.ToString() + dr("Modificado") = True + If DdlPorcentajeIVAE.Visible Then + dr("PorcentajeImpuesto") = DdlPorcentajeIVAE.SelectedValue.ToDecimal End If + + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() + + If CvePrePoliza > 0 Or CvePrePolizaOrigen Then + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + UpPrePoliza.Visible = True + End If + + TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero + TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero + UpTotalCargo.Update() + UpTotalAbono.Update() + RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") + Else Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero + Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle) - - If Rows.Count > 0 Then - Dim dr As DataRow = Rows(0) - Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) - dr("IdCtaContable") = IdCtaContable - dr("CveCuenta") = DdlCuentaContableE.SelectedValue - dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text - dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - dr("Concepto") = TxtConceptoE.Text - dr("Referencia") = TxtReferenciaE.Text - dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) - dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text - dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) - dr("Modificado") = True - - dr("ContadoCuenta") = DdlModalConceptoCuenta.SelectedValue.ToEntero - dr("ContadoTipoTransaccion") = DdlModalConceptoTipoTransaccion.SelectedValue.ToEntero - dr("ContadoNumeroFolio") = TxtModalConceptoDocumentoFolio.Text - dr("ContadoBeneficiario") = TxtModalConceptoDocumentoBeneficiario.Text - dr("ContadoObservaciones") = TxtModalConceptoDocumentoObservaciones.Text - dr("ContadoImporte") = TxtModalConceptoDocumentoImporte.Text.ToDecimal - - dr("TC") = TxtModalConceptoTipoCambio.Text.ToDecimal - - dr("PorcentajeImpuesto") = DdlPorcentajeIVAE.SelectedValue.ToString.ToDecimal - - - - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnConceptoContable").Value = DdlConceptosContablesE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnProveedor").Value = DdlProveedoresE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCompra").Value = DdlComprasE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnPersonal").Value = DdlPersonalE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCliente").Value = DdlClientesE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnVenta").Value = DdlVentasE.SelectedValue.ToEntero - - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnSubProyecto").Value = DdlSubProyectoE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnTipoGasto").Value = DdlTipoGastoE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCtaContable").Value = DdlCtaContableE.SelectedValue.ToEntero - - If TxtCargoE.Text <> "" Then - dr("Cargo") = TxtCargoE.Text.ToDouble - dr("Abono") = "".ToDouble - Else - dr("Abono") = TxtAbonoE.Text.ToDouble - dr("Cargo") = "".ToDouble - End If - - - DtMovimientos.AcceptChanges() - GvPrePoliza.EditIndex = -1 - - If CvePrePoliza > 0 Or CvePrePolizaOrigen > 0 Then - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - UpPrePoliza.Update() - End If - GvPrePoliza.Columns(11).Visible = True - GvPrePoliza.Rows(IndiceGrid).FCCheckBox("chkModificado").Checked = True - - TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero - TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero - UpTotalCargo.Update() - UpTotalAbono.Update() - + If CvePrePolizaDetalle <= 0 Then + Dim IdMov As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("IdMov").ToEntero + Rows = DtMovimientos.Select("IdMov = " & IdMov) End If - RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") - End If + If Rows.Count > 0 Then + Dim dr As DataRow = Rows(0) + Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) + dr("IdCtaContable") = IdCtaContable + dr("CveCuenta") = DdlCuentaContableE.SelectedValue + dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text + dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text + dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue + dr("Concepto") = TxtConceptoE.Text + dr("Referencia") = TxtReferenciaE.Text + dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, False, True) + dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) + dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue + dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text + dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero + dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero + dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero + dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero + dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) + dr("Modificado") = True + dr("ContadoCuenta") = DdlModalConceptoCuenta.SelectedValue.ToEntero + dr("ContadoTipoTransaccion") = DdlModalConceptoTipoTransaccion.SelectedValue.ToEntero + dr("ContadoNumeroFolio") = TxtModalConceptoDocumentoFolio.Text + dr("ContadoBeneficiario") = TxtModalConceptoDocumentoBeneficiario.Text + dr("ContadoObservaciones") = TxtModalConceptoDocumentoObservaciones.Text + dr("ContadoImporte") = TxtModalConceptoDocumentoImporte.Text.ToDecimal - UpPrePoliza.Update() + dr("TC") = TxtTipoCambio.Text.ToDecimal + + dr("PorcentajeImpuesto") = DdlPorcentajeIVAE.SelectedValue.ToDecimal + + If TxtCargoE.Text <> "" Then + dr("Cargo") = TxtCargoE.Text.ToDouble + dr("Abono") = "".ToDouble + Else + dr("Abono") = TxtAbonoE.Text.ToDouble + dr("Cargo") = "".ToDouble + End If + + DtMovimientos.AcceptChanges() + GvPrePoliza.EditIndex = -1 + + 'If CvePrePoliza > 0 Or CvePrePolizaOrigen > 0 Then + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + UpPrePoliza.Update() + GvPrePoliza.Visible = True + 'End If + + GvPrePoliza.Columns(11).Visible = True + GvPrePoliza.Rows(IndiceGrid).FCCheckBox("chkModificado").Checked = True + + TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero + TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero + UpTotalCargo.Update() + UpTotalAbono.Update() + + End If + RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") + End If + UpPrePoliza.Update() End Sub Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting @@ -1913,7 +1795,7 @@ Partial Class ContabilidadC_RegPrePolizaS dr("Cuenta") = DdlConceptosContables.SelectedItem dr("Referencia") = TxtReferencia.Text dr("Concepto") = TxtConcepto.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, False, True) dr("EsComodin") = 0 dr("CveConcepto") = DdlConceptosContables.SelectedValue dr("Cargo") = TxtCargo.Text.ToDouble @@ -1943,7 +1825,7 @@ Partial Class ContabilidadC_RegPrePolizaS dr("CveConceptoContable") = DdlConceptosContables.SelectedValue dr("Concepto") = TxtDescripcion.Text dr("Referencia") = TxtReferencia.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, False, True) dr("Cargo") = TxtCargo.Text.ToDouble dr("Abono") = TxtAbono.Text.ToDouble dr("ImporteMN") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, TxtCargo.Text.ToDouble, TxtAbono.Text.ToDouble) @@ -1985,7 +1867,7 @@ Partial Class ContabilidadC_RegPrePolizaS dr("Cuenta") = DdlConceptosContables.SelectedItem.Text dr("Referencia") = TxtReferencia.Text dr("Concepto") = TxtConcepto.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, False, True) dr("EsComodin") = 0 dr("CveConcepto") = DdlConceptosContables.SelectedValue dr("CveConceptoContable") = DdlConceptosContables.SelectedValue @@ -2006,12 +1888,6 @@ Partial Class ContabilidadC_RegPrePolizaS DtMovimientos.Rows.Add(dr) DtMovimientos.AcceptChanges() - 'If CvePrePoliza > 0 Then - ' GvPrePoliza.DataSource = DtMovimientos - ' GvPrePoliza.DataBind() - ' UpPrePoliza.Update() - 'End If - GvMov.DataSource = DtMovimientos GvMov.DataBind() UPMovs.Update() @@ -2140,7 +2016,7 @@ Partial Class ContabilidadC_RegPrePolizaS Next UpPrePoliza.Update() End If - If UPMovs.Visible Then + If divMovtos.Visible Then For Each Gvr As GridViewRow In GvMov.Rows Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) Next @@ -2217,58 +2093,6 @@ Partial Class ContabilidadC_RegPrePolizaS End If - UPPDocumento.Update() - DivAgregarConceptos.Visible = True - - 'If DtMovimientos Is Nothing Then CreaDT() - - 'Dim dr As DataRow = DtMovimientos.NewRow - 'Dim CodigoCuenta As String = "" - 'Dim NombreCuenta As String = "" - - 'dr("IdCuenta") = DdlCtaContable.SelectedValue - - 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) - ' If drr IsNot Nothing Then - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() - ' End If - 'End If - - 'dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta - 'dr("Cuenta") = DdlConceptosContables.SelectedItem - 'dr("Referencia") = TxtReferencia.Text - 'dr("Concepto") = TxtObservaciones.Text - 'dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - 'dr("EsComodin") = 0 - 'dr("CveConcepto") = DdlConceptosContables.SelectedValue - 'dr("Cargo") = TxtCargo.Text.ToDouble - 'dr("Abono") = TxtAbono.Text.ToDouble - 'dr("Descripcion") = TxtDescripcion.Text - 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - 'dr("CveClasificacion") = -1 - 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero - 'DtMovimientos.Rows.Add(dr) - - 'If CvePrePoliza > 0 Then - ' GvPrePoliza.DataSource = DtMovimientos - ' GvPrePoliza.DataBind() - 'End If - - - 'GvMov.DataSource = DtMovimientos - 'GvMov.DataBind() - 'UPMovs.Update() - - End Sub Private Sub LbCancelarEdicion_Click(sender As Object, e As EventArgs) Handles LbCancelarEdicion.Click @@ -2956,9 +2780,7 @@ Partial Class ContabilidadC_RegPrePolizaS 'divDatosPrincipales.Visible = False 'divObservaciones.Visible = False - UPMovs.Visible = False - UPMovs.Update() - UPPDocumento.Update() + UpPrePoliza.Update() RegistraScript("comparar();") @@ -2988,7 +2810,7 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub - Private Sub CrarPrePolizaApartirDe() + Private Sub CrearPrePolizaApartirDe() Dim CvePrePoliza As Integer Dim FolioPoliza As Integer @@ -3131,9 +2953,6 @@ Partial Class ContabilidadC_RegPrePolizaS MsgError = ObjMov.MensajePolizaDescuadre End If End If - - - Else MsgError = "No se pudo insertar la póliza" End If @@ -3157,8 +2976,6 @@ Partial Class ContabilidadC_RegPrePolizaS ObjIE.Commit() If Conta IsNot Nothing Then Conta.Commit() - UPPDocumento.Update() - TxtConcepto.Text = "" GvMov.DataBind() TxtFechaDocumento.Text = "" From 1cea8b03bb14490b401616139a6d558b3eb00128 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 9 May 2022 09:39:36 -0700 Subject: [PATCH 19/19] =?UTF-8?q?-=20subtotal2=20en=20la=20validaci=C3=B3n?= =?UTF-8?q?=20sobre=20las=20facturas=20que=20se=20peude=20hacer=20devoluci?= =?UTF-8?q?=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx.vb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 4974cfbfb..fe7583a4e 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1313,7 +1313,7 @@ Partial Class Compras_Compras If DdlTipoComprobante.SelectedValue = "NC" Then paneldevolucion.Visible = True Pnlalmaceninventarios.Visible = False - cargaddldevoluciones(CveProveedor, TxtSubTotal.Text.ToDouble) + cargaddldevoluciones(CveProveedor, TxtSubTotal2.Text.ToDouble) InicializaAplicaNCFact() DivReembolso.Visible = False RBLPago.Items(2).Enabled = False @@ -5925,8 +5925,7 @@ Partial Class Compras_Compras Dim Concepto As String = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreProveedor, $"{TxtSerie.Text}-{TxtFolio.Text}", If(TxtDocumentoFolio.Visible, TxtDocumentoFolio.Text, If(TxtDocumentoFolioCaja.Visible, TxtDocumentoFolioCaja.Text, ConceptoPersonal))) Dim importeMN As Decimal = 0 - Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1) - + Dim Multiplicador As Integer = Row("Multiplicador").ToString.ToEntero ' If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1) Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation Dim PorcentajeImpuesto As Decimal = 0 @@ -16950,7 +16949,7 @@ Partial Class Compras_Compras If DdlTipoComprobante.SelectedValue.Contiene("DEV") Then DivAlmacenDev.Visible = True End If - cargaddldevoluciones(CveProveedor, TxtSubTotal.Text.ToDouble) + cargaddldevoluciones(CveProveedor, TxtSubTotal2.Text.ToDouble) InicializaAplicaNCFact() DivReembolso.Visible = False RBLPago.Items(2).Enabled = False