This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description

Projeto Extratos CF-e-SAT


This project is about printing receipts from eletronic fiscal documents related to SAT-CF-e which is a system for autorization and transmission of fiscal documents, developed by Finance Secretary of state of São Paulo, Brazil. This entire project, variables, methods and class names, as well as documentation, are written in brazilian portuguese.

Refer to the oficial web site for more information (in brazilian portuguese only).

Emissão de extratos do CF-e-SAT diretamente a partir dos documentos eletrônicos que representam o CF-e de venda e/ou de cancelamento, na forma de arquivos em formato XML.

Esta implementação é baseada na emissão dos extratos para mini-impressoras, normalmente térmicas (mas não limitado à elas), através da abstração PyESCPOS para o sistema de comandos de impressão ESC/POS® e derivações.

Para comunicar-se com equipamentos SAT veja o Projeto SATCFe.

Exemplos de Uso

Extratos do CF-e de Venda

Para emitir um extrato de um CF-e de venda, você irá precisar do XML do CF-e-SAT de venda, que é o documento fiscal, e uma impressora ESC/POS® (veja as implementações disponíveis no projeto PyESCPOS):

from escpos.serial import SerialConnection
from escpos.impl.daruma import DR700
from satextrato import ExtratoCFeVenda

conn = SerialConnection.create('COM1:9600,8,1,N')
impressora = DR700(conn)
impressora.init()

with open(r'C:\CFe351702.xml', 'r') as fp:
    extrato = ExtratoCFeVenda(fp, impressora)
    extrato.imprimir()

Extratos do CF-e de Cancelamento

Para emitir um extrato do CF-e-SAT de cancelamento, além do documento de cancelamento você também irá precisar do documento da venda, ao qual o documento de cancelamento se refere. Seguindo a mesma linha do exemplo anterior:

with open('CFe_1.xml', 'r') as fvenda, open('CFeCanc_1.xml', 'r') as fcanc:
    extrato = ExtratoCFeCancelamento(fvenda, fcanc, impressora)
    extrato.imprimir()

Mais Exemplos

Eventualmente, você poderá encontrar mais exemplos no Wiki do projeto.

Executando Testes

Para executar os testes de emissão dos extratos em impressoras conectadas à portas seriais, ou em impressoras USB a partir de virtualizadores de portas seriais:

$ python setup.py test -a \
        "--escpos-impl=escpos.impl.daruma.DR700 "\
        "--escpos-if=serial "\
        "--serial-port=/dev/ttyS7"

Para executar os testes em uma impressora conectada à rede, via TCP/IP no endereço 192.168.1.200 porta 9100:

$ python setup.py test -a \
        "--escpos-impl=escpos.impl.epson.TMT20 "\
        "--escpos-if=network "\
        "--network-host=192.168.1.200 "\
        "--network-port=9100 "
Release History

Release History

0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
satextrato-0.1.tar.gz (20.7 kB) Copy SHA256 Checksum SHA256 Source Feb 8, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting