protected override void SetBankAccountAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Lines_DGW))
            {
                return;
            }

            CashLine item = ControlsMng.GetCurrentItem(Lines_DGW) as CashLine;

            if (item.Locked)
            {
                return;
            }

            if (!new ETipoLineaCaja[]
            {
                ETipoLineaCaja.EntradaPorTraspaso,
                ETipoLineaCaja.SalidaPorIngreso
            }.Contains(item.ETipoLinea))
            {
                return;
            }

            BankAccountSelectForm form = new BankAccountSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                item.OidCuentaBancaria = cuenta.Oid;
                item.CuentaBancaria    = cuenta.Valor;
            }
        }
示例#2
0
        protected override void SetStatusAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            if (item.EEstado == moleQule.Base.EEstado.Anulado)
            {
                return;
            }
            if (item.EEstado == moleQule.Base.EEstado.Pagado)
            {
                return;
            }

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            moleQule.Base.EEstado[] list = { moleQule.Base.EEstado.Abierto, moleQule.Base.EEstado.Contabilizado, moleQule.Base.EEstado.Anulado };
            form.SetDataSource(moleQule.Base.EnumText <moleQule.Base.EEstado> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;

                ChangeState(item, (moleQule.Base.EEstado)estado.Oid);

                Payrolls_BS.ResetBindings(false);

                SetGridFormat();
            }
        }
示例#3
0
        protected void ReparteGasto(Expedient expediente)
        {
            if (!ControlsMng.IsCurrentItemValid(ExpensesInvoices_DGW))
            {
                return;
            }

            InputInvoiceInfo fac = ControlsMng.GetCurrentItem(ExpensesInvoices_DGW) as InputInvoiceInfo;

            if (fac.Conceptos == null)
            {
                fac.LoadChilds(typeof(InputInvoiceLine), false);
            }

            FRecibidaSelectGastoForm form = new FRecibidaSelectGastoForm(fac, expediente, this);

            foreach (InputInvoiceLineInfo item in form.EntityInfo.Conceptos)
            {
                Expense expense = expediente.Gastos.GetItemByConceptoFactura(item);
                item.IsSelected = (expense != null);
            }

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                EditFacturaGastos(form.EntityInfo);

                UpdateExpensesList();
                Datos.ResetBindings(false);
            }
        }
        protected virtual void SetFormaPago()
        {
            if (!ControlsMng.IsCurrentItemValid(Datos_DGW))
            {
                return;
            }
            CreditCard item = ControlsMng.GetCurrentItem(Datos_DGW) as CreditCard;

            EFormaPago[] list;

            if (item.ETipoTarjeta == ETipoTarjeta.Credito)
            {
                list = new EFormaPago[] { EFormaPago.MesVencido, EFormaPago.XDiasMes }
            }
            ;
            else
            {
                list = new EFormaPago[] { EFormaPago.Contado }
            };

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(Library.Common.EnumText <EFormaPago> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource forma_pago = form.Selected as ComboBoxSource;

                item.FormaPago = forma_pago.Oid;
                Datos_DGW.CurrentCell.Value = item.FormaPagoLabel;
            }
        }
        protected override void RemoveOtroGastoAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Expenses_DGW))
            {
                return;
            }

            Expense item = ControlsMng.GetCurrentItem(Expenses_DGW) as Expense;

            RemoveOtroGasto(_entity, item);
        }
        protected override void EditCabezaAction()
        {
            if (!ControlsMng.IsCurrentItemValid(LibroGanadero_DGW))
            {
                return;
            }

            LivestockBookLine linea = ControlsMng.GetCurrentItem(LibroGanadero_DGW) as LivestockBookLine;

            LivestockBookLineEditForm form = new LivestockBookLineEditForm(linea, this);

            form.ShowDialog(this);
        }
示例#7
0
        protected virtual void ViewConceptoCosteEAction()
        {
            if (!ControlsMng.IsCurrentItemValid(ConceptosCostes_DGW))
            {
                return;
            }

            InputInvoiceLineInfo line = ControlsMng.GetCurrentItem(ConceptosCostes_DGW) as InputInvoiceLineInfo;

            InputInvoiceViewForm form = new InputInvoiceViewForm(line.OidFactura, ETipoAcreedor.Proveedor, this);

            form.ShowDialog(this);
        }
示例#8
0
        protected virtual void ViewFacturaEAction()
        {
            if (!ControlsMng.IsCurrentItemValid(FacturasE_DGW))
            {
                return;
            }

            OutputInvoiceInfo invoice = ControlsMng.GetCurrentItem(FacturasE_DGW) as OutputInvoiceInfo;

            InvoiceViewForm form = new InvoiceViewForm(invoice.Oid, this);

            form.ShowDialog(this);
        }
示例#9
0
        protected virtual void ViewConceptoFacturaEAction()
        {
            if (!ControlsMng.IsCurrentItemValid(ConceptosE_DGW))
            {
                return;
            }

            OutputInvoiceLineInfo line = ControlsMng.GetCurrentItem(ConceptosE_DGW) as OutputInvoiceLineInfo;

            InvoiceViewForm form = new InvoiceViewForm(line.OidFactura, this);

            form.ShowDialog(this);
        }
示例#10
0
        protected override void CalculatePayrollAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            item.CalculateValues(_employees.GetItem(item.OidEmpleado), _entity.Fecha);

            ControlsMng.UpdateBinding(Payrolls_BS);
        }
示例#11
0
        protected virtual void ViewFGastoAction()
        {
            if (!ControlsMng.IsCurrentItemValid(ExpensesInvoices_DGW))
            {
                return;
            }

            InputInvoiceInfo fac = ControlsMng.GetCurrentItem(ExpensesInvoices_DGW) as InputInvoiceInfo;

            InputInvoiceViewForm form = new InputInvoiceViewForm(fac, this);

            form.ShowDialog(this);
        }
示例#12
0
        protected virtual void ViewFacturaCosteAction()
        {
            if (!ControlsMng.IsCurrentItemValid(FacturasCostes_DGW))
            {
                return;
            }

            InputInvoiceInfo invoice = ControlsMng.GetCurrentItem(FacturasCostes_DGW) as InputInvoiceInfo;

            InputInvoiceViewForm form = new InputInvoiceViewForm(invoice.Oid, invoice.ETipoAcreedor, this);

            form.ShowDialog(this);
        }
示例#13
0
        protected virtual void RemoveFGastoAction()
        {
            if (!ControlsMng.IsCurrentItemValid(ExpensesInvoices_DGW))
            {
                return;
            }

            InputInvoiceInfo fac = ControlsMng.GetCurrentItem(ExpensesInvoices_DGW) as InputInvoiceInfo;

            RemoveFacturaGastos(fac);

            UpdateExpensesList();
            Datos.ResetBindings(false);
        }
示例#14
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);
            }
        }
示例#15
0
        protected override void UpdatePayroll()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            item.CalculateNeto(_employees.GetItem(item.OidEmpleado).EPayrollMethod);
            ControlsMng.UpdateBinding(Payrolls_BS);

            UpdateTotalRemesa();

            ControlsMng.UpdateBinding(Datos);
        }
        protected override void EditWorkReportAction()
        {
            if (!ControlsMng.IsCurrentItemValid(WorkReport_DGW))
            {
                return;
            }

            WorkReportResourceInfo item = ControlsMng.GetCurrentItem(WorkReport_DGW) as WorkReportResourceInfo;

            WorkReportEditForm form = new WorkReportEditForm(item.OidWorkReport, this);

            form.ShowDialog(this);

            if (form.ActionResult == DialogResult.OK)
            {
                LoadWorkReports(true);
            }
        }
示例#17
0
        protected override void EditEmployeeAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            EmployeeEditForm form = new EmployeeEditForm(item.OidEmpleado, this);

            form.ShowDialog();

            if (form.ActionResult == DialogResult.OK)
            {
                _employees.GetItem(item.OidEmpleado).CopyFrom(form.Entity);
                CalculatePayrollAction();
            }
        }
示例#18
0
        protected override void DeletePayrollAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            if (item.OidPago != 0)
            {
                PgMng.ShowInfoException(Resources.Messages.NOMINA_CON_PAGO);
                return;
            }

            _entity.Nominas.Remove(_entity, item);

            Payrolls_BS.DataSource = _entity.Nominas;
        }
示例#19
0
        protected override void ViewCashLinesAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Lines_DGW))
            {
                return;
            }

            CreditCardStatementInfo item = ControlsMng.GetCurrentItem(Lines_DGW) as CreditCardStatementInfo;

            CashLineList    list = CashLineList.GetByCreditCardStatement(item.Oid, false);
            CashLineMngForm form = new CashLineMngForm(true, _parent, list, 1);

            form.ViewMode      = molView.Enbebbed;
            form.Text          = String.Format("Disposiciones de efectivo de tarjeta {0}: {1} - {2})", _entity.TarjetaCredito, item.From.ToShortDateString(), item.Till.ToShortDateString());
            form.Width         = form.Width / 5 * 4;
            form.Height        = form.Height / 5 * 4;
            form.StartPosition = FormStartPosition.CenterScreen;

            FormMngBase.Instance.ShowFormulario(form, this);
        }
        protected virtual void PrintWorkReportListAction()
        {
            if (!ControlsMng.IsCurrentItemValid(WorkReportMonth_DGW))
            {
                return;
            }
            WorkReportResourceInfo item = ControlsMng.GetCurrentItem(WorkReportMonth_DGW) as WorkReportResourceInfo;

            PgMng.Reset(2, 1, Face.Resources.Messages.LOADING_DATA, this);

            string title  = Resources.Labels.EMPLOYEE_WORKREPORTS_LIST;
            string filter = Resources.Labels.EMPLOYEE + " = " + item.Resource + "; " + Resources.Labels.YEAR + " = " + item.Year + "; " + Resources.Labels.MONTH + " = " + item.Month;

            WorkReportReportMng rptMng = new WorkReportReportMng(AppContext.ActiveSchema, title, filter);

            ReportClass report = rptMng.GetWorkReportResourceList(WorkReportResourceList.GetList(WorkReport_BS.DataSource as IList <WorkReportResourceInfo>));

            PgMng.FillUp();

            ShowReport(report);
        }
        protected override void SetCreditCardAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Lines_DGW))
            {
                return;
            }

            CashLine item = ControlsMng.GetCurrentItem(Lines_DGW) as CashLine;

            if (item.Locked)
            {
                return;
            }

            if (!new ETipoLineaCaja[]
            {
                ETipoLineaCaja.EntradaPorTarjetaCredito
            }.Contains(item.ETipoLinea))
            {
                return;
            }

            CreditCardSelectForm form = new CreditCardSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                CreditCardInfo credit_card = form.Selected as CreditCardInfo;
                if (credit_card.ETipoTarjeta != ETipoTarjeta.Credito)
                {
                    return;
                }

                item.OidCreditCard     = credit_card.Oid;
                item.CreditCard        = credit_card.Nombre;
                item.OidCuentaBancaria = credit_card.OidCuentaBancaria;
                item.CuentaBancaria    = credit_card.CuentaBancaria;

                Lines_BS.ResetBindings(false);
            }
        }
示例#22
0
        protected override void ViewStatementAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Lines_DGW))
            {
                return;
            }

            CreditCardStatementInfo item = ControlsMng.GetCurrentItem(Lines_DGW) as CreditCardStatementInfo;

            PaymentList    list = PaymentList.GetByCreditCardStatement(item.Oid, false);
            PaymentMngForm form = new PaymentMngForm(true, _parent, ETipoPago.Todos, list);

            form.ViewMode      = molView.Enbebbed;
            form.Text          = String.Format("Extracto de tarjeta {0}: {1} - {2})", _entity.TarjetaCredito, item.From.ToShortDateString(), item.Till.ToShortDateString());
            form.Width         = form.Width / 5 * 4;
            form.Height        = form.Height / 5 * 4;
            form.StartPosition = FormStartPosition.CenterScreen;

            FormMngBase.Instance.ShowFormulario(form, this);

            form.FitColumns();
        }
示例#23
0
        protected override void EditPaymentAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Pagos_DGW))
            {
                return;
            }

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

            if (item.Operations.Count == 0)
            {
                item.LoadChilds(typeof(TransactionPayment), false);
            }

            LoanPaymentEditForm form = new LoanPaymentEditForm(item, ETipoPago.Prestamo, _entity, this);

            form.ShowDialog();

            UpdatePayments();

            UpdateImportes();
        }
示例#24
0
        protected override void SetEmployeeAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            if (item.EEstado == moleQule.Base.EEstado.Anulado)
            {
                return;
            }

            EmployeeSelectForm form = new EmployeeSelectForm(this, _employees);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                EmployeeInfo empleado = form.Selected as EmployeeInfo;

                item.CopyFrom(_entity, empleado);
            }
        }