Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -376,7 +376,8 @@ Public Class ClsInventarios
|
||||
End Function
|
||||
|
||||
|
||||
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean
|
||||
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1,
|
||||
Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1, Optional AlmacenAbreviatura As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
CveAlmacenAgregado = -1
|
||||
|
||||
@@ -394,6 +395,7 @@ Public Class ClsInventarios
|
||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
|
||||
.Add("@CveAlmacenVirtual", SqlDbType.Int).Value = CveAlmacenVirtual
|
||||
.Add("@AlmacenAbreviatura", SqlDbType.VarChar).Value = AlmacenAbreviatura
|
||||
.Add("@CveAlmacenAgregado", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
@@ -414,7 +416,8 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean
|
||||
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Orden As Integer = -1,
|
||||
Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1, Optional AlmacenAbreviatura As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_AlmacenesUpdate")
|
||||
@@ -432,6 +435,7 @@ Public Class ClsInventarios
|
||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
|
||||
.Add("@CveAlmacenVirtual", SqlDbType.Int).Value = CveAlmacenVirtual
|
||||
.Add("@AlmacenAbreviatura", SqlDbType.VarChar).Value = AlmacenAbreviatura
|
||||
|
||||
End With
|
||||
|
||||
|
||||
@@ -2700,6 +2700,32 @@ Public Class ClsNominas
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function ReporteVacaciones(CveProyecto As Integer, CveSubProyecto As Integer, cveEmpresa As Integer, fechaInicio As String, fechaFin As String) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
Try
|
||||
DTSet = New DataSet()
|
||||
DataAdapter("PA_Nom_ReporteVacaciones", CommandType.StoredProcedure)
|
||||
SqlAdapter.SelectCommand.CommandTimeout = 2400
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
|
||||
.Add("@FechaInicio", SqlDbType.Date).Value = fechaInicio
|
||||
.Add("@FechaFin", SqlDbType.Date).Value = fechaFin
|
||||
End With
|
||||
SqlAdapter.Fill(DTSet)
|
||||
retorno = True
|
||||
Catch sqEx As SqlException
|
||||
retorno = False
|
||||
OnError("Ocurrió un error al realizar el reporte de vacaciones.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Catch ex As Exception
|
||||
retorno = False
|
||||
OnError("Ocurrió un error al realizar el reporte de vacaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
Public Function GetNominasSinTimbrar(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
Try
|
||||
|
||||
@@ -8452,7 +8452,7 @@ Public Class ClsPaginas
|
||||
RptParametro.Add(New ReportParameter("Fecha", ObjNomina.Fecha.ToString))
|
||||
RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo))
|
||||
RptParametro.Add(New ReportParameter("DiasPagados", ObjNomina.DiasPagados.ToString))
|
||||
RptParametro.Add(New ReportParameter("MetodoPago", ObjNomina.MetodoPago)) '"""PUE"" (Pago en una sola exhibición)"-
|
||||
RptParametro.Add(New ReportParameter("MetodoPago", """PUE"" (Pago en una sola exhibición)")) 'ObjNomina.MetodoPago
|
||||
RptParametro.Add(New ReportParameter("FormaPago", """99"" (Por definir)"))
|
||||
RptParametro.Add(New ReportParameter("Cantidad", "1"))
|
||||
RptParametro.Add(New ReportParameter("Unidad", "ACT"))
|
||||
@@ -9850,6 +9850,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Documentacion/TableroMaterialidadDetalle.aspx".ToUpper(), 965)
|
||||
PaginaDict.Add("/RH/DiasFestivos.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Nomina/FiniquitoB.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Nomina/ReporteVacaciones.aspx".ToUpper(), -1)
|
||||
|
||||
'------------ Páginas agregadas recientemente (Implementación Metronic) ------------
|
||||
PaginaDict.Add("/Default2.aspx".ToUpper(), -1)
|
||||
|
||||
@@ -7568,6 +7568,28 @@ Public Class ClsVentas
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Public Function GetRepVentasBiosistemas(CveEmpresa As Integer, Opcion As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasBiosistemasGetRep")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el Reporte de Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
#Region "IDisposable Support"
|
||||
|
||||
|
||||
|
||||
@@ -345,6 +345,7 @@
|
||||
<asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" />
|
||||
<asp:TextBox runat="server" ID="TxtDescuenoMasivo" ClientIDMode="Static" onkeyup="DescuenoMasivo(this)" Visible="false" Width="60px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuenoMasivo" FilterType="Custom" ValidChars="1234567890+" />
|
||||
<asp:CheckBox Text="Generar Remisión" ID="ChkGeneraRNC" CssClass="md-checksd" runat="server" Checked="false" Visible="false" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@@ -608,14 +609,27 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
var Facturas = '';
|
||||
var RNCAutocheck = true;
|
||||
|
||||
function FnSuma(t, txt, importe) {
|
||||
function FnSuma(t, txt, importe, idTxtDescuento) {
|
||||
var chkPesosBancos = $get("ChkPagarPesos");
|
||||
var chkDolaresBancos = $get("ChkPagarDolares");
|
||||
|
||||
if (t.checked) {
|
||||
|
||||
txt.value = FormatoNumero(importe, 2);
|
||||
|
||||
let txtDescuento = $("#" + idTxtDescuento)
|
||||
|
||||
if (typeof txtDescuento.val() === "string"){
|
||||
let descuentoValue = $("#" + idTxtDescuento).val().trim();
|
||||
if (descuentoValue.length > 0) {
|
||||
calculaDescuentoEscalonado(importe, idTxtDescuento, txt, t, 'El Importe no debe de exceder el saldo',1);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
txt.value = "";
|
||||
}
|
||||
@@ -644,46 +658,50 @@
|
||||
if (textBoxes[i].id.indexOf('C_GvCxP_TxtAbonar') >= 0) {
|
||||
if (textBoxes[i].value != '') {
|
||||
idd = textBoxes[i].id.replace('C_GvCxP_TxtAbonar_', '');
|
||||
Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText;
|
||||
let importeFactura = 0;
|
||||
let chk = $('#C_GvCxP_Chk_'+idd) //C_GvCxP_Chk_
|
||||
|
||||
if(chk.is(':checked')){
|
||||
Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText;
|
||||
|
||||
let importeFactura = 0;
|
||||
|
||||
if (cveMonedaPago == 0) {
|
||||
if (aplicaTC && $get('TxtTC') != null) {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
} else {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
}
|
||||
} else {
|
||||
let cveMonedaCompra = textBoxes[i].getAttribute("cvemoneda");
|
||||
if (cveMonedaPago == 0) {
|
||||
if (aplicaTC && $get('TxtTC') != null) {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
} else {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
}
|
||||
} else {
|
||||
let cveMonedaCompra = textBoxes[i].getAttribute("cvemoneda");
|
||||
|
||||
switch (cveMonedaPago) {
|
||||
case 1: //PAGO CON PESOS
|
||||
switch (cveMonedaPago) {
|
||||
case 1: //PAGO CON PESOS
|
||||
|
||||
//SI SON DOLARES MULTIPLICAR POR TC
|
||||
if (cveMonedaCompra == '2') {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
//MISMA MONEDA DEBE SOLO SUMAR
|
||||
} else if (cveMonedaCompra == '1') {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
}
|
||||
|
||||
break;
|
||||
case 2: //PAGO CON DOLARES
|
||||
|
||||
//SI SON DOLARES MULTIPLICAR POR TC
|
||||
if (cveMonedaCompra == '2') {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
//MISMA MONEDA DEBE SOLO SUMAR
|
||||
} else if (cveMonedaCompra == '1') {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
}
|
||||
|
||||
break;
|
||||
case 2: //PAGO CON DOLARES
|
||||
|
||||
//MISMA MONEDA DEBE SOLO SUMAR
|
||||
if (cveMonedaCompra == '2') {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
//SI SON PESOS DIVIDIR ENTRE EL TC
|
||||
} else if (cveMonedaCompra == '1') {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) / parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
}
|
||||
break;
|
||||
if (cveMonedaCompra == '2') {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
//SI SON PESOS DIVIDIR ENTRE EL TC
|
||||
} else if (cveMonedaCompra == '1') {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) / parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Importe = parseFloat(Importe) + importeFactura;
|
||||
Importe = parseFloat(Importe) + importeFactura;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (textBoxes[i].id.indexOf('C_GvCxP_TxtComision') >= 0) {
|
||||
@@ -714,12 +732,14 @@
|
||||
}
|
||||
|
||||
function FnCambia(chk, txt, saldo, op, text, Tipo) {
|
||||
debugger;
|
||||
|
||||
var chkPesosBancos = $get("ChkPagarPesos");
|
||||
var chkDolaresBancos = $get("ChkPagarDolares");
|
||||
if (op == 1) {
|
||||
if (txt.value != '') {
|
||||
chk.checked = true;
|
||||
if( RNCAutocheck){
|
||||
chk.checked = true;
|
||||
}
|
||||
} else {
|
||||
chk.checked = false;
|
||||
}
|
||||
@@ -831,7 +851,7 @@
|
||||
|
||||
var TipoCambioActual = 0.0;
|
||||
function CambiaTC(txt) {
|
||||
debugger;
|
||||
|
||||
//let TipoCambioTxt = ToDouble(txt.value)
|
||||
//if (TipoCambioActual != TipoCambioTxt) {
|
||||
$get("BtnCambiaTipoMoneda").click();
|
||||
@@ -839,8 +859,8 @@
|
||||
//}
|
||||
}
|
||||
|
||||
function calculaDescuentoEscalonado(saldo, TxtDescuento, TxtAbonar, chk, Text, Tipo) {
|
||||
let idTxtDescuento = TxtDescuento.id;
|
||||
function calculaDescuentoEscalonado(saldo, idTxtDescuento, TxtAbonar, chk, Text, Tipo) {
|
||||
//let idTxtDescuento = TxtDescuento.id;
|
||||
let idTxtAbonar = TxtAbonar.id;
|
||||
|
||||
let descuentoValue = $("#" + idTxtDescuento).val().trim();
|
||||
@@ -870,6 +890,8 @@
|
||||
|
||||
|
||||
function DescuenoMasivo(txt) {
|
||||
|
||||
RNCAutocheck = false;
|
||||
$(".selDescuento").val(txt.value);
|
||||
$(".selDescuento").trigger("keyup");
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo")))
|
||||
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format(" RNCAutocheck = true; FnSuma(this,{0},{1},'{2}');", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCTextBox("TxtDescuento").ClientID))
|
||||
|
||||
If FiltrarCuentas = 1 AndAlso e.Row.RowIndex = 0 Then
|
||||
e.Row.FCHyperLink("HplF").Text = (CType(GvCxP.DataSource, DataTable).Rows.Count - 1).ToString
|
||||
@@ -522,8 +522,8 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
e.Row.FCCheckBox("Chk").Visible = False
|
||||
e.Row.FCTextBox("TxtComision").Visible = False
|
||||
Else
|
||||
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format("FnCambia({0},this,{1},1,'{2}',1);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo"))
|
||||
e.Row.FCTextBox("TxtComision").Attributes.Add("onblur", String.Format("FnCambia({0},this,{1},2,'{2}',2);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo"))
|
||||
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format(" RNCAutocheck = true; FnCambia({0},this,{1},1,'{2}',1);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo"))
|
||||
e.Row.FCTextBox("TxtComision").Attributes.Add("onblur", String.Format(" RNCAutocheck = true;FnCambia({0},this,{1},2,'{2}',2);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo"))
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red
|
||||
@@ -586,7 +586,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
|
||||
e.Row.FCLiteral("LtlAux").Text = String.Format("<a Class=""Texto thickbox"" href=""/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=370&width=900"" />Ir</a>", e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveCompra"))
|
||||
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format("FnCambia({0},this,{1},1,'{2}',1);{3}", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo", FiltroInv))
|
||||
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format(" RNCAutocheck = true; FnCambia({0},this,{1},1,'{2}',1);{3}", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo", FiltroInv))
|
||||
|
||||
|
||||
|
||||
@@ -623,7 +623,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
e.Row.FCCheckBox("Chk").Enabled = False
|
||||
End If
|
||||
|
||||
e.Row.FCTextBox("TxtDescuento").Attributes.Add("onkeyup", $"calculaDescuentoEscalonado({e.Row.DBCampo("Saldo")},{e.Row.FCTextBox("TxtDescuento").ClientID},{e.Row.FCTextBox("TxtAbonar").ClientID},{e.Row.FCCheckBox("Chk").ClientID},'El Importe no debe de exceder el saldo',1)")
|
||||
e.Row.FCTextBox("TxtDescuento").Attributes.Add("onkeyup", $" calculaDescuentoEscalonado({e.Row.DBCampo("Saldo")},'{e.Row.FCTextBox("TxtDescuento").ClientID}',{e.Row.FCTextBox("TxtAbonar").ClientID},{e.Row.FCCheckBox("Chk").ClientID},'El Importe no debe de exceder el saldo',1)")
|
||||
Else
|
||||
e.Row.FCTextBox("TxtDescuento").Visible = False
|
||||
|
||||
@@ -932,62 +932,81 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
|
||||
'INICIO Descuento Remision Nota de credito
|
||||
Dim descuentoParts As String() = gvr.FCTextBox("TxtDescuento").Text.Split("+"c)
|
||||
Dim Descuento As Decimal = 0
|
||||
Dim TotalTemp As Decimal = gvr.DataKey("Saldo").ToDecimal
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(574) = "1" And ChkGeneraRNC.Checked Then
|
||||
Dim descuentoParts As String() = gvr.FCTextBox("TxtDescuento").Text.Split("+"c)
|
||||
Dim Descuento As Decimal = 0
|
||||
Dim TotalTemp As Decimal = gvr.DataKey("Saldo").ToDecimal
|
||||
|
||||
If descuentoParts.Length = 0 Then
|
||||
Descuento = 0
|
||||
Else
|
||||
If descuentoParts.Length = 0 Then
|
||||
Descuento = 0
|
||||
Else
|
||||
|
||||
For i As Integer = 0 To descuentoParts.Length - 1
|
||||
Dim descuentoPart As Decimal = descuentoParts(i).Trim().ToDecimal
|
||||
If descuentoPart > 0 Then
|
||||
Descuento = Descuento + ((TotalTemp - Descuento) * (descuentoPart / 100))
|
||||
Else
|
||||
Continue For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If Descuento > 0 Then
|
||||
|
||||
Dim PorcentajeIVA As Decimal = gvr.DataKey("PorcentajeIVA").ToDecimal
|
||||
Dim serieFolioArray As String() = gvr.DataKey("SerieFolio").ToString.Split("-"c)
|
||||
Dim SerieRNC As String = ""
|
||||
Dim FolioRNC As String = ""
|
||||
|
||||
Dim SerieFolioRNC As String = serieFolioArray(0)
|
||||
If serieFolioArray.Length = 2 Then
|
||||
SerieRNC = serieFolioArray(0)
|
||||
FolioRNC = serieFolioArray(1)
|
||||
SerieFolioRNC = $"{FolioRNC}-D-{SerieRNC = serieFolioArray(0)}"
|
||||
|
||||
For i As Integer = 0 To descuentoParts.Length - 1
|
||||
Dim descuentoPart As Decimal = descuentoParts(i).Trim().ToDecimal
|
||||
If descuentoPart > 0 Then
|
||||
Descuento = Descuento + ((TotalTemp - Descuento) * (descuentoPart / 100))
|
||||
Else
|
||||
Continue For
|
||||
FolioRNC = serieFolioArray(0)
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
Descuento = Descuento.RoundSQL(2)
|
||||
If PorcentajeIVA > 0 Then
|
||||
|
||||
If Descuento > 0 Then
|
||||
Descuento = ((Descuento) / (1 + PorcentajeIVA))
|
||||
'Descuento = ((Descuento) / (1 + PorcentajeIVA)).RoundSQL(2)
|
||||
|
||||
Dim PorcentajeIVA As Decimal = gvr.DataKey("PorcentajeIVA").ToDecimal
|
||||
Dim serieFolioArray As String() = gvr.DataKey("SerieFolio").ToString.Split("-"c)
|
||||
Dim SerieRNC As String = ""
|
||||
Dim FolioRNC As String = ""
|
||||
Dim saldo As Decimal = gvr.DataKey("Saldo").ToDecimal
|
||||
Dim abonado As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
Dim TotalRNC = Descuento + (Descuento * PorcentajeIVA).RoundSQL
|
||||
Dim dif As Decimal = saldo - (TotalRNC + abonado)
|
||||
|
||||
Dim SerieFolioRNC As String = serieFolioArray(0)
|
||||
If serieFolioArray.Length = 2 Then
|
||||
SerieRNC = serieFolioArray(0)
|
||||
FolioRNC = serieFolioArray(1)
|
||||
SerieFolioRNC = $"{FolioRNC}-D-{SerieRNC = serieFolioArray(0)}"
|
||||
If dif.Abs() >= 0.01 Then
|
||||
If dif > 0 Then
|
||||
'Descuento = Descuento + 0.01D
|
||||
End If
|
||||
|
||||
Else
|
||||
FolioRNC = serieFolioArray(0)
|
||||
End If
|
||||
If dif < 0 Then
|
||||
'Descuento = Descuento - 0.01D
|
||||
End If
|
||||
End If
|
||||
|
||||
Descuento = Descuento.RoundSQL(2)
|
||||
If PorcentajeIVA > 0 Then
|
||||
Descuento = (Descuento) / (1 + PorcentajeIVA)
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim CveCompraRNC As Integer = GeneraRNC(Descuento.RoundSQL(2), ObjComp.IniciaTransacSQL, gvr.DataKey("CveCompra").ToEntero, CompraActual, ObjMov, CvePrePoliza, CveProveedor, HplProveedor.Text, TxtFechaDocumento.Text.ToDate,
|
||||
$"Remisión Nota de Crédito pago {gvr.DataKey("SerieFolio").ToString}", gvr.DataKey("CveMoneda").ToEntero, TxtTC.Text.ToDecimal, SerieRNC, FolioRNC, PorcentajeIVA:=PorcentajeIVA,
|
||||
CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero)
|
||||
Dim CveCompraRNC As Integer = GeneraRNC(Descuento, ObjComp.IniciaTransacSQL, gvr.DataKey("CveCompra").ToEntero, CompraActual, ObjMov, CvePrePoliza, CveProveedor, HplProveedor.Text, TxtFechaDocumento.Text.ToDate,
|
||||
$"Remisión Nota de Crédito pago {gvr.DataKey("SerieFolio").ToString}", gvr.DataKey("CveMoneda").ToEntero, TxtTC.Text.ToDecimal, SerieRNC, FolioRNC, PorcentajeIVA:=PorcentajeIVA,
|
||||
CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero)
|
||||
|
||||
If CveCompraRNC > 0 Then
|
||||
If CveCompraRNC > 0 Then
|
||||
|
||||
sbRNC.AppendLine($"<a class='Texto' href='../Compras/Compras.aspx?CveCompra={CveCompraRNC}' > {SerieFolioRNC}</a><br>")
|
||||
sbRNC.AppendLine($"<a class='Texto' href='../Compras/Compras.aspx?CveCompra={CveCompraRNC}' > {SerieFolioRNC}</a><br>")
|
||||
|
||||
Else
|
||||
'TieneError = True
|
||||
MsgError = $"Error al Generar Remisión de Nota de Crédito de factura {gvr.DataKey("SerieFolio").ToString}"
|
||||
Exit For
|
||||
Else
|
||||
'TieneError = True
|
||||
MsgError = $"Error al Generar Remisión de Nota de Crédito de factura {gvr.DataKey("SerieFolio").ToString}"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'FIN Descuento Remision Nota de credito
|
||||
|
||||
|
||||
@@ -1855,6 +1874,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
GvCxP.Columns(11).Visible = chkaplicaDescuento.Checked
|
||||
TxtDescuenoMasivo.Visible = chkaplicaDescuento.Checked
|
||||
ChkGeneraRNC.Visible = chkaplicaDescuento.Checked
|
||||
UPCompras.Update()
|
||||
End Sub
|
||||
|
||||
@@ -1960,7 +1980,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
If PSRow IsNot Nothing Then
|
||||
|
||||
Dim CompraRNC As New ClsCompraManagerCompras(UsuarioActual) With {
|
||||
Dim CompraRNC As New ClsCompraManagerComprasCA(UsuarioActual) With {
|
||||
.TipoDocto = "RNC",
|
||||
.CveProveedor = CveProveedor,
|
||||
.CveTipoProveedor = CveTipoProveedor,
|
||||
@@ -1986,12 +2006,14 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
Dim PS As String = PSRow("PSCodigo").ToString
|
||||
Dim CveUM As Integer = PSRow("CveUnidadMedida").ToString.ToEntero
|
||||
Dim UM As String = PSRow("UnidadMedida").ToString
|
||||
Dim IVARNC As Decimal = (ImporteRNC * PorcentajeIVA)
|
||||
|
||||
CompraRNC.ConfiguraRegistroRapido(CvePS_RNC, CveUM, UM, CveClasificacion, Clasificacion, PS, CveSubProyectoPrincipal, SubProyecto, ImporteRNC, IVARNC, (ImporteRNC + IVARNC), PorcentajeIVA)
|
||||
Dim IVARNC As Decimal = (ImporteRNC * PorcentajeIVA).RoundSQL(2)
|
||||
Dim TotalRNC As Decimal = (ImporteRNC + IVARNC).RoundSQL(2)
|
||||
|
||||
CompraRNC.ConfiguraRegistroRapido(CvePS_RNC, CveUM, UM, CveClasificacion, Clasificacion, PS, CveSubProyectoPrincipal, SubProyecto, ImporteRNC.RoundSQL(2), IVARNC, TotalRNC, PorcentajeIVA)
|
||||
|
||||
If CompraRNC.AddCompra(sqltransaccion) Then
|
||||
Dim tImporteRNC = ImporteRNC + IVARNC ' le agrego el importe del iva
|
||||
Dim tImporteRNC = (ImporteRNC + IVARNC).RoundSQL(2) ' le agrego el importe del iva
|
||||
Dim Pago As New CompraPago
|
||||
Pago.ImportePago = tImporteRNC
|
||||
Pago.CveMonedaPago = CompraActual.CveMoneda
|
||||
@@ -2003,6 +2025,10 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
Pago.Fecha = CompraActual.Fecha 'toma la misma fecha de la provisión en el pago de NC
|
||||
CveCompraRNC = CompraRNC.CveCompra
|
||||
respuesta = Not AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
|
||||
|
||||
If Not respuesta Then
|
||||
Dim error_ As Boolean = True
|
||||
End If
|
||||
Else
|
||||
respuesta = False
|
||||
End If
|
||||
@@ -2064,7 +2090,7 @@ End Class
|
||||
|
||||
|
||||
|
||||
Public Class ClsCompraManagerCompras
|
||||
Public Class ClsCompraManagerComprasCA
|
||||
|
||||
Enum EnumCargaCompra
|
||||
DesdeXML
|
||||
|
||||
@@ -22354,6 +22354,8 @@ Partial Class Compras_Compras
|
||||
TmpDTProrrateoGasolina.Columns.Add("RetISR", GetType(Decimal))
|
||||
TmpDTProrrateoGasolina.Columns.Add("Total", GetType(Decimal))
|
||||
TmpDTProrrateoGasolina.Columns.Add("PorcentajeIVA", GetType(Decimal))
|
||||
TmpDTProrrateoGasolina.Columns.Add("RetISRPorcentaje", GetType(Decimal))
|
||||
TmpDTProrrateoGasolina.Columns.Add("RetIVAPorcentaje", GetType(Decimal))
|
||||
|
||||
TmpDTProrrateoGasolina.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDTProrrateoGasolina.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
@@ -22368,7 +22370,7 @@ Partial Class Compras_Compras
|
||||
|
||||
Protected Sub LnkProrrateoGasolina_Click(sender As Object, e As EventArgs)
|
||||
|
||||
InicializaDTProrrateoGasolina()
|
||||
'InicializaDTProrrateoGasolina()
|
||||
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoProrrateoGasolina,)
|
||||
GvProrrateoGasolina.Columns(0).HeaderText = LblSubProyectoProrrateoGasolina.Text
|
||||
LblRiruloProrrareo.Text = $"Prorratear por { LblSubProyectoProrrateoGasolina.Text}"
|
||||
@@ -22517,15 +22519,15 @@ Partial Class Compras_Compras
|
||||
nRow("CveSubProyecto") = CveSubProyecto
|
||||
nRow("SubProyecto") = SubProyecto
|
||||
|
||||
If CveFactura > 0 Then
|
||||
nRow("IVA") = ivaParcial.RoundSQL(4)
|
||||
nRow("RetIVA") = retIvaParcial.RoundSQL(4)
|
||||
nRow("RetISR") = retIsrParcial.RoundSQL(4)
|
||||
Else
|
||||
nRow("IVA") = (ivaParcial / subtotalParcial).RoundSQL(4)
|
||||
nRow("RetIVA") = (retIvaParcial / subtotalParcial).RoundSQL(4)
|
||||
nRow("RetISR") = (retIsrParcial / subtotalParcial).RoundSQL(4)
|
||||
End If
|
||||
'If CveFactura > 0 Then
|
||||
nRow("IVA") = ivaParcial.RoundSQL(4)
|
||||
nRow("RetIVA") = retIvaParcial.RoundSQL(4)
|
||||
nRow("RetISR") = retIsrParcial.RoundSQL(4)
|
||||
'Else
|
||||
'nRow("IVA") = (ivaParcial / subtotalParcial).RoundSQL(4)
|
||||
'nRow("RetIVA") = (retIvaParcial / subtotalParcial).RoundSQL(4)
|
||||
'nRow("RetISR") = (retIsrParcial / subtotalParcial).RoundSQL(4)
|
||||
'End If
|
||||
|
||||
nRow("SubTotal") = subtotalParcial.RoundSQL(4)
|
||||
|
||||
@@ -22533,6 +22535,8 @@ Partial Class Compras_Compras
|
||||
nRow("PorcentajeIVA") = (ivaParcial / subtotalParcial).RoundSQL(4)
|
||||
nRow("Porcentaje") = ((totalParcialDeseado.RoundSQL(4) * 100) / TotalOriginal).RoundSQL(2)
|
||||
|
||||
nRow("RetIVAPorcentaje") = (retIvaParcial / subtotalParcial).RoundSQL(4)
|
||||
nRow("RetISRPorcentaje") = (retIsrParcial / subtotalParcial).RoundSQL(4)
|
||||
|
||||
nRow("CveUM") = CveUM
|
||||
nRow("UM") = UM
|
||||
@@ -22584,7 +22588,8 @@ Partial Class Compras_Compras
|
||||
TmpDT.Rows.Clear()
|
||||
For Each dRow As DataRow In DTProrrateoGasolina.Rows
|
||||
AddPS(1, dRow("CveUM").ToString.ToEntero, dRow("UM").ToString, dRow("CveClasificacion").ToString.ToEntero, dRow("Clasificacion").ToString, dRow("CvePS").ToString.ToEntero, dRow("PS").ToString, 1, dRow("CveSubProyecto").ToString, dRow("SubProyecto").ToString, "",
|
||||
"-1", "", dRow("SubTotal").ToString.ToDecimal, dRow("Total").ToString.ToDecimal, dRow("PorcentajeIVA").ToString.ToDecimal, dRow("RetIVA").ToString.ToDecimal, dRow("RetISR").ToString.ToDecimal, 0, 0, 0, PorcentajeIVA:=dRow("PorcentajeIVA").ToString.ToDecimal)
|
||||
"-1", "", dRow("SubTotal").ToString.ToDecimal, dRow("Total").ToString.ToDecimal, dRow("IVA").ToString.ToDecimal, dRow("RetIVA").ToString.ToDecimal, dRow("RetISR").ToString.ToDecimal, 0, 0, 0, PorcentajeIVA:=dRow("PorcentajeIVA").ToString.ToDecimal,
|
||||
CargaXml:=True, PorcentajeRetIVA:=dRow("RetIVAPorcentaje").ToString.ToDecimal, PorcentajeRetISR:=dRow("RetISRPorcentaje").ToString.ToDecimal)
|
||||
Next
|
||||
|
||||
AddPS2()
|
||||
|
||||
@@ -151,18 +151,20 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta,CveUsuarioAutoriza,CveAlmacenVirtual" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta,CveUsuarioAutoriza,CveAlmacenVirtual,AlmacenAbreviatura"
|
||||
EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="20%" HeaderText="Almacen">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAlmacen" runat="server" Text='<%# Eval("Almacen") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField ItemStyle-Width="10%" HeaderText="Sucursal">
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="20%" HeaderText="Abreviatura">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("Sucursal", "{0}") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlAlmacenAbreviatura" runat="server" Text='<%# Eval("AlmacenAbreviatura") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="10%" HeaderText="SubProyecto">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto", "{0}") %>'></asp:Literal>
|
||||
@@ -230,11 +232,19 @@
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyAlmacen" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAlmacen" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtAlmacen" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50" ></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVAlmacen" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAlmacen" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacén''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtAlmacen" runat="server" Text="Almacén:"></asp:Label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAlmacenAbreviatura" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50" ></asp:TextBox>
|
||||
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAlmacen" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacén''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>--%>
|
||||
<asp:Label AssociatedControlID="TxtAlmacenAbreviatura" runat="server" Text="Abreviatura:"></asp:Label>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%-- <div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
@@ -260,7 +260,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero,
|
||||
CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero()) Then
|
||||
CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero(), AlmacenAbreviatura:=TxtAlmacenAbreviatura.Text) Then
|
||||
Alert("El nuevo Almacen se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpDatos.Update()
|
||||
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
@@ -270,7 +270,9 @@ Partial Class Inventarios_CatAlmacenes
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, DdlModalidad.SelectedValue.ToEntero, Estatus, HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero, CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero) Then
|
||||
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, DdlModalidad.SelectedValue.ToEntero, Estatus, HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero,
|
||||
UsuarioActual.CveEmpresa, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero, CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero,
|
||||
AlmacenAbreviatura:=TxtAlmacenAbreviatura.Text) Then
|
||||
Alert("El Almacen se actualizo correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpDatos.Update()
|
||||
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
@@ -295,6 +297,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
BtnAgregarAlmacen.Text = "Agregar"
|
||||
myModalLabel.InnerText = "Agregar Almacén"
|
||||
TxtAlmacen.Text = ""
|
||||
TxtAlmacenAbreviatura.Text = ""
|
||||
TxtOrden.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
divEstatus.Visible = False
|
||||
@@ -335,6 +338,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
DdlTipoAlmacen.SelectedValueExist(GvRow.DataKey("CveTipoAlmacen"))
|
||||
TxtAlmacen.Text = GvRow.DataKey("Almacen")
|
||||
TxtAlmacenAbreviatura.Text = GvRow.DataKey("AlmacenAbreviatura")
|
||||
TxtOrden.Text = GvRow.DataKey("Orden")
|
||||
DdlUsuariosAutoriza.SelectedValueExist(If(GvRow.DataKey("CveUsuarioAutoriza").ToEntero > 0, GvRow.DataKey("CveUsuarioAutoriza"), "-1"))
|
||||
DdlAlmacenesVirtuales.SelectedValueExist(GvRow.DataKey("CveAlmacenVirtual"))
|
||||
|
||||
154
Nomina/ReporteVacaciones.aspx
Normal file
154
Nomina/ReporteVacaciones.aspx
Normal file
@@ -0,0 +1,154 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ReporteVacaciones.aspx.cs" Inherits="Nomina_ReporteVacaciones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
/*.text-right {
|
||||
text-align:right
|
||||
}*/
|
||||
td.borderleft,th.borderleft{
|
||||
border-left:1px solid black !important;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte Vacaciones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpContenido" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
|
||||
<label class="col-md-1 mediocol">Inicio:</label>
|
||||
<div class="col-md-1">
|
||||
<%--<asp:TextBox ID="TxtPeriodoInicio" Text="0" CssClass="form-control" runat="server"></asp:TextBox>--%>
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="TxtRpdFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 80px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkRpdFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtRpdFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender3" TargetControlID="TxtRpdFechaInicio" PopupButtonID="LnkRpdFechaInicio" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvRpdFechaInicio" runat="server" ControlToValidate="TxtRpdFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="VGReporterepperde"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaInicio"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-1 mediocol">Fin:</label>
|
||||
<div class="col-md-1">
|
||||
<%--<asp:TextBox ID="TxtPeriodoFin" Text="99" CssClass="form-control" runat="server"></asp:TextBox>--%>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="TxtRpdFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 80px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender5" runat="server" TargetControlID="TxtRpdFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender4" TargetControlID="TxtRpdFechaFin" PopupButtonID="LnkFechaFin" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvRpdFechaFin" runat="server" ControlToValidate="TxtRpdFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor ingréselo." ValidationGroup="VGReporterepperde"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaFin"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<asp:Label ID="LblProyecto" CssClass="col-md-1 compoonenlabel" runat="server" Text="Proyecto:" Style="max-width: 100px;"></asp:Label>
|
||||
<div runat="server" id="divddlproyeto" class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" CssClass="select2me" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<asp:Label ID="LblSubProyeccto" CssClass="col-md-1 compoonenlabel" runat="server" Text="SubProyecto:" Style="max-width: 103px;"></asp:Label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<asp:LinkButton ID="LnkConsultar" OnClick="LnkConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="expand" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<table id="gvReporteVacaciones" class="table table-striped table-advance table-hover ScrollAD Widthall gvReporteVacaciones" data-rows="2" data-heighterror="360">
|
||||
<%-- <thead>
|
||||
</thead>--%>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<%-- Encabezados dinámicos para los ejercicios --%>
|
||||
|
||||
<asp:Repeater ID="RepeaterEjerciciosH1" runat="server">
|
||||
<ItemTemplate>
|
||||
<th class="borderleft" colspan="3"><%# Eval("Ejercicio") %></th>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Código</th>
|
||||
<th>Nombre Completo</th>
|
||||
<th>Fecha Inicio</th>
|
||||
<%-- Encabezados dinámicos para los ejercicios --%>
|
||||
|
||||
<asp:Repeater ID="RepeaterEjerciciosH2" runat="server">
|
||||
<ItemTemplate>
|
||||
<th class="borderleft">Antigüedad</th>
|
||||
<th>Días Vacaciones</th>
|
||||
<th>Días Pagados</th>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
</tr>
|
||||
<asp:Repeater ID="RepeaterPrincipal" runat="server">
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<tr>
|
||||
<%--<td><%# Eval("CvePersonal") %></td>--%>
|
||||
<td>
|
||||
<asp:HyperLink runat="server" Text='<%# Eval("Codigo") %>' NavigateUrl='<%# Eval("CvePersonal", "~/RH/Personal.aspx?CvePersonal={0}") %>'></asp:HyperLink></td>
|
||||
<td>
|
||||
<asp:HyperLink runat="server" Text='<%# Eval("NombreCompleto") %>' NavigateUrl='<%# Eval("CvePersonal", "~/RH/Personal.aspx?CvePersonal={0}") %>'></asp:HyperLink></td>
|
||||
<td><%# Eval("FechaInicio", "{0:yyyy-MM-dd}") %></td>
|
||||
<%-- Subrepeater para los ejercicios --%>
|
||||
<asp:Repeater ID="RepeaterEjercicios" runat="server" DataSource='<%# Eval("Ejercicios") %>'>
|
||||
<ItemTemplate>
|
||||
<td class="text-right borderleft"><%# Convert.ToInt32(Eval("Antiguedad")) > 0 ? Eval("Antiguedad") : "" %></td>
|
||||
<td class="text-right "><%# Convert.ToInt32(Eval("Antiguedad")) > 0 ? Eval("DiasVacaciones") : "" %></td>
|
||||
<td class="text-right "><%# Convert.ToInt32(Eval("Antiguedad")) > 0 ? Eval("DiasPagados") : "" %></td>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
</tr>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
</FooterTemplate>
|
||||
</asp:Repeater>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
171
Nomina/ReporteVacaciones.aspx.cs
Normal file
171
Nomina/ReporteVacaciones.aspx.cs
Normal file
@@ -0,0 +1,171 @@
|
||||
using ADSNetLibrary.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class Nomina_ReporteVacaciones : ClsPaginas
|
||||
{
|
||||
#region "Propiedades"
|
||||
protected int FiltCveProyecto
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["FiltCveProyecto"] == null) { return -1; }
|
||||
else { return ViewState["FiltCveProyecto"].ToString().ToEntero(); }
|
||||
}
|
||||
|
||||
set { ViewState["FiltCveProyecto"] = value; }
|
||||
}
|
||||
protected int FiltCveSubProyecto
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["FiltCveSubProyecto"] == null) { return -1; }
|
||||
else { return ViewState["FiltCveSubProyecto"].ToString().ToEntero(); }
|
||||
}
|
||||
|
||||
set { ViewState["FiltCveSubProyecto"] = value; }
|
||||
}
|
||||
protected string FiltFechaInicio
|
||||
{
|
||||
get
|
||||
{
|
||||
string fecha = $"{DateTime.Now.Year - 3}-01-01";
|
||||
if (ViewState["FiltFechaInicio"] == null) { return fecha ; }
|
||||
else { return ViewState["FiltFechaInicio"].ToString(); }
|
||||
}
|
||||
|
||||
set { ViewState["FiltFechaInicio"] = value; }
|
||||
}
|
||||
protected string FiltFechaFin
|
||||
{
|
||||
get
|
||||
{
|
||||
string fecha = $"{DateTime.Now.Year}-12-31";
|
||||
if (ViewState["FiltFechaFin"] == null) { return fecha; }
|
||||
else { return ViewState["FiltFechaFin"].ToString(); }
|
||||
}
|
||||
|
||||
set { ViewState["FiltFechaFin"] = value; }
|
||||
}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
TxtRpdFechaInicio.Text = $"{FiltFechaInicio.ToDateTime():dd/MM/yyyy}";
|
||||
TxtRpdFechaFin.Text = $"{FiltFechaFin.ToDateTime():dd/MM/yyyy}";
|
||||
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyeccto);
|
||||
divddlproyeto.Visible = DdlProyecto.Visible;
|
||||
getinfo();
|
||||
}
|
||||
}
|
||||
public void getinfo()
|
||||
{
|
||||
using (ClsNominas objnom = new ClsNominas())
|
||||
{
|
||||
if (objnom.ReporteVacaciones(FiltCveProyecto, FiltCveSubProyecto, UsuarioActual.CveEmpresa, FiltFechaInicio, FiltFechaFin))
|
||||
{
|
||||
DataTable tabla1 = objnom.DTSetResultados.Tables[0]; // Simula tu tabla 1
|
||||
DataTable tabla2 = objnom.DTSetResultados.Tables[1]; // Simula tu tabla 2
|
||||
DataTable tabla3 = objnom.DTSetResultados.Tables[2]; // Simula tu tabla 3
|
||||
RepeaterEjerciciosH1.DataSource= tabla3;
|
||||
RepeaterEjerciciosH2.DataSource= tabla3;
|
||||
RepeaterEjerciciosH1.DataBind();
|
||||
RepeaterEjerciciosH2.DataBind();
|
||||
// Convertir Tabla 1 a Enumerable con un campo extra
|
||||
List<Registro> resultado = tabla1.AsEnumerable().Select(row1 => new Registro()
|
||||
{
|
||||
CvePersonal = row1.Field<int>("CvePersonal"),
|
||||
Codigo = row1.Field<string>("Codigo"),
|
||||
NombreCompleto = row1.Field<string>("NombreCompleto"),
|
||||
//FechaFin = (row1("FechaFin")).ToString().,
|
||||
FechaInicio = row1.Field<DateTime>("FechaInicio"),
|
||||
FechaAntiguedad = row1.Field<DateTime>("FechaAntiguedad"),
|
||||
Antiguedad = row1.Field<int>("Antiguedad"),
|
||||
|
||||
// Campo extra: Enumerable para cada Ejercicio de Tabla 3
|
||||
Ejercicios = tabla3.AsEnumerable().Select(row3 =>
|
||||
{
|
||||
var ejercicio = row3.Field<int>("Ejercicio");
|
||||
|
||||
// Buscar en Tabla 2 si existe el registro para CvePersonal y Ejercicio
|
||||
var registro = tabla2.AsEnumerable().FirstOrDefault(row2 =>
|
||||
row2.Field<int>("CvePersonal") == row1.Field<int>("CvePersonal") &&
|
||||
row2.Field<int>("EJercicio") == ejercicio);
|
||||
|
||||
// Si no existe, crear un nuevo registro
|
||||
if (registro == null)
|
||||
{
|
||||
return new EjercicioInfo()
|
||||
{
|
||||
Ejercicio = ejercicio,
|
||||
FechaAntiguedad = row1.Field<DateTime>("FechaAntiguedad"),
|
||||
Antiguedad = 0,
|
||||
DiasVacaciones = 0, // Valor predeterminado
|
||||
DiasPagados = 0, // Valor predeterminado
|
||||
DiasDisfrutados = 0 // Valor predeterminado
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si existe, devolver los datos de la Tabla 2
|
||||
return new EjercicioInfo()
|
||||
{
|
||||
Ejercicio = registro.Field<int>("EJercicio"),
|
||||
FechaAntiguedad = registro.Field<DateTime>("FechaAntiguedad"),
|
||||
Antiguedad = registro.Field<int>("Antiguedad"),
|
||||
DiasVacaciones = registro.Field<int>("DiasVacaciones"),
|
||||
DiasPagados = registro.Field<int>("DiasPagados"),
|
||||
DiasDisfrutados = registro.Field<int>("DiasDisfrutados")
|
||||
};
|
||||
}
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
RepeaterPrincipal.DataSource = resultado;
|
||||
RepeaterPrincipal.DataBind();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void LnkConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
FiltFechaInicio = $"{TxtRpdFechaInicio.Text.ToDateTime():yyyy-MM-dd}";
|
||||
FiltFechaFin = $"{TxtRpdFechaFin.Text.ToDateTime():yyyy-MM-dd}";
|
||||
getinfo();
|
||||
}
|
||||
}
|
||||
|
||||
public class Registro
|
||||
{
|
||||
public int CvePersonal { get; set; }
|
||||
public string Codigo { get; set; }
|
||||
public string NombreCompleto { get; set; }
|
||||
public DateTime FechaInicio { get; set; }
|
||||
public DateTime FechaFin { get; set; }
|
||||
public DateTime FechaAntiguedad { get; set; }
|
||||
public int Antiguedad { get; set; }
|
||||
public List<EjercicioInfo> Ejercicios { get; set; }
|
||||
}
|
||||
|
||||
public class EjercicioInfo
|
||||
{
|
||||
public int Ejercicio { get; set; }
|
||||
public DateTime FechaAntiguedad { get; set; }
|
||||
public int Antiguedad { get; set; }
|
||||
public int DiasVacaciones { get; set; }
|
||||
public int DiasPagados { get; set; }
|
||||
public int DiasDisfrutados { get; set; }
|
||||
}
|
||||
@@ -101,9 +101,20 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkDescargaCartaPorte" OnClick="LnkDescargaCartaPorte_Click" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Descarga Carta Porte</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkGeneraXLS1" OnClick="LnkGeneraXLS1_Click" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Generar XLS 1</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkGeneraXLS2" OnClick="LnkGeneraXLS2_Click" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Generar XLS 2</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkDescargaCartaPorte" />
|
||||
<asp:PostBackTrigger ControlID="LnkGeneraXLS1" />
|
||||
<asp:PostBackTrigger ControlID="LnkGeneraXLS2" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
@@ -153,6 +153,12 @@ Partial Class Ventas_RepVentas
|
||||
PrePersonalizacion()
|
||||
CargaPersonalizacion()
|
||||
|
||||
|
||||
If UsuarioActual.CveEmpresa = 199 Then
|
||||
LnkGeneraXLS1.Visible = True
|
||||
LnkGeneraXLS2.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -1058,4 +1064,41 @@ Partial Class Ventas_RepVentas
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkGeneraXLS1_Click(sender As Object, e As EventArgs)
|
||||
RepVentasBioSistemas(1)
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkGeneraXLS2_Click(sender As Object, e As EventArgs)
|
||||
RepVentasBioSistemas(2)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub RepVentasBioSistemas(OpcionReporte As Integer)
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
Dim DTResultados As New DataTable
|
||||
|
||||
If ObjVentas.GetRepVentasBiosistemas(UsuarioActual.CveEmpresa, OpcionReporte) Then
|
||||
DTResultados = ObjVentas.DtResultados
|
||||
End If
|
||||
|
||||
|
||||
Dim NombreReporte As String = "Reporte 1"
|
||||
Dim TituloReporte As String = "Reporte 1"
|
||||
DTResultados.TableName = "Reporte1"
|
||||
|
||||
If OpcionReporte = 2 Then
|
||||
NombreReporte = "Reporte 2"
|
||||
TituloReporte = "Reporte1 2"
|
||||
DTResultados.TableName = "Reporte2"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
DTResultados.ExportToExcelG(NombreReporte, TituloReporte, UsuarioActual, "")
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user