public Lbl.Comprobantes.ColeccionDetalleArticulos ObtenerArticulos(Lbl.Comprobantes.ComprobanteConArticulos comprobante) { if (m_Articulos == null) { m_Articulos = new Lbl.Comprobantes.ColeccionDetalleArticulos(comprobante); } else { m_Articulos.Clear(); } int i = 1; foreach (DetalleCompra Pro in this.ChildControls) { if (Pro.IsEmpty == false) { Lbl.Comprobantes.DetalleArticulo DetArt = new Lbl.Comprobantes.DetalleArticulo(comprobante); DetArt.Articulo = Pro.Articulo; DetArt.Alicuota = Pro.Alicuota; DetArt.Nombre = Pro.TextDetail; DetArt.Orden = i++; DetArt.Cantidad = Pro.Cantidad; DetArt.ImporteIvaUnitario = Pro.ImporteIvaUnitario; DetArt.ImporteUnitario = Pro.ImporteUnitario; DetArt.ImporteNoGravado = Pro.ImporteNoGravado; DetArt.Descuento = Pro.Descuento; DetArt.DatosSeguimiento = Pro.DatosSeguimiento; m_Articulos.Add(DetArt); } } return(m_Articulos); }
/// <summary> /// Genera y devuelve un Detalle de una factura que consta de 1 artículo código 1, a precio $ 100 más /// VA del 21%, cantidad 5, con descuento del 8%. /// </summary> /// <param name="ivaDiscriminado">Indica si se trata de un detalle con IVA discriminado.</param> /// <param name="conIVa">Indica si el cliente paga IVA.</param> /// <returns>El detalle generado.</returns> public static Lbl.Comprobantes.DetalleArticulo ObtenerDetalleEjemplo(bool ivaDiscriminado, bool conIva) { var Det = new Lbl.Comprobantes.DetalleArticulo(TestSetup.Connection); Det.Crear(); Det.Articulo = Articulo; Det.Cantidad = 5m; if (conIva) { Det.ImporteUnitario = ivaDiscriminado ? 100m : 121m; Det.ImporteIvaUnitario = 21m; } else { Det.ImporteUnitario = 100m; Det.ImporteIvaUnitario = 0m; } Det.Descuento = 8m; Det.Alicuota = Alicuota21; return(Det); }
public void EnviarNP(object sender, System.EventArgs e) { Lbl.Comprobantes.ComprobanteDeCompra Comprob = new Lbl.Comprobantes.ComprobanteDeCompra(this.Connection); Comprob.Tipo = Lbl.Comprobantes.Tipo.TodosPorLetra["NP"]; Comprob.FormaDePago = new Lbl.Pagos.FormaDePago(this.Connection, 3); Lbl.Comprobantes.ColeccionDetalleArticulos newCole = new Lbl.Comprobantes.ColeccionDetalleArticulos(this.Connection); foreach (ListViewItem Itm in this.Listado.Items) { Lbl.Articulos.Articulo art = new Lbl.Articulos.Articulo(this.Connection, int.Parse(Itm.SubItems[0].Text)); Lbl.Comprobantes.DetalleArticulo detArt = new Lbl.Comprobantes.DetalleArticulo(this.Connection); detArt.Crear(); detArt.Articulo = art; decimal costoFinal = decimal.Parse(Itm.SubItems["articulos.costo"].Text); detArt.ImporteUnitario = costoFinal; decimal stockAct = decimal.Parse(Itm.SubItems["articulos.stock_actual"].Text); decimal stockMin = decimal.Parse(Itm.SubItems["articulos.stock_minimo"].Text); if (stockMin == 0) { detArt.Cantidad = 1; } else { detArt.Cantidad = stockMin > stockAct ? stockMin - stockAct : stockMin; } newCole.Add(detArt); } Comprob.Articulos.AddRange(newCole); Comprob.Estado = 50; Lfc.FormularioEdicion FormularioEdicion = Lfc.Instanciador.InstanciarFormularioEdicion(Comprob); FormularioEdicion.MdiParent = this.MdiParent; //this.ParentForm.MdiParent; FormularioEdicion.Show(); //Lbl.IElementoDeDatos El = Lbl.Instanciador.Instanciar(this.Definicion.ElementoTipo, Lfx.Workspace.Master.GetNewConnection("Crear " + this.Definicion.ElementoTipo.ToString()) as Lfx.Data.Connection); //El.Crear(); }
public Lbl.Comprobantes.ColeccionDetalleArticulos ObtenerArticulos(Lfx.Data.IConnection dataBase) { m_Articulos = new Lbl.Comprobantes.ColeccionDetalleArticulos(dataBase); int i = 1; foreach (DetalleComprobante Pro in this.ChildControls) { if (Pro.IsEmpty == false) { Lbl.Comprobantes.DetalleArticulo DetArt = new Lbl.Comprobantes.DetalleArticulo(dataBase); DetArt.Articulo = Pro.Elemento as Lbl.Articulos.Articulo; DetArt.Nombre = Pro.TextDetail; DetArt.Orden = i++; DetArt.Cantidad = Pro.Cantidad; DetArt.ImporteUnitario = Pro.ImporteUnitario; DetArt.Descuento = Pro.Descuento; DetArt.DatosSeguimiento = Pro.DatosSeguimiento; m_Articulos.Add(DetArt); } } return(m_Articulos); }
private Lfx.Types.OperationResult Facturar() { Lui.Forms.YesNoDialog Pregunta = new Lui.Forms.YesNoDialog("¿Desea guardar los cambios realizados y generar una factura a partir de esta tarea?", "Facturar"); if (Pregunta.ShowDialog() != DialogResult.OK) { return(new Lfx.Types.CancelOperationResult()); } if (EntradaEstado.ValueInt < 50) { EntradaEstado.ValueInt = 50; } Lfx.Types.OperationResult Res = this.Save(); if (Res.Success == false) { return(Res); } Lbl.Tareas.Tarea Tarea = this.Elemento as Lbl.Tareas.Tarea; Lbl.Comprobantes.ComprobanteFacturable Factura; Lfx.Data.Connection ConnFacturaNueva = Lfx.Workspace.Master.GetNewConnection("Convertir tarea en factura"); if (Tarea.Factura != null && Tarea.Factura.Anulado == false) { // Ya fue facturada... lo muestro Factura = Tarea.Factura; } else { // No tiene comprobante, lo creo Factura = new Lbl.Comprobantes.Factura(ConnFacturaNueva); Factura.Crear(); Factura.Cliente = EntradaCliente.Elemento as Lbl.Personas.Persona; Factura.Cliente.Connection = ConnFacturaNueva; Factura.Tipo = Factura.Cliente.ObtenerTipoComprobante(); Factura.Tipo.Connection = ConnFacturaNueva; Factura.Vendedor = EntradaEncargado.Elemento as Lbl.Personas.Persona; Factura.Vendedor.Connection = ConnFacturaNueva; Factura.Obs = EntradaTarea.TextDetail + " s/" + this.Elemento.ToString(); if (Tarea.Articulos.Count > 0) { Factura.Articulos.AddRange(Tarea.Articulos); } else if (Tarea.Presupuesto != null && Tarea.Presupuesto.Articulos.Count > 0) { Factura.Articulos.AddRange(Tarea.Presupuesto.Articulos); Factura.Descuento = Tarea.Presupuesto.Descuento; } if (EntradaImportePresupuesto.ValueDecimal > 0) { Lbl.Comprobantes.DetalleArticulo Art = new Lbl.Comprobantes.DetalleArticulo(Factura); Art.Nombre = this.Elemento.ToString(); Art.Unitario = EntradaImportePresupuesto.ValueDecimal; Art.Cantidad = 1; Factura.Articulos.Add(Art); } } Lfc.FormularioEdicion FormularioFactura = Lfc.Instanciador.InstanciarFormularioEdicion(Factura); FormularioFactura.MdiParent = this.ParentForm.MdiParent; FormularioFactura.ControlDestino = EntradaComprobanteId; FormularioFactura.Show(); return(new Lfx.Types.SuccessOperationResult()); }
protected Lazaro.Pres.Spreadsheet.Row FormatArt(Lazaro.Pres.Spreadsheet.Sheet sheet, Lbl.Comprobantes.DetalleArticulo useField) { Lazaro.Pres.Spreadsheet.Row Reng = new Lazaro.Pres.Spreadsheet.Row(sheet); int id_articulo = useField.Articulo == null ? 0 : useField.Articulo.Id; Lazaro.Pres.Spreadsheet.Cell NewCell = Reng.Cells.Add(); ExcelReg e = excReg.Find(t => t.name == "id_articulo"); NewCell = GetContent(NewCell, e, id_articulo); string nombre = useField.Nombre; NewCell = Reng.Cells.Add(); e = excReg.Find(t => t.name == "nombre"); NewCell = GetContent(NewCell, e, nombre); string descripcion = useField.Descripcion; NewCell = Reng.Cells.Add(); e = excReg.Find(t => t.name == "descripcion"); NewCell = GetContent(NewCell, e, descripcion); decimal cantidad = useField.Cantidad; NewCell = Reng.Cells.Add(); e = excReg.Find(t => t.name == "cantidad"); NewCell = GetContent(NewCell, e, cantidad); decimal costo = useField.Costo; NewCell = Reng.Cells.Add(); e = excReg.Find(t => t.name == "costo"); NewCell = GetContent(NewCell, e, costo); decimal precio = useField.ImporteUnitario; NewCell = Reng.Cells.Add(); e = excReg.Find(t => t.name == "precio"); NewCell = GetContent(NewCell, e, precio); decimal importe = useField.ImporteUnitarioFinal; NewCell = Reng.Cells.Add(); e = excReg.Find(t => t.name == "importe"); NewCell = GetContent(NewCell, e, importe); decimal recargo = useField.Recargo; NewCell = Reng.Cells.Add(); e = excReg.Find(t => t.name == "recargo"); NewCell = GetContent(NewCell, e, recargo); decimal total = useField.ImporteAImprimir; NewCell = Reng.Cells.Add(); e = excReg.Find(t => t.name == "total"); NewCell = GetContent(NewCell, e, total); return(Reng); }
public override string ObtenerValorCampo(string nombreCampo, string formato) { string Res = null; switch (nombreCampo.ToUpperInvariant()) { case "ARTICULOS.CODIGOS": case "ARTÍCULOS.CÓDIGOS": case "CODIGOS": case "CÓDIGOS": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { // FIXME: que imprima el código seleccionado por el usuario, no siempre el autonumérico string CodigoImprimir; if (this.Comprobante.Articulos[i].Articulo == null) { CodigoImprimir = ""; } else { CodigoImprimir = this.Comprobante.Articulos[i].Articulo.Id.ToString(); } if (Res == null) { Res = CodigoImprimir; } else { Res += System.Environment.NewLine + CodigoImprimir; } } return(Res); case "ARTICULOS.CANTIDADES": case "ARTÍCULOS.CANTIDADES": case "CANTIDADES": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Articulos[i].Cantidad, Lbl.Sys.Config.Articulos.Decimales) + System.Environment.NewLine; } return(Res); case "ARTICULOS.IVA": case "ARTÍCULOS.IVA": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += this.Comprobante.Articulos[i].ObtenerAlicuota().Porcentaje.ToString("0.0") + "%" + System.Environment.NewLine; } return(Res); case "ARTICULOS.IVADISCRIMINADO": case "ARTÍCULOS.IVADISCRIMINADO": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteUnitarioIvaDiscriminado, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } return(Res); case "ARTÍCULOS.IMPORTESCONIVA": case "ARTICULOS.IMPORTESCONIVA": Res = ""; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteAImprimir, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } return(Res); case "ARTÍCULOS.UNITARIOSCONIVA": case "ARTICULOS.UNITARIOSCONIVA": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteUnitarioConIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } return(Res); case "ARTÍCULOS.IMPORTESCONIVA1": case "ARTÍCULOS.IMPORTESCONIVA2": case "ARTÍCULOS.IMPORTESCONIVA3": case "ARTÍCULOS.IMPORTESCONIVA4": case "ARTÍCULOS.IMPORTESCONIVA5": case "ARTÍCULOS.IMPORTESCONIVA6": case "ARTÍCULOS.IMPORTESCONIVA7": case "ARTÍCULOS.IMPORTESCONIVA8": case "ARTÍCULOS.IMPORTESCONIVA9": case "ARTICULOS.IMPORTESCONIVA1": case "ARTICULOS.IMPORTESCONIVA2": case "ARTICULOS.IMPORTESCONIVA3": case "ARTICULOS.IMPORTESCONIVA4": case "ARTICULOS.IMPORTESCONIVA5": case "ARTICULOS.IMPORTESCONIVA6": case "ARTICULOS.IMPORTESCONIVA7": case "ARTICULOS.IMPORTESCONIVA8": case "ARTICULOS.IMPORTESCONIVA9": int NumeroIvaArt = Lfx.Types.Parsing.ParseInt(nombreCampo.Substring(nombreCampo.Length - 1)); Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (Res == null) { Res = Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteConIvaFinalAlicuota(NumeroIvaArt), Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } else { Res += System.Environment.NewLine + Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteConIvaFinalAlicuota(NumeroIvaArt), Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } } return(Res); case "ARTICULOS.DETALLES": case "ARTÍCULOS.DETALLES": case "DETALLES": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { string NombreArticulo; if (this.Comprobante.Articulos[i].Articulo == null) { NombreArticulo = this.Comprobante.Articulos[i].Nombre; } else { NombreArticulo = this.Comprobante.Articulos[i].Articulo.ToString(); } if (Res == null) { Res = NombreArticulo; } else { Res += System.Environment.NewLine + NombreArticulo; } } if (this.Comprobante.Descuento != 0) { Res += System.Environment.NewLine + "Descuento: " + Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Descuento, 2) + "%"; } if (this.Comprobante.Recargo != 0) { Res += System.Environment.NewLine + "Recargo: " + Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Descuento, 2) + "%"; } return(Res); case "ARTICULOS.UNITARIOSORIGINALES": case "ARTÍCULOS.UNITARIOSORIGINALES": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Comprobante.Articulos[i]; string Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteUnitario, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } return(Res); case "ARTICULOS.UNITARIOS": case "ARTÍCULOS.UNITARIOS": case "ARTÍCULOS.UNITARIOSFINALES": case "PRECIOS": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Comprobante.Articulos[i]; string Linea; if (Comprobante.Tipo.DiscriminaIva) { Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteUnitarioSinIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } else { Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteUnitarioConIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } return(Res); case "ARTICULOS.DESCUENTOS": case "ARTÍCULOS.DESCUENTOS": case "DESCUENTOS": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Comprobante.Articulos[i]; string Linea; if (Det.Descuento == 0) { Linea = "--"; } else { Linea = Lfx.Types.Formatting.FormatNumberForPrint(Det.Descuento, 2) + "%"; } if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } return(Res); case "ARTICULOS.IMPORTES": case "ARTÍCULOS.IMPORTES": case "IMPORTES": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Comprobante.Articulos[i]; string Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteAImprimir, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); if (Res == null) { Res = ""; } Res += Linea + System.Environment.NewLine; } return(Res); case "SUBTOTAL": case "COMPROBANTE.SUBTOTAL": if (Comprobante.DiscriminaIva) { return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.SubtotalSinIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); } else { return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Subtotal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); } case "TOTAL": case "COMPROBANTE.TOTAL": return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Total, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); case "IVADISCRIMINADO": case "COMPROBANTE.IVADISCRIMINADO": if (Comprobante.DiscriminaIva) { return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.ImporteIvaDiscriminadoFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); } else { return("N/A"); } case "COMPROBANTE.TOTALIVA1": case "COMPROBANTE.TOTALIVA2": case "COMPROBANTE.TOTALIVA3": case "COMPROBANTE.TOTALIVA4": case "COMPROBANTE.TOTALIVA5": case "COMPROBANTE.TOTALIVA6": case "COMPROBANTE.TOTALIVA7": case "COMPROBANTE.TOTALIVA8": case "COMPROBANTE.TOTALIVA9": case "TOTALIVA1": case "TOTALIVA2": case "TOTALIVA3": case "TOTALIVA4": case "TOTALIVA5": case "TOTALIVA6": case "TOTALIVA7": case "TOTALIVA8": case "TOTALVA9": int NumeroIvaComprob = Lfx.Types.Parsing.ParseInt(nombreCampo.Substring(nombreCampo.Length - 1)); return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.TotalIvaAlicuota(NumeroIvaComprob), Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); case "RECARGO": case "COMPROBANTE.RECARGO": return(Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Recargo, 2)); case "FORMAPAGO": case "COMPROBANTE.FORMAPAGO": if (this.Comprobante.FormaDePago == null) { return(""); } else { return(this.Comprobante.FormaDePago.ToString()); } case "SONPESOS": case "COMPROBANTE.SONPESOS": return(Lfx.Types.Formatting.SpellNumber(this.Comprobante.Total)); case "TIPO": case "COMPROBANTE.TIPO": return(this.Comprobante.Tipo.Nombre); default: return(base.ObtenerValorCampo(nombreCampo, formato)); } }
public override string ObtenerValorCampo(string nombreCampo, string formato) { string Res = null; switch (nombreCampo.ToUpperInvariant()) { case "CLIENTE": case "CLIENTE.NOMBRE": return(this.Tarea.Cliente.ToString()); case "LOCALIDAD": case "LOCALIDAD.NOMBRE": case "CLIENTE.LOCALIDAD": case "CLIENTE.LOCALIDAD.NOMBRE": if (this.Tarea.Cliente.Localidad == null) { return(""); } else { return(this.Tarea.Cliente.Localidad.ToString()); } case "DOMICILIO": case "CLIENTE.DOMICILIO": if (this.Tarea.Cliente.Domicilio != null && this.Tarea.Cliente.Domicilio.Length > 0) { return(this.Tarea.Cliente.Domicilio); } else { return(this.Tarea.Cliente.DomicilioLaboral); } case "CLIENTE.DOCUMENTO": if (this.Tarea.Cliente.ClaveTributaria != null) { return(this.Tarea.Cliente.ClaveTributaria.ToString()); } else { return(this.Tarea.Cliente.NumeroDocumento); } case "CUIT": case "CLIENTE.CUIT": if (this.Tarea.Cliente.ClaveTributaria != null) { return(this.Tarea.Cliente.ClaveTributaria.ToString()); } else { return(""); } case "CLIENTE.ID": return(this.Tarea.Cliente.Id.ToString()); case "VENDEDOR": case "VENDEDOR.NOMBRE": return(this.Tarea.Encargado.ToString()); case "TOTAL": case "TAREA.TOTAL": decimal totalTarea = this.Tarea.ImporteAsociado - ((this.Tarea.DescuentoArticulos * this.Tarea.ImporteAsociado) / 100); return(Lfx.Types.Formatting.FormatCurrencyForPrint(totalTarea, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); case "ARTICULOS.CODIGOS": case "ARTÍCULOS.CÓDIGOS": case "CODIGOS": case "CÓDIGOS": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { // FIXME: que imprima el código seleccionado por el usuario, no siempre el autonumérico string CodigoImprimir; if (this.Tarea.Articulos[i].Articulo == null) { CodigoImprimir = ""; } else { CodigoImprimir = this.Tarea.Articulos[i].Articulo.Id.ToString(); } if (Res == null) { Res = CodigoImprimir; } else { Res += System.Environment.NewLine + CodigoImprimir; } } return(Res); case "ARTICULOS.CANTIDADES": case "ARTÍCULOS.CANTIDADES": case "CANTIDADES": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatNumberForPrint(this.Tarea.Articulos[i].Cantidad, Lbl.Sys.Config.Articulos.Decimales) + System.Environment.NewLine; } return(Res); case "ARTICULOS.IVA": case "ARTÍCULOS.IVA": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += this.Tarea.Articulos[i].ObtenerAlicuota().Porcentaje.ToString("0.0") + "%" + System.Environment.NewLine; } return(Res); case "ARTICULOS.IVADISCRIMINADO": case "ARTÍCULOS.IVADISCRIMINADO": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Tarea.Articulos[i].ImporteUnitarioIvaDiscriminado, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } return(Res); case "ARTÍCULOS.IMPORTESCONIVA": case "ARTICULOS.IMPORTESCONIVA": Res = ""; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Tarea.Articulos[i].ImporteAImprimir, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } return(Res); case "ARTÍCULOS.UNITARIOSCONIVA": case "ARTICULOS.UNITARIOSCONIVA": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Tarea.Articulos[i].ImporteUnitarioConIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } return(Res); case "ARTÍCULOS.IMPORTESCONIVA1": case "ARTÍCULOS.IMPORTESCONIVA2": case "ARTÍCULOS.IMPORTESCONIVA3": case "ARTÍCULOS.IMPORTESCONIVA4": case "ARTÍCULOS.IMPORTESCONIVA5": case "ARTÍCULOS.IMPORTESCONIVA6": case "ARTÍCULOS.IMPORTESCONIVA7": case "ARTÍCULOS.IMPORTESCONIVA8": case "ARTÍCULOS.IMPORTESCONIVA9": case "ARTICULOS.IMPORTESCONIVA1": case "ARTICULOS.IMPORTESCONIVA2": case "ARTICULOS.IMPORTESCONIVA3": case "ARTICULOS.IMPORTESCONIVA4": case "ARTICULOS.IMPORTESCONIVA5": case "ARTICULOS.IMPORTESCONIVA6": case "ARTICULOS.IMPORTESCONIVA7": case "ARTICULOS.IMPORTESCONIVA8": case "ARTICULOS.IMPORTESCONIVA9": int NumeroIvaArt = Lfx.Types.Parsing.ParseInt(nombreCampo.Substring(nombreCampo.Length - 1)); Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { if (Res == null) { Res = Lfx.Types.Formatting.FormatCurrencyForPrint(this.Tarea.Articulos[i].ImporteConIvaFinalAlicuota(NumeroIvaArt), Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } else { Res += System.Environment.NewLine + Lfx.Types.Formatting.FormatCurrencyForPrint(this.Tarea.Articulos[i].ImporteConIvaFinalAlicuota(NumeroIvaArt), Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } } return(Res); case "ARTICULOS.DETALLES": case "ARTÍCULOS.DETALLES": case "DETALLES": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { string NombreArticulo; if (this.Tarea.Articulos[i].Articulo == null) { NombreArticulo = this.Tarea.Articulos[i].Nombre; } else { NombreArticulo = this.Tarea.Articulos[i].Articulo.ToString(); } if (Res == null) { Res = NombreArticulo; } else { Res += System.Environment.NewLine + NombreArticulo; } } if (this.Tarea.DescuentoArticulos != 0) { Res += System.Environment.NewLine + "Descuento: " + Lfx.Types.Formatting.FormatNumberForPrint(this.Tarea.DescuentoArticulos, 2) + "%"; } return(Res); case "ARTICULOS.UNITARIOSORIGINALES": case "ARTÍCULOS.UNITARIOSORIGINALES": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Tarea.Articulos[i]; string Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteUnitario, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } return(Res); case "ARTICULOS.UNITARIOS": case "ARTÍCULOS.UNITARIOS": case "ARTÍCULOS.UNITARIOSFINALES": case "PRECIOS": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Tarea.Articulos[i]; string Linea; Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteUnitarioConIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } return(Res); case "ARTICULOS.DESCUENTOS": case "ARTÍCULOS.DESCUENTOS": case "DESCUENTOS": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Tarea.Articulos[i]; string Linea; if (Det.Descuento == 0) { Linea = "--"; } else { Linea = Lfx.Types.Formatting.FormatNumberForPrint(Det.Descuento, 2) + "%"; } if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } return(Res); case "ARTICULOS.IMPORTES": case "ARTÍCULOS.IMPORTES": case "IMPORTES": Res = null; for (int i = 0; i < this.Tarea.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Tarea.Articulos[i]; string Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteAImprimir, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); if (Res == null) { Res = ""; } Res += Linea + System.Environment.NewLine; } return(Res); case "SONPESOS": case "TAREA.SONPESOS": decimal totalTareaenPesos = this.Tarea.ImporteAsociado - ((this.Tarea.DescuentoArticulos * this.Tarea.ImporteAsociado) / 100); return(Lfx.Types.Formatting.SpellNumber(totalTareaenPesos)); default: return(base.ObtenerValorCampo(nombreCampo, formato)); } }
public new void Add(Lbl.Comprobantes.DetalleArticulo detalle) { detalle.ElementoPadre = this.ElementoPadre; base.Add(detalle); }
private Lfx.Types.OperationResult Facturar() { Lui.Forms.YesNoDialog Pregunta = new Lui.Forms.YesNoDialog("¿Desea guardar los cambios realizados y generar una factura a partir de esta tarea?", "Facturar"); if (Pregunta.ShowDialog() != DialogResult.OK) return new Lfx.Types.CancelOperationResult(); if (EntradaEstado.ValueInt < 50) EntradaEstado.ValueInt = 50; Lfx.Types.OperationResult Res = this.Save(); if (Res.Success == false) return Res; Lbl.Tareas.Tarea Tarea = this.Elemento as Lbl.Tareas.Tarea; Lbl.Comprobantes.ComprobanteFacturable Factura; Lfx.Data.Connection ConnFacturaNueva = Lfx.Workspace.Master.GetNewConnection("Convertir tarea en factura"); if (Tarea.Factura != null && Tarea.Factura.Anulado == false) { // Ya fue facturada... lo muestro Factura = Tarea.Factura; } else { // No tiene comprobante, lo creo Factura = new Lbl.Comprobantes.Factura(ConnFacturaNueva); Factura.Crear(); Factura.Cliente = EntradaCliente.Elemento as Lbl.Personas.Persona; Factura.Cliente.Connection = ConnFacturaNueva; Factura.Tipo = Factura.Cliente.ObtenerTipoComprobante(); Factura.Tipo.Connection = ConnFacturaNueva; Factura.Vendedor = EntradaEncargado.Elemento as Lbl.Personas.Persona; Factura.Vendedor.Connection = ConnFacturaNueva; Factura.Obs = EntradaTarea.TextDetail + " s/" + this.Elemento.ToString(); if (Tarea.Articulos.Count > 0) { Factura.Articulos.AddRange(Tarea.Articulos); } else if (Tarea.Presupuesto != null && Tarea.Presupuesto.Articulos.Count > 0) { Factura.Articulos.AddRange(Tarea.Presupuesto.Articulos); Factura.Descuento = Tarea.Presupuesto.Descuento; } if (EntradaImportePresupuesto.ValueDecimal > 0) { Lbl.Comprobantes.DetalleArticulo Art = new Lbl.Comprobantes.DetalleArticulo(Factura); Art.Nombre = this.Elemento.ToString(); Art.Unitario = EntradaImportePresupuesto.ValueDecimal; Art.Cantidad = 1; Factura.Articulos.Add(Art); } } Lfc.FormularioEdicion FormularioFactura = Lfc.Instanciador.InstanciarFormularioEdicion(Factura); FormularioFactura.MdiParent = this.ParentForm.MdiParent; FormularioFactura.ControlDestino = EntradaComprobanteId; FormularioFactura.Show(); return new Lfx.Types.SuccessOperationResult(); }
public Lbl.Comprobantes.ColeccionDetalleArticulos ObtenerArticulos(Lbl.Comprobantes.ComprobanteConArticulos comprobante) { if (m_Articulos == null) m_Articulos = new Lbl.Comprobantes.ColeccionDetalleArticulos(comprobante); else m_Articulos.Clear(); int i = 1; foreach (DetalleComprobante Pro in this.ChildControls) { if (Pro.IsEmpty == false) { Lbl.Comprobantes.DetalleArticulo DetArt = new Lbl.Comprobantes.DetalleArticulo(comprobante); DetArt.Articulo = Pro.Articulo; DetArt.Nombre = Pro.TextDetail; DetArt.Orden = i++; DetArt.Cantidad = Pro.Cantidad; DetArt.Unitario = Pro.Unitario; DetArt.Descuento = Pro.Descuento; DetArt.DatosSeguimiento = Pro.DatosSeguimiento; m_Articulos.Add(DetArt); } } return m_Articulos; }
public Lbl.Comprobantes.ColeccionDetalleArticulos ObtenerArticulos(Lfx.Data.Connection dataBase) { m_Articulos = new Lbl.Comprobantes.ColeccionDetalleArticulos(dataBase); int i = 1; foreach (DetalleComprobante Pro in this.ChildControls) { if (Pro.IsEmpty == false) { Lbl.Comprobantes.DetalleArticulo DetArt = new Lbl.Comprobantes.DetalleArticulo(dataBase); DetArt.Articulo = Pro.Elemento as Lbl.Articulos.Articulo; DetArt.Nombre = Pro.TextDetail; DetArt.Orden = i++; DetArt.Cantidad = Pro.Cantidad; DetArt.Unitario = Pro.Unitario; DetArt.Descuento = Pro.Descuento; DetArt.DatosSeguimiento = Pro.DatosSeguimiento; m_Articulos.Add(DetArt); } } return m_Articulos; }
public override IElementoDeDatos ConvertirRegistroEnElemento(MapaDeTabla mapa, Lfx.Data.Row externalRow, Lfx.Data.Row internalRow) { switch (mapa.TablaGestion) { case "ctacte": Lbl.IElementoDeDatos ElemMovim = base.ConvertirRegistroEnElemento(mapa, externalRow, internalRow); Lbl.CuentasCorrientes.Movimiento Movim = ElemMovim as Lbl.CuentasCorrientes.Movimiento; if (Movim != null) { if (Movim.IdCliente == 0) { return(null); } Movim.Auto = true; string TipoComprobVentre = externalRow["original_TIPO"].ToString(); if (TipoComprobVentre == "FCB") { TipoComprobVentre = "Factura"; } else if (TipoComprobVentre == "RCB") { TipoComprobVentre = "Recibo"; Movim.Importe = -Movim.Importe; } else if (TipoComprobVentre == "NCB") { TipoComprobVentre = "Nota de Crédito"; Movim.Importe = -Movim.Importe; } Movim.Nombre = TipoComprobVentre + " 0001-" + System.Convert.ToInt32(externalRow["original_NROCOM"]).ToString("00000000"); } return(ElemMovim); case "comprob_detalle": // Busco una factura a la cual adosar este detalle string Tipo = externalRow["TIPO"].ToString(), TipoGestion = null; bool Compra = false; int Numero = Lfx.Types.Parsing.ParseInt(externalRow["NROCOM"].ToString()); switch (Tipo) { case "FCA": TipoGestion = "FA"; break; case "FCB": TipoGestion = "FB"; break; case "ING": TipoGestion = "FA"; Compra = true; break; case "DEV": TipoGestion = "NCB"; break; } if (Numero > 0 && TipoGestion != null) { // Es una factura válida Lbl.Comprobantes.Factura Fac; qGen.Select SelFac = new qGen.Select("comprob"); SelFac.WhereClause = new qGen.Where(); SelFac.WhereClause.AddWithValue("tipo_fac", TipoGestion); SelFac.WhereClause.AddWithValue("compra", Compra ? 1 : 0); SelFac.WhereClause.AddWithValue("numero", Numero); Lfx.Data.Row FacRow = this.Connection.FirstRowFromSelect(SelFac); if (FacRow == null) { int Cliente = System.Convert.ToInt32(externalRow["CLIENTE"]); if (Cliente <= 0) { Cliente = 999; } qGen.Insert NewFac = new qGen.Insert("comprob"); NewFac.ColumnValues.AddWithValue("id_formapago", 1); NewFac.ColumnValues.AddWithValue("tipo_fac", TipoGestion); NewFac.ColumnValues.AddWithValue("pv", 1); NewFac.ColumnValues.AddWithValue("numero", Numero); NewFac.ColumnValues.AddWithValue("situacionorigen", 1); NewFac.ColumnValues.AddWithValue("situaciondestino", 999); NewFac.ColumnValues.AddWithValue("fecha", System.Convert.ToDateTime(externalRow["FECHA"])); NewFac.ColumnValues.AddWithValue("id_vendedor", 1); NewFac.ColumnValues.AddWithValue("id_cliente", Cliente); NewFac.ColumnValues.AddWithValue("impresa", 1); NewFac.ColumnValues.AddWithValue("id_sucursal", 1); NewFac.ColumnValues.AddWithValue("estado", 1); this.Connection.ExecuteNonQuery(NewFac); FacRow = this.Connection.FirstRowFromSelect(SelFac); } Fac = new Comprobantes.Factura(this.Connection, FacRow); if (internalRow != null) { internalRow.Fields.AddWithValue("id_comprob", Fac.Id); } Lbl.IElementoDeDatos Elem = base.ConvertirRegistroEnElemento(mapa, externalRow, internalRow); Lbl.Comprobantes.DetalleArticulo DetArt = Elem as Lbl.Comprobantes.DetalleArticulo; if (DetArt != null) { if (DetArt.Articulo == null) { DetArt.Nombre = externalRow["original_CODIGO"].ToString(); } DetArt.IdComprobante = Fac.Id; } return(Elem); } break; } return(base.ConvertirRegistroEnElemento(mapa, externalRow, internalRow)); }
public override string ObtenerValorCampo(string nombreCampo, string formato) { string Res = null; switch (nombreCampo.ToUpperInvariant()) { case "ARTICULOS.CODIGOS": case "ARTÍCULOS.CÓDIGOS": case "CODIGOS": case "CÓDIGOS": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { // FIXME: que imprima el código seleccionado por el usuario, no siempre el autonumérico string CodigoImprimir; if (this.Comprobante.Articulos[i].Articulo == null) { CodigoImprimir = ""; } else { CodigoImprimir = this.Comprobante.Articulos[i].Articulo.Id.ToString(); } if (Res == null) { Res = CodigoImprimir; } else { Res += System.Environment.NewLine + CodigoImprimir; } } } return(Res); case "ARTICULOS.CANTIDADES": case "ARTÍCULOS.CANTIDADES": case "CANTIDADES": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (Res == null) { Res = ""; } if (i >= DesdeImprimir && i <= HastaImprimir) { Res += Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Articulos[i].Cantidad, Lbl.Sys.Config.Articulos.Decimales) + System.Environment.NewLine; } } return(Res); case "ARTICULOS.IVA": case "ARTÍCULOS.IVA": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { if (Res == null) { Res = ""; } Lbl.Impuestos.Alicuota aliC = this.Comprobante.Articulos[i].ObtenerAlicuota(); if (aliC != null) { Res += aliC.Porcentaje.ToString("0.0") + "%" + System.Environment.NewLine; } else { Res += System.Environment.NewLine; } } } return(Res); case "ARTICULOS.IVADISCRIMINADO": case "ARTÍCULOS.IVADISCRIMINADO": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteUnitarioIvaDiscriminado, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } } return(Res); case "ARTÍCULOS.IMPORTESCONIVA": case "ARTICULOS.IMPORTESCONIVA": Res = ""; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteAImprimir, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } } return(Res); case "ARTÍCULOS.UNITARIOSCONIVA": case "ARTICULOS.UNITARIOSCONIVA": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { if (Res == null) { Res = ""; } Res += Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteUnitarioConIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal) + System.Environment.NewLine; } } return(Res); case "ARTÍCULOS.IMPORTESCONIVA1": case "ARTÍCULOS.IMPORTESCONIVA2": case "ARTÍCULOS.IMPORTESCONIVA3": case "ARTÍCULOS.IMPORTESCONIVA4": case "ARTÍCULOS.IMPORTESCONIVA5": case "ARTÍCULOS.IMPORTESCONIVA6": case "ARTÍCULOS.IMPORTESCONIVA7": case "ARTÍCULOS.IMPORTESCONIVA8": case "ARTÍCULOS.IMPORTESCONIVA9": case "ARTICULOS.IMPORTESCONIVA1": case "ARTICULOS.IMPORTESCONIVA2": case "ARTICULOS.IMPORTESCONIVA3": case "ARTICULOS.IMPORTESCONIVA4": case "ARTICULOS.IMPORTESCONIVA5": case "ARTICULOS.IMPORTESCONIVA6": case "ARTICULOS.IMPORTESCONIVA7": case "ARTICULOS.IMPORTESCONIVA8": case "ARTICULOS.IMPORTESCONIVA9": int NumeroIvaArt = Lfx.Types.Parsing.ParseInt(nombreCampo.Substring(nombreCampo.Length - 1)); Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { if (Res == null) { Res = Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteConIvaFinalAlicuota(NumeroIvaArt), Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } else { Res += System.Environment.NewLine + Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteConIvaFinalAlicuota(NumeroIvaArt), Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } } } return(Res); case "IVA27": case "IVA21": case "IVA105": case "IVA025": case "IVA05": case "IVA0": return(Lfx.Types.Formatting.FormatCurrencyForPrint(0, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); case "ARTÍCULOS.FULLDETALLES": case "ARTICULOS.FULLDETALLES": Res = null; int CantidadDeArticulosContinuo = this.Comprobante.Articulos.Count; PaginaTotal = (int)(Math.Ceiling(this.Comprobante.Articulos.Count / (decimal)CantidadFilas)); UltimaEspejo = DesdeImprimir; DesdeImprimir = Espejo ? UltimaEspejo : UltimaFila; HastaImprimir = DesdeImprimir + CantidadFilas; for (int i = 0; i < CantidadDeArticulosContinuo; i++) { string NombreArticulo = ""; if (i >= DesdeImprimir && i <= HastaImprimir) { if (this.Comprobante.Articulos[i].Articulo == null) { NombreArticulo = this.Comprobante.Articulos[i].Nombre; } else { NombreArticulo = this.Comprobante.Articulos[i].Articulo.ToString(); } if (Res == null) { Res = NombreArticulo; } else { Res += System.Environment.NewLine + NombreArticulo; } Res += " (x" + Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Articulos[i].Cantidad, Lbl.Sys.Config.Articulos.Decimales) + ")"; Res += " $ " + Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Articulos[i].ImporteAImprimir, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); FilaActual = i; } } if (!Espejo) { UltimaFila = FilaActual + 1; } if (UltimaFila >= CantidadDeArticulosContinuo) { int CanARestar = HastaImprimir - FilaActual; if (this.Comprobante.Descuento != 0) { Res += System.Environment.NewLine + "Descuento: " + Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Descuento, 2) + "%"; } if (this.Comprobante.Recargo != 0) { if (CanARestar < 1) { Res += System.Environment.NewLine + "Recargo: " + Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Descuento, 2) + "% ---> Página " + PaginaNumero.ToString(); } else { Res += System.Environment.NewLine + "Recargo: " + Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Descuento, 2) + "%"; } } else { for (int resto = 0; resto < CanARestar; resto++) { Res += System.Environment.NewLine; } Res += System.Environment.NewLine + " Página " + PaginaNumero.ToString(); } } else { HastaImprimir = UltimaFila; //No es última página Res += System.Environment.NewLine + " Página " + PaginaNumero.ToString(); Res += System.Environment.NewLine + " Continúa en pág. " + (PaginaNumero + 1).ToString(); } return(Res); case "ARTICULOS.DETALLES": case "ARTÍCULOS.DETALLES": case "DETALLES": Res = null; int CantidadDeArticulos = this.Comprobante.Articulos.Count; PaginaTotal = (int)(Math.Ceiling(this.Comprobante.Articulos.Count / (decimal)CantidadFilas)); UltimaEspejo = DesdeImprimir; DesdeImprimir = Espejo ? UltimaEspejo : UltimaFila; HastaImprimir = DesdeImprimir + CantidadFilas; for (int i = 0; i < CantidadDeArticulos; i++) { string NombreArticulo = ""; if (i >= DesdeImprimir && i <= HastaImprimir) { if (this.Comprobante.Articulos[i].Articulo == null) { NombreArticulo = this.Comprobante.Articulos[i].Nombre; } else { NombreArticulo = this.Comprobante.Articulos[i].Articulo.ToString(); } if (Res == null) { Res = NombreArticulo; } else { Res += System.Environment.NewLine + NombreArticulo; } FilaActual = i; } } if (!Espejo) { UltimaFila = FilaActual + 1; } if (UltimaFila >= CantidadDeArticulos) { if (this.Comprobante.Descuento != 0) { Res += System.Environment.NewLine + "Descuento: " + Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Descuento, 2) + "%"; } if (this.Comprobante.Recargo != 0) { Res += System.Environment.NewLine + "Recargo: " + Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Descuento, 2) + "%"; } } else { HastaImprimir = UltimaFila; //No es última página Res += System.Environment.NewLine + " Página " + PaginaNumero.ToString(); Res += System.Environment.NewLine + " Continúa en pág. " + (PaginaNumero + 1).ToString(); } return(Res); case "ARTICULOS.UNITARIOSORIGINALES": case "ARTÍCULOS.UNITARIOSORIGINALES": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { Lbl.Comprobantes.DetalleArticulo Det = this.Comprobante.Articulos[i]; if (i >= DesdeImprimir && i <= HastaImprimir) { string Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteUnitario, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } } return(Res); case "ARTICULOS.UNITARIOS": case "ARTÍCULOS.UNITARIOS": case "ARTÍCULOS.UNITARIOSFINALES": case "PRECIOS": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { Lbl.Comprobantes.DetalleArticulo Det = this.Comprobante.Articulos[i]; string Linea; if (Comprobante.Tipo.DiscriminaIva) { Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteUnitarioSinIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } else { Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteUnitarioConIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); } if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } } return(Res); case "ARTICULOS.DESCUENTOS": case "ARTÍCULOS.DESCUENTOS": case "DESCUENTOS": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { Lbl.Comprobantes.DetalleArticulo Det = this.Comprobante.Articulos[i]; string Linea; if (Det.Descuento == 0) { Linea = "--"; } else { Linea = Lfx.Types.Formatting.FormatNumberForPrint(Det.Descuento, 2) + "%"; } if (Res == null) { Res = Linea; } else { Res += System.Environment.NewLine + Linea; } } } return(Res); case "ARTICULOS.IMPORTES": case "ARTÍCULOS.IMPORTES": case "IMPORTES": Res = null; for (int i = 0; i < this.Comprobante.Articulos.Count; i++) { if (i >= DesdeImprimir && i <= HastaImprimir) { Lbl.Comprobantes.DetalleArticulo Det = this.Comprobante.Articulos[i]; string Linea = Lfx.Types.Formatting.FormatCurrencyForPrint(Det.ImporteAImprimir, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal); if (Res == null) { Res = ""; } Res += Linea + System.Environment.NewLine; } } return(Res); case "SUBTOTAL": case "COMPROBANTE.SUBTOTAL": if (Comprobante.DiscriminaIva) { return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.SubtotalSinIvaFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); } else { return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Subtotal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); } case "TOTAL": case "COMPROBANTE.TOTAL": return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.Total, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); case "IVADISCRIMINADO": case "COMPROBANTE.IVADISCRIMINADO": if (Comprobante.DiscriminaIva) { return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.ImporteIvaDiscriminadoFinal, Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); } else { return("N/A"); } case "COMPROBANTE.TOTALIVA1": case "COMPROBANTE.TOTALIVA2": case "COMPROBANTE.TOTALIVA3": case "COMPROBANTE.TOTALIVA4": case "COMPROBANTE.TOTALIVA5": case "COMPROBANTE.TOTALIVA6": case "COMPROBANTE.TOTALIVA7": case "COMPROBANTE.TOTALIVA8": case "COMPROBANTE.TOTALIVA9": case "TOTALIVA1": case "TOTALIVA2": case "TOTALIVA3": case "TOTALIVA4": case "TOTALIVA5": case "TOTALIVA6": case "TOTALIVA7": case "TOTALIVA8": case "TOTALVA9": int NumeroIvaComprob = Lfx.Types.Parsing.ParseInt(nombreCampo.Substring(nombreCampo.Length - 1)); return(Lfx.Types.Formatting.FormatCurrencyForPrint(this.Comprobante.TotalIvaAlicuota(NumeroIvaComprob), Lfx.Workspace.Master.CurrentConfig.Moneda.DecimalesFinal)); case "RECARGO": case "COMPROBANTE.RECARGO": return(Lfx.Types.Formatting.FormatNumberForPrint(this.Comprobante.Recargo, 2)); case "FORMAPAGO": case "COMPROBANTE.FORMAPAGO": if (this.Comprobante.FormaDePago == null) { return(""); } else { return(this.Comprobante.FormaDePago.ToString()); } case "SONPESOS": case "COMPROBANTE.SONPESOS": return(Lfx.Types.Formatting.SpellNumber(this.Comprobante.Total)); case "TIPO": case "COMPROBANTE.TIPO": return(this.Comprobante.Tipo.Nombre); default: return(base.ObtenerValorCampo(nombreCampo, formato)); } }