Solicitud de devolución dede OS
This commit is contained in:
@@ -70,6 +70,7 @@ Public Class ClsOS
|
|||||||
Public Property CveMedico As Integer = -1
|
Public Property CveMedico As Integer = -1
|
||||||
Public Property CveProcedimiento As Integer = -1
|
Public Property CveProcedimiento As Integer = -1
|
||||||
Public Property CveTipoVenta As Integer = -1
|
Public Property CveTipoVenta As Integer = -1
|
||||||
|
Public Property CveVenta As Integer = -1
|
||||||
Public Property Paciente As String
|
Public Property Paciente As String
|
||||||
Public Property IdentificadorCliente As String
|
Public Property IdentificadorCliente As String
|
||||||
|
|
||||||
@@ -591,6 +592,7 @@ Public Class ClsOS
|
|||||||
Me.CveTipoVenta = Data.Rows(0)("CveTipoVenta").ToString.ToEntero
|
Me.CveTipoVenta = Data.Rows(0)("CveTipoVenta").ToString.ToEntero
|
||||||
Me.Paciente = Data.Rows(0)("Paciente").ToString
|
Me.Paciente = Data.Rows(0)("Paciente").ToString
|
||||||
Me.IdentificadorCliente = Data.Rows(0)("IdentificadorCliente").ToString
|
Me.IdentificadorCliente = Data.Rows(0)("IdentificadorCliente").ToString
|
||||||
|
Me.CveVenta = Data.Rows(0)("CveVenta").ToString.ToEntero
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Retorno = True
|
Retorno = True
|
||||||
@@ -1323,6 +1325,29 @@ Public Class ClsOS
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function GetOrdenesServicioDevolucionMaterial(CveOS As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_OS_OrdenesServicioDevolucionMaterialGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveOS", SqlDbType.Int).Value = CveOS
|
||||||
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener los productos de devolución.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Function GetCotizacionOS(CveCotizacion As Integer) As Boolean
|
Public Function GetCotizacionOS(CveCotizacion As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_OS_GetCotizacionOS")
|
DataAdapter("PA_OS_GetCotizacionOS")
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Parameters!Beneficiario.Value</Value>
|
<Value>=Parameters!Beneficiario.Value</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontSize>11pt</FontSize>
|
<FontSize>9pt</FontSize>
|
||||||
</Style>
|
</Style>
|
||||||
</TextRun>
|
</TextRun>
|
||||||
</TextRuns>
|
</TextRuns>
|
||||||
|
|||||||
@@ -3010,6 +3010,15 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
OnError("Ocurrió un error al guardar", ex)
|
OnError("Ocurrió un error al guardar", ex)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If EsDevolucionVenta = 1 AndAlso CveOSSurtir > 0 AndAlso TipoMovimiento = 2 Then
|
||||||
|
If Not CierreOS(CveOSSurtir) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
Alert("Error al finalizar orden de servicio", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
|
|
||||||
ObjInventario.Commit()
|
ObjInventario.Commit()
|
||||||
@@ -4218,4 +4227,24 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function CierreOS(CveOSCerrar As Integer) As Boolean
|
||||||
|
|
||||||
|
Dim Respuesta As Boolean = True
|
||||||
|
|
||||||
|
Dim CveOSEstatusFinalizada As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 4").ToEntero
|
||||||
|
|
||||||
|
If CveOSEstatusFinalizada > 0 Then
|
||||||
|
Dim ObjOS As New ClsOS()
|
||||||
|
Respuesta = ObjOS.UpdateOrdenesServiciosEstatus(CveOSEstatusFinalizada, UsuarioActual.CveUsuario, CveOSCerrar)
|
||||||
|
ObjOS.Dispose()
|
||||||
|
Else
|
||||||
|
Alert("No se pudo obtener el estado para finalizar la orden de servicio.")
|
||||||
|
Respuesta = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return Respuesta
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -13,6 +13,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir Orden</asp:LinkButton>
|
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir Orden</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkAccionesDevolucion" runat="server" OnClick="LnkAccionesDevolucion_Click" Visible="false"> <i class="fa fa-plus"></i> Devolución Material</asp:LinkButton>
|
||||||
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
<Triggers>
|
<Triggers>
|
||||||
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||||
@@ -1259,6 +1262,67 @@
|
|||||||
<%--MODAL FINALIZAR ORDEN INICIO --%>
|
<%--MODAL FINALIZAR ORDEN INICIO --%>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="DVModalSolicitarDevolucion" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<asp:UpdatePanel ID="UpModalSolicitarDevolucion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title" >Solicitar Devolución</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<asp:GridView ID="GvSolicitarDevolucion" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial"
|
||||||
|
DataKeyNames="CveVentaDetalle,Cantidad"
|
||||||
|
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvSolicitarDevolucion_RowDataBound">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<HeaderTemplate>Cant.</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<HeaderTemplate>Dev</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtDev" runat="server" Width="50px" ></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender runat="server" FilterType="Custom" TargetControlID="TxtDev" ValidChars="123456789." />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<HeaderTemplate>Concepto</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlcodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
|
||||||
|
<asp:LinkButton ID="LnkModalSolicitarDevolucion" runat="server" CssClass="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si"
|
||||||
|
OnClick="LnkModalSolicitarDevolucion_Click" >Guardar</asp:LinkButton>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%--MODAL FINALIZAR ORDEN INICIO --%>
|
||||||
|
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="content7" ContentPlaceHolderID="JS" runat="server">
|
<asp:Content ID="content7" ContentPlaceHolderID="JS" runat="server">
|
||||||
<script src="/Scripts/DataTables.js"></script>
|
<script src="/Scripts/DataTables.js"></script>
|
||||||
@@ -1405,5 +1469,15 @@
|
|||||||
});
|
});
|
||||||
$('#GvMateriales').parent().parent().children().first().css("position", "static");
|
$('#GvMateriales').parent().parent().children().first().css("position", "static");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function ValidarCantidad(t, c) {
|
||||||
|
if (t.value > c) {
|
||||||
|
t.value = c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ Imports System.Data
|
|||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
Imports ADSNetLibrary.SIGAPI.Models.Sistema
|
Imports ADSNetLibrary.SIGAPI.Models.Sistema
|
||||||
Imports Telerik.Charting.Styles
|
Imports Telerik.Charting.Styles
|
||||||
|
Imports Telerik.Web.UI
|
||||||
|
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||||
|
Imports Profact.TimbraCFDI.Complementos.InstitucionesEducativas
|
||||||
|
|
||||||
|
|
||||||
'Imports msExcel = Microsoft.Office.Interop.Excel
|
'Imports msExcel = Microsoft.Office.Interop.Excel
|
||||||
'Imports VBIDE
|
'Imports VBIDE
|
||||||
@@ -84,6 +88,22 @@ Partial Class OS_OrdenesServicios
|
|||||||
ViewState("CveOS") = value
|
ViewState("CveOS") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
Private Property CveVenta As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveVenta") Is Nothing Then
|
||||||
|
ViewState("CveVenta") = -1
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return ViewState("CveVenta").ToString.ToEntero
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveVenta") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
Private Property CveOsDetalle As Integer
|
Private Property CveOsDetalle As Integer
|
||||||
Get
|
Get
|
||||||
Return ViewState("CveOsDetalle").ToString.ToEntero
|
Return ViewState("CveOsDetalle").ToString.ToEntero
|
||||||
@@ -286,6 +306,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
TipoEstatus = 1
|
TipoEstatus = 1
|
||||||
CveConsecutivo = 0
|
CveConsecutivo = 0
|
||||||
CveOsDetalle = -1
|
CveOsDetalle = -1
|
||||||
|
CveVenta = -1
|
||||||
CveUsuarioAtendioCount = 0
|
CveUsuarioAtendioCount = 0
|
||||||
ImgImprimir.Visible = False
|
ImgImprimir.Visible = False
|
||||||
|
|
||||||
@@ -613,6 +634,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
SeFacturara = GlobalDTTipoOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("SeFacturara", String.Format("CveOrdenServicioTipo = {0}", ObjOS.CveOSTipo))
|
SeFacturara = GlobalDTTipoOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("SeFacturara", String.Format("CveOrdenServicioTipo = {0}", ObjOS.CveOSTipo))
|
||||||
CveTecnico = ObjOS.CveUsuarioAtendio
|
CveTecnico = ObjOS.CveUsuarioAtendio
|
||||||
CargarEstatusDelUsuario(TipoEstatus)
|
CargarEstatusDelUsuario(TipoEstatus)
|
||||||
|
CveVenta = ObjOS.CveVenta
|
||||||
|
|
||||||
'Dim validacionTieneEstatus As Integer = EstatusOSDelUsuario.FiltraParametros(String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio)).Rows.Count
|
'Dim validacionTieneEstatus As Integer = EstatusOSDelUsuario.FiltraParametros(String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio)).Rows.Count
|
||||||
|
|
||||||
@@ -677,6 +699,11 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
CargaEventoBitacora()
|
CargaEventoBitacora()
|
||||||
CargaHistorial()
|
CargaHistorial()
|
||||||
|
|
||||||
|
|
||||||
|
If CveVenta > 0 And TipoEstatus.Contiene(1, 2, 3) Then
|
||||||
|
LnkAccionesDevolucion.Visible = True
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
Alert("La Orden de Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
Alert("La Orden de Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||||
BtnGuardar.Enabled = False
|
BtnGuardar.Enabled = False
|
||||||
@@ -3003,4 +3030,91 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub LnkAccionesDevolucion_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
LnkModalSolicitarDevolucion.Visible = True
|
||||||
|
|
||||||
|
GvSolicitarDevolucion.DataSource = Nothing
|
||||||
|
|
||||||
|
Dim ObjOS As New ClsOS
|
||||||
|
Dim DTTemp As New DataTable
|
||||||
|
|
||||||
|
|
||||||
|
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
|
DTTemp = ObjOS.DtResultados
|
||||||
|
GvSolicitarDevolucion.DataSource = DTTemp
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjOS.Dispose()
|
||||||
|
GvSolicitarDevolucion.DataBind()
|
||||||
|
|
||||||
|
Dim EsDevolucionVenta As Boolean = (DTTemp.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0)
|
||||||
|
|
||||||
|
RegistraScript("$('#DVModalSolicitarDevolucion').modal();")
|
||||||
|
|
||||||
|
If EsDevolucionVenta Then
|
||||||
|
Alert("Ya existe una solicitud de devolución", TipoMensaje.MsgAdvertencia)
|
||||||
|
LnkModalSolicitarDevolucion.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
UpModalSolicitarDevolucion.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub GvSolicitarDevolucion_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
e.Row.FCTextBox("TxtDev").Attributes.Add("onblur", String.Format("ValidarCantidad(this, {0})", e.Row.DataKey("Cantidad")))
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkModalSolicitarDevolucion_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim PropcesoOK As Boolean = True
|
||||||
|
Dim ObjV As New ClsVentas
|
||||||
|
ObjV.IniciaTransacSQL()
|
||||||
|
|
||||||
|
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
|
||||||
|
PropcesoOK = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
If PropcesoOK Then
|
||||||
|
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows
|
||||||
|
|
||||||
|
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||||
|
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
||||||
|
|
||||||
|
If CantidadDev > 0 Then
|
||||||
|
If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then
|
||||||
|
PropcesoOK = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If PropcesoOK Then
|
||||||
|
'ObjV.RollBack()
|
||||||
|
ObjV.Commit()
|
||||||
|
Alert("La solicitud de Devolución de Almacén se guardó correctamente")
|
||||||
|
RegistraScript("$('#DVModalSolicitarDevolucion').modal('hide');")
|
||||||
|
Else
|
||||||
|
ObjV.RollBack()
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ObjV.Dispose()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -13145,6 +13145,11 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa.Contiene(186) AndAlso EsVentaMedica AndAlso RBLTipoVenta.SelectedValue.ToEntero <> 2 Then
|
||||||
|
CveAlmacenTraspasoDestino = 1031 'FIXME OIC 2023-12-12 Por definir almacen
|
||||||
|
End If
|
||||||
|
|
||||||
Dim TotalImpuestoLocal As Double = 0
|
Dim TotalImpuestoLocal As Double = 0
|
||||||
If GvImpuestosLocales2.Rows.Count > 0 Then
|
If GvImpuestosLocales2.Rows.Count > 0 Then
|
||||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||||
|
|||||||
Reference in New Issue
Block a user