Beispiel #1
0
        private void Gerar_Dados_Boletos(ref DataRow row_Capa, ref DataRow row_Vencimento)
        {
            im.Pula(1);
            im.ImpCol(7, "Pagavel em qualquer banco até a data do vencimento.");
            im.ImpColLF(97, Convert.ToDateTime(row_Vencimento["Data_Vencimento"]).ToShortDateString());
            im.Pula(3);

            im.ImpCol(7, DateTime.Now.ToString("dd/MM/yyyy"));
            if (Convert.ToBoolean(row_Capa["Gera_NF"]))
            {
                im.ImpCol(21, row_Capa["Numero_Nota"].ToString().PadLeft(10, '0'));
            }
            else
            {
                im.ImpCol(21, row_Capa["Pedido"].ToString().PadLeft(10, '0'));
            }

            im.ImpCol(60, row_Capa["Boleto_EspecieDoc"].ToString());
            im.ImpCol(70, Convert.ToBoolean(row_Capa["Boleto_Aceite"]) ? "S" : "N");
            im.ImpColLF(78, DateTime.Now.ToString("dd/MM/yyyy"));

            im.ImpCol(28, row_Capa["Boleto_Carteira"].ToString());
            im.ImpCol(42, row_Capa["Sigla_Moeda"].ToString());
            im.ImpColRightLF(114, row_Vencimento["Valor_Duplicata"].ToString());

            im.Pula(1);

            //-- Instruções.
            im.ImpColLF(8, "Sr. caixa não receber após o vencimento.");

            im.Pula(6);

            //-- Sacado
            im.ImpCol(8, Funcoes_Matricial.PadR(row_Capa["Razao_Social_Cliente"].ToString(), 40, " "));
            im.ImpColLF(55, Funcoes_Matricial.Formata_CNPJ_CPF(row_Capa["CPF_CNPJ_Cliente"].ToString()));

            im.ImpCol(8, row_Capa["Endereco_Correspondencia"].ToString().ToUpper());
            im.Imp(",");
            im.ImpLF(row_Capa["Numero_Correspondencia"].ToString());

            im.ImpCol(8, Funcoes_Matricial.Formata_CEP(row_Capa["cep_correspondencia"].ToString()));
            im.ImpCol(25, row_Capa["cidade_correspondencia"].ToString().ToUpper());
            im.Imp("/");
            im.Imp(row_Capa["Estado_Correspondencia"].ToString().ToUpper());

            im.Fim();     //-- Finaliza o processo de impressão...
            im.Dispose(); //-- Destroi todos os componentes...
        }
Beispiel #2
0
        private void Gerar_Dados_Duplicatas(ref DataRow row_Capa, ref DataRow row_Vencimento)
        {
            im.Pula(5);
            im.ImpCol(153, DateTime.Now.ToShortDateString());
            im.ImpColLF(181, Convert.ToDateTime(row_Vencimento["Data_Vencimento"]).ToShortDateString());
            im.ImpCol(93, DateTime.Now.ToShortDateString());

            im.Pula(3);
            im.ImpCol(150, row_Capa["Numero_Nota"].ToString());
            im.Imp("/");
            im.Imp(row_Vencimento.Table.Rows.Count.ToString());
            im.Imp(row_Vencimento["Numero_Parcela"].ToString());
            im.ImpColLF(186, row_Capa["Cliente"].ToString());

            im.ImpColRight(27, row_Capa["Valor_Total_Nota"].ToString());
            im.ImpCol(36, row_Capa["Numero_Nota"].ToString());
            im.ImpColRight(70, row_Vencimento["Valor_Duplicata"].ToString());
            im.ImpCol(80, row_Capa["Numero_Nota"].ToString());
            im.Imp("/");
            im.Imp(row_Vencimento.Table.Rows.Count.ToString());
            im.Imp(row_Vencimento["Numero_Parcela"].ToString());
            im.ImpColLF(97, Convert.ToDateTime(row_Vencimento["Data_Vencimento"]).ToShortDateString());

            string sSacado1 = row_Capa["Razao_Social_Cliente"].ToString(),
                   sSacado2 = "";

            if (sSacado1.Length > 34)
            {
                sSacado2 = sSacado1.Substring(34, (sSacado1.Length - 34));
                sSacado1 = sSacado1.Substring(0, 33);
            }

            im.ImpColLF(164, sSacado1);
            im.ImpColLF(150, sSacado2);

            string sEndereco1 = row_Capa["Endereco_Correspondencia"].ToString(),
                   sEndereco2 = "";

            if (row_Capa["Numero_Correspondencia"] != DBNull.Value)
            {
                sEndereco1 += ", " + row_Capa["Numero_Correspondencia"].ToString();
            }

            if (sEndereco1.Length > 38)
            {
                sEndereco2 = sEndereco1.Substring(38, (sEndereco1.Length - 38));
                sEndereco1 = sEndereco1.Substring(0, 37);
            }
            im.ImpColLF(158, sEndereco1);
            im.ImpColLF(150, sEndereco2);

            im.ImpColLF(158, row_Capa["Cidade_Correspondencia"].ToString());

            im.ImpLF("");

            im.ImpCol(39, Funcoes_Matricial.PadR(row_Capa["Razao_Social_Cliente"].ToString(), 70));
            im.ImpColLF(120, row_Capa["Cliente"].ToString());

            sEndereco1 = row_Capa["Endereco_Correspondencia"].ToString();
            if (row_Capa["Numero_Correspondencia"] != DBNull.Value)
            {
                sEndereco1 += ", " + row_Capa["Numero_Correspondencia"].ToString();
            }

            im.ImpCol(39, sEndereco1);
            im.ImpColLF(166, row_Capa["Nome_Vendedor"].ToString());

            im.ImpCol(39, row_Capa["Cidade_Correspondencia"].ToString());
            im.ImpCol(106, row_Capa["Estado_Correspondencia"].ToString());
            im.ImpColLF(122, Funcoes_Matricial.Formata_CEP(row_Capa["CEP_Correspondencia"].ToString()));

            //-- Praça de pagamento
            im.ImpColLF(39, sEndereco1);
            im.ImpLF("");

            im.ImpCol(39, Funcoes_Matricial.Formata_CNPJ_CPF(row_Capa["CPF_CNPJ_Cliente"].ToString()));
            im.ImpCol(108, Funcoes_Matricial.Formata_IE(row_Capa["RG_IE_Cliente"].ToString()));

            im.Pula(2);

            Extenso ext             = new Extenso();
            string  sValor_Extenso  = "(*" + ext.Extenso_Valor(Convert.ToDecimal(row_Vencimento["Valor_Duplicata"])) + "*)";
            string  sValor_Extenso2 = "";

            if (sValor_Extenso.Length > 80)
            {
                sValor_Extenso2 = "(*" + sValor_Extenso.Substring(75, sValor_Extenso.Length - 75);
                sValor_Extenso  = sValor_Extenso.Substring(0, 75) + "*)";
            }

            im.ImpCol(36, sValor_Extenso);
            im.ImpColLF(169, row_Vencimento["Valor_Duplicata"].ToString());

            im.ImpColLF(36, sValor_Extenso2);

            int iPula = 36 - im.Numero_Linhas_Impressao_Atual;

            im.Pula(iPula);
        }
Beispiel #3
0
        private void Gerar_Header(ref DataRow row_Capa)
        {
            im.Pula(2); //-- Pula 2 linhas
            if ((bool)row_Capa["Tipo_Saida"])
            {
                im.Imp("X".PadLeft(95)); //-- Linha 4
            }
            if ((bool)row_Capa["Tipo_Entrada"])
            {
                im.Imp("X".PadLeft(109)); //-- Linha 4
            }
            if (Convert.ToInt32(row_Capa["Empresa"]) == 1)
            {
                im.ImpCol(130, string.Format("{0:00000000}", row_Capa["Numero_nota"]));
            }
            im.ImpLF("");

            im.Pula(5);                                                                            //-- Pula 5 linhas

            im.ImpCol(2, Funcoes_Matricial.PadR(row_Capa["Desc_CFOP"].ToString(), 44));            //-- Linha 9
            im.ImpColLF(49, row_Capa["CFOP"].ToString());                                          //-- Linha 9

            im.Pula(2);                                                                            //-- Pula 2 linhas

            im.ImpCol(2, Funcoes_Matricial.PadR(row_Capa["Razao_Social_Cliente"].ToString(), 88)); //-- Linha 12
            im.Imp("".PadLeft(6));

            string sCNPJ = Funcoes_Matricial.Formata_CNPJ_CPF(row_Capa["CPF_CNPJ_Cliente"].ToString());

            im.Imp(sCNPJ);                                                                    //-- linha 12
            im.Imp("".PadLeft(129 - (sCNPJ.Length + 96)));                                    //-- alterar de 127 para 129
            im.ImpLF(" " + Convert.ToDateTime(row_Capa["Data_Emissao"]).ToShortDateString()); //-- linha 12

            im.Pula(1);

            //-- Linha 13
            string sEndereco = row_Capa["Endereco_Correspondencia"].ToString();

            if (row_Capa["Numero_Correspondencia"] != DBNull.Value)
            {
                sEndereco += row_Capa["Numero_Correspondencia"].ToString();
            }

            im.ImpCol(2, Funcoes_Matricial.PadR(sEndereco, 73));
            im.Imp("".PadLeft(5));
            im.Imp(Funcoes_Matricial.PadR(row_Capa["Bairro_Correspondencia"].ToString(), 23));
            im.Imp("".PadLeft(6));

            if (row_Capa["CEP_Correspondencia"] != DBNull.Value)
            {
                im.ImpLF(Funcoes_Matricial.PadL(Funcoes_Matricial.Formata_CEP(row_Capa["CEP_Correspondencia"].ToString()), 9));
            }
            else
            {
                im.ImpLF("00000-000");
            }

            //-- Pula uma linha.
            im.Pula(1);

            //-- Linha 16
            im.ImpCol(2, Funcoes_Matricial.PadR(row_Capa["Cidade_Correspondencia"].ToString(), 54));
            im.Imp("".PadLeft(4));
            string sFone = Funcoes_Matricial.Formata_Telefone(row_Capa["ddd1_cliente"].ToString(), row_Capa["fone1_cliente"].ToString());

            im.Imp(Funcoes_Matricial.PadR(sFone, 27));
            im.Imp(Funcoes_Matricial.PadR(row_Capa["Estado_Correspondencia"].ToString(), 9));
            im.ImpLF(Funcoes_Matricial.Formata_IE(row_Capa["RG_IE_Cliente"].ToString()));

            //-- Pula 2 linhas para iniciar vencimentos da NF
            im.Pula(2);
        }