public static ReportDocument GetReportDetalleComprobantes(ComprobantesBL comprobantesBL, Comprobantes comp) { ComprobanteDetalleRpt result = new ComprobanteDetalleRpt(); result.SetDataSource(comprobantesBL.GetDTODetalle(comp)); return(result); }
private void notasDeDébitoToolStripMenuItem_Click(object sender, EventArgs e) { ComprobantesBL FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL; FacturasBL.SetTipoFilter(TiposComprobantesList.NotaDebito); CRUDComprobantesController result = new CRUDComprobantesController(FacturasBL, "Notas de Débito", "Notas de Débito", typeof(ComprobantesCRUD)); CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result); result.ShowGrid(); }
private void AvisoFacturasProgramadas() { ComprobantesBL comprobantes = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL; Int32 pendientesHoy = comprobantes.HasComprobantesProgramados(); if (pendientesHoy > 0) { MessageBox.Show("Tiene " + pendientesHoy.ToString() + " comprobantes programados pendientes de emisión."); } }
private void emitirFacturaToolStripMenuItem_Click(object sender, EventArgs e) { Thread thrdStatus = new Thread(new ParameterizedThreadStart(Status.CheckStatus)); thrdStatus.IsBackground = true; thrdStatus.Start(this); ComprobantesBL FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL; FacturasBL.SetTipoFilter(TiposComprobantesList.Factura); CRUDComprobantesController result = new CRUDComprobantesController(FacturasBL, "Facturas", "Facturas", typeof(ComprobantesCRUD)); CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result); result.ShowCRUDForm(); }
public void EnvioFTP() { EmpresasBL empBL = new EmpresasBL(); empBL.SetParameters(db); ComprobantesBL compBL = new ComprobantesBL(); compBL.SetParameters(db); Empresas empresa = empBL.GetObject(GeneralSettings.Instance.IdEmpresaDefault) as Empresas; if (empresa != null) { Ftp FtpClient = new Ftp(); FtpClient.HostAddress = FTPHost; FtpClient.Port = FTPPort; FtpClient.Username = FTPName; FtpClient.Password = FTPPass; FtpClient.Timeout = FTPTimeOut; FtpClient.Connect(); string fileName = empresa.Cuit + "_" + DateTime.Now.ToString("yyyyMMdd_hhmm") + ".txt"; StreamWriter tw = File.CreateText(fileName); FtpClient.MoveDirectory(empresa.Cuit); int cantidadEmitidos = 0; foreach (Comprobantes comp in compBL.GetDataSource()) { if (comp.IsEmitido) { tw.Write(compBL.GetResumeStream(comp)); cantidadEmitidos++; } } tw.Write("Cantidad de facturas emitidas: " + cantidadEmitidos.ToString() + "\r\n"); tw.Close(); FtpClient.PutFile(fileName); FtpClient.Quit(); File.Delete(fileName); } }
public bool IsValidLicense() { if (!lastLicenseCheck.HasValue || lastLicenseCheck.Value.AddMonths(1) < DateTime.Today) { EmpresasBL empBL = new EmpresasBL(); empBL.SetParameters(db); ComprobantesBL compBL = new ComprobantesBL(); compBL.SetParameters(db); Empresas empresa = empBL.GetObject(GeneralSettings.Instance.IdEmpresaDefault) as Empresas; if (empresa != null) { Ftp FtpClient = new Ftp(); FtpClient.HostAddress = FTPHost; FtpClient.Port = FTPPort; FtpClient.Username = FTPName; FtpClient.Password = FTPPass; FtpClient.Timeout = FTPTimeOut; FtpClient.Connect(); string fileName = empresa.Cuit; FtpClient.MoveDirectory("Licencias"); FtpItemCollection fic = new FtpItemCollection(); FtpClient.FileList(ref fic); foreach (FtpItem item in fic) { if (item.Name.ToLower() == fileName.ToLower()) { lastLicenseCheck = DateTime.Today; return(true); } } FtpClient.Quit(); } return(false); } else { return(true); } }