Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Types of Contributions
Report Bugs
~~~~~~~~~~~

Report bugs at https://lib.facho.cyou
Report bugs at https://git.disroot.org/Etrivial/facho/issues.

If you are reporting a bug, please include:

Expand Down Expand Up @@ -45,7 +45,7 @@ articles, and such.
Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://lib.facho.cyou/ticket.
The best way to send feedback is to file an issue at https://git.disroot.org/Etrivial/facho/issues.

If you are proposing a feature:

Expand All @@ -57,28 +57,18 @@ If you are proposing a feature:
Get Started!
------------

Using docker
------------

1. make -f Makefile.dev dev-setup
1. make -f Makefile.dev dev-shell
2. make -f Makefile.dev test
3. make -f Makefile.dev tox

From Source Code
-----------

Ready to contribute? Here's how to set up `facho` for local development.

1. Fork the `facho` repo .
2. Clone your fork locally::

$ fossil clone https://lib.facho.cyou
$ git clone https://git.disroot.org/Etrivial/facho.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ python3 -mvenv facho-venv && source facho-venv/bin/activate
$ cd facho/
$ pre-commit install
$ python setup.py develop

4. Create a branch for local development::
Expand All @@ -104,6 +94,13 @@ Ready to contribute? Here's how to set up `facho` for local development.

7. Submit a pull request through the GitHub website.

Using docker
------------

1. make -f Makefile.dev build
2. make -f Makefile.dev dev-shell
3. make -f Makefile.dev python3.8 setup.py develop
4. make -f Makefile.dev python3.8 setup.py test

Pull Request Guidelines
-----------------------
Expand Down
37 changes: 17 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
# DERIVADO DE https://alextereshenkov.github.io/run-python-tests-with-tox-in-docker.html
FROM ubuntu:20.04

LABEL org.opencontainers.image.authors="bit4bit@riseup.net"
FROM ubuntu:24.04

RUN apt-get -qq update

RUN apt install software-properties-common -y \
&& add-apt-repository ppa:deadsnakes/ppa

RUN apt-get install -y --no-install-recommends \
python3.7 python3.7-distutils python3.7-dev \
python3.8 python3.8-distutils python3.8-dev \
python3.9 python3.9-distutils python3.9-dev \
python3.10 python3.10-distutils python3.10-dev \
python3.11 python3.11-distutils python3.11-dev \
python3.12 python3-setuptools python3.12-dev \
wget \
ca-certificates

RUN wget https://bootstrap.pypa.io/get-pip.py \
&& python3.7 get-pip.py pip==22.2.2 \
&& python3.8 get-pip.py pip==22.2.2 \
&& python3.9 get-pip.py pip==22.2.2 \
&& python3.10 get-pip.py pip==22.2.2 \
&& python3.9 get-pip.py pip==23.2.1 --break-system-packages \
&& python3.10 get-pip.py pip==23.2.1 --break-system-packages \
&& python3.11 get-pip.py pip==23.2.1 --break-system-packages \
&& python3.12 get-pip.py pip==23.2.1 --break-system-packages \
&& rm get-pip.py

RUN apt-get install -y --no-install-recommends \
libxml2-dev \
libxmlsec1-dev \
build-essential \
zip \
pkg-config

RUN python3.7 --version
RUN python3.8 --version
libxml2-dev \
libxmlsec1-dev \
build-essential \
zip

RUN python3.9 --version
RUN python3.10 --version
RUN python3.11 --version
RUN python3.12 --version

RUN pip3.7 install setuptools setuptools-rust
RUN pip3.8 install setuptools setuptools-rust
RUN pip3.9 install setuptools setuptools-rust
RUN pip3.10 install setuptools setuptools-rust
RUN pip3.11 install setuptools setuptools-rust --break-system-packages
RUN pip3.12 install setuptools setuptools-rust --break-system-packages

RUN pip3 install tox pytest
RUN pip3 install tox pytest --break-system-packages
2 changes: 1 addition & 1 deletion Makefile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dev-shell:
docker run --rm -ti -v "$(PWD):/app" -w /app --name facho-cli facho bash

test:
docker run -t -v $(PWD):/app -w /app facho sh -c 'cd /app; python3.7 setup.py test'
docker run -t -v $(PWD):/app -w /app facho sh -c 'cd /app; python3.12 setup.py test'

tox:
docker run -it -v $(PWD)/:/app -w /app facho tox
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ INSTALACION

usando pip::

pip install git+https://github.com/bit4bit/facho
pip install git+https://git.disroot.org/Etrivial/facho

CLI
===
Expand Down
Binary file removed docs/DIAN/Anexo_tecnico_vr18_09022021.pdf
Binary file not shown.
Binary file not shown.
77 changes: 40 additions & 37 deletions examples/generate-invoice-from-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from datetime import datetime, date

# Datos del fomulario del SET de pruebas
INVOICE_AUTHORIZATION = '181360000001' #Número suministrado por la Dian en el momento de la creación del SET de Pruebas
INVOICE_AUTHORIZATION = '181360000001' # Número suministrado por la Dian en el momento de la creación del SET de Pruebas
ID_SOFTWARE = '57bcb6d1-c591-5a90-b80a-cb030ec91440' #Id suministrado por la Dian en el momento de la creación del SET de Pruebas
PIN = '19642' #Número creado por la empresa para poder crear el SET de pruebas
CLAVE_TECNICA = 'fc9eac422eba16e21ffd8c5f94b3f30a6e38162d' ##Id suministrado por la Dian en el momento de la creación del SET de Pruebas
Expand All @@ -36,6 +36,7 @@ def extensions(inv):
'SETP', 990000000, 995000000)#del SET de pruebas
return [security_code, authorization_provider, cufe, software_provider, inv_authorization]


def invoice():
# factura de venta nacional
inv = form.Invoice('01')
Expand All @@ -49,16 +50,17 @@ def invoice():
inv.set_operation_type('10')
inv.set_supplier(form.Party(
legal_name = 'Nombre registrado de la empresa',
name = 'Nombre comercial o él mismo nombre registrado',
ident = form.PartyIdentification('nit_empresa', 'digito_verificación', '31'),
name='Nombre comercial o él mismo nombre registrado',
ident=form.PartyIdentification(
'nit_empresa', 'digito_verificación', '31'),
# obligaciones del contribuyente ver DIAN:FAK26
responsability_code = form.Responsability(['O-07', 'O-14', 'O-48']),
responsability_code=form.Responsability(['ZZ', 'O-14', 'O-48']),
# ver DIAN:FAJ28
responsability_regime_code = '48',
responsability_regime_code='48',
# tipo de organizacion juridica ver DIAN:6.2.3
organization_code = '1',
email = "correoempresa@correoempresa.correo",
address = form.Address(
organization_code='1',
email="correoempresa@correoempresa.correo",
address=form.Address(
'', '', form.City('05001', 'Medellín'),
form.Country('CO', 'Colombia'),
form.CountrySubentity('05', 'Antioquia')),
Expand All @@ -76,42 +78,43 @@ def invoice():
'', '', form.City('05001', 'Medellín'),
form.Country('CO', 'Colombia'),
form.CountrySubentity('05', 'Antioquia')),
#tax_scheme = form.TaxScheme('01', 'IVA')
# tax_scheme = form.TaxScheme('01', 'IVA')
))
# asignar metodo de pago
inv.set_payment_mean(form.PaymentMean(
# metodo de pago ver DIAN:3.4.1
id = '1',
# codigo correspondiente al medio de pago ver DIAN:3.4.2
code = '20',
# fecha de vencimiento de la factura
due_at = datetime.now(),
# identificador numerico
payment_id = '2'
id='1',
# codigocorrespondientealmediodepagoverDIAN:3.4.2
code='20',
# fechadevencimientodelafactura
due_at=datetime.now(),
# identificadornumerico
payment_id='2'
))
# adicionar una linea al documento
inv.add_invoice_line(form.InvoiceLine(
quantity = form.Quantity(int(20.5), '94'),
# item general de codigo 999
description = 'productO3',
item = form.StandardItem('test', 9999),
price = form.Price(
# precio base del item (sin iva)
amount = form.Amount(200.00),
# ver DIAN:6.3.5.1
type_code = '01',
type = 'x'
),
tax = form.TaxTotal(
subtotals = [
form.TaxSubTotal(
percent = 19.00,
scheme=form.TaxScheme('01')
)
]
)
))
inv.add_invoice_line(
form.InvoiceLine(
quantity=form.Quantity(int(20.5), '94'),
# item general de codigo 999
description='productO3',
sitem=form.StandardItem('test', 9999),
price=form.Price(
# precio base del item (sin iva)
amount=form.Amount(200.00),
# ver DIAN:6.3.5.1
type_code='01',
type='x'
),
tax=form.TaxTotal(
subtotals=[
form.TaxSubTotal(
percent=19.00,
scheme=form.TaxScheme('01')
)]
)
))
return inv


def document_xml():
return form_xml.DIANInvoiceXML
Loading