protected override void GetFormSourceData(long oid, object[] parameters) { ETipoPago tipo = (ETipoPago)parameters[0]; if (parameters[1] != null) { _holder = (IAcreedor)parameters[1]; _holder.LoadChilds(typeof(Payment), true); _entity = _holder.Pagos.GetItem(oid); } else { _entity = Payment.Get(oid, tipo); } _entity.BeginEdit(); if (_holder != null) { _payrolls = PayrollList.GetByPagoAndPendientesList(_entity.GetInfo(false), (_holder as Employee).Oid, false); } else { _payrolls = PayrollList.GetByPagoAndPendientesList(_entity.GetInfo(false), false); } }
protected override void EditPagoAction() { bool locked = false; 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; } PayrollPaymentEditForm form = new PayrollPaymentEditForm(this, _entity, Pago.Oid, locked); form.MedioPago_BT.Enabled = false; form.ShowDialog(this); Payment current = Pago; Payments_BS.ResetBindings(false); _summary.Refresh(_entity); Summary_BS.ResetBindings(false); SetGridColors(Pagos_DGW.Name); _payrolls = PayrollList.GetListByEmpleado(_entity.Oid, false); Select(current); }
public void SetReadOnly() { Payment_GB.Enabled = false; Nominas_GB.Enabled = false; Submit_BT.Enabled = false; Datos_Lineas.DataSource = PayrollList.GetByPagoList(_entity.GetInfo(false), false).GetSortedList(); }
protected override void SetUnlinkedGridValues(Control control) { SortedBindingList <NominaInfo> nominas = Datos_Lineas.DataSource as SortedBindingList <NominaInfo>; PayrollList list = PayrollList.GetList(nominas); if (nominas != null) { list.UpdatePagoValues(_entity); } Datos_Lineas.DataSource = list.GetSortedList(); UpdateAllocated(); }
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; Payments_BS.ResetBindings(false); _summary.Refresh(_entity); Summary_BS.ResetBindings(false); SetGridColors(Pagos_DGW.Name); _payrolls = PayrollList.GetListByEmpleado(_entity.Oid, false); Select(current); } catch (Exception ex) { PgMng.ShowInfoException(ex); } }
protected override void RefreshMainData() { Datos.DataSource = _entity; PgMng.Grow(); Datos_Lineas.DataSource = PayrollList.GetSortedList(_payrolls, "PrevisionPago", ListSortDirection.Ascending); PgMng.Grow(); Fecha_DTP.Value = _entity.Fecha; Vencimiento_DTP.Value = _entity.Vencimiento; base.RefreshMainData(); }
protected override void RefreshMainData() { Datos.DataSource = _entity; PgMng.Grow(); Datos_Lineas.DataSource = PayrollList.GetByPagoList(_entity, false).GetSortedList(); PgMng.Grow(); Fecha_DTP.Value = _entity.Fecha; Vencimiento_DTP.Value = _entity.Vencimiento; base.RefreshMainData(); }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { PayrollList listA = PayrollList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Unlock: case molAction.ChangeStateContabilizado: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { PayrollList listD = PayrollList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
protected override void RefreshMainData() { _payrolls = PayrollList.GetListByEmpleado(_entity.Oid, false); PgMng.Grow(); Datos.DataSource = _entity; PgMng.Grow(); _entity.LoadChilds(typeof(Payment), true); Payments_BS.DataSource = _entity.Pagos.GetSortedList("Fecha", ListSortDirection.Descending); PgMng.Grow(); Summary_BS.DataSource = _summary; base.RefreshMainData(); }
public PayrollMngForm(bool isModal, Form parent, PayrollList list) : base(isModal, parent, list) { InitializeComponent(); SetView(molView.Normal); // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas DatosLocal_BS = Datos; Tabla.DataSource = DatosLocal_BS; SetMainDataGridView(Tabla); Datos.DataSource = PayrollList.NewList().GetSortedList(); SortProperty = Fecha.DataPropertyName; SortDirection = ListSortDirection.Descending; }
protected override void RefreshAction() { Payment current = Pago; Payments_BS.DataSource = _entity.Pagos.GetSortedList("Fecha", ListSortDirection.Descending); Pagos_DGW.Refresh(); Payments_BS.ResetBindings(false); _payrolls = PayrollList.GetListByEmpleado(_entity.Oid, false); UpdatePendientes(); _summary.Refresh(_entity); Summary_BS.ResetBindings(false); SetGridColors(Pagos_DGW.Name); Select(current); }
protected override void RefreshMainData() { PgMng.Grow(string.Empty, "Payroll"); long oid = ActiveOID; switch (DataType) { case EntityMngFormTypeData.Default: List = PayrollList.GetList(false); break; case EntityMngFormTypeData.ByParameter: _sorted_list = List.GetSortedList(); break; } PgMng.Grow(string.Empty, "Lista de Nominas"); }
protected override void GetFormSourceData(object[] parameters) { if (parameters[0] == null) { if (parameters[2] != null) { _holder = (IAcreedor)parameters[2]; _holder.LoadChilds(typeof(Payment), true); _entity = _holder.Pagos.NewItem(_holder, ETipoPago.Nomina); _entity.CopyFrom(_holder, ETipoPago.Nomina); } else { _entity = Payment.New((ETipoPago)parameters[1]); } _entity.ETipoAcreedor = ETipoAcreedor.Empleado; _entity.BeginEdit(); _entity.Oid = -1; } else { _entity = (Payment)parameters[0]; _entity.BeginEdit(); _entity.Oid = -1; } if (_holder != null) { _payrolls = PayrollList.GetPendientesList((_holder as Employee).Oid, false); } else { _payrolls = PayrollList.GetPendientesList(_entity.GetInfo(false), false); } //Asociamos los gastos previamente vinculados foreach (TransactionPayment item in _entity.Operations) { NominaInfo gasto = _payrolls.GetItem(item.OidOperation); gasto.Vincula(); } }
protected void UpdatePendientes() { Unpaids_BS.DataSource = PayrollList.GetPendientesList(Entity.Oid, false); }
public virtual void ExportPayments() { Payments payments2 = null; try { _store_conditions.Orders.Clear(); _store_conditions.Orders.NewOrder("Vencimiento", System.ComponentModel.ListSortDirection.Ascending, typeof(Payment)); PaymentList payments = PaymentList.GetOrderedByFechaList(_store_conditions, true); //if (pagos.Count == 0) return; // throw new iQException(Library.Resources.Messages.NO_RESULTS); //Hacen falta todas porque un pago puede estar asociado a una factura que no este en las condiciones del filtro _input_invoices = InputInvoiceList.GetList(false); _providers = (_providers == null) ? ProviderBaseList.GetList(false) : _providers; _employees = (_employees == null) ? EmployeeList.GetList(false) : _employees; _expense_types = (_expense_types == null) ? TipoGastoList.GetList(false) : _expense_types; _payrolls = (_payrolls == null) ? PayrollList.GetList(false) : _payrolls; foreach (PaymentInfo item in payments) { if (item.EEstado == EEstado.Anulado) { continue; } LineaRegistro lr = _registry.LineaRegistros.NewItem(_registry, item); switch (item.ETipoPago) { case ETipoPago.Factura: { BuildInvoicePaymentAccountingEntry(item, lr); BuildFinancialCashBookPaymentAccountingEntry(item); } break; case ETipoPago.Nomina: { BuildPayrollPaymentAccountingEntry(item, lr); } break; case ETipoPago.Gasto: { BuildExpensePaymentAccountingEntry(item, lr); } break; case ETipoPago.ExtractoTarjeta: { BuildCreditCardStatementPaymentAccountingEntry(item, lr); } break; } _accounting_entry++; } //Cambiamos el estado de los pagos contabilizados payments2 = Payments.GetList(_store_conditions, false); foreach (Payment item in payments2) { if (item.EEstado == EEstado.Anulado) { continue; } if (item.EEstado != EEstado.Exportado) { /*if (item.EEstadoPago == EEstado.Pagado)*/ item.EEstado = EEstado.Exportado; } } payments2.Save(); } catch (iQException ex) { _registry = null; throw ex; } catch (Exception ex) { _registry = null; throw ex; } finally { if (payments2 != null) { payments2.CloseSession(); } } }