This commit is contained in:
Antonio Gonzalez
2019-12-24 11:15:37 -07:00
14 changed files with 1082 additions and 163 deletions

View File

@@ -1771,11 +1771,15 @@ Public Class ClsNominas
DataAdapter("PA_Nom_FiniquitosGET") DataAdapter("PA_Nom_FiniquitosGET")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@cveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Limpiar", SqlDbType.Int).Value = Limpiar '.Add("@Limpiar", SqlDbType.Int).Value = Limpiar
End With End With
Try Try
SqlAdapter.Fill(Data) DTSet = New DataSet()
SqlAdapter.Fill(DTSet)
If (DTSet.Tables.Count > 0) Then
Data = DTSet.Tables(0)
End If
Retorno = True Retorno = True
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al obtener el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError("Ocurrió un error al obtener el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)

View File

@@ -937,7 +937,7 @@ Partial Class Bancos_ProveedoresAbonar
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
TipoCambioGeneral = tipoCambioCompra TipoCambioGeneral = tipoCambioCompra
ConceptoMovimiento = $"{HplProveedor.Text} F:{gvr.DataKey("SerieFolio")}"
'cuando son dolares, y tienen complementaria, se hace el registro 'cuando son dolares, y tienen complementaria, se hace el registro
If gvr.DataKey("CveMoneda").ToEntero = 1 Then If gvr.DataKey("CveMoneda").ToEntero = 1 Then
IdCtaContable = CtaProveedor IdCtaContable = CtaProveedor

View File

@@ -2893,18 +2893,28 @@ Partial Class Compras_Compras
If Saldo < Total Then If Saldo < Total Then
LblCompraEstatus.Text = "ABONADA" LblCompraEstatus.Text = "ABONADA"
LblCompraEstatus.Font.Bold = True LblCompraEstatus.Font.Bold = True
End If
LblCompraEstatus.ForeColor = Drawing.Color.Navy LblCompraEstatus.ForeColor = Drawing.Color.Navy
trSaldo.Visible = True trSaldo.Visible = True
HplSaldoAuxiliar.Text = String.Format("$ {0}", Saldo.FormatoNumero()) HplSaldoAuxiliar.Text = String.Format("$ {0}", Saldo.FormatoNumero())
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra) HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra)
End If
End If End If
End If End If
UpEstatus.Update() UpEstatus.Update()
Else
If CveCompra > 0 Then
LblCompraEstatus.Font.Bold = True
LblCompraEstatus.ForeColor = Drawing.Color.Navy
trSaldo.Visible = True
HplSaldoAuxiliar.Text = String.Format("$ {0}", Saldo.FormatoNumero())
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra)
End If
End If End If
End Sub End Sub
@@ -6382,7 +6392,7 @@ Partial Class Compras_Compras
' adfasdasd ' adfasdasd
'ChkNCInvNC 'ChkNCInvNC
If Not RegistraConcepto225 AndAlso Not ChkNCInvNC.Checked AndAlso Not RegistroCuentaPuente Then If Not RegistroCuentaPuente AndAlso Not ChkNCInvNC.Checked Then
'GASTO 'GASTO
If UsuarioActual.CveEmpresa = 119 Then If UsuarioActual.CveEmpresa = 119 Then
DT = TmpDT DT = TmpDT
@@ -18848,13 +18858,21 @@ Partial Class Compras_Compras
IdCtaContableAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero IdCtaContableAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero
CveCuentaAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero CveCuentaAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero
Dim CveClasificacionCostoOC = TmpDT.FiltroPrimeroValor("CveClasificacion", "ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And ISNULL(CveTipoPS, 0) = 2").ToEntero
Dim IdCtaContable69 As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
'' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
If DiferenciaInvOC.RoundSQL() <> 0 Then If DiferenciaInvOC.RoundSQL() <> 0 Then
CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
If CveMoneda = 2 And UsuarioActual.CveEmpresa.Contiene(119) Then If CveMoneda = 2 And UsuarioActual.CveEmpresa.Contiene(119) Then
ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL() ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL()
ImporteMEComp = (DiferenciaInvOC - ImporteME).RoundSQL() ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundSQL()
Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, ConceptoPartida, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, ConceptoPartida, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then
Retorno = False Retorno = False
@@ -18862,7 +18880,12 @@ Partial Class Compras_Compras
End If End If
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, SerieFolio, 228, ConceptoPartida, Fecha, IdCtaContableRecepcionOCME, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, SerieFolio, 228, ConceptoPartida, Fecha, IdCtaContableRecepcionOCME, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, SerieFolio, 229, ConceptoPartida, Fecha, IdCtaContableRecepcionOCComplementaria, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, SerieFolio, 229, ConceptoPartida, Fecha, IdCtaContableRecepcionOCComplementaria, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifImporte, SerieFolio, 69, ConceptoPartida, Fecha, IdCtaContable69, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DifImporte, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC) Then
Retorno = False
Exit For
End If
Else
Retorno = False Retorno = False
Exit For Exit For
End If End If

View File

@@ -13,32 +13,43 @@
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server" >
<ContentTemplate>
<li> <li>
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton> <asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton> <asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li> </li>
<li> <li>
<asp:UpdatePanel runat="server" ID="UpPersonlizar"> <asp:LinkButton ID="ImgExcelPersonalizado" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Excel Personalizado</asp:LinkButton>
<ContentTemplate>
<asp:LinkButton runat="server" ID="LnkPersonalizar" CssClass="" data-toggle="tooltip" Visible="True" OnClick="LnkPersonalizar_Click"
data-placement="left" title="Enviar Correo de Prueba" Text="<i class='fa fa-pencil'></i> Personalizar" ></asp:LinkButton>
</ContentTemplate>
</asp:UpdatePanel>
</li> </li>
<li>
<asp:LinkButton runat="server" ID="LnkPersonalizar" CssClass="" data-toggle="tooltip" Visible="True" OnClick="LnkPersonalizar_Click"
data-placement="left" title="Enviar Correo de Prueba" Text="<i class='fa fa-pencil'></i> Personalizar"></asp:LinkButton> </li>
<li> <li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink> <asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HplProgramar" runat="server">Programar Recursos</asp:HyperLink>
</li> </li>
<%--<li><asp:Image ID="ImgPersonalizar" runat="server" ImageUrl="/Imagenes/Table-icon.png" Width="17px" Height="17px" Style="cursor: pointer;" /></li>--%> </ContentTemplate>
<li> <Triggers>
<asp:HyperLink ID="HplProgramar" runat="server">Programar Recursos</asp:HyperLink></li> <asp:PostBackTrigger ControlID="ImgImprimir" />
<asp:PostBackTrigger ControlID="ImgExcel" />
<asp:PostBackTrigger ControlID="ImgExcelPersonalizado" />
</Triggers>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de CxP - Detalle Reporte de CxP - Detalle
@@ -226,14 +237,16 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" data-sort="true" AutoGenerateColumns="False" Width="100%" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-striped ScrollAD" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" data-sort="true" Width="99%" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
Fecha Fecha
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>&nbsp; <asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
@@ -267,7 +280,7 @@
Fecha Venc. Fecha Venc.
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal ID="LtlFechaVenc" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>&nbsp; <asp:Literal ID="LtlFechaVenc" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
@@ -283,7 +296,7 @@
Proveedor Proveedor
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal ID="LtlProveedor" runat="server" Text='<%# Eval("RazonSocial", "{0}")%>'></asp:Literal> <asp:Literal ID="LtlProveedor" runat="server" Text='<%# Eval("RazonSocial", "{0}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ControlStyle-Width="150px"> <asp:TemplateField ControlStyle-Width="150px">
@@ -291,7 +304,7 @@
Cuenta Cuenta
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal ID="LtlCuenta" runat="server" Text='<%# Eval("Cuenta")%>'></asp:Literal> <asp:Literal ID="LtlCuenta" runat="server" Text='<%# Eval("Cuenta")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ControlStyle-Width="150px" Visible="false"> <asp:TemplateField ControlStyle-Width="150px" Visible="false">
@@ -299,11 +312,14 @@
Observaciones Observaciones
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal ID="LtlObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'></asp:Literal> <asp:Literal ID="LtlObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView> </asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -83,6 +83,19 @@ Partial Class RepCxPDetalle
ViewState("FechaFin") = value ViewState("FechaFin") = value
End Set End Set
End Property End Property
Private Property Personalizo As Integer
Get
Return ViewState("Personalizo").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Personalizo") = value
End Set
End Property
Public Property FechaVInicio() As String Public Property FechaVInicio() As String
Get Get
Return ViewState("FechaVInicio").ToString Return ViewState("FechaVInicio").ToString
@@ -207,6 +220,8 @@ Partial Class RepCxPDetalle
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
Personalizo = 0
ViewState("Opcion") = IfNull(Request("Op"), "S") ViewState("Opcion") = IfNull(Request("Op"), "S")
CargaCombos() CargaCombos()
If Request("Op") IsNot Nothing Then If Request("Op") IsNot Nothing Then
@@ -533,6 +548,15 @@ Partial Class RepCxPDetalle
Else Else
GvDatos.Columns(8).Visible = False GvDatos.Columns(8).Visible = False
End If End If
Personalizo = 1
If Personalizo = 1 Then
ImgExcelPersonalizado.Visible = True
Else
ImgExcelPersonalizado.Visible = False
End If
UPDatos.Update() UPDatos.Update()
RegistraScript("$('#DivPersonalizar').modal('hide');") RegistraScript("$('#DivPersonalizar').modal('hide');")
@@ -546,6 +570,15 @@ Partial Class RepCxPDetalle
GenerarPDF("EXCEL") GenerarPDF("EXCEL")
End Sub End Sub
Protected Sub ImgExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles ImgExcelPersonalizado.Click
'GvVsh.Visible = True
'GvVsh.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
'GvVsh.Visible = False
GvDatos.ExportToExcel("DetalleCompras_" & Now.ToShortDateString & ".xls")
'GvDatos.ExportToExcelG("DetalleVentas_" & Now.ToShortDateString & ".xlsx")
End Sub
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
GenerarPDF() GenerarPDF()
End Sub End Sub

View File

@@ -29,14 +29,14 @@ Partial Class Contabilidad2_CatCuentas
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
'inicio() 'inicio()
'RegistraScript("$('#Tsubcuenta').mask('00000-0000-0000-00000');") 'RegistraScript("$('#Tsubcuenta').mask('00000-0000-0000-00000');")
If UsuarioActual.Empresa.UsaContabilidad Then ' If UsuarioActual.Empresa.UsaContabilidad Then
CargaMonedas() CargaMonedas()
CargaAgrupadorSAT() CargaAgrupadorSAT()
CargaDatos() CargaDatos()
Else 'Else
Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia) ' Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia)
MEECuenta.Enabled = False ' MEECuenta.Enabled = False
End If 'End If
End If End If
End Sub End Sub

View File

@@ -680,7 +680,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim DtPendientes As New DataTable Dim DtPendientes As New DataTable
If ObjInventarios.ComprasPendientesAlmacenGet(-1, TxtFechaPendientes.Text.ToDate, UsuarioActual.CveEmpresa) Then If ObjInventarios.ComprasPendientesAlmacenGet(-1, TxtFechaPendientes.Text.ToDate, UsuarioActual.CveEmpresa) Then
Dim FiltroTemporal = If(UsuarioActual.CveEmpresa = 119, "AND TipoDocto IN ('Fac','NC')", "AND TipoDocto IN ('Fac')") Dim FiltroTemporal = If(UsuarioActual.CveEmpresa.Contiene(119, 140), "AND TipoDocto IN ('Fac','NC','DEV')", "AND TipoDocto IN ('Fac')")
DtPendientes = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}") DtPendientes = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}")
Else Else
DtPendientes = Nothing DtPendientes = Nothing
@@ -830,12 +830,12 @@ Partial Class Inventarios_RecepcionAlmacen
TipoCambio = ObjCompras.DtResultados.Rows(0)("TipoCambio").ToString.ToDecimal TipoCambio = ObjCompras.DtResultados.Rows(0)("TipoCambio").ToString.ToDecimal
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("EstatusAlmacen").ToString.ToEntero = 1, 2, 1) TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("EstatusAlmacen").ToString.ToEntero = 1, 2, 1)
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("TipoDocto").ToString = "NC", 3, TipoMovimiento) TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("TipoDocto").ToString.Contiene("NC", "DEV"), 3, TipoMovimiento)
TotalCompraOC = ObjCompras.DtResultados.Rows(0)("SubTotal").ToString.ToDecimal TotalCompraOC = ObjCompras.DtResultados.Rows(0)("SubTotal").ToString.ToDecimal
CveTipoCompra = ObjCompras.DtResultados.Rows(0)("CveTipoCompra").ToString.ToEntero CveTipoCompra = ObjCompras.DtResultados.Rows(0)("CveTipoCompra").ToString.ToEntero
If TipoMovimiento = 3 Then If TipoMovimiento = 3 Then
CargaAlmacenes(-1, "21") CargaAlmacenes(-1, "21,2")
End If End If
RecibidaCompleta = False RecibidaCompleta = False
If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then

View File

@@ -2546,6 +2546,9 @@ Partial Class Inventarios_TraspasoAlmacen
Try Try
Dim DtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa) Dim DtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa)
For Each RowExcel As DataRow In dt.Rows For Each RowExcel As DataRow In dt.Rows
If RowExcel("Codigo").ToString() <> "" Then
Dim RowPS = DtPS.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Codigo").ToString())) Dim RowPS = DtPS.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Codigo").ToString()))
Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero() Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero()
@@ -2594,9 +2597,10 @@ Partial Class Inventarios_TraspasoAlmacen
RowsNoCargados = RowsNoCargados + 1 RowsNoCargados = RowsNoCargados + 1
ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString()) ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString())
End If End If
End If
Next Next
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al cargar los productos.", ex) OnError("Ocurrió un error al cargar los productos." & ProductosNoCargados.ToString(), ex)
Finally Finally
If NoPSConSerieLote > 0 Then If NoPSConSerieLote > 0 Then

View File

@@ -1,20 +1,35 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Finiquito.aspx.vb" Inherits="Nomina_Finiquito" %> <%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Finiquito.aspx.cs" Inherits="Nomina_Finiquito" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style> <style>
.GvConceptos.table > tbody > tr > th { .GvConceptos.table > tbody > tr > th {
border-top: 1px solid #c49f47; border-top: 1px solid #E87E04;
color: #fff; color: #fff;
font-size: 15px; font-size: 15px;
background-color: #c49f47; background-color: #E87E04;
}
}
.portlet > .portlet-title {
min-height: 30px;
}
.portlet > .portlet-title > .caption {
font-size: 13px;
padding: 5px 0 5px 0;
}
.portlet > .portlet-title > .tools {
padding: 5px 0 5px 0;
} }
.GvConceptos.table > tbody > tr.thTituloConcepto > th:nth-child(1), .GvConceptos.table > tbody > tr.thTituloConcepto > th:nth-child(1),
.GvConceptos.table > tbody > tr:not(.thTituloConcepto) > th:nth-child(2), .GvConceptos.table > tbody > tr:not(.thTituloConcepto) > th:nth-child(2),
.GvConceptos.table > tbody > tr > td:nth-child(2) { .GvConceptos.table > tbody > tr > td:nth-child(2) {
border-right: 1px solid #c49f47; border-right: 1px solid #E87E04;
} }
.dtosEmpleado { .dtosEmpleado {
@@ -73,7 +88,7 @@
<div class="row "> <div class="row ">
<div class="col-md-6 col-md-offset-3 col-sm-10 col-sm-offset-1"> <div class="col-md-6 col-md-offset-3 col-sm-10 col-sm-offset-1">
<div class="portlet box yellow smallpadding" id="pnldl"> <div class="portlet box yellow-gold smallpadding" id="pnldl">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption "> <div class="caption ">
<i class="icon-pin "></i> <i class="icon-pin "></i>
@@ -121,8 +136,12 @@
</div> </div>
<div class="portlet box yellow smallpadding" id="pnlSobreRecivo"> <ajax:TabContainer ID="Tab" runat="server" Width="100%" AutoPostBack="True">
<div class="portlet-title"> <ajax:TabPanel ID="TabSobreRecibo" runat="server" HeaderText="Sobre Recibo">
<ContentTemplate>
<div class="portlet box yellow-gold smallpadding" id="pnlSobreRecivo">
<div class="portlet-title" style="display: none;">
<div class="caption "> <div class="caption ">
<i class="icon-pin "></i> <i class="icon-pin "></i>
<span class="caption-subject bold uppercase ">Sobre Recibo</span> <span class="caption-subject bold uppercase ">Sobre Recibo</span>
@@ -136,19 +155,19 @@
<asp:GridView ID="GvConceptos" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-hover Widthall GvConceptos" <asp:GridView ID="GvConceptos" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-hover Widthall GvConceptos"
Style="text-align: center;" GridLines="None" OnRowDataBound="GvConceptos_RowDataBound" Style="text-align: center;" GridLines="None" OnRowDataBound="GvConceptos_RowDataBound"
DataKeyNames="Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD"> DataKeyNames="ConceptoP,CveConceptoP,ImporteP,EstatusP,ConceptoD,CveConceptoD,ImporteD,EstatusD">
<Columns> <Columns>
<asp:TemplateField HeaderText="Concepto"> <asp:TemplateField HeaderText="Concepto">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LtlConcepto" runat="server" Text='<%# Eval("Concepto") %>' Style="word-break: break-all;"></asp:Label> <asp:Label ID="LtlConcepto" runat="server" Text='<%# Eval("ConceptoP") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkConcepto" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("Concepto") %>'></asp:LinkButton> <asp:LinkButton ID="LnkConcepto" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("ConceptoP") %>'></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="37%" /> <ItemStyle HorizontalAlign="Left" Width="37%" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Importe"> <asp:TemplateField HeaderText="Importe">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "${0:N}") %>' Style="word-break: break-all;"></asp:Label> <asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("ImporteP", "${0:N}") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkImporte" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("Importe", "${0:N}") %>'></asp:LinkButton> <asp:LinkButton ID="LnkImporte" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("ImporteP", "${0:N}") %>'></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="13%" /> <ItemStyle HorizontalAlign="Right" Width="13%" />
</asp:TemplateField> </asp:TemplateField>
@@ -170,6 +189,184 @@
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabAguinaldo" runat="server" HeaderText="Aguinaldo">
<ContentTemplate>
<div class="portlet light xspadding bordered" id="pnlAguinaldo">
<div class="portlet-title" style="display: none;">
<div class="caption ">
<i class="icon-pin font-yellow-gold "></i>
<span class="caption-subject bold uppercase font-yellow-gold ">Aguinaldo</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body " style="padding: 0px;">
<div class="row">
<div class="col-md-3 ">
<div class="indicador2 red">
<div class="visual">$</div>
<div class="value"> <asp:Label ID="LblAguinaldoCompleto" runat="server" Text="$ ##,###.##"></asp:Label>
</div>
<div class="details">Aguinaldo ejercicio completo </div>
</div>
</div>
<div class="col-md-3">
<div class="indicador2 red">
<div class="visual">$</div>
<div class="value"> <asp:Label ID="LblAguinaldo" runat="server" Text="$ ##,###.##"></asp:Label>
</div>
<div class="details">Aguinaldo </div>
</div>
</div>
<div class="col-md-3">
<div class="indicador2 red">
<div class="visual"><i class="fa fa-money"></i></div>
<div class="value"> <asp:Label ID="LblAguinaldoPagado" runat="server" Text="$ ##,###.##"></asp:Label>
</div>
<div class="details">Aguinaldo Pagado</div>
</div>
</div>
<div class="col-md-3">
<div class="indicador2 bluesky">
<div class="visual"><i class="fa fa-money"></i></div>
<div class="value"> <asp:Label ID="LblAguinaldoporPagar" runat="server" Text="$ ##,###.##"></asp:Label>
</div>
<div class="details">Aguinaldo por pagar</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3 ">
<div class="indicador2 green">
<div class="visual"><i class="fa fa-cubes"></i></div>
<div class="value"> <asp:Label ID="Label1" runat="server" Text="###"></asp:Label>
</div>
<div class="details">Dias Ejercicio </div>
</div>
</div>
<div class="col-md-3">
<div class="indicador2 green">
<div class="visual"><i class="fa fa-cubes"></i></div>
<div class="value"> <asp:Label ID="Label2" runat="server" Text="###"></asp:Label>
</div>
<div class="details">Dias Laborados </div>
</div>
</div>
<div class="col-md-3">
<div class="indicador2 green">
<div class="visual"><i class="fa fa-cubes"></i></div>
<div class="value"> <asp:Label ID="Label3" runat="server" Text="###"></asp:Label>
</div>
<div class="details">Dias pago Aguinaldo</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabVacaciones" runat="server" HeaderText="Vacaciones">
<ContentTemplate>
<div class="portlet light xspadding bordered" id="pnlVacaciones">
<div class="portlet-title" style="display: none;">
<div class="caption ">
<i class="icon-pin font-yellow-gold "></i>
<span class="caption-subject bold uppercase font-yellow-gold ">Vacaciones</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body " style="padding: 0px;">
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtAntiguedad" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Antiguedad" AssociatedControlID="TxtAntiguedad"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtdiasVacaciones" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Días Vacaciones(ejercicio)" AssociatedControlID="TxtdiasVacaciones"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDiasLaborados" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Días Laborados " AssociatedControlID="TxtDiasLaborados"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDiasProporcion" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Días Proporcional" AssociatedControlID="TxtDiasProporcion"></asp:Label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtVaciones" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Vacaciones" AssociatedControlID="TxtVaciones"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDiasPago" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Días Pagados" AssociatedControlID="TxtDiasPago"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDiasPendientes" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Días pendientes " AssociatedControlID="TxtDiasPendientes"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtVacacionesporPagar" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Vacaciones por pagar" AssociatedControlID="TxtVacacionesporPagar"></asp:Label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPorcentjePrima" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Porcentaje Prima" AssociatedControlID="TxtPrimaPagada"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrimaVacacional" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Prima Vacacional" AssociatedControlID="TxtPrimaPagada"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrimaPagada" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Prima Vac. Pagada" AssociatedControlID="TxtPrimaPagada"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrimaPorPagar" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Prima vac. por Pagar" AssociatedControlID="TxtPrimaPorPagar"></asp:Label>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<div id="ModalConceptos" class="modal ADS fade " role="dialog"> <div id="ModalConceptos" class="modal ADS fade " role="dialog">
@@ -227,18 +424,17 @@
<h4>Debe llenar los siguientes valores para continuar</h4> <h4>Debe llenar los siguientes valores para continuar</h4>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMotivoBaja" runat="server" AppendDataBoundItems="True" DataTextField="MotivoBaja" DataValueField="CveMotivoBaja" CssClass="form-control select2me" ValidationGroup="GrpGuardar"> <asp:DropDownList ID="DdlMotivoBaja" runat="server" AppendDataBoundItems="True" DataTextField="MotivoBaja" DataValueField="CveMotivoBaja" Width="100%"
CssClass="form-control select2me" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Sin asignar Motivo de Baja" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Sin asignar Motivo de Baja" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:Label runat="server" Text="Motivo de Baja: " AssociatedControlID="DdlMotivoBaja"></asp:Label> <asp:Label runat="server" Text="Motivo de Baja: " AssociatedControlID="DdlMotivoBaja"></asp:Label>
</div> </div>
<div class=""> <div class="">
¿es Liquidación?
<asp:CheckBox ID="ChkesLiquidacion" CssClass="chksino" Text=" " runat="server" />
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6" style="padding-right: 0px"> <div class="col-md-6" style="padding-right: 0px">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright" style="width: 120px; display: inline-block">
<asp:TextBox ID="TxtFechaBaja" runat="server" CausesValidation="True" CssClass="form-control"></asp:TextBox> <asp:TextBox ID="TxtFechaBaja" runat="server" CausesValidation="True" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" CssClass="help-block errorimput" <asp:RequiredFieldValidator ID="RfvTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Baja''</b> es necesario " ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Baja''</b> es necesario "
@@ -249,23 +445,24 @@
<asp:CompareValidator ID="CVFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Baja''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" Visible="False"></asp:CompareValidator> <asp:CompareValidator ID="CVFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Baja''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" Visible="False"></asp:CompareValidator>
</div> </div>
</div> <span class="input-group-btn " style="display: inline-block">
<div class="col-md-6" style="padding-left: 0px">
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaBaja" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton> <asp:LinkButton ID="ImgFechaBaja" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span> </span>
</div> </div>
<div class="col-md-6" style="padding-left: 0px">
¿es Liquidación?
<asp:CheckBox ID="ChkesLiquidacion" CssClass="chksino" Text=" " runat="server" />
</div>
</div> </div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" OnSelectedIndexChanged="DdlTipoPeriodo_SelectedIndexChanged"> <asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="form-control select2me" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" OnSelectedIndexChanged="DdlTipoPeriodo_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Ordinario" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Ordinario" Value="-1"></asp:ListItem>
<asp:ListItem Text="Extraordinario" Value="6"></asp:ListItem> <asp:ListItem Text="Extraordinario" Value="6"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:Label runat="server" Text="Tipo Período: " AssociatedControlID="DdlTipoPeriodo"></asp:Label> <asp:Label runat="server" Text="Tipo Período: " AssociatedControlID="DdlTipoPeriodo"></asp:Label>
</div> </div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo"> <asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="form-control select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:Label runat="server" Text="Período:" AssociatedControlID="DdlPeriodo"></asp:Label> <asp:Label runat="server" Text="Período:" AssociatedControlID="DdlPeriodo"></asp:Label>

514
Nomina/Finiquito.aspx.cs Normal file
View File

@@ -0,0 +1,514 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualBasic;
using System.Data;
using Extensiones;
using System.Web.UI.WebControls;
partial class Nomina_Finiquito : ClsPaginas
{
private class NConcepto
{
//Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD
public string NoConceptoP { get; set; }
public string ConceptoP { get; set; }
public string LabelValorP { get; set; }
public int CveConceptoP { get; set; }
public double ImporteP { get; set; }
public double ValorP { get; set; }
public int EstatusP { get; set; }
public bool isEditedP { get; set; }
public string NoConceptoD { get; set; }
public string ConceptoD { get; set; }
public string LabelValorD { get; set; }
public int CveConceptoD { get; set; }
public double ImporteD { get; set; }
public double ValorD { get; set; }
public int EstatusD { get; set; }
public bool isEditedD { get; set; }
}
private class ConceptosPersonal
{
public ConceptosPersonal()
{
Concepto = "";
ConceptoD = "";
CveConcepto = 0;
CveConceptoD = 0;
Estatus = 0;
Estatus = 0;
}
public string Concepto { get; set; }
public int CveConcepto { get; set; }
public decimal Importe { get; set; }
public int Estatus { get; set; }
public string ConceptoD { get; set; }
public int CveConceptoD { get; set; }
public decimal ImporteD { get; set; }
public int EstatusD { get; set; }
}
#region Propiedades
private int CvePersonal
{
get { return ViewState["CvePersonal"] != null ? ViewState["CvePersonal"].ToString().ToEntero() : 0; }
set { ViewState["CvePersonal"] = value; }
}
private int CveTipoPeriodo
{
get { return ViewState["CveTipoPeriodo"] != null ? ViewState["CveTipoPeriodo"].ToString().ToEntero() : 0; }
set
{
ViewState["CveTipoPeriodo"] = value;
}
}
private int CvePeriodoFiniquito
{
get { return ViewState["CvePeriodoFiniquito"] != null ? ViewState["CvePeriodoFiniquito"].ToString().ToEntero() : 0; }
set { ViewState["CvePeriodoFiniquito"] = value; }
}
private int GCEstatus
{
get { return ViewState["GCEstatus"] != null ? ViewState["GCEstatus"].ToString().ToEntero() : 0; }
set { ViewState["GCEstatus"] = value; }
}
private int GCCveConcepto
{
get { return ViewState["GCCveConcepto"] != null ? ViewState["GCCveConcepto"].ToString().ToEntero() : 0; }
set { ViewState["GCCveConcepto"] = value; }
}
private decimal GCImporte
{
get { return ViewState["GCImporte"] != null ? ViewState["GCImporte"].ToString().ToDecimal() : 0; }
set { ViewState["GCImporte"] = value; }
}
private DataTable DTConceptosPersonal
{
get { return ViewState["DTConceptosPersonal"] != null ? (DataTable)ViewState["DTConceptosPersonal"] : null; }
set { ViewState["DTConceptosPersonal"] = value; }
}
private DataTable DTConceptos
{
get { return ViewState["DTConceptos"] != null ? (DataTable)ViewState["DTConceptos"] : null; }
set { ViewState["DTConceptos"] = value; }
}
private bool esLiquidacion
{
get { return ViewState["esLiquidacion"] != null ? System.Convert.ToBoolean(ViewState["esLiquidacion"]) : false; }
set { ViewState["esLiquidacion"] = value; }
}
#endregion
private List<ConceptosPersonal> ConceptsPersonas
{
get
{
List<ConceptosPersonal> listaconceptos = new List<ConceptosPersonal>();
decimal TotalP = 0;
decimal TotalD = 0;
if ((!Information.IsNothing(DTConceptosPersonal) && DTConceptosPersonal.Rows.Count > 0))
{
DataTable dtP = DTConceptosPersonal.FiltraParametros("Tipo=1");
DataTable dtD = DTConceptosPersonal.FiltraParametros("Tipo=2");
var noP = dtP.Rows.Count;
var noD = dtD.Rows.Count;
var max = noP > noD ? noP : noD;
TotalP = dtP.SUM("Importe").ToString().ToDecimal();
TotalD = dtD.SUM("Importe").ToString().ToDecimal();
for (int index = 0; index <= max; index++)
{
ConceptosPersonal obj = new ConceptosPersonal();
if (index < noP)
{
obj.Importe = dtP.Rows[index]["Importe"].ToString().ToDecimal();
obj.CveConcepto = dtP.Rows[index]["CveConcepto"].ToString().ToEntero();
obj.Concepto = dtP.Rows[index]["Concepto"].ToString();
obj.Estatus = dtP.Rows[index]["Estatus"].ToString().ToEntero();
}
else if (index == noP)
{
obj.Estatus = -1;
obj.Concepto = "Agregar";
}
if (index < noD)
{
obj.ImporteD = dtD.Rows[index]["Importe"].ToString().ToDecimal();
obj.CveConceptoD = dtD.Rows[index]["CveConcepto"].ToString().ToEntero();
obj.ConceptoD = dtD.Rows[index]["Concepto"].ToString();
obj.EstatusD = dtD.Rows[index]["Estatus"].ToString().ToEntero();
}
else if (index == noD)
{
obj.EstatusD = -1;
obj.ConceptoD = "Agregar";
}
listaconceptos.Add(obj);
}
}
listaconceptos.Add(new ConceptosPersonal());
ConceptosPersonal objST = new ConceptosPersonal();
objST.Importe = TotalP;
objST.CveConcepto = 0;
objST.Concepto = "Total Percepciones";
objST.Estatus = -2;
objST.ImporteD = TotalD;
objST.CveConceptoD = 0;
objST.ConceptoD = "Total Deducciones";
objST.EstatusD = -2;
listaconceptos.Add(objST);
ConceptosPersonal objT = new ConceptosPersonal();
objT.CveConcepto = 0;
objT.Concepto = "";
objT.Estatus = -3;
objT.ImporteD = objST.Importe + objST.ImporteD;
objT.CveConceptoD = 0;
objT.ConceptoD = "Total";
objT.EstatusD = -3;
listaconceptos.Add(objT);
return listaconceptos;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
CargaDdlPersonal();
CargaMotivoBaja();
CvePeriodoFiniquito = 0;
if (Request["CvePersonal"] != null && Request["CvePersonal"].ToString().ToEntero() > 0)
{
CvePersonal = Request["CvePersonal"].ToString().ToEntero();
}
else
{
CvePersonal = -1;
}
if (!CargaDatosFiniquito())
{
}
RegistraScript("$('#ModalEmpleados').modal();");
}
if (CvePersonal > 0 & CvePeriodoFiniquito > 0)
{
LtlEmpleadoCancelar.Visible = true;
}
}
private void CargaMotivoBaja()
{
DdlMotivoBaja.DataSource = GlobalDTMotivoBaja.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
DdlMotivoBaja.DataBind();
}
private void CargaDdlPersonal()
{
ClsRH ObjPersonal = new ClsRH();
if (ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa))
{
DdlPersonal.DataSource = ObjPersonal.DtResultados;
DdlPersonal.DataBind();
}
ObjPersonal.Dispose();
}
private bool CargaDatosFiniquito()
{
bool retorno = true;
if (CvePersonal > 0)
{
DdlPersonal.SelectedValueExist(CvePersonal.ToString());
string Nombre = "";
string FechaBaja = "";
string EstatusPersonal = "";
CvePeriodoFiniquito = 0;
CveTipoPeriodo = 0;
esLiquidacion = false;
pnlupValoresFiniquito.Visible = false;
DdlMotivoBaja.SelectedValue = "-1";
using (ClsRH ObjPersonal = new ClsRH())
{
if (ObjPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) && ObjPersonal.DtResultados.Rows.Count > 0)
{
DataRow prow = ObjPersonal.DtResultados.Rows[0];
Nombre = prow["Nombre"].ToString();
FechaBaja = string.Format("{0:dd/MM/yyyy}", ObjPersonal.FechaBaja);
EstatusPersonal = string.Format("{0}", prow["EstatusPersonal"]);
CveTipoPeriodo = prow["CveTipoPeriodo"].ToString().ToEntero();
}
if (ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
{
DataRow prow = ObjPersonal.DtResultados.Rows[0];
CvePeriodoFiniquito = prow["CvePeriodoFiniquito"].ToString().ToEntero();
FechaBaja = string.Format("{0:dd/MM/yyyy}", prow["FechaFin"]);
DdlMotivoBaja.SelectedValueExist(prow["CveMotivoBaja"].ToString().ToEntero());
var stringesliquidacion = prow["esLiquidacion"].ToString();
esLiquidacion = (stringesliquidacion == "True" || stringesliquidacion == "1");
ChkesLiquidacion.Checked = esLiquidacion;
}
}
if (DdlMotivoBaja.SelectedValue.ToEntero() > 0)
LblMotivoBaja.Text = DdlMotivoBaja.SelectedItem.Text;
else
LblMotivoBaja.Text = "";
HypEmpleado.Text = Nombre;
HypEmpleado.NavigateUrl = string.Format("/RH/Personal.aspx?CvePersonal={0}", CvePersonal);
LblFechaBaja.Text = FechaBaja;
LblEstatus.Text = EstatusPersonal;
TxtFechaBaja.Text = FechaBaja;
DdlTipoPeriodo_SelectedIndexChanged(null, null);
LblPerido.Text = DdlPeriodo.SelectedItem.Text;
if (CvePeriodoFiniquito <= 0)
retorno = false;
pnlupValoresFiniquito.Visible = true;
using (ClsNominas ObjNom = new ClsNominas())
{
if (ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa))
{
DataRow finrow = ObjNom.DtResultados.Rows[0];
TxtAntiguedad.Text = $"{finrow["Antiguedad"]}";
TxtdiasVacaciones.Text = $"{finrow["Diasvacaciones"]}";
TxtDiasLaborados.Text = $"{finrow["diaslaborados"]}";
TxtDiasProporcion.Text = $"{finrow["diasProporcion"]}";
TxtVaciones.Text = $"{finrow["Vacaciones"]}";
TxtDiasPago.Text = $"{finrow["Diasvacaciones"]}";
TxtDiasPendientes.Text = $"{finrow["diasporpagar"]}";
TxtVacacionesporPagar.Text = $"{finrow["VacacionesporPagar"]}";
TxtPorcentjePrima.Text = $"{finrow["PrimaPorcentaje"]}";
TxtPrimaVacacional.Text = $"{finrow["PrimaVacacional"]}";
TxtPrimaPagada.Text = $"{finrow["PrimaPagada"]}";
TxtPrimaPorPagar.Text = $"{finrow["PrimaVacacionalPorPagar"]}";
}
if (ObjNom.DTSetResultados.Tables.Count > 5)
{
DataTable dtconceptos = ObjNom.DTSetResultados.Tables[1];
DataTable dtconpersonal = ObjNom.DTSetResultados.Tables[5];
int maxFila = dtconpersonal.MAX("Fila", "Tipo<3").ToEntero();
List<NConcepto> lfin = new List<NConcepto>();
if (maxFila > 0)
{
DataRow conPerrow;
DataRow conrow;
NConcepto sr;
for (int i = 1; i <= maxFila; i++)
{
sr = new NConcepto();
conPerrow = dtconpersonal.FiltroPrimero(string.Format("Tipo=1 AND Fila ={0}", i));
if (conPerrow != null)
{
sr.CveConceptoP = conPerrow["CveConcepto"].ToString().ToEntero();
conrow = dtconceptos.FiltroPrimero(string.Format("CveConcepto ={0}", sr.CveConceptoP));
sr.ConceptoP = conrow["Concepto"].ToString();
sr.ValorP = conPerrow["Valor"].ToString().ToDouble();
sr.ImporteP = conPerrow["Importe"].ToString().ToDouble();
sr.NoConceptoP = conrow["Codigo"].ToString();
}
conPerrow = dtconpersonal.FiltroPrimero(string.Format("Tipo=2 AND Fila ={0}", i));
if (conPerrow != null)
{
sr.CveConceptoD = conPerrow["CveConcepto"].ToString().ToEntero();
conrow = dtconceptos.FiltroPrimero(string.Format("CveConcepto ={0}", sr.CveConceptoD));
sr.ConceptoD = conrow["Concepto"].ToString();
sr.ValorD= conPerrow["Valor"].ToString().ToDouble();
sr.ImporteD = conPerrow["Importe"].ToString().ToDouble();
sr.NoConceptoD = conrow["Codigo"].ToString();
}
lfin.Add(sr);
}
}
GvConceptos.DataSource = lfin;
GvConceptos.DataBind();
}
}
//GvConceptos.DataSource = ConceptsPersonas;
//GvConceptos.DataBind();
}
else
retorno = false;
return retorno;
}
protected void LnkCampiarEmpleado_Click(object sender, EventArgs e)
{
CvePersonal = DdlPersonal.SelectedValue.ToEntero();
using (ClsRH ObjPersonal = new ClsRH())
{
if (ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), DdlPeriodo.SelectedValue.ToEntero(), DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked) && ObjPersonal.DtResultados.Rows.Count > 0)
{
}
}
if (pnlupValoresFiniquito.Visible)
{
}
if (!CargaDatosFiniquito())
RegistraScript("$('#ModalEmpleados').modal('hide');");
upDatos.Update();
}
protected void LnkCalcular_Click(object sender, EventArgs e)
{
}
protected void LnkAutorizar_Click(object sender, EventArgs e)
{
}
protected void LnkTimbrar_Click(object sender, EventArgs e)
{
}
protected void LnkFormatoRenuncia_Click(object sender, EventArgs e)
{
}
protected void DdlPersonal_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect($"/Nomina/Finiquito.aspx?CvePersonal={DdlPersonal.SelectedValue}");
}
protected void DdlTipoPeriodo_SelectedIndexChanged(object sender, EventArgs e)
{
int CveTipoPeriodoactual = DdlTipoPeriodo.SelectedValue.ToEntero() > 0 ? DdlTipoPeriodo.SelectedValue.ToEntero() : CveTipoPeriodo;
string fechabaja = TxtFechaBaja.Text;
DataTable dtperiodos = new DataTable();
ClsNominas ObjPeriodos = new ClsNominas();
if (ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, -1))
{
dtperiodos = ObjPeriodos.DtResultados;
if (Information.IsNothing(sender) && CvePeriodoFiniquito > 0)
{
DataRow row = dtperiodos.FiltroPrimero(string.Format("CvePeriodo={0} ", CvePeriodoFiniquito));
if (!Information.IsNothing(row))
{
CveTipoPeriodoactual = row["CveTipoPeriodo"].ToString().ToEntero();
DdlTipoPeriodo.SelectedValueExist(CveTipoPeriodoactual == 6 ? "6" : "-1");
}
}
dtperiodos = ObjPeriodos.DtResultados.FiltraParametros(string.Format("(Estatus IN (1,2,3,4) AND CveTipoPeriodo={0}) ", CveTipoPeriodoactual));
// FechaInicio, P.FechaFin
DdlPeriodo.Items.Clear();
DdlPeriodo.Items.Add(new ListItem("Seleccione", "-1"));
DdlPeriodo.SelectedValue = "-1";
DdlPeriodo.DataSource = dtperiodos;
}
else
DdlPeriodo.DataSource = null;
ObjPeriodos.Dispose();
DdlPeriodo.DataBind();
if (fechabaja.Length > 0 && dtperiodos.Rows.Count > 0)
{
if ((CvePeriodoFiniquito > 0) && Information.IsNothing(sender))
DdlPeriodo.SelectedValueExist(CvePeriodoFiniquito);
else
{
DataRow row = dtperiodos.FiltroPrimero(string.Format("(FechaInicio<='{0:yyyy/MM/dd}' AND FechaFin>='{0:yyyy/MM/dd}') ", fechabaja.ToDate()));
if (!Information.IsNothing(row))
DdlPeriodo.SelectedValueExist(row["CvePeriodo"]);
}
}
}
protected void GvConceptos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Datakeys
// Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD
int CveConcepto = e.Row.DataKey("CveConceptoP").ToEntero();
int CveConceptoD = e.Row.DataKey("CveConceptoD").ToEntero();
// Dim Importe As Decimal = e.Row.DataKey("Importe").ToDecimal()
// Dim ImporteD As Decimal = e.Row.DataKey("ImporteD").ToDecimal()
int Estatus = e.Row.DataKey("EstatusP").ToEntero();
int EstatusD = e.Row.DataKey("EstatusD").ToEntero();
// Controles
Label LtlConcepto = e.Row.FCLabel("LtlConcepto");
LinkButton LnkConcepto = e.Row.FCLinkButton("LnkConcepto");
Label LtlConceptoD = e.Row.FCLabel("LtlConceptoD");
LinkButton LnkConceptoD = e.Row.FCLinkButton("LnkConceptod");
Label LtlImporte = e.Row.FCLabel("LtlImporte");
LinkButton LnkImporte = e.Row.FCLinkButton("LnkImporte");
Label LtlImporteD = e.Row.FCLabel("LtlImporteD");
LinkButton LnkImporteD = e.Row.FCLinkButton("LnkImporteD");
if (Estatus < -1 | EstatusD < -1)
e.Row.CssClass = "ConceptosTotales";
if (CveConcepto == 0 && (Estatus == 0 || Estatus == -1 || Estatus == -3))
LtlImporte.Text = "";
if (CveConceptoD == 0 && (EstatusD == 0 || EstatusD == -1))
LtlImporteD.Text = "";
if (Estatus == -1)
LtlConcepto.Visible = false;
else if (Estatus > 0)
LtlImporte.Visible = false;
if (EstatusD == -1)
LtlConceptoD.Visible = false;
else if (EstatusD > 0)
LtlImporteD.Visible = false;
LnkConcepto.Visible = !LtlConcepto.Visible;
LnkConceptoD.Visible = !LtlConceptoD.Visible;
LnkImporte.Visible = !LtlImporte.Visible;
LnkImporteD.Visible = !LtlImporteD.Visible;
}
}
protected void LnkConcepto_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
GCEstatus = gvRow.DataKey("Estatus").ToEntero();
GCCveConcepto = gvRow.DataKey("CveConcepto").ToEntero();
GCImporte = gvRow.DataKey("Importe").ToDecimal();
OpenModalConceptos(1);
}
protected void LnkConceptoD_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
GCEstatus = gvRow.DataKey("Estatus").ToEntero();
GCCveConcepto = gvRow.DataKey("CveConcepto").ToEntero();
GCImporte = gvRow.DataKey("Importe").ToDecimal();
OpenModalConceptos(2);
}
private void OpenModalConceptos(int Tipo)
{
if (GCEstatus == -1)
{
}
else
{
}
RegistraScript("$('#ModalConceptos').modal();");
}
protected void LnkAceptarConceptos_Click(object sender, EventArgs e)
{
RegistraScript("$('#ModalConceptos').modal('hide');");
}
}

View File

@@ -3,7 +3,7 @@
Imports System.Data Imports System.Data
Imports Extensiones Imports Extensiones
Partial Class Nomina_Finiquito Partial Class Nomina_FiniquitoVB
Inherits ClsPaginas Inherits ClsPaginas
Private Class ConceptosPersonal Private Class ConceptosPersonal
Public Sub New() Public Sub New()
@@ -215,8 +215,8 @@ Partial Class Nomina_Finiquito
CvePersonal = -1 CvePersonal = -1
End If End If
If Not CargaDatosFiniquito() Then If Not CargaDatosFiniquito() Then
RegistraScript("$('#ModalEmpleados').modal();")
End If End If
RegistraScript("$('#ModalEmpleados').modal();")
End If End If
@@ -264,7 +264,7 @@ Partial Class Nomina_Finiquito
DdlMotivoBaja.SelectedValueExist(ObjPersonal.DtResultados.Rows(0)("CveMotivoBaja").ToString().ToEntero()) DdlMotivoBaja.SelectedValueExist(ObjPersonal.DtResultados.Rows(0)("CveMotivoBaja").ToString().ToEntero())
Dim stringesliquidacion = ObjPersonal.DtResultados.Rows(0)("esLiquidacion").ToString() Dim stringesliquidacion = ObjPersonal.DtResultados.Rows(0)("esLiquidacion").ToString()
esLiquidacion = (stringesliquidacion = "True" OrElse stringesliquidacion = "1") esLiquidacion = (stringesliquidacion = "True" OrElse stringesliquidacion = "1")
ChkesLiquidacion.Checked = esLiquidacion
End If End If
End Using End Using
If DdlMotivoBaja.SelectedValue.ToEntero() > 0 Then If DdlMotivoBaja.SelectedValue.ToEntero() > 0 Then
@@ -277,11 +277,12 @@ Partial Class Nomina_Finiquito
LblFechaBaja.Text = FechaBaja LblFechaBaja.Text = FechaBaja
LblEstatus.Text = EstatusPersonal LblEstatus.Text = EstatusPersonal
TxtFechaBaja.Text = FechaBaja TxtFechaBaja.Text = FechaBaja
If CvePeriodoFiniquito <= 0 Then
DdlTipoPeriodo_SelectedIndexChanged(Nothing, Nothing) DdlTipoPeriodo_SelectedIndexChanged(Nothing, Nothing)
LblPerido.Text = DdlPeriodo.SelectedItem.Text
If CvePeriodoFiniquito <= 0 Then
retorno = False retorno = False
pnlupValoresFiniquito.Visible = True
End If End If
pnlupValoresFiniquito.Visible = True
Using ObjNom As New ClsNominas() Using ObjNom As New ClsNominas()
'If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then 'If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
' DTConceptosPersonal = ObjNom.DtResultados ' DTConceptosPersonal = ObjNom.DtResultados
@@ -342,10 +343,20 @@ Partial Class Nomina_Finiquito
Dim fechabaja As String = TxtFechaBaja.Text Dim fechabaja As String = TxtFechaBaja.Text
Dim dtperiodos As New DataTable Dim dtperiodos As New DataTable
Dim ObjPeriodos As New ClsNominas Dim ObjPeriodos As New ClsNominas
If ObjPeriodos.GetPeriodos(CveTipoPeriodoactual, UsuarioActual.CveEmpresa, -1, -1, -1) Then If ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, -1) Then
dtperiodos = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (1,2,3,4)") dtperiodos = ObjPeriodos.DtResultados
If IsNothing(sender) AndAlso CvePeriodoFiniquito > 0 Then
Dim row As DataRow = dtperiodos.FiltroPrimero(String.Format("CvePeriodo={0} ", CvePeriodoFiniquito))
If Not IsNothing(row) Then
CveTipoPeriodoactual = row("CveTipoPeriodo").ToString().ToEntero()
DdlTipoPeriodo.SelectedValueExist(If(CveTipoPeriodoactual = 6, "6", "-1"))
End If
End If
dtperiodos = ObjPeriodos.DtResultados.FiltraParametros(String.Format("(Estatus IN (1,2,3,4) AND CveTipoPeriodo={0}) ", CveTipoPeriodoactual))
'FechaInicio, P.FechaFin 'FechaInicio, P.FechaFin
DdlPeriodo.Items.Clear()
DdlPeriodo.Items.Add(New ListItem("Seleccione", "-1"))
DdlPeriodo.SelectedValue = "-1"
DdlPeriodo.DataSource = dtperiodos DdlPeriodo.DataSource = dtperiodos
Else Else
DdlPeriodo.DataSource = Nothing DdlPeriodo.DataSource = Nothing
@@ -353,11 +364,16 @@ Partial Class Nomina_Finiquito
ObjPeriodos.Dispose() ObjPeriodos.Dispose()
DdlPeriodo.DataBind() DdlPeriodo.DataBind()
If fechabaja.Length > 0 AndAlso dtperiodos.Rows.Count > 0 Then If fechabaja.Length > 0 AndAlso dtperiodos.Rows.Count > 0 Then
Dim row As DataRow = dtperiodos.FiltroPrimero(String.Format("FechaInicio<='{0:yyyy/MM/dd}' AND FechaFin>='{0:yyyy/MM/dd}'", fechabaja.ToDate())) If (CvePeriodoFiniquito > 0) AndAlso IsNothing(sender) Then
DdlPeriodo.SelectedValueExist(CvePeriodoFiniquito)
Else
Dim row As DataRow = dtperiodos.FiltroPrimero(String.Format("(FechaInicio<='{0:yyyy/MM/dd}' AND FechaFin>='{0:yyyy/MM/dd}') ", fechabaja.ToDate()))
If Not IsNothing(row) Then If Not IsNothing(row) Then
DdlPeriodo.SelectedValueExist(row("CvePeriodo")) DdlPeriodo.SelectedValueExist(row("CvePeriodo"))
End If End If
End If End If
End If
End Sub End Sub
#Region "Conceptos" #Region "Conceptos"

View File

@@ -4,6 +4,9 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style> <style>
span.font-black{
color:#333;
}
.GvConceptos { .GvConceptos {
border: 1px solid #E87E04; border: 1px solid #E87E04;
} }
@@ -375,10 +378,58 @@
<ContentTemplate> <ContentTemplate>
<div class="modal-content"> <div class="modal-content">
<div class="modal-header "> <div class="modal-header ">
<h4 class="modal-title"> <h4 class="modal-title">Sobre Recibo</h4>
<asp:Label ID="LblEmpleado" runat="server" Text="Label"></asp:Label></h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="portlet light xspadding bordered " id="pnlDatos">
<div class="portlet-title">
<div class="caption ">
<i class="fa fa-user font-yellow-gold"></i>
<span class="caption-subject bold font-black uppercase">Trabajador :<asp:Label ID="LblEmpleado" runat="server" Text=""></asp:Label></span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body " style="padding: 0px;">
<div class="row">
<div class="col-md-2 bold">No. Trabajador</div>
<div class="col-md-4"><asp:Label ID="LblCodigoEmpleado" runat="server"></asp:Label></div>
<div class="col-md-2 bold">Días Trabajados</div>
<div class="col-md-4"><asp:Label ID="LblDiasLaborados" runat="server"></asp:Label></div>
</div>
<div class="row">
<div class="col-md-2 bold">Afi IMSS </div>
<div class="col-md-4"><asp:Label ID="LblNSS" runat="server"></asp:Label> </div>
<div class="col-md-2 bold">Faltas</div>
<div class="col-md-4"><asp:Label ID="LblDiasFaltados" runat="server"></asp:Label></div>
</div>
<div class="row">
<div class="col-md-2 bold">R.F.C.</div>
<div class="col-md-4"><asp:Label ID="LblRFC" runat="server"></asp:Label></div>
<div class="col-md-2 bold">Retardos</div>
<div class="col-md-4"><asp:Label ID="LblDiasRetardos" runat="server"></asp:Label></div>
</div>
<div class="row">
<div class="col-md-2 bold">Curp</div>
<div class="col-md-4"><asp:Label ID="LblCURP" runat="server"></asp:Label></div>
<div class="col-md-2 bold">Días Vacaciones</div>
<div class="col-md-4"><asp:Label ID="LblDiasVacaciones" runat="server"></asp:Label></div>
</div>
<div class="row">
<div class="col-md-2 bold">Tipo de Pago</div>
<div class="col-md-4"><asp:Label ID="LblTipoPeriodo" runat="server"></asp:Label></div>
<div class="col-md-2 bold">Días Incapacidad</div>
<div class="col-md-4"><asp:Label ID="LblDiasIncapacidad" runat="server"></asp:Label></div>
</div>
<div class="row">
<div class="col-md-2 bold">Fecha de Pago</div>
<div class="col-md-4"><asp:Label ID="LblFechaPagosrb" runat="server"></asp:Label></div>
<div class="col-md-2 bold">Periodo del</div>
<div class="col-md-4"><asp:Label ID="LblFecha" runat="server"></asp:Label></div>
</div>
</div>
</div>
<ajax:TabContainer ID="TabPersonal" runat="server" Width="100%"> <ajax:TabContainer ID="TabPersonal" runat="server" Width="100%">
<ajax:TabPanel ID="TabSobreRecivo" runat="server" HeaderText="Sobre Recibo"> <ajax:TabPanel ID="TabSobreRecivo" runat="server" HeaderText="Sobre Recibo">

View File

@@ -924,6 +924,58 @@ public partial class Nomina_Nomina2 : ClsPaginas
} }
private void mostrarConceptos() private void mostrarConceptos()
{ {
#region "Llenado de datos empleado"
string CodigoEmpleado = "";
string NombreCompleto = "";
string RFC = "";
string CURP = "";
string TipoPeriodo = "";
string NSS = "";
string DiasLaborados = "";
string DiasFaltados = "";
string DiasVacaciones = "";
string FechaInicio = "";
string FechaFin = "";
string DiasRetardos = "";
string DiasIncapacidad = "";
DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal = {0}", SRCvePersonal));
if (drow != null)
{
DiasLaborados = string.Format("{0}", drow["DiasLaborados"].ToString().ToEntero());
DiasFaltados = string.Format("{0}", drow["DiasFaltados"].ToString().ToEntero());
DiasVacaciones = string.Format("{0}", drow["DiasVacaciones"].ToString().ToEntero());
FechaInicio = string.Format("{0:dd/MM/yyyy}", drow["FechaInicio"]);
FechaFin = string.Format("{0:dd/MM/yyyy}", drow["FechaFin"]);
DiasRetardos = string.Format("{0}", drow["DiasRetardos"].ToString().ToEntero());
DiasIncapacidad = string.Format("{0}", drow["DiasIncapacidad"].ToString().ToEntero());
}
using (ClsRH objrh = new ClsRH())
{
if (objrh.GetPersonal(SRCvePersonal, UsuarioActual.CveEmpresa) && objrh.DtResultados.Rows.Count > 0)
{
DataRow erow = objrh.DtResultados.Rows[0];
CodigoEmpleado = erow["Codigo"].ToString();
NombreCompleto = erow["NombreCompleto"].ToString();
RFC = erow["RFC"].ToString();
CURP = erow["CURP"].ToString();
TipoPeriodo = erow["TipoPeriodo"].ToString();
NSS = erow["NSS"].ToString();
}
}
LblCodigoEmpleado.Text = CodigoEmpleado;
//LblNombreCompleto.Text = NombreCompleto;
LblRFC.Text = RFC;
LblCURP.Text = CURP;
LblTipoPeriodo.Text = TipoPeriodo;
LblNSS.Text = NSS;
LblDiasLaborados.Text = DiasLaborados;
LblDiasFaltados.Text = DiasFaltados;
LblDiasVacaciones.Text = DiasVacaciones;
LblFecha.Text = string.Format("{0} al {1}",FechaInicio, FechaFin);
LblDiasRetardos.Text = DiasRetardos;
LblDiasIncapacidad.Text = DiasIncapacidad;
#endregion
#region "Sobre Recibo" #region "Sobre Recibo"
{ {
DataTable dtper = dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 "); DataTable dtper = dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 ");
@@ -1375,6 +1427,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
public double ImporteP { get; set; } public double ImporteP { get; set; }
public double ValorP { get; set; } public double ValorP { get; set; }
public int EstatusP { get; set; } public int EstatusP { get; set; }
public bool isEditedP { get; set; }
public string NoConceptoD { get; set; } public string NoConceptoD { get; set; }
@@ -1384,6 +1437,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
public double ImporteD { get; set; } public double ImporteD { get; set; }
public double ValorD { get; set; } public double ValorD { get; set; }
public int EstatusD { get; set; } public int EstatusD { get; set; }
public bool isEditedD { get; set; }
} }
protected void GvConceptos_RowDataBound(object sender, GridViewRowEventArgs e) protected void GvConceptos_RowDataBound(object sender, GridViewRowEventArgs e)
@@ -1409,6 +1463,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
LinkButton LnkImporte = e.Row.FCLinkButton("LnkImporte"); LinkButton LnkImporte = e.Row.FCLinkButton("LnkImporte");
Label LtlImporteD = e.Row.FCLabel("LtlImporteD"); Label LtlImporteD = e.Row.FCLabel("LtlImporteD");
LinkButton LnkImporteD = e.Row.FCLinkButton("LnkImporteD"); LinkButton LnkImporteD = e.Row.FCLinkButton("LnkImporteD");
//isEditedD
if (Estatus < -1 | EstatusD < -1) if (Estatus < -1 | EstatusD < -1)
e.Row.CssClass = "ConceptosTotales"; e.Row.CssClass = "ConceptosTotales";

View File

@@ -21072,10 +21072,16 @@ Partial Class Ventas
Dr("ImporteTotal") = Math.Round(Porcentaje * (TmpDT.SUM("TotalImporte", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ") - TmpDT.SUM("Descuento", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ")), 2) Dr("ImporteTotal") = Math.Round(Porcentaje * (TmpDT.SUM("TotalImporte", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ") - TmpDT.SUM("Descuento", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ")), 2)
' COMENTANDO POR JESUS MURUA ALIAS EL CHOLO, LO HIZO EL RAUL ARRIBA ALV ! 28/02/2018 ' COMENTANDO POR JESUS MURUA ALIAS EL CHOLO, LO HIZO EL RAUL ARRIBA ALV ! 28/02/2018
'Dr("ImporteTotal") = Porcentaje * TmpDT.SUM("TotalImporte", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ") 'Dr("ImporteTotal") = Porcentaje * TmpDT.SUM("TotalImporte", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ")
Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' "), 2)
Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' "), 2) Dr("ImporteIVA") = (Porcentaje * Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}'"), 2) Dr("ImporteRetIVA") = (Porcentaje * Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}'"), 2) Dr("ImporteRetISR") = (Porcentaje * Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteIEPS") = (Porcentaje * Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2)
'Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' "), 2)
'Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' "), 2)
'Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}'"), 2)
'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}'"), 2)
Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal) Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal)
Next Next
'codigo para ajuste de centavo, si el importe total no cuadra con los totales 'codigo para ajuste de centavo, si el importe total no cuadra con los totales
@@ -23433,7 +23439,7 @@ Partial Class Ventas
Private Sub CalculaUsados() Private Sub CalculaUsados()
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot") Then
Dim DTTamanios As DataTable = GlobalDTAcumTamaños() Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
Dim DTCvePSCostos As DataTable Dim DTCvePSCostos As DataTable