Autorizacion de traslados
This commit is contained in:
@@ -358,7 +358,7 @@ Public Class ClsInventarios
|
||||
End Function
|
||||
|
||||
|
||||
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1) As Boolean
|
||||
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_AlmacenesAdd")
|
||||
@@ -374,6 +374,8 @@ Public Class ClsInventarios
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@Orden", SqlDbType.SmallInt).Value = Orden
|
||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
|
||||
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -392,7 +394,7 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1) As Boolean
|
||||
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_AlmacenesUpdate")
|
||||
@@ -408,6 +410,8 @@ Public Class ClsInventarios
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@Orden", SqlDbType.SmallInt).Value = Orden
|
||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
|
||||
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -3882,7 +3886,7 @@ Public Class ClsInventarios
|
||||
|
||||
#Region " INVENTARIOS - SOLICITUD DE TRASPASOS "
|
||||
Public Function AddTrasladoSolicitud(Observaciones As String, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, CveTrasladoEstatus As Integer, CveMovimientoAlmacen As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
|
||||
Optional CveContrato As Integer = -1, Optional Guia As String = "", Optional CvePaqueteria As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional CveOS As Integer = -1) As Integer
|
||||
Optional CveContrato As Integer = -1, Optional Guia As String = "", Optional CvePaqueteria As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional CveOS As Integer = -1, Optional EstatusAlmacen As Integer = -1) As Integer
|
||||
Dim Retorno = -1
|
||||
DataAdapter("PA_Inv_TraspasoSolicitudAdd")
|
||||
|
||||
@@ -3902,6 +3906,7 @@ Public Class ClsInventarios
|
||||
.Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria
|
||||
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
|
||||
.Add("@CveOS", SqlDbType.Int).Value = CveOS
|
||||
.Add("@EstatusAlmacen", SqlDbType.Int).Value = EstatusAlmacen
|
||||
|
||||
End With
|
||||
|
||||
@@ -3969,6 +3974,31 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function UpdateTrasladoAutorizar(CveTraspasoSolicitud As Integer, CveEmpresa As Integer, EstatusAlmacen As Integer, CveUsuarioAutoriza As Integer, FechaAutorizacion As Date) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_TraspasoAutorizar")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveTraspasoSolicitud", SqlDbType.Int).Value = CveTraspasoSolicitud
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@EstatusAlmacen", SqlDbType.Int).Value = EstatusAlmacen
|
||||
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
|
||||
.Add("@FechaAutorizacion", SqlDbType.Date).Value = FechaAutorizacion
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function RemoveTrasladoSolicitud(CveTrasladoSolicitud As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim CveTraspasoSolicitud As Integer = 0
|
||||
|
||||
@@ -4238,6 +4238,8 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Contabilidad2/CatCuentasAsignaciones.aspx".ToUpper(), 724)
|
||||
PaginaDict.Add("/Contabilidad2/CatContaEjercicios.aspx".ToUpper(), 725)
|
||||
PaginaDict.Add("/Contabilidad2/PolizasImpresion.aspx".ToUpper(), 726)
|
||||
PaginaDict.Add("/Contabilidad2/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420)
|
||||
|
||||
#End Region
|
||||
'CONTRATOS
|
||||
#Region "Contratos"
|
||||
@@ -4311,7 +4313,6 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Finanzas/RepBalanceGeneralVertical.aspx".ToUpper(), 418)
|
||||
PaginaDict.Add("/Finanzas/RepBalanceGeneralHorizontal.aspx".ToUpper(), 419)
|
||||
PaginaDict.Add("/Finanzas/RepEstadoResultados.aspx".ToUpper(), 579)
|
||||
PaginaDict.Add("/Finanzas/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420)
|
||||
PaginaDict.Add("/Finanzas/RepEstadoResultadosVertical.aspx".ToUpper(), 424)
|
||||
PaginaDict.Add("/Finanzas/RepOrigenAplicacion.aspx".ToUpper(), 581)
|
||||
PaginaDict.Add("/Finanzas/RazonesFinancierasCuentas.aspx".ToUpper(), -1)
|
||||
@@ -4984,7 +4985,7 @@ Public Class ClsPaginas
|
||||
|
||||
PaginaDict.Add("/Compras/RepCxPCaudillo.aspx".ToUpper(), -1)
|
||||
|
||||
PaginaDict.Add("/Contabilidad2/RepEstadoResultadosHorizontal.aspx".ToUpper(), -1)
|
||||
|
||||
PaginaDict.Add("/Contabilidad2/RepBalanceGeneralHorizontal.aspx".ToUpper(), -1)
|
||||
|
||||
|
||||
|
||||
BIN
App_WebReferences/App_WebReferences.rar
Normal file
BIN
App_WebReferences/App_WebReferences.rar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -151,7 +151,7 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta,CveUsuarioAutoriza" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="15%" HeaderText="Almacen">
|
||||
<ItemTemplate>
|
||||
@@ -302,6 +302,20 @@
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
|
||||
<asp:Label AssociatedControlID="ChkEstatus" runat="server" Text="Estatus:"></asp:Label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUsuariosAutoriza" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Width="100%" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:Label AssociatedControlID="DdlUsuariosAutoriza" runat="server" Text="Autorizá:"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -48,6 +48,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
CargaSubProyectos()
|
||||
CargaTipoAlmacen()
|
||||
CargaDatos()
|
||||
CargaUsuarios()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
@@ -83,6 +84,15 @@ Partial Class Inventarios_CatAlmacenes
|
||||
DdlTipoAlmacen.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaUsuarios()
|
||||
|
||||
DdlUsuariosAutoriza.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros(" Estatus = 1 ")
|
||||
DdlUsuariosAutoriza.DataBind()
|
||||
|
||||
DdlUsuariosAutoriza.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCuentasContables()
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
||||
divCuentasCompac.Visible = False
|
||||
@@ -222,6 +232,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
Dim CuentaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
|
||||
If divddlcc.Visible Then
|
||||
If pnlCuentassig.Visible Then
|
||||
CveCuenta = DdlCuentasSig.SelectedValue.ToEntero()
|
||||
@@ -229,8 +240,9 @@ Partial Class Inventarios_CatAlmacenes
|
||||
CuentaContable = DdlCuentasContables.SelectedValue.ToEntero()
|
||||
End If
|
||||
End If
|
||||
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta) Then
|
||||
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero) Then
|
||||
Alert("El nuevo Almacen se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpDatos.Update()
|
||||
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
@@ -240,7 +252,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta) Then
|
||||
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero) Then
|
||||
Alert("El Almacen se actualizo correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpDatos.Update()
|
||||
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
@@ -268,6 +280,8 @@ Partial Class Inventarios_CatAlmacenes
|
||||
TxtOrden.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
divEstatus.Visible = False
|
||||
DdlUsuariosAutoriza.SelectedValueExist("-1")
|
||||
|
||||
UpAddAlmacen.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddAlmacen"))
|
||||
|
||||
@@ -304,11 +318,15 @@ Partial Class Inventarios_CatAlmacenes
|
||||
DdlTipoAlmacen.SelectedValueExist(GvRow.DataKey("CveTipoAlmacen"))
|
||||
TxtAlmacen.Text = GvRow.DataKey("Almacen")
|
||||
TxtOrden.Text = GvRow.DataKey("Orden")
|
||||
DdlUsuariosAutoriza.SelectedValueExist(If(GvRow.DataKey("CveUsuarioAutoriza").ToEntero > 0, GvRow.DataKey("CveUsuarioAutoriza"), "-1"))
|
||||
|
||||
|
||||
divEstatus.Visible = True
|
||||
ChkEstatus.Checked = If((GvRow.DataKey("Estatus")) = "Activo", True, False)
|
||||
UpAddAlmacen.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddAlmacen"))
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub LnkAlmacen_Click(sender As Object, e As EventArgs) Handles LnkAlmacen.Click
|
||||
Agregar()
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
<tr>
|
||||
<td><b>Almacén Destino: </b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlAlmacenDestino" DataTextField="Almacen" DataValueField="CveAlmacen" Width="250" CssClass="select2me" runat="server"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlAlmacenDestino" DataTextField="Almacen" DataValueField="CveAlmacen" Width="250" CssClass="select2me" runat="server" ></asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
|
||||
|
||||
<div class="col-md-6" id="DivInfo" runat="server" visible="false">
|
||||
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
@@ -214,6 +215,67 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" id="DivAutoriza" runat="server" visible="false">
|
||||
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">AUTORIZACIÓN</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
|
||||
|
||||
<div class="row" runat="server" id="DVAutorizaInformacion" visible = "False" >
|
||||
|
||||
<div class="col-md-12" runat="server" >
|
||||
<table>
|
||||
|
||||
<tr><td><b>Estado : </b></td><td><asp:Label runat="server" id="LblEstatusAutorizo" ></asp:Label></td></tr>
|
||||
<tr><td><b>Usuario : </b></td><td><asp:Label runat="server" id="LblUsaurioAutorizo" ></asp:Label></td></tr>
|
||||
<tr><td><b>Fecha : </b></td><td><asp:Label runat="server" id="LblFechaAutoriza" ></asp:Label></td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" runat="server" id="DVAutorizarBotones" visible = "False" >
|
||||
|
||||
|
||||
<div class="col-md-6" style="text-align:center!important">
|
||||
<asp:LinkButton runat="server" Text ="Aceptar" id="LnkAceptarTraslado" CssClass="btn btn-success"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar autorización?" data-btn-ok-label="Si" OnClick="LnkAceptarTraslado_Click"></asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align:center!important">
|
||||
<asp:LinkButton runat="server" Text ="Rechazar" ID="LnkRechazarTraslado" CssClass="btn btn-danger"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar rechazo?" data-btn-ok-label="Si" OnClick="LnkRechazarTraslado_Click" ></asp:LinkButton>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -238,7 +300,7 @@
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS, CodigoPS, CveUM, Cantidad, Precio, Observaciones, CveContratoDetalle" EmptyDataText="No se encontraron Productos registrados" ToolTip="Listado de Productos" CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS, CodigoPS, CveUM, Cantidad, Precio, Observaciones, CveContratoDetalle,UnidadMedida" EmptyDataText="No se encontraron Productos registrados" ToolTip="Listado de Productos" CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Cantidad" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Center" DataField="Cantidad" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="U.M" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Center" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||
|
||||
@@ -36,6 +36,21 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
ViewState("CveDireccionEnvio") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Private Property CveUsuarioAutoriza As Integer
|
||||
' Get
|
||||
' If ViewState("CveUsuarioAutoriza") Is Nothing Then
|
||||
' Return -1
|
||||
' Else
|
||||
' Return CType(ViewState("CveUsuarioAutoriza"), Integer)
|
||||
' End If
|
||||
|
||||
' End Get
|
||||
' Set(value As Integer)
|
||||
' ViewState("CveUsuarioAutoriza") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -133,6 +148,7 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim ObjClientes As New ClsClientes
|
||||
|
||||
If ObjInventarios.AddTrasladoSolicitudGet(CveTraspasoSolicitud, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
@@ -213,6 +229,55 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
LbAgregarPS.Visible = False
|
||||
HLDesdeContrato.Visible = False
|
||||
|
||||
|
||||
Dim EstatusAlmacen As Integer = ObjInventarios.DtResultados.Rows(0)("EstatusAlmacen").ToString().ToEntero
|
||||
Dim CveUsuarioAutoriza As Integer = ObjInventarios.DtResultados.Rows(0)("CveUsuarioAutorizaDestino").ToString().ToEntero
|
||||
|
||||
If EstatusAlmacen > 0 Then
|
||||
|
||||
|
||||
If UsuarioActual.CveUsuario = CveUsuarioAutoriza Then
|
||||
|
||||
If EstatusAlmacen = 1 Then
|
||||
|
||||
|
||||
DivAutoriza.Visible = True
|
||||
DVAutorizarBotones.Visible = True
|
||||
DVAutorizaInformacion.Visible = False
|
||||
|
||||
ElseIf EstatusAlmacen.Contiene(2, 3) Then
|
||||
DivAutoriza.Visible = True
|
||||
|
||||
DVAutorizarBotones.Visible = False
|
||||
DVAutorizaInformacion.Visible = True
|
||||
|
||||
LblEstatusAutorizo.Text = If(EstatusAlmacen = 2, "Aceptado", "Rechazado")
|
||||
LblUsaurioAutorizo.Text = ObjInventarios.DtResultados.Rows(0)("NombreAutoriza").ToString()
|
||||
LblFechaAutoriza.Text = ObjInventarios.DtResultados.Rows(0)("FechaAutorizacion").ToString().ToDate().ToString("dd/MM/yyyy")
|
||||
Else
|
||||
|
||||
End If
|
||||
|
||||
ElseIf EstatusAlmacen.Contiene(2, 3) Then
|
||||
|
||||
DivAutoriza.Visible = True
|
||||
|
||||
DVAutorizarBotones.Visible = False
|
||||
DVAutorizaInformacion.Visible = True
|
||||
|
||||
LblEstatusAutorizo.Text = If(EstatusAlmacen = 2, "Aceptado", "Rechazado")
|
||||
LblUsaurioAutorizo.Text = ObjInventarios.DtResultados.Rows(0)("NombreAutoriza").ToString()
|
||||
LblFechaAutoriza.Text = ObjInventarios.DtResultados.Rows(0)("FechaAutorizacion").ToString().ToDate().ToString("dd/MM/yyyy")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
DivAutoriza.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener los datos del traspaso.", TipoMensaje.MsgError)
|
||||
End If
|
||||
@@ -471,6 +536,9 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim CveUsuarioAutoriza As Integer = -1
|
||||
Dim EstatusAlmacen As Integer = 2
|
||||
'VERIFICA EXISTENCIAS
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim Existencia = 0.0
|
||||
@@ -478,6 +546,25 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
Dim MensajeExistencia As New StringBuilder
|
||||
MensajeExistencia.Append("No hay la existencia suficiente de los siguientes productos:<br/>")
|
||||
Dim CodigoPS As String = ""
|
||||
|
||||
|
||||
If ObjInventarios.GetAlmacenes(-1, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
CveUsuarioAutoriza = If(ObjInventarios.DtResultados.FiltraParametros($"CveAlmacen = {DdlAlmacenDestino.SelectedValue}")(0)("CveUsuarioAutoriza").ToString.ToEntero > 0, ObjInventarios.DtResultados.FiltraParametros($"CveAlmacen = {DdlAlmacenDestino.SelectedValue}")(0)("CveUsuarioAutoriza").ToString.ToEntero, -1)
|
||||
If CveUsuarioAutoriza > 0 Then
|
||||
EstatusAlmacen = 1
|
||||
End If
|
||||
|
||||
Else
|
||||
CveUsuarioAutoriza = -1
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
For Each row As GridViewRow In GvDatos.Rows
|
||||
CodigoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row.DataKey("CvePS").ToEntero).FiltroPrimeroValor("PSCodigo", "")
|
||||
Existencia = ObjInventarios.GetExistenciasPS(row.DataKey("CvePS").ToEntero, row.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"))
|
||||
@@ -509,7 +596,7 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
Estatus = 3
|
||||
End If
|
||||
|
||||
Dim Folio = ObjInventarios.AddTrasladoSolicitud(TxtObservaciones.Text.Trim, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, Estatus, -1, TxtFecha.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato, Guia:=Guia, CvePaqueteria:=DdlPaqueteria.SelectedValue.ToEntero, CveDireccionEnvio:=CveDireccionEnvio)
|
||||
Dim Folio = ObjInventarios.AddTrasladoSolicitud(TxtObservaciones.Text.Trim, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, Estatus, -1, TxtFecha.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato, Guia:=Guia, CvePaqueteria:=DdlPaqueteria.SelectedValue.ToEntero, CveDireccionEnvio:=CveDireccionEnvio, EstatusAlmacen:=EstatusAlmacen)
|
||||
|
||||
If Folio > 0 Then
|
||||
CveTraspasoSolicitud = ObjInventarios.CveTraspasoSolicitud
|
||||
@@ -537,6 +624,11 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
If TieneError = False Then
|
||||
ObjInventarios.Commit()
|
||||
Alert($"El Traspaso se guardó correctamente con el folio #: <b>{Folio}</b>.", TipoMensaje.MsgInformacion, $"document.location.href=""/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}""")
|
||||
|
||||
If CveUsuarioAutoriza > 0 Then
|
||||
MandaCorreoAutorizacion(Folio, CveTraspasoSolicitud, CveUsuarioAutoriza)
|
||||
End If
|
||||
|
||||
Else
|
||||
ObjInventarios.RollBack()
|
||||
Alert("Ocurrió un Error al guardar el traspaso.", TipoMensaje.MsgError)
|
||||
@@ -875,5 +967,77 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
UpPS.Update()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkAceptarTraslado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjInven As New ClsInventarios
|
||||
If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 2, UsuarioActual.CveUsuario, Now) Then
|
||||
Alert("Autorizado correctamente.")
|
||||
End If
|
||||
ObjInven.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
Protected Sub LnkRechazarTraslado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjInven As New ClsInventarios
|
||||
If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 3, UsuarioActual.CveUsuario, Now) Then
|
||||
Alert("Rechazado correctamente.")
|
||||
End If
|
||||
ObjInven.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MandaCorreoAutorizacion(Folio As Integer, CveTraspasoSolicitud As Integer, CveUsuarioAutoriza As Integer)
|
||||
|
||||
Dim SB As New StringBuilder
|
||||
|
||||
Dim CorreoDestino As String = GlobalDTUsuarios(CveUsuarioAutoriza)(0)("Correo").ToString.Trim
|
||||
|
||||
|
||||
If CorreoDestino.Length > 0 Then
|
||||
|
||||
|
||||
|
||||
SB.AppendLine($"<p>Se ha registrado una solicitud de traspaso de {DdlAlmacenOrigen.SelectedItem.Text} a {DdlAlmacenDestino.SelectedItem.Text}, con los siguientes productos.</p>")
|
||||
|
||||
|
||||
|
||||
SB.AppendLine("<br>")
|
||||
SB.AppendLine("<table border = '0'>")
|
||||
SB.AppendLine("<tr style='color:white;background-color:#808080;' ><th>Cantidad</th> <th>U.M.</th> <th>Producto</th> <th>Observaciones</th> </tr>")
|
||||
|
||||
For Each GvRow As GridViewRow In GvDatos.Rows
|
||||
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
SB.AppendLine($"<tr style='background-color:#F2F2F0;'> <td>{GvRow.DataKey("Cantidad")}</td> <td>{GvRow.DataKey("UnidadMedida")}</td> <td>{GvRow.DataKey("CodigoPS")}</td> <td>{GvRow.DataKey("Observaciones")}</td> </tr>")
|
||||
End If
|
||||
|
||||
Next
|
||||
SB.AppendLine("</table>")
|
||||
SB.AppendLine("<br>")
|
||||
SB.AppendLine($"<strong> <a href='{Request.Url.GetLeftPart(UriPartial.Authority)}/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}'>Ir a solicitud de traspaso para autorización</a></strong>")
|
||||
|
||||
|
||||
|
||||
Dim MandaCorre As New ClsSisMail
|
||||
MandaCorre.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, $"Solicitud de Autorización de traspaso #{Folio}", SB.ToString, Displayname:="SIG Notificaciones: Solicitud de Traspaso")
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user