This commit is contained in:
2024-01-17 12:47:05 -07:00
4 changed files with 55 additions and 27 deletions

View File

@@ -99,6 +99,20 @@ Partial Class OS_OrdenesServicios
End Set
End Property
Private Property CvePedido As Integer
Get
If ViewState("CvePedido") Is Nothing Then
ViewState("CvePedido") = -1
End If
Return ViewState("CvePedido").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CvePedido") = value
End Set
End Property
Private Property CveOsDetalle As Integer
Get
@@ -641,6 +655,10 @@ Partial Class OS_OrdenesServicios
CveTecnico = ObjOS.CveUsuarioAtendio
CargarEstatusDelUsuario(TipoEstatus)
CveVenta = ObjOS.CveVenta
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
CvePedido = ObjOS.CveCotizacion
End If
'Dim validacionTieneEstatus As Integer = EstatusOSDelUsuario.FiltraParametros(String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio)).Rows.Count
@@ -2972,7 +2990,7 @@ Partial Class OS_OrdenesServicios
End Select
Dim ObjOS As New ClsOS
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, Opcion, UsuarioActual.CveEmpresa) Then
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, If(UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1, CvePedido, CveVenta), Opcion, UsuarioActual.CveEmpresa) Then
DTSolicitudDev = ObjOS.DtResultados
GvMU.DataSource = DTSolicitudDev
GvMU.Columns(3).Visible = DTSolicitudDev.MIN("Serie") <> ""
@@ -3093,7 +3111,7 @@ Partial Class OS_OrdenesServicios
Next
If AplicaDevolucion Then
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVentaPedido) Then
ProcesoOK = False
End If
End If
@@ -3213,6 +3231,16 @@ Partial Class OS_OrdenesServicios
Else
ProcesoOK = False
End If
If ProcesoOK Then
If Not ObjOS.UpdateVentaOS(Respuesta.CveVenta, CveOS) Then
ProcesoOK = False
End If
End If
End If
End If
@@ -3249,7 +3277,7 @@ Partial Class OS_OrdenesServicios
Dim CveSubProyectoPedido As Integer = -1
Dim CveMoneda As Integer = -1
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
If ObjVentas.GetVenta(CvePedido, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0)
CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
CveSubProyectoPedido = DbRowVenta("CveSubProyecto").ToString().ToEntero()

View File

@@ -163,29 +163,31 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="100%" EmptyDataText="No se encontraron ordenes de servicio con los filtros especificados"
ToolTip="Listado de ordenes de servicio" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None">
ToolTip="Listado de ordenes de servicio" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<%--0--%>
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveOS" DataNavigateUrlFormatString="/OS/OrdenesServicios.aspx?CveOS={0}" DataTextField="Folio" Target="_blank" />
<%--<asp:BoundField HeaderText="Folio" DataField="Folio" ItemStyle-HorizontalAlign="Left" />--%>
<%--<asp:BoundField HeaderText="Folio" DataField="Folio" />--%>
<%--1--%>
<asp:BoundField DataField="FechaCita" HeaderText="Fecha Cirugía" ItemStyle-Width="100px" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" />
<%--2--%>
<asp:BoundField HeaderText="Hospital" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Hospital" DataField="Nombre" />
<%--3--%>
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Médico" DataField="Medico" />
<%--4--%>
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" />
<%--5--%>
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
<%--6--%>
<asp:BoundField HeaderText="Estatus" DataField="EstatusOrdenServicio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Estatus" DataField="EstatusOrdenServicio" />
<%--7--%>
<asp:BoundField HeaderText="Técnico" DataField="NombreUsuario" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Técnico" DataField="NombreUsuario" />
<%--8--%>
<asp:BoundField HeaderText="Paciente" DataField="Paciente" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Paciente" DataField="Paciente" />
<%--9--%>
<asp:BoundField HeaderText="Episodio" DataField="IdentificadorCliente" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Episodio" DataField="IdentificadorCliente" />
<asp:HyperLinkField HeaderText="Pedido" DataTextField="SerieFolioPedido" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVentaPedido" Target="_blank" />
<asp:HyperLinkField HeaderText="Remisión" DataTextField="SerieFolioRemision" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVentaRemision" Target="_blank" />
</Columns>
</asp:GridView>

View File

@@ -4370,7 +4370,7 @@
<label class="col-md-2">Fecha:</label></b>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAnticipoCliente" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<asp:TextBox ID="TxtFechaAnticipoCliente" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10" AutoPostBack="true" OnTextChanged="TxtFechaAnticipoCliente_TextChanged"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaAnticipoCliente" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>

View File

@@ -13644,19 +13644,12 @@ Partial Class Ventas
GeneraOS(ObjVentas.IniciaTransacSQL, ErrorList, CveVentaOS:=factura.CveVenta, SerieFolioOS:=factura.SerieFolio)
If ErrorList.Count = 0 Then
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOSVentaMedica) Then
ErrorList.Add("Ocurrió un error al guardar la venta en Ordenes de Servicio")
End If
End If
If Not ObjVentas.SincronizacionProcedimientoProducto(DdlProcedimiento.SelectedValue.ToEntero, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorList.Add("Ocurrió un error al guardar los productos al procedimiento")
End If
End If
'Si viene de OS, Se guarda CveVenta en OS
If CveOS > 0 Then
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOS) Then
@@ -15849,16 +15842,17 @@ Partial Class Ventas
'Else
' tipoCambio = GlobalTipoCambio(e.Row.DataKey("Fecha").ToString().ToDate).ToDecimal
'End If
tipoCambio = e.Row.DBCampo("TipoCambioHoy").ToString().ToDecimal
If TxtFechaAnticipoCliente.Text = "" Then TxtFechaAnticipoCliente.Text = Now.ToShortDateString
tipoCambio = GlobalTipoCambio(TxtFechaAnticipoCliente.Text.ToDate).ToDecimal 'e.Row.DBCampo("TipoCambioHoy").ToString().ToDecimal
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Text = tipoCambio.FormatoNumero(4)
If DdlMoneda.SelectedValue.ToEntero() = 1 And e.Row.DBCampo("CveMoneda").ToString().ToEntero() = 1 Then
If DdlMoneda.SelectedValue.ToEntero() = 1 And e.Row.DBCampo("CveMoneda").ToEntero() = 1 Then
saldo = e.Row.DataKey("Saldo").ToDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 And e.Row.DBCampo("CveMoneda").ToString().ToEntero() = 1 And tipoCambio > 0 Then
saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal / tipoCambio)
ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 And e.Row.DBCampo("CveMoneda").ToString().ToEntero() = 2 Then
saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal * tipoCambio)
ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 And e.Row.DBCampo("CveMoneda").ToEntero() = 1 And tipoCambio > 0 Then
saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal / tipoCambio).TruncateDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 And e.Row.DBCampo("CveMoneda").ToEntero() = 2 Then
saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal * tipoCambio).TruncateDecimal
Else
saldo = e.Row.DataKey("Saldo").ToDecimal
End If
@@ -36509,5 +36503,9 @@ Partial Class Ventas
End If
End Sub
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
CargaAnticipos(CveCliente)
End Sub
End Class