From 3c1523d6a752e1701b397c364b72822040ba7d4c Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 20 May 2024 13:11:59 -0700 Subject: [PATCH 01/11] Facturacion de remsiones en cobranza E189 --- Ventas/PVCobranza.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 60866a433..a3f77d042 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -431,7 +431,7 @@ Partial Class Ventas_PVCobranza Try 'FACTURAR LA REMISION PARA HACER EL PAGO - If UsuarioActual.CveEmpresa = 193 AndAlso VentaActual.TipoDocto = "Rem" Then + If UsuarioActual.CveEmpresa = 189 AndAlso VentaActual.TipoDocto = "Rem" Then respFactura = GenerarFactura(VentaActual, ObjVentas2, ObjClientes) If respFactura Is Nothing Then From c52b59e32d325f8446bd07743eecb87e4a7e97b8 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 20 May 2024 09:35:10 -0700 Subject: [PATCH 02/11] Ventas SMS Permitir modificar precio en ventas de tipo pago directo --- UserControl/AddMedico.ascx.vb | 2 +- Ventas/Ventas.aspx.vb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UserControl/AddMedico.ascx.vb b/UserControl/AddMedico.ascx.vb index f2e4d1edf..a2ede09ae 100644 --- a/UserControl/AddMedico.ascx.vb +++ b/UserControl/AddMedico.ascx.vb @@ -227,7 +227,7 @@ Partial Class UserControl_AddMedico TxtFechaIng.Text = "" TxtUsuario.Text = "" - DdlVendedor.SelectedValueExist(-1) + DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor) CargaGVMedicoClienteSucursal(-1, UsuarioActual.CveEmpresa) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ee5f66057..5bc192581 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -8767,7 +8767,7 @@ Partial Class Ventas GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False - If DdlTipoComprobante.SelectedValue = "Cot" Or RBLTipoVenta.SelectedValue.ToEntero = 1 Then + If DdlTipoComprobante.SelectedValue = "Cot" Or RBLTipoVenta.SelectedValue.ToEntero = 2 Then GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = True End If @@ -17682,7 +17682,7 @@ Partial Class Ventas If EsVentaMedica Then TxtPrecio.Enabled = False - If UsuarioActual.CveUsuario = 3986 Or RBLTipoVenta.SelectedValue.ToEntero = 1 Then + If UsuarioActual.CveUsuario = 3986 Or RBLTipoVenta.SelectedValue.ToEntero = 2 Then TxtPrecio.Enabled = True End If From 8244fd7b6a27573bf0df22bdf323c32085c3b4d7 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 20 May 2024 19:27:19 -0700 Subject: [PATCH 03/11] EMD - registro de una factura con OC y y anticipo --- Compras/Compras.aspx | 24 +++++++++++++++------- Compras/Compras.aspx.vb | 44 ++++++++++++++++++++++++++++++----------- 2 files changed, 50 insertions(+), 18 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index f1b590b20..2db947fe9 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5918,7 +5918,7 @@ } - function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra) { + function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra, txtComision) { var Total = ToDouble($get('TxtTotal').value); debugger; var txtvalue = ToDouble(txt.value); @@ -5939,13 +5939,23 @@ else { TCC = 1; } var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt()).toFixed(2); // le agrego lo del valor actual para validarlo + + if (t.checked) - { - if (DifSaldo > importevalue) { - txt.value = toFixed(ToDouble(importevalue*TCC),2); - } else { - txt.value = toFixed(ToDouble(DifSaldo*TCC),2); - } + { + if (DifSaldo > importevalue) { + txt.value = toFixed(ToDouble(importevalue * TCC), 2); + } else { + txt.value = toFixed(ToDouble(DifSaldo * TCC), 2); + } + + let difFinal = (DifSaldo - importevalue) * TCC; + + if (difFinal > 0 && difFinal < 1) { + txtComision.value = toFixed(ToDouble(difFinal), 2); + } + + } else { txt.value = ""; } diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index a2177e891..8c7f444f1 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4193,9 +4193,24 @@ Partial Class Compras_Compras '------------------ INICIA VALIDACIONES ------------------ - If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then - Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia) - Exit Sub + + + + If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then + + Dim ImporteAnticipoComision As Decimal = 0 + If ArrAnticipos.Count > 0 Then + For Each Ant As Compras_Compras.Anticipos In ArrAnticipos + ImporteAnticipoComision += Ant.ImporteComision + Next + End If + + If (LblSaldoFactura.Text.ToDecimal - ImporteAnticipoComision) > 0 Then + Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + End If Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal() @@ -7240,20 +7255,22 @@ Partial Class Compras_Compras ErrorPrepoliza = True End If Else - Dim ImporteAntMNComision As Decimal = (ImporteAnt + ImporComisionAnticipo) * TipoCambioAnt + 'Dim ImporteAntMNComision As Decimal = (ImporteAnt + ImporComisionAnticipo) * TipoCambioAnt + Dim ImporteAntMNComision As Decimal = (ImporteAnt) * TipoCambioAnt - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (ImporteAnt + ImporComisionAnticipo), ImporteAntMNComision, ConceptoContableAnticipo, Referencia, Concepto, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteME:=If(tipoCambioActual = 1, 0, (ImporteAnt + ImporComisionAnticipo)), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then + 'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (ImporteAnt + ImporComisionAnticipo), ImporteAntMNComision, ConceptoContableAnticipo, Referencia, Concepto, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteME:=If(tipoCambioActual = 1, 0, (ImporteAnt + ImporComisionAnticipo)), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (ImporteAnt), ImporteAntMNComision, ConceptoContableAnticipo, Referencia, Concepto, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteME:=If(tipoCambioActual = 1, 0, (ImporteAnt)), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If End If If TxtTotal.Text.ToDouble > 0 AndAlso TieneAnticiposXML = False Then Dim Pago As New CompraPago - Pago.ImportePago = importeMovimiento + Pago.ImportePago = importeMovimiento + ImporComisionAnticipo Pago.CveIE = Ant.CveIE Pago.TCPago = Ant.TCCompra Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1) - Pago.OtroGastoIngreso = ImporComisionAnticipo + Pago.OtroGastoIngreso = -ImporComisionAnticipo ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta) End If @@ -8480,7 +8497,8 @@ Partial Class Compras_Compras Dim ImporteAnticipo As Decimal = 0 If ArrAnticipos.Count > 0 Then For Each Ant As Compras_Compras.Anticipos In ArrAnticipos - ImporteAnticipo += Ant.Importe + 'ImporteAnticipo += (Ant.Importe + Ant.ImporteComision) + ImporteAnticipo += (Ant.Importe) Next End If @@ -9762,22 +9780,26 @@ Partial Class Compras_Compras Dim tTCFecha As Double = If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble) - e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6});", + e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6},{7});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, CompraSaldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda"), e.Row.DBCampo("TCCompra").ToDouble, DdlMoneda.SelectedValue, - IIf(DdlMoneda.SelectedValue = "1", 1, TxtTC.Text))) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO + IIf(DdlMoneda.SelectedValue = "1", 1, TxtTC.Text), + e.Row.FCTextBox("TxtComision").ClientID + )) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO If UsuarioActual.Empresa.CveEmpresa.Contiene(13, 83) Then + e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5},{6});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), - If(CveCompra > 0, CompraSaldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, + If(CveCompra > 0, CompraSaldo, ImporteAmortizacion), + e.Row.DBCampo("CveMoneda").ToEntero, tTCFecha, DdlMoneda.SelectedValue.ToEntero, e.Row.FCTextBox("TxtComision").ClientID)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO From 75398a18bf731498923eff1ba6e020b0bdfb9f78 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 21 May 2024 10:19:56 -0700 Subject: [PATCH 04/11] --FIX. Cajas chicas en transferencia en E197 --- Ventas/Ventas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ee5f66057..0904079d6 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -23480,7 +23480,7 @@ Partial Class Ventas ' DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) 'End If - If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 195 Then + If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa.Contiene(195, 197) Then DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) Else DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) From b6817236804e37ae0e35d7f1829cd133729758a7 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 21 May 2024 11:31:53 -0700 Subject: [PATCH 05/11] =?UTF-8?q?EMD=20-=20Agregar=20Clasificaci=C3=B3n=20?= =?UTF-8?q?a=20un=20presupuesto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx | 8 ++- Contratos/ModificarPresupuesto.aspx | 70 ++++++++++++++++++++- Contratos/ModificarPresupuesto.aspx.vb | 86 +++++++++++++++++++++++++- 3 files changed, 159 insertions(+), 5 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 2db947fe9..ea1caef0c 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5937,7 +5937,7 @@ } } else { TCC = 1; } - var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt()).toFixed(2); // le agrego lo del valor actual para validarlo + var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt());//.toFixed(2); // le agrego lo del valor actual para validarlo @@ -5952,7 +5952,7 @@ let difFinal = (DifSaldo - importevalue) * TCC; if (difFinal > 0 && difFinal < 1) { - txtComision.value = toFixed(ToDouble(difFinal), 2); + txtComision.value = toFixed(roundToTwo(difFinal), 2); } @@ -5968,6 +5968,10 @@ } + function roundToTwo(num) { + return Math.round(num * 100) / 100; + } + function FnCambiaAnt(chk, txt, saldo, TotalSaldo, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, txtComision) { var Total = ToDouble($get('TxtTotal').value); diff --git a/Contratos/ModificarPresupuesto.aspx b/Contratos/ModificarPresupuesto.aspx index eab520066..5c419e264 100644 --- a/Contratos/ModificarPresupuesto.aspx +++ b/Contratos/ModificarPresupuesto.aspx @@ -10,6 +10,17 @@ + + + + +
  • + +
  • + +
    +
    @@ -98,7 +109,7 @@
    -
    +
    - +
    + + + + + diff --git a/Contratos/ModificarPresupuesto.aspx.vb b/Contratos/ModificarPresupuesto.aspx.vb index a15b37859..7eba861ad 100644 --- a/Contratos/ModificarPresupuesto.aspx.vb +++ b/Contratos/ModificarPresupuesto.aspx.vb @@ -88,11 +88,13 @@ Partial Class Contratos_ModificarPresupuesto #Region "C A R G A - D A T O S" Private Sub CargaDatos() + Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero Dim Nombre = "-1" Dim CveSubProyecto = -1 Dim CveUsuario = -1 Dim Agrupador = 1 'CLASIFICACION + If CvePresupuesto > 0 Then TxtFecha.Text = NowADS().ToString("dd/MM/yyyy") Dim DrPresupuesto = DtPresupuestos.FiltroPrimero($"CvePresupuesto = {CvePresupuesto}") @@ -131,10 +133,22 @@ Partial Class Contratos_ModificarPresupuesto GvPresupuestos.Columns(3).Visible = True GvPresupuestos.Columns(4).Visible = True End Select - + Else + DtClasificaciones = New DataTable + GvPresupuestos.DataSource = DtClasificaciones + GvPresupuestos.DataBind() End If + + + + ValidaAcciones() + End Sub + + + + Protected Sub GvPresupuestos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPresupuestos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim StrTipo = DdlTipo.SelectedValue @@ -286,4 +300,74 @@ Partial Class Contratos_ModificarPresupuesto End If End Sub + + + Private Sub ValidaAcciones() + LnkAccionesAgregarClasificacion.Visible = False + If DtClasificaciones IsNot Nothing AndAlso DtClasificaciones.Rows.Count > 0 Then + LnkAccionesAgregarClasificacion.Visible = True + End If + UpAcciones.Update() + + End Sub + + Protected Sub LnkAccionesAgregarClasificacion_Click(sender As Object, e As EventArgs) + CargaAccionesDdlclasificaciones() + RegistraScript("$('#DVModalAgregarClasificacion').modal();") + End Sub + + Private Sub CargaAccionesDdlclasificaciones() + + Dim dtClasificaciones As DataTable = Me.DtClasificaciones.Copy + Dim globalDtClasificacionesn As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("Tipo = 1").Copy + + + Dim filteredRecords = From globalRow In globalDtClasificacionesn.AsEnumerable() + Where Not dtClasificaciones.AsEnumerable().Any(Function(dtRow) dtRow.Field(Of Integer)("CveClasificacion") = globalRow.Field(Of Integer)("CveClasificacion")) + Select globalRow + + + Dim resultTable As DataTable = globalDtClasificacionesn.Clone() + For Each row In filteredRecords + resultTable.ImportRow(row) + Next + + + DdlModalClasificacion.DataSource = resultTable + + DdlModalClasificacion.DataBind() + DdlModalClasificacion.Items.Insert(0, New ListItem("Seleccione Una", "-1")) + UpModalAgregarClasicicacion.Update() + End Sub + + Protected Sub LnkModalAgregarClasificacion_Click(sender As Object, e As EventArgs) + + Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero + Dim CveClasificacion As Integer = DdlModalClasificacion.SelectedValue.ToEntero + + If CveClasificacion > 0 Then + + Dim ObjCont As New ClsContratos + Dim TieneError As Boolean = False + + If Not ObjCont.AddPresupuestosDetalle(CvePresupuesto, CveClasificacion, -1, 0, "") Then + TieneError = True + End If + + ObjCont.Dispose() + + If Not TieneError Then + RegistraScript($"$('#DVModalAgregarClasificacion').modal('hide');") + Alert($"Clasificación {DdlModalClasificacion.SelectedItem.Text} agregada correctamente.") + CargaDatos() + UpGvClasificaciones.Update() + End If + + End If + + + + End Sub + + End Class From 56a1d7bee08b90d8790049aa18b80d0088bc8597 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 21 May 2024 15:38:23 -0700 Subject: [PATCH 06/11] =?UTF-8?q?EMD=20-=20Agregar=20Clasificaci=C3=B3n=20?= =?UTF-8?q?a=20un=20presupuesto,=20ajuste=20clasificaci=C3=B3n=20activa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contratos/ModificarPresupuesto.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contratos/ModificarPresupuesto.aspx.vb b/Contratos/ModificarPresupuesto.aspx.vb index 7eba861ad..f26d46780 100644 --- a/Contratos/ModificarPresupuesto.aspx.vb +++ b/Contratos/ModificarPresupuesto.aspx.vb @@ -319,7 +319,7 @@ Partial Class Contratos_ModificarPresupuesto Private Sub CargaAccionesDdlclasificaciones() Dim dtClasificaciones As DataTable = Me.DtClasificaciones.Copy - Dim globalDtClasificacionesn As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("Tipo = 1").Copy + Dim globalDtClasificacionesn As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("Tipo = 1 AND Estado = 1 ").Copy Dim filteredRecords = From globalRow In globalDtClasificacionesn.AsEnumerable() From 3e6d9ec9c6cfe0b70da2fcbf89dc5f2b6a205cb7 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 21 May 2024 18:50:42 -0700 Subject: [PATCH 07/11] --FIX, soportes --- Empresas/190/Formatos/RepCortes.rdlc | 12 ++++++++ Empresas/193/Formatos/RepCortes.rdlc | 12 ++++++++ Ventas/CatClasificaciones2.aspx.vb | 44 +++++++++++++--------------- Ventas/Ventas.aspx.vb | 2 +- 4 files changed, 46 insertions(+), 24 deletions(-) diff --git a/Empresas/190/Formatos/RepCortes.rdlc b/Empresas/190/Formatos/RepCortes.rdlc index 3d72d3b77..b967bd1ab 100644 --- a/Empresas/190/Formatos/RepCortes.rdlc +++ b/Empresas/190/Formatos/RepCortes.rdlc @@ -402,6 +402,7 @@ =Fields!SerieFolio.Value @@ -415,6 +416,7 @@ + =IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White") 2pt 2pt 2pt @@ -434,6 +436,7 @@ =Fields!NombreComercial.Value @@ -447,6 +450,7 @@ + =IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White") 2pt 2pt 2pt @@ -468,6 +472,7 @@ @@ -481,6 +486,7 @@ + =IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White") 2pt 2pt 2pt @@ -501,6 +507,7 @@ =Fields!MetodoPago.Value @@ -514,6 +521,7 @@ + =IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White") 2pt 2pt 2pt @@ -1668,6 +1676,10 @@ /* Local Query */ + + CveVenta + System.Integer + SerieFolio System.String diff --git a/Empresas/193/Formatos/RepCortes.rdlc b/Empresas/193/Formatos/RepCortes.rdlc index 5b7ac4c46..8a722aea3 100644 --- a/Empresas/193/Formatos/RepCortes.rdlc +++ b/Empresas/193/Formatos/RepCortes.rdlc @@ -182,6 +182,7 @@ =Fields!SerieFolio.Value @@ -195,6 +196,7 @@ + =IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White") 2pt 2pt 2pt @@ -214,6 +216,7 @@ =Fields!NombreComercial.Value @@ -227,6 +230,7 @@ + =IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White") 2pt 2pt 2pt @@ -248,6 +252,7 @@ @@ -261,6 +266,7 @@ + =IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White") 2pt 2pt 2pt @@ -281,6 +287,7 @@ =Fields!MetodoPago.Value @@ -294,6 +301,7 @@ + =IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White") 2pt 2pt 2pt @@ -2577,6 +2585,10 @@ /* Local Query */ + + CveVenta + System.Integer + SerieFolio System.String diff --git a/Ventas/CatClasificaciones2.aspx.vb b/Ventas/CatClasificaciones2.aspx.vb index 4380f1c83..f1a7b9dcf 100644 --- a/Ventas/CatClasificaciones2.aspx.vb +++ b/Ventas/CatClasificaciones2.aspx.vb @@ -186,33 +186,31 @@ Partial Class Ventas_CatClasificaciones2 Protected Sub LbAgregarS_Click(sender As Object, e As EventArgs) Handles LbAgregarS.Click Dim ObjClasificaciones As New ClsClasificaciones - 'If ObjClasificaciones.AddClasificaciones(TxtClasificacionS.Text.Trim, "", - ' -1, "", -1, "", -1, "", - ' DdlCategoriaS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False) Then + If ObjClasificaciones.AddClasificaciones(TxtClasificacionS.Text.Trim, "", DdlCategoriaS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False) Then - ' 'DdlCuentaGastoS.SelectedValue.ToEntero, DdlCuentaGastoS.SelectedItem.Text, - ' 'DdlCuentaAnticipoS.SelectedValue.ToEntero, DdlCuentaAnticipoS.SelectedItem.Text, - ' 'DdlCuentaInventarioS.SelectedValue.ToEntero, DdlCuentaInventarioS.SelectedItem.Text, - ' TxtClasificacionS.Text = "" - ' Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion) - ' UpTitulosS.Update() + 'DdlCuentaGastoS.SelectedValue.ToEntero, DdlCuentaGastoS.SelectedItem.Text, + 'DdlCuentaAnticipoS.SelectedValue.ToEntero, DdlCuentaAnticipoS.SelectedItem.Text, + 'DdlCuentaInventarioS.SelectedValue.ToEntero, DdlCuentaInventarioS.SelectedItem.Text, + TxtClasificacionS.Text = "" + Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion) + UpTitulosS.Update() - ' If ObjClasificaciones.GetClasificaciones(-1, 4) Then - ' GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = Nothing - ' ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) - ' GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) - ' End If + If ObjClasificaciones.GetClasificaciones(-1, 4) Then + GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = Nothing + ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) + GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) + End If - ' 'DdlCuentaGastoS.SelectedValue = "-1" - ' 'DdlCuentaAnticipoS.SelectedValue = "-1" - ' 'DdlCuentaInventarioS.SelectedValue = "-1" + 'DdlCuentaGastoS.SelectedValue = "-1" + 'DdlCuentaAnticipoS.SelectedValue = "-1" + 'DdlCuentaInventarioS.SelectedValue = "-1" - ' If ViewState("Orden2").ToString() <> String.Empty Then - ' CargaGridS(ViewState("Orden2").ToString()) - ' Else - ' CargaGridS("") - ' End If - 'End If + If ViewState("Orden2").ToString() <> String.Empty Then + CargaGridS(ViewState("Orden2").ToString()) + Else + CargaGridS("") + End If + End If ObjClasificaciones.Dispose() End Sub diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index bd8cae3a5..fbbffc483 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5073,7 +5073,7 @@ Partial Class Ventas 'End If 'si utiliza cortes, y cajas, no permitir cancelar de días anteriores If UsuarioActual.CveRol <> 1 AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso DbRowVenta("Fecha").ToString.ToDate.ToShortDateString.ToDate < Now.ToShortDateString.ToDate Then - LbCancelarDocumento.Visible = False + LbCancelarDocumento.Visible = UsuarioActual.TienePermisoProceso(378) End If End If From 25892a084d31fafd50668314992fe264deaa93d5 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 22 May 2024 09:54:31 -0700 Subject: [PATCH 08/11] Compras error al seleccionar anticipo txt comision nulo --- Compras/Compras.aspx | 78 +++--- Compras/Compras.aspx.vb | 21 +- Ventas/CatClientes.aspx | 505 +++++++++++++++++++------------------ Ventas/CatClientes.aspx.vb | 8 +- 4 files changed, 321 insertions(+), 291 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index ea1caef0c..c2c1cbf6d 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5918,56 +5918,58 @@ } - function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra, txtComision) { - var Total = ToDouble($get('TxtTotal').value); - debugger; - var txtvalue = ToDouble(txt.value); - var ImportePago, ImporteCompra; + function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra, txtComision) { + var Total = ToDouble($get('TxtTotal').value); + debugger; + var txtvalue = ToDouble(txt.value); + var ImportePago, ImporteCompra; - var TCC = TCCompra / TCAnticipo; - var importevalue = ToDouble(importe); + var TCC = TCCompra / TCAnticipo; + var importevalue = ToDouble(importe); - if (CveMonedaAnticipo != CveMonedaOriginal) { - if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) { - txtvalue = ToDouble(txtvalue / TCAnticipo); - importevalue = ToDouble(importevalue / TCAnticipo); - } else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) { - txtvalue = ToDouble(txtvalue * TCAnticipo); - importevalue = ToDouble(importevalue * TCAnticipo); + if (CveMonedaAnticipo != CveMonedaOriginal) { + if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) { + txtvalue = ToDouble(txtvalue / TCAnticipo); + importevalue = ToDouble(importevalue / TCAnticipo); + } else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) { + txtvalue = ToDouble(txtvalue * TCAnticipo); + importevalue = ToDouble(importevalue * TCAnticipo); + } } - } - else { TCC = 1; } - var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt());//.toFixed(2); // le agrego lo del valor actual para validarlo + else { TCC = 1; } + var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt());//.toFixed(2); // le agrego lo del valor actual para validarlo - if (t.checked) - { - if (DifSaldo > importevalue) { - txt.value = toFixed(ToDouble(importevalue * TCC), 2); - } else { - txt.value = toFixed(ToDouble(DifSaldo * TCC), 2); + if (t.checked) + { + if (DifSaldo > importevalue) { + txt.value = toFixed(ToDouble(importevalue * TCC), 2); + } else { + txt.value = toFixed(ToDouble(DifSaldo * TCC), 2); + } + + + if (txtComision !== undefined && txtComision !== null) { + let difFinal = (DifSaldo - importevalue) * TCC; + if (difFinal > 0 && difFinal < 1) { + txtComision.value = toFixed(roundToTwo(difFinal), 2); + } + } + + + } else { + txt.value = ""; } - let difFinal = (DifSaldo - importevalue) * TCC; - - if (difFinal > 0 && difFinal < 1) { - txtComision.value = toFixed(roundToTwo(difFinal), 2); - } + $("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); + $("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2)); + $("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2)); + $("#LblSaldoFactura").text(FormatoNumero(TotalSaldoCompra - FnSumaValoresAnt(), 2)); - } else { - txt.value = ""; } - $("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); - $("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2)); - $("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2)); - $("#LblSaldoFactura").text(FormatoNumero(TotalSaldoCompra - FnSumaValoresAnt(), 2)); - - - } - function roundToTwo(num) { return Math.round(num * 100) / 100; } diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 8c7f444f1..1bae445bc 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -9780,7 +9780,13 @@ Partial Class Compras_Compras Dim tTCFecha As Double = If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble) - e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6},{7});", + + + + + If UsuarioActual.Empresa.CveEmpresa.Contiene(13, 83) Then + + e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6},{7});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, CompraSaldo, ImporteAmortizacion), @@ -9793,8 +9799,6 @@ Partial Class Compras_Compras - If UsuarioActual.Empresa.CveEmpresa.Contiene(13, 83) Then - e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5},{6});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), @@ -9813,6 +9817,17 @@ Partial Class Compras_Compras DdlMoneda.SelectedValue.ToEntero, e.Row.FCTextBox("TxtAnticipo").ClientID)) Else + + e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6});", + e.Row.FCTextBox("TxtAnticipo").ClientID, + e.Row.DBCampo("Saldo"), + If(CveCompra > 0, CompraSaldo, ImporteAmortizacion), + e.Row.DBCampo("CveMoneda"), + e.Row.DBCampo("TCCompra").ToDouble, + DdlMoneda.SelectedValue, + IIf(DdlMoneda.SelectedValue = "1", 1, TxtTC.Text) + )) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO + e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), diff --git a/Ventas/CatClientes.aspx b/Ventas/CatClientes.aspx index fb29a26ab..45d666451 100644 --- a/Ventas/CatClientes.aspx +++ b/Ventas/CatClientes.aspx @@ -17,9 +17,7 @@
  • Personalizar
  • - <%--
  • - Agregar Corporativo -
  • --%> +
  • Unificar Clientes
  • @@ -34,29 +32,28 @@ -
    -
    +
    +
    - "> -
    -
    -
    Nombre:
    -
    +
    + +
    Nombre:
    +
    -
    RFC:
    -
    +
    RFC:
    +
    -
    Estatus:
    -
    +
    Estatus:
    +
    Todos Activo @@ -64,9 +61,20 @@
    -
    + <%--
    -
    +
    --%> + +
    + Permite Crédito: +
    +
    + + Todos + Si + No + +
    @@ -75,18 +83,18 @@
    >
    -
    Sucursal:
    -
    +
    Sucursal:
    +
    -
    Clasif:
    -
    +
    Clasificación:
    +
    -
    Tipo:
    -
    +
    Tipo:
    +
    Todos Frecuente @@ -94,10 +102,10 @@
    -
    +
    Vendedor:
    -
    +
    @@ -105,6 +113,7 @@
    +
    @@ -121,8 +130,9 @@ -
    - + + + <%-- - + --%> -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Nombre Corto - - - - - - No Ext - - - - - - No Int - - - - - - Colonia - - - - - - Ciudad - - - - - - Estado - - - - - - País - - - - - - CP - - - - - - Contacto - - - - - - Correo Env. Factura - - - - - - Recepción Facturas - - - - - - Ret IVA - - - - - - Ret ISR - - - - - - Plazo Cobranza - - - - - - Límite Crédito - - - - - +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nombre Corto + + + + + + No Ext + + + + + + No Int + + + + + + Colonia + + + + + + Ciudad + + + + + + Estado + + + + + + País + + + + + + CP + + + + + + Contacto + + + + + + Correo Env. Factura + + + + + + Recepción Facturas + + + + + + Ret IVA + + + + + + Ret ISR + + + + + + Plazo Cobranza + + + + + + Límite Crédito + + + + + - <%-- - CIE - - - - --%> + + Calle + + + + + + Celular + + + + + + Correo Env. Cotización + + + + + + Otro Telefono + + + + + + Permite Crédito + + + + + + F Limite Crédito + + + + + + +
    - - Calle - - - - - - Celular - - - - - - Correo Env. Cotización - - - - - - Otro Telefono - - - - - - F Limite Crédito - - - - - - - - - - - +
    @@ -455,9 +463,10 @@ - + - + + @@ -476,46 +485,46 @@
    - + +
    +
    + + + +