diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb index f0a7a8aca..6bd2224a0 100644 --- a/App_Code/CalendarEvent.vb +++ b/App_Code/CalendarEvent.vb @@ -47,6 +47,11 @@ Public Class CalendarEvent Public Property SerieFolioCompra As String Public Property CveVenta As Integer Public Property SerieFolioVenta As String + + Public Property CveVentaRemision As Integer = -1 + Public Property RemisionSerieFolio As String = "" + Public Property RemisionSaldo As Decimal = -1 + Public Property CveActivoFijo As Integer Public Property CveTipoAF As Integer @@ -64,6 +69,7 @@ Public Class CalendarEvent Public Property CveMoneda As Integer Public Property Moneda As String - + Public Property NumChoferes As Integer = 1 + Public Property TipoEstatus As Integer = -1 End Class diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 6d8b7fdf3..22f47b871 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -193,6 +193,7 @@ Public Class ClsContratos Public Property CvePartida As Integer Public Property CveDestino As Integer Public Property CveMasivo As Integer + Public Property NumChoferes As Integer = 1 #End Region #Region " C O N T R A T O S " @@ -318,7 +319,8 @@ Public Class ClsContratos Me.CantidadPasajeros = Data.Rows(0)("CantidadPasajeros").ToString.ToEntero Me.CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero Me.CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero - Me.CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero + Me.CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero + Me.NumChoferes = Data.Rows(0)("NumChoferes").ToString.ToEntero End If Retorno = True @@ -423,7 +425,8 @@ Public Class ClsContratos Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = -1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1, Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1, Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, - Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = Nothing, Optional CveChofer As Integer = Nothing, Optional CveChofer2 As Integer = Nothing, Optional CveAF As Integer = Nothing, Optional CantidadPasajeros As Integer = Nothing, Optional CvePartida As Integer = Nothing, Optional CveDestino As Integer = Nothing, Optional CveMasivo As Integer = Nothing) As Boolean + Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = Nothing, Optional CveChofer As Integer = Nothing, Optional CveChofer2 As Integer = Nothing, Optional CveAF As Integer = Nothing, + Optional CantidadPasajeros As Integer = Nothing, Optional CvePartida As Integer = Nothing, Optional CveDestino As Integer = Nothing, Optional CveMasivo As Integer = -1, Optional NumChoferes As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosUpdate") @@ -487,6 +490,7 @@ Public Class ClsContratos .Add("@CvePartida", SqlDbType.Int).Value = CvePartida .Add("@CveDestino", SqlDbType.Int).Value = CveDestino .Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo + .Add("@NumChoferes", SqlDbType.Int).Value = NumChoferes End With Try SqlAdapter.Fill(Data) @@ -684,7 +688,7 @@ Public Class ClsContratos Return Retorno End Function - Public Function GetContratosValUnidadesAgendadas(CveAF As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveEmpresa As Integer, CveContrato As Integer) As Boolean + Public Function GetContratosValUnidadesAgendadas(CveAF As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveEmpresa As Integer, CveContrato As Integer, Optional Opcion As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosValUnidadesAgendadasGet") @@ -694,6 +698,7 @@ Public Class ClsContratos .Add("@FechaFinal", SqlDbType.DateTime).Value = FechaFinal .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@Opcion", SqlDbType.Int).Value = Opcion End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c1ae046c4..a3a5c5ecd 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -7881,7 +7881,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("TipoOC", If(ObjOC.Tipo = "OC", "Orden de Compra", "Requisición"))) params.Add(New ReportParameter("UsoCFDI", ObjOC.UsoCFDI)) - If UsuarioActual.CveEmpresa.Contiene(72, 80, 172) Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then + If UsuarioActual.CveEmpresa.Contiene(72, 80, 172) Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa.Contiene(197, 189)) Then params.Add(New ReportParameter("FolioAdicional", dtOC(0)("FolioAdicional").ToString)) params.Add(New ReportParameter("Vendedor", dtOC(0)("Vendedor").ToString)) params.Add(New ReportParameter("Observacion", dtOC(0)("PrioridadObservacion").ToString)) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 5ea5979ef..8c8c7823d 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -3401,6 +3401,7 @@ Public Class ClsVentas .Add("@EsFilial", SqlDbType.Int).Value = EsFilial End With Try + SqlAdapter.SelectCommand.CommandTimeout = 0 SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 8574dd9a6..323dcd810 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -552,13 +552,28 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero cevent.CveTipoAF = dr("CveTipoAF").ToString.ToEntero - cevent.backgroundColor = dr("BackgroundColor").ToString cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString cevent.NumeroContrato = dr("NumeroContrato").ToString cevent.Observaciones = dr("Observaciones").ToString cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero cevent.CveMoneda = dr("CveMoneda").ToString.ToEntero cevent.Moneda = dr("Moneda").ToString + cevent.NumChoferes = dr("NumChoferes").ToString.ToEntero + + cevent.CveVentaRemision = dr("CveVentaRemision").ToString.ToEntero + cevent.RemisionSerieFolio = dr("RemisionSerieFolio").ToString + cevent.RemisionSaldo = dr("RemisionSaldo").ToString.ToDecimal + cevent.TipoEstatus = dr("TipoEstatus").ToString.ToEntero + cevent.backgroundColor = dr("backgroundColor").ToString + + Dim BGC_Atencion As String = "#bc9b1b" + If cevent.TipoEstatus <> 4 AndAlso cevent.TipoEstatus <> 3 Then + If dr("CveChofer").ToString.ToEntero <= 0 Or (dr("CveChofer2").ToString.ToEntero <= 0 And cevent.NumChoferes = 2) Or dr("CveAF").ToString.ToEntero <= 0 Then + cevent.backgroundColor = BGC_Atencion + End If + End If + + If Not cevent.recurrenciatipo > 0 Then diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index 1f8fa17e7..d4318ac11 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -446,10 +446,10 @@ <%-- 11 --%> - + % Desc. - + @@ -721,63 +721,36 @@ //} } - function calculaDescuentoEscalonado(saldo, TxtDescuento, TxtAbonar, chk,Text,Tipo) { - - let idTxtDescuento = TxtDescuento.id - let idTxtAbonar = TxtAbonar.id - - let descuentoValue = $("#" + idTxtDescuento).val().trim(); - let descuentoParts = descuentoValue.split('+'); - let abonarConDescuento = 0.0; - - - if (descuentoParts.length === 1) { - - - if (isNaN(parseFloat(descuentoParts[0])) || descuentoParts[0] == "0") { - $("#" + idTxtAbonar).val(saldo.toFixed(2)); - FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); - - } else { - let descuento = saldo * (parseFloat(descuentoParts[0]) / 100); - abonarConDescuento = saldo - descuento; - $("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento.toFixed(2),2)); - FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); - } - - } else if (descuentoParts.length === 2) { - - if (isNaN(parseFloat(descuentoParts[0]))) { - $("#" + idTxtAbonar).val(""); - FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); - return; - } - - let descuento1 = saldo * (parseFloat(descuentoParts[0]) / 100); - - if (isNaN(parseFloat(descuentoParts[1]))) { - - let descuento = saldo * (parseFloat(descuentoParts[0]) / 100); - abonarConDescuento = saldo - descuento; - $("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento.toFixed(2), 2)); - FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); - return; - } - - let descuento = saldo * (parseFloat(descuentoParts[0]) / 100); - abonarConDescuento = saldo - descuento; - - let abonarConDescuento2 = abonarConDescuento - (abonarConDescuento * (parseFloat(descuentoParts[1]) / 100)); - - $("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento2.toFixed(2), 2)); - FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); - - - } else { - $("#" + idTxtAbonar).val(""); - FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); - } + function calculaDescuentoEscalonado(saldo, TxtDescuento, TxtAbonar, chk, Text, Tipo) { + let idTxtDescuento = TxtDescuento.id; + let idTxtAbonar = TxtAbonar.id; + + let descuentoValue = $("#" + idTxtDescuento).val().trim(); + let descuentoParts = descuentoValue.split('+'); + let abonarConDescuento = saldo; + + if (descuentoParts.length === 0 || (descuentoParts.length === 1 && descuentoParts[0] === "")) { + $("#" + idTxtAbonar).val(saldo.toFixed(2)); + FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); + return; + } + + for (let i = 0; i < descuentoParts.length; i++) { + let descuentoPart = descuentoParts[i].trim(); + + if (isNaN(parseFloat(descuentoPart)) || descuentoPart === "0") { + continue; + } + + let descuento = abonarConDescuento * (parseFloat(descuentoPart) / 100); + abonarConDescuento -= descuento; + } + + $("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento.toFixed(2), 2)); + FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); } + + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 0d7f05061..b4e27a62b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4227,12 +4227,14 @@ Partial Class Compras_Compras Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click + + + '------------------ INICIA VALIDACIONES ------------------ + If Not ValidaPresupuesto(2) Then Exit Sub End If - '------------------ 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 @@ -4689,6 +4691,11 @@ Partial Class Compras_Compras Exit Sub End If + If DdlMoneda.SelectedValue.ToEntero > 1 And TxtTC.Text.ToDecimal <= 10 Then + Alert("Al seleccionar dólares, el tipo de cambio debe ser superior a 10.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + '------------------TERMINA VALIDACIONES------------------ @@ -8552,7 +8559,7 @@ Partial Class Compras_Compras If ArrAnticipos.Count > 0 Then For Each Ant As Compras_Compras.Anticipos In ArrAnticipos 'ImporteAnticipo += (Ant.Importe + Ant.ImporteComision) - ImporteAnticipo += (Ant.Importe) + ImporteAnticipo += ((Ant.Importe) + Ant.ImporteComision) Next End If @@ -17103,7 +17110,7 @@ Partial Class Compras_Compras 'HdnIVAPS.Value = If(PS.Rows(0)("IVA").ToString = "-1", ViewState("IVA"), PS.Rows(0)("IVA").ToString).ToString ViewState("IVAPS") = PS("IVA").ToString If ViewState("IVAPS").ToString.ToEntero() = -1 Then - Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0) + Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)(0) ViewState("IVAPS") = Drr("IVA").ToString().ToDouble() DdlProyecto.SelectedValueExist(Drr("CveProyecto")) diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index f7fce04d7..4b3d3ab11 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -5114,11 +5114,11 @@ -