diff --git a/.gitignore b/.gitignore index dcae84dd2..c1c000c04 100644 --- a/.gitignore +++ b/.gitignore @@ -287,3 +287,4 @@ vwd.webinfo /A/CatEstatusIE.aspx.vb /A/a.aspx /A/a.aspx.vb +/General/Report.rdlc diff --git a/Acumuladores/RepRecolecciones.aspx.vb b/Acumuladores/RepRecolecciones.aspx.vb index 44e8fccab..2cc61fdc3 100644 --- a/Acumuladores/RepRecolecciones.aspx.vb +++ b/Acumuladores/RepRecolecciones.aspx.vb @@ -209,6 +209,18 @@ Partial Class Acumuladores_RepRecolecciones End Sub Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click + + + Dim Cantidad As Decimal = HdnCantidadRecoleccion.Value.ToDecimal + Dim CantidadDefinido As Decimal = 0 + For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows + CantidadDefinido += gvr.DataKey("Cantidad").ToDecimal + Next + If CantidadDefinido <> Cantidad Then + Alert("La cantidad definida no es la correcta", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim ObjInventario As New ClsInventarios Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL) Dim ErrorMovInv As Boolean = False diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index a4f9b0a36..84fcb8ab7 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -197,13 +197,19 @@ Public Class ClsContratos #End Region #Region " C O N T R A T O S " - Public Function GetContratosReporte(CveEmpresa As Integer, FechaInicial As DateTime, FechaFinal As DateTime) As Boolean + Public Function GetContratosReporte(CveEmpresa As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveCliente As Integer, Optional CveEstatus As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveTipoContrato As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosReporteGet") With SqlAdapter.SelectCommand.Parameters .Add("@FechaInicial", SqlDbType.DateTime).Value = FechaInicial .Add("@FechaFinal", SqlDbType.DateTime).Value = FechaFinal + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF + .Add("@CveChofer", SqlDbType.Int).Value = CveChofer + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 806a0d125..e0ee2474c 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -3,7 +3,9 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient +Imports CrystalDecisions.[Shared].Json Imports Extensiones +Imports Microsoft.Ajax.Utilities Imports Profact.TimbraCFDI40 @@ -2053,17 +2055,25 @@ Public Class ClsRH .Add("@CveSubTipoPeriodo", SqlDbType.Int).Value = CveSubTipoPeriodo + .Add("@ErrorMostrarADS", SqlDbType.VarChar).Direction = ParameterDirection.Output - .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue + .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.Output - End With + End With + Try - SqlAdapter.Fill(Data) - _CvePersonal = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero + SqlAdapter.SelectCommand.ExecuteNonQuery() + + 'SqlAdapter.Fill(Data) + _CvePersonal = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString().ToEntero() Retorno = True Catch Ex1 As SqlException - 'dbo.Vw_Val_Nom_Curps - If Ex1.Message.Contains("Número: 2627;") Then + Dim ErrorMostrarADS As String = trygetparameter("@ErrorMostrarADS") + + 'dbo.Vw_Val_Nom_Curps + If Not (ErrorMostrarADS.IsNullOrWhiteSpace()) Then + Alert(ErrorMostrarADS, TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("Número: 2627;") Then Alert("El nuevo personal no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia) ElseIf Ex1.Message.Contains("Chk_RH_PersonalSalarioIMSS") Then Alert("El nuevo personal no se guardo debido a que se presento un problema al calcular el salario", TipoMensaje.MsgAdvertencia) @@ -2077,11 +2087,26 @@ Public Class ClsRH Me.OnError("Ocurrió un error al guardar el nuevo personal.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If Catch ex As Exception - OnError("Ocurrió un error al guardar el nuevo personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Dim ErrorMostrarADS As String = trygetparameter("@ErrorMostrarADS") + + If Not (ErrorMostrarADS.IsNullOrWhiteSpace()) Then + Alert(ErrorMostrarADS, TipoMensaje.MsgAdvertencia) + Else + OnError("Ocurrió un error al guardar el nuevo personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If End Try Return Retorno End Function + Private Function trygetparameter(parametername As String) As String + Try + Return SqlAdapter.SelectCommand.Parameters(parametername).Value.ToString() + Catch ex As Exception + Return Nothing + End Try + End Function + + Public Function UpdatePersonal(Codigo As String, APaterno As String, AMaterno As String, Nombres As String, Correo As String, FechaIngreso As Date, CveTipoPeriodo As Integer, NumeroSS As String, SeInscribioSS As Boolean, SalarioDiarioPago As Double, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveMetodoPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String, diff --git a/Bancos/PopIEVentas.aspx b/Bancos/PopIEVentas.aspx index 851a7d32a..e2eb1826e 100644 --- a/Bancos/PopIEVentas.aspx +++ b/Bancos/PopIEVentas.aspx @@ -533,14 +533,26 @@ + + + + + +
+ + + + +
- +
+ +
+
+ +

-
-
- - -
+
diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index b05648ad7..b7108b91a 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -1110,6 +1110,22 @@ Partial Class Bancos_PopIEVentas #Region "G U A R D A R" Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click + If ChkComplementoPago.Checked Then + Dim objGral As New ClsGralFolios + Dim SalirDeMetodo As Boolean = False + If objGral.GetFolios("CP", UsuarioActual.CveEmpresa) Then + If Not objGral.DtResultados.Rows.Count > 0 Then + Alert("No se cuenta con folios para emitir complemento de pago", TipoMensaje.MsgAdvertencia) + SalirDeMetodo = True + End If + End If + objGral.Dispose() + If SalirDeMetodo Then + Exit Sub + End If + End If + + Dim FechaFactura As Date = FechaVenta Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate diff --git a/Bancos/RepComplementoPago.aspx.vb b/Bancos/RepComplementoPago.aspx.vb index a22070ac6..e7360a3c1 100644 --- a/Bancos/RepComplementoPago.aspx.vb +++ b/Bancos/RepComplementoPago.aspx.vb @@ -97,9 +97,9 @@ Partial Class Bancos_RepComplementoPago Alert("No se cuenta con folios para emitir complemento de pago", TipoMensaje.MsgAdvertencia) End If End If - - 'CargaDatos() - + objGral.Dispose() + 'CargaDatos() + End If End Sub diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index a78ec0fb7..ef2bf7701 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -751,6 +751,8 @@ Partial Class Inventarios_RecepcionUsados End Sub Private Sub LimpiarMovimiento() CveMovimiento = -1 + CveRemisionRecibida = -1 + CargoRemisionDesdeURL = False If ObjFactura IsNot Nothing Then ObjFactura.Dispose() @@ -771,7 +773,7 @@ Partial Class Inventarios_RecepcionUsados RblUsadosAjuste.Enabled = True RblUsadosAjuste.SelectedValue = "0" - CveRemisionRecibida = -1 + EsDistribuidor = False InicializaClientes(True) DdlClientes.Enabled = True @@ -831,6 +833,14 @@ Partial Class Inventarios_RecepcionUsados 'CargaInicial() + + If Me.ObjRemisionNC IsNot Nothing Then + Me.ObjRemisionNC.Dispose() + Me.ObjRemisionNC = Nothing + End If + + DtMovimientos.Rows.Clear() + UpGenerales.Update() UpRegistroTipoCambio.Update() UPDatos.Update() @@ -1234,12 +1244,14 @@ Partial Class Inventarios_RecepcionUsados End If End Sub Private Sub BtnGenerarRNC_Click(sender As Object, e As EventArgs) Handles BtnGenerarRNC.Click - Guardar(True) + Guardar(True, RecargarPagina:=True) End Sub Protected Sub Guardar(Optional GenerarRNC As Boolean = False, Optional RecargarPagina As Boolean = False) If GvM.Rows.Count > 0 Then - Dim Msg As New StringBuilder() + Dim MsgError As New StringBuilder() + Dim Msg As New StringBuilder + Dim Resp As Modelos.Factura.MMensajeFactura = Nothing Dim ObjInventario As New ClsInventarios Dim ObjAcum As New ClsAcumuladores(ObjInventario.IniciaTransacSQL()) @@ -1255,9 +1267,7 @@ Partial Class Inventarios_RecepcionUsados Dim CveSubProyecto As Integer = -1 Dim ActivoFijo As Integer = -1 - If CveMovimiento > 0 Then - Else - + If Not CveMovimiento > 0 Then Dim Fecha As Date = String.Format("{0}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd")).ToDate Dim CveCliente As Integer = CInt(IIf((DdlClientes.SelectedValue.ToEntero <= 0), -1, DdlClientes.SelectedValue.ToEntero)) Dim CveClienteSucursal As Integer = CInt(IIf((DdlClientesSucursales.SelectedValue.ToEntero <= 0), -1, DdlClientesSucursales.SelectedValue.ToEntero)) @@ -1281,22 +1291,23 @@ Partial Class Inventarios_RecepcionUsados CargaDTDetalleRNC() Resp = ObjRemisionNC.EmitirFactura(False, ObjInventario.IniciaTransacSQL) - 'For Each mensaje2 As String In Resp.Mensajes - ' Msg.AppendFormat("
{0}", mensaje2) - 'Next - If Resp.TieneError Then ErrorMovInv = True - 'Alert(Msg.ToString, If(Resp.CveVenta > 0, TipoMensaje.MsgInformacion, TipoMensaje.MsgAdvertencia)) - CveVenta = Resp.CveVenta - If Resp.CveMovimientoUsado <= 0 Then - Msg.Append("Error al guardar los movimientos de usados") + If Resp.TieneError Then ErrorMovInv = True + + If Resp.CveVenta > 0 Then + CveVenta = Resp.CveVenta + Else + MsgError.Append("Error al generar la remisión de nota de crédito") ErrorMovInv = True End If + If Resp.CveMovimientoUsado <= 0 Then + MsgError.Append("Error al guardar los movimientos de usados") + ErrorMovInv = True + End If End If - Dim Mensaje As String = "" Dim FolioInv As String = "" If GenerarRNC Then @@ -1314,7 +1325,7 @@ Partial Class Inventarios_RecepcionUsados Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text, PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor, Modulo:="RU/G") If CveMovimiento <= 0 Then - Mensaje = "Error al guardar los movimientos" + MsgError.Append("Error al guardar los movimientos") ErrorMovInv = True Else FolioInv = ObjInventario.Folio.ToString() @@ -1322,14 +1333,14 @@ Partial Class Inventarios_RecepcionUsados For Each Dr As DataRow In DtMovimientos.Rows If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - Mensaje = "Error al guardar los movimientos" + MsgError.Append("Error al guardar los movimientos") ErrorMovInv = True Exit For End If If CveVenta > 0 AndAlso Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True, CveMovimiento) Then - Mensaje = "Error al actualizar el recibo de los usados" ErrorMovInv = True + MsgError.Append("Error al actualizar el recibo de los usados") Exit For End If @@ -1346,7 +1357,7 @@ Partial Class Inventarios_RecepcionUsados If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, Puntos, Cargo, Bonificacion, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, NowADS(), CveMovimiento:=CveMovimiento) Then - Mensaje = "Error al guardar Movimientos de distribuidor" + MsgError.Append("Error al guardar Movimientos de distribuidor") ErrorMovInv = True Exit For End If @@ -1354,24 +1365,10 @@ Partial Class Inventarios_RecepcionUsados End If Next - 'ACTUALIZA LA POLIZA VIRTUAL DEL LA REMISION - 'If Not ErrorMovInv AndAlso ObjFactura.TipoDocto = "Rem" Then - ' If ObjAcum.GetPolizasVirtuales(ObjFactura.CveVenta) Then - ' Dim DtPoliza As DataTable = ObjAcum.DtResultados.Copy() - ' For Each RowPoliza As DataRow In DtPoliza.Rows - ' If Not ObjAcum.UpdatePolizaVirtual(RowPoliza("CvePolizaVirtual").ToString().ToEntero, DdlMarcaRem.SelectedValue.ToEntero(), TxtFechaVigencia.Text.ToDateTime()) Then - ' Mensaje = "Error al guardar la póliza virtual" - ' ErrorMovInv = True - ' Exit For - ' End If - ' Next - - ' DtPoliza.Dispose() - ' Else - ' Mensaje = "Error al obtener la póliza virtual" - ' ErrorMovInv = True - ' End If - 'End If + If Not ErrorMovInv AndAlso ObjFactura.CveCliente <> CveCliente Then + ErrorMovInv = True + MsgError.Append("Error al asignar el cliente") + End If ''GENERA LA PREPOLIZA DE ALMACEN VS EL CONCEPTO DE RNC If Not ErrorMovInv Then @@ -1384,14 +1381,12 @@ Partial Class Inventarios_RecepcionUsados If Not ErrorMovInv Then + If Resp IsNot Nothing Then For Each mensaje2 As String In Resp.Mensajes Msg.AppendFormat("
{0}", mensaje2) Next End If - End If - - If Not ErrorMovInv Then Msg.AppendFormat("
El Movimiento se registro con el Folio: {0}", FolioInv, CveMovimiento) Msg.AppendFormat("

Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento))) @@ -1399,27 +1394,17 @@ Partial Class Inventarios_RecepcionUsados If IDPoliza > 0 Then Msg = Msg.AppendFormat("

Ver Póliza", IDPoliza) ObjInventario.Commit() ' aplica los movimientos insertados - - 'Limpia Valores cuando inserta de campos especiales - If UsuarioActual.CveEmpresa = 66 Then - DdlSubProyecto.SelectedValueExist("-1") - End If - - ' EnvioCorreo() - - CargaPendientesRecibir() - UPDatos.Update() - Else ObjInventario.RollBack() 'deshace lo insertado CveMovimiento = 0 - Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError) + MsgError.Append("Ocurrió un error al registrar.") + Alert(MsgError.ToString(), TipoMensaje.MsgError) End If End If Catch ex As Exception ObjInventario.RollBack() 'deshace lo insertado CveMovimiento = 0 - Alert("Ocurrió un Error inesperado en el registro" & ex.Message, TipoMensaje.MsgError) + Alert("Ocurrió un error inesperado en el registro" & ex.Message, TipoMensaje.MsgError) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") End Try @@ -1435,15 +1420,19 @@ Partial Class Inventarios_RecepcionUsados End If Alert(Msg.ToString, TipoMensaje.MsgInformacion, JSBtnAceptar:=Liga, ShowCloseButton:=False) - End If + If CveRemisionRecibida > 0 Then + CargaRemisionesPendientes() + UPDatos.Update() + End If + End If Else Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") End If LimpiarMovimiento() - CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' ")) + CargaGVM(DtMovimientos) End Sub @@ -1655,7 +1644,7 @@ Partial Class Inventarios_RecepcionUsados #End Region #Region " GVM " - Private Sub CargaGVM(DtTemp As DataTable) + Private Sub CargaGVM(ByRef DtTemp As DataTable) GvM.DataSource = DtTemp GvM.DataBind() @@ -2243,10 +2232,10 @@ Partial Class Inventarios_RecepcionUsados End Sub Protected Sub BtnConsultarPendientes_Click(sender As Object, e As EventArgs) - CargaPendientesRecibir() + CargaRemisionesPendientes() End Sub - Private Sub CargaPendientesRecibir() + Private Sub CargaRemisionesPendientes() Dim ObjVentas As New ClsVentas If ObjVentas.GetVentasUsados(-1, DdlSubProyectos.SelectedValue.ToEntero(), TxtFechaPendientes.Text.ToDateTime(), UsuarioActual.CveEmpresa, ServicioDomicilio:=ChkServicioDomicilio.Checked) Then GVPendientes.DataSource = ObjVentas.DtResultados @@ -2365,8 +2354,7 @@ Partial Class Inventarios_RecepcionUsados End If If DtUsados IsNot Nothing Then - - 'DivRecepcionApartado.Visible = True + AgregarUsado = True For Each RowUsado As DataRow In DtUsados.Rows Dim CvePS As Integer = RowUsado("CvePS").ToString().ToEntero() @@ -2382,8 +2370,9 @@ Partial Class Inventarios_RecepcionUsados Dim CveVentaDetalle As Integer = RowUsado("CveVentaDetalle").ToString().ToEntero() AddNew(CvePS, PS, CveUM, UM, Cantidad, PU, "", "-1", "-1", "-1", "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", CveTamaño, CveVentaDetalle:=CveVentaDetalle) - Next + + AgregarUsado = False End If Else Alert("No se pudo recibir la remisión", TipoMensaje.MsgAdvertencia) diff --git a/Nomina/RepFiniquito.aspx b/Nomina/RepFiniquito.aspx index 7fea45c34..fe01b8bad 100644 --- a/Nomina/RepFiniquito.aspx +++ b/Nomina/RepFiniquito.aspx @@ -91,7 +91,12 @@ - + + + + + + diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 13e26033c..3546aa177 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -3039,6 +3039,9 @@ Partial Class OS_OrdenesServicios Case 5 Opcion = 3 Exit Select + Case 6 + Opcion = 4 + Exit Select Case Else Opcion = 1 Exit Select diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index ab7cca780..5d866cce3 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -94,69 +94,62 @@ <%-- Filtro Visible - Consulta --%>
- +
-
- <%-- Fecha Inicial --%> - -
-
- - - - -
- - - +
+ +
+ Fecha Inicio: +
+
+
+ + + + +
+ + + + + + +
+
+ Fecha Fin: + +
+
+
+ + + + +
+ + + + + + +
+ + +
+ +
+ +
+ + +
+
- <%-- Fecha Final --%> - -
-
- - - - -
- - - -
- <%-- Cliente --%> - -
- -
- <%-- Estatus --%> - -
- - -
-
+
<%-- Filtro Oculto --%> @@ -256,16 +249,14 @@ - + - - + @@ -362,8 +353,8 @@
+ DataTextField="TipoActivoFijo" Class="form-control input-inline" + Width="100%" runat="server" Enabled="false">
@@ -375,13 +366,7 @@ - - - - +
@@ -391,29 +376,16 @@ - - - - + -
- - - - +
diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index 265a14ee4..cbd2ceb86 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -28,41 +28,31 @@ Partial Class RepContratosCalendario End Property #End Region - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - txtFechaI.Text = DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy").Replace(" ", "T") - txtFechaF.Text = DateTime.Now.AddDays(7).ToString("MM/dd/yyyy").Replace(" ", "T") + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString + txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString If Not IsPostBack Then InicializaCombos() InicializaCalendar() CargaDatos() - End If InicializaCalendar() End Sub Private Sub CargaDatos() Dim ObjContratos As New ClsContratos - GvContratos.HeaderStyle.ForeColor = Drawing.Color.Black + ' GvContratos.HeaderStyle.ForeColor = Drawing.Color.Black + Dim CveCliente As Integer = DdlClientesFiltro.SelectedValue.ToEntero + If CveCliente = 0 Then CveCliente = -1 - If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=34) Then + If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientesFiltro.SelectedValue.ToEntero, CveEstatus:=DdlEstatusConsulta.SelectedValue.ToEntero, CveTipoContrato:=34) Then GvContratos.DataSource = ObjContratos.DtResultados GvContratos.DataBind() End If DtAvance = ObjContratos.DtResultados - If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then - DdlEstatus.DataSource = ObjContratos.DtResultados - DdlEstatus.DataBind() - DdlEstatus.Items.Insert(0, New ListItem("-", "")) - - DdlEstatusContrato.DataSource = ObjContratos.DtResultados - DdlEstatusContrato.DataBind() - DdlEstatusContrato.Items.Insert(0, New ListItem("-", "")) - - End If - ObjContratos.Dispose() End Sub Private Sub InicializaCalendar() @@ -92,9 +82,26 @@ Partial Class RepContratosCalendario DdlChofer2.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlChofer2.DataBind() DdlChofer2.Items.Insert(0, New ListItem("-", "")) - DdlChoferConsulta.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) - DdlChoferConsulta.DataBind() - DdlChoferConsulta.Items.Insert(0, New ListItem("-", "")) + + DdlChoferFiltro.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltraParametros("", "NombreCompleto") + DdlChoferFiltro.DataBind() + DdlChoferFiltro.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlTipoUnidad.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("MedidaVehicularClave IN (2,3)") + DdlTipoUnidad.DataBind() + DdlTipoUnidad.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlEstatusConsulta.DataSource = GlobalDTContratosEstatus(UsuarioActual.CveEmpresa) + DdlEstatusConsulta.DataBind() + DdlEstatusConsulta.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlEstatusContrato.DataSource = GlobalDTContratosEstatus(UsuarioActual.CveEmpresa) + DdlEstatusContrato.DataBind() + DdlEstatusContrato.Items.Insert(0, New ListItem("-", "")) + + + + CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto) End Sub @@ -133,21 +140,20 @@ Partial Class RepContratosCalendario TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato") TxtObservaciones.Text = GvRow.DataKey("Observaciones") TxtUbicacion.Text = GvRow.DataKey("Ubicacion") - TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy hh:mm:ss tt") - TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm:ss tt") + TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy hh:mm tt") + TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm tt") 'Requeridos ViewState("Contrato") = GvRow.DataKey("CveContrato") DdlAF.SelectedValue = GvRow.DataKey("CveAF") - DdlChofer.SelectedValue = GvRow.DataKey("CveChofer") - DdlChofer2.SelectedValue = GvRow.DataKey("CveChofer2") + DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer")) + DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2")) DdlEstatusContrato.SelectedValue = GvRow.DataKey("CveContratosEstatus") UpModal.Update() RegistraScript("$('#ModalActualizar').modal('show');") End Sub - Protected Sub Consultar(sender As Object, e As EventArgs) - End Sub + Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString) End Sub @@ -172,4 +178,5 @@ Partial Class RepContratosCalendario Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) End If End Sub + End Class diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 599476524..58c50a68d 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -615,6 +615,22 @@ Partial Class Ventas_ClientesAbonar Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click + If ChkComplementoPago.Checked Then + Dim objGral As New ClsGralFolios + Dim SalirDeMetodo As Boolean = False + If objGral.GetFolios("CP", UsuarioActual.CveEmpresa) Then + If Not objGral.DtResultados.Rows.Count > 0 Then + Alert("No se cuenta con folios para emitir complemento de pago", TipoMensaje.MsgAdvertencia) + SalirDeMetodo = True + End If + End If + objGral.Dispose() + If SalirDeMetodo Then + Exit Sub + End If + End If + + 'SI ES EMPRESA DE ACUMULADORES DEBE OBLIGAR A SUBIR UN ARCHIVO If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then Dim files As Extensiones.Files = Anexo.getfiles() diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index a0ee834f0..4b87baa9e 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -3503,6 +3503,7 @@ Partial Class ProductosyServicios DVNomQuimico.Visible = True DVNumCAS.Visible = True ElseIf DdlClaveSectorCOFEPRIS.SelectedValue.ToEntero = 5 Then ' 5 - Plaguicidas y fertilizantes + DVNombreIngredienteActivo.Visible = True DVNumRegistroPlagCOFEPRIS.Visible = True DVDatosFabricante.Visible = True DVDatosFormulador.Visible = True @@ -3534,21 +3535,21 @@ Partial Class ProductosyServicios CamposStringCCP = CamposStringCCP + TxtDatosMaquilador.Text.Trim() CamposStringCCP = CamposStringCCP + TxtUsoAutorizado.Text.Trim() - If CamposStringCCP.Length > 0 And (DdlMaterialPeligroso.SelectedValue.ToEntero <= 0 Or DdlEmbalaje.SelectedValue.ToEntero <= 0 Or TxtPesoKg.Text = "") Then - Alert("Para guardar los datos de carta porte los campos Material Peligroso, Embalaje, Peso en Kg son requeridos", TipoMensaje.MsgAdvertencia) - Respuesta = False - Else + 'If CamposStringCCP.Length > 0 And (DdlMaterialPeligroso.SelectedValue.ToEntero <= 0 Or DdlEmbalaje.SelectedValue.ToEntero <= 0 Or TxtPesoKg.Text = "") Then + ' Alert("Para guardar los datos de carta porte los campos Material Peligroso, Embalaje, Peso en Kg son requeridos", TipoMensaje.MsgAdvertencia) + ' Respuesta = False + 'Else - 'If DdlMaterialPeligroso.SelectedValue.ToEntero > 0 And DdlEmbalaje.SelectedValue.ToEntero > 0 And DdlClaveSectorCOFEPRIS.SelectedValue.ToEntero > 0 And CamposStringCCP.Length > 0 Then - Dim ObjPS As New ClsProductosServicios(transaccionSQL) + 'If DdlMaterialPeligroso.SelectedValue.ToEntero > 0 And DdlEmbalaje.SelectedValue.ToEntero > 0 And DdlClaveSectorCOFEPRIS.SelectedValue.ToEntero > 0 And CamposStringCCP.Length > 0 Then + Dim ObjPS As New ClsProductosServicios(transaccionSQL) If Not ObjPS.AddUpdateProductosServiciosComplementos(CvePS, TxtPesoKg.Text.ToDecimal, DdlMaterialPeligroso.SelectedValue.ToEntero, DdlEmbalaje.SelectedValue.ToEntero, TxtDimensiones.Text, DdlClaveSectorCOFEPRIS.SelectedValue.ToEntero, TxtNombreIngredienteActivo.Text.Trim, TxtNomQuimico.Text.Trim, TxtDenominacionGenerica.Text.Trim, TxtDenominacionDistintiva.Text.Trim, TxtFabricante.Text.Trim, DdlClaveFormaFarmaceutica.SelectedValue.ToEntero, DdlCondicionesEspTransporte.SelectedValue.ToEntero, TxtRegistroSanitarioAutorizacion.Text.Trim, TxtPermisoImportacion.Text.Trim, TxtFolioImportacionVUCEM.Text.Trim, TxtNumCAS.Text.Trim, TxtRazonSocialEmpImportacion.Text, TxtNumRegistroPlagCOFEPRIS.Text.Trim, TxtDatosFabricante.Text.Trim, TxtDatosFormulador.Text.Trim, TxtDatosMaquilador.Text.Trim, TxtUsoAutorizado.Text, DdlTipoMateria.SelectedValue.ToEntero) Then Respuesta = False End If - ' End If - End If + ' End If + 'End If Return Respuesta diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 8d2ce4861..4adeb74f4 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -7029,7 +7029,6 @@
-