public override void PrintDetailAction() { if (ActiveItem == null) { return; } InputInvoiceReportMng reportMng = new InputInvoiceReportMng(AppContext.ActiveSchema, this.Text, this.FilterValues); InputInvoiceInfo item = InputInvoiceInfo.Get(ActiveOID, ActiveItem.ETipoAcreedor, true); FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport(); ProviderBaseInfo provider = ProviderBaseInfo.Get(ActiveItem.OidAcreedor, ActiveItem.ETipoAcreedor, false); SerieInfo serie = SerieInfo.Get(ActiveItem.OidSerie, false); conf.nota = (provider.OidImpuesto == 1) ? Library.Invoice.Resources.Messages.NOTA_EXENTO_IGIC : string.Empty; conf.nota += (conf.nota != string.Empty) ? Environment.NewLine : string.Empty; conf.nota += (ActiveItem.Nota ? serie.Cabecera : ""); conf.cuenta_bancaria = ActiveItem.CuentaBancaria; PgMng.Grow(); ReportClass report = reportMng.GetDetailReport(item, conf); if (SettingsMng.Instance.GetUseDefaultPrinter()) { int n_copias = SettingsMng.Instance.GetDefaultNCopies(); PrintReport(report, n_copias); } else { ShowReport(report); } }
protected virtual void LinkLineAction(DataGridViewRow row) { if (row == null) { return; } if (_entity.EMedioPago != EMedioPago.CompensacionFactura) { if (_deallocated == 0) { UnlinkLineAction(row); return; } } InputInvoiceInfo item = row.DataBoundItem as InputInvoiceInfo; if (item == null) { return; } _entity.InsertNewTransactionPayment(item, _deallocated); UpdateAllocated(); MarkAsNoActiva(row); }
/*public FRecibidaSelectGastoForm(long oid, ETipoAcreedor tipo, Form parent) * : base(oid, tipo, parent) * { * InitializeComponent(); * }*/ public FRecibidaSelectGastoForm(InputInvoiceInfo factura, Expedient expediente, Form parent) : base(factura, parent) { InitializeComponent(); _expediente = expediente; }
protected void RemoveFacturaGastos(Expedient expediente, InputInvoiceInfo fac) { this.Enabled = false; try { PgMng.Reset(5, 1, "Recalculando gastos y costes del expediente...", this); if (fac.Conceptos == null) { fac.LoadChilds(typeof(InputInvoiceLine), false); } foreach (InputInvoiceLineInfo item in fac.Conceptos) { item.IsSelected = true; } PgMng.Grow(); expediente.LoadConceptosAlbaranes(false); PgMng.Grow(); expediente.RemoveGasto(fac, expediente.Conceptos, true); PgMng.Grow(); UpdateExpensesList(); Datos.ResetBindings(false); PgMng.Grow(); } finally { PgMng.FillUp(); this.Enabled = true; } }
public override void PrintQRAction() { /*PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this); * * InputInvoiceReportMng reportMng = new InputInvoiceReportMng(AppContext.ActiveSchema, this.Text, FilterValues); * * PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT); * QRCodeRpt report = reportMng.GetQRCodeReport(InputInvoiceList.GetList(Datos.DataSource as IList<InputInvoiceInfo>)); * * PgMng.FillUp(); * * ShowReport(report);*/ if (ActiveItem == null) { return; } InputInvoiceReportMng reportMng = new InputInvoiceReportMng(AppContext.ActiveSchema, this.Text, this.FilterValues); InputInvoiceInfo item = InputInvoiceInfo.Get(ActiveOID, ActiveItem.ETipoAcreedor, true); ReportClass report = reportMng.GetQRCodeReport(item); if (SettingsMng.Instance.GetUseDefaultPrinter()) { int n_copias = SettingsMng.Instance.GetDefaultNCopies(); PrintReport(report, n_copias); } else { ShowReport(report); } }
protected void MarkAsActiva(DataGridViewRow row) { InputInvoiceInfo item = row.DataBoundItem as InputInvoiceInfo; item.Vinculado = Library.Store.Resources.Labels.SET_PAGO; row.Cells[Asignacion.Index].Style.BackColor = row.Cells[Pendiente.Index].Style.BackColor; }
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 override void SetUnlinkedGridValues(string grid_name) { if (grid_name == Facturas_DGW.Name) { Payment Pago = (Payment)Datos_Pago.Current; InputInvoiceInfo item = null; foreach (DataGridViewRow row in Facturas_DGW.Rows) { if (row.IsNewRow) { return; } item = row.DataBoundItem as InputInvoiceInfo; if (item == null) { continue; } row.Cells[FacturaAsignado.Index].Value = Pago.Operations.GetItemByFactura(item.Oid).Cantidad; row.Cells[FacturaAnteriores.Index].Value = item.Pagado - Pago.Operations.GetItemByFactura(item.Oid).Cantidad; } } }
public InputInvoiceViewForm(InputInvoiceInfo factura, Form parent) : base(-1, factura, true, parent) { InitializeComponent(); SetFormData(); _mf_type = ManagerFormType.MFView; }
protected void EditFacturaGastos(Expedient expediente, InputInvoiceInfo fac) { this.Enabled = false; try { PgMng.Reset(5, 1, "Recalculando gastos y costes del expediente...", this); PgMng.Grow(); expediente.LoadConceptosAlbaranes(false); PgMng.Grow(); expediente.UpdateGasto(fac, expediente.Conceptos, true); PgMng.Grow(); UpdateExpensesList(); UpdateBindings(); PgMng.Grow(); } finally { PgMng.FillUp(); this.Enabled = true; } }
private void CopyFactura() { Factura = InputInvoice.New(_entity).GetInfo(true); List <InputInvoiceLineInfo> conceptosOut = new List <InputInvoiceLineInfo>(); foreach (InputInvoiceLineInfo item in Factura.Conceptos) { bool isIn = false; foreach (InputInvoiceLineInfo cp in _conceptos_selected) { if (cp.Oid == item.Oid) { isIn = true; continue; } } if (!isIn) { conceptosOut.Add(item); } } foreach (InputInvoiceLineInfo item in conceptosOut) { Factura.Conceptos.RemoveItem(item.Oid); } Factura.CalculateTotal(); }
protected override void GetFormSourceData(object[] parameters) { _entity = (InputInvoiceInfo)parameters[0]; if (_entity.Conceptos == null) { _entity.LoadChilds(typeof(InputInvoiceLine), false); } }
protected bool ValidateAllocation() { if (_entity.EMedioPago == EMedioPago.CompensacionFactura) { decimal importe = 0; Expenses_BS.MoveFirst(); foreach (DataGridViewRow row in Lineas_DGW.Rows) { InputInvoiceInfo item = row.DataBoundItem as InputInvoiceInfo; if (item.Vinculado == Library.Store.Resources.Labels.RESET_PAGO) { importe += item.Asignado; } Expenses_BS.MoveNext(); } if (importe != 0) { PgMng.ShowInfoException(Resources.Messages.IMPORTE_PAGO_COMPENSACION); _action_result = DialogResult.Ignore; return(false); } } else { if (_entity.Pendiente == 0) { return(true); } if (_entity.Importe < 0) { if (_no_asignado < _entity.Pendiente) { PgMng.ShowInfoException(string.Format("La asignación {0:C2} es inferior a la cantidad pendiente en el cobro {1:C2}.", _no_asignado, _entity.Pendiente)); _action_result = DialogResult.Ignore; return(false); } } else { if (_no_asignado > _entity.Pendiente) { PgMng.ShowInfoException(string.Format("La asignación {0:C2} es superior a la cantidad pendiente en el cobro {1:C2}.", _no_asignado, _entity.Pendiente)); _action_result = DialogResult.Ignore; return(false); } } } return(true); }
protected override void SaveAction() { Factura = EntityInfo; //SelectConceptosAction(); //CopyFactura(); _action_result = DialogResult.OK; DialogResult = DialogResult.OK; }
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); }
protected virtual void VerPendienteAction() { if (Pendientes_DGW.CurrentRow == null) { return; } InputInvoiceInfo factura = Pendientes_DGW.CurrentRow.DataBoundItem as InputInvoiceInfo; InputInvoiceViewForm form = new InputInvoiceViewForm(factura.Oid, factura.ETipoAcreedor, this); form.ShowDialog(this); }
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); }
protected virtual void RemoveFGastoAction() { if (!ControlsMng.IsCurrentItemValid(ExpensesInvoices_DGW)) { return; } InputInvoiceInfo fac = ControlsMng.GetCurrentItem(ExpensesInvoices_DGW) as InputInvoiceInfo; RemoveFacturaGastos(fac); UpdateExpensesList(); Datos.ResetBindings(false); }
protected virtual void AddFGastoAction() { InputInvoiceList list = InputInvoiceList.GetListNoAsignadas(false); InputInvoiceSelectForm form = new InputInvoiceSelectForm(this, list); if (form.ShowDialog(this) == DialogResult.OK) { InputInvoiceInfo fac = form.Selected as InputInvoiceInfo; AddFacturaGastos(fac); UpdateExpensesList(); Datos.ResetBindings(false); } }
protected virtual void UnlinkLineAction(DataGridViewRow row) { if (row == null) { return; } InputInvoiceInfo item = row.DataBoundItem as InputInvoiceInfo; _entity.DeleteTransactionPayment(item); UpdateAllocated(); MarkAsActiva(row); }
protected void CopyValues(InputInvoiceInfo source) { if (source == null) { return; } _oid_titular = source.OidAcreedor; _id_titular = source.NumeroAcreedor; _vat_number_titular = source.VatNumber; _titular = source.Acreedor; _tipo_titular = (long)ETipoTitular.Acreedor; _total = source.Total; _total_efectivo = source.BaseImponible; }
protected void AddFacturaGastos(Expedient expediente, InputInvoiceInfo fac) { this.Enabled = false; try { PgMng.Reset(5, 1, "Recalculando gastos y costes del expediente...", this); if (fac.Conceptos == null) { fac.LoadChilds(typeof(InputInvoiceLine), false); } foreach (InputInvoiceLineInfo item in fac.Conceptos) { if ((item.OidExpediente != expediente.Oid) && (item.OidExpediente != 0)) { item.IsSelected = false; } else { item.IsSelected = true; item.OidExpediente = expediente.Oid; item.Expediente = expediente.Codigo; } } PgMng.Grow(); expediente.LoadConceptosAlbaranes(false); PgMng.Grow(); expediente.NuevoGasto(fac, expediente.Conceptos, true); PgMng.Grow(); UpdateExpensesList(); UpdateBindings(); PgMng.Grow(); } catch (iQException ex) { PgMng.ShowInfoException(ex); } finally { PgMng.FillUp(); this.Enabled = true; } }
public bool CheckFactura(InputInvoiceInfo fac) { List <InputInvoiceInfo> lista = ExpensesInvoices_BS.DataSource as List <InputInvoiceInfo>; InputInvoiceInfo factura = null; foreach (InputInvoiceInfo item in lista) { if ((item.OidAcreedor == fac.OidAcreedor) && (item.ETipoAcreedor == fac.ETipoAcreedor)) { factura = item; } } return(factura != null); }
protected virtual void PrintPendienteListAction() { if (Pendientes_DGW.CurrentRow == null) { return; } InputInvoiceInfo factura = Pendientes_DGW.CurrentRow.DataBoundItem as InputInvoiceInfo; InputInvoiceReportMng reportMng = new InputInvoiceReportMng(AppContext.ActiveSchema, this.Text, "Acreedor = " + factura.Acreedor); InputInvoiceListRpt report = reportMng.GetListReport(Datos_Pendientes.DataSource as InputInvoiceList, ProviderBaseList.GetList(false)); ShowReport(report); }
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; }
protected override void SelectConceptosGastos() { InvoicedExpenses_BS.RaiseListChangedEvents = false; if (ExpensesInvoices_BS.Current != null) { InputInvoiceInfo factura = ExpensesInvoices_BS.Current as InputInvoiceInfo; InvoicedExpenses_BS.DataSource = Expenses.GetListAgrupada(_entity.Gastos.GetSubList(factura)); } else { InvoicedExpenses_BS.DataSource = null; } InvoicedExpenses_BS.RaiseListChangedEvents = true; InvoicedExpenses_BS.ResetBindings(true); }
void Datos_Pago_CurrentChanged(object sender, EventArgs e) { List <InputInvoiceInfo> lista = new List <InputInvoiceInfo>(); if (Datos_Pago.Current == null) { Datos_Factura.DataSource = lista; return; } foreach (TransactionPayment item in Pago.Operations) { InputInvoiceInfo exp = _invoices.GetItem(item.OidOperation); lista.Add(exp); } Datos_Factura.DataSource = lista; }
protected override void SetRowFormat(DataGridViewRow row) { if (row.IsNewRow) { return; } if (!row.Displayed) { return; } InputInvoiceInfo item = row.DataBoundItem as InputInvoiceInfo; Face.Common.ControlTools.Instance.SetRowColor(row, item.EEstado); if (item.Pagada) { return; } /*{ * row.Cells[DiasTranscurridos.Name].Style = Face.Common.ControlTools.Instance.CobradoStyle; * }*/ else if (0 <= item.DiasTranscurridos && item.DiasTranscurridos < 15) { row.Cells[DiasTranscurridos.Name].Style = Face.Common.ControlTools.Instance.PendienteStyleA; } else if (15 <= item.DiasTranscurridos && item.DiasTranscurridos < 31) { row.Cells[DiasTranscurridos.Name].Style = Face.Common.ControlTools.Instance.PendienteStyleB; } else if (31 <= item.DiasTranscurridos && item.DiasTranscurridos < 45) { row.Cells[DiasTranscurridos.Name].Style = Face.Common.ControlTools.Instance.PendienteStyleC; } else if (45 <= item.DiasTranscurridos && item.DiasTranscurridos < 60) { row.Cells[DiasTranscurridos.Name].Style = Face.Common.ControlTools.Instance.PendienteStyleD; } else { row.Cells[DiasTranscurridos.Name].Style = Face.Common.ControlTools.Instance.PendienteStyleE; } }
protected virtual void EditAmountAction(DataGridViewRow row) { InputDecimalForm form = new InputDecimalForm(); form.Message = Resources.Labels.IMPORTE_PAGO_FACTURA; if (form.ShowDialog(this) == DialogResult.OK) { InputInvoiceInfo item = row.DataBoundItem as InputInvoiceInfo; _deallocated += item.Asignado; _entity.EditTransactionPayment(item, form.Value); LinkLineAction(row); SetUnlinkedGridValues(Lineas_DGW); Datos_Lineas.ResetBindings(false); SetGridColors(Lineas_DGW); } }
protected override void AttachFacturaNavieraActon() { if (Fomento_DGW.CurrentRow == null) { return; } if (Fomento_DGW.CurrentRow.DataBoundItem == null) { return; } LineaFomento linea = Fomento_DGW.CurrentRow.DataBoundItem as LineaFomento; InputInvoiceList list = _entity.GetFacturasNaviera(); InputInvoiceSelectForm form = new InputInvoiceSelectForm(this, list); if (form.ShowDialog(this) == DialogResult.OK) { InputInvoiceInfo fac = form.Selected as InputInvoiceInfo; _entity.ExpedientesFomento.SetValues(_entity, fac, linea); } }