imprimir Entregas Por realizar al ser asignadas
This commit is contained in:
@@ -2819,11 +2819,12 @@ Public Class ClsGenerales
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetEntregasPorRealizar(CveEmpresa As Integer) As Boolean
|
||||
Public Function GetEntregasPorRealizar(CveEmpresa As Integer, Optional CveTick As Long = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_EntregasPorRealizarGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveTick", SqlDbType.BigInt).Value = CveTick
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -2835,12 +2836,13 @@ Public Class ClsGenerales
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AsignarEntregasPorRealizar(CvePaqueteriaGuia As Integer, CvePersonal As Integer) As Boolean
|
||||
Public Function AsignarEntregasPorRealizar(CvePaqueteriaGuia As Integer, CvePersonal As Integer, Optional CveTick As Long = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_AsignarEntregasPorRealizar")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia
|
||||
.Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CvePersonal
|
||||
.Add("@CveTick", SqlDbType.BigInt).Value = CveTick
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -472,6 +472,13 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
End If
|
||||
|
||||
'IMPRIME ENTREGAS POR REALIZAR
|
||||
If UrlParametros("OP").ToString = "ENTREGAS" Then
|
||||
If UrlParametros("CVETICK") IsNot Nothing And UrlParametros("USUARIOENTREGA") IsNot Nothing Then
|
||||
ImprimeEntregasPorRealziar(UrlParametros("CVETICK").ToString, UrlParametros("USUARIOENTREGA").ToString)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function Parametros(Cadena As String) As Hashtable
|
||||
@@ -4160,7 +4167,23 @@ Partial Class PopUpVerFactura
|
||||
Else
|
||||
RegistraScript("alert('No hay un formato de factura predefinido,favor de comunicar a soporte tecnico')")
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "OP = ENTREGAS - Entregas por realizar"
|
||||
Public Sub ImprimeEntregasPorRealziar(pCveTick As String, pUsuarioEntregar As String)
|
||||
Dim CveTick As Long = pCveTick.ToLong()
|
||||
Dim ObjGeneral As New ClsGenerales
|
||||
If ObjGeneral.GetEntregasPorRealizar(UsuarioActual.CveEmpresa, CveTick) Then
|
||||
Dim DtPaqueteriasGuias As DataTable = ObjGeneral.DtResultados
|
||||
Dim RepParams As New List(Of ReportParameter)
|
||||
RepParams.Add(New ReportParameter("Fecha", DateTime.Today.ToString()))
|
||||
RepParams.Add(New ReportParameter("AsignadoA", pUsuarioEntregar))
|
||||
RepParams.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
|
||||
ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF", RDSName:="DsInventarios")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -41,13 +41,17 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas
|
||||
GridViewRowCollection Grid = GvPaqueteriasGuias.Rows;
|
||||
|
||||
int CvePersonal = DdlUsuario.SelectedValue.ToEntero();
|
||||
long CveTick = DateTime.Now.Ticks;
|
||||
string Usuario = DdlUsuario.SelectedValue.ToEntero() > 0 ? DdlUsuario.SelectedItem.Text : "Todos";
|
||||
|
||||
string LigaPopUpVerFactura = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", ModExtensiones.Encripta(String.Format("OP=ENTREGAS&CVETICK={0}&USUARIOENTREGA={1}", CveTick, Usuario)));
|
||||
foreach (GridViewRow row in Grid)
|
||||
{
|
||||
if (row.FCCheckBox("ChkAsigna").Checked)
|
||||
{
|
||||
int CvePaqueteriasGuias = row.DataKey("CvePaqueteriaGuia").ToEntero();
|
||||
|
||||
if(!ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriasGuias, CvePersonal)){
|
||||
if(!ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriasGuias, CvePersonal, CveTick)){
|
||||
TieneError = true;
|
||||
}else
|
||||
{
|
||||
@@ -67,11 +71,11 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjGeneral.Commit();
|
||||
Alert("Entregas asignadas correctamente");
|
||||
Alert(String.Format("Entregas asignadas correctamente <br/><br/><a style='color:#23527c' href='{0}'>Imprimir Reporte de Entregas Asignadas</a>", LigaPopUpVerFactura));
|
||||
CargarEntregas();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user