Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: French Specifications v1.4 #28

Merged
merged 4 commits into from
Dec 6, 2024
Merged
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
7 changes: 7 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"release-type": "python",
"skip-github-release": true,
"include-v-in-tag": false,
"include-component-in-tag": false,
"always-update": true
}
3 changes: 3 additions & 0 deletions .github/release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "2024.0.0"
}
3 changes: 2 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ jobs:
with:
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: python
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
8 changes: 6 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@

## Schemas

[All the schemas](./schemas) are taken or adapted from documents issued by Direction Générale des Finances Public, in its [_Cahier des charges DPI-DAC7 (Revenus 2023)_](https://www.impots.gouv.fr/transfert-dinformations-en-application-des-dispositifs-dpi-dac7-plateformes-deconomie-collaborative)
[All the schemas](./schemas) are taken or adapted from documents issued by Direction Générale des Finances Publiques, in
its [_Cahier des charges DPI-DAC7, Revenus 2024, v1.4_][dgfip] (last updated in October 2024, retrieved in November 2024).

They are released under the [Etalab-2.0 license](./schemas/LICENSE.md).

## Examples

[All the examples](./examples) are taken or adapted from documents issued by Direction Générale des Finances Public, in its [_Cahier des charges DPI-DAC7 (Revenus 2023)_](https://www.impots.gouv.fr/transfert-dinformations-en-application-des-dispositifs-dpi-dac7-plateformes-deconomie-collaborative)
[All the examples](./examples) are taken or adapted from documents issued by Direction Générale des Finances Publiques, in
its [_Cahier des charges DPI-DAC7, Revenus 2024, v1.4_][dgfip] (last updated in October 2024, retrieved in November 2024).

They are released under the [Etalab-2.0 license](./examples/LICENSE.md).

[dgfip]: https://www.impots.gouv.fr/transfert-dinformations-en-application-des-dispositifs-dpi-dac7-plateformes-deconomie-collaborative
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ test-unit: schemas-xsd ## Launch unit tests

.PHONY: test-e2e
test-e2e: prepare-test-env ## Launch end-to-end tests
$(MAKE) test-e2e-case CASE=1_initial_immovable_properties TIMESTAMP=2024-01-31T12:05:56.084
$(MAKE) test-e2e-case CASE=2_initial_sale_of_goods TIMESTAMP=2024-01-25T12:55:02.003
$(MAKE) test-e2e-case CASE=3_additional TIMESTAMP=2024-01-25T14:17:22.241
$(MAKE) test-e2e-case CASE=4_corrective TIMESTAMP=2024-01-28T08:12:00.003
$(MAKE) test-e2e-case CASE=5_initial_assuming TIMESTAMP=2024-01-30T21:48:22.209
$(MAKE) test-e2e-case CASE=6_initial_assumed TIMESTAMP=2024-01-16T11:22:59.456
$(MAKE) test-e2e-case CASE=1_initial_immovable_properties TIMESTAMP=2025-01-31T12:05:56.084
$(MAKE) test-e2e-case CASE=2_initial_sale_of_goods TIMESTAMP=2025-01-25T12:55:02.003
$(MAKE) test-e2e-case CASE=3_additional TIMESTAMP=2025-01-25T14:17:22.241
$(MAKE) test-e2e-case CASE=4_corrective TIMESTAMP=2025-01-28T08:12:00.003
$(MAKE) test-e2e-case CASE=5_initial_assuming TIMESTAMP=2025-01-30T21:48:22.209
$(MAKE) test-e2e-case CASE=6_initial_assumed TIMESTAMP=2025-01-16T11:22:59.456


.PHONY: test-e2e-case
Expand Down
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DAC7 (France 2023)
# DAC7 (France report for 2024 earnings)

> [!CAUTION]
> All content shared in this repository is provided "as is" without any warranty of any kind from its authors.
Expand Down Expand Up @@ -32,8 +32,7 @@ poetry run dac7 encrypt -z -E PROD ${filename} > ${filename}.gz.gpg

This repository is focused on the French version of DAC7, the requirements of
which have been published by the _Direction générale des Finances publiques_,
or DGFiP, on May 15, 2024
([_cahier des charges_ v1.3][dgfip-cdc],
or DGFiP, on October 24, 2024 ([_cahier des charges_ v1.4][dgfip-cdc],
[schema v1.1][dgfip-schema]
:fr:).
They differ from the
Expand All @@ -54,7 +53,7 @@ This repository contains:

### Revised XML schema

The [DGFiP specification v1.3][dgfip-cdc] :fr: is not compatible with the
The [DGFiP specification][dgfip-cdc] :fr: is not compatible with the
[OECD standard v1][oecd]
on at least the following points:

Expand All @@ -68,7 +67,7 @@ Unfortunately, its
[version v1.1][dgfip-schema]
:fr:
does not implement all the requirements stated in the
[specification document v1.3][dgfip-cdc] :fr: released at the same time.
[specification document][dgfip-cdc] :fr: released at the same time.

For this reason, we provide a revised version of the French schema in the
[schemas/xml](./schemas/xml) folder that includes the following additional
Expand All @@ -84,8 +83,7 @@ checks:
DAC7, i.e. within the EU

Those schemas are adapted from the schemas included in the DGFiP specification
documents ([Cahier des charges DPI-DAC7, Revenus 2023, v1.3][dgfip],
last updated in May 2024, retrieved in May 2024), which are published under the
documents ([_Cahier des charges DPI-DAC7_][dgfip-cdc]), which are published under the
[Etalab-2.0 license](./examples/LICENSE.md).

### Python CLI
Expand Down Expand Up @@ -121,9 +119,8 @@ To run the `dac7` CLI, you need:
It may work with other versions, maybe. Don't hesitate to open a PR to update
the documentation and/or the code!

Once you have cloned the repository, you can use
[Poetry](https://python-poetry.org/) to create a virtual environment and
install the project in it with all its dependencies:
Once you have cloned the repository, you can use [Poetry](https://python-poetry.org/) to create a virtual environment
and install the project in it with all its dependencies:

```sh
poetry install
Expand All @@ -140,8 +137,8 @@ poetry run dac7 --help
> [!NOTE]
> You need GnuPG to be installed on your system to be able to encrypt the file

The DGFiP test and prod platforms expect a compressed-then-encrypted file,
using the corresponding test and prod encryption keys.
The DGFiP test and prod platforms expect a compressed-then-encrypted file, using the corresponding test and prod
encryption keys.

The `encrypt` command can do both in one go:

Expand Down Expand Up @@ -240,8 +237,7 @@ poetry run dac7 schemas build --help

In the [examples](./examples) folder, we provide files adapted from the examples
included in the DGFiP specification documents
([Cahier des charges DPI-DAC7, Revenus 2023, v1.3][dgfip],
last updated in May 2024, retrieved in May 2024), which are published under the
([_Cahier des charges DPI-DAC7_][dgfip-cdc]), which are published under the
[Etalab-2.0 license](./examples/LICENSE.md).

#### 1. Entity and individual sellers for immovable properties
Expand Down Expand Up @@ -365,7 +361,7 @@ make schemas
- a "naming convention" for the file

[dgfip]: https://www.impots.gouv.fr/transfert-dinformations-en-application-des-dispositifs-dpi-dac7-plateformes-deconomie-collaborative
[dgfip-cdc]: https://www.impots.gouv.fr/sites/default/files/media/1_metier/3_partenaire/tiers_declarants/cdc_td_bilateral/cdc-dac7-v.1.3.pdf
[dgfip-cdc]: https://www.impots.gouv.fr/sites/default/files/media/1_metier/3_partenaire/tiers_declarants/cdc_td_bilateral/cdc-dac7-v.1.4.pdf
[dgfip-naming]: https://www.impots.gouv.fr/sites/default/files/media/1_metier/3_partenaire/tiers_declarants/cdc_td_bilateral/nommage_collecte-dpi-dac7.pdf
[dgfip-schema]: https://www.impots.gouv.fr/sites/default/files/media/1_metier/3_partenaire/tiers_declarants/cdc_td_bilateral/schema-xsd-de-collecte-dpi-dac7---revenus-2023.zip
[dgfip-schema]: https://www.impots.gouv.fr/sites/default/files/media/1_metier/3_partenaire/tiers_declarants/cdc_td_bilateral/schema-xsd-de-collecte-dpi-dac7---revenus-2024.zip
[oecd]: https://www.oecd.org/tax/exchange-of-tax-information/model-rules-for-reporting-by-platform-operators-with-respect-to-sellers-in-the-sharing-and-gig-economy.htm
4 changes: 2 additions & 2 deletions cli/tests/scripts/build_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TEMP_FILENAME="${OUTPUT_DIR}/.declaration.xml"
"${DAC7}" build \
--env="${ENV}" \
--declaration-id=1 \
--fiscal-year=2023 \
--fiscal-year=2024 \
${TIMESTAMP:+"--timestamp=${TIMESTAMP}"} \
--platform-operator="${PLATFORM_JSON}" \
${OTHERS_JSON:+"--other-platform-operators=${OTHERS_JSON}"} \
Expand All @@ -32,4 +32,4 @@ mv "${TEMP_FILENAME}" "${FINAL_FILENAME}"

# Compress and encrypt

"${DAC7}" encrypt -z --env="${ENV}" "${FINAL_FILENAME}" > "${FINAL_FILENAME}.gz.gpg"
# "${DAC7}" encrypt -z --env="${ENV}" "${FINAL_FILENAME}" > "${FINAL_FILENAME}.gz.gpg"
12 changes: 6 additions & 6 deletions examples/1_initial_immovable_properties/declaration.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"dpi:TransmittingCountry": "FR",
"dpi:ReceivingCountry": "FR",
"dpi:MessageType": "DPI",
"dpi:MessageRefId": "OP_2023_123456789_d1",
"dpi:MessageRefId": "OP_2024_123456789_d1",
"dpi:MessageTypeIndic": "DPI401",
"dpi:ReportingPeriod": "2023-12-31",
"dpi:Timestamp": "2024-01-31T12:05:56.084"
"dpi:ReportingPeriod": "2024-12-31",
"dpi:Timestamp": "2025-01-31T12:05:56.084"
},
"dpi:DPIBody": {
"dpi:PlatformOperator": {
Expand Down Expand Up @@ -52,7 +52,7 @@
"dpi:AssumedReporting": false,
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD1",
"stf:DocRefId": "OP_2023_123456789_v1"
"stf:DocRefId": "OP_2024_123456789_v1"
}
},
"dpi:ReportableSeller": [
Expand Down Expand Up @@ -190,7 +190,7 @@
},
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD1",
"stf:DocRefId": "OP_2023_123456789_03349c99-fb08-4179-9cca-05260a8b54d0_v1"
"stf:DocRefId": "OP_2024_123456789_03349c99-fb08-4179-9cca-05260a8b54d0_v1"
}
},
{
Expand Down Expand Up @@ -347,7 +347,7 @@
},
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD1",
"stf:DocRefId": "OP_2023_123456789_03587e99-aa78-8871-9abc-487025a8b54d0_v1"
"stf:DocRefId": "OP_2024_123456789_03587e99-aa78-8871-9abc-487025a8b54d0_v1"
}
}
]
Expand Down
12 changes: 6 additions & 6 deletions examples/1_initial_immovable_properties/declaration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<dpi:TransmittingCountry>FR</dpi:TransmittingCountry>
<dpi:ReceivingCountry>FR</dpi:ReceivingCountry>
<dpi:MessageType>DPI</dpi:MessageType>
<dpi:MessageRefId>OP_2023_123456789_d1</dpi:MessageRefId>
<dpi:MessageRefId>OP_2024_123456789_d1</dpi:MessageRefId>
<dpi:MessageTypeIndic>DPI401</dpi:MessageTypeIndic>
<dpi:ReportingPeriod>2023-12-31</dpi:ReportingPeriod>
<dpi:Timestamp>2024-01-31T12:05:56.084</dpi:Timestamp>
<dpi:ReportingPeriod>2024-12-31</dpi:ReportingPeriod>
<dpi:Timestamp>2025-01-31T12:05:56.084</dpi:Timestamp>
</dpi:MessageSpec>
<dpi:DPIBody>
<dpi:PlatformOperator>
Expand All @@ -30,7 +30,7 @@
<dpi:AssumedReporting>false</dpi:AssumedReporting>
<dpi:DocSpec>
<stf:DocTypeIndic>OECD1</stf:DocTypeIndic>
<stf:DocRefId>OP_2023_123456789_v1</stf:DocRefId>
<stf:DocRefId>OP_2024_123456789_v1</stf:DocRefId>
</dpi:DocSpec>
</dpi:PlatformOperator>
<dpi:ReportableSeller>
Expand Down Expand Up @@ -104,7 +104,7 @@
</dpi:RelevantActivities>
<dpi:DocSpec>
<stf:DocTypeIndic>OECD1</stf:DocTypeIndic>
<stf:DocRefId>OP_2023_123456789_03349c99-fb08-4179-9cca-05260a8b54d0_v1</stf:DocRefId>
<stf:DocRefId>OP_2024_123456789_03349c99-fb08-4179-9cca-05260a8b54d0_v1</stf:DocRefId>
</dpi:DocSpec>
</dpi:ReportableSeller>
<dpi:ReportableSeller>
Expand Down Expand Up @@ -192,7 +192,7 @@
</dpi:RelevantActivities>
<dpi:DocSpec>
<stf:DocTypeIndic>OECD1</stf:DocTypeIndic>
<stf:DocRefId>OP_2023_123456789_03587e99-aa78-8871-9abc-487025a8b54d0_v1</stf:DocRefId>
<stf:DocRefId>OP_2024_123456789_03587e99-aa78-8871-9abc-487025a8b54d0_v1</stf:DocRefId>
</dpi:DocSpec>
</dpi:ReportableSeller>
</dpi:DPIBody>
Expand Down
14 changes: 7 additions & 7 deletions examples/2_initial_sale_of_goods/declaration.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"dpi:TransmittingCountry": "FR",
"dpi:ReceivingCountry": "FR",
"dpi:MessageType": "DPI",
"dpi:MessageRefId": "OP_2023_123456789_d1",
"dpi:MessageRefId": "OP_2024_123456789_d1",
"dpi:MessageTypeIndic": "DPI401",
"dpi:ReportingPeriod": "2023-12-31",
"dpi:Timestamp": "2024-01-25T12:55:02.003"
"dpi:ReportingPeriod": "2024-12-31",
"dpi:Timestamp": "2025-01-25T12:55:02.003"
},
"dpi:DPIBody": {
"dpi:PlatformOperator": {
Expand Down Expand Up @@ -52,7 +52,7 @@
"dpi:AssumedReporting": false,
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD1",
"stf:DocRefId": "OP_2023_123456789_v1"
"stf:DocRefId": "OP_2024_123456789_v1"
}
},
"dpi:ReportableSeller": [
Expand Down Expand Up @@ -171,7 +171,7 @@
},
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD1",
"stf:DocRefId": "OP_2023_123456789_5683da9c-2ea0-427b-ab86-578ebdb545ba_v1"
"stf:DocRefId": "OP_2024_123456789_5683da9c-2ea0-427b-ab86-578ebdb545ba_v1"
}
},
{
Expand Down Expand Up @@ -289,7 +289,7 @@
},
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD1",
"stf:DocRefId": "OP_2023_123456789_2a1d15af-aef0-4b77-8c0c-7341ee5e7ae1_v1"
"stf:DocRefId": "OP_2024_123456789_2a1d15af-aef0-4b77-8c0c-7341ee5e7ae1_v1"
}
},
{
Expand Down Expand Up @@ -413,7 +413,7 @@
},
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD1",
"stf:DocRefId": "OP_2023_123456789_b27ec429-f539-499c-88bc-da6d9563f316_v1"
"stf:DocRefId": "OP_2024_123456789_b27ec429-f539-499c-88bc-da6d9563f316_v1"
}
}
]
Expand Down
14 changes: 7 additions & 7 deletions examples/2_initial_sale_of_goods/declaration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<dpi:TransmittingCountry>FR</dpi:TransmittingCountry>
<dpi:ReceivingCountry>FR</dpi:ReceivingCountry>
<dpi:MessageType>DPI</dpi:MessageType>
<dpi:MessageRefId>OP_2023_123456789_d1</dpi:MessageRefId>
<dpi:MessageRefId>OP_2024_123456789_d1</dpi:MessageRefId>
<dpi:MessageTypeIndic>DPI401</dpi:MessageTypeIndic>
<dpi:ReportingPeriod>2023-12-31</dpi:ReportingPeriod>
<dpi:Timestamp>2024-01-25T12:55:02.003</dpi:Timestamp>
<dpi:ReportingPeriod>2024-12-31</dpi:ReportingPeriod>
<dpi:Timestamp>2025-01-25T12:55:02.003</dpi:Timestamp>
</dpi:MessageSpec>
<dpi:DPIBody>
<dpi:PlatformOperator>
Expand All @@ -30,7 +30,7 @@
<dpi:AssumedReporting>false</dpi:AssumedReporting>
<dpi:DocSpec>
<stf:DocTypeIndic>OECD1</stf:DocTypeIndic>
<stf:DocRefId>OP_2023_123456789_v1</stf:DocRefId>
<stf:DocRefId>OP_2024_123456789_v1</stf:DocRefId>
</dpi:DocSpec>
</dpi:PlatformOperator>
<dpi:ReportableSeller>
Expand Down Expand Up @@ -89,7 +89,7 @@
</dpi:RelevantActivities>
<dpi:DocSpec>
<stf:DocTypeIndic>OECD1</stf:DocTypeIndic>
<stf:DocRefId>OP_2023_123456789_5683da9c-2ea0-427b-ab86-578ebdb545ba_v1</stf:DocRefId>
<stf:DocRefId>OP_2024_123456789_5683da9c-2ea0-427b-ab86-578ebdb545ba_v1</stf:DocRefId>
</dpi:DocSpec>
</dpi:ReportableSeller>
<dpi:ReportableSeller>
Expand Down Expand Up @@ -148,7 +148,7 @@
</dpi:RelevantActivities>
<dpi:DocSpec>
<stf:DocTypeIndic>OECD1</stf:DocTypeIndic>
<stf:DocRefId>OP_2023_123456789_2a1d15af-aef0-4b77-8c0c-7341ee5e7ae1_v1</stf:DocRefId>
<stf:DocRefId>OP_2024_123456789_2a1d15af-aef0-4b77-8c0c-7341ee5e7ae1_v1</stf:DocRefId>
</dpi:DocSpec>
</dpi:ReportableSeller>
<dpi:ReportableSeller>
Expand Down Expand Up @@ -216,7 +216,7 @@
</dpi:RelevantActivities>
<dpi:DocSpec>
<stf:DocTypeIndic>OECD1</stf:DocTypeIndic>
<stf:DocRefId>OP_2023_123456789_b27ec429-f539-499c-88bc-da6d9563f316_v1</stf:DocRefId>
<stf:DocRefId>OP_2024_123456789_b27ec429-f539-499c-88bc-da6d9563f316_v1</stf:DocRefId>
</dpi:DocSpec>
</dpi:ReportableSeller>
</dpi:DPIBody>
Expand Down
10 changes: 5 additions & 5 deletions examples/3_additional/declaration.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"dpi:TransmittingCountry": "FR",
"dpi:ReceivingCountry": "FR",
"dpi:MessageType": "DPI",
"dpi:MessageRefId": "OP_2023_123456789_d1",
"dpi:MessageRefId": "OP_2024_123456789_d1",
"dpi:MessageTypeIndic": "DPI401",
"dpi:ReportingPeriod": "2023-12-31",
"dpi:Timestamp": "2024-01-25T14:17:22.241"
"dpi:ReportingPeriod": "2024-12-31",
"dpi:Timestamp": "2025-01-25T14:17:22.241"
},
"dpi:DPIBody": {
"dpi:PlatformOperator": {
Expand Down Expand Up @@ -52,7 +52,7 @@
"dpi:AssumedReporting": false,
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD0",
"stf:DocRefId": "OP_2023_123456789_v1"
"stf:DocRefId": "OP_2024_123456789_v1"
}
},
"dpi:ReportableSeller": [
Expand Down Expand Up @@ -179,7 +179,7 @@
},
"dpi:DocSpec": {
"stf:DocTypeIndic": "OECD1",
"stf:DocRefId": "OP_2023_123456789_1090c2c9-9448-4287-895a-edf79ef3981e_v1"
"stf:DocRefId": "OP_2024_123456789_1090c2c9-9448-4287-895a-edf79ef3981e_v1"
}
}
]
Expand Down
Loading
Loading