public PayrollBatchSelectForm(Form parent, PayrollBatchList list) : base(true, parent, list) { InitializeComponent(); _view_mode = molView.Select; _action_result = DialogResult.Cancel; }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { PayrollBatchList listA = PayrollBatchList.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) { PayrollBatchList listD = PayrollBatchList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public PayrollBatchMngForm(bool is_modal, Form parent, PayrollBatchList list) : base(is_modal, 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 = PayrollBatchList.NewList().GetSortedList(); SortProperty = Fecha.DataPropertyName; SortDirection = ListSortDirection.Descending; }
protected override void RefreshMainData() { PgMng.Grow(string.Empty, "Payroll"); long oid = ActiveOID; switch (DataType) { case EntityMngFormTypeData.Default: List = PayrollBatchList.GetList(false); break; case EntityMngFormTypeData.ByParameter: _sorted_list = List.GetSortedList(); break; } PgMng.Grow(string.Empty, "Lista de Nominas"); }
public virtual void ExportPayrolls() { PayrollBatchs payrollbatchs2 = null; try { if (Invoice.ModulePrincipal.GetCuentaNominasSetting() == string.Empty) { throw new iQException("No se ha definido la cuenta contable asociada para las Nóminas"); } if (Invoice.ModulePrincipal.GetCuentaSegurosSocialesSetting() == string.Empty) { throw new iQException("No se ha definido la cuenta contable asociada para los seguros sociales"); } if (Invoice.ModulePrincipal.GetCuentaHaciendaSetting() == string.Empty) { throw new iQException("No se ha definido la cuenta contable asociada para la Hacienda Pública"); } _store_conditions.Orders.Clear(); _store_conditions.Orders.NewOrder("Vencimiento", System.ComponentModel.ListSortDirection.Ascending, typeof(Payment)); _payments = PaymentList.GetListInNomina(_store_conditions, true); _employees = EmployeeList.GetList(false); _store_conditions.Orders.Clear(); _store_conditions.Orders.NewOrder("Fecha", System.ComponentModel.ListSortDirection.Ascending, typeof(PayrollBatch)); PayrollBatchList payrollbatchs = PayrollBatchList.GetList(_store_conditions, true); foreach (PayrollBatchInfo item in payrollbatchs) { if (item.EEstado == EEstado.Anulado) { continue; } LineaRegistro lr = _registry.LineaRegistros.NewItem(_registry, item); BuildPayrollBatchAccountingEntry(item, lr); _accounting_entry++; } //Cambiamos el estado de las nominas contabilizadas payrollbatchs2 = PayrollBatchs.GetList(_store_conditions, true); foreach (PayrollBatch item in payrollbatchs2) { if (item.EEstado == EEstado.Anulado) { continue; } if (item.EEstado != EEstado.Exportado) { item.EEstado = EEstado.Exportado; } } payrollbatchs2.Save(); } catch (Exception ex) { _registry = null; throw ex; } finally { if (payrollbatchs2 != null) { payrollbatchs2.CloseSession(); } } }