Nominas Timbrado

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-09-01 13:50:01 -07:00
parent ffa9f511a8
commit 6f6294d91d
6 changed files with 132 additions and 50 deletions

2
.gitignore vendored
View File

@@ -1,7 +1,7 @@
################################################################################
# Este archivo .gitignore ha sido creado automáticamente por Microsoft(R) Visual Studio.
################################################################################
/Utilerias
/Empresas
/Menu
/Web.config

View File

@@ -4124,7 +4124,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Nomina/CatSatRegimenContratacion.aspx".ToUpper(), 257)
PaginaDict.Add("/Nomina/CatSatTipoIncapacidad.aspx".ToUpper(), 258)
PaginaDict.Add("/Nomina/CatSatRiesgoPuesto.aspx".ToUpper(), 259)
PaginaDict.Add("/Nomina/Utilidades.aspx".ToUpper(), 870)
PaginaDict.Add("/Nomina/ReportePTU.aspx".ToUpper(), 870)
#End Region
'Ordenes de Servicios
#Region "OS"

View File

@@ -1984,6 +1984,28 @@ Public Class ClsRH
Return Retorno
End Function
Public Function UpPersonalAltas(CvePersonal As Integer, fechaInicio As String, fechaFin As String, CvePeriodoFiniquito As Integer, CveMotivoBaja As Integer, esLiquidacion As Boolean) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_PersonalAltasUp")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@fechaInicio", SqlDbType.VarChar).Value = fechaInicio
.Add("@fechaFin", SqlDbType.VarChar).Value = fechaFin
.Add("@CvePeriodoFiniquito", SqlDbType.Int).Value = CvePeriodoFiniquito
.Add("@CveMotivoBaja", SqlDbType.Int).Value = CveMotivoBaja
.Add("@esLiquidacion", SqlDbType.Int).Value = If(esLiquidacion, 1, 0)
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el reporte de Altas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetPersonalAltas(CvePersonal As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_PersonalAltasGet")

View File

@@ -634,7 +634,7 @@ Public Class Timbrado
'Retorno = TimbrarFacturaProFact(UsuarioActual, Ventas, TmpDTConceptos, TmpDTImpuestos, TmpDTComplementos, Ruta, LstFordASN, FordGSDBM, ObjV)
Case 4
Dim Ret As String = TimbrarFacturaGoCFDIv33(Ventas, UsuarioActual)
Dim Ret As String = TimbrarFacturaGoCFDIv33(Ventas, UsuarioActual, CvePACEspecial)
Retorno = If(Ret = "", True, False)
End Select
@@ -1571,7 +1571,10 @@ Public Class Timbrado
'GC.Collect()
Return Retorno
End Function
Public Function TimbrarFacturaGoCFDIv33(Ventas As Modelos.Factura, UsuarioActual As Usuario) As String
Public Function TimbrarFacturaGoCFDIv33(Ventas As Modelos.Factura, UsuarioActual As Usuario, Optional CvePACEspecial As Integer = -1) As String
If CvePACEspecial = -1 Then
CvePACEspecial = UsuarioActual.Empresa.CvePAC
End If
Dim sw As New Diagnostics.Stopwatch
Dim swmili As Long = 0
Dim swTiempo As New StringBuilder
@@ -1581,8 +1584,8 @@ Public Class Timbrado
' 'Sucursal matriz de la empresa
Dim ArchivoLLave As String = String.Format("{0}Certificados\{1}", UsuarioActual.Empresa.Ruta, UsuarioActual.Empresa.ArchivoKey)
Dim ArchivoCertificado As String = String.Format("{0}Certificados\{1}", UsuarioActual.Empresa.Ruta, UsuarioActual.Empresa.ArchivoCer)
Dim UsuarioServicio As String = If(UsuarioActual.Empresa.CvePAC = 2, UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx")
Dim ClaveServicio As String = If(UsuarioActual.Empresa.CvePAC = 2, UsuarioActual.Empresa.RFC.ToLower, "rene2018")
Dim UsuarioServicio As String = If(CvePACEspecial = 2, UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx")
Dim ClaveServicio As String = If(CvePACEspecial = 2, UsuarioActual.Empresa.RFC.ToLower, "rene2018")
Dim Clave As String = UsuarioActual.Empresa.ContraseñaKey
Dim EmisorRFC As String = UsuarioActual.Empresa.RFC
Dim UrlServicio As String = "" ' Produccion
@@ -1591,8 +1594,7 @@ Public Class Timbrado
Dim SubTotal As Decimal = 0
Dim TimbraProduccion As Boolean = True
If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo)
Select Case UsuarioActual.Empresa.CvePAC
Select Case CvePACEspecial
Case 2
UrlServicio = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL"
Case 4
@@ -1606,7 +1608,7 @@ Public Class Timbrado
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer"
Clave = "12345678a"
TimbraProduccion = False
Select Case UsuarioActual.Empresa.CvePAC
Select Case CvePACEspecial
Case 2
UsuarioServicio = "fgomez"
ClaveServicio = "12121212"
@@ -2090,7 +2092,7 @@ Public Class Timbrado
Using ObjVentas As New ClsVentas()
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=CvePACEspecial) Then
Retorno = ""
Else
Retorno = "Error"
@@ -2113,7 +2115,7 @@ Public Class Timbrado
If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then
Using ObjNomina2 As New ClsNominas()
If ObjNomina2.UpdateEstatusNomNominas(3, UsuarioActual.Empresa.CvePAC, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then
If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then
Retorno = ""
Else
Retorno = "Error"
@@ -2159,7 +2161,7 @@ Public Class Timbrado
End If
#End Region
GuardaLogTimbrado(swTiempo.ToString, UsuarioActual.Empresa.CvePAC)
GuardaLogTimbrado(swTiempo.ToString, CvePACEspecial)
Return Retorno
End Function
Public Sub GuardaLogTimbrado(Str As String, CvePAC As Integer)

View File

@@ -188,6 +188,10 @@
</asp:DropDownList>
<asp:Label runat="server" Text="Concepto:" AssociatedControlID="DdlConcepto"></asp:Label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtImporte" CssClass="form-control" runat="server"></asp:TextBox>
<asp:Label runat="server" Text="Concepto:" AssociatedControlID="DdlConcepto"></asp:Label>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
@@ -228,6 +232,10 @@
</asp:DropDownList>
<asp:Label runat="server" Text="Motivo de Baja: " AssociatedControlID="DdlMotivoBaja"></asp:Label>
</div>
<div class="">
¿es Liquidación?
<asp:CheckBox ID="ChkesLiquidacion" CssClass="chksino" Text=" " runat="server" />
</div>
<div class="row">
<div class="col-md-6" style="padding-right: 0px">
<div class="form-group form-md-line-input input-iconright">
@@ -285,6 +293,22 @@
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<%--"<tr class=\"thTituloConcepto\"> <th scope=\"col\" colspan=\"2\">Percepciones</th><th scope=\"col\" colspan=\"2\">Deducciones</th> </tr>"--%>
<script>
function insertParam(key, value) {
key = encodeURIComponent(key); value = encodeURIComponent(value);
var s = document.location.search;
var kvp = key + "=" + value;
var r = new RegExp("(&|\\?)" + key + "=[^\&]*");
s = s.replace(r, "$1" + kvp);
if (!RegExp.$1) { s += (s.length > 0 ? '&' : '?') + kvp; };
//again, do what you will here
document.location.search = s;
}
function ADSBegin() {
if ($('.thTituloConcepto').length == 0) {
$('.GvConceptos').prepend("<tr class=\"thTituloConcepto\"> <th scope=\"col\" colspan=\"2\">Percepciones</th><th scope=\"col\" colspan=\"2\">Deducciones</th> </tr>");

View File

@@ -130,7 +130,7 @@ Partial Class Nomina_Finiquito
obj.EstatusD = dtD.Rows(index)("Estatus").ToString().ToEntero()
ElseIf index = noD Then
obj.EstatusD = -1
obj.ConceptoD = "Agregar"
obj.ConceptoD = "Agregar"
End If
listaconceptos.Add(obj)
Next
@@ -155,7 +155,7 @@ Partial Class Nomina_Finiquito
objT.CveConcepto = 0
objT.Concepto = ""
objT.Estatus = -3
objT.ImporteD = objST.Importe - objT.Importe
objT.ImporteD = objST.Importe + objST.ImporteD
objT.CveConceptoD = 0
objT.ConceptoD = "Total"
objT.EstatusD = -3
@@ -188,6 +188,20 @@ Partial Class Nomina_Finiquito
ViewState("DTConceptos") = Value
End Set
End Property
Private Property esLiquidacion As Boolean
Get
If Not IsNothing(ViewState("esLiquidacion")) Then
Return CBool(ViewState("esLiquidacion"))
Else
Return False
End If
End Get
Set
ViewState("esLiquidacion") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
@@ -217,7 +231,7 @@ Partial Class Nomina_Finiquito
End Sub
Private Sub CargaDdlPersonal()
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
DdlPersonal.DataSource = ObjPersonal.DtResultados
DdlPersonal.DataBind()
End If
@@ -227,29 +241,40 @@ Partial Class Nomina_Finiquito
Private Function CargaDatosFiniquito() As Boolean
Dim retorno As Boolean = True
If CvePersonal > 0 Then
DdlPersonal.SelectedValueExist(CvePersonal.ToString())
Dim Nombre As String = ""
Dim FechaBaja As String = ""
Dim MotivoBaja As String = ""
Dim EstatusPersonal As String = ""
CvePeriodoFiniquito = 0
CveTipoPeriodo = 0
esLiquidacion = False
pnlupValoresFiniquito.Visible = False
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then
Nombre = ObjPersonal.DtResultados.Rows(0)("Nombre").ToString()
FechaBaja = String.Format("{0:dd/MM/yyyy}", ObjPersonal.FechaBaja)
MotivoBaja = String.Format("{0}", ObjPersonal.DtResultados.Rows(0)("MotivoBaja"))
EstatusPersonal = String.Format("{0}", ObjPersonal.DtResultados.Rows(0)("EstatusPersonal"))
CvePeriodoFiniquito = ObjPersonal.DtResultados.Rows(0)("CvePeriodoFiniquito").ToString().ToEntero()
CveTipoPeriodo = ObjPersonal.DtResultados.Rows(0)("CveTipoPeriodo").ToString().ToEntero()
End If
ObjPersonal.Dispose()
DdlMotivoBaja.SelectedValue = "-1"
Using ObjPersonal As New ClsRH()
If ObjPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then
Nombre = ObjPersonal.DtResultados.Rows(0)("Nombre").ToString()
FechaBaja = String.Format("{0:dd/MM/yyyy}", ObjPersonal.FechaBaja)
EstatusPersonal = String.Format("{0}", ObjPersonal.DtResultados.Rows(0)("EstatusPersonal"))
CveTipoPeriodo = ObjPersonal.DtResultados.Rows(0)("CveTipoPeriodo").ToString().ToEntero()
End If
If ObjPersonal.GetPersonalAltas(CvePersonal) AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then
CvePeriodoFiniquito = ObjPersonal.DtResultados.Rows(0)("CvePeriodoFiniquito").ToString().ToEntero()
FechaBaja = String.Format("{0:dd/MM/yyyy}", ObjPersonal.DtResultados.Rows(0)("FechaFin"))
DdlMotivoBaja.SelectedValueExist(ObjPersonal.DtResultados.Rows(0)("CveMotivoBaja").ToString().ToEntero())
Dim stringesliquidacion = ObjPersonal.DtResultados.Rows(0)("esLiquidacion").ToString()
esLiquidacion = (stringesliquidacion = "True" OrElse stringesliquidacion = "1")
End If
End Using
If DdlMotivoBaja.SelectedValue.ToEntero() > 0 Then
LblMotivoBaja.Text = DdlMotivoBaja.SelectedItem.Text
Else
LblMotivoBaja.Text = ""
End If
HypEmpleado.Text = Nombre
HypEmpleado.NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", CvePersonal)
LblFechaBaja.Text = FechaBaja
LblMotivoBaja.Text = MotivoBaja
LblEstatus.Text = EstatusPersonal
TxtFechaBaja.Text = FechaBaja
If CvePeriodoFiniquito <= 0 Then
@@ -257,11 +282,11 @@ Partial Class Nomina_Finiquito
retorno = False
pnlupValoresFiniquito.Visible = True
End If
Dim ObjNom As New ClsNominas
If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
DTConceptosPersonal = ObjNom.DtResultados
End If
ObjNom.Dispose()
Using ObjNom As New ClsNominas()
If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
DTConceptosPersonal = ObjNom.DtResultados
End If
End Using
GvConceptos.DataSource = ConceptsPersonas
GvConceptos.DataBind()
Else
@@ -273,6 +298,13 @@ Partial Class Nomina_Finiquito
Protected Sub LnkCampiarEmpleado_Click(sender As Object, e As EventArgs)
CvePersonal = DdlPersonal.SelectedValue.ToEntero()
Using ObjPersonal As New ClsRH()
If ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), DdlPeriodo.SelectedValue.ToEntero(), DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked) AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then
End If
End Using
If pnlupValoresFiniquito.Visible Then
End If
@@ -295,7 +327,9 @@ Partial Class Nomina_Finiquito
End Sub
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs)
Response.Redirect($"/Nomina/Finiquito.aspx?CvePersonal={DdlPersonal.SelectedValue}")
'Alert($"insertParam('CvePersonal','{DdlPersonal.SelectedValue}')")
'RegistraScript($"insertParam('CvePersonal','{DdlPersonal.SelectedValue}')")
End Sub
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim CveTipoPeriodoactual As Integer = If(DdlTipoPeriodo.SelectedValue.ToEntero() > 0, DdlTipoPeriodo.SelectedValue.ToEntero(), CveTipoPeriodo)
@@ -354,24 +388,24 @@ Partial Class Nomina_Finiquito
End If
If Estatus = -1 Then
LtlConcepto.Visible = False
ElseIf Estatus > 0 Then
LtlImporte.Visible = False
End If
If EstatusD = -1 Then
LtlConceptoD.Visible = False
ElseIf EstatusD > 0 Then
LtlImporteD.Visible = False
End If
LnkConcepto.Visible = Not LtlConcepto.Visible
LnkConceptoD.Visible = Not LtlConceptoD.Visible
LnkImporte.Visible = Not LtlImporte.Visible
LnkImporteD.Visible = Not LtlImporteD.Visible
LtlConcepto.Visible = False
ElseIf Estatus > 0 Then
LtlImporte.Visible = False
End If
If EstatusD = -1 Then
LtlConceptoD.Visible = False
ElseIf EstatusD > 0 Then
LtlImporteD.Visible = False
End If
LnkConcepto.Visible = Not LtlConcepto.Visible
LnkConceptoD.Visible = Not LtlConceptoD.Visible
LnkImporte.Visible = Not LtlImporte.Visible
LnkImporteD.Visible = Not LtlImporteD.Visible
End If
End Sub
Protected Sub LnkConcepto_Click(sender As Object, e As EventArgs)