/// <summary> /// Define a série que será inserida na nota caso o usuário não tenha preenchido este campo com 0, 1 e vazio ao inserir a nota fiscal /// </summary> public static int SeriePadraoNFe(string codCfop, string inscEstLoja, bool?notaDeAjuste) { var config = Config.GetConfigItem <int>(Config.ConfigEnum.SeriePadraoNFe); if (config != 1) { return(config); } if (ControleSistema.GetSite() == ControleSistema.ClienteSistema.LojaDosEspelhos && (inscEstLoja == "06.200.647-9" || inscEstLoja == "062006479")) { return(2); } if (ControleSistema.GetSite() == ControleSistema.ClienteSistema.VitralManaus && (inscEstLoja == "06.200.648-7" || inscEstLoja == "062006487")) { return(6); } if (ControleSistema.GetSite() == ControleSistema.ClienteSistema.VitralManaus && (inscEstLoja == "04.123.770-6" || inscEstLoja == "041237706")) { return(1); } if (ControleSistema.GetSite() == ControleSistema.ClienteSistema.CasaDosEspelhos && (inscEstLoja == "06.201.161-8" || inscEstLoja == "062011618")) { return(2); } if ((ControleSistema.GetSite() == ControleSistema.ClienteSistema.Dividros || ControleSistema.GetSite() == ControleSistema.ClienteSistema.Invitra) && (codCfop == "5103" || codCfop == "5104")) { return(3); } if (ControleSistema.GetSite() == ControleSistema.ClienteSistema.ModeloVidros && notaDeAjuste.GetValueOrDefault()) { return(3); } if ((ControleSistema.GetSite() == ControleSistema.ClienteSistema.TemperadosEstrela || ControleSistema.GetSite() == ControleSistema.ClienteSistema.VidrosDresch || ControleSistema.GetSite() == ControleSistema.ClienteSistema.WickertVidros) && notaDeAjuste.GetValueOrDefault()) { return(2); } return(1); }
/// <summary> /// Retorna o caminho do arquivo usado como logotipo no sistema. /// </summary> /// <returns></returns> public static string GetLogoVirtualPath() { string arqLogotipo = "logo" + ControleSistema.GetSite() + "Color"; if (UserInfo.GetUserInfo != null) { arqLogotipo += UserInfo.GetUserInfo.IdLoja; } return("~/Images/" + arqLogotipo + ".png"); }
/// <summary> /// Retorna o nome do arquivo usado como logotipo colorido no orçamento. /// </summary> public static string GetReportLogoColorOrca(HttpRequest request) { string path = "file:///" + ObterCaminhoFisico(request).Replace('\\', '/') + "Images/"; if (EsconderLogotipoRelatorios) { return(path + "logoEmBranco.png"); } path += "logo" + ControleSistema.GetSite() + "Color.png"; return(path); }
/// <summary> /// Retorna o caminho do arquivo usado como logotipo do DANFE. /// </summary> /// <param name="idLoja"></param> /// <returns></returns> public static string GetReportLogoNF(HttpRequest request, uint idLoja) { string arqLogotipo = "logo" + ControleSistema.GetSite() + "Nf"; if (System.IO.File.Exists(string.Format("{0}Images\\{1}.png", ObterCaminhoFisico(request), arqLogotipo))) { return("file:///" + ObterCaminhoFisico(request).Replace('\\', '/') + "Images/" + arqLogotipo + ".png"); } else { return(GetReportLogoColor(request, idLoja)); } }
/// <summary> /// Posição X da roldana, usado na montagem do arquivo SAG /// </summary> public static int PosXRoldana(int largura) { switch (ControleSistema.GetSite()) { case ControleSistema.ClienteSistema.BlueHouse: return(largura >= 1050 ? 100 : 50); case ControleSistema.ClienteSistema.TemperGlass: return(largura >= 700 ? 100 : 50); default: return(50); } }
/// <summary> /// Retorna o caminho do arquivo usado como logotipo no relatório. /// </summary> /// <param name="request">Requisição do http.</param> /// <param name="idLoja">Código da loja, usado para buscar o logotipo.</param> public static string GetReportLogo(string diretorio, uint?idLoja) { var arqLogotipo = "logo" + ControleSistema.GetSite(); if ((UserInfo.GetUserInfo != null || idLoja.GetValueOrDefault() > 0)) { arqLogotipo += idLoja.GetValueOrDefault() > 0 ? idLoja.Value : UserInfo.GetUserInfo.IdLoja; } if (EsconderLogotipoRelatorios) { arqLogotipo = "logoEmBranco"; } return(string.Format("file:///{0}", System.IO.Path.Combine(diretorio, arqLogotipo + ".png").Replace("\\", "/"))); }
/// <summary> /// Retorna o nome do arquivo usado como logotipo colorido no relatório. /// </summary> public static string GetReportLogoColor(HttpRequest request) { string arqLogotipo = "logo" + ControleSistema.GetSite() + "Color"; if (UserInfo.GetUserInfo != null) { arqLogotipo += UserInfo.GetUserInfo.IdLoja; } if (EsconderLogotipoRelatorios) { arqLogotipo = "logoEmBranco"; } return("file:///" + ObterCaminhoFisico(request).Replace('\\', '/') + "Images/" + arqLogotipo + ".png"); }
/// <summary> /// Retorna o caminho do arquivo usado como logotipo no relatório. /// </summary> /// <param name="request">Requisição do http.</param> /// <param name="idLoja">Código da loja, usado para buscar o logotipo.</param> public static string GetReportLogo(HttpRequest request, uint?idLoja) { var arqLogotipo = "logo" + ControleSistema.GetSite(); if ((UserInfo.GetUserInfo != null || idLoja.GetValueOrDefault() > 0)) { arqLogotipo += idLoja.GetValueOrDefault() > 0 ? idLoja.Value : UserInfo.GetUserInfo.IdLoja; } if (EsconderLogotipoRelatorios) { arqLogotipo = "logoEmBranco"; } return("file:///" + ObterCaminhoFisico(request).Replace('\\', '/') + "Images/" + arqLogotipo + ".png"); }
/// <summary> /// Raio da roldana, usado na montagem do arquivo SAG /// </summary> public static int RaioRoldana(int largura, float espessura) { switch (ControleSistema.GetSite()) { case ControleSistema.ClienteSistema.BellTemper: case ControleSistema.ClienteSistema.Dekor: case ControleSistema.ClienteSistema.Diviglass: case ControleSistema.ClienteSistema.EstruturalVidros: case ControleSistema.ClienteSistema.FastTemper: case ControleSistema.ClienteSistema.GoldGlass: case ControleSistema.ClienteSistema.VidroRapido: case ControleSistema.ClienteSistema.Termari: return(7); case ControleSistema.ClienteSistema.TemperGlass: return(espessura == 6 ? 6 : 7); default: return(8); } }
/// <summary> /// Nome do arquivo do relatório. /// </summary> public static string NomeArquivoRelatorio(int idLoja, bool notaFiscal, bool retalho) { var caminhoRelatorio = string.Empty; // Nota Fiscal if (notaFiscal) { if (ModeloEtiquetaPorLoja && idLoja > 0) { var caminhoRelatorioLoja = string.Format("Relatorios/ModeloEtiqueta/rptEtiqueta{0}NF{1}.rdlc", ControleSistema.GetSite().ToString(), idLoja); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorioLoja)))) { return(caminhoRelatorioLoja); } } caminhoRelatorio = string.Format("Relatorios/ModeloEtiqueta/rptEtiqueta{0}NF.rdlc", ControleSistema.GetSite().ToString()); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorio)))) { return(caminhoRelatorio); } } // Retalho if (retalho) { if (ModeloEtiquetaPorLoja && idLoja > 0) { var caminhoRelatorioLoja = string.Format("Relatorios/ModeloEtiqueta/rptEtiqueta{0}Ret{1}.rdlc", ControleSistema.GetSite().ToString(), idLoja); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorioLoja)))) { return(caminhoRelatorioLoja); } } caminhoRelatorio = string.Format("Relatorios/ModeloEtiqueta/rptEtiqueta{0}Ret.rdlc", ControleSistema.GetSite().ToString()); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorio)))) { return(caminhoRelatorio); } } // Padrão if (ModeloEtiquetaPorLoja && idLoja > 0) { var caminhoRelatorioLoja = string.Format("Relatorios/ModeloEtiqueta/rptEtiqueta{0}{1}.rdlc", ControleSistema.GetSite().ToString(), idLoja); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorioLoja)))) { return(caminhoRelatorioLoja); } } caminhoRelatorio = string.Format("Relatorios/ModeloEtiqueta/rptEtiqueta{0}.rdlc", ControleSistema.GetSite().ToString()); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorio)))) { return(caminhoRelatorio); } return(PedidoConfig.LiberarPedido ? "Relatorios/ModeloEtiqueta/rptEtiquetaLib.rdlc" : "Relatorios/ModeloEtiqueta/rptEtiqueta.rdlc"); }
protected override Colosoft.Reports.IReportDocument LoadReport(ref LocalReport report, ref List <ReportParameter> lstParam, HttpRequest PageRequest, System.Collections.Specialized.NameValueCollection Request, object[] outrosParametros, LoginUsuario login, string diretorioLogotipos) { var orca = OrcamentoDAO.Instance.GetForRpt(Glass.Conversoes.StrParaUint(Request["idOrca"])); orca.SomarDescontoProdutosTotal = OrcamentoConfig.ExibirItensProdutosRelatorio; ProdutosOrcamento[] prodOrca = ProdutosOrcamentoDAO.Instance.GetForRpt(Glass.Conversoes.StrParaUint(Request["idOrca"]), true); var itensProjeto = ItemProjetoDAO.Instance.GetByOrcamento(Conversoes.StrParaUint(Request["idOrca"])); uint idLoja = orca.IdLoja != null ? orca.IdLoja.Value : 0; // Recupera o caminho do relatório a ser renderizado var caminhoRelatorio = string.Format("Relatorios/ModeloOrcamento/rptOrcamento{0}.rdlc", ControleSistema.GetSite().ToString()); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorio)))) { report.ReportPath = caminhoRelatorio; } else { report.ReportPath = PedidoConfig.LiberarPedido ? "Relatorios/ModeloOrcamento/rptOrcamentoLib.rdlc" : "Relatorios/ModeloOrcamento/rptOrcamento.rdlc"; } string rptLogoPath = idLoja > 0 ? Logotipo.GetReportLogo(PageRequest, idLoja) : Logotipo.GetReportLogoColorOrca(PageRequest); if (Geral.ConsiderarLojaClientePedidoFluxoSistema && orca.IdCliente.GetValueOrDefault(0) > 0) { var idCliente = orca.IdCliente.Value; if (idCliente > 0) { var idLojaCliente = ClienteDAO.Instance.ObtemIdLoja(idCliente); if (idLojaCliente > 0) { rptLogoPath = Logotipo.GetReportLogo(PageRequest, idLojaCliente); } } } #region Transportador cliente var nomeTransportadorCliente = string.Empty; if (orca.IdCliente > 0) { var idTransportador = ClienteDAO.Instance.ObtemIdTransportador(orca.IdCliente.Value); if (idTransportador > 0) { nomeTransportadorCliente = TransportadorDAO.Instance.GetNome(idTransportador.Value); } } lstParam.Add(new ReportParameter("NomeTransportadorCliente", nomeTransportadorCliente)); #endregion lstParam.Add(new ReportParameter("Logotipo", rptLogoPath)); lstParam.Add(new ReportParameter("ExibirCusto", "false")); lstParam.Add(new ReportParameter("AgruparBeneficiamentos", PedidoConfig.RelatorioPedido.AgruparBenefRelatorio.ToString())); lstParam.Add(new ReportParameter("ExibirIcmsIpi", "True")); lstParam.Add(new ReportParameter("Cabecalho_IdOrcamento", orca.IdOrcamento.ToString())); lstParam.Add(new ReportParameter("Cabecalho_DataOrcamento", orca.DataOrcamento)); lstParam.Add(new ReportParameter("Cabecalho_TelefoneLoja", orca.TelefoneLoja)); lstParam.Add(new ReportParameter("Cabecalho_EmailLoja", orca.EmailLoja)); lstParam.Add(new ReportParameter("Cabecalho_DadosLoja", orca.DadosLoja)); lstParam.Add(new ReportParameter("Cabecalho_EnderecoLoja", orca.EnderecoLoja)); lstParam.Add(new ReportParameter("Cabecalho_FoneFaxLoja", orca.FoneFaxLoja)); lstParam.Add(new ReportParameter("Cabecalho_SiteLoja", orca.EmailLoja)); lstParam.Add(new ReportParameter("FormatTotM", Glass.Configuracoes.Geral.GetFormatTotM())); report.DataSources.Add(new ReportDataSource("Orcamento", new Data.Model.Orcamento[] { orca })); report.DataSources.Add(new ReportDataSource("ProdutosOrcamento", prodOrca)); report.DataSources.Add(new ReportDataSource("ItensProjeto", itensProjeto)); report.DataSources.Add(new ReportDataSource("TextoOrcamento", TextoOrcamentoDAO.Instance.GetByOrcamento(orca.IdOrcamento))); return(null); }
/// <summary> /// Nome do arquivo do relatório. /// </summary> /// <returns>Item1: é o caminho do arquivo do relatório. /// Item2: true/false - o arquivo é um dos relatórios padrões do sistema (A4 ou A4ProcApl), foi criado a partir de um deles ou não está mapeado no código.</returns> public static Tuple <string, bool> NomeArquivoRelatorio(uint idLoja) { var caminhoRelatorio = string.Format("Relatorios/ModeloPedido/rptPedido{0}.rdlc", ControleSistema.GetSite().ToString()); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorio)))) { return(new Tuple <string, bool>(caminhoRelatorio, true)); } return(new Tuple <string, bool>("Relatorios/ModeloPedido/rptPedidoA4.rdlc", true)); }
/// <summary> /// Nome do arquivo do relatório. /// </summary> public string NomeArquivoRelatorioReposicao(int idLoja) { if (EtiquetaConfig.RelatorioEtiqueta.ModeloEtiquetaPorLoja && idLoja > 0) { var caminhoRelatorioLoja = string.Format("Relatorios/ModeloEtiqueta/rptEtiqueta{0}Rep{1}.rdlc", ControleSistema.GetSite().ToString(), idLoja); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorioLoja)))) { return(caminhoRelatorioLoja); } } var caminhoRelatorio = string.Format("Relatorios/ModeloEtiqueta/rptEtiqueta{0}Rep.rdlc", ControleSistema.GetSite().ToString()); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorio)))) { return(caminhoRelatorio); } return(PedidoConfig.LiberarPedido ? "Relatorios/ModeloEtiqueta/rptEtiquetaLib.rdlc" : "Relatorios/ModeloEtiqueta/rptEtiqueta.rdlc"); }
protected override Colosoft.Reports.IReportDocument LoadReport(ref LocalReport report, ref List <ReportParameter> lstParam, HttpRequest PageRequest, System.Collections.Specialized.NameValueCollection Request, object[] outrosParametros, LoginUsuario login, string diretorioLogotipos) { // Verifica qual relatório será chamado switch (Request["rel"]) { case "EtqVolume": var caminhoRelatorio = string.Format("Relatorios/ModeloEtiquetaVolume/rptEtiquetaVolume{0}.rdlc", ControleSistema.GetSite().ToString()); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(string.Format("~/{0}", caminhoRelatorio)))) { report.ReportPath = caminhoRelatorio; } else { report.ReportPath = "Relatorios/ModeloEtiquetaVolume/rptEtiquetaVolume.rdlc"; } var etqVolume = WebGlass.Business.OrdemCarga.Fluxo.EtiquetaVolumeFluxo.Instance.GetForImpressao(Glass.Conversoes.StrParaUint(Request["IdVolume"])); report.DataSources.Add(new ReportDataSource("EtiquetaVolume", etqVolume)); break; default: break; } return(null); }