diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 5b6c87d55..c56dffb17 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -4,7 +4,6 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient Imports Extensiones -Imports Profact.TimbraCFDI40 Public Class ClsContratos Implements IDisposable @@ -323,7 +322,7 @@ Public Class ClsContratos Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo 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 ObservacionesGenerales As String = "", - Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveAF As Integer = -1) As Integer + Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveAF As Integer = -1, Optional CantidadPasajeros As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Con_ContratosAdd") @@ -382,6 +381,7 @@ Public Class ClsContratos .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF .Add("@CveChofer", SqlDbType.Int).Value = CveChofer .Add("@CveAF", SqlDbType.Int).Value = CveAF + .Add("@CantidadPasajeros", SqlDbType.Int).Value = CantidadPasajeros End With diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 3e736c02e..2e6ca0934 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -497,7 +497,7 @@ Public Class ClsOS Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, - Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean + Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet") @@ -514,6 +514,8 @@ Public Class ClsOS .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveMedico", SqlDbType.Int).Value = CveMedico .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento + .Add("@CveEspecialidad", SqlDbType.Int).Value = CveEspecialidad + .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal End With diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c0ad45639..365eecdb7 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10812,6 +10812,7 @@ Public Class ClsPaginas #Region "Transportes" PaginaDict.Add("/Transportes/RepContratos.aspx".ToUpper(), 598) + PaginaDict.Add("/Transportes/RepContratosDetalles.aspx".ToUpper(), 598) PaginaDict.Add("/Transportes/RepViajes.aspx".ToUpper(), 599) PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 600) PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 601) diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 344297e94..84be4f7ec 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -457,8 +457,6 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState For Each dr As DataRow In ObjContratos.DtResultados.Rows Dim cevent As CalendarEvent = New CalendarEvent() - Dim estatus As Integer = dr("EstatusContrato").ToString.ToEntero - cevent.id = dr("CveContrato").ToString.ToEntero cevent.title = dr("DescripcionContrato").ToString cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime) @@ -471,15 +469,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.Pesos = dr("ImporteMax").ToString.ToDecimal cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero + cevent.backgroundColor = dr("BackgroundColor").ToString - Select Case estatus - Case 1 - cevent.backgroundColor = "#00A56A" - Case 2 - cevent.backgroundColor = "#2B4FD6" - Case 3 - cevent.backgroundColor = "#EE602E" - End Select diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx index 2e7da80a0..938ca01b6 100644 --- a/Ashx/E119.ashx +++ b/Ashx/E119.ashx @@ -368,7 +368,6 @@ Public Class E119 : Implements IHttpHandler Return JsonConvert.SerializeObject(RespuestaError) End If - If Not TieneError Then Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa) Dim ObjFactura As Modelos.Factura = Nothing @@ -399,7 +398,7 @@ Public Class E119 : Implements IHttpHandler If objVenta.GetVentaTerminal(IdEcommerce, MinFecha, CveSubProyecto, CveEmpresa) Then Dim dr As DataRow = objVenta.DtResultados.FiltroPrimero("") If dr IsNot Nothing Then - MsgLog.AppendLine("0.10 remisión registrada previamente") + Dim data As New JArray Dim objSucursal As New JObject( New JProperty("Cve", dr("CveVenta")), @@ -408,6 +407,8 @@ Public Class E119 : Implements IHttpHandler data.Add(objSucursal) Respuesta.status = "success" Respuesta.data = data + Respuesta.message = "Folio registrado previamente." + MsgLog.AppendLine("Folio registrado previamente.") Registrada = True End If End If @@ -434,7 +435,6 @@ Public Class E119 : Implements IHttpHandler If Not TieneError Then - 'BUSCAR SI ESTÁ REGISTRADO EL CLIENTE If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then If ObjClientes.DtResultados.Rows.Count > 0 Then @@ -445,7 +445,6 @@ Public Class E119 : Implements IHttpHandler End If MsgLog.AppendLine("1.4 verificar cliente.") - If CveCliente = 0 Then ' 'DATOS DE BILLING MsgLog.AppendLine("1.5 crear cliente") diff --git a/Empresas/153/Formatos/Factura.rdlc b/Empresas/153/Formatos/Factura.rdlc index 6ccaafaed..ad404844f 100644 --- a/Empresas/153/Formatos/Factura.rdlc +++ b/Empresas/153/Formatos/Factura.rdlc @@ -2661,94 +2661,6 @@ 2pt - - true - true - - - - - Sucursal Tijuana - - - - - - - - - Beneficiario: ELECTRICA SERVEC S DE RL DE CV - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - Embedded RFIRMAELECTRONICAEDITABLE @@ -2757,7 +2669,7 @@ 0.51012cm 1.73059cm 3.63914cm - 21 + 20 @@ -2771,7 +2683,7 @@ - Cuentas Bancarias + Cuenta Bancaria @@ -3236,7 +3148,7 @@ 0.15747cm 2.0799cm 20.85172cm - 23 + 22 =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) @@ -3277,7 +3189,7 @@ 16.84664cm 0.49387cm 4.14557cm - 24 + 23 diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index 3130410a4..7a0cf1acd 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -3,7 +3,7 @@ - --%> + + Entrega Almacén (Surtir Mercancia) @@ -472,145 +481,174 @@ - - -
-
-
- - Salida de Inventario -
-
-
-
-
-
- -
-
-
+
+
- <%--AGREGAR POR CODIGO DE BARRAS--%> - - -
+ + -
-
- -
-
-
- - - - - - -
- - - - - - - -
+
+
+
+ + Salida de Inventario +
+
+
- - +
+ +
+
+
+ <%--AGREGAR POR CODIGO DE BARRAS--%> + + +
- <%--GV DATOS--%> - - - - - - - - - - - - - - - - - - - -<%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - +
+
+ +
+
+
+ + + + + + +
+ + + + + + + +
+
-
-
- - - - - - -
-
- -
-
- - - + + - <%--BOTON GUARDAR--%> - - -
- -
-
- -
-
-
+ + + <%--GV DATOS--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%--8--%> + + + + + + + + <%--9--%> + + + + + + + + +
+ + + + + + + + + + +
+ +
+
+ + + + + + +
+
+ + + + +
+
+ +
+
+ + +
+ +
+ <%--BOTON GUARDAR--%> + + +
+ +
+
+ +
+
+
+
+
+ <%--AGREGA POR SERIE--%> @@ -702,8 +740,6 @@
- -
+
-
Serie
-
- - - + +
+
+ + + +
+
+ +
+
+ + + +
-
+ +
+ +
+ + + +
+ + + + +
+ + + + + + + + +
+ + <%--
+ + +
+ + + + +
+ + + + + + + + +
--%> + + +
+ + +
+ +
+
- + - - + + + + diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 3c43cfe9d..4e1ff1e29 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -2,6 +2,7 @@ Option Strict On Imports System.Data +Imports System.IO.Packaging Imports Extensiones Partial Class Inventarios_PaquetesArmadoDesarmado Inherits ClsPaginas @@ -89,12 +90,32 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End Set End Property - Private Property AplicaSerie As Boolean + Private Property AplicaLotePaquete As Boolean Get - Return CType(ViewState("AplicaSerie"), Boolean) + Return CType(ViewState("AplicaLotePaquete"), Boolean) End Get Set(value As Boolean) - ViewState("AplicaSerie") = value + ViewState("AplicaLotePaquete") = value + End Set + End Property + + + Private Property AplicaCaducidadPaquete As Boolean + Get + Return CType(ViewState("AplicaCaducidadPaquete"), Boolean) + End Get + Set(value As Boolean) + ViewState("AplicaCaducidadPaquete") = value + End Set + End Property + + + Private Property AplicaSeriePaquete As Boolean + Get + Return CType(ViewState("AplicaSeriePaquete"), Boolean) + End Get + Set(value As Boolean) + ViewState("AplicaSeriePaquete") = value End Set End Property @@ -245,6 +266,12 @@ Partial Class Inventarios_PaquetesArmadoDesarmado #Region " PROCESAR - VERIFICAR EXISTENCIAS " Protected Sub BtnVerificarExistenciasArmado_Click(sender As Object, e As EventArgs) + + + AplicaSeriePaquete = False + AplicaLotePaquete = False + AplicaCaducidadPaquete = False + TipoMovimiento = 1 Limpia(TipoMovimiento) @@ -289,24 +316,43 @@ Partial Class Inventarios_PaquetesArmadoDesarmado If ErrorExistencias Then Alert(TextoExistencias, TipoMensaje.MsgAdvertencia) Else - AplicaSerie = CBool(drP("AplicaSerie")) + AplicaSeriePaquete = CBool(drP("AplicaSerie")) + AplicaLotePaquete = CBool(drP("AplicaLote")) + AplicaCaducidadPaquete = CBool(drP("AplicaCaducidad")) BtnGuadarArmado.Visible = True End If - If AplicaSerie Then + + + + If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then DivSeriesPaqueteArmado.Visible = True Dim Dt As New DataTable Dt.Columns.Add("Row", GetType(Integer)) Dt.Columns.Add("Serie", GetType(String)) + Dt.Columns.Add("Lote", GetType(String)) + Dt.Columns.Add("FechaCaducidad", GetType(Date)) + For index = 1 To TxtCantidadArmado.Text.ToEntero Dim Row = Dt.NewRow Row("Row") = index Row("Serie") = "" + Row("Lote") = "" + Row("FechaCaducidad") = MinFecha Dt.Rows.Add(Row) Next + + GvSeriesPaqueteArmado.Columns(1).Visible = AplicaSeriePaquete + GvSeriesPaqueteArmado.Columns(2).Visible = AplicaLotePaquete + GvSeriesPaqueteArmado.Columns(3).Visible = AplicaCaducidadPaquete + GvSeriesPaqueteArmado.DataSource = Dt GvSeriesPaqueteArmado.DataBind() + End If + + + UpSeriesPaqueteArmado.Update() CvePaqueteArmado = DdlPaqueteArmado.SelectedValue.ToEntero @@ -328,10 +374,16 @@ Partial Class Inventarios_PaquetesArmadoDesarmado UpGeneralesArmado.Update() End Sub Protected Sub BtnVerificarExistenciasDesarmado_Click(sender As Object, e As EventArgs) + + + DvDesArmadoCaducidad.Visible = False + DvDesArmadoLote.Visible = False + DvDesArmadoSerie.Visible = False + DtDatosDetalle.Clear() BtnGuadarDesarmado.Visible = False TotalDesarmado.Visible = False - AplicaSerie = False + AplicaSeriePaquete = False TxtSerieDesarmado.Text = "" CvePaqueteDesarmado = -1 TipoMovimiento = 2 @@ -362,7 +414,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Alert($"No hay existencia suficiente del paquete ""{DdlPaqueteDesarmado.SelectedItem.Text}"" para desarmar. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia) Exit Sub Else - AplicaSerie = CBool(drP("AplicaSerie")) + AplicaSeriePaquete = CBool(drP("AplicaSerie")) + AplicaLotePaquete = CBool(drP("AplicaLote")) + AplicaCaducidadPaquete = CBool(drP("AplicaCaducidad")) End If @@ -391,13 +445,23 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Next End If - If AplicaSerie Then + If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then + + DvDesArmadoCaducidad.Visible = AplicaSeriePaquete + DvDesArmadoLote.Visible = AplicaLotePaquete + DvDesArmadoSerie.Visible = AplicaCaducidadPaquete + + GvSeriesPaqueteDesarmado.Columns(1).Visible = AplicaSeriePaquete + GvSeriesPaqueteDesarmado.Columns(2).Visible = AplicaLotePaquete + GvSeriesPaqueteDesarmado.Columns(3).Visible = AplicaCaducidadPaquete DivSeriesPaqueteDesarmado.Visible = True CreaDtSeriesDesarmado() DtSeriesDesarmado.Clear() + GvSeriesPaqueteDesarmado.DataSource = DtSeriesDesarmado GvSeriesPaqueteDesarmado.DataBind() + End If UpSeriesPaqueteDesarmado.Update() @@ -454,42 +518,118 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Case 1 ' ARMADO For Each gvr As GridViewRow In GvDatosArmado.Rows If gvr.DataKey("AplicaSerie") = "True" Then - If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then - Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) + + ''If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then + '' Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) + '' Exit Sub + ''End If + 'If gvr.FCTextBox("TxtSerie") Then + + 'End If + + 'If gvr.FCTextBox("TxtSerie").Text.Trim = "" Then + ' Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If + + End If + + If gvr.DataKey("AplicaLote") = "True" Then + If gvr.FCTextBox("TxtLote").Text.Trim = "" Then + Alert("Es necesario ingresas todos los lotes de los componentes.", TipoMensaje.MsgAdvertencia) Exit Sub End If End If + + If gvr.DataKey("AplicaCaducidad") = "True" Then + + If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then + Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + End If + Next Case 2 ' DESARMADO For Each gvr As GridViewRow In GvDatosDesarmado.Rows + If gvr.DataKey("AplicaSerie") = "True" Then - If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then + + 'If gvr.DataKey("AplicaSerie") = "True" Then + ' 'If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then + ' ' Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) + ' ' Exit Sub + ' 'End If + 'End If + + If gvr.FCTextBox("Serie").Text.Trim = "" Then Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) Exit Sub End If + End If + + If gvr.DataKey("AplicaLote") = "True" Then + If gvr.FCTextBox("TxtLote").Text.Trim = "" Then + Alert("Es necesario ingresas todos los lotes de los componentes.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + + If gvr.DataKey("AplicaCaducidad") = "True" Then + + If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then + Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + End If + + Next End Select 'VALIDA SI EL PAQUETE ES DE SERIE QUE SE INGRESEN TODAS LAS SERIES (CANTIDAD) - If AplicaSerie Then + If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then Select Case (Tipo) Case 1 ' ARMADO For Each gvr As GridViewRow In GvSeriesPaqueteArmado.Rows - If gvr.FCTextBox("TxtSerie").Text.Trim = "" Then - Alert("Es necesario indicar las series del paquete a armar.", TipoMensaje.MsgAdvertencia) - Exit Sub + + If AplicaSeriePaquete Then + If gvr.FCTextBox("TxtSerie").Text.Trim = "" Then + Alert("Es necesario indicar las series del paquete a armar.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If End If + + If AplicaLotePaquete Then + If gvr.FCTextBox("TxtLote").Text.Trim = "" Then + Alert("Es necesario indicar los lotes del paquete a armar.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + + If AplicaCaducidadPaquete Then + If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then + Alert("Es necesario indicar fechas de caducidad validas del paquete a armar.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + Next Case 2 ' DESARMADO + If TxtCantidadDesarmado.Text.ToEntero <> DtSeriesDesarmado.Rows.Count Then - Alert("Es necesario indicar las series del paquete a desarmar.", TipoMensaje.MsgAdvertencia) + Alert("Es necesario indicar las series, lotes o Fecha de caducidad del paquete a desarmar.", TipoMensaje.MsgAdvertencia) Exit Sub End If + End Select End If + Dim TextoError As New StringBuilder If Tipo = 1 Then Dim ObjInventarioVal As New ClsInventarios @@ -572,7 +712,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If - Exit Sub + Dim ObjInventario As New ClsInventarios @@ -669,12 +809,17 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If - If AplicaSerie Then + If AplicaSeriePaquete Then Dim ContadorPaquete = 1 Dim DtSeriesComponentes As New DataTable For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows 'AGREGA MOVTO DETALLE DE LA ENTRADA DEL PAQUETE - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then + + Dim Serie As String = Gvr.FCTextBox("TxtSerie").Text.Trim + Dim Lote As String = Gvr.FCTextBox("TxtLote").Text.Trim + Dim FechaCaducidad As Date = If(Gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha, MinFecha, Gvr.FCTextBox("TxtCaducidad").Text.ToDate) + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada" Exit For @@ -736,10 +881,17 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'If AplicaSeccion Then ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero 'End If - If AplicaSerie Then + If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then + + For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows + + Dim Serie As String = If(AplicaSeriePaquete, Gvr.DataKey("Serie").Trim, "-1") + Dim Lote As String = If(AplicaLotePaquete, Gvr.DataKey("Lote").Trim, "-1") + Dim FechaCaducidad As Date = If(AplicaCaducidadPaquete, Gvr.DataKey("FechaCaducidad").Trim.ToDate, MinFecha) + 'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Gvr.DataKey("Serie").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida" Exit For @@ -751,6 +903,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida" Exit For End If + Next Else If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtCantidadDesarmado.Text.ToDecimal, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen) Then @@ -878,7 +1031,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Private Sub Limpia(Tipo As Integer) DtDatosDetalle.Clear() - AplicaSerie = False + AplicaSeriePaquete = False 'If Tipo = 1 Then @@ -1441,6 +1594,11 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dt.Columns.Add("Row", GetType(Integer)) Dt.Columns.Add("Serie", GetType(String)) + 'Dim DrPS As DataRow = Nothing + 'DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=_DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimero("") + 'Dim AplicaSerie + + For Each Row As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CType(sender, LinkButton).CommandArgument.ToEntero)).Rows If i > TxtCantidadArmado.Text.ToEntero Then Exit For @@ -1456,6 +1614,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvSeriesPaqueteArmado.DataSource = Dt GvSeriesPaqueteArmado.DataBind() + + + UpSeriesPaqueteArmado.Update() End Sub @@ -1465,15 +1626,23 @@ Partial Class Inventarios_PaquetesArmadoDesarmado DtSeriesDesarmado = New DataTable DtSeriesDesarmado.Columns.Add("Row", GetType(Integer)) DtSeriesDesarmado.Columns.Add("Serie", GetType(String)) + DtSeriesDesarmado.Columns.Add("Lote", GetType(String)) + DtSeriesDesarmado.Columns.Add("FechaCaducidad", GetType(Date)) + + + End If End Sub Protected Sub BtnAgregarSerieDesarmado_Click(sender As Object, e As EventArgs) - Dim Serie = TxtSerieDesarmado.Text.Trim + Dim Serie As String = If(AplicaSeriePaquete, TxtSerieDesarmado.Text.Trim, "-1") + Dim Lote As String = If(AplicaLotePaquete, TxtLoteDesarmado.Text.Trim, "-1") + Dim FechaCaducidad As Date = If(AplicaCaducidadPaquete, TxtDesarmadoCaducidad.Text.ToDate, MinFecha) 'VERIFICA EXISTENCIAS Dim ObjInventarios As New ClsInventarios Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimeroValor("CveUM").ToEntero - Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) + Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, + CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Lote:=Lote, FechaCaducidad:=FechaCaducidad) If Existencia < 1 Then Alert($"No hay existencia suficiente con la Serie definida ""{Serie}"". Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia) @@ -1495,9 +1664,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dim Row = DtSeriesDesarmado.NewRow Row("Row") = DtSeriesDesarmado.MAX("Row").ToEntero + 1 Row("Serie") = TxtSerieDesarmado.Text.Trim + Row("Lote") = TxtLoteDesarmado.Text.Trim + Row("FechaCaducidad") = TxtDesarmadoCaducidad.Text.ToDate + DtSeriesDesarmado.Rows.Add(Row) TxtSerieDesarmado.Text = "" + TxtLoteDesarmado.Text = "" + TxtDesarmadoCaducidad.Text = "" + If DtSeriesDesarmado.Rows.Count >= TxtCantidadDesarmado.Text.ToEntero Then BtnAgregarSerieDesarmado.Enabled = False diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 2bb004a3f..7ef7653f2 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -3330,7 +3330,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveConceptoContableCostoME As Integer = -1 Dim CveConceptoContableCostoComplementaria As Integer = -1 Dim UsaComplementariaFleteImportaciones As Boolean = True - If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False + If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementariaFleteImportaciones = False If DtCostos.Rows.Count > 0 Then If CveCompraSurtir > 0 Then diff --git a/OS/RepOSMedicas.aspx b/OS/RepOSMedicas.aspx index 621e7e27c..12630f200 100644 --- a/OS/RepOSMedicas.aspx +++ b/OS/RepOSMedicas.aspx @@ -98,7 +98,7 @@
-
@@ -109,11 +109,11 @@
diff --git a/OS/RepOSMedicas.aspx.vb b/OS/RepOSMedicas.aspx.vb index a231dbf39..830315c54 100644 --- a/OS/RepOSMedicas.aspx.vb +++ b/OS/RepOSMedicas.aspx.vb @@ -80,6 +80,48 @@ Partial Class OS_RepOSMedicas DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlProcedimiento.DataBind() + + + Dim ObjVentas As New ClsVentas + + If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then + DdlEspecialidad.DataSource = ObjVentas.DtResultados + Else + DdlEspecialidad.DataSource = Nothing + End If + + ObjVentas.Dispose() + + DdlEspecialidad.DataBind() + DdlEspecialidad.Items.Insert(0, New ListItem("Todas", "-1")) + + + Dim objcliente As New ClsClientes + + If objcliente.GetClienteSucursales(-1, UsuarioActual.CveEmpresa) Then + DdlClienteSucursal.DataSource = objcliente.DtResultados + Else + DdlClienteSucursal.DataSource = Nothing + End If + + objcliente.Dispose() + + DdlClienteSucursal.DataBind() + DdlClienteSucursal.Items.Insert(0, New ListItem("Todos", "-1")) + + + + 'Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + 'If EsWS Then + ' DdlCliente.setEsWebService(True) + + 'Else + ' DdlCliente.setEsWebService(False) + ' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + ' DdlCliente.DataBind() + ' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + 'End If + End Sub @@ -101,7 +143,8 @@ Partial Class OS_RepOSMedicas LnkPersonalizar.Visible = False If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, - CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then + CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero, + CveClienteSucursal:=DdlClienteSucursal.SelectedValue.ToEntero) Then GvDatos.DataSource = ObjOS.DtResultados If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then LnkPersonalizar.Visible = True diff --git a/Transportes/RepContratos - Copy.aspx b/Transportes/RepContratos - Copy.aspx new file mode 100644 index 000000000..b89700e5b --- /dev/null +++ b/Transportes/RepContratos - Copy.aspx @@ -0,0 +1,361 @@ +<%@ Page Language="VB" AutoEventWireup="true" Title="Transportes V&A - Contratos" + MasterPageFile="~/Site.master" + CodeFile="RepContratos - Copy.aspx.vb" + Inherits="ListadoContratos" %> + + + Listado de Contratos + + + + + + + + + +
  • + Agregar Contrato +
  • +
  • + Generar Excel +
  • +
    + + + +
    +
    + + + + +
    +
    + + + + +
    + +
    + + + + +
    + +
    + + +
    + +
    + +
    + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + Fecha
    + Salida +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + + Fecha
    + Regreso +
    + + + +
    + + + + + + + +
    +
    +
    +
    + + + +
    + + diff --git a/Transportes/RepContratos - Copy.aspx.vb b/Transportes/RepContratos - Copy.aspx.vb new file mode 100644 index 000000000..57ecfc736 --- /dev/null +++ b/Transportes/RepContratos - Copy.aspx.vb @@ -0,0 +1,159 @@ +Option Explicit On +Option Strict On +Imports System.Data.SqlClient +Imports Extensiones +Imports Extensiones.ModExtensiones + +Partial Class ListadoContratos + Inherits ClsPaginas + + Private Property CveContrato As Integer + Get + Return ViewState("CveContrato").ToString().ToEntero + End Get + Set(value As Integer) + ViewState("CveContrato") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.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") + + If Not IsPostBack Then + ViewState("CveContrato") = 0 + InicializaCombos() + CargaDatos() + End If + End Sub + Private Sub InicializaCombos() + 'Lista Tipo AF + DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa) + DdlTipoAF.DataBind() + DdlTipoAF.Items.Insert(0, New ListItem("-", "")) + 'Lista Chofer' + DdlChofer.DataSource = GlobalDTRHPersonal(185) + DdlChofer.DataBind() + DdlChofer.Items.Insert(0, New ListItem("-", "")) + UpModal.Update() + End Sub + Private Sub CargaDatos() + Dim ObjContratos As New ClsContratos + If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then + GvContratos.DataSource = ObjContratos.DtResultados + GvContratos.DataBind() + End If + If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then + DdlEstatusConsulta.DataSource = ObjContratos.DtResultados + DdlEstatusConsulta.DataBind() + DdlEstatusConsulta.Items.Insert(0, New ListItem("-", "")) + + End If + UpTitulos.Update() + + End Sub + Protected Sub MostrarModal(Optional Descripcion As String = "", Optional FechaSalida As String = "", Optional FechaRegreso As String = "", Optional Observaciones As String = "", Optional Ubicacion As String = "", Optional Transporte As String = "", Optional CveCliente As Integer = 0, Optional Dolares As String = "", Optional Pesos As String = "", Optional Anticipo As String = "", Optional Boton As String = "Guardar", Optional Chofer As String = "") + + 'DdlClientes.SelectedText = Cliente + TxtDescripcion.Text = Descripcion + TxtUbicacion.Text = Ubicacion + TxtFechaSalida.Text = FechaSalida + TxtFechaRegreso.Text = FechaRegreso + TxtObservaciones.Text = Observaciones + TxtUbicacion.Text = Ubicacion + DdlTipoAF.SelectedValue = Transporte + DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial") + DdlClientes.SelectedValue = CveCliente.ToString + DdlChofer.SelectedValue = Chofer + TxtObservaciones.Text = Observaciones + TxtDolares.Text = Math.Round(Dolares.ToDecimal, 2).ToString + TxtPesos.Text = Math.Round(Pesos.ToDecimal, 2).ToString + TxtAnticipo.Text = Math.Round(Anticipo.ToDecimal * 100, 2).ToString + BtnGuardar.Text = Boton + myModalLabel.InnerHtml = $"{Boton} Contrato" + UpModal.Update() + RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) + End Sub + Private Sub LBAgregarContrato_Click(sender As Object, e As EventArgs) Handles LBAgregarContrato.Click + MostrarModal() + End Sub + Protected Sub AddContrato(sender As Object, e As EventArgs) + + If DdlClientes.SelectedValue = "" Then + Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim ObjContratos As New ClsContratos + ObjContratos.IniciaTransacSQL() + + + 'Agregar contrato + If BtnGuardar.Text = "Guardar" Then + If ObjContratos.AddContratos("", TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) > 0 Then + ObjContratos.Commit() + Alert("Agregado Correctamente.") + End If + End If + + 'Actualizar contrato + If BtnGuardar.Text = "Editar" Then + If ObjContratos.UpdateContratos(CveContrato, "", TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero) Then + + ObjContratos.Commit() + Alert("Actualizado Correctamente.") + End If + End If + + TxtDescripcion.Text = "" + TxtFechaSalida.Text = "" + TxtFechaRegreso.Text = "" + TxtObservaciones.Text = "" + TxtUbicacion.Text = "" + DdlClientes.SelectedText = "" + DdlTipoAF.SelectedValue = "" + DdlChofer.SelectedValue = "" + TxtDolares.Text = "" + TxtPesos.Text = "" + TxtAnticipo.Text = "" + BtnGuardar.Text = "Guardar" + + ObjContratos.Dispose() + CargaDatos() + + End Sub + + Protected Sub LBExcel_Click(sender As Object, e As EventArgs) Handles LBExcel.Click + GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString) + End Sub + + Protected Sub Consultar(sender As Object, e As EventArgs) + Dim fechaInicial As String = txtFechaI.Text + Dim fechaFinal As String = txtFechaF.Text + + Dim cliente As String = If(DdlClientesConsulta.SelectedValue = "", "", $"C.CveCliente = {DdlClientesConsulta.SelectedValue} AND") + Dim estatus As String = "" + Dim nombreEstatus As String = "" + Dim innerEstatus As String = "" + If (DdlEstatusConsulta.SelectedValue <> "") Then + estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND" + nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1" + innerEstatus = "INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus +" + End If + Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'") + + + Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial {nombreEstatus} FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente {innerEstatus} WHERE {cliente} {estatus} {intervalo}" + + Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString) + Using command As New SqlCommand(query, connection) + connection.Open() + Dim reader As SqlDataReader = command.ExecuteReader() + GvContratos.DataSource = reader + GvContratos.DataBind() + End Using + End Using + + UpTitulos.Update() + End Sub +End Class diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx index 339d007a1..9f4d4df89 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -13,24 +13,6 @@ margin-block: 1rem; } - .dataTables_scrollHead { - background-color: #DDD; - color: white; - } - - .table-scrollable { - margin-top: 0px !important; - margin-bottom: 0px !important; - } - - .Texto { - text-align: left !important - } - - .boton { - background: red; - } - .consulta { padding: 1rem 2rem; background-color: #95A5A6; @@ -70,52 +52,49 @@ - - -
    -
    - + <%-- Filtros --%> +
    +
    + - + -
    +
    -
    - +
    + - + -
    +
    -
    - - -
    +
    + + +
    -
    - -
    - - -
    -
    - - +
    + +
    + +
    - - +
    + +
    + <%-- Listado de Contratos --%> + Text='<%# Eval("ContratoEstatus") %>' Style='<%# "color:" + If(Eval("BackgroundColor") IsNot DBNull.Value, Eval("BackgroundColor").ToString(), String.Empty) %>'> @@ -177,13 +156,12 @@ - + <%-- Modal --%>