- simplificación de uso de nómna
This commit is contained in:
@@ -289,23 +289,23 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
|
||||
CargaCuentas()
|
||||
|
||||
If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero() > 0 Then
|
||||
ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero()
|
||||
ViewState("CveProyecto") = Request("CveProyecto").ToEntero()
|
||||
ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero()
|
||||
ViewState("CveTurno") = Request("CveTurno").ToEntero()
|
||||
'If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero() > 0 Then
|
||||
' ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero()
|
||||
' ViewState("CveProyecto") = Request("CveProyecto").ToEntero()
|
||||
' ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero()
|
||||
' ViewState("CveTurno") = Request("CveTurno").ToEntero()
|
||||
|
||||
'DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61"))
|
||||
'DdlPlantilla.SelectedValue = "61"
|
||||
DdlPlantilla.Enabled = False
|
||||
DivAgregarConceptos.Visible = False
|
||||
' 'DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61"))
|
||||
' 'DdlPlantilla.SelectedValue = "61"
|
||||
' DdlPlantilla.Enabled = False
|
||||
' DivAgregarConceptos.Visible = False
|
||||
|
||||
CargaNomina()
|
||||
' CargaNomina()
|
||||
|
||||
RegistraScript("$(document).ready(function () { calculateCargo(); Sys.Application.add_load(function (s, e) { calculateCargo(); }); } );", 1)
|
||||
RegistraScript("$(document).ready(function () { calculateAbono(); Sys.Application.add_load(function (s, e) { calculateAbono(); }); } );", 2)
|
||||
RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3)
|
||||
End If
|
||||
' RegistraScript("$(document).ready(function () { calculateCargo(); Sys.Application.add_load(function (s, e) { calculateCargo(); }); } );", 1)
|
||||
' RegistraScript("$(document).ready(function () { calculateAbono(); Sys.Application.add_load(function (s, e) { calculateAbono(); }); } );", 2)
|
||||
' RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3)
|
||||
'End If
|
||||
|
||||
If IfNull(Request("Tipo"), "").ToString() <> "NOMPROV" Then
|
||||
GvPrePoliza.Columns(3).Visible = False
|
||||
@@ -360,81 +360,81 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
End With
|
||||
End Sub
|
||||
|
||||
Private Sub CargaNomina()
|
||||
Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero()
|
||||
Dim ObjNomina As New ClsNominas
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
'Private Sub CargaNomina()
|
||||
' Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero()
|
||||
' Dim ObjNomina As New ClsNominas
|
||||
' Dim ObjConta As New ClsContabilidad
|
||||
|
||||
Dim Dt As DataTable = Nothing
|
||||
Dim Cuenta As String = ""
|
||||
Dim Concepto As String = ""
|
||||
Dim IdCuenta As Integer = 0
|
||||
Dim TipoMovto As Integer
|
||||
Dim CveConcepto As Integer
|
||||
Dim CodigoCuenta As String = ""
|
||||
Dim NombreCuenta As String = ""
|
||||
Dim Referencia As String = ""
|
||||
Dim EsComodin As Integer = 0
|
||||
DtMovimientos.Clear()
|
||||
' Dim Dt As DataTable = Nothing
|
||||
' Dim Cuenta As String = ""
|
||||
' Dim Concepto As String = ""
|
||||
' Dim IdCuenta As Integer = 0
|
||||
' Dim TipoMovto As Integer
|
||||
' Dim CveConcepto As Integer
|
||||
' Dim CodigoCuenta As String = ""
|
||||
' Dim NombreCuenta As String = ""
|
||||
' Dim Referencia As String = ""
|
||||
' Dim EsComodin As Integer = 0
|
||||
' DtMovimientos.Clear()
|
||||
|
||||
If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then
|
||||
Dt = ObjNomina.DtResultados
|
||||
' If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then
|
||||
' Dt = ObjNomina.DtResultados
|
||||
|
||||
For Each drt As DataRow In Dt.Rows
|
||||
Dim dr As DataRow = DtMovimientos.NewRow
|
||||
' For Each drt As DataRow In Dt.Rows
|
||||
' Dim dr As DataRow = DtMovimientos.NewRow
|
||||
|
||||
If drt("NombreCompleto").ToString() = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then
|
||||
CveConcepto = 98
|
||||
Cuenta = "Nominas por Pagar"
|
||||
IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString().ToEntero()
|
||||
Concepto = "Pago Nomina"
|
||||
Referencia = "Pago Nomina"
|
||||
Else
|
||||
Concepto = drt("NombreCompleto")
|
||||
Referencia = ""
|
||||
CveConcepto = drt("CveConceptoContable").ToString().ToEntero()
|
||||
Cuenta = drt("ConceptoContable").ToString()
|
||||
IdCuenta = drt("IdCtaContable").ToString().ToEntero()
|
||||
End If
|
||||
' If drt("NombreCompleto").ToString() = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then
|
||||
' CveConcepto = 98
|
||||
' Cuenta = "Nominas por Pagar"
|
||||
' IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString().ToEntero()
|
||||
' Concepto = "Pago Nomina"
|
||||
' Referencia = "Pago Nomina"
|
||||
' Else
|
||||
' Concepto = drt("NombreCompleto")
|
||||
' Referencia = ""
|
||||
' CveConcepto = drt("CveConceptoContable").ToString().ToEntero()
|
||||
' Cuenta = drt("ConceptoContable").ToString()
|
||||
' IdCuenta = drt("IdCtaContable").ToString().ToEntero()
|
||||
' End If
|
||||
|
||||
Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}")
|
||||
CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "")
|
||||
NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "")
|
||||
' Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}")
|
||||
' CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "")
|
||||
' NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "")
|
||||
|
||||
TipoMovto = drt("TipoMovto")
|
||||
' TipoMovto = drt("TipoMovto")
|
||||
|
||||
If TipoMovto = 0 Then
|
||||
dr("Cargo") = Math.Abs(drt("Importe").ToString().ToDecimal())
|
||||
dr("Abono") = 0
|
||||
Else
|
||||
dr("Cargo") = 0
|
||||
dr("Abono") = Math.Abs(drt("Importe").ToString().ToDecimal())
|
||||
End If
|
||||
' If TipoMovto = 0 Then
|
||||
' dr("Cargo") = Math.Abs(drt("Importe").ToString().ToDecimal())
|
||||
' dr("Abono") = 0
|
||||
' Else
|
||||
' dr("Cargo") = 0
|
||||
' dr("Abono") = Math.Abs(drt("Importe").ToString().ToDecimal())
|
||||
' End If
|
||||
|
||||
dr("IdCuenta") = IdCuenta
|
||||
dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta
|
||||
dr("Cuenta") = Cuenta
|
||||
dr("Concepto") = Concepto
|
||||
dr("Descripcion") = Concepto
|
||||
dr("Referencia") = Referencia
|
||||
dr("TipoMovto") = TipoMovto
|
||||
dr("EsComodin") = EsComodin
|
||||
dr("CveConcepto") = CveConcepto
|
||||
dr("CveProveedor") = "-1"
|
||||
dr("CveSubProyecto") = drt("CveSubProyecto")
|
||||
dr("CvePersonal") = drt("CvePersonal")
|
||||
dr("CveClasificacion") = drt("CveClasificacion")
|
||||
dr("CveTipoGasto") = drt("CveTipoGasto")
|
||||
' dr("IdCuenta") = IdCuenta
|
||||
' dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta
|
||||
' dr("Cuenta") = Cuenta
|
||||
' dr("Concepto") = Concepto
|
||||
' dr("Descripcion") = Concepto
|
||||
' dr("Referencia") = Referencia
|
||||
' dr("TipoMovto") = TipoMovto
|
||||
' dr("EsComodin") = EsComodin
|
||||
' dr("CveConcepto") = CveConcepto
|
||||
' dr("CveProveedor") = "-1"
|
||||
' dr("CveSubProyecto") = drt("CveSubProyecto")
|
||||
' dr("CvePersonal") = drt("CvePersonal")
|
||||
' dr("CveClasificacion") = drt("CveClasificacion")
|
||||
' dr("CveTipoGasto") = drt("CveTipoGasto")
|
||||
|
||||
DtMovimientos.Rows.Add(dr)
|
||||
Next
|
||||
' DtMovimientos.Rows.Add(dr)
|
||||
' Next
|
||||
|
||||
GvMov.DataSource = DtMovimientos
|
||||
GvMov.DataBind()
|
||||
UPMovs.Update()
|
||||
End If
|
||||
' GvMov.DataSource = DtMovimientos
|
||||
' GvMov.DataBind()
|
||||
' UPMovs.Update()
|
||||
' End If
|
||||
|
||||
End Sub
|
||||
'End Sub
|
||||
|
||||
Private Sub CargaPrePoliza()
|
||||
BtnEliminar.Visible = True
|
||||
@@ -1072,11 +1072,11 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
Next
|
||||
|
||||
|
||||
If CvePeriodo > 0 Then
|
||||
If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
MsgError = "No se pudo actualizar el periodo de la nómina"
|
||||
End If
|
||||
End If
|
||||
'If CvePeriodo > 0 Then
|
||||
' If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
' MsgError = "No se pudo actualizar el periodo de la nómina"
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then
|
||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||
|
||||
@@ -579,10 +579,10 @@
|
||||
<table class="table table-striped table-advance table-hover Widthall">
|
||||
<tr>
|
||||
<td style="width: 730px"> </td>
|
||||
<th style="width: 70px;">
|
||||
<asp:TextBox ID="TxtTotalCargos" runat="server" Style="text-align: right" Enabled="false" Width="70px" Text="0.00"></asp:TextBox></th>
|
||||
<th style="width: 70px;">
|
||||
<asp:TextBox ID="TxtTotalAbonos" runat="server" Style="text-align: right" Enabled="false" Width="70px" Text="0.00"></asp:TextBox></th>
|
||||
<th style="width: 90px;">
|
||||
<asp:TextBox ID="TxtTotalCargos" runat="server" Style="text-align: right" Enabled="false" Width="90px" Text="0.00"></asp:TextBox></th>
|
||||
<th style="width: 90px;">
|
||||
<asp:TextBox ID="TxtTotalAbonos" runat="server" Style="text-align: right" Enabled="false" Width="90px" Text="0.00"></asp:TextBox></th>
|
||||
<asp:HiddenField ID="HdnTotales" runat="server" ClientIDMode="Static" />
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user