vpython库_cfdi-为墨西哥生成CFDI的Python库-Jarsa Sistemas, S.A. de C.V. Installation How to use it? Known issu...

作者:Jarsa Sistemas, S.A. de C.V.

### 作者邮箱:info@jarsa.com.mx

### 首页:https://github.com/jarsa/cfdi

### 文档:None

### 下载链接

.. image:: https://travis-ci.org/Jarsa/cfdi.svg?branch=master

:target: https://travis-ci.org/Jarsa/cfdi

.. image:: https://coveralls.io/repos/github/Jarsa/cfdi/badge.svg?branch=master :target: https://coveralls.io/github/Jarsa/cfdi?branch=master .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. image:: https://img.shields.io/pypi/v/cfdi.svg :target: https://pypi.python.org/pypi/cfdi .. image:: https://img.shields.io/pypi/dm/cfdi.svg :target: https://pypi.python.org/pypi/cfdi

CFDI Python Library

This library helps to make Mexico CFDI invoice.

Is in early stage.

Installation

From PyPI

.. code-block::

pip install cfdi

From local source

.. code-block::

git clone https://github.com/Jarsa/cfdi.git

cd cfdi

pip install .

From remote source

.. code-block::

pip install git+https://github.com/Jarsa/cfdi.git

How to use it?

To generate XML you only need to call create method.

.. code-block:: python

import cfdi

invoice = cfdi.invoice()

xml = invoice.create(data)

First you need to make a dictionary with invoice data like this:

.. code-block:: python

data = {

'Atributos': {

'serie': 'A', # Optional

'folio': '12345', # Optional

'fecha': 'aaaa-mm-ddThh:mm:ss', # ISO 8601

'sello': '', # Generated with this lib.

'formaDePago': 'Pago en una sola exhibicion', # Pago en una sola exhibición o número de parcialidad pagada contra el total de parcialidades, Parcialidad 1 de X.

'noCertificado': '', # Generated with this lib.

'certificado': '', # Generated with tis lib.

'condicionesDePago': '', # Optional

'subTotal': '100.00',

'descuento': '0.0', # Optional

'motivoDescuento': '', # Optional

'TipoCambio': '1.0', # Optional

'Moneda': 'MXN', # Optional

'total': '116.00',

'tipoDeComprobante': 'ingreso', # ingreso egreso traslado

'metodoDePago': 'NA', # See catalog in SAT.

'LugarExpedicion': 'Torreon Coahuila, Mexico',

'NumCtaPago': '1234', # Optional

'FolioFiscalOrig': '', # Optional

'SerieFolioFiscalOrig': '', # Optional

'FechaFolioFiscalOrig': 'aaaa-mm-ddThh:mm:ss', # Optional ISO 8601

'MontoFolioFiscalOrig': '0.00', # Optional

},

'Emisor': {

'rfc': 'JSI140527TS9',

'nombre': 'Jarsa Sistemas, S.A. de C.V.', # Optional

'DomicilioFiscal': {

'calle': 'Calle',

'noExterior': '49', # Optional

'noInterior': '', # Optional

'colonia': 'Colonia', # Optional

'localidad': 'Torreon', # Optional

'referencia': 'Referencia', # Optional

'municipio': 'Torreon',

'estado': 'Coahuila',

'pais': 'Mexico',

'codigoPostal': '27200',

},

'ExpedidoEn': {

'calle': 'Calle', # Optional

'noExterior': '49', # Optional

'noInterior': '', # Optional

'colonia': 'Colonia', # Optional

'localidad': 'Torreon', # Optional

'referencia': 'Referencia', # Optional

'municipio': 'Torreon', # Optional

'estado': 'Coahuila', # Optional

'pais': 'Mexico', # Optional

'codigoPostal': '27200', # Optional

},

'RegimenFiscal': 'Parsona Fisica con Actividad Empresarial',

},

'Receptor': {

'rfc': 'XAXX010101000',

'nombre': 'Cliente', # Optional

'Domicilio': {

'calle': 'Calle', # Optional

'noExterior': '50', # Optional

'noInterior': '', # Optional

'colonia': 'Colonia', # Optional

'localidad': 'Torreon', # Optional

'referencia': 'Referencia', # Optional

'municipio': 'Torreon', # Optional

'estado': 'Coahuila', # Optional

'pais': 'Mexico', # Optional

'codigoPostal': '27200', # Optional

},

},

'Conceptos': [

{

'cantidad': '1.0',

'unidad': 'pieza',

'noIdentificacion': 'A123', # Reference or serial no. Optional

'descripcion': '', # Optional

'valorUnitario': '100.00',

'importe': '100.00',

'InformacionAduanera': {

'numero': '',

'fecha': '',

'aduana': '', # Optional

},

'CuentaPredial': {

'numero': '',

},

'Parte': [

{

'cantidad': '1.0',

'unidad': 'pieza', # Optional

'noIdentificacion': '', # Optional

'descripcion': '',

'valorUnitario': '0.0', # Optional

'importe': '0.0', # Optional

'InformacionAduanera': {

'numero': '',

'fecha': '',

'aduana': '', # Optional

}

},

],

},

],

'Impuestos': {

'totalImpuestosRetenidos': '0.0', # Optional

'totalImpuestosTrasladados': '16.0', # Optional

'Retenciones': [

{

'impuesto': '', # IVA ISR

'importe': '0.00',

},

],

'Traslados': [

{

'impuesto': 'IVA', # IVA IEPS

'tasa': '16.00',

'importe': '16.00',

},

],

},

}

Known issues / Roadmap

Sign the XML.

Generate drivers framework to allow different PAC's.

Hability to create Addendas.

Test & document everything.

Compatibility to CFDI v3.3.

Bug Tracker

Bugs are tracked on GitHub Issues . In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback here .

Credits

Contributors

Maintainer

.. image:: http://www.jarsa.com.mx/logo.png :alt: Jarsa Sistemas, S.A. de C.V. :target: http://www.jarsa.com.mx

This package is maintained by Jarsa Sistemas, S.A. de C.V.

Copy from pypi.org

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值