diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 0543bb1c9..7630fec47 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -2153,7 +2153,8 @@ Namespace Modelos
PedidoContrato:=factura.PedidoContrato, ObservacionesAlmacen:=factura.ObservacionesAlmacen, CveSubProyecto:=factura.CveSubProyecto, CveSubProyectoCobranza:=factura.CveSubProyectoCobranza, CveSubProyectoEjecucion:=factura.CveSubProyectoEjecucion, CveFormaPago33:=factura.CveFormaPago33,
CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI, OrdenCompra:=factura.OrdenCompra, CveCuentaTerminal:=factura.CveCuentaTerminal, CveTipoRelacion:=factura.CveTipoRelacion, ImpuestoLocal:=TotalImpuestoLocal,
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
- CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor, EsGarantia:=factura.EsGarantia, DescripcionVenta:=factura.DescripcionVenta) Then
+ CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor, EsGarantia:=factura.EsGarantia, DescripcionVenta:=factura.DescripcionVenta,
+ CveMedico:=factura.CveMedico, CveProcedimiento:=factura.CveProcedimiento, CveTipoVenta:=factura.CveTipoVenta) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
@@ -7669,6 +7670,9 @@ Namespace Modelos
Public Property CveContratoSecciones As String = ""
Public Property CveEstatus As Integer
Public Property GenerarPDFFactura As Boolean = False
+ Public Property CveMedico As Integer = -1
+ Public Property CveProcedimiento As Integer = -1
+ Public Property CveTipoVenta As Integer = -1
#End Region
End Class
diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx
index e263f9138..5b6998b80 100644
--- a/OS/OrdenesServicios.aspx
+++ b/OS/OrdenesServicios.aspx
@@ -1278,7 +1278,7 @@
diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb
index cfb3ecb40..c6b9bed20 100644
--- a/OS/OrdenesServicios.aspx.vb
+++ b/OS/OrdenesServicios.aspx.vb
@@ -3166,11 +3166,19 @@ Partial Class OS_OrdenesServicios
Dim Respuesta As New RespuestaFacturacion()
+ Dim DtVentaDetalle As New DataTable
If ProcesoOK Then
Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
- If Not Respuesta.CveVenta > 0 Then
+
+ If Respuesta.CveVenta > 0 Then
+ If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then
+ Dim dtClon As DataTable = ObjV.DtResultados.Copy
+ dtClon.DefaultView.Sort = "CveVentaDetalle ASC"
+ DtVentaDetalle = dtClon.DefaultView.ToTable()
+ End If
+ Else
ProcesoOK = False
End If
@@ -3185,6 +3193,7 @@ Partial Class OS_OrdenesServicios
If CveMovimiento > 0 Then
+ Dim IndexMov1 As Integer = 0
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
@@ -3192,7 +3201,7 @@ Partial Class OS_OrdenesServicios
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
- Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
+ Dim CveVentaDetalle As Integer = DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
Dim Serie As String = GvRow.DataKey("Serie")
@@ -3206,6 +3215,7 @@ Partial Class OS_OrdenesServicios
Exit For
End If
End If
+ IndexMov1 = IndexMov1 + 1
Next
If ProcesoOK Then
@@ -3214,13 +3224,14 @@ Partial Class OS_OrdenesServicios
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
+ Dim IndexMov2 As Integer = 0
For Each dRow As DataRow In ObjInventario.DtResultados.Rows
Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero
Dim PU As Decimal = dRow("PU").ToString.ToDecimal
- Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero
+ Dim CveVentaDetalle As Integer = DtVentaDetalle.Rows(IndexMov2)("CveVentaDetalle").ToString.ToEntero
Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero
Dim Lote As String = dRow("Lote").ToString
@@ -3232,12 +3243,13 @@ Partial Class OS_OrdenesServicios
ProcesoOK = False
Exit For
End If
+ IndexMov2 = IndexMov2 + 1
Next
If ProcesoOK Then
Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL)
Dim LigaVenta As String = String.Format("Venta {2} en Folio: {1}", CveMovimiento, Folio, "Material utilizado")
- If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaPedido, CveOS:=CveOS) Then
+ If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Respuesta.CveVenta, CveOS:=CveOS) Then
ProcesoOK = False
End If
End If
@@ -3254,7 +3266,7 @@ Partial Class OS_OrdenesServicios
If ProcesoOK Then
ObjV.Commit()
Alert("El material utilizado se guardó correctamente")
- RegistraScript("$('#DVModalSolicitarDevolucion').modal('hide');")
+ RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');")
Else
ObjV.RollBack()
End If
@@ -3283,45 +3295,44 @@ Partial Class OS_OrdenesServicios
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyectoPedido, CveCliente, CveMoneda, "Rem")
- If ObjFactura IsNot Nothing Then
+ If ObjFactura IsNot Nothing AndAlso ProcesoOK Then
+
+
+
+ ObjFactura.CveMedico = DdlMedico.SelectedValue.ToEntero
+ ObjFactura.CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero
+ ObjFactura.CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero
+
+ For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
+
+ Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
+ Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
+ Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
+ Dim CantidadRegistro As Decimal = Cantidad - CantidadDev
+ Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
+ Dim Descuento As Decimal = GvRow.DataKey("Descuento").ToDecimal
+ Dim Obs As String = GvRow.DataKey("Observaciones")
+
+ If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido) Then
+ Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
+ ProcesoOK = False
+ Exit For
+ End If
+ Next
+
If ProcesoOK Then
+ ObjFactura.CalculaTotales()
+ Dim Resp As New Modelos.Factura.MMensajeFactura
+ Resp = ObjFactura.EmitirFactura(False, Transac:=TransaccionSQL)
- For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
-
- Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
- Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
- Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
- Dim CantidadRegistro As Decimal = Cantidad - CantidadDev
- Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
- Dim Descuento As Decimal = GvRow.DataKey("Descuento").ToDecimal
- Dim Obs As String = GvRow.DataKey("Observaciones")
-
- If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido) Then
- Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
- ProcesoOK = False
- Exit For
- End If
-
- Next
-
- If ProcesoOK Then
- ObjFactura.CalculaTotales()
-
-
- Dim Resp As New Modelos.Factura.MMensajeFactura
- Resp = ObjFactura.EmitirFactura(False, Transac:=TransaccionSQL)
-
- If Resp.CveVenta > 0 Then
- Respuesta.CveVenta = Resp.CveVenta
- Respuesta.SerieFolio = Resp.SerieFolio
- Else
- ProcesoOK = False
- End If
-
+ If Resp.CveVenta > 0 Then
+ Respuesta.CveVenta = Resp.CveVenta
+ Respuesta.SerieFolio = Resp.SerieFolio
+ Else
+ ProcesoOK = False
End If
-
End If
Else
diff --git a/Scripts/funciones.js b/Scripts/funciones.js
index c28864b85..46f0f9311 100644
--- a/Scripts/funciones.js
+++ b/Scripts/funciones.js
@@ -1107,6 +1107,16 @@ function FormatoNumero(Importe, Decimales) {
}
+function filtraListBox(txtBusqueda, listBox) {
+
+ var value = txtBusqueda.value.toLowerCase();
+ $(`#${listBox} option`).filter(function () {
+ $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
+ });
+
+}
+
+
jQuery.fn.center = function() {
this.css("position", "absolute");
var widthh = $(this).width();
diff --git a/Sistemas/EmpresasModulos.aspx b/Sistemas/EmpresasModulos.aspx
index 5b39c796f..ac0e313c8 100644
--- a/Sistemas/EmpresasModulos.aspx
+++ b/Sistemas/EmpresasModulos.aspx
@@ -38,26 +38,55 @@
-
-
- |
-
- |
-
-
-
-
-
-
- |
-
-
- |
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+