This commit is contained in:
2022-06-18 11:20:13 -07:00
parent 8a5eae3654
commit b925b5b408
9 changed files with 113 additions and 125 deletions

View File

@@ -1,13 +1,10 @@
using System;
using Extensiones;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
using static Extensiones.ModExtensiones;
public partial class Bancos_Devoluciones : ClsPaginas
@@ -111,11 +108,11 @@ public partial class Bancos_Devoluciones : ClsPaginas
ComprobanteMuestraOculta();
CargaTipoTransaccion(tipo);
}
protected void TipoDevolucion_SelectedIndexChanged(object sender, EventArgs e)
{
{
switch (TipoDevolucion.SelectedValue)
{
case "1":
@@ -139,7 +136,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2)
{
Anexo.Text = "";
DvComprobante.Visible = false;
DvComprobante.Visible = false;
}
else
{
@@ -163,7 +160,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
protected void CargaSubProyectos()
{
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa:UsuarioActual.CveEmpresa);
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
DdlSubProyecto.DataBind();
DdlSubProyecto.Items.Insert(0, new ListItem("Seleccione SubProyecto", "-1"));
}
@@ -358,14 +355,14 @@ public partial class Bancos_Devoluciones : ClsPaginas
#region"GUARDAR"
protected void BtnGuardar_Click(object sender, EventArgs e)
{
//inician validaciones
//inician validaciones
if (OpcionDevolucion.SelectedValue.ToEntero() != 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() != 2 && TxtImporte.Text == "")
{
Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia);
return;
Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia);
return;
}
if (OpcionDevolucion.SelectedValue == "3" && TipoDevolucion.SelectedValue == "2")
if (OpcionDevolucion.SelectedValue == "3" && TipoDevolucion.SelectedValue == "2")
{
if (TxtValor.Text == "")
{
@@ -382,8 +379,8 @@ public partial class Bancos_Devoluciones : ClsPaginas
return;
}
else
{
if (valor ==0)
{
if (valor == 0)
{
Alert("No se han seleccionado opciones", TipoMensaje.MsgAdvertencia);
return;
@@ -400,7 +397,8 @@ public partial class Bancos_Devoluciones : ClsPaginas
List<Archivo> filesgral = Anexo.getfiles().Archivos;
string filemove = "";
string Comprobante = "";
foreach(Archivo fileItem in filesgral){
foreach (Archivo fileItem in filesgral)
{
Comprobante = System.IO.Path.GetExtension(String.Format("{0}Temp\\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "");
filemove = fileItem.filename;
}
@@ -465,7 +463,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
// DATOS PREPOLIZA
if ( DdlTipoTransanccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
if (DdlTipoTransanccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), 1, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: CveTipoPoliza);
if (CvePrePoliza > 0)
@@ -475,25 +473,25 @@ public partial class Bancos_Devoluciones : ClsPaginas
if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2)
{
int cveConcepto = DdlConcepto.SelectedValue.ToEntero();
string descripcion = TxtDescripcion.Text;
int tipoDescuento = 1;
double valor = TxtValor.Text.ToDouble();
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
decimal montoLimite = 0;
string fechaInicioAplicacion = DateTime.Now.ToString("yyyy/MM/dd");
bool estatus = true;
int CveCuenta = -1;
int CveMovtoPermanente = ObjNom.AddMovtoPermanente(cveConcepto, cvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta);
int cveConcepto = DdlConcepto.SelectedValue.ToEntero();
string descripcion = TxtDescripcion.Text;
int tipoDescuento = 1;
double valor = TxtValor.Text.ToDouble();
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
decimal montoLimite = 0;
string fechaInicioAplicacion = DateTime.Now.ToString("yyyy/MM/dd");
bool estatus = true;
int CveCuenta = -1;
int CveMovtoPermanente = ObjNom.AddMovtoPermanente(cveConcepto, cvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta);
if (CveMovtoPermanente < 0)
{
MsgError = "No se pudo insertar movimiento permanente";
}
if (CveMovtoPermanente < 0)
{
MsgError = "No se pudo insertar movimiento permanente";
}
foreach (GridViewRow gvr in GvDevoluciones.Rows)
{
@@ -515,7 +513,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
}
}
}
}
}
else
@@ -605,7 +603,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
{
MsgError = "No se insertó movimiento bancario";
}
}
}
}
else
{
@@ -674,7 +672,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
{
archivo = new System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero()));
}
if (IDPoliza > 0)
{
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza);
@@ -699,7 +697,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
Msg.Clear();
Alert(Msg.ToString(), TipoMensaje.MsgError);
}
ObjIE.Dispose();
ObjMov.Dispose();
@@ -718,8 +716,8 @@ public partial class Bancos_Devoluciones : ClsPaginas
DataTable dt = onom.DtResultados.FiltraParametros(" FormulaTotal = 'FNC.[MovimientosPermanentes]'");
DdlConcepto.Items.Clear();
DdlConcepto.DataSource = dt.FiltraParametros("Tipo ='D'");
DdlConcepto.DataSource = dt.FiltraParametros("Tipo ='D'");
DataRow drow = dt.NewRow();
drow["CveConcepto"] = "-1";
drow["Concepto"] = "Seleccione";