Exemplo n.º 1
0
        protected virtual void EditAmountAction(DataGridViewRow row)
        {
            InputDecimalForm form = new InputDecimalForm();

            form.Message = Resources.Labels.IMPORTE_COBRO;

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                OutputInvoiceInfo item = row.DataBoundItem as OutputInvoiceInfo;

                _no_asignado += item.Asignado;

                CobroFactura cobro = _entity.CobroFacturas.GetItemByFactura(item.Oid);
                if (cobro != null)
                {
                    cobro.Cantidad = 0;
                }
                item.Cobrado          -= item.Asignado;
                item.PendienteVencido += item.Asignado;

                item.Asignado = form.Value;
                LinkInvoiceAction(row);
                SetUnlinkedGridValues(Facturas_DGW.Name);
                Datos_Facturas.ResetBindings(false);
                SetGridColors(Facturas_DGW.Name);
            }
        }
Exemplo n.º 2
0
        protected override void EditarImporteAction(DataGridViewRow row)
        {
            InputDecimalForm form = new InputDecimalForm();

            form.Message = Resources.Labels.IMPORTE_COBRO;

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                LineaFomentoInfo item = row.DataBoundItem as LineaFomentoInfo;

                _no_asignado += item.Asignado;

                CobroFactura cobro = _entity.CobroFacturas.GetItemByFactura(item.Oid);
                if (cobro != null)
                {
                    cobro.Cantidad = 0;
                }
                item.ImporteCobrado -= item.Asignado;
                item.Pendiente      += item.Asignado;

                item.Asignado = form.Value;
                VinculaFacturaAction(row, true);
                SetUnlinkedGridValues(Facturas_DGW.Name);
                Datos_Facturas.ResetBindings(false);
                SetGridColors(Facturas_DGW);
            }
        }
Exemplo n.º 3
0
        protected bool Asignar()
        {
            if (_entity.EMedioPago == EMedioPago.CompensacionFactura)
            {
                decimal importe = 0;

                Datos_Facturas.MoveFirst();
                foreach (DataGridViewRow row in Facturas_DGW.Rows)
                {
                    OutputInvoiceInfo item = row.DataBoundItem as OutputInvoiceInfo;

                    if (item.Vinculado == Library.Invoice.Resources.Labels.RESET_COBRO)
                    {
                        importe += item.Asignado;
                    }

                    Datos_Facturas.MoveNext();
                }

                if (importe != 0)
                {
                    PgMng.ShowInfoException("El importe total para este tipo de cobro debe ser 0.");
                    _action_result = DialogResult.Ignore;
                    return(false);
                }
            }
            else
            {
                if (_entity.Pendiente == 0)
                {
                    return(true);
                }

                if (_entity.Importe < 0)
                {
                    if (NoAsignado < _entity.Pendiente)
                    {
                        PgMng.ShowInfoException(string.Format("La asignación {0:C2} es inferior a la cantidad pendiente en el cobro {1:C2}.", NoAsignado, _entity.Pendiente));
                        _action_result = DialogResult.Ignore;
                        return(false);
                    }
                }
                else
                {
                    if (NoAsignado > _entity.Pendiente)
                    {
                        PgMng.ShowInfoException(string.Format("La asignación {0:C2} es superior a la cantidad pendiente en el cobro {1:C2}.", NoAsignado, _entity.Pendiente));
                        _action_result = DialogResult.Ignore;
                        return(false);
                    }
                }
            }

            return(true);
        }
Exemplo n.º 4
0
        protected void AsignarTodoAction()
        {
            foreach (DataGridViewRow row in Facturas_DGW.Rows)
            {
                VinculaFacturaAction(row);
            }

            Datos_Facturas.ResetBindings(false);

            SetGridColors(Facturas_DGW);
        }
Exemplo n.º 5
0
        protected void ApportionAction()
        {
            LineaFomentoList lines = LineaFomentoList.GetList((IList <LineaFomentoInfo>)Datos_Facturas.DataSource);

            decimal total_solicitado = lines.TotalSubvencionSolicitada();

            foreach (DataGridViewRow row in Facturas_DGW.Rows)
            {
                ApportionAction(row, total_solicitado);
            }

            Datos_Facturas.ResetBindings(false);

            SetGridColors(Facturas_DGW);
        }