跳转到主要内容

caerp_payment

项目描述

注意:从2.0版本开始,此库不再支持Python 2

该库的目标是提供一套用于管理收款的完整工具集,以满足2018年财政法的要求。以下文本 http://bofip.impots.gouv.fr/bofip/10691-PGP 详细描述了需要解决的问题

它的工作原理如下

  • 收款操作通过公共API执行

  • 对于每次收款操作,都会在日志中写入一条记录

日志是保证收款操作完整性的保证。

模块激活

公共API可以通过CAErp的配置文件.ini进行配置。

确保caerp_payment库已包含在caerp.includes中

caerp.includes = ...
                   ...
                   caerp_payment

配置caerp.interfaces.IPaymentRecordService服务

caerp.interfaces.IPaymentRecordService = caerp_payment.public.PaymentService

配置‘caerp_payment’的日志。有关python logging模块的详细信息,请参阅文档:https://docs.pythonlang.cn/2/library/logging.html 以及 development.ini.sample 文件中的示例。

配置要使用的caerp_payment.interfaces.IPaymentRecordHistoryService日志服务。

caerp_payment提供两种日志服务

HistoryLogService:默认服务,适用于开发模式,仅记录操作,不包含详细信息。

HistoryDBService:将操作记录在特定的数据库中(不一定是在同一台mysql服务器上)

HistoryDBService

要激活特定数据库的详细日志记录,请将以下行添加到.ini文件中的[app:caerp]部分

caerp_payment.interfaces.IPaymentRecordHistoryService = caerp_payment.history.caerp_payment.history.HistoryDBService

创建一个新的数据库,您可以使用caerp存储库中提供的./tools/add_payment_database.sh实用程序。

cd caerp/
./tools/add_payment_database.sh
# Suivez les instructions

然后,将新数据库的连接信息添加到.ini文件中的[app:caerp]部分

caerp_payment_db.url = mysql://caerp_payment:caerp_payment@localhost/caerp_payment?charset=utf8

归档

为了确保收款操作的历史记录,caerp_payment允许使用归档服务。

本地版本,将以下行添加到caerp服务的.ini配置文件中的[app:caerp]部分

caerp_payment.interfaces.IPaymentArchiveService=caerp_payment.archive.FileArchiveService
caerp_payment_archive_storage_path=<chemin sur disque pour le stockage des journaux>

本地版本提供了一种可接受的收款日志认证解决方案。

为了获得更健壮的解决方案,我们更倾向于使用带有第三方认证的远程服务。

完整的配置包含以下信息

caerp.includes =
            ....
            caerp_payment

# Accès à la bdd de traitement des paiements
caerp_payment_db.url = mysql://caerp_payment:caerp_payment@localhost/caerp_payment?charset=utf8

# Le service qui sera utilisé depuis caerp pour agir sur les encaissements
caerp.interfaces.IPaymentRecordService = caerp_payment.public.PaymentService

# Le service qui sera utilisé par caerp_payment pour stocker l'historique des actions d'encaissement
caerp_payment.interfaces.IPaymentRecordHistoryService = caerp_payment.history.HistoryDBService

# Le service en charge de la génération d'une archive avec un peu de certification d'intégrité des journaux
caerp_payment.interfaces.IPaymentArchiveService = caerp_payment.archive.FileArchiveService

# Le chemin utilisé par le service d'archivage pour le stockage sur disque
caerp_payment_archive_storage_path = /var/caerp/files/treasury/payment_storage

日志查看

如果使用HistoryDBService服务,caerp_payment会自动在CAErp的会计菜单中添加一个条目,允许查看对收款所做的更改日志。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

caerp_payment-2024.0.7.tar.gz (31.5 kB 查看哈希值)

上传时间

构建分布

caerp_payment-2024.0.7-py3-none-any.whl (35.4 kB 查看哈希值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面