diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index b06d1b586..c04c98792 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -199,7 +199,8 @@ Public Class ClsCompras Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1, Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Decimal = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Integer = 0, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Decimal = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1, - Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional DoctosRelacionados As String = "-1", Optional CveFolioGarantia As Integer = -1) As Boolean + Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional DoctosRelacionados As String = "-1", Optional CveFolioGarantia As Integer = -1, + Optional CveCompraRelacionada As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -255,6 +256,7 @@ Public Class ClsCompras .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@DoctosRelacionados", SqlDbType.VarChar).Value = DoctosRelacionados .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia + .Add("@CveCompraRelacionada", SqlDbType.Int).Value = CveCompraRelacionada End With Try diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index cf04e3794..81d96ea9f 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -6311,7 +6311,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function UpdatePedidoDetalleCantidad(CveVentaDetalle As Integer, Cantidad As Decimal, Optional Opcion As Integer = 1) As Boolean + Public Function UpdatePedidoDetalleCantidad(CveVentaDetalle As Integer, Cantidad As Decimal, CveUsuario As Integer, Optional Opcion As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasDetalleCantidadUpdate") @@ -6319,6 +6319,7 @@ Public Class ClsInventarios .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle .Add("@Cantidad", SqlDbType.Money).Value = Cantidad .Add("@Opcion", SqlDbType.Int).Value = Opcion + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 75066cbde..7b817d862 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9809,11 +9809,11 @@ Public Class ClsPaginas Public Property SerieFolio As String = "" Public Property ClienteNombre As String = "" Public Property TC As Decimal = 1 - Public Property Total As Decimal - Public Property IVA As Decimal - Public Property IEPS As Decimal - Public Property RetIVA As Decimal - Public Property RetISR As Decimal + Public Property Total As Decimal = 0 + Public Property IVA As Decimal = 0 + Public Property IEPS As Decimal = 0 + Public Property RetIVA As Decimal = 0 + Public Property RetISR As Decimal = 0 Public Property PorcentajeIVA As Decimal Public Property CveSubProyecto As Integer Public Property CveUsoCFDI As Integer diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index bb81bc959..484068c11 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -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" diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 1b88ed2c4..419794e5b 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1488,7 +1488,8 @@ Namespace Modelos Optional CveSubProyecto As Integer = -1, Optional SubProyecto As String = "", Optional PorcentajeIVA As Decimal = -1, Optional CuentaPredial As String = "", Optional CveVentaDetallePadre As Integer = -1, - Optional CveVentaDetalleRemision As Integer = -1, Optional CveViajePasajero As Integer = -1, Optional RedondearTotal As Boolean = True) As Boolean + Optional CveVentaDetalleRemision As Integer = -1, Optional CveViajePasajero As Integer = -1, Optional RedondearTotal As Boolean = True, + Optional CvePromocionDetalle As Integer = -1) As Boolean If Not CvePS > 0 Then Alert("Ocurrió un error al cargar la información del producto a agregar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgError) @@ -1651,7 +1652,6 @@ Namespace Modelos Row("IEPS") = Row("ImporteIEPS") Row("Descuento") = (Descuento).RoundSQL(NumeroDecimales) Row("TipoDescuento") = -1 - Row("CvePromocionDetalle") = -1 If RedondearTotal Then Row("Total") = (Cantidad * PU).RoundSQL(NumeroDecimales) @@ -1678,6 +1678,7 @@ Namespace Modelos Row("CveVentaDetallePedido2") = -1 Row("CuentaPredial") = CuentaPredial Row("EsCargo") = 0 + Row("CvePromocionDetalle") = CvePromocionDetalle If Me.DtDetalle.Columns.Contains("CveMarca") Then Row("CveMarca") = DrPS("CveMarca") @@ -2258,7 +2259,7 @@ Namespace Modelos Row("PU").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Math.Round((Row("Total").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), Row("Obs").ToString, Row("Descuento").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, TiempoEntrega:=Row("TiempoEntrega").ToString, CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, - CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1), + CvePromocionDetalle:=Row("CvePromocionDetalle").ToString.ToEntero, IEPS:=Row("ImporteIEPS").ToString.ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero, ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString, diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index ca85d2adb..42d378a46 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -832,13 +832,13 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe If ObjFactura.TipoDocto = "Cot" Then If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then If ObjClientes.DtResultados.Rows.Count > 0 Then - ObjFactura.CveFormaPago = ObjClientes.CveFormaPago33 - ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33)) - ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33)) + ObjFactura.CveFormaPago = ObjClientes.CveFormaPago + ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago)) + ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago)) - ObjFactura.CveMetodoPago = ObjClientes.CveMetodoPago33 - ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33)) - ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33)) + ObjFactura.CveMetodoPago = ObjClientes.CveMetodoPago + ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago)) + ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago)) ObjFactura.CveUsoCFDI = ObjClientes.CveUsoCFDI ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI)) diff --git a/Ashx/E194.ashx b/Ashx/E194.ashx index d5604d293..ffceffa11 100644 --- a/Ashx/E194.ashx +++ b/Ashx/E194.ashx @@ -326,13 +326,13 @@ Public Class E194 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe Dim ObjCliente As New ClsClientes If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then If ObjCliente.DtResultados.Rows.Count > 0 Then - ObjFactura.CveFormaPago = ObjCliente.CveFormaPago33 - ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) + ObjFactura.CveFormaPago = ObjCliente.CveFormaPago + ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago)) + ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago)) - ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago33 - ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) - ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) + ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago + ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)) + ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)) ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index baabe5df8..f13ce480c 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -314,13 +314,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Dim ObjCliente As New ClsClientes If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then If ObjCliente.DtResultados.Rows.Count > 0 Then - ObjFactura.CveFormaPago = ObjCliente.CveFormaPago33 - ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) + ObjFactura.CveFormaPago = ObjCliente.CveFormaPago + ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago)) + ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago)) - ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago33 - ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) - ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) + ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago + ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)) + ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)) ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 37fce5bfc..12275d7f1 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -26,9 +26,7 @@ -
  • - Póliza -
  • +
  • @@ -62,7 +60,12 @@
  • Envíar Comprobante Mail
  • - +
  • + Ver Póliza +
  • +
  • + Imprimir Póliza +
  • diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index b419b6dd1..8cec942a6 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -863,6 +863,8 @@ Partial Class Bancos_IE ViewState("CvePrePoliza") = ObjIE.DtResultados.Rows(0)("CvePrePoliza").ToString.ToEntero HpLPrePoliza.NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", ViewState("CvePrePoliza")) HpLPrePoliza.Visible = True + LnkDescargaPoliza.Visible = True + LnkDescargaPoliza.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=PREPO&CvePrePoliza={0}", ViewState("CvePrePoliza")))}" TxtFechaDocumento.Text = ObjIE.FechaDocumento.ToShortDateString TxtFolio.Text = ObjIE.Folio LblBeneficiario.Text = ObjIE.PagueseA diff --git a/Bancos/PagoAcreedor.aspx b/Bancos/PagoAcreedor.aspx index eeca92ae5..bf3356817 100644 --- a/Bancos/PagoAcreedor.aspx +++ b/Bancos/PagoAcreedor.aspx @@ -28,7 +28,8 @@
    - + @@ -71,6 +72,12 @@ + + + +
    @@ -155,7 +162,8 @@
    - + @@ -201,6 +209,12 @@ + + + +
    diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 2605d9662..9643bbd97 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -12,7 +12,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas { #region "PROPIEDADES" - + private int CveMonedaCuentaPago { get @@ -36,7 +36,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) - { + { CveMonedaCuentaPago = 0; rowComisiones.Visible = true; @@ -53,18 +53,21 @@ public partial class Bancos_PagoAcreedor : ClsPaginas CargarCentrosDeCosto(null, null, null, LblSubProyecto); LblSubProyecto2.Text = LblSubProyecto.Text; + ValidaFechaDocumentoDiasPosterioresPrestamo(); + ValidaFechaDocumentoDiasPosteriores(); + } } private void CargaSubproyectos() { - DdlSubProyecto.DataSource = get_GlobalDTSubProyectos( UsuarioActual.CveEmpresa); + DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(UsuarioActual.CveEmpresa); DdlSubProyecto.DataBind(); DdlSubProyecto.Items.Insert(0, new ListItem("Seleccione", "-1")); - DdlSubProyectoPago.DataSource = get_GlobalDTSubProyectos( UsuarioActual.CveEmpresa); + DdlSubProyectoPago.DataSource = get_GlobalDTSubProyectos(UsuarioActual.CveEmpresa); DdlSubProyectoPago.DataBind(); DdlSubProyectoPago.Items.Insert(0, new ListItem("Seleccione", "-1")); @@ -116,7 +119,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas CveMonedaCuentaPago = 0; if (dr != null) { - CveMonedaCuentaPago = dr["CveMoneda"].ToString().ToEntero(); + CveMonedaCuentaPago = dr["CveMoneda"].ToString().ToEntero(); } if (CveMonedaCuentaPago != 1) @@ -144,8 +147,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas bancos.Dispose(); TxtFolio.Text = Folio.ToString(); - - TxtDDImporte.Attributes.Add("onblur",$"validaDeudoresDiversos({CveMonedaCuentaPago});FormatoMoneda(this);"); + + TxtDDImporte.Attributes.Add("onblur", $"validaDeudoresDiversos({CveMonedaCuentaPago});FormatoMoneda(this);"); UpDatos.Update(); } @@ -231,7 +234,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas { decimal ImporteBanco = TxtImporte.Text.ToDecimal(); decimal ImporteMNBanco = ImporteBanco; - decimal ImporteComplementaria = 0; + decimal ImporteComplementaria = 0; decimal TCPago = TxtTCPago.Text.ToDecimal(); string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; @@ -243,14 +246,14 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (CveIE > 0) { - + decimal Importe; decimal ImporteMN; decimal ImporteComision; decimal ImporteComisionMN; decimal AcumImporteMN = 0; decimal ImporteBancosMN, ImporteAcreedorMN; - bool TipoMovtoComision = false; + bool TipoMovtoComision = false; int CveConceptoDiferenciaCambiaria = 0; //GUARDA PREPOLIZAS DETALLE @@ -262,7 +265,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas ImporteAcreedorMN = Importe; ImporteBancosMN = Importe; ImporteComisionMN = ImporteComision; - ImporteComplementaria = 0; + ImporteComplementaria = 0; if (gvr.FCTextBox("TxtComision").Text.ToDecimal() < 0) { @@ -273,7 +276,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas else { TipoMovtoComision = false; - } + } if (gvr.FCCheckBox("Chk").Checked) { @@ -308,7 +311,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas } else if (CveMonedaPago == 2 && tCveMoneda == 2) { - + //ImporteComisionMN = ImporteComision; //ImporteMN = Importe; //ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); @@ -318,48 +321,48 @@ public partial class Bancos_PagoAcreedor : ClsPaginas //ImporteComplementaria = ImporteComplementaria.RoundSQL(); ImporteComisionMN = ImporteComisionMN.RoundSQL(); ImporteComision = ImporteComision.RoundSQL(); - AcumImporteMN += ImporteMN; - - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteMN, CveConceptoContablePago, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + AcumImporteMN += ImporteMN; + + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteMN, CveConceptoContablePago, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de pago acreedor"; break; - } - + } + if (tCveMoneda > 1 && MsgError == "") { ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteComplementaria, CveConceptoContablePrestamoComplementario, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteComplementaria, CveConceptoContablePrestamoComplementario, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de acreedor complementaria"; } - if (ImporteBancosMN != ImporteAcreedorMN && MsgError == "") - { - bool TipoMovto = false; + if (ImporteBancosMN != ImporteAcreedorMN && MsgError == "") + { + bool TipoMovto = false; if (TCPago > TC) { CveConceptoDiferenciaCambiaria = 65; - TipoMovto = false; + TipoMovto = false; } else if (TCPago < TC) { CveConceptoDiferenciaCambiaria = 64; TipoMovto = true; } - Importe = ((Importe * TCPago) - (Importe * TC)).Abs(); + Importe = ((Importe * TCPago) - (Importe * TC)).Abs(); - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Importe, CveConceptoDiferenciaCambiaria, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteME: Importe, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Importe, CveConceptoDiferenciaCambiaria, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteME: Importe, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de diferencia cambiaria"; } - - if (ImporteComision != 0 && MsgError == "" && DdlOtrosPagos.SelectedValue == "2" ) + + if (ImporteComision != 0 && MsgError == "" && DdlOtrosPagos.SelectedValue == "2") { - + ImporteComisionMN = (ImporteComision * TCPago).RoundSQL(); int tTipoConceptoOtro = 255; //if (DdlOtrosPagos.SelectedValue == "3") tTipoConceptoOtro = 43; //deudores diversos - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoComision, ImporteComision, ImporteComisionMN, tTipoConceptoOtro, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(),CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoComision, ImporteComision, ImporteComisionMN, tTipoConceptoOtro, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de pago acreedor"; break; @@ -389,30 +392,30 @@ public partial class Bancos_PagoAcreedor : ClsPaginas //CveMonedaPago ImporteComision = ImporteComision.RoundSQL(); - ImporteComisionMN = (ImporteComision * TCPago).RoundSQL() ; + ImporteComisionMN = (ImporteComision * TCPago).RoundSQL(); ImporteComisionMN = (ImporteComision * TCPago).RoundSQL(); - + int tTipoConceptoOtro = 43; //deudores diversos if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoComision, ImporteComision, ImporteComisionMN, tTipoConceptoOtro, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) { - MsgError = "No se pudo insertar concepto de pago acreedor"; + MsgError = "No se pudo insertar concepto de pago acreedor"; } } if (CveMonedaPago != 1) - { - ImporteComplementaria = (ImporteBanco * TCPago - ImporteBanco).RoundSQL(); + { + ImporteComplementaria = (ImporteBanco * TCPago - ImporteBanco).RoundSQL(); } - if (MsgError == "" && !ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, ImporteBanco, 30, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(),ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos"; - + if (MsgError == "" && !ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, ImporteBanco, 30, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos"; + //movimiento de ajuste por sino se aplicó en el proceso anterior - if (MsgError == "" && CveMonedaPago != 1 ) + if (MsgError == "" && CveMonedaPago != 1) { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, ImporteComplementaria, 204, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos complementaria"; - } + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, ImporteComplementaria, 204, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos complementaria"; + } } else @@ -426,15 +429,15 @@ public partial class Bancos_PagoAcreedor : ClsPaginas } //VALIDA QUE CUADRE LA PREPOLIZA - Usuario UA = UsuarioActual; - if (MsgError == "" && ObjMov.ValidacionesPrePoliza(CvePrePoliza, ref UA,Opcion:5)) + Usuario UA = UsuarioActual; + if (MsgError == "" && ObjMov.ValidacionesPrePoliza(CvePrePoliza, ref UA, Opcion: 5)) { if (ObjMov.ValorPolizaDescuadre > 0) { MsgError = ObjMov.MensajePolizaDescuadre; ModExtensiones.GuardaLogAD($"Bancos/IE PAGO ACREEDOR | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas"); } - } + } if (MsgError.Equals("")) { @@ -445,10 +448,10 @@ public partial class Bancos_PagoAcreedor : ClsPaginas } //GUARDA COMPROBANTE - if (!filemove.Equals("")) - { - filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); - } + if (!filemove.Equals("")) + { + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); + } System.IO.FileInfo archivo = null; if (DdlTipoTransaccion.SelectedValue.ToEntero().Contiene(2, 8, 9)) @@ -481,10 +484,10 @@ public partial class Bancos_PagoAcreedor : ClsPaginas //{ // Msg.AppendFormat(@"

    Ver Póliza", IDPoliza); //} - + Msg.AppendFormat(@"Ver Póliza
    ", CvePrePoliza); Msg.AppendFormat($"Imprimir"); - + } else { @@ -542,8 +545,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas } private void AsignaCuentaProveedor(int CveProveedor) - { - + { + } protected void BtnGuardarPrestamo_Click(object sender, EventArgs e) @@ -597,8 +600,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (CveMoneda != 1) { - ImporteMN = Importe; - ImporteComplementaria = Importe * TC - Importe; + ImporteMN = Importe; + ImporteComplementaria = Importe * TC - Importe; } @@ -611,7 +614,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteMN,CveConceptoContableBanco, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteMN, CveConceptoContableBanco, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de bancos"; } @@ -619,23 +622,23 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (CveMoneda != 1) { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, ImporteMN, CveConceptoContablePrestamo, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, ImporteMN, CveConceptoContablePrestamo, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de acreedor"; - } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteComplementaria, CveConceptoContableBancoComplementario, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + } + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteComplementaria, CveConceptoContableBancoComplementario, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de bancos complementaria"; } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, ImporteComplementaria, CveConceptoContablePrestamoComplementario, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, ImporteComplementaria, CveConceptoContablePrestamoComplementario, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de acreedor complementaria"; } - + } else { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, ImporteMN, CveConceptoContablePrestamo, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, ImporteMN, CveConceptoContablePrestamo, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de acreedor"; } @@ -653,14 +656,14 @@ public partial class Bancos_PagoAcreedor : ClsPaginas //VALIDA QUE CUADRE LA POLIZA Usuario UA = UsuarioActual; - if (MsgError == "" && ObjMov.ValidacionesPrePoliza(CvePrePoliza, ref UA, Opcion: 5)) + if (MsgError == "" && ObjMov.ValidacionesPrePoliza(CvePrePoliza, ref UA, Opcion: 5)) { if (ObjMov.ValorPolizaDescuadre > 0) { MsgError = ObjMov.MensajePolizaDescuadre; ModExtensiones.GuardaLogAD($"Bancos/IE PAGO ACREEDOR | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas"); } - } + } if (MsgError.Equals("")) { @@ -808,7 +811,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas divDD.Visible = false; if (DdlOtrosPagos.SelectedValue == "2") { - TxtOtrosImportes.Visible = true; + TxtOtrosImportes.Visible = true; TxtTotal.Visible = true; GvMovAcreedor.Columns[8].Visible = true; TxtOtrosImportes.Text = ""; @@ -818,14 +821,14 @@ public partial class Bancos_PagoAcreedor : ClsPaginas else { if (DdlOtrosPagos.SelectedValue == "3") - { + { TxtDDImporte.Text = ""; divDD.Visible = true; RegistraScript($"$get('TxtImporte').value = FormatoNumero(SumaValores({CveMonedaCuentaPago}), 2);"); - } + } TxtOtrosImportes.Visible = false; TxtTotal.Visible = false; - GvMovAcreedor.Columns[8].Visible = false; + GvMovAcreedor.Columns[8].Visible = false; } UpDatos.Update(); UpMovAcreedor.Update(); @@ -835,4 +838,93 @@ public partial class Bancos_PagoAcreedor : ClsPaginas { CargaReporte(); } + + + + + protected void DdlTipoTransaccion_SelectedIndexChanged(object sender, EventArgs e) + { + ValidaFechaDocumentoDiasPosteriores(); + } + + protected void RVTxtFechaDocumento_Init(object sender, EventArgs e) + { + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString(); + RVTxtFechaDocumento.MinimumValue = NowADS().AddMonths(-38).ToShortDateString(); + Calendario.EndDate = NowADS().AddDays(2); + } + + private void ValidaFechaDocumentoDiasPosteriores() + { + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(3).ToShortDateString(); + RVTxtFechaDocumento.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 días de la fecha actual"; + + Calendario.EndDate = NowADS().AddDays(3); + + // Equivalente a: If DdlTipoMovto.SelectedValue.Contiene("1", "16") Then + // Suponiendo que "Contiene" verifique si SelectedValue es "1" o "16" + if (DdlTipoTransaccion.SelectedValue == "1" || DdlTipoTransaccion.SelectedValue == "16") + { + // cheques, 3 meses + RVTxtFechaDocumento.MaximumValue = NowADS().AddMonths(3).ToShortDateString(); + RVTxtFechaDocumento.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 meses de la fecha actual"; + Calendario.EndDate = NowADS().AddMonths(3); + } + + // transfer, 3 semanas + if (DdlTipoTransaccion.SelectedValue == "2") + { + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(21).ToShortDateString(); + RVTxtFechaDocumento.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 semanas de la fecha actual"; + Calendario.EndDate = NowADS().AddDays(21); + } + + UpDatos.Update(); + //UpGuardar.Update(); + } + + + + + protected void DdlTipoTransanccionPrestamo_SelectedIndexChanged(object sender, EventArgs e) + { + ValidaFechaDocumentoDiasPosterioresPrestamo(); + } + protected void RVTxtFechaPrestamo_Init(object sender, EventArgs e) + { + RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(2).ToShortDateString(); + RVTxtFechaPrestamo.MinimumValue = NowADS().AddMonths(-38).ToShortDateString(); + CalendarioPrestamo.EndDate = NowADS().AddDays(2); + + } + + private void ValidaFechaDocumentoDiasPosterioresPrestamo() + { + RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(3).ToShortDateString(); + RVTxtFechaPrestamo.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 días de la fecha actual"; + + CalendarioPrestamo.EndDate = NowADS().AddDays(3); + + // Equivalente a: If DdlTipoMovto.SelectedValue.Contiene("1", "16") Then + // Suponiendo que "Contiene" verifique si SelectedValue es "1" o "16" + if (DdlTipoTransanccionPrestamo.SelectedValue == "1" || DdlTipoTransanccionPrestamo.SelectedValue == "16") + { + // cheques, 3 meses + RVTxtFechaPrestamo.MaximumValue = NowADS().AddMonths(3).ToShortDateString(); + RVTxtFechaPrestamo.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 meses de la fecha actual"; + CalendarioPrestamo.EndDate = NowADS().AddMonths(3); + } + + // transfer, 3 semanas + if (DdlTipoTransanccionPrestamo.SelectedValue == "2") + { + RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(21).ToShortDateString(); + RVTxtFechaPrestamo.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 semanas de la fecha actual"; + CalendarioPrestamo.EndDate = NowADS().AddDays(21); + } + + UpPrestamo.Update(); + + } + } diff --git a/Bancos/PagoDeudor.aspx b/Bancos/PagoDeudor.aspx index 09e008c7e..09be4eddd 100644 --- a/Bancos/PagoDeudor.aspx +++ b/Bancos/PagoDeudor.aspx @@ -42,7 +42,8 @@
    - + @@ -95,6 +96,12 @@ + + + +
    @@ -209,7 +216,8 @@
    - + @@ -263,6 +271,12 @@ + + + +
    diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index e2af4114e..10ebf8179 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -56,6 +56,9 @@ public partial class Bancos_PagoDeudor : ClsPaginas TxtImporte.Attributes.Add("disabled", "disabled"); CargarCentrosDeCosto(null, null, null, LblSubProyecto); LblSubProyecto2.Text = LblSubProyecto.Text; + + ValidaFechaDocumentoDiasPosterioresPrestamo(); + ValidaFechaDocumentoDiasPosteriores(); } } @@ -372,6 +375,48 @@ public partial class Bancos_PagoDeudor : ClsPaginas if (ObjComp != null) ObjComp.Dispose(); } + + protected void DdlTipoTransaccionPrestamo_SelectedIndexChanged(object sender, EventArgs e) + { + ValidaFechaDocumentoDiasPosterioresPrestamo(); + } + protected void RVTxtFechaPrestamo_Init(object sender, EventArgs e) + { + RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(2).ToShortDateString(); + RVTxtFechaPrestamo.MinimumValue = NowADS().AddMonths(-38).ToShortDateString(); + CalendarioPrestamo.EndDate = NowADS().AddDays(2); + + } + + private void ValidaFechaDocumentoDiasPosterioresPrestamo() + { + RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(3).ToShortDateString(); + RVTxtFechaPrestamo.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 días de la fecha actual"; + + CalendarioPrestamo.EndDate = NowADS().AddDays(3); + + // Equivalente a: If DdlTipoMovto.SelectedValue.Contiene("1", "16") Then + // Suponiendo que "Contiene" verifique si SelectedValue es "1" o "16" + if (DdlTipoTransaccionPrestamo.SelectedValue == "1" || DdlTipoTransaccionPrestamo.SelectedValue == "16") + { + // cheques, 3 meses + RVTxtFechaPrestamo.MaximumValue = NowADS().AddMonths(3).ToShortDateString(); + RVTxtFechaPrestamo.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 meses de la fecha actual"; + CalendarioPrestamo.EndDate = NowADS().AddMonths(3); + } + + // transfer, 3 semanas + if (DdlTipoTransaccionPrestamo.SelectedValue == "2") + { + RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(21).ToShortDateString(); + RVTxtFechaPrestamo.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 semanas de la fecha actual"; + CalendarioPrestamo.EndDate = NowADS().AddDays(21); + } + + UpPrestamo.Update(); + //UpGuardar.Update(); + } + #endregion #region "PAGO DEUDORES" @@ -830,4 +875,52 @@ public partial class Bancos_PagoDeudor : ClsPaginas TxtFechaDocumento.Attributes.Remove("onchange"); DivImporteME.Visible = false; } + + + + protected void DdlTipoTransaccion_SelectedIndexChanged(object sender, EventArgs e) + { + ValidaFechaDocumentoDiasPosteriores(); + } + + protected void RVTxtFechaDocumento_Init(object sender, EventArgs e) + { + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString(); + RVTxtFechaDocumento.MinimumValue = NowADS().AddMonths(-38).ToShortDateString(); + Calendario.EndDate = NowADS().AddDays(2); + } + + private void ValidaFechaDocumentoDiasPosteriores() + { + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(3).ToShortDateString(); + RVTxtFechaDocumento.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 días de la fecha actual"; + + Calendario.EndDate = NowADS().AddDays(3); + + // Equivalente a: If DdlTipoMovto.SelectedValue.Contiene("1", "16") Then + // Suponiendo que "Contiene" verifique si SelectedValue es "1" o "16" + if (DdlTipoTransaccion.SelectedValue == "1" || DdlTipoTransaccion.SelectedValue == "16") + { + // cheques, 3 meses + RVTxtFechaDocumento.MaximumValue = NowADS().AddMonths(3).ToShortDateString(); + RVTxtFechaDocumento.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 meses de la fecha actual"; + Calendario.EndDate = NowADS().AddMonths(3); + } + + // transfer, 3 semanas + if (DdlTipoTransaccion.SelectedValue == "2") + { + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(21).ToShortDateString(); + RVTxtFechaDocumento.ErrorMessage = "ERROR:
    La fecha del documento no puede ser superior a 3 semanas de la fecha actual"; + Calendario.EndDate = NowADS().AddDays(21); + } + + UpMovDeudor.Update(); + //UpGuardar.Update(); + } + + + + + } \ No newline at end of file diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index c2daed3a9..2377a6341 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -105,15 +105,16 @@ - + + - - + <%-- + --%> @@ -341,10 +342,10 @@ - - + + @@ -608,14 +609,27 @@