protected override void SetParametrosPagoComercioExteriorAction()
        {
            if (_loan == null)
            {
                return;
            }

            BankAccountInfo cuenta = BankAccountInfo.Get(_loan.OidCuenta, false);

            if (cuenta.ETipoCuenta != ETipoCuenta.CuentaCorriente)
            {
                _entity.OidCuentaBancaria = cuenta.OidCuentaAsociada;
                _entity.CuentaBancaria    = cuenta.CuentaAsociada;
            }
            else
            {
                _entity.OidCuentaBancaria = cuenta.Oid;
                _entity.CuentaBancaria    = cuenta.Valor;
            }

            _entity.EMedioPago  = EMedioPago.Transferencia;
            _entity.EEstadoPago = moleQule.Base.EEstado.Pagado;

            base.SetParametrosPagoComercioExteriorAction();
            Cuenta_TB.Text = cuenta.Valor;
        }
Пример #2
0
        public void ShowApuntesAction()
        {
            BankAccountInfo cuenta = BankAccountInfo.Get(ActiveOID, false);

            Assembly assembly = Assembly.Load("moleQule.Face.Invoice");
            Type     type     = assembly.GetType("moleQule.Face.Invoice.BankLineMngForm");

            EntityMngBaseForm form = (EntityMngBaseForm)type.InvokeMember("BankLineMngForm", BindingFlags.CreateInstance, null, null, new object[3] {
                true, this, cuenta
            });

            form.ShowDialog();
        }
Пример #3
0
        protected virtual void SetExpenses()
        {
            if (_entity.EMedioPago != EMedioPago.ComercioExterior)
            {
                return;
            }

            BankAccountInfo cuenta = BankAccountInfo.Get(_entity.OidCuentaBancaria, false);

            if (cuenta.PagoGastosInicio)
            {
                int dias_pago = (_entity.Vencimiento - _entity.Fecha).Days;

                _entity.GastosBancarios = _entity.Importe * cuenta.TipoInteres * dias_pago / 36000;
            }
        }
Пример #4
0
        protected virtual void AsociaPagoFacturaAction()
        {
            BankAccountInfo cuenta = BankAccountInfo.Get(_entity.OidCuenta, false);

            if (cuenta.ETipoCuenta == moleQule.Common.Structs.ETipoCuenta.CuentaCorriente)
            {
                PgMng.ShowInfoException("No se puede asociar un pago de factura a una cuenta corriente. Debe seleccionar una cuenta de comercio exterior");
                return;
            }

            PaymentInfo pago = PaymentInfo.Get(_entity.OidPago, ETipoPago.Factura, false);

            if (pago.EMedioPago == moleQule.Common.Structs.EMedioPago.ComercioExterior)
            {
                PgMng.ShowInfoException("El pago asociado al préstamo actual ha sido generado automáticamente por la aplicación y no es posible modificarlo");
                return;
            }
            else
            {
                if (_entity.Payments.Count > 0)
                {
                    PgMng.ShowInfoException("El préstamo actual tiene pagos y no es posible modificar el pago de factura asociado");
                    return;
                }
                else
                {
                    PaymentSelectForm form = new PaymentSelectForm(this, ETipoPago.Factura);

                    if (form.ShowDialog(this) == DialogResult.OK)
                    {
                        PaymentInfo info = form.Selected as PaymentInfo;

                        _entity.OidPago          = info.Oid;
                        _entity.Pago             = _entity.Nombre;
                        _entity.Importe          = info.Importe;
                        _entity.FechaFirma       = info.Fecha;
                        _entity.FechaIngreso     = info.Fecha;
                        _entity.FechaVencimiento = info.Vencimiento;
                    }
                }
            }
        }
Пример #5
0
        protected virtual void SetExpenses()
        {
            if (_loan == null)
            {
                return;
            }

            BankAccountInfo bank_account = BankAccountInfo.Get(_loan.OidCuenta, false, true);

            int dias_pago             = (DateTime.Now - _loan.FechaIngreso).Days;
            int dias_pago_vencimiento = (_loan.FechaVencimiento - _loan.FechaIngreso).Days;

            decimal tipo = bank_account.ETipoCuenta == ETipoCuenta.ComercioExterior ? bank_account.TipoInteres : 0;

            decimal gastos             = _entity.Importe * tipo * dias_pago / 36000;
            decimal gastos_vencimiento = _entity.Importe * tipo * dias_pago_vencimiento / 36000;

            decimal gastos_prev = _entity.GastosBancarios;

            if (bank_account.PagoGastosInicio)
            {
                _entity.GastosBancarios += gastos - gastos_vencimiento;
            }
            else
            {
                _entity.GastosBancarios += gastos;
            }

            if (_entity.GastosBancarios != gastos_prev)
            {
                if (DialogResult.No == ProgressInfoMng.ShowQuestion("Los gastos se han actualizado automáticamente. ¿Confirmar?"))
                {
                    _entity.GastosBancarios = gastos_prev;
                }
            }
        }
 protected override void GetFormSourceData(long oid)
 {
     _entity  = BankAccountInfo.Get(oid, true);
     _mf_type = ManagerFormType.MFView;
 }