Ejemplo n.º 1
0
        protected override void AnulaLineaAction()
        {
            if (Lines_DGW.CurrentRow == null)
            {
                return;
            }

            CashLine item = Lines_DGW.CurrentRow.DataBoundItem as CashLine;

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.NULL_CONFIRM) != DialogResult.Yes)
            {
                return;
            }

            if (item.Locked)
            {
                return;
            }

            _entity.Lines.Remove(item);

            _entity.UpdateSaldo();
            Datos.ResetBindings(false);

            SetGridFormat(Lines_DGW);
        }
Ejemplo n.º 2
0
        public static DialogResult ValidateDueDate(Payment payment, CreditCardInfo creditCard, DateTime dueDate)
        {
            if (payment.EMedioPago != EMedioPago.Tarjeta)
            {
                return(DialogResult.OK);
            }

            creditCard = creditCard ?? CreditCardInfo.Get(payment.OidCreditCard, false);

            if (creditCard.ETipoTarjeta != ETipoTarjeta.Credito)
            {
                return(DialogResult.OK);
            }

            DateTime statementDueDate = StatementDatesFromOperationDueDate.GetStatementDueDate(creditCard, dueDate);

            if (!statementDueDate.Equals(dueDate))
            {
                string message = String.Format(moleQule.Common.Resources.Messages.STATEMENT_DATE_NOT_MISMATCH, statementDueDate.ToShortDateString());
                if (ProgressInfoMng.ShowQuestion(message) == System.Windows.Forms.DialogResult.Yes)
                {
                    payment.Vencimiento = statementDueDate;
                    return(DialogResult.OK);
                }
                else
                {
                    return(DialogResult.Ignore);
                }
            }

            return(DialogResult.OK);
        }
Ejemplo n.º 3
0
        protected override void DeleteAction()
        {
            if (CurrentDocumento == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Resources.Messages.DELETE_CONFIRM) == DialogResult.No)
            {
                return;
            }

            _back_job = BackJob.Delete;
            PgMng.Reset(9, 1, Resources.Messages.CONNECTING_SERVER, this);
            //PgMng.StartBackJob(this);
            DoJob();

            PgMng.Grow();
            if (PgMng.Result == BGResult.OK)
            {
                _entity.ApplyEdit();
                _entity.Save();
            }

            RefreshSecondaryData();
            PgMng.FillUp();
        }
Ejemplo n.º 4
0
        protected void ChangeStateAction(EEstado estado)
        {
            if (_entity.EEstado == EEstado.Anulado)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.ITEM_ANULADO_NO_EDIT);
                return;
            }

            switch (estado)
            {
            case EEstado.Anulado:
            {
                if (_entity.EEstado == EEstado.Contabilizado)
                {
                    PgMng.ShowInfoException(Library.Common.Resources.Messages.NULL_CONTABILIZADO_NOT_ALLOWED);
                    return;
                }

                if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.NULL_CONFIRM) != DialogResult.Yes)
                {
                    return;
                }
            }
            break;
            }

            _entity.EEstado = estado;
        }
Ejemplo n.º 5
0
        public override void RealizarCancelacionAction()
        {
            BankAccount item = (BankAccount)CuentasAsociadas_DGW.CurrentRow.DataBoundItem;

            if (item == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion("Para realizar una cancelación debe guardar la cuenta bancaria ahora. ¿Desea continuar?") == DialogResult.Yes)
            {
                if (SaveObject())
                {
                    Assembly assembly = Assembly.Load("moleQule.Face.Invoice");
                    Type     type     = assembly.GetType("moleQule.Face.Invoice.TraspasoAddForm");

                    ItemMngBaseForm form = (ItemMngBaseForm)type.InvokeMember("TraspasoAddForm", BindingFlags.CreateInstance, null, null, new object[1] {
                        item
                    });
                    form.ShowDialog();

                    Close();
                }
            }
        }
        protected override void DeleteLineaAction()
        {
            if (Lineas_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }
            LineaPedido item = (LineaPedido)Lineas_DGW.CurrentRow.DataBoundItem;

            if (item == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                PgMng.Reset(4, 1, Store.Resources.Messages.UPDATING_STOCK, this);

                BatchInfo partida = BatchInfo.Get(item.OidPartida, true);
                PgMng.Grow();

                if (partida.IsKit)
                {
                    DeleteKit(partida);
                }
                PgMng.Grow();

                _entity.Lineas.Remove(item, _entity);

                ControlsMng.UpdateBinding(Datos_Lineas);
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }
        }
Ejemplo n.º 7
0
        protected void SetExpedient(ExpedientInfo source, bool setToLines = true)
        {
            _expedient = source;

            if (_expedient != null)
            {
                _entity.Expediente    = _expedient.Codigo;
                _entity.OidExpediente = _expedient.Oid;
                Expediente_TB.Text    = _expedient.Codigo;

                AddCacheItem(_expedient);

                //setToLines es para evitar que pregunte al cargar el albarán
                if (_entity.Conceptos.Count > 0 && setToLines)
                {
                    DialogResult result = ProgressInfoMng.ShowQuestion(string.Format("¿Asignar el expediente {0} a todos los conceptos del albarán?", _expedient.Codigo));

                    foreach (InputDeliveryLine item in _entity.Conceptos)
                    {
                        if (result == DialogResult.No && item.OidExpediente != 0)
                        {
                            continue;
                        }
                        item.OidExpediente = source.Oid;
                        item.Expediente    = source.Codigo;
                    }
                }
            }
        }
        protected override void EliminarConceptoAction()
        {
            if (Datos_Concepto.Current == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                PgMng.Reset(5, 1, Store.Resources.Messages.UPDATING_STOCK, this);

                BatchInfo pexp = BatchInfo.Get(Line.OidPartida, true);
                PgMng.Grow();

                if (pexp.IsKit)
                {
                    DeleteKit(pexp);
                }
                PgMng.Grow();

                _entity.Conceptos.Remove(Line);
                _entity.CalculaTotal();
                PgMng.Grow();

                RefreshConceptos();
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }

            Serie_BT.Enabled = (_entity.Conceptos.Count > 0);
        }
        protected override void DeleteLineAction()
        {
            if (Lines_BS.Current == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                if (Concepto.OidPedido == 0)
                {
                    PgMng.Reset(4, 1, Store.Resources.Messages.UPDATING_STOCK, this);

                    if (Concepto.OidPartida != 0)
                    {
                        BatchInfo partida = BatchInfo.Get(Concepto.OidPartida, true);
                        PgMng.Grow();

                        if (partida.IsKit)
                        {
                            DeleteKit(partida);
                        }
                        PgMng.Grow();
                    }

                    _entity.Conceptos.Remove(Concepto, true);
                    _entity.CalculateTotal();
                    PgMng.Grow();
                }
                else
                {
                    long oidPedido = Concepto.OidPedido;

                    _entity.Conceptos.Remove(Concepto, true);
                    _entity.CalculateTotal();

                    bool free_pedido = true;

                    foreach (OutputDeliveryLine item in _entity.Conceptos)
                    {
                        if (item.OidPedido == Concepto.OidPedido)
                        {
                            free_pedido = false;
                        }
                    }

                    //Actualizamos la lista de pedidos disponibles
                    if (free_pedido)
                    {
                        _pedidos.AddItem(_pedidos_cliente.GetItem(oidPedido));
                    }
                }

                ControlsMng.UpdateBinding(Lines_BS);
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }

            Serie_BT.Enabled = (_entity.Conceptos.Count > 0);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Función que realiza el login de usuario y carga la clase principal del
        /// programa
        /// </summary>
        /// <remarks>
        /// Esta función utiliza el usuario y password por defecto.
        /// Para utilizar un formulario personalizado de login es necesario sobrecargar
        /// esta función en el MainForm de la aplicación.
        /// </remarks>
        protected override void DoLogin()
        {
            if (AppContext.Principal != null)
            {
                AppContext.Principal.Logout();
            }
            SetFormSkin();

            // Cableado para que no pida usuario
            try
            {
                Principal.Login();

                if (!AppContext.User.IsAuthenticated)
                {
                    ProgressInfoMng.Instance.ShowInfoException(Resources.Messages.LOGIN_ERROR);
                    return;
                }

                LoadSchema();
                AppContext.Principal.LoadUserContext();
            }
            catch (iQLockException ex)
            {
                ProgressInfoMng.ShowException(ex, MessageBoxButtons.OK, MessageBoxIcon.Error);
                AppContext.Principal.Logout();
                FormMng.OpenForm(LoginForm.ID);
            }
            catch (Exception ex)
            {
                ProgressInfoMng.ShowException(ex, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }
        }
        public override void ChangeStateAction(EEstadoItem estado)
        {
            switch (estado)
            {
            case EEstadoItem.Unlock:
                _entity = Charge.ChangeEstado(ActiveOID, ActiveItem.ETipoCobro, EEstado.Abierto);
                break;

            case EEstadoItem.Contabilizado:
                _entity = Charge.ChangeEstado(ActiveOID, ActiveItem.ETipoCobro, EEstado.Contabilizado);
                break;

            case EEstadoItem.Anulado:
            {
                if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.NULL_CONFIRM) != DialogResult.Yes)
                {
                    return;
                }
                _entity = Charge.ChangeEstado(ActiveOID, ActiveItem.ETipoCobro, EEstado.Anulado);
            }
            break;
            }

            _action_result = DialogResult.OK;
        }
 public override void DeleteObject(long oid)
 {
     if (ProgressInfoMng.ShowQuestion(moleQule.Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
     {
         InventarioAlmacen.Delete(oid);
         _action_result = DialogResult.OK;
     }
 }
Ejemplo n.º 13
0
        protected void ChangeStateAction(moleQule.Base.EEstado estado)
        {
            if (_entity.EEstado == moleQule.Base.EEstado.Anulado)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.ITEM_ANULADO_NO_EDIT);
                return;
            }

            switch (estado)
            {
            case moleQule.Base.EEstado.Anulado:
            {
                if (_entity.EEstado == moleQule.Base.EEstado.Contabilizado)
                {
                    PgMng.ShowInfoException(moleQule.Common.Resources.Messages.NULL_CONTABILIZADO_NOT_ALLOWED);
                    return;
                }

                if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.NULL_CONFIRM) != DialogResult.Yes)
                {
                    return;
                }
            }
            break;

            case moleQule.Base.EEstado.Baja:
            {
                if (_entity.OidPair == 0)
                {
                    LivestockBookLineInfo entry = SelectEntryPair();

                    if (entry != null)
                    {
                        _entity.CopyFromPair(entry);
                    }
                    else
                    {
                        return;
                    }
                }
            }
            break;

            case moleQule.Base.EEstado.Alta:
            {
                _entity.OidPair = 0;
            }
            break;
            }

            _entity.EEstado = estado;

            ShowPair();
        }
Ejemplo n.º 14
0
 private void ObraUIForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (_action_result != DialogResult.OK)
     {
         if (DialogResult.No == ProgressInfoMng.ShowQuestion(moleQule.Face.Resources.Messages.CANCEL_CONFIRM))
         {
             e.Cancel = true;
             return;
         }
     }
 }
Ejemplo n.º 15
0
 protected override void BorrarProductoAction()
 {
     if (Datos_ProductoCliente.Current != null)
     {
         if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
         {
             ProductoCliente producto = (ProductoCliente)Datos_ProductoCliente.Current;
             _entity.Productos.Remove(producto);
         }
     }
 }
Ejemplo n.º 16
0
        public static DialogResult ValidateAllocation(Payment payment, decimal deallocated, IEnumerable <ITransactionPayment> transactionPayments = null)
        {
            switch (payment.EMedioPago)
            {
            case EMedioPago.CompensacionFactura:
            {
                decimal importe = 0;

                foreach (ITransactionPayment item in transactionPayments ?? new List <ITransactionPayment>())
                {
                    if (item.Vinculado == Library.Store.Resources.Labels.RESET_PAGO)
                    {
                        importe += item.Asignado;
                    }
                }

                if (importe != 0)
                {
                    ProgressInfoMng.ShowInfo(Resources.Messages.IMPORTE_PAGO_COMPENSACION);
                    return(DialogResult.Ignore);
                }
            }
            break;

            default:
            {
                if (payment.Pendiente == 0)
                {
                    return(DialogResult.OK);
                }

                if (payment.Importe < 0)
                {
                    if (deallocated < payment.Pendiente)
                    {
                        ProgressInfoMng.ShowInfo(string.Format(Resources.Messages.PAYMENT_LESS_ALLOCATION, deallocated, payment.Pendiente));
                        return(DialogResult.Ignore);
                    }
                }
                else
                {
                    if (deallocated > payment.Pendiente)
                    {
                        ProgressInfoMng.ShowInfo(string.Format(Resources.Messages.PAYMENT_BIGGER_ALLOCATION, deallocated, payment.Pendiente));
                        return(DialogResult.Ignore);
                    }
                }
            }
            break;
            }

            return(DialogResult.OK);
        }
Ejemplo n.º 17
0
        protected void ChangeState(moleQule.Base.EEstado estado)
        {
            if (Pago == null)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.NO_SELECTED);
                return;
            }

            if (Pago.EEstado == moleQule.Base.EEstado.Anulado)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.ITEM_ANULADO_NO_EDIT);
                return;
            }

            switch (estado)
            {
            case moleQule.Base.EEstado.Anulado:
            {
                if (Pago.EEstado == moleQule.Base.EEstado.Contabilizado)
                {
                    PgMng.ShowInfoException(moleQule.Common.Resources.Messages.NULL_CONTABILIZADO_NOT_ALLOWED);
                    return;
                }

                if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.NULL_CONFIRM) != DialogResult.Yes)
                {
                    return;
                }
            }
            break;
            }

            try
            {
                _entity.Pagos.ChangeState(estado, Pago, _entity);
                _entity.ApplyEdit();
                _entity.ISave(Pago);
                _entity.BeginEdit();

                Payment current = Pago;
                Datos_Pago.ResetBindings(false);
                _summary.Refresh(_entity);
                Datos_Resumen.ResetBindings(false);
                SetGridColors(Pagos_DGW.Name);
                _invoices = InputInvoiceList.GetListByAcreedor(_entity.Oid, _entity.ETipoAcreedor, false);
                Select(current);
            }
            catch (Exception ex)
            {
                PgMng.ShowInfoException(ex);
            }
        }
Ejemplo n.º 18
0
        protected override void DeletePeriodoAction()
        {
            if (Datos_Periodos.Current == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                AyudaPeriodo item = (AyudaPeriodo)Datos_Periodos.Current;
                _entity.Periodos.Remove(item);
            }
        }
        private void SetDestinationCompany(CompanyInfo source)
        {
            if (source.Oid == AppContext.ActiveSchema.Oid)
            {
                ProgressInfoMng.ShowInfo(Library.Invoice.Resources.Messages.EXPORTING_COMPANY_EQUALS);
                return;
            }

            _destination_company = source;

            Company_TB.Text = (_destination_company != null) ? _destination_company.Name : string.Empty;

            _config.DestinationCompany = _destination_company;
        }
Ejemplo n.º 20
0
        protected void ChangeState(EEstado estado)
        {
            if (Cobro == null)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.NO_SELECTED);
                return;
            }

            if (Cobro.EEstado == EEstado.Anulado)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.ITEM_ANULADO_NO_EDIT);
                return;
            }

            switch (estado)
            {
            case EEstado.Anulado:
            {
                if (Cobro.EEstado == EEstado.Contabilizado)
                {
                    PgMng.ShowInfoException(Library.Common.Resources.Messages.NULL_CONTABILIZADO_NOT_ALLOWED);
                    return;
                }

                if (Cobro.EMedioPago == EMedioPago.Efectivo)
                {
                    CashLineInfo linea = CashLineInfo.GetByCobro(Cobro.Oid);
                    if ((linea.Oid != 0) && (linea.OidCierre != 0) && (linea.EEstado != EEstado.Anulado))
                    {
                        PgMng.ShowInfoException(String.Format(Resources.Messages.CIERRE_CAJA_COBRO, linea.Codigo, linea.Fecha));
                        return;
                    }
                }

                if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.NULL_CONFIRM) != DialogResult.Yes)
                {
                    return;
                }
            }
            break;
            }

            _entity.Cobros.ChangeState(estado, Cobro, _entity);
            _entity.ApplyEdit();
            _entity.Save();
            _entity.BeginEdit();

            RefreshAction();
        }
Ejemplo n.º 21
0
        public override void DeleteObject(long oid)
        {
            if (ProgressInfoMng.ShowQuestion(moleQule.Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                if (ActiveItem.Shared)
                {
                    if (ProgressInfoMng.ShowQuestion(Resources.Messages.DOC_SHARED) != DialogResult.OK)
                    {
                        _action_result = DialogResult.Cancel;
                        return;
                    }
                }

                try
                {
                    PgMng.Reset(5, 1, Resources.Messages.CONNECTING_SERVER, this);

                    HipatiaCtl.InitHipatia(_ftp, Principal.GetHipatiaFTPRootPath(), Principal.GetHipatiaFTPHost());

                    PgMng.Grow(moleQule.Face.Resources.Messages.DELETING);

                    Documento item = Documento.Get(ActiveItem.OidDocumento);
                    item.AgenteDocumentos.Clear();
                    item.Save();
                    item.CloseSession();
                    PgMng.Grow();

                    Documento.Delete(ActiveItem.OidDocumento);
                    PgMng.Grow();

                    if (HipatiaCtl.ExistsFile(_ftp, ActiveItem.Ruta))
                    {
                        _ftp.DeleteFile(ActiveItem.Ruta);
                    }
                    PgMng.Grow();
                }
                catch (Exception ex)
                {
                    _action_result = DialogResult.Cancel;
                    throw ex;
                }
                finally
                {
                    PgMng.FillUp();
                }

                _action_result = DialogResult.OK;
            }
        }
Ejemplo n.º 22
0
        protected override void DeletePeriodoTipoInteresAction()
        {
            if (InterestRates_BS.Current == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                InterestRate item = (InterestRate)InterestRates_BS.Current;
                _entity.InterestRates.Remove(item);
            }

            UpdateImportes();
        }
Ejemplo n.º 23
0
        protected void ChangeState(EEstado estado)
        {
            if (!ControlsMng.IsCurrentItemValid(Pagos_DGW))
            {
                return;
            }

            Payment payment = ControlsMng.GetCurrentItem(Pagos_DGW) as Payment;

            if (payment == null)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.NO_SELECTED);
                return;
            }

            if (payment.EEstado == moleQule.Base.EEstado.Anulado)
            {
                PgMng.ShowInfoException(Face.Resources.Messages.ITEM_ANULADO_NO_EDIT);
                return;
            }

            switch (estado)
            {
            case moleQule.Base.EEstado.Anulado:

                if (payment.EEstado == moleQule.Base.EEstado.Contabilizado)
                {
                    PgMng.ShowInfoException(moleQule.Common.Resources.Messages.NULL_CONTABILIZADO_NOT_ALLOWED);
                    return;
                }

                if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.NULL_CONFIRM) != DialogResult.Yes)
                {
                    return;
                }
                break;
            }

            try
            {
                payment.ChangeEstado(estado);
                UpdatePayments();
            }
            catch (Exception ex)
            {
                PgMng.ShowInfoException(ex);
            }
        }
        protected override void SaveAction()
        {
            InputInvoiceList list = (InputInvoiceList)Cache.Instance.Get(typeof(InputInvoiceList));

            if (list != null)
            {
                InputInvoiceInfo item = list.GetItemByNFactura(_entity.NFactura, _entity.Fecha.Year, _entity.OidAcreedor, _entity.ETipoAcreedor);
                if (item != null && item.Oid != _entity.Oid)
                {
                    if (ProgressInfoMng.ShowQuestion(String.Format(Library.Store.Resources.Messages.FACTURA_RECIBIDA_DUPLICADA, _entity.Acreedor)) == DialogResult.No)
                    {
                        _action_result = DialogResult.Ignore;
                        return;
                    }
                }
            }

            Library.Store.QueryConditions conditions = new Library.Store.QueryConditions
            {
                FacturaRecibida = _entity.GetInfo(false),
                TipoAcreedor    = new ETipoAcreedor[1] {
                    _entity.ETipoAcreedor
                },
                Estado = moleQule.Base.EEstado.NoAnulado
            };

            conditions.FacturaRecibida.Oid = 0;

            InputInvoiceInfo prev_invoice = InputInvoiceInfo.Exists(conditions, false);

            if (prev_invoice.Oid != 0 && prev_invoice.Oid != _entity.Oid && prev_invoice.Total == _entity.Total)
            {
                if (DialogResult.No == ProgressInfoMng.ShowQuestion("Existe una factura de este proveedor con la misma fecha, número e importe. ¿Desea continuar?"))
                {
                    _action_result = DialogResult.Cancel;
                    return;
                }
            }

            if (_expediente != null)
            {
                _entity.SetExpediente(_expediente);
            }

            _action_result = SaveObject() ? DialogResult.OK : DialogResult.Ignore;
        }
Ejemplo n.º 25
0
        private void Submit_TI_Click(object sender, EventArgs e)
        {
            try
            {
                if (ProgressInfoMng.ShowQuestion("A continuación se generarán los apuntes bancarios asociados") == DialogResult.No)
                {
                    return;
                }

                RefreshAction();

                PgMng.Reset(5, 1, "Creando apuntes bancarios...", this);

                if (Apuntes_TV.TopNode.Nodes[PAGOS_PENDIENTES].Checked)
                {
                    PgMng.Grow("Creando apuntes bancarios de pagos");
                    Library.Invoice.ModuleController.CreateApuntesBancarios(CobrosVencidosList);
                }

                if (Apuntes_TV.TopNode.Nodes[COBROS_PENDIENTES].Checked)
                {
                    PgMng.Grow("Creando apuntes bancarios de pagos");
                    Library.Invoice.ModuleController.CreateApuntesBancarios(PagosVencidosList);
                }

                PgMng.Grow("Creando apuntes bancarios de pagos por tarjeta de crédito");
                foreach (PaymentList list in PagosTarjetasList)
                {
                    if (Apuntes_TV.TopNode.Nodes[PAGOS_TARJETA_PENDIENTES].Nodes[PagosTarjetasList.IndexOf(list)].Checked)
                    {
                        Library.Invoice.ModuleController.CreateApuntesBancarios(list);
                    }
                }

                PgMng.FillUp();

                RefreshAction();
            }
            catch (Exception ex)
            {
                PgMng.FillUp();
                throw ex;
            }
        }
Ejemplo n.º 26
0
        protected bool RemoveStock(Expedient expediente, Stock stock)
        {
            if (((stock.OidAlbaran != 0) || (stock.Inicial)) &&
                stock.ETipoStock != ETipoStock.Consumo &&
                stock.ETipoStock != ETipoStock.MovimientoSalida &&
                stock.ETipoStock != ETipoStock.Merma)
            {
                PgMng.ShowInfoException(Resources.Messages.STOCK_FACTURADO);
                return(false);
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                expediente.RemoveStock(stock);
                return(true);
            }

            return(false);
        }
Ejemplo n.º 27
0
        protected override void SaveAction()
        {
            Library.Store.QueryConditions conditions = new Library.Store.QueryConditions
            {
                InputDelivery = _entity.GetInfo(false),
                TipoAcreedor  = new ETipoAcreedor[1] {
                    _entity.ETipoAcreedor
                },
                Estado = moleQule.Base.EEstado.NoAnulado
            };

            conditions.InputDelivery.Oid = 0;

            if (InputDeliveryInfo.Exists(conditions, false).Oid != 0 &&
                InputDeliveryInfo.Exists(conditions, false).Oid != _entity.Oid)
            {
                if (DialogResult.No == ProgressInfoMng.ShowQuestion("Existe un albarán de este proveedor con la misma fecha e importe. ¿Desea continuar?"))
                {
                    _action_result = DialogResult.Cancel;
                    return;
                }
            }

            if (_entity.Rectificativo)
            {
                foreach (InputDeliveryLine item in _entity.Conceptos)
                {
                    if (item.FacturacionBulto && item.CantidadBultos > 0)
                    {
                        item.CantidadBultos = -item.CantidadBultos;
                    }
                    if (item.FacturacionPeso && item.CantidadKilos > 0)
                    {
                        item.CantidadKilos = -item.CantidadKilos;
                    }
                }

                _entity.CalculateTotal();
            }

            _action_result = SaveObject() ? DialogResult.OK : DialogResult.Ignore;
        }
        protected override void DeleteLineaAction()
        {
            if (Lineas_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }
            LineaPedidoProveedor item = (LineaPedidoProveedor)Lineas_DGW.CurrentRow.DataBoundItem;

            if (item == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                _entity.Lineas.RemoveItem(_entity, item);

                RefreshLineas();
            }
        }
Ejemplo n.º 29
0
        private void DoDelete(BackgroundWorker bk)
        {
            PgMng.Grow(Resources.Messages.CONNECTING_SERVER);

            if (_ftp == null)
            {
                _ftp = new FtpClient(Principal.GetHipatiaFTPHost(), Principal.GetHipatiaFTPUser(), Principal.GetHipatiaFTPPwd(), Principal.GetHipatiaFTPRootPath());
                HipatiaCtl.InitHipatia(_ftp, Principal.GetHipatiaFTPRootPath(), Principal.GetHipatiaFTPHost());
            }
            PgMng.Grow();

            _entity.Documentos.RemoveAgent(CurrentDocumento);

            PgMng.Grow();

            if (CurrentDocumento.AgenteDocumentos.Count == 1)
            {
                if (ProgressInfoMng.ShowQuestion(Resources.Messages.DELETE_LAST_FILE) == DialogResult.No)
                {
                    try
                    {
                        Documento.Delete(CurrentDocumento.OidDocumento);
                        PgMng.Grow();

                        if (HipatiaCtl.ExistsFile(_ftp, CurrentDocumento.Ruta))
                        {
                            _ftp.DeleteFile(CurrentDocumento.Ruta);
                        }
                        PgMng.Grow();
                    }
                    catch (Exception ex)
                    {
                        PgMng.Result = BGResult.Error;
                        throw ex;
                    }
                }
            }

            PgMng.Result = BGResult.OK;
        }
        protected override void SelectLineExpedientAction()
        {
            if (_entity.EHolderType == ETipoEntidad.WorkReport)
            {
                return;
            }

            if (Lines_BS.Current == null)
            {
                return;
            }

            OutputDeliveryLine item = Lines_BS.Current as OutputDeliveryLine;

            if (item.OidPartida != 0)
            {
                ProgressInfoMng.ShowInfo(Resources.Messages.DELIVERY_LINE_EXPEDIENT_WARNING);
                return;
            }

            ExpedienteList expedientes = ExpedienteList.GetListByStockProducto(item.GetInfo(false));

            ExpedienteSelectForm form = new ExpedienteSelectForm(this, expedientes);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ExpedientInfo source = (ExpedientInfo)form.Selected;

                if (source.StockKilos < item.CantidadKilos)
                {
                    PgMng.ShowErrorException(Resources.Messages.STOCK_INSUFICIENTE + " " + source.StockKilos.ToString());
                    return;
                }

                item.OidExpediente = source.Oid;
                item.Expediente    = source.Codigo;

                AddCacheItem(source);
            }
        }