Example #1
0
        //outras impressoras:::

        static public void PrintOutrasCondicional(Library.Condicional condicional, Library.Configuracoes config)
        {
            try
            {
                MatrixReporter.EpsonCodes _EpsonCodes = new MatrixReporter.EpsonCodes();

                MatrixReporter.Reporter _Reporter = new MatrixReporter.Reporter();

                _Reporter.Output = config.ImpressoraPorta;

                _Reporter.StartJob();

                _Reporter.PrintText(01, 14, _EpsonCodes.ExpandedOn + "JEANE MODAS" + _EpsonCodes.ExpandedOff);
                _Reporter.PrintText(02, 06, _EpsonCodes.ItalicOn + "Av. Nilo Peçanha, 688" + _EpsonCodes.ItalicOff);
                _Reporter.PrintText(03, 10, "(22) 3852-6784 / 9873-2552");
                _Reporter.PrintText(04, 16, _EpsonCodes.CondensedOn + _EpsonCodes.ExpandedOn + _Reporter.CleanText("Condicional") + _EpsonCodes.ExpandedOff + _EpsonCodes.CondensedOff);

                _Reporter.PrintText(05, 01, "");
                _Reporter.PrintText(06, 02, _Reporter.CleanText("N.: " + condicional.Id));
                _Reporter.PrintText(07, 01, DateTime.Now.ToShortDateString());
                _Reporter.PrintText(07, 43, DateTime.Now.ToShortTimeString());

                _Reporter.PrintText(08, 01, "-----------------------------------------------");

                List <Library.CondicionalProduto> condicionalProdutos = Library.CondicionalProdutoBD.FindAdvanced(new Library.Classes.QItem("o.id", condicional.Id));

                int i = 0;
                foreach (Library.CondicionalProduto op in condicionalProdutos)
                {
                    _Reporter.PrintText(9 + i, 02, op.Quantidade.ToString());
                    _Reporter.PrintText(9 + i, 08, _Reporter.CleanText(op.Produto.Nome));
                    string preco = op.PrecoTotal.Value.ConvertToMoneyString();
                    _Reporter.PrintText(9 + i, 47 - preco.Length, preco);
                    i++;
                }

                string tota = condicional.Valor.ConvertToMoneyString();

                _Reporter.PrintText(10 + i, 25, "TOTAl: ");
                _Reporter.PrintText(10 + i, 47 - tota.Length, tota);

                _Reporter.EndJob();
                _Reporter.PrintJob();

                PrintCliente(condicional.Cliente, config);

                Library.Classes.Print.PrintSpace(config);
            }
            catch (Exception ex)
            {
                Library.Diagnostics.Logger.Error(ex);
            }
        }
Example #2
0
        //notas:::
        static public void PrintCondicional(Library.Condicional orcamento)
        {
            try
            {
                MatrixReporter.EpsonCodes _EpsonCodes = new MatrixReporter.EpsonCodes();

                MatrixReporter.Reporter _Reporter = new MatrixReporter.Reporter();

                _Reporter.Output = "LPT1";

                _Reporter.StartJob();

                _Reporter.PrintText(01, 14, _EpsonCodes.ExpandedOn + "ARTE LIVRE" + _EpsonCodes.ExpandedOff);
                _Reporter.PrintText(02, 06, _EpsonCodes.ItalicOn + _Reporter.CleanText("Rua Governador Roberto Silveira, 755") + _EpsonCodes.ItalicOff);
                _Reporter.PrintText(03, 17, "(22) 3852-1606");
                _Reporter.PrintText(04, 16, _EpsonCodes.CondensedOn + _EpsonCodes.ExpandedOn + _Reporter.CleanText("Condicional") + _EpsonCodes.ExpandedOff + _EpsonCodes.CondensedOff);

                _Reporter.PrintText(06, 01, "");
                _Reporter.PrintText(07, 02, _Reporter.CleanText("N.: " + orcamento.Id));
                _Reporter.PrintText(08, 01, DateTime.Now.ToShortDateString());
                _Reporter.PrintText(08, 43, DateTime.Now.ToShortTimeString());

                _Reporter.PrintText(09, 01, "-----------------------------------------------");

                List <Library.CondicionalProduto> orcamentoProdutos = Library.CondicionalProdutoBD.FindAdvanced(new Library.Classes.QItem("o.id", orcamento.Id));

                int i = 0;
                foreach (Library.CondicionalProduto op in orcamentoProdutos)
                {
                    _Reporter.PrintText(10 + i, 02, op.Quantidade.ToString());
                    _Reporter.PrintText(10 + i, 08, _Reporter.CleanText(op.Produto.Nome));
                    string preco = op.PrecoTotal.Value.ConvertToMoneyString();
                    _Reporter.PrintText(10 + i, 47 - preco.Length, preco);
                    i++;
                }

                string tota = orcamento.Valor.ConvertToMoneyString();

                _Reporter.PrintText(11 + i, 25, "TOTAl: ");
                _Reporter.PrintText(11 + i, 47 - tota.Length, tota);

                _Reporter.EndJob();
                _Reporter.PrintJob();

                PrintCliente(orcamento.Cliente);

                Library.Classes.Print.PrintSpace();
            }
            catch (Exception ex)
            {
                Library.Diagnostics.Logger.Error(ex);
            }
        }
Example #3
0
        static public void PrintCliente(Library.Cliente cliente, Library.Configuracoes config)
        {
            MatrixReporter.EpsonCodes _EpsonCodes = new MatrixReporter.EpsonCodes();

            MatrixReporter.Reporter _Reporter = new MatrixReporter.Reporter();

            _Reporter.Output = config.ImpressoraPorta;

            _Reporter.StartJob();

            _Reporter.PrintText(01, 01, "");

            int i = 2;

            _Reporter.PrintText(i, 02, _Reporter.CleanText(cliente.Nome));
            i++;

            if (cliente.Cpf != "")
            {
                _Reporter.PrintText(i, 02, "CPF: " + _Reporter.CleanText(cliente.Cpf));
                i++;
            }
            if (cliente.Endereco != "")
            {
                _Reporter.PrintText(i, 02, _Reporter.CleanText(cliente.Endereco));
                i++;
            }
            if (cliente.Cidade != "")
            {
                _Reporter.PrintText(i, 02, _Reporter.CleanText(cliente.Cidade));
                _Reporter.PrintText(i, cliente.Cidade.Length, _Reporter.CleanText("-" + cliente.Estado));
                i++;
            }
            _Reporter.PrintText(i, 01, "");
            i++;
            _Reporter.PrintText(i, 01, "");
            i++;
            _Reporter.PrintText(i, 01, "-----------------------------------------------");
            i++;
            _Reporter.PrintText(i, 19, "ASSINATURA");
            i++;
            _Reporter.PrintText(i, 01, "");

            _Reporter.EndJob();

            _Reporter.PrintJob();
        }
Example #4
0
        static public void PrintOutrasParcela(Library.VendaParcela parcela, Library.Configuracoes config)
        {
            try
            {
                MatrixReporter.EpsonCodes _EpsonCodes = new MatrixReporter.EpsonCodes();

                MatrixReporter.Reporter _Reporter = new MatrixReporter.Reporter();

                _Reporter.Output = config.ImpressoraPorta;

                _Reporter.StartJob();

                _Reporter.PrintText(01, 14, _EpsonCodes.ExpandedOn + "JEANE MODAS" + _EpsonCodes.ExpandedOff);
                _Reporter.PrintText(02, 06, _EpsonCodes.ItalicOn + "Av. Nilo Peçanha, 688" + _EpsonCodes.ItalicOff);
                _Reporter.PrintText(03, 12, "(22) 3852-6784 / 9873-2552");
                _Reporter.PrintText(04, 19, _EpsonCodes.CondensedOn + _EpsonCodes.ExpandedOn + _Reporter.CleanText("Parcela de Venda") + _EpsonCodes.ExpandedOff + _EpsonCodes.CondensedOff);

                _Reporter.PrintText(05, 01, "");
                _Reporter.PrintText(06, 02, _Reporter.CleanText("N. da Venda: " + parcela.Id));
                _Reporter.PrintText(07, 02, DateTime.Now.ToString("dd/MM/yyyy"));
                _Reporter.PrintText(07, 42, DateTime.Now.ToShortTimeString());

                _Reporter.PrintText(08, 01, "-----------------------------------------------");

                _Reporter.PrintText(09, 02, _Reporter.CleanText("Valor da Parcela: " + parcela.Valor));

                if (parcela.Valor != parcela.ValorPago)
                {
                    _Reporter.PrintText(10, 02, _Reporter.CleanText("Valor pago: " + parcela.ValorPago));
                }

                _Reporter.EndJob();

                _Reporter.PrintJob();

                Library.Classes.Print.PrintSpace(config);
            }
            catch (Exception ex)
            {
                Library.Diagnostics.Logger.Error(ex);
            }
        }
Example #5
0
        static public void PrintPagamentoCartao(Library.Configuracoes config)
        {
            MatrixReporter.EpsonCodes _EpsonCodes = new MatrixReporter.EpsonCodes();

            MatrixReporter.Reporter _Reporter = new MatrixReporter.Reporter();

            _Reporter.Output = config.ImpressoraPorta;

            _Reporter.StartJob();

            _Reporter.PrintText(01, 02, _Reporter.CleanText("Pagamento em cartão"));
            _Reporter.PrintText(02, 02, "Volte Sempre!");

            _Reporter.EndJob();

            _Reporter.PrintJob();
        }
Example #6
0
        static public void PrintPagamentoCartao()
        {
            MatrixReporter.EpsonCodes _EpsonCodes = new MatrixReporter.EpsonCodes();

            MatrixReporter.Reporter _Reporter = new MatrixReporter.Reporter();

            _Reporter.Output = "LPT1";

            _Reporter.StartJob();

            _Reporter.PrintText(01, 02, _Reporter.CleanText("Pagamento em cartão"));
            _Reporter.PrintText(02, 02, "Volte Sempre!");

            _Reporter.EndJob();

            _Reporter.PrintJob();
        }
Example #7
0
        static public void PrintOutrasCaixa(Library.Caixa caixa, Library.Configuracoes config)
        {
            try
            {
                decimal vendaavista     = 0;
                decimal vendaaprazo     = 0;
                decimal despesas        = 0;
                decimal outrasOperacoes = 0;

                List <Library.CaixaTransacao> transacoes = Library.CaixaTransacaoBD.FindAdvanced(new QItem("ct.idCaixa", caixa.Id));

                foreach (Library.CaixaTransacao ct in transacoes)
                {
                    if (ct.Despesa != null)
                    {
                        despesas += ct.Valor;
                    }
                    else if (ct.Venda != null)
                    {
                        if (ct.VendaParcela == null)
                        {
                            vendaavista += ct.Valor;
                        }
                        else
                        {
                            vendaaprazo += ct.Valor;
                        }
                    }
                    else
                    {
                        outrasOperacoes += ct.Valor;
                    }
                }


                MatrixReporter.EpsonCodes _EpsonCodes = new MatrixReporter.EpsonCodes();

                MatrixReporter.Reporter _Reporter = new MatrixReporter.Reporter();

                _Reporter.Output = config.ImpressoraPorta;

                _Reporter.StartJob();


                int i = 1;
                _Reporter.PrintText(i, 01, _Reporter.CleanText("CAIXA " + caixa.Data.Value.ToShortDateString()));
                i++;
                _Reporter.PrintText(i, 01, " ");
                i++;
                if (vendaavista > 0)
                {
                    _Reporter.PrintText(i, 01, _Reporter.CleanText("Vendas a vista: "));
                    string valor1 = vendaavista.ConvertToMoneyString();
                    _Reporter.PrintText(i, 47 - valor1.Length, valor1);
                    i++;
                }
                if (vendaaprazo > 0)
                {
                    _Reporter.PrintText(i, 01, _Reporter.CleanText("Vendas a prazo: "));
                    string valor1 = vendaaprazo.ConvertToMoneyString();
                    _Reporter.PrintText(i, 47 - valor1.Length, valor1);
                    i++;
                }
                if (despesas > 0)
                {
                    _Reporter.PrintText(i, 01, _Reporter.CleanText("Despesas: "));
                    string valor1 = despesas.ConvertToMoneyString();
                    _Reporter.PrintText(i, 47 - valor1.Length, valor1);
                    i++;
                }
                if (outrasOperacoes > 0)
                {
                    _Reporter.PrintText(i, 01, _Reporter.CleanText("Outras operacoes: "));
                    string valor1 = outrasOperacoes.ConvertToMoneyString();
                    _Reporter.PrintText(i, 47 - valor1.Length, valor1);
                    i++;
                }
                _Reporter.PrintText(i, 01, " ");
                i++;
                _Reporter.PrintText(i, 01, _Reporter.CleanText("TOTAL: "));
                string valor = caixa.Saldo.ConvertToMoneyString();
                _Reporter.PrintText(i, 47 - valor.Length, valor);
                i++;


                _Reporter.EndJob();

                Console.WriteLine(_Reporter.PreviewJob());
                //_Reporter.PrintJob();

                //PrintSpace();
            }
            catch (Exception ex)
            {
                Library.Diagnostics.Logger.Error(ex);
            }
        }
Example #8
0
        static public void PrintOutrasVenda(Library.Venda venda, Library.Configuracoes config)
        {
            try
            {
                MatrixReporter.EpsonCodes _EpsonCodes = new MatrixReporter.EpsonCodes();

                MatrixReporter.Reporter _Reporter = new MatrixReporter.Reporter();

                _Reporter.Output = config.ImpressoraPorta;

                _Reporter.StartJob();

                _Reporter.PrintText(01, 14, _EpsonCodes.ExpandedOn + "JEANE MODAS" + _EpsonCodes.ExpandedOff);
                _Reporter.PrintText(02, 06, _EpsonCodes.ItalicOn + "Av. Nilo Peçanha, 688" + _EpsonCodes.ItalicOff);
                _Reporter.PrintText(03, 12, "(22) 3852-6784 / 9873-2552");
                _Reporter.PrintText(04, 19, _EpsonCodes.CondensedOn + _EpsonCodes.ExpandedOn + _Reporter.CleanText("Venda") + _EpsonCodes.ExpandedOff + _EpsonCodes.CondensedOff);

                _Reporter.PrintText(05, 01, "");
                _Reporter.PrintText(06, 02, _Reporter.CleanText("N.: " + venda.Id));
                _Reporter.PrintText(07, 02, DateTime.Now.ToString("dd/MM/yyyy"));
                _Reporter.PrintText(07, 42, DateTime.Now.ToShortTimeString());

                _Reporter.PrintText(08, 01, "-----------------------------------------------");

                List <Library.VendaProduto> vendaProdutos = Library.VendaProdutoBD.FindAdvanced(new Library.Classes.QItem("v.id", venda.Id));

                decimal produtostotal = 0;
                int     i             = 0;
                foreach (Library.VendaProduto vp in vendaProdutos)
                {
                    _Reporter.PrintText(9 + i, 02, vp.Quantidade.ToString());
                    _Reporter.PrintText(9 + i, 08, _Reporter.CleanText(vp.Produto.Nome));

                    string preco = vp.PrecoTotal.Value.ConvertToMoneyString();

                    _Reporter.PrintText(9 + i, 47 - preco.Length, preco);
                    produtostotal += vp.PrecoTotal.Value;
                    i++;
                }

                if (venda.FormaPagamento == "avista")
                {
                    string tota = produtostotal.ConvertToMoneyString();
                    string tdea = venda.Valor.ConvertToMoneyString();

                    _Reporter.PrintText(10 + i, 25, "TOTAl: ");
                    _Reporter.PrintText(10 + i, 47 - tota.Length, tota);

                    _Reporter.PrintText(11 + i, 19, "TOTAl FINAL: ");
                    _Reporter.PrintText(11 + i, 47 - tdea.Length, tdea);

                    _Reporter.PrintText(12 + i, 01, "");
                }
                else if (venda.FormaPagamento == "aprazo")
                {
                    string tot = venda.Valor.ConvertToMoneyString();
                    _Reporter.PrintText(10 + i, 25, "TOTAl: ");
                    _Reporter.PrintText(10 + i, 47 - tot.Length, tot);

                    _Reporter.PrintText(11 + i, 01, "");
                    _Reporter.PrintText(12 + i, 01, "-----------------------------------------------");

                    _Reporter.PrintText(13 + i, 02, "Entrada");
                    string entrada = venda.Entrada.ConvertToMoneyString();
                    _Reporter.PrintText(13 + i, 47 - entrada.Length, entrada);

                    decimal j = 1;
                    foreach (Library.VendaParcela vp in Library.VendaParcelaBD.FindAdvanced(new QItem("v.id", venda.Id)))
                    {
                        _Reporter.PrintText(14 + i, 02, "Parcela " + j + " " + vp.Vencimento.Value.ToString("dd/MM/yyyy"));

                        string preco = vp.Valor.Value.ConvertToMoneyString();
                        _Reporter.PrintText(14 + i, 47 - preco.Length, preco);
                        i++;
                        j++;
                    }

                    _Reporter.PrintText(15 + i, 01, "-----------------------------------------------");
                }
                else
                {
                    string tot = venda.Valor.ConvertToMoneyString();
                    _Reporter.PrintText(10 + i, 25, "TOTAl: ");
                    _Reporter.PrintText(10 + i, 47 - tot.Length, tot);

                    _Reporter.PrintText(11 + i, 01, "");
                }



                _Reporter.EndJob();

                _Reporter.PrintJob();


                if (venda.FormaPagamento == "avista")
                {
                    Library.Classes.Print.PrintPagamentoAVista(config);
                }
                else if (venda.FormaPagamento == "aprazo")
                {
                    Library.Classes.Print.PrintPagamentoAPrazo(config);
                    PrintCliente(venda.Cliente, config);
                }
                else if (venda.FormaPagamento == "cartao")
                {
                    Library.Classes.Print.PrintPagamentoCartao(config);
                }
                else if (venda.FormaPagamento == "cheque")
                {
                    Library.Classes.Print.PrintPagamentoCheque(config);
                }
                Library.Classes.Print.PrintSpace(config);
            }
            catch (Exception ex)
            {
                Library.Diagnostics.Logger.Error(ex);
            }
        }