Documentacion proveedores

This commit is contained in:
Rakcsle Supertramp
2020-02-18 17:50:58 -07:00
parent 45915390df
commit 63b335d136
12 changed files with 1460 additions and 246 deletions

View File

@@ -7210,7 +7210,19 @@ Partial Class Compras_Compras
Next
importeMovimiento = 0
End If
End If
'Case 205
' If TxtTotal.Text.ToDecimal = 0 And DdlTipoComprobante.SelectedValue = "Fac" Then
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=True) Then
' ErrorPrepoliza = True
' Exit For
' End If
' End If
End Select
If ErrorPrepoliza Then

View File

@@ -61,11 +61,11 @@
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvTxtFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpRL"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="rfvTxtFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo es requerido por la aplicación, por favor ingrese una fecha."></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvTxtFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ></asp:CompareValidator>
<%-- <asp:RequiredFieldValidator ID="rfvTxtFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo es requerido por la aplicación, por favor ingrese una fecha."></asp:RequiredFieldValidator>--%>
<ajax:ValidatorCalloutExtender ID="cvcTxtFechaI" runat="server" HighlightCssClass="vco" TargetControlID="cvTxtFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="rfvcTxtFechaI" runat="server" HighlightCssClass="vco" TargetControlID="rfvTxtFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<%--<ajax:ValidatorCalloutExtender ID="rfvcTxtFechaI" runat="server" HighlightCssClass="vco" TargetControlID="rfvTxtFechaI" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
@@ -80,11 +80,11 @@
<%-- <ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>--%>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvImgFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpRL"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="rfvImgFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo es requerido por la aplicación, por favor ingrese una fecha."></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvImgFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ></asp:CompareValidator>
<%--<asp:RequiredFieldValidator ID="rfvImgFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo es requerido por la aplicación, por favor ingrese una fecha."></asp:RequiredFieldValidator>--%>
<ajax:ValidatorCalloutExtender ID="cvcImgFechaF" runat="server" HighlightCssClass="vco" TargetControlID="cvImgFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="rfvcImgFechaF" runat="server" HighlightCssClass="vco" TargetControlID="rfvImgFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<%--<ajax:ValidatorCalloutExtender ID="rfvcImgFechaF" runat="server" HighlightCssClass="vco" TargetControlID="rfvImgFechaF" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
@@ -158,7 +158,7 @@
<asp:TemplateField ControlStyle-CssClass="template" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100" HeaderText="Vencimiento" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlVencimiento" runat="server" Text='<%# Eval("Vencimiento") %>'></asp:Literal>
<asp:Literal ID="LtlVencimiento" runat="server" Text='<%# Eval("Vencimiento", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
@@ -226,7 +226,7 @@
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" HeaderText="Cargar">
<ItemTemplate>
<asp:LinkButton ID="ImgUpload" runat="server" AlternateText="Editar" CausesValidation="False"
<asp:LinkButton ID="ImgUpload" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="UploadModal_ClickDocumentacion"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload' title='Subir documento' ></i>" />
</ItemTemplate>
</asp:TemplateField>
@@ -281,6 +281,55 @@
</asp:UpdatePanel>
<div id="ModalUploadDoc" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalReferenciasVerificacion" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<asp:UpdatePanel ID="UpModalTitleUploadDocumento" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<h4 class="modal-title">
<asp:Literal ID="LtlModalUploadTitulo" runat="server"></asp:Literal></h4>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UPModalUploadDoc" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtFileDocumentacion" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="btnUploadFileDoc" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Scripts/DataTables.js"></script>

View File

@@ -37,9 +37,160 @@ Partial Class Proveedores_RepDocumentacionProveedor
Set(value As DataTable)
ViewState("DTHeaders") = value
End Set
End Property
End Property
#Region "UPLOAD"
Property CveDocumentacionElectronica As Integer
Get
If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CvePersonalClienteDocumentacion") = value
End Set
End Property
Property CveDocumentacion As Integer
Get
If ViewState("CveDocumentacion") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CveDocumentacion"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CveDocumentacion") = value
End Set
End Property
Property Documentacion As String
Get
If ViewState("Documentacion") Is Nothing Then
Return "-1"
Else
Return ViewState("Documentacion").ToString
End If
End Get
Set(value As String)
ViewState("Documentacion") = value
End Set
End Property
Property AdjuntoDocumentacion As String
Get
If ViewState("AdjuntoDocumentacion") Is Nothing Then
Return ""
Else
Return ViewState("AdjuntoDocumentacion").ToString
End If
End Get
Set(value As String)
ViewState("AdjuntoDocumentacion") = value
End Set
End Property
Property DiasVigencia As Integer
Get
If ViewState("DiasVigencia") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("DiasVigencia"), Integer)
End If
End Get
Set(value As Integer)
ViewState("DiasVigencia") = value
End Set
End Property
Property AplicaFechaVencimiento As Boolean
Get
If ViewState("AplicaFechaVencimiento") Is Nothing Then
Return True
Else
Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean)
End If
End Get
Set(value As Boolean)
ViewState("AplicaFechaVencimiento") = value
End Set
End Property
Private Property FechaVigencia As Date
Get
If ViewState("FechaVigencia") Is Nothing Then
Return Nothing
Else
Return ViewState("FechaVigencia").ToString.ToDate
End If
End Get
Set(value As Date)
ViewState("FechaVigencia") = value
End Set
End Property
Property Estatus As Integer
Get
If ViewState("Estatus") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("Estatus"), Integer)
End If
End Get
Set(value As Integer)
ViewState("Estatus") = value
End Set
End Property
Property ObservacionDocumentacion As String
Get
If ViewState("ObservacionDocumentacion") Is Nothing Then
Return ""
Else
Return ViewState("ObservacionDocumentacion").ToString
End If
End Get
Set(value As String)
ViewState("ObservacionDocumentacion") = value
End Set
End Property
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
Return Date.Now.AddDays(15)
Else
Return ViewState("FechaLimite").ToString.ToDate
End If
End Get
Set(value As Date)
ViewState("FechaLimite") = value
End Set
End Property
Property CveProveedor As Integer
Get
If ViewState("CveProveedor") Is Nothing Then
Return 0
Else
Return DirectCast(ViewState("CveProveedor"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CveProveedor") = value
End Set
End Property
#End Region
Private Sub Proveedores_RepDocumentacionProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
@@ -125,7 +276,7 @@ Partial Class Proveedores_RepDocumentacionProveedor
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
Dim Documentacion As String = e.Row.DataKey("Documentacion")
Dim CveDocumentacionElectronica As Integer = e.Row.DataKey("CveDocumentacionElectronica").ToEntero
Dim ImgRechazar As LinkButton = e.Row.FCLinkButton("ImgRechazar")
@@ -185,9 +336,9 @@ Partial Class Proveedores_RepDocumentacionProveedor
ImgDownLoad.Visible = True
If extencion.Length > 0 Then
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, Documentacion & "." & extencion)
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica & "." & extencion)
Else
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, Documentacion)
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveDocumentacionElectronica)
End If
@@ -324,56 +475,149 @@ Partial Class Proveedores_RepDocumentacionProveedor
End Function
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
'Protected Sub BrnProcesar_Click(sender As Object, e As EventArgs)
' Dim chkEstatus As CheckBox
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
Documentacion = GvRow.DataKey("Documentacion")
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
CveProveedor = GvRow.DataKey("CveProveedor").ToEntero
'DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero
Dim x As String = GvRow.DataKey("AplicaFechaVencimiento")
If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False
If GvRow.DataKey("Adjunto").ToString.Length > 0 Then
FechaVigencia = GvRow.DataKey("Adjunto").ToString.ToDate
Else
FechaVigencia = Nothing
End If
Estatus = GvRow.DataKey("Estatus").ToEntero
'If chkEstatus.Checked Then
' Estatus = 1
'Else
' Estatus = 0
'End If
ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
LtlModalUploadTitulo.Text = "Subir " & Documentacion
UpModalTitleUploadDocumento.Update()
RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
End Sub
' Dim objEdoc As New ClsEdocumentacion
' objEdoc.IniciaTransacSQL()
Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click
' Dim ErrorProceso As Boolean = False
Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
Dim Filename As String = ""
Dim ErrorProceso As Boolean = False
' For Each GvRow As GridViewRow In GvDocumentos.Rows
If AplicaFechaVencimiento And DiasVigencia > 0 Then
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
End If
For Each fileItem As Archivo In Filesgral
' Dim RDBAcptar As RadioButton = GvRow.FCRadioButton("RDBAcptar")
' Dim RDBRechazar As RadioButton = GvRow.FCRadioButton("RDBRechazar")
' Dim ContactoMail As String = GvRow.DataKey("ContactoMail")
Try
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Dim tempArray() As String
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
' If RDBAcptar.Checked Or RDBRechazar.Checked Then
' Dim Estatus As Integer = If(RDBAcptar.Checked, 3, 1)
' Dim Obsebaciones As String = If(RDBAcptar.Checked, "", GvRow.FCTextBox("TxtObservaciones").Text)
Dim TempCveDocumentacionElectronica As Integer = 0
Dim objEdoc As New ClsEdocumentacion
objEdoc.IniciaTransacSQL()
If CveDocumentacionElectronica = -1 Then
CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
If CveDocumentacionElectronica > 0 Then
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
ErrorProceso = True
End If
End If
Else
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
ErrorProceso = True
End If
End If
' If Not objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, Estatus,
' If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate,
' GvRow.DataKey("FechaVigencia").ToDate) Then
' ErrorProceso = True
' Exit For
' Else
If Not ErrorProceso = True Then
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
Try
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\")
End If
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
File.Delete(rutaAdjuntoAnterior)
End If
If System.IO.File.Exists(rutaDestino) Then
System.IO.File.Delete(rutaDestino)
End If
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
Catch ex As Exception
GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
ErrorProceso = True
End Try
End If
If Not ErrorProceso Then
objEdoc.Commit()
Alert("Documento cargado correctamente")
Else
objEdoc.RollBack()
Alert("Error al cargar archivo", TipoMensaje.MsgError)
End If
objEdoc.Dispose()
CargaDocumentacion()
TxtFileDocumentacion.Text = ""
UPModalUploadDoc.Update()
Catch ex As Exception
OnError("Error al cargar archivo", ex)
End Try
Next
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
End Sub
' If Estatus = 1 Then
' 'Enviar correo rechazo con obserbación
' End If
' End If
' Else
' 'Enviar correo archivo pediente
' End If
' Next
' If ErrorProceso Then
' objEdoc.RollBack()
' Else
' objEdoc.Commit()
' Alert("Proceso Terminado correctamente.")
' End If
' objEdoc.Dispose()
'End Sub