示例#1
0
        private void GerarArquivoP()
        {
            try
            {
                acbrPAF.PafP.RegistroP1.RazaoSocial = txtRazaoSocial.Text;
                acbrPAF.PafP.RegistroP1.UF = txtUF.Text;
                acbrPAF.PafP.RegistroP1.CNPJ = txtCNPJ.Text;
                acbrPAF.PafP.RegistroP1.IE = txtIE.Text;
                acbrPAF.PafP.RegistroP1.IM = txtIM.Text;

                for(int i = 0; i < 10; i++)
                {
                    ACBrPAFRegistroP2 ItemP2 = new ACBrPAFRegistroP2();
                    ItemP2.COD_MERC_SERV = (string)GerarDados('S', 6);
                    ItemP2.DESC_MERC_SERV = (string)GerarDados('S', 6);
                    ItemP2.UN_MED = (string)GerarDados('S', 2);
                    ItemP2.IAT = (string)GerarDados('S', 6);
                    ItemP2.IPPT = (string)GerarDados('S', 6);
                    ItemP2.ST = (string)GerarDados('S', 6);
                    ItemP2.ALIQ = (decimal)GerarDados('D', 6);
                    ItemP2.VL_UNIT = (decimal)GerarDados('D', 6);
                    ItemP2.RegistroValido = true;
                    acbrPAF.PafP.RegistroP2.Add(ItemP2);
                    ItemP2 = null;
                }

                if(acbrPAF.SaveFileTXT_P(@"\PAF_P.txt"))
                    WriteResp("Arquivo PAF_P gerado com sucesso");
                else
                    WriteResp("Arquivo PAF_P não foi gerado");
            }
            catch(Exception exception)
            {
                messageToolStripStatusLabel.Text = "Exception";
                descriptionToolStripStatusLabel.Text = exception.Message;
            }
        }
示例#2
0
        /// <summary>
        /// Relação de mercadorias e serviços
        /// </summary>
        private void PreencheP()
        {
            ACBrPAF.PAF_P.RegistroP1.RazaoSocial = Settings.EmpresaAtual.RazaoSocial;
            ACBrPAF.PAF_P.RegistroP1.UF = Settings.EmpresaAtual.Enderecos.First(w => w.Principal).Endereco.Estado.UF;
            ACBrPAF.PAF_P.RegistroP1.CNPJ = Settings.EmpresaAtual.GetCPFCNPJ();
            ACBrPAF.PAF_P.RegistroP1.IE = Settings.EmpresaAtual.Juridica.IE;
            ACBrPAF.PAF_P.RegistroP1.IM = Settings.EmpresaAtual.Juridica.IM;

            //-------------------------------------------------------------------------
            // Buscar a tabela de preços principal e sem regras
            //-------------------------------------------------------------------------
            ITabelaPreco tabelaPreco = new TabelaPreco((GUID)Settings.Setting.TabelaPrecoPadrao);

            foreach(Model.Cadastro.TabelaPreco.IItem item in tabelaPreco.Itens)
            {
                ACBrPAFRegistroP2 ItemP2 = new ACBrPAFRegistroP2();
                ItemP2.COD_MERC_SERV = item.Item.EGUID;
                ItemP2.DESC_MERC_SERV = item.Item.Descricao;

                if(item.Item is Model.Cadastro.Item.Produto.IProduto)
                {
                    ItemP2.IAT = (item.Item as Model.Cadastro.Item.Produto.IProduto).IndicadorTruncamento;
                    ItemP2.IPPT = (item.Item as Model.Cadastro.Item.Produto.IProduto).IndicadorProducao;
                }

              //  ItemP2.ST = item.SituacaoTributaria;
                //ItemP2.ALIQ = (decimal)item.Aliquota;
                ItemP2.VL_UNIT = (decimal)item.Preco;
                ItemP2.RegistroValido = !item.Item.HasHashModification;
                ACBrPAF.PAF_P.RegistroP2.Add(ItemP2);
                ItemP2 = null;
            }
        }
示例#3
0
        private void PAF_Preenche_P()
        {
            acbrPAF.PafP.RegistroP1.RazaoSocial = txtRazaoSocial.Text;
            acbrPAF.PafP.RegistroP1.UF = txtUF.Text;
            acbrPAF.PafP.RegistroP1.CNPJ = txtCNPJ.Text;
            acbrPAF.PafP.RegistroP1.IE = txtIE.Text;
            acbrPAF.PafP.RegistroP1.IM = txtIM.Text;

            for(int i = 0; i < 10; i++)
            {
                ACBrPAFRegistroP2 ItemP2 = new ACBrPAFRegistroP2();
                ItemP2.COD_MERC_SERV = (string)GerarDados('S', 6);
                ItemP2.DESC_MERC_SERV = (string)GerarDados('S', 6);
                ItemP2.UN_MED = (string)GerarDados('S', 2);
                ItemP2.IAT = (string)GerarDados('S', 6);
                ItemP2.IPPT = (string)GerarDados('S', 6);
                ItemP2.ST = (string)GerarDados('S', 6);
                ItemP2.ALIQ = (decimal)GerarDados('D', 6);
                ItemP2.VL_UNIT = (decimal)GerarDados('D', 6);
                ItemP2.RegistroValido = true;
                acbrPAF.PafP.RegistroP2.Add(ItemP2);
                ItemP2 = null;
            }
        }