From f8bebd9bddd8b31415213f65369dbe42e51dcb6a Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sun, 12 Nov 2023 13:07:45 -0600 Subject: [PATCH 01/62] chore(v15 migration): removal of setup.py --- license.txt | 22 +++++++++++++++++++++- pyproject.toml | 17 +++++++++++++++++ requirements.txt | 1 - 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt diff --git a/license.txt b/license.txt index 2fdf7c7..d4ed839 100644 --- a/license.txt +++ b/license.txt @@ -1 +1,21 @@ -License: MIT \ No newline at end of file +MIT License + +Copyright (c) 2023 TI Sin Problemas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..174fc2d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "erpnext_mexico_compliance" +authors = [{ name = "TI Sin Problemas", email = "info@tisinproblemas.com" }] +description = "ERPNext app to serve as base to comply with help with Mexican Rules and Regulations" +requires-python = ">=3.10" +readme = "README.md" +dynamic = ["version"] +dependencies = [ + # "frappe~=15.0.0" # Installed and managed by bench. +] +[build-system] +requires = ["flit_core"] +build-backend = "flit_core.buildapi" + +# These dependencies are only installed when developer mode is enabled +[tool.bench.dev-dependencies] +# package_name = "~=1.1.0" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7668191..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -# frappe -- https://github.com/frappe/frappe is installed via 'bench init' \ No newline at end of file From bccfe25a104fee6fd068fd07dd2ad64e41551593 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sun, 12 Nov 2023 13:08:45 -0600 Subject: [PATCH 02/62] ci(v15 migration): update frappe base --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29c3d05..7be28c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,17 +70,20 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- + - name: Install MariaDB Client + run: sudo apt-get install mariadb-client-10.6 + - name: Setup run: | pip install frappe-bench - bench init --frappe-branch version-14 --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench - mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'" - mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" + bench init --frappe-branch version-15 --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench + mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'" + mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" - name: Install working-directory: /home/runner/frappe-bench run: | - bench get-app erpnext --branch version-14 + bench get-app erpnext --branch version-15 bench get-app erpnext_mexico_compliance $GITHUB_WORKSPACE bench setup requirements --dev bench new-site --db-root-password root --admin-password admin test_site From 68bb9b6e3d533d671312900284a03572e6bd9547 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sun, 12 Nov 2023 13:34:17 -0600 Subject: [PATCH 03/62] chore(install): remove deprecated import local file function --- .../fixtures/custom_field.json | 18 +++++ erpnext_mexico_compliance/install.py | 74 +------------------ 2 files changed, 22 insertions(+), 70 deletions(-) diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 8af4ab6..e604633 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -48,6 +48,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -101,6 +102,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -154,6 +156,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -207,6 +210,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -260,6 +264,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -313,6 +318,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -366,6 +372,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 1, "unique": 0, "width": null @@ -419,6 +426,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -472,6 +480,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -525,6 +534,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -578,6 +588,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -631,6 +642,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -684,6 +696,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -737,6 +750,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -790,6 +804,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -843,6 +858,7 @@ "report_hide": 0, "reqd": 0, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -896,6 +912,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null @@ -949,6 +966,7 @@ "report_hide": 0, "reqd": 1, "search_index": 0, + "sort_options": 0, "translatable": 0, "unique": 0, "width": null diff --git a/erpnext_mexico_compliance/install.py b/erpnext_mexico_compliance/install.py index 9936b9b..c0783d7 100644 --- a/erpnext_mexico_compliance/install.py +++ b/erpnext_mexico_compliance/install.py @@ -2,84 +2,18 @@ import os import frappe -from frappe.core.doctype.data_import.importer import Importer, ImportFile +from frappe.core.doctype.data_import.data_import import import_file from .hooks import app_name -# TODO: Replace with frappe.core.doctype.data_import.data_import.import_file -# when commit c6b1b02 is merged into version-14 -def import_local_file( - doctype, file_path, import_type, submit_after_import=False, console=False -): - """ - Import documents in from CSV or XLSX using data import. - - :param doctype: DocType to import - :param file_path: Path to .csv, .xls, or .xlsx file to import - :param import_type: One of "Insert" or "Update" - :param submit_after_import: Whether to submit documents after import - :param console: Set to true if this is to be used from command line. Will print errors or progress to stdout. - """ - - class LocalImportFile(ImportFile): - def read_file(self, file_path: str): - _, extn = super().read_file(file_path) - file_content = frappe.read_file(file_path, True) - return file_content, extn - - class LocalImporter(Importer): - def __init__( - self, - doctype, - data_import=None, - file_path=None, - import_type=None, - console=False, - ): - self.doctype = doctype - self.console = console - - self.data_import = data_import - if not self.data_import: - self.data_import = frappe.get_doc(doctype="Data Import") - if import_type: - self.data_import.import_type = import_type - - self.template_options = frappe.parse_json( - self.data_import.template_options or "{}" - ) - self.import_type = self.data_import.import_type - - self.import_file = LocalImportFile( - doctype, - file_path or data_import.google_sheets_url or data_import.import_file, - self.template_options, - self.import_type, - ) - - data_import = frappe.new_doc("Data Import") - data_import.submit_after_import = submit_after_import - data_import.import_type = ( - "Insert New Records" - if import_type.lower() == "insert" - else "Update Existing Records" - ) - - i = LocalImporter( - doctype=doctype, file_path=file_path, data_import=data_import, console=console - ) - i.import_data() - - def after_sync(): """Run tasks after migration sync""" print("Importing SAT Product or Service Key data...") fixtures_directory = "fixtures_csv" files = sorted(os.listdir(frappe.get_app_path(app_name, fixtures_directory))) for file in files: - print("\nLoading", f"{file}...") + print("Loading", f"{file}...") file_path = frappe.get_app_path(app_name, fixtures_directory, file) - import_local_file( - "SAT Product or Service Key", file_path, "Insert", console=True - ) + import_file("SAT Product or Service Key", file_path, "Insert", console=True) + print("") From 59ec0d9a440b367249c3b7b8017783b03f611d39 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Tue, 25 Jun 2024 23:35:28 -0600 Subject: [PATCH 04/62] feat: add app workspace --- .../mexico_compliance.json} | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) rename erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/{sat_catalogs/sat_catalogs.json => mexico_compliance/mexico_compliance.json} (67%) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/sat_catalogs/sat_catalogs.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json similarity index 67% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/sat_catalogs/sat_catalogs.json rename to erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json index b76ae89..52ea4e9 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/sat_catalogs/sat_catalogs.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json @@ -1,20 +1,25 @@ { "charts": [], - "content": "[{\"type\":\"header\",\"data\":{\"text\":\"SAT Catalogs\",\"col\":12}},{\"type\":\"card\",\"data\":{\"card_name\":\"Setup\",\"col\":4}}]", - "creation": "2022-12-06 17:25:51.574668", + "content": "[{\"id\":\"I0YRNY96Kv\",\"type\":\"header\",\"data\":{\"text\":\"Mexico Compliance\",\"col\":12}},{\"id\":\"L_y6Iz2ciM\",\"type\":\"card\",\"data\":{\"card_name\":\"Contabilidad\",\"col\":4}}]", + "creation": "2024-06-25 23:20:44.180369", + "custom_blocks": [], "docstatus": 0, "doctype": "Workspace", "for_user": "", "hide_custom": 0, - "icon": "table", + "icon": "organization", "idx": 0, - "label": "SAT Catalogs", + "indicator_color": "green", + "is_hidden": 0, + "label": "Mexico Compliance", "links": [ { + "description": "SAT Catalogs for accounting module", "hidden": 0, "is_query_report": 0, - "label": "Setup", + "label": "Accounting", "link_count": 5, + "link_type": "DocType", "onboard": 0, "type": "Card Break" }, @@ -69,16 +74,17 @@ "type": "Link" } ], - "modified": "2022-12-06 17:29:14.082879", + "modified": "2024-06-25 23:31:02.513334", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "SAT Catalogs", + "name": "Mexico Compliance", + "number_cards": [], "owner": "Administrator", - "parent_page": "Accounting", + "parent_page": "", "public": 1, "quick_lists": [], "roles": [], - "sequence_id": 31.0, + "sequence_id": 39.0, "shortcuts": [], - "title": "SAT Catalogs" -} \ No newline at end of file + "title": "Mexico Compliance" +} From 8397ee6ed35aff8874f1a4babf08e06eb565e3e3 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Tue, 25 Jun 2024 23:47:54 -0600 Subject: [PATCH 05/62] chore(install): add logger --- erpnext_mexico_compliance/install.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext_mexico_compliance/install.py b/erpnext_mexico_compliance/install.py index c0783d7..606a836 100644 --- a/erpnext_mexico_compliance/install.py +++ b/erpnext_mexico_compliance/install.py @@ -6,14 +6,14 @@ from .hooks import app_name +logger = frappe.logger("erpnext_mexico_compliance.install") def after_sync(): """Run tasks after migration sync""" - print("Importing SAT Product or Service Key data...") + logger.info("Importing SAT Product or Service Key data...") fixtures_directory = "fixtures_csv" files = sorted(os.listdir(frappe.get_app_path(app_name, fixtures_directory))) for file in files: - print("Loading", f"{file}...") + logger.info(f"Loading {file}...") file_path = frappe.get_app_path(app_name, fixtures_directory, file) import_file("SAT Product or Service Key", file_path, "Insert", console=True) - print("") From 18a6cd72241e96af9698f39cf7c673203cf680e5 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 26 Jun 2024 23:29:51 -0600 Subject: [PATCH 06/62] chore: update desktop strings --- .../workspace/mexico_compliance/mexico_compliance.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json index 52ea4e9..b3e095b 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json @@ -1,6 +1,6 @@ { "charts": [], - "content": "[{\"id\":\"I0YRNY96Kv\",\"type\":\"header\",\"data\":{\"text\":\"Mexico Compliance\",\"col\":12}},{\"id\":\"L_y6Iz2ciM\",\"type\":\"card\",\"data\":{\"card_name\":\"Contabilidad\",\"col\":4}}]", + "content": "[{\"id\":\"I0YRNY96Kv\",\"type\":\"header\",\"data\":{\"text\":\"Mexico Compliance\",\"col\":12}},{\"id\":\"2_c8TjCfdY\",\"type\":\"card\",\"data\":{\"card_name\":\"Accounting\",\"col\":4}}]", "creation": "2024-06-25 23:20:44.180369", "custom_blocks": [], "docstatus": 0, @@ -14,7 +14,7 @@ "label": "Mexico Compliance", "links": [ { - "description": "SAT Catalogs for accounting module", + "description": "SAT Catalogs for accounting", "hidden": 0, "is_query_report": 0, "label": "Accounting", @@ -74,7 +74,7 @@ "type": "Link" } ], - "modified": "2024-06-25 23:31:02.513334", + "modified": "2024-06-26 23:24:01.241491", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Mexico Compliance", @@ -87,4 +87,4 @@ "sequence_id": 39.0, "shortcuts": [], "title": "Mexico Compliance" -} +} \ No newline at end of file From eeb369ba4453f45c0d605c874b7b2e2c42a4dd18 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 27 Jun 2024 00:46:54 -0600 Subject: [PATCH 07/62] feat: rename SAT Payment Mode to SAT Payment Method --- .../__init__.py | 0 .../sat_payment_method.js} | 2 +- .../sat_payment_method.json | 95 +++++++++++++++++++ .../sat_payment_method.py} | 2 +- .../test_sat_payment_method.py} | 2 +- .../sat_payment_mode/sat_payment_mode.json | 94 ------------------ ...ment_mode.json => sat_payment_method.json} | 44 ++++----- .../translations/es-MX.csv | 4 +- erpnext_mexico_compliance/translations/es.csv | 4 +- 9 files changed, 124 insertions(+), 123 deletions(-) rename erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/{sat_payment_mode => sat_payment_method}/__init__.py (100%) rename erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/{sat_payment_mode/sat_payment_mode.js => sat_payment_method/sat_payment_method.js} (78%) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json rename erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/{sat_payment_mode/sat_payment_mode.py => sat_payment_method/sat_payment_method.py} (90%) rename erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/{sat_payment_mode/test_sat_payment_mode.py => sat_payment_method/test_sat_payment_method.py} (76%) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.json rename erpnext_mexico_compliance/fixtures/{sat_payment_mode.json => sat_payment_method.json} (79%) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/__init__.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/__init__.py similarity index 100% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/__init__.py rename to erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/__init__.py diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.js b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.js similarity index 78% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.js rename to erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.js index 8bdb74b..b360765 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.js +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.js @@ -1,7 +1,7 @@ // Copyright (c) 2022, TI Sin Problemas and contributors // For license information, please see license.txt -frappe.ui.form.on('SAT Payment Mode', { +frappe.ui.form.on('SAT Payment Method', { // refresh: function(frm) { // } diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json new file mode 100644 index 0000000..a9e027a --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json @@ -0,0 +1,95 @@ +{ + "actions": [], + "autoname": "field:key", + "creation": "2022-12-19 10:40:09.916493", + "default_view": "List", + "description": "Indicates the form in which a payment was made, in accordance with the catalog of forms of payment", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "enabled", + "section_break", + "key", + "key_name", + "column_break", + "description" + ], + "fields": [ + { + "default": "1", + "fieldname": "enabled", + "fieldtype": "Check", + "label": "Enabled" + }, + { + "fieldname": "section_break", + "fieldtype": "Section Break" + }, + { + "fieldname": "key", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Key", + "length": 2, + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "key_name", + "fieldtype": "Data", + "label": "Key Name", + "read_only": 1 + }, + { + "fieldname": "column_break", + "fieldtype": "Column Break" + }, + { + "fieldname": "description", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Description", + "reqd": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-06-27 00:39:59.933741", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "SAT Payment Method", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "show_title_field_in_link": 1, + "sort_field": "key_name", + "sort_order": "ASC", + "states": [], + "title_field": "key_name" +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.py similarity index 90% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.py rename to erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.py index fbffa27..445faaa 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.py @@ -5,7 +5,7 @@ from frappe.model.document import Document -class SATPaymentMode(Document): +class SATPaymentMethod(Document): """SAT's Payment Mode (Forma de pago)""" def before_save(self): diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/test_sat_payment_mode.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/test_sat_payment_method.py similarity index 76% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/test_sat_payment_mode.py rename to erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/test_sat_payment_method.py index dfadba4..1730533 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/test_sat_payment_mode.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/test_sat_payment_method.py @@ -5,5 +5,5 @@ from frappe.tests.utils import FrappeTestCase -class TestSATPaymentMode(FrappeTestCase): +class TestSATPaymentMethod(FrappeTestCase): pass diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.json deleted file mode 100644 index edc8860..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_mode/sat_payment_mode.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "actions": [], - "autoname": "field:key", - "creation": "2022-12-19 10:40:09.916493", - "default_view": "List", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "enabled", - "section_break", - "key", - "key_name", - "column_break", - "description" - ], - "fields": [ - { - "default": "1", - "fieldname": "enabled", - "fieldtype": "Check", - "label": "Enabled" - }, - { - "fieldname": "section_break", - "fieldtype": "Section Break" - }, - { - "fieldname": "key", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Key", - "length": 2, - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "key_name", - "fieldtype": "Data", - "label": "Key Name", - "read_only": 1 - }, - { - "fieldname": "column_break", - "fieldtype": "Column Break" - }, - { - "fieldname": "description", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Description", - "reqd": 1 - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2022-12-19 10:40:09.916493", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "SAT Payment Mode", - "naming_rule": "By fieldname", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - }, - { - "create": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "share": 1, - "write": 1 - } - ], - "quick_entry": 1, - "show_title_field_in_link": 1, - "sort_field": "key_name", - "sort_order": "ASC", - "states": [], - "title_field": "key_name" -} diff --git a/erpnext_mexico_compliance/fixtures/sat_payment_mode.json b/erpnext_mexico_compliance/fixtures/sat_payment_method.json similarity index 79% rename from erpnext_mexico_compliance/fixtures/sat_payment_mode.json rename to erpnext_mexico_compliance/fixtures/sat_payment_method.json index e93890c..6344e4f 100644 --- a/erpnext_mexico_compliance/fixtures/sat_payment_mode.json +++ b/erpnext_mexico_compliance/fixtures/sat_payment_method.json @@ -1,7 +1,7 @@ [ { "description": "Efectivo", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "01", "key_name": "01 - Efectivo", @@ -9,7 +9,7 @@ }, { "description": "Cheque nominativo", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "02", "key_name": "02 - Cheque nominativo", @@ -17,7 +17,7 @@ }, { "description": "Transferencia electrónica de fondos", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "03", "key_name": "03 - Transferencia electrónica de fondos", @@ -25,7 +25,7 @@ }, { "description": "Tarjeta de crédito", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "04", "key_name": "04 - Tarjeta de crédito", @@ -33,7 +33,7 @@ }, { "description": "Monedero electrónico", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "05", "key_name": "05 - Monedero electrónico", @@ -41,7 +41,7 @@ }, { "description": "Dinero electrónico", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "06", "key_name": "06 - Dinero electrónico", @@ -49,7 +49,7 @@ }, { "description": "Vales de despensa", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "08", "key_name": "08 - Vales de despensa", @@ -57,7 +57,7 @@ }, { "description": "Dación en pago", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "12", "key_name": "12 - Dación en pago", @@ -65,7 +65,7 @@ }, { "description": "Pago por subrogación", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "13", "key_name": "13 - Pago por subrogación", @@ -73,7 +73,7 @@ }, { "description": "Pago por consignación", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "14", "key_name": "14 - Pago por consignación", @@ -81,7 +81,7 @@ }, { "description": "Condonación", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "15", "key_name": "15 - Condonación", @@ -89,7 +89,7 @@ }, { "description": "Compensación", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "17", "key_name": "17 - Compensación", @@ -97,7 +97,7 @@ }, { "description": "Novación", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "23", "key_name": "23 - Novación", @@ -105,7 +105,7 @@ }, { "description": "Confusión", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "24", "key_name": "24 - Confusión", @@ -113,7 +113,7 @@ }, { "description": "Remisión de deuda", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "25", "key_name": "25 - Remisión de deuda", @@ -121,7 +121,7 @@ }, { "description": "Prescripción o caducidad", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "26", "key_name": "26 - Prescripción o caducidad", @@ -129,7 +129,7 @@ }, { "description": "A satisfacción del acreedor", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "27", "key_name": "27 - A satisfacción del acreedor", @@ -137,7 +137,7 @@ }, { "description": "Tarjeta de débito", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "28", "key_name": "28 - Tarjeta de débito", @@ -145,7 +145,7 @@ }, { "description": "Tarjeta de servicios", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "29", "key_name": "29 - Tarjeta de servicios", @@ -153,7 +153,7 @@ }, { "description": "Aplicación de anticipos", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "30", "key_name": "30 - Aplicación de anticipos", @@ -161,7 +161,7 @@ }, { "description": "Intermediario pagos", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "31", "key_name": "31 - Intermediario pagos", @@ -169,7 +169,7 @@ }, { "description": "Por definir", - "doctype": "SAT Payment Mode", + "doctype": "SAT Payment Method", "enabled": 1, "key": "99", "key_name": "99 - Por definir", diff --git a/erpnext_mexico_compliance/translations/es-MX.csv b/erpnext_mexico_compliance/translations/es-MX.csv index c830548..09c3d45 100644 --- a/erpnext_mexico_compliance/translations/es-MX.csv +++ b/erpnext_mexico_compliance/translations/es-MX.csv @@ -6,8 +6,8 @@ Key Name,Clave Nombre Mexico Compliance,Cumplimiento Mexicano SAT Catalogs,Catálogos del SAT SAT CFDI Use,Uso de CFDI SAT -SAT Payment Method,Método de Pago SAT -SAT Payment Mode,Forma de Pago SAT +SAT Payment Option,Método de Pago SAT +SAT Payment Method,Forma de Pago SAT SAT Product or Service Key,Clave SAT de Producto o Servicio SAT Tax System,Régimen Fiscal SAT SAT UOM Key,Clave SAT de UDM diff --git a/erpnext_mexico_compliance/translations/es.csv b/erpnext_mexico_compliance/translations/es.csv index c830548..09c3d45 100644 --- a/erpnext_mexico_compliance/translations/es.csv +++ b/erpnext_mexico_compliance/translations/es.csv @@ -6,8 +6,8 @@ Key Name,Clave Nombre Mexico Compliance,Cumplimiento Mexicano SAT Catalogs,Catálogos del SAT SAT CFDI Use,Uso de CFDI SAT -SAT Payment Method,Método de Pago SAT -SAT Payment Mode,Forma de Pago SAT +SAT Payment Option,Método de Pago SAT +SAT Payment Method,Forma de Pago SAT SAT Product or Service Key,Clave SAT de Producto o Servicio SAT Tax System,Régimen Fiscal SAT SAT UOM Key,Clave SAT de UDM From 775318b854850d6a1511d24aefc1c78e6822c0ad Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 27 Jun 2024 01:23:45 -0600 Subject: [PATCH 08/62] feat: rename SAT Payment Mode custom field --- .../custom/mode_of_payment.json | 159 ++++++++++++++++++ .../fixtures/custom_field.json | 108 ------------ 2 files changed, 159 insertions(+), 108 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json new file mode 100644 index 0000000..7924cbb --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json @@ -0,0 +1,159 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-26 23:30:54.165903", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Mode of Payment", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 5, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "accounts", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:11:37.701411", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Mode of Payment-cfdi", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-26 23:30:54.238538", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Mode of Payment", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "sat_payment_method", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 6, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Payment Method", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 15:58:19.773242", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Mode of Payment-sat_payment_method", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Payment Method", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Mode of Payment", + "links": [], + "property_setters": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-06-27 01:01:30.664001", + "default_value": null, + "doc_type": "Mode of Payment", + "docstatus": 0, + "doctype_or_field": "DocType", + "field_name": null, + "idx": 0, + "is_system_generated": 0, + "modified": "2024-06-27 01:01:30.664001", + "modified_by": "Administrator", + "module": null, + "name": "Mode of Payment-main-field_order", + "owner": "Administrator", + "property": "field_order", + "property_type": "Data", + "row_name": null, + "value": "[\"mode_of_payment\", \"enabled\", \"type\", \"accounts\", \"cfdi\", \"sat_payment_method\"]" + } + ], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index e604633..907ee76 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -107,114 +107,6 @@ "unique": 0, "width": null }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Mode of Payment", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi_40", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "accounts", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI 4.0", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:11:37.701411", - "module": "ERPNext Mexico Compliance", - "name": "Mode of Payment-cfdi_40", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Mode of Payment", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "sat_payment_mode", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cfdi_40", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Payment Mode", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 15:58:19.773242", - "module": "ERPNext Mexico Compliance", - "name": "Mode of Payment-sat_payment_mode", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Payment Mode", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, From 7d7b176d539f395c52945e63a08f66a319983da4 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 27 Jun 2024 02:19:07 -0600 Subject: [PATCH 09/62] feat: add SAT Payment Option doctype --- .../sat_payment_method.json | 10 +-- .../doctype/sat_payment_option/__init__.py | 0 .../sat_payment_option/sat_payment_option.js | 8 ++ .../sat_payment_option.json | 90 +++++++++++++++++++ .../sat_payment_option/sat_payment_option.py | 13 +++ .../test_sat_payment_option.py | 9 ++ .../fixtures/sat_payment_option.json | 18 ++++ 7 files changed, 141 insertions(+), 7 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/__init__.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.js create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/test_sat_payment_option.py create mode 100644 erpnext_mexico_compliance/fixtures/sat_payment_option.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json index a9e027a..1ee6cdd 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json @@ -8,11 +8,10 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ - "enabled", "section_break", + "enabled", "key", "key_name", - "column_break", "description" ], "fields": [ @@ -41,10 +40,6 @@ "label": "Key Name", "read_only": 1 }, - { - "fieldname": "column_break", - "fieldtype": "Column Break" - }, { "fieldname": "description", "fieldtype": "Data", @@ -53,9 +48,10 @@ "reqd": 1 } ], + "hide_toolbar": 1, "index_web_pages_for_search": 1, "links": [], - "modified": "2024-06-27 00:39:59.933741", + "modified": "2024-06-27 01:55:39.377966", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "SAT Payment Method", diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/__init__.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.js b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.js new file mode 100644 index 0000000..3f7d193 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.js @@ -0,0 +1,8 @@ +// Copyright (c) 2024, TI Sin Problemas and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("SAT Payment Option", { +// refresh(frm) { + +// }, +// }); diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json new file mode 100644 index 0000000..d38d37b --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json @@ -0,0 +1,90 @@ +{ + "actions": [], + "autoname": "field:key", + "creation": "2024-06-27 01:29:40.855867", + "default_view": "List", + "description": "Indicates when the payment of the operation was made, in accordance with the SAT catalog of payment methods", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "section_break_yk87", + "enabled", + "key", + "key_name", + "description" + ], + "fields": [ + { + "fieldname": "section_break_yk87", + "fieldtype": "Section Break" + }, + { + "default": "1", + "fieldname": "enabled", + "fieldtype": "Check", + "label": "Enabled" + }, + { + "fieldname": "key", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Key", + "length": 3, + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "key_name", + "fieldtype": "Data", + "label": "Key Name", + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Description", + "reqd": 1 + } + ], + "hide_toolbar": 1, + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-06-27 01:57:36.934666", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "SAT Payment Option", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "show_title_field_in_link": 1, + "sort_field": "key_name", + "sort_order": "ASC", + "states": [], + "title_field": "key_name" +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.py new file mode 100644 index 0000000..2054c97 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.py @@ -0,0 +1,13 @@ +# Copyright (c) 2024, TI Sin Problemas and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class SATPaymentOption(Document): + """SAT's Payment Option (Método de pago)""" + + def before_save(self): + """Set DocType key name""" + self.key_name = f"{self.key} - {self.description}"[:140] diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/test_sat_payment_option.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/test_sat_payment_option.py new file mode 100644 index 0000000..0ebe5a9 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/test_sat_payment_option.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, TI Sin Problemas and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestSATPaymentOption(FrappeTestCase): + pass diff --git a/erpnext_mexico_compliance/fixtures/sat_payment_option.json b/erpnext_mexico_compliance/fixtures/sat_payment_option.json new file mode 100644 index 0000000..92fd10c --- /dev/null +++ b/erpnext_mexico_compliance/fixtures/sat_payment_option.json @@ -0,0 +1,18 @@ +[ + { + "description": "Pago en parcialidades o diferido", + "doctype": "SAT Payment Option", + "enabled": 1, + "key": "PPD", + "key_name": "PPD - Pago en parcialidades o diferido", + "name": "PPD" + }, + { + "description": "Pago en una sola exhibición", + "doctype": "SAT Payment Option", + "enabled": 1, + "key": "PUE", + "key_name": "PUE - Pago en una sola exhibición", + "name": "PUE" + } +] \ No newline at end of file From b5be12d52a448ad8b7e91a893c7262e3967993e5 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 27 Jun 2024 19:25:33 -0600 Subject: [PATCH 10/62] feat: add SAT Payment Option to workspace --- .../mexico_compliance/mexico_compliance.json | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json index b3e095b..bd5fd26 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json @@ -66,15 +66,25 @@ { "hidden": 0, "is_query_report": 0, - "label": "SAT Payment Mode", + "label": "SAT Payment Method", "link_count": 0, - "link_to": "SAT Payment Mode", + "link_to": "SAT Payment Method", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "SAT Payment Option", + "link_count": 0, + "link_to": "SAT Payment Option", "link_type": "DocType", "onboard": 0, "type": "Link" } ], - "modified": "2024-06-26 23:24:01.241491", + "modified": "2024-06-27 19:22:58.830059", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Mexico Compliance", From 591bcd93a282f83766a7aeb39df5a41fec2e894e Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 27 Jun 2024 19:26:03 -0600 Subject: [PATCH 11/62] chore: add SAT Payment Option fixture --- .../doctype/sat_payment_option/sat_payment_option.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json index d38d37b..4cf7c17 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json @@ -50,7 +50,7 @@ "hide_toolbar": 1, "index_web_pages_for_search": 1, "links": [], - "modified": "2024-06-27 01:57:36.934666", + "modified": "2024-06-27 02:29:23.445119", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "SAT Payment Option", From 3b468d021e38f6fce6c5a74b17f897c797d6713f Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 27 Jun 2024 23:05:11 -0600 Subject: [PATCH 12/62] chore: remove sales invoice item custom fields from fixtures --- .../custom/sales_invoice_item.json | 135 ++++++++++++++++++ .../fixtures/custom_field.json | 108 -------------- 2 files changed, 135 insertions(+), 108 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json new file mode 100644 index 0000000..098d86a --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json @@ -0,0 +1,135 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-27 19:09:40.594044", + "default": null, + "depends_on": "", + "description": null, + "docstatus": 0, + "dt": "Sales Invoice Item", + "fetch_from": "item_code.sat_product_or_service_key", + "fetch_if_empty": 1, + "fieldname": "sat_product_or_service_key", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 104, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi_40", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Product or Service Key", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "", + "modified": "2022-12-19 16:14:48.913990", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice Item-sat_product_or_service_key", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Product or Service Key", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "eval: doc.item_code", + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-27 19:09:40.387700", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi_40", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 103, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "project", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI 4.0", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:14:38.888661", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice Item-cfdi_40", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Sales Invoice Item", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 907ee76..a0b11d0 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -323,114 +323,6 @@ "unique": 0, "width": null }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Sales Invoice Item", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi_40", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "project", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI 4.0", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:14:38.888661", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice Item-cfdi_40", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": "", - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Sales Invoice Item", - "fetch_from": "item_code.sat_product_or_service_key", - "fetch_if_empty": 1, - "fieldname": "sat_product_or_service_key", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cfdi_40", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Product or Service Key", - "length": 0, - "mandatory_depends_on": "", - "modified": "2022-12-19 16:14:48.913990", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice Item-sat_product_or_service_key", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Product or Service Key", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": "eval: doc.item_code", - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, From e970f36d5889e9fa9d8d4ce496e39c66503e8f42 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 27 Jun 2024 23:26:07 -0600 Subject: [PATCH 13/62] chore: remove sales invoice custom fields from fixtures --- .../custom/sales_invoice.json | 387 ++++++++++++++++++ .../fixtures/custom_field.json | 324 --------------- 2 files changed, 387 insertions(+), 324 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json new file mode 100644 index 0000000..0680a9f --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json @@ -0,0 +1,387 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-27 19:09:42.668602", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "sat_cfdi_use", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 211, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_compliance_sat_payment_option", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT CFDI Use", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-06-27 19:53:20.818669", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-sat_cfdi_use", + "no_copy": 0, + "non_negative": 0, + "options": "SAT CFDI Use", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-27 19:47:46.258744", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_compliance_sat_payment_option", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 210, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi_40", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Payment Option", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-06-27 19:53:20.792645", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_sat_payment_option", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Payment Option", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-27 19:09:41.796187", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": "mode_of_payment.sat_payment_method", + "fetch_if_empty": 0, + "fieldname": "sat_payment_mode", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 215, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mode_of_payment", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Payment Method", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 21:38:43.086168", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-sat_payment_mode", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-27 19:09:41.283106", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi_40", + "fieldtype": "Tab Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 210, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "connections_tab", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:54:24.912637", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-cfdi_40", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-27 19:09:42.072016", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "column_break_206", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 212, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "sat_cfdi_use", + "is_system_generated": 0, + "is_virtual": 0, + "label": null, + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:53:24.995485", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-column_break_206", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-06-27 19:09:41.529406", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 213, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "column_break_206", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Mode of Payment", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:24:16.564574", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-mode_of_payment", + "no_copy": 0, + "non_negative": 0, + "options": "Mode of Payment", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "", + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Sales Invoice", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index a0b11d0..427f398 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -430,329 +430,5 @@ "translatable": 0, "unique": 0, "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi_40", - "fieldtype": "Tab Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "connections_tab", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI 4.0", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:54:24.912637", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-cfdi_40", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cfdi_40", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Mode of Payment", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:24:16.564574", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-mode_of_payment", - "no_copy": 0, - "non_negative": 0, - "options": "Mode of Payment", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": "", - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Sales Invoice", - "fetch_from": "mode_of_payment.sat_payment_mode", - "fetch_if_empty": 0, - "fieldname": "sat_payment_mode", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mode_of_payment", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Payment Mode", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 21:38:43.086168", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-sat_payment_mode", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "column_break_206", - "fieldtype": "Column Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "sat_payment_mode", - "is_system_generated": 0, - "is_virtual": 0, - "label": null, - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:53:24.995485", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-column_break_206", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "sat_payment_method", - "fieldtype": "Select", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "column_break_206", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Payment Method", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:43:21.441790", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-sat_payment_method", - "no_copy": 0, - "non_negative": 0, - "options": "\nPUE - Pago en una sola exhibición\nPPD - Pago en parcialidades o diferido", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "sat_cfdi_use", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "sat_payment_method", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT CFDI Use", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:43:34.645756", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-sat_cfdi_use", - "no_copy": 0, - "non_negative": 0, - "options": "SAT CFDI Use", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null } ] \ No newline at end of file From a6ce45c4230270296dde0506e38001d38b4343ed Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Mon, 29 Jul 2024 23:39:45 -0600 Subject: [PATCH 14/62] chore: add sat_payment_method to quick entry --- .../erpnext_mexico_compliance/custom/mode_of_payment.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json index 7924cbb..d5ca439 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json @@ -5,7 +5,7 @@ "_comments": null, "_liked_by": null, "_user_tags": null, - "allow_in_quick_entry": 0, + "allow_in_quick_entry": 1, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -68,7 +68,7 @@ "_comments": null, "_liked_by": null, "_user_tags": null, - "allow_in_quick_entry": 0, + "allow_in_quick_entry": 1, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -144,7 +144,7 @@ "field_name": null, "idx": 0, "is_system_generated": 0, - "modified": "2024-06-27 01:01:30.664001", + "modified": "2024-07-24 23:36:47.697799", "modified_by": "Administrator", "module": null, "name": "Mode of Payment-main-field_order", From 5b9e5cd6609e8968b7ce37422ff9a7702cce1820 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Tue, 30 Jul 2024 00:26:14 -0600 Subject: [PATCH 15/62] chore: reorder sales invoice item custom fields --- .../custom/sales_invoice_item.json | 88 ++++++++++++------- 1 file changed, 56 insertions(+), 32 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json index 098d86a..70525c7 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json @@ -8,44 +8,44 @@ "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, - "collapsible": 0, + "collapsible": 1, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:40.594044", + "creation": "2024-07-30 00:21:39.107146", "default": null, - "depends_on": "", + "depends_on": null, "description": null, "docstatus": 0, "dt": "Sales Invoice Item", - "fetch_from": "item_code.sat_product_or_service_key", - "fetch_if_empty": 1, - "fieldname": "sat_product_or_service_key", - "fieldtype": "Link", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_cfdi", + "fieldtype": "Section Break", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 104, + "idx": 103, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "cfdi_40", + "insert_after": "project", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT Product or Service Key", + "label": "CFDI", "length": 0, "link_filters": null, - "mandatory_depends_on": "", - "modified": "2022-12-19 16:14:48.913990", + "mandatory_depends_on": null, + "modified": "2024-07-30 00:21:39.107146", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice Item-sat_product_or_service_key", + "name": "Sales Invoice Item-custom_cfdi", "no_copy": 0, "non_negative": 0, - "options": "SAT Product or Service Key", + "options": null, "owner": "Administrator", "permlevel": 0, "precision": "", @@ -53,9 +53,9 @@ "print_hide_if_no_value": 0, "print_width": null, "read_only": 0, - "read_only_depends_on": "eval: doc.item_code", + "read_only_depends_on": null, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -74,41 +74,41 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:40.387700", + "creation": "2024-06-27 19:09:40.594044", "default": null, - "depends_on": null, + "depends_on": "", "description": null, "docstatus": 0, "dt": "Sales Invoice Item", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi_40", - "fieldtype": "Section Break", + "fetch_from": "item_code.sat_product_or_service_key", + "fetch_if_empty": 1, + "fieldname": "sat_product_or_service_key", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 103, + "idx": 104, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "project", + "insert_after": "custom_cfdi", "is_system_generated": 0, "is_virtual": 0, - "label": "CFDI 4.0", + "label": "SAT Product or Service Key", "length": 0, "link_filters": null, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:14:38.888661", + "mandatory_depends_on": "", + "modified": "2022-12-19 16:14:48.913990", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice Item-cfdi_40", + "name": "Sales Invoice Item-sat_product_or_service_key", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "SAT Product or Service Key", "owner": "Administrator", "permlevel": 0, "precision": "", @@ -116,9 +116,9 @@ "print_hide_if_no_value": 0, "print_width": null, "read_only": 0, - "read_only_depends_on": null, + "read_only_depends_on": "eval: doc.item_code", "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -130,6 +130,30 @@ "custom_perms": [], "doctype": "Sales Invoice Item", "links": [], - "property_setters": [], + "property_setters": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-30 00:21:38.837880", + "default_value": null, + "doc_type": "Sales Invoice Item", + "docstatus": 0, + "doctype_or_field": "DocType", + "field_name": null, + "idx": 0, + "is_system_generated": 0, + "modified": "2024-07-30 00:21:38.837880", + "modified_by": "Administrator", + "module": null, + "name": "Sales Invoice Item-main-field_order", + "owner": "Administrator", + "property": "field_order", + "property_type": "Data", + "row_name": null, + "value": "[\"barcode\", \"has_item_scanned\", \"item_code\", \"col_break1\", \"item_name\", \"customer_item_code\", \"description_section\", \"description\", \"item_group\", \"brand\", \"image_section\", \"image\", \"image_view\", \"quantity_and_rate\", \"qty\", \"stock_uom\", \"col_break2\", \"uom\", \"conversion_factor\", \"stock_qty\", \"section_break_17\", \"price_list_rate\", \"base_price_list_rate\", \"discount_and_margin\", \"margin_type\", \"margin_rate_or_amount\", \"rate_with_margin\", \"column_break_19\", \"discount_percentage\", \"discount_amount\", \"base_rate_with_margin\", \"section_break1\", \"rate\", \"amount\", \"item_tax_template\", \"col_break3\", \"base_rate\", \"base_amount\", \"pricing_rules\", \"stock_uom_rate\", \"is_free_item\", \"grant_commission\", \"section_break_21\", \"net_rate\", \"net_amount\", \"column_break_24\", \"base_net_rate\", \"base_net_amount\", \"drop_ship\", \"delivered_by_supplier\", \"accounting\", \"income_account\", \"is_fixed_asset\", \"asset\", \"finance_book\", \"col_break4\", \"expense_account\", \"discount_account\", \"deferred_revenue\", \"deferred_revenue_account\", \"service_stop_date\", \"enable_deferred_revenue\", \"column_break_50\", \"service_start_date\", \"service_end_date\", \"section_break_18\", \"weight_per_unit\", \"total_weight\", \"column_break_21\", \"weight_uom\", \"warehouse_and_reference\", \"warehouse\", \"target_warehouse\", \"quality_inspection\", \"pick_serial_and_batch\", \"serial_and_batch_bundle\", \"use_serial_batch_fields\", \"col_break5\", \"allow_zero_valuation_rate\", \"incoming_rate\", \"item_tax_rate\", \"actual_batch_qty\", \"actual_qty\", \"section_break_eoec\", \"serial_no\", \"column_break_ytgd\", \"batch_no\", \"edit_references\", \"sales_order\", \"so_detail\", \"sales_invoice_item\", \"column_break_74\", \"delivery_note\", \"dn_detail\", \"delivered_qty\", \"internal_transfer_section\", \"purchase_order\", \"column_break_92\", \"purchase_order_item\", \"accounting_dimensions_section\", \"cost_center\", \"dimension_col_break\", \"project\", \"cfdi_section\", \"sat_product_or_service_key\", \"section_break_54\", \"page_break\"]" + } + ], "sync_on_migrate": 1 } \ No newline at end of file From 279f39b2b60146f43b1bd75ccc19893ac283b574 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 1 Aug 2024 00:00:52 -0600 Subject: [PATCH 16/62] feat: update sales invoice fields --- .../custom/sales_invoice.json | 158 ++++++++++-------- 1 file changed, 91 insertions(+), 67 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json index 0680a9f..dc29f7d 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json @@ -11,7 +11,7 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:42.668602", + "creation": "2024-06-27 19:09:41.283106", "default": null, "depends_on": null, "description": null, @@ -19,33 +19,33 @@ "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "sat_cfdi_use", - "fieldtype": "Link", + "fieldname": "cfdi_40", + "fieldtype": "Tab Break", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 211, + "idx": 210, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "mx_compliance_sat_payment_option", + "insert_after": "connections_tab", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT CFDI Use", + "label": "CFDI", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-06-27 19:53:20.818669", + "modified": "2022-12-19 16:54:24.912637", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-sat_cfdi_use", + "name": "Sales Invoice-cfdi_40", "no_copy": 0, "non_negative": 0, - "options": "SAT CFDI Use", + "options": null, "owner": "Administrator", "permlevel": 0, "precision": "", @@ -55,7 +55,7 @@ "read_only": 0, "read_only_depends_on": null, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -74,7 +74,7 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:47:46.258744", + "creation": "2024-06-27 19:09:42.072016", "default": null, "depends_on": null, "description": null, @@ -82,33 +82,33 @@ "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "mx_compliance_sat_payment_option", - "fieldtype": "Link", + "fieldname": "column_break_206", + "fieldtype": "Column Break", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 210, + "idx": 212, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "cfdi_40", + "insert_after": "sat_cfdi_use", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT Payment Option", + "label": null, "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-06-27 19:53:20.792645", + "modified": "2022-12-19 16:53:24.995485", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_sat_payment_option", + "name": "Sales Invoice-column_break_206", "no_copy": 0, "non_negative": 0, - "options": "SAT Payment Option", + "options": null, "owner": "Administrator", "permlevel": 0, "precision": "", @@ -118,7 +118,7 @@ "read_only": 0, "read_only_depends_on": null, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -137,51 +137,51 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:41.796187", + "creation": "2024-06-27 19:47:46.258744", "default": null, "depends_on": null, "description": null, "docstatus": 0, "dt": "Sales Invoice", - "fetch_from": "mode_of_payment.sat_payment_method", + "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "sat_payment_mode", - "fieldtype": "Data", + "fieldname": "mx_compliance_sat_payment_option", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 215, + "idx": 210, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "mode_of_payment", + "insert_after": "cfdi_40", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT Payment Method", + "label": "SAT Payment Option", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 21:38:43.086168", + "modified": "2024-06-27 19:53:20.792645", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-sat_payment_mode", + "name": "Sales Invoice-custom_sat_payment_option", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "SAT Payment Option", "owner": "Administrator", "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -200,7 +200,7 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:41.283106", + "creation": "2024-06-27 19:09:41.529406", "default": null, "depends_on": null, "description": null, @@ -208,33 +208,33 @@ "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "cfdi_40", - "fieldtype": "Tab Break", + "fieldname": "mode_of_payment", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 210, + "idx": 213, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "connections_tab", + "insert_after": "column_break_206", "is_system_generated": 0, "is_virtual": 0, - "label": "CFDI", + "label": "Mode of Payment", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 16:54:24.912637", + "modified": "2022-12-19 16:24:16.564574", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-cfdi_40", + "name": "Sales Invoice-mode_of_payment", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "Mode of Payment", "owner": "Administrator", "permlevel": 0, "precision": "", @@ -242,9 +242,9 @@ "print_hide_if_no_value": 0, "print_width": null, "read_only": 0, - "read_only_depends_on": null, + "read_only_depends_on": "", "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -263,7 +263,7 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:42.072016", + "creation": "2024-06-27 19:09:42.668602", "default": null, "depends_on": null, "description": null, @@ -271,33 +271,33 @@ "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "column_break_206", - "fieldtype": "Column Break", + "fieldname": "sat_cfdi_use", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 212, + "idx": 211, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "sat_cfdi_use", + "insert_after": "mx_compliance_sat_payment_option", "is_system_generated": 0, "is_virtual": 0, - "label": null, + "label": "SAT CFDI Use", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 16:53:24.995485", + "modified": "2024-06-27 19:53:20.818669", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-column_break_206", + "name": "Sales Invoice-sat_cfdi_use", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "SAT CFDI Use", "owner": "Administrator", "permlevel": 0, "precision": "", @@ -307,7 +307,7 @@ "read_only": 0, "read_only_depends_on": null, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -326,51 +326,51 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:41.529406", + "creation": "2024-06-27 19:09:41.796187", "default": null, "depends_on": null, "description": null, "docstatus": 0, "dt": "Sales Invoice", - "fetch_from": null, + "fetch_from": "mode_of_payment.sat_payment_method", "fetch_if_empty": 0, - "fieldname": "mode_of_payment", - "fieldtype": "Link", + "fieldname": "sat_payment_mode", + "fieldtype": "Data", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 213, + "idx": 215, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "column_break_206", + "insert_after": "mode_of_payment", "is_system_generated": 0, "is_virtual": 0, - "label": "Mode of Payment", + "label": "SAT Payment Method", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 16:24:16.564574", + "modified": "2022-12-19 21:38:43.086168", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-mode_of_payment", + "name": "Sales Invoice-sat_payment_mode", "no_copy": 0, "non_negative": 0, - "options": "Mode of Payment", + "options": null, "owner": "Administrator", "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, - "read_only_depends_on": "", + "read_only": 1, + "read_only_depends_on": null, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -382,6 +382,30 @@ "custom_perms": [], "doctype": "Sales Invoice", "links": [], - "property_setters": [], + "property_setters": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-06-27 19:47:45.732836", + "default_value": null, + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype_or_field": "DocType", + "field_name": null, + "idx": 0, + "is_system_generated": 0, + "modified": "2024-06-27 19:47:45.732836", + "modified_by": "Administrator", + "module": null, + "name": "Sales Invoice-main-field_order", + "owner": "Administrator", + "property": "field_order", + "property_type": "Data", + "row_name": null, + "value": "[\"customer_section\", \"title\", \"naming_series\", \"customer\", \"customer_name\", \"tax_id\", \"company\", \"company_tax_id\", \"column_break1\", \"posting_date\", \"posting_time\", \"set_posting_time\", \"due_date\", \"column_break_14\", \"is_pos\", \"pos_profile\", \"is_consolidated\", \"is_return\", \"return_against\", \"update_outstanding_for_self\", \"update_billed_amount_in_sales_order\", \"update_billed_amount_in_delivery_note\", \"is_debit_note\", \"amended_from\", \"accounting_dimensions_section\", \"cost_center\", \"dimension_col_break\", \"project\", \"currency_and_price_list\", \"currency\", \"conversion_rate\", \"column_break2\", \"selling_price_list\", \"price_list_currency\", \"plc_conversion_rate\", \"ignore_pricing_rule\", \"items_section\", \"scan_barcode\", \"update_stock\", \"column_break_39\", \"set_warehouse\", \"set_target_warehouse\", \"section_break_42\", \"items\", \"section_break_30\", \"total_qty\", \"total_net_weight\", \"column_break_32\", \"base_total\", \"base_net_total\", \"column_break_52\", \"total\", \"net_total\", \"taxes_section\", \"tax_category\", \"taxes_and_charges\", \"column_break_38\", \"shipping_rule\", \"column_break_55\", \"incoterm\", \"named_place\", \"section_break_40\", \"taxes\", \"section_break_43\", \"base_total_taxes_and_charges\", \"column_break_47\", \"total_taxes_and_charges\", \"totals\", \"base_grand_total\", \"base_rounding_adjustment\", \"base_rounded_total\", \"base_in_words\", \"column_break5\", \"grand_total\", \"rounding_adjustment\", \"use_company_roundoff_cost_center\", \"rounded_total\", \"in_words\", \"total_advance\", \"outstanding_amount\", \"disable_rounded_total\", \"section_break_49\", \"apply_discount_on\", \"base_discount_amount\", \"is_cash_or_non_trade_discount\", \"additional_discount_account\", \"column_break_51\", \"additional_discount_percentage\", \"discount_amount\", \"sec_tax_breakup\", \"other_charges_calculation\", \"pricing_rule_details\", \"pricing_rules\", \"packing_list\", \"packed_items\", \"product_bundle_help\", \"time_sheet_list\", \"timesheets\", \"section_break_104\", \"total_billing_hours\", \"column_break_106\", \"total_billing_amount\", \"payments_tab\", \"payments_section\", \"cash_bank_account\", \"payments\", \"section_break_84\", \"base_paid_amount\", \"column_break_86\", \"paid_amount\", \"section_break_88\", \"base_change_amount\", \"column_break_90\", \"change_amount\", \"account_for_change_amount\", \"advances_section\", \"allocate_advances_automatically\", \"only_include_allocated_payments\", \"get_advances\", \"advances\", \"write_off_section\", \"write_off_amount\", \"base_write_off_amount\", \"write_off_outstanding_amount_automatically\", \"column_break_74\", \"write_off_account\", \"write_off_cost_center\", \"loyalty_points_redemption\", \"redeem_loyalty_points\", \"loyalty_points\", \"loyalty_amount\", \"column_break_77\", \"loyalty_program\", \"loyalty_redemption_account\", \"loyalty_redemption_cost_center\", \"contact_and_address_tab\", \"address_and_contact\", \"customer_address\", \"address_display\", \"col_break4\", \"contact_person\", \"contact_display\", \"contact_mobile\", \"contact_email\", \"territory\", \"shipping_address_section\", \"shipping_address_name\", \"shipping_address\", \"shipping_addr_col_break\", \"dispatch_address_name\", \"dispatch_address\", \"company_address_section\", \"company_address\", \"company_addr_col_break\", \"company_address_display\", \"terms_tab\", \"payment_schedule_section\", \"ignore_default_payment_terms_template\", \"payment_terms_template\", \"payment_schedule\", \"terms_section_break\", \"tc_name\", \"terms\", \"more_info_tab\", \"customer_po_details\", \"po_no\", \"column_break_23\", \"po_date\", \"more_info\", \"debit_to\", \"party_account_currency\", \"is_opening\", \"column_break8\", \"unrealized_profit_loss_account\", \"against_income_account\", \"sales_team_section_break\", \"sales_partner\", \"amount_eligible_for_commission\", \"column_break10\", \"commission_rate\", \"total_commission\", \"section_break2\", \"sales_team\", \"edit_printing_settings\", \"letter_head\", \"group_same_items\", \"column_break_84\", \"select_print_heading\", \"language\", \"subscription_section\", \"subscription\", \"from_date\", \"auto_repeat\", \"column_break_140\", \"to_date\", \"update_auto_repeat_reference\", \"more_information\", \"status\", \"inter_company_invoice_reference\", \"campaign\", \"represents_company\", \"source\", \"customer_group\", \"col_break23\", \"is_internal_customer\", \"is_discounted\", \"remarks\", \"repost_required\", \"connections_tab\", \"cfdi_40\", \"sat_payment_option\", \"sat_cfdi_use\", \"column_break_206\", \"mode_of_payment\", \"sat_payment_mode\"]" + } + ], "sync_on_migrate": 1 } \ No newline at end of file From a00a074193bf36a1d9ec683f86c56d1f36e9fe29 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 2 Aug 2024 16:59:47 -0600 Subject: [PATCH 17/62] feat: add UOM custom fields --- .../erpnext_mexico_compliance/custom/uom.json | 159 ++++++++++++++++++ .../fixtures/custom_field.json | 108 ------------ 2 files changed, 159 insertions(+), 108 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json new file mode 100644 index 0000000..9021f51 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json @@ -0,0 +1,159 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 1, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-25 00:18:06.817491", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "UOM", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_cfdi", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 4, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "must_be_whole_number", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-25 00:18:06.817491", + "modified_by": "Administrator", + "module": null, + "name": "UOM-custom_cfdi", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 1, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-24 23:36:45.800248", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "UOM", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "sat_uom_key", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 5, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_preview": 0, + "in_standard_filter": 1, + "insert_after": "custom_cfdi", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT UOM Key", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:59:28.711146", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "UOM-sat_uom_key", + "no_copy": 0, + "non_negative": 0, + "options": "SAT UOM Key", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "UOM", + "links": [], + "property_setters": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-25 00:29:36.111740", + "default_value": null, + "doc_type": "UOM", + "docstatus": 0, + "doctype_or_field": "DocType", + "field_name": null, + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-02 15:50:07.837965", + "modified_by": "Administrator", + "module": null, + "name": "UOM-main-field_order", + "owner": "Administrator", + "property": "field_order", + "property_type": "Data", + "row_name": null, + "value": "[\"enabled\", \"uom_name\", \"must_be_whole_number\", \"custom_cfdi\", \"sat_uom_key\"]" + } + ], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 427f398..bbcfe79 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1,112 +1,4 @@ [ - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "UOM", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi_40", - "fieldtype": "Tab Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "must_be_whole_number", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI 4.0", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:59:40.234315", - "module": "ERPNext Mexico Compliance", - "name": "UOM-cfdi_40", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 1, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "UOM", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "sat_uom_key", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_preview": 0, - "in_standard_filter": 1, - "insert_after": "cfdi_40", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT UOM Key", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:59:28.711146", - "module": "ERPNext Mexico Compliance", - "name": "UOM-sat_uom_key", - "no_copy": 0, - "non_negative": 0, - "options": "SAT UOM Key", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, From d354abbcfa22c8be0e3bb5009190c906ef495e8e Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 2 Aug 2024 17:08:19 -0600 Subject: [PATCH 18/62] feat: add Sat Payment Mode to Payment Entry --- .../custom/payment_entry.json | 72 +++++++++++++++++++ .../erpnext_mexico_compliance/custom/uom.json | 2 +- .../fixtures/custom_field.json | 54 -------------- 3 files changed, 73 insertions(+), 55 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json new file mode 100644 index 0000000..8138724 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json @@ -0,0 +1,72 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-02 15:50:05.598146", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Payment Entry", + "fetch_from": "mode_of_payment.sat_payment_mode", + "fetch_if_empty": 0, + "fieldname": "sat_payment_mode", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 8, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mode_of_payment", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Payment Mode", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-20 16:53:50.909607", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-sat_payment_mode", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Payment Entry", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json index 9021f51..ca37808 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json @@ -41,7 +41,7 @@ "mandatory_depends_on": null, "modified": "2024-07-25 00:18:06.817491", "modified_by": "Administrator", - "module": null, + "module": "ERPNext Mexico Compliance", "name": "UOM-custom_cfdi", "no_copy": 0, "non_negative": 0, diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index bbcfe79..5c1d309 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1,58 +1,4 @@ [ - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Payment Entry", - "fetch_from": "mode_of_payment.sat_payment_mode", - "fetch_if_empty": 0, - "fieldname": "sat_payment_mode", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mode_of_payment", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Payment Mode", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-20 16:53:50.909607", - "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-sat_payment_mode", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, From 71f10cc2df36994599bcb0c53e6e707ecc3f0701 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 2 Aug 2024 17:46:01 -0600 Subject: [PATCH 19/62] feat: add Account customizations --- .../custom/account.json | 72 +++++++++++++++++++ .../fixtures/custom_field.json | 54 -------------- 2 files changed, 72 insertions(+), 54 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/account.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/account.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/account.json new file mode 100644 index 0000000..4e5068a --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/account.json @@ -0,0 +1,72 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-02 15:50:05.826417", + "default": null, + "depends_on": "eval:doc.account_type == 'Tax'", + "description": null, + "docstatus": 0, + "dt": "Account", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "tax_type", + "fieldtype": "Select", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 14, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_rate", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Tax Type", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "eval:doc.account_type == 'Tax'", + "modified": "2022-12-19 15:45:47.468341", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Account-tax_type", + "no_copy": 0, + "non_negative": 0, + "options": "\nIVA\nISR\nIEPS", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Account", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 5c1d309..2adeb3d 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1,58 +1,4 @@ [ - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": "eval:doc.account_type == 'Tax'", - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Account", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "tax_type", - "fieldtype": "Select", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "tax_rate", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Tax Type", - "length": 0, - "mandatory_depends_on": "eval:doc.account_type == 'Tax'", - "modified": "2022-12-19 15:45:47.468341", - "module": "ERPNext Mexico Compliance", - "name": "Account-tax_type", - "no_copy": 0, - "non_negative": 0, - "options": "\nIVA\nISR\nIEPS", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, From 40a9cb03730430dc662d55ff911582e8ffd50b93 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 2 Aug 2024 18:44:23 -0600 Subject: [PATCH 20/62] chore: add bank account custom properties --- .../custom/bank_account.json | 72 +++++++++++++++++++ .../custom/mode_of_payment.json | 26 +------ .../custom/sales_invoice.json | 26 +------ .../custom/sales_invoice_item.json | 26 +------ .../erpnext_mexico_compliance/custom/uom.json | 26 +------ .../fixtures/custom_field.json | 54 -------------- 6 files changed, 76 insertions(+), 154 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/bank_account.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/bank_account.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/bank_account.json new file mode 100644 index 0000000..c006872 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/bank_account.json @@ -0,0 +1,72 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-02 15:50:06.020394", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Bank Account", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "clabe", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 16, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "iban", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CLABE", + "length": 18, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2023-06-12 22:33:46.005100", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Bank Account-clabe", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Bank Account", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json index d5ca439..75b1a1e 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json @@ -130,30 +130,6 @@ "custom_perms": [], "doctype": "Mode of Payment", "links": [], - "property_setters": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2024-06-27 01:01:30.664001", - "default_value": null, - "doc_type": "Mode of Payment", - "docstatus": 0, - "doctype_or_field": "DocType", - "field_name": null, - "idx": 0, - "is_system_generated": 0, - "modified": "2024-07-24 23:36:47.697799", - "modified_by": "Administrator", - "module": null, - "name": "Mode of Payment-main-field_order", - "owner": "Administrator", - "property": "field_order", - "property_type": "Data", - "row_name": null, - "value": "[\"mode_of_payment\", \"enabled\", \"type\", \"accounts\", \"cfdi\", \"sat_payment_method\"]" - } - ], + "property_setters": [], "sync_on_migrate": 1 } \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json index dc29f7d..c90d580 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json @@ -382,30 +382,6 @@ "custom_perms": [], "doctype": "Sales Invoice", "links": [], - "property_setters": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2024-06-27 19:47:45.732836", - "default_value": null, - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype_or_field": "DocType", - "field_name": null, - "idx": 0, - "is_system_generated": 0, - "modified": "2024-06-27 19:47:45.732836", - "modified_by": "Administrator", - "module": null, - "name": "Sales Invoice-main-field_order", - "owner": "Administrator", - "property": "field_order", - "property_type": "Data", - "row_name": null, - "value": "[\"customer_section\", \"title\", \"naming_series\", \"customer\", \"customer_name\", \"tax_id\", \"company\", \"company_tax_id\", \"column_break1\", \"posting_date\", \"posting_time\", \"set_posting_time\", \"due_date\", \"column_break_14\", \"is_pos\", \"pos_profile\", \"is_consolidated\", \"is_return\", \"return_against\", \"update_outstanding_for_self\", \"update_billed_amount_in_sales_order\", \"update_billed_amount_in_delivery_note\", \"is_debit_note\", \"amended_from\", \"accounting_dimensions_section\", \"cost_center\", \"dimension_col_break\", \"project\", \"currency_and_price_list\", \"currency\", \"conversion_rate\", \"column_break2\", \"selling_price_list\", \"price_list_currency\", \"plc_conversion_rate\", \"ignore_pricing_rule\", \"items_section\", \"scan_barcode\", \"update_stock\", \"column_break_39\", \"set_warehouse\", \"set_target_warehouse\", \"section_break_42\", \"items\", \"section_break_30\", \"total_qty\", \"total_net_weight\", \"column_break_32\", \"base_total\", \"base_net_total\", \"column_break_52\", \"total\", \"net_total\", \"taxes_section\", \"tax_category\", \"taxes_and_charges\", \"column_break_38\", \"shipping_rule\", \"column_break_55\", \"incoterm\", \"named_place\", \"section_break_40\", \"taxes\", \"section_break_43\", \"base_total_taxes_and_charges\", \"column_break_47\", \"total_taxes_and_charges\", \"totals\", \"base_grand_total\", \"base_rounding_adjustment\", \"base_rounded_total\", \"base_in_words\", \"column_break5\", \"grand_total\", \"rounding_adjustment\", \"use_company_roundoff_cost_center\", \"rounded_total\", \"in_words\", \"total_advance\", \"outstanding_amount\", \"disable_rounded_total\", \"section_break_49\", \"apply_discount_on\", \"base_discount_amount\", \"is_cash_or_non_trade_discount\", \"additional_discount_account\", \"column_break_51\", \"additional_discount_percentage\", \"discount_amount\", \"sec_tax_breakup\", \"other_charges_calculation\", \"pricing_rule_details\", \"pricing_rules\", \"packing_list\", \"packed_items\", \"product_bundle_help\", \"time_sheet_list\", \"timesheets\", \"section_break_104\", \"total_billing_hours\", \"column_break_106\", \"total_billing_amount\", \"payments_tab\", \"payments_section\", \"cash_bank_account\", \"payments\", \"section_break_84\", \"base_paid_amount\", \"column_break_86\", \"paid_amount\", \"section_break_88\", \"base_change_amount\", \"column_break_90\", \"change_amount\", \"account_for_change_amount\", \"advances_section\", \"allocate_advances_automatically\", \"only_include_allocated_payments\", \"get_advances\", \"advances\", \"write_off_section\", \"write_off_amount\", \"base_write_off_amount\", \"write_off_outstanding_amount_automatically\", \"column_break_74\", \"write_off_account\", \"write_off_cost_center\", \"loyalty_points_redemption\", \"redeem_loyalty_points\", \"loyalty_points\", \"loyalty_amount\", \"column_break_77\", \"loyalty_program\", \"loyalty_redemption_account\", \"loyalty_redemption_cost_center\", \"contact_and_address_tab\", \"address_and_contact\", \"customer_address\", \"address_display\", \"col_break4\", \"contact_person\", \"contact_display\", \"contact_mobile\", \"contact_email\", \"territory\", \"shipping_address_section\", \"shipping_address_name\", \"shipping_address\", \"shipping_addr_col_break\", \"dispatch_address_name\", \"dispatch_address\", \"company_address_section\", \"company_address\", \"company_addr_col_break\", \"company_address_display\", \"terms_tab\", \"payment_schedule_section\", \"ignore_default_payment_terms_template\", \"payment_terms_template\", \"payment_schedule\", \"terms_section_break\", \"tc_name\", \"terms\", \"more_info_tab\", \"customer_po_details\", \"po_no\", \"column_break_23\", \"po_date\", \"more_info\", \"debit_to\", \"party_account_currency\", \"is_opening\", \"column_break8\", \"unrealized_profit_loss_account\", \"against_income_account\", \"sales_team_section_break\", \"sales_partner\", \"amount_eligible_for_commission\", \"column_break10\", \"commission_rate\", \"total_commission\", \"section_break2\", \"sales_team\", \"edit_printing_settings\", \"letter_head\", \"group_same_items\", \"column_break_84\", \"select_print_heading\", \"language\", \"subscription_section\", \"subscription\", \"from_date\", \"auto_repeat\", \"column_break_140\", \"to_date\", \"update_auto_repeat_reference\", \"more_information\", \"status\", \"inter_company_invoice_reference\", \"campaign\", \"represents_company\", \"source\", \"customer_group\", \"col_break23\", \"is_internal_customer\", \"is_discounted\", \"remarks\", \"repost_required\", \"connections_tab\", \"cfdi_40\", \"sat_payment_option\", \"sat_cfdi_use\", \"column_break_206\", \"mode_of_payment\", \"sat_payment_mode\"]" - } - ], + "property_setters": [], "sync_on_migrate": 1 } \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json index 70525c7..da611e2 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json @@ -130,30 +130,6 @@ "custom_perms": [], "doctype": "Sales Invoice Item", "links": [], - "property_setters": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2024-07-30 00:21:38.837880", - "default_value": null, - "doc_type": "Sales Invoice Item", - "docstatus": 0, - "doctype_or_field": "DocType", - "field_name": null, - "idx": 0, - "is_system_generated": 0, - "modified": "2024-07-30 00:21:38.837880", - "modified_by": "Administrator", - "module": null, - "name": "Sales Invoice Item-main-field_order", - "owner": "Administrator", - "property": "field_order", - "property_type": "Data", - "row_name": null, - "value": "[\"barcode\", \"has_item_scanned\", \"item_code\", \"col_break1\", \"item_name\", \"customer_item_code\", \"description_section\", \"description\", \"item_group\", \"brand\", \"image_section\", \"image\", \"image_view\", \"quantity_and_rate\", \"qty\", \"stock_uom\", \"col_break2\", \"uom\", \"conversion_factor\", \"stock_qty\", \"section_break_17\", \"price_list_rate\", \"base_price_list_rate\", \"discount_and_margin\", \"margin_type\", \"margin_rate_or_amount\", \"rate_with_margin\", \"column_break_19\", \"discount_percentage\", \"discount_amount\", \"base_rate_with_margin\", \"section_break1\", \"rate\", \"amount\", \"item_tax_template\", \"col_break3\", \"base_rate\", \"base_amount\", \"pricing_rules\", \"stock_uom_rate\", \"is_free_item\", \"grant_commission\", \"section_break_21\", \"net_rate\", \"net_amount\", \"column_break_24\", \"base_net_rate\", \"base_net_amount\", \"drop_ship\", \"delivered_by_supplier\", \"accounting\", \"income_account\", \"is_fixed_asset\", \"asset\", \"finance_book\", \"col_break4\", \"expense_account\", \"discount_account\", \"deferred_revenue\", \"deferred_revenue_account\", \"service_stop_date\", \"enable_deferred_revenue\", \"column_break_50\", \"service_start_date\", \"service_end_date\", \"section_break_18\", \"weight_per_unit\", \"total_weight\", \"column_break_21\", \"weight_uom\", \"warehouse_and_reference\", \"warehouse\", \"target_warehouse\", \"quality_inspection\", \"pick_serial_and_batch\", \"serial_and_batch_bundle\", \"use_serial_batch_fields\", \"col_break5\", \"allow_zero_valuation_rate\", \"incoming_rate\", \"item_tax_rate\", \"actual_batch_qty\", \"actual_qty\", \"section_break_eoec\", \"serial_no\", \"column_break_ytgd\", \"batch_no\", \"edit_references\", \"sales_order\", \"so_detail\", \"sales_invoice_item\", \"column_break_74\", \"delivery_note\", \"dn_detail\", \"delivered_qty\", \"internal_transfer_section\", \"purchase_order\", \"column_break_92\", \"purchase_order_item\", \"accounting_dimensions_section\", \"cost_center\", \"dimension_col_break\", \"project\", \"cfdi_section\", \"sat_product_or_service_key\", \"section_break_54\", \"page_break\"]" - } - ], + "property_setters": [], "sync_on_migrate": 1 } \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json index ca37808..f54d105 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json @@ -130,30 +130,6 @@ "custom_perms": [], "doctype": "UOM", "links": [], - "property_setters": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2024-07-25 00:29:36.111740", - "default_value": null, - "doc_type": "UOM", - "docstatus": 0, - "doctype_or_field": "DocType", - "field_name": null, - "idx": 0, - "is_system_generated": 0, - "modified": "2024-08-02 15:50:07.837965", - "modified_by": "Administrator", - "module": null, - "name": "UOM-main-field_order", - "owner": "Administrator", - "property": "field_order", - "property_type": "Data", - "row_name": null, - "value": "[\"enabled\", \"uom_name\", \"must_be_whole_number\", \"custom_cfdi\", \"sat_uom_key\"]" - } - ], + "property_setters": [], "sync_on_migrate": 1 } \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 2adeb3d..940ad7e 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1,58 +1,4 @@ [ - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Bank Account", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "clabe", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "iban", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CLABE", - "length": 18, - "mandatory_depends_on": null, - "modified": "2023-06-12 22:33:46.005100", - "module": "ERPNext Mexico Compliance", - "name": "Bank Account-clabe", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 1, - "unique": 0, - "width": null - }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, From 29950c470ba4b7acd49ff2553a2a25c6506abd5b Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Mon, 5 Aug 2024 16:52:44 -0600 Subject: [PATCH 21/62] feat: add customer custom fields --- .../custom/customer.json | 96 +++++++++++++++++++ .../fixtures/custom_field.json | 56 +---------- .../fixtures/property_setter.json | 18 ---- 3 files changed, 97 insertions(+), 73 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json delete mode 100644 erpnext_mexico_compliance/fixtures/property_setter.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json new file mode 100644 index 0000000..e6b2fa5 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json @@ -0,0 +1,96 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-02 15:50:06.166937", + "default": null, + "depends_on": "", + "description": null, + "docstatus": 0, + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "sat_tax_system", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 48, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_id", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Tax System", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "", + "modified": "2022-12-19 15:47:09.539300", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Customer-sat_tax_system", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Tax System", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Customer", + "links": [], + "property_setters": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-08-02 15:49:16.756830", + "default_value": null, + "doc_type": "Customer", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "tax_id", + "idx": 0, + "is_system_generated": 0, + "modified": "2022-12-23 22:48:41.912479", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Customer-tax_id-allow_in_quick_entry", + "owner": "Administrator", + "property": "allow_in_quick_entry", + "property_type": "Check", + "row_name": null, + "value": "1" + } + ], + "sync_on_migrate": 1 +} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 940ad7e..4fe29de 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1,58 +1,4 @@ [ - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": "", - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Customer", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "sat_tax_system", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "tax_id", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Tax System", - "length": 0, - "mandatory_depends_on": "", - "modified": "2022-12-19 15:47:09.539300", - "module": "ERPNext Mexico Compliance", - "name": "Customer-sat_tax_system", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Tax System", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, @@ -161,4 +107,4 @@ "unique": 0, "width": null } -] \ No newline at end of file +] diff --git a/erpnext_mexico_compliance/fixtures/property_setter.json b/erpnext_mexico_compliance/fixtures/property_setter.json deleted file mode 100644 index 51d52aa..0000000 --- a/erpnext_mexico_compliance/fixtures/property_setter.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "default_value": null, - "doc_type": "Customer", - "docstatus": 0, - "doctype": "Property Setter", - "doctype_or_field": "DocField", - "field_name": "tax_id", - "is_system_generated": 0, - "modified": "2022-12-23 22:48:41.912479", - "module": "ERPNext Mexico Compliance", - "name": "Customer-tax_id-allow_in_quick_entry", - "property": "allow_in_quick_entry", - "property_type": "Check", - "row_name": null, - "value": "1" - } -] \ No newline at end of file From 4cf227f2f951c7f3a1895a57a0d2372199767ae7 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Mon, 5 Aug 2024 16:56:18 -0600 Subject: [PATCH 22/62] feat: add prettier settings file --- .prettierrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b0b12f2 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,12 @@ +{ + "tabWidth": 2, + "useTabs": false, + "overrides": [ + { + "files": "*.json", + "options": { + "tabWidth": 1 + } + } + ] +} From 134b226fb836e8a5e5a60ce5ef3889df8a484559 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Mon, 5 Aug 2024 20:18:04 -0600 Subject: [PATCH 23/62] feat: add Item custom fields --- .../custom/item.json | 135 ++++++++++++++++++ .../fixtures/custom_field.json | 110 -------------- 2 files changed, 135 insertions(+), 110 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json delete mode 100644 erpnext_mexico_compliance/fixtures/custom_field.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json new file mode 100644 index 0000000..f0497e2 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json @@ -0,0 +1,135 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-02 15:50:06.379210", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi_40", + "fieldtype": "Tab Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 108, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "total_projected_qty", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 15:51:31.690229", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Item-cfdi_40", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-02 15:50:06.628836", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "sat_product_or_service_key", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 109, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi_40", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Product or Service Key", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 15:51:48.922472", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Item-sat_product_or_service_key", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Product or Service Key", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Item", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json deleted file mode 100644 index 4fe29de..0000000 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Item", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi_40", - "fieldtype": "Tab Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "total_projected_qty", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI 4.0", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 15:51:31.690229", - "module": "ERPNext Mexico Compliance", - "name": "Item-cfdi_40", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "Item", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "sat_product_or_service_key", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cfdi_40", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Product or Service Key", - "length": 0, - "mandatory_depends_on": null, - "modified": "2022-12-19 15:51:48.922472", - "module": "ERPNext Mexico Compliance", - "name": "Item-sat_product_or_service_key", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Product or Service Key", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } -] From 89dd42b25f748a737ff07d02bd100f9794241fea Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Mon, 5 Aug 2024 21:49:40 -0600 Subject: [PATCH 24/62] chore: resolve pylint logging-fstring-interpolation --- erpnext_mexico_compliance/install.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext_mexico_compliance/install.py b/erpnext_mexico_compliance/install.py index 606a836..c378194 100644 --- a/erpnext_mexico_compliance/install.py +++ b/erpnext_mexico_compliance/install.py @@ -1,4 +1,5 @@ """Installation tasks""" + import os import frappe @@ -8,12 +9,13 @@ logger = frappe.logger("erpnext_mexico_compliance.install") + def after_sync(): """Run tasks after migration sync""" logger.info("Importing SAT Product or Service Key data...") fixtures_directory = "fixtures_csv" files = sorted(os.listdir(frappe.get_app_path(app_name, fixtures_directory))) for file in files: - logger.info(f"Loading {file}...") + logger.info("Loading %s...", file) file_path = frappe.get_app_path(app_name, fixtures_directory, file) import_file("SAT Product or Service Key", file_path, "Insert", console=True) From 8035bdf5bb8f8a6c942d43c955ed084aae419916 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 9 Aug 2024 17:39:50 -0600 Subject: [PATCH 25/62] chore: update available hooks --- erpnext_mexico_compliance/hooks.py | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/erpnext_mexico_compliance/hooks.py b/erpnext_mexico_compliance/hooks.py index 17c2b3d..32b2d0f 100644 --- a/erpnext_mexico_compliance/hooks.py +++ b/erpnext_mexico_compliance/hooks.py @@ -37,6 +37,11 @@ # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} # doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} +# Svg Icons +# ------------------ +# include app icons in desk +# app_include_icons = "erpnext_mexico_compliance/public/icons.svg" + # Home Pages # ---------- @@ -82,6 +87,22 @@ # after_migrate = "erpnext_mexico_compliance.migrate.after_migrate" # before_migrate = "erpnext_mexico_compliance.migrate.before_migrate" +# Integration Setup +# ------------------ +# To set up dependencies/integrations with other apps +# Name of the app being installed is passed as an argument + +# before_app_install = "erpnext_mexico_compliance.utils.before_app_install" +# after_app_install = "erpnext_mexico_compliance.utils.after_app_install" + +# Integration Cleanup +# ------------------- +# To clean up dependencies/integrations with other apps +# Name of the app being uninstalled is passed as an argument + +# before_app_uninstall = "erpnext_mexico_compliance.utils.before_app_uninstall" +# after_app_uninstall = "erpnext_mexico_compliance.utils.after_app_uninstall" + # Desk Notifications # ------------------ # See frappe.core.notifications.get_notification_config @@ -171,6 +192,15 @@ # ignore_links_on_delete = ["Communication", "ToDo"] +# Request Events +# ---------------- +# before_request = ["erpnext_mexico_compliance.utils.before_request"] +# after_request = ["erpnext_mexico_compliance.utils.after_request"] + +# Job Events +# ---------- +# before_job = ["erpnext_cfdi.utils.before_job"] +# after_job = ["erpnext_cfdi.utils.after_job"] # User Data Protection # -------------------- @@ -203,6 +233,13 @@ # "erpnext_mexico_compliance.auth.validate" # ] +# Automatically update python controller files with type annotations for this app. +# export_python_type_annotations = True + +# default_log_clearing_doctypes = { +# "Logging DocType Name": 30 # days to retain logs +# } + fixtures = [ {"doctype": "Custom Field", "filters": [{"module": "ERPNext Mexico Compliance"}]}, { From a2e547787f57c4a31f3fe8aa743b2a45a270c394 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 9 Aug 2024 17:40:39 -0600 Subject: [PATCH 26/62] chore: export type annotations --- erpnext_mexico_compliance/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext_mexico_compliance/hooks.py b/erpnext_mexico_compliance/hooks.py index 32b2d0f..a3c30d4 100644 --- a/erpnext_mexico_compliance/hooks.py +++ b/erpnext_mexico_compliance/hooks.py @@ -234,7 +234,7 @@ # ] # Automatically update python controller files with type annotations for this app. -# export_python_type_annotations = True +export_python_type_annotations = True # default_log_clearing_doctypes = { # "Logging DocType Name": 30 # days to retain logs From e28cbb18ce548e21a3b0e1b8b34949a56ab8845f Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 9 Aug 2024 20:02:29 -0600 Subject: [PATCH 27/62] feat: add CSD settings --- .../cfdi_stamping_settings/__init__.py | 0 .../cfdi_stamping_settings.js | 16 +++++ .../cfdi_stamping_settings.json | 63 +++++++++++++++++ .../cfdi_stamping_settings.py | 67 +++++++++++++++++++ .../test_cfdi_stamping_settings.py | 9 +++ pyproject.toml | 8 ++- 6 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/__init__.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.js create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/test_cfdi_stamping_settings.py diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/__init__.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.js b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.js new file mode 100644 index 0000000..d154670 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.js @@ -0,0 +1,16 @@ +// Copyright (c) 2024, TI Sin Problemas and contributors +// For license information, please see license.txt + +frappe.ui.form.on("CFDI Stamping Settings", { + refresh(frm) { + if ( + frm.doc.signing_certificate && + frm.doc.signing_key && + frm.doc.signing_password + ) { + frm.add_custom_button(__("Validate Signing Certificate"), () => { + frm.call("validate_signing_certificate"); + }); + } + }, +}); diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json new file mode 100644 index 0000000..d2824aa --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json @@ -0,0 +1,63 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-08-09 14:55:18.675674", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "csd_column", + "signing_certificate", + "signing_key", + "signing_password" + ], + "fields": [ + { + "description": ".cer file of the Digital Signing Certificate", + "fieldname": "signing_certificate", + "fieldtype": "Attach", + "in_list_view": 1, + "label": "Certificate" + }, + { + "fieldname": "csd_column", + "fieldtype": "Column Break", + "label": "Digital Signing Certificate" + }, + { + "description": ".key file of the Digital Signing Certificate", + "fieldname": "signing_key", + "fieldtype": "Attach", + "in_list_view": 1, + "label": "Certificate Key" + }, + { + "fieldname": "signing_password", + "fieldtype": "Password", + "in_list_view": 1, + "label": "Certificate Password" + } + ], + "index_web_pages_for_search": 1, + "issingle": 1, + "links": [], + "modified": "2024-08-09 16:45:34.677933", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "CFDI Stamping Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py new file mode 100644 index 0000000..a4e255b --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py @@ -0,0 +1,67 @@ +# Copyright (c) 2024, TI Sin Problemas and contributors +# For license information, please see license.txt + +import frappe +from frappe import _ +from frappe.model.document import Document +from frappe.utils.file_manager import get_file +from frappe.utils.password import get_decrypted_password +from satcfdi.exceptions import CFDIError +from satcfdi.models import Signer + + +class CFDIStampingSettings(Document): + + def _get_file(self, field: str) -> tuple[str, bytes]: + return get_file(getattr(self, field)) + + def get_certificate(self) -> bytes: + """Returns the Digital Signing Certificate + + Returns: + bytes: Digital Signing Certificate + """ + if not self.signing_certificate: + frappe.throw(_("Signing Certificate not configured")) + return self._get_file("signing_certificate")[1] + + def get_key(self) -> bytes: + """Returns the Digital Signing Certificate Key + + Returns: + bytes: Digital Signing Certificate Key + """ + if not self.signing_key: + frappe.throw(_("Signing Key not configured")) + return self._get_file("signing_key")[1] + + def get_certificate_password(self) -> str: + """Returns the Digital Signing Certificate Key Password + + Returns: + str: Password for the Digital Signing Certificate key + """ + if not self.signing_password: + frappe.throw(_("Signing Password not configured")) + return get_decrypted_password(self.doctype, self.name, "signing_password") + + def get_csd_signer(self) -> Signer: + """Returns Signer from the Digital Signing Certificate + + Returns: + Signer: CSD Signer + """ + certificate = self.get_certificate() + key = self.get_key() + password = self.get_certificate_password() + try: + signer = Signer.load(certificate=certificate, key=key, password=password) + except (CFDIError, ValueError) as e: + frappe.throw(title="Invalid Signing Certificate", msg=str(e)) + + return signer + + @frappe.whitelist() + def validate_signing_certificate(self): + """Validate the CSD Signing Certificate""" + self.get_csd_signer() diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/test_cfdi_stamping_settings.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/test_cfdi_stamping_settings.py new file mode 100644 index 0000000..b67f6ed --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/test_cfdi_stamping_settings.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, TI Sin Problemas and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestCFDIStampingSettings(FrappeTestCase): + pass diff --git a/pyproject.toml b/pyproject.toml index 174fc2d..4020acc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,7 @@ description = "ERPNext app to serve as base to comply with help with Mexican Rul requires-python = ">=3.10" readme = "README.md" dynamic = ["version"] -dependencies = [ - # "frappe~=15.0.0" # Installed and managed by bench. -] +dependencies = ["zeep ≃4.2.1", "satcfdi ~=4.5.5"] [build-system] requires = ["flit_core"] build-backend = "flit_core.buildapi" @@ -15,3 +13,7 @@ build-backend = "flit_core.buildapi" # These dependencies are only installed when developer mode is enabled [tool.bench.dev-dependencies] # package_name = "~=1.1.0" + +[tool.bench.frappe-dependencies] +frappe = ">=15.0.0,<16.0.0" +erpnext = ">=15.0.0,<16.0.0" From 563e651c53af7ce49e9b8df996af6b452177ee3e Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 10 Aug 2024 00:49:04 -0600 Subject: [PATCH 28/62] feat: add Digital Signing Certificate doctype --- .../digital_signing_certificate/__init__.py | 0 .../digital_signing_certificate.js | 12 ++ .../digital_signing_certificate.json | 102 +++++++++++++++++ .../digital_signing_certificate.py | 107 ++++++++++++++++++ .../test_digital_signing_certificate.py | 9 ++ 5 files changed, 230 insertions(+) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/__init__.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.js create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/test_digital_signing_certificate.py diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/__init__.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.js b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.js new file mode 100644 index 0000000..90c66b3 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.js @@ -0,0 +1,12 @@ +// Copyright (c) 2024, TI Sin Problemas and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Digital Signing Certificate", { + refresh(frm) { + if (frm.doc.certificate && frm.doc.key && frm.doc.password) { + frm.add_custom_button(__("Validate Certificate"), () => { + frm.call("validate_certificate"); + }); + } + }, +}); diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json new file mode 100644 index 0000000..ee7b4b6 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json @@ -0,0 +1,102 @@ +{ + "actions": [], + "autoname": "field:company", + "creation": "2024-08-09 21:12:07.021650", + "description": "Company's Digital Signing Certificate to sign CFDI ", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "company", + "certificate", + "key", + "password", + "column_break_ymzu", + "legal_name", + "rfc" + ], + "fields": [ + { + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Company", + "no_copy": 1, + "options": "Company", + "reqd": 1, + "unique": 1 + }, + { + "description": "Certificate file (.cer)", + "fieldname": "certificate", + "fieldtype": "Attach", + "label": "Certificate" + }, + { + "description": "Certificate key file (.key)", + "fieldname": "key", + "fieldtype": "Attach", + "label": "Key" + }, + { + "description": "Password for the certificate key", + "fieldname": "password", + "fieldtype": "Password", + "label": "Password" + }, + { + "description": "Certificate's RFC", + "fieldname": "rfc", + "fieldtype": "Data", + "is_virtual": 1, + "label": "RFC" + }, + { + "fieldname": "column_break_ymzu", + "fieldtype": "Column Break" + }, + { + "description": "Certificate's legal name", + "fieldname": "legal_name", + "fieldtype": "Data", + "is_virtual": 1, + "label": "Legal Name" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-08-09 22:40:07.169173", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Digital Signing Certificate", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py new file mode 100644 index 0000000..74fa9d3 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py @@ -0,0 +1,107 @@ +# Copyright (c) 2024, TI Sin Problemas and contributors +# For license information, please see license.txt + +import frappe +from frappe import _ +from frappe.model.document import Document +from frappe.utils.file_manager import get_file +from satcfdi.exceptions import CFDIError +from satcfdi.models import Signer + + +class DigitalSigningCertificate(Document): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + certificate: DF.Attach | None + company: DF.Link + key: DF.Attach | None + legal_name: DF.Data | None + password: DF.Password | None + rfc: DF.Data | None + # end: auto-generated types + + def _get_file(self, field: str) -> bytes: + return get_file(getattr(self, field))[1] + + def read_certificate(self) -> bytes: + """Returns the content of the Digital Signing Certificate file + + Returns: + bytes: Digital Signing Certificate content + """ + if not self.certificate: + frappe.throw(_("Certificate file not configured")) + return self._get_file("certificate") + + def read_key(self) -> bytes: + """Returns the content of the Digital Signing Certificate Key file + + Returns: + bytes: Digital Signing Certificate Key content + """ + if not self.key: + frappe.throw(_("Key file not configured")) + return self._get_file("key") + + def get_signer(self) -> Signer: + """Returns a Signer object loaded with the certificate, key, and password of the current + DigitalSigningCertificate instance. + + Returns: + Signer: CSD Signer + """ + certificate = self.read_certificate() + key = self.read_key() + password = self.get_password() + try: + signer = Signer.load(certificate=certificate, key=key, password=password) + except (CFDIError, ValueError) as e: + frappe.throw(msg=str(e), title="Invalid Signing Certificate") + + return signer + + @frappe.whitelist() + def validate_certificate(self): + """Validates the digital signing certificate by checking if the certificate files and + password are correctly configured.""" + self.get_signer() + msg = _("Certificate files and password are valid") + frappe.msgprint(msg=msg, title=_("Success"), indicator="green") + + @property + def triad_is_complete(self) -> bool: + """Checks if the digital signing certificate triad is complete. + + The triad consists of the certificate, key, and password. This property returns True if + all three are present, False otherwise. + + Returns: + bool: Whether the triad is complete. + """ + return all([self.certificate, self.key, self.password]) + + @property + def legal_name(self) -> str | None: + """Returns the legal name associated with the digital signing certificate. + + Returns: + str | None: The legal name associated with the digital signing certificate, or None if + the triad is not complete. + """ + return self.get_signer().legal_name if self.triad_is_complete else None + + @property + def rfc(self) -> str | None: + """Returns the RFC associated with the digital signing certificate. + + Returns: + str | None: The RFC associated with the digital signing certificate, or None if the + triad is not complete. + """ + return self.get_signer().rfc if self.triad_is_complete else None diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/test_digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/test_digital_signing_certificate.py new file mode 100644 index 0000000..8e08359 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/test_digital_signing_certificate.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, TI Sin Problemas and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestDigitalSigningCertificate(FrappeTestCase): + pass From 7f13febd92c536729f5f29367acdfa407640dc53 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 10 Aug 2024 01:28:51 -0600 Subject: [PATCH 29/62] feat(digital signing cert): add branch name field --- .../digital_signing_certificate.json | 50 +++++++++++++++---- .../digital_signing_certificate.py | 11 ++++ 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json index ee7b4b6..f025096 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json @@ -1,47 +1,54 @@ { "actions": [], - "autoname": "field:company", + "allow_rename": 1, + "autoname": "format:{company}-{###}", "creation": "2024-08-09 21:12:07.021650", "description": "Company's Digital Signing Certificate to sign CFDI ", "doctype": "DocType", "engine": "InnoDB", "field_order": [ + "company_section", "company", + "files_section", + "column_break_ymzu", "certificate", "key", "password", - "column_break_ymzu", + "column_break_jted", "legal_name", - "rfc" + "rfc", + "branch_name" ], "fields": [ { + "description": "Company for which this certificate will be used to sign CFDI", "fieldname": "company", "fieldtype": "Link", "in_list_view": 1, "label": "Company", - "no_copy": 1, "options": "Company", - "reqd": 1, - "unique": 1 + "reqd": 1 }, { "description": "Certificate file (.cer)", "fieldname": "certificate", "fieldtype": "Attach", - "label": "Certificate" + "label": "Certificate", + "no_copy": 1 }, { "description": "Certificate key file (.key)", "fieldname": "key", "fieldtype": "Attach", - "label": "Key" + "label": "Key", + "no_copy": 1 }, { "description": "Password for the certificate key", "fieldname": "password", "fieldtype": "Password", - "label": "Password" + "label": "Password", + "no_copy": 1 }, { "description": "Certificate's RFC", @@ -60,15 +67,36 @@ "fieldtype": "Data", "is_virtual": 1, "label": "Legal Name" + }, + { + "description": "Certificate's branch name", + "fieldname": "branch_name", + "fieldtype": "Data", + "is_virtual": 1, + "label": "Branch Name" + }, + { + "fieldname": "column_break_jted", + "fieldtype": "Column Break" + }, + { + "fieldname": "company_section", + "fieldtype": "Section Break", + "label": "Company" + }, + { + "fieldname": "files_section", + "fieldtype": "Section Break", + "label": "Files" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-08-09 22:40:07.169173", + "modified": "2024-08-10 01:32:36.071690", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Digital Signing Certificate", - "naming_rule": "By fieldname", + "naming_rule": "Expression", "owner": "Administrator", "permissions": [ { diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py index 74fa9d3..62cd4ce 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py @@ -18,6 +18,7 @@ class DigitalSigningCertificate(Document): if TYPE_CHECKING: from frappe.types import DF + branch_name: DF.Data | None certificate: DF.Attach | None company: DF.Link key: DF.Attach | None @@ -105,3 +106,13 @@ def rfc(self) -> str | None: triad is not complete. """ return self.get_signer().rfc if self.triad_is_complete else None + + @property + def branch_name(self) -> str | None: + """Returns the branch name associated with the digital signing certificate. + + Returns: + str | None: The branch name associated with the digital signing certificate, or None if + the triad is not complete. + """ + return self.get_signer().branch_name if self.triad_is_complete else None From 5dbc099d55506f76c0f38026cb015b5ad49d5c59 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 10 Aug 2024 15:07:13 -0600 Subject: [PATCH 30/62] feat(tax regime): rename SAT Tax System to SAT Tax Regime --- .../custom/customer.json | 14 +-- .../__init__.py | 0 .../sat_tax_regime.js} | 2 +- .../sat_tax_regime/sat_tax_regime.json | 89 +++++++++++++++++++ .../sat_tax_regime.py} | 2 +- .../test_sat_tax_regime.py} | 2 +- .../sat_tax_system/sat_tax_system.json | 89 ------------------- .../mexico_compliance/mexico_compliance.json | 50 +++++++++-- ...at_tax_system.json => sat_tax_regime.json} | 40 ++++----- .../overrides/customer.py | 8 +- .../translations/es-MX.csv | 2 +- erpnext_mexico_compliance/translations/es.csv | 2 +- 12 files changed, 171 insertions(+), 129 deletions(-) rename erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/{sat_tax_system => sat_tax_regime}/__init__.py (100%) rename erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/{sat_tax_system/sat_tax_system.js => sat_tax_regime/sat_tax_regime.js} (79%) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json rename erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/{sat_tax_system/sat_tax_system.py => sat_tax_regime/sat_tax_regime.py} (91%) rename erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/{sat_tax_system/test_sat_tax_system.py => sat_tax_regime/test_sat_tax_regime.py} (78%) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.json rename erpnext_mexico_compliance/fixtures/{sat_tax_system.json => sat_tax_regime.json} (85%) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json index e6b2fa5..76ac910 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json @@ -19,13 +19,13 @@ "dt": "Customer", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "sat_tax_system", + "fieldname": "mx_tax_regime", "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 48, + "idx": 49, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -35,17 +35,17 @@ "insert_after": "tax_id", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT Tax System", + "label": "SAT Tax Regime", "length": 0, "link_filters": null, "mandatory_depends_on": "", "modified": "2022-12-19 15:47:09.539300", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Customer-sat_tax_system", + "name": "Customer-mx_tax_regime", "no_copy": 0, "non_negative": 0, - "options": "SAT Tax System", + "options": "SAT Tax Regime", "owner": "Administrator", "permlevel": 0, "precision": "", @@ -55,7 +55,7 @@ "read_only": 0, "read_only_depends_on": null, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -81,7 +81,7 @@ "field_name": "tax_id", "idx": 0, "is_system_generated": 0, - "modified": "2022-12-23 22:48:41.912479", + "modified": "2024-08-10 11:44:44.962389", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Customer-tax_id-allow_in_quick_entry", diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/__init__.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/__init__.py similarity index 100% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/__init__.py rename to erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/__init__.py diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.js b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.js similarity index 79% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.js rename to erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.js index c0840c0..4694196 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.js +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.js @@ -1,7 +1,7 @@ // Copyright (c) 2022, TI Sin Problemas and contributors // For license information, please see license.txt -frappe.ui.form.on('SAT Tax System', { +frappe.ui.form.on('SAT Tax Regime', { // refresh: function(frm) { // } diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json new file mode 100644 index 0000000..965b368 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json @@ -0,0 +1,89 @@ +{ + "actions": [], + "autoname": "field:key", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "enabled", + "section_break", + "key", + "key_name", + "column_break", + "description" + ], + "fields": [ + { + "default": "1", + "fieldname": "enabled", + "fieldtype": "Check", + "label": "Enabled" + }, + { + "fieldname": "section_break", + "fieldtype": "Section Break" + }, + { + "fieldname": "key_name", + "fieldtype": "Data", + "label": "Key Name", + "read_only": 1 + }, + { + "fieldname": "key", + "fieldtype": "Data", + "label": "Key", + "length": 3, + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "column_break", + "fieldtype": "Column Break" + }, + { + "fieldname": "description", + "fieldtype": "Data", + "label": "Description", + "reqd": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "SAT Tax Regime", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "show_title_field_in_link": 1, + "sort_field": "key_name", + "sort_order": "ASC", + "states": [], + "title_field": "key_name" +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.py similarity index 91% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.py rename to erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.py index d756356..8b1333a 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.py @@ -6,7 +6,7 @@ from frappe.model.document import Document -class SATTaxSystem(Document): +class SATTaxRegime(Document): """SAT's Tax System""" def before_save(self): diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/test_sat_tax_system.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/test_sat_tax_regime.py similarity index 78% rename from erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/test_sat_tax_system.py rename to erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/test_sat_tax_regime.py index c84933c..e2219aa 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/test_sat_tax_system.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/test_sat_tax_regime.py @@ -5,5 +5,5 @@ from frappe.tests.utils import FrappeTestCase -class TestSATTaxSystem(FrappeTestCase): +class TestSATTaxRegime(FrappeTestCase): pass diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.json deleted file mode 100644 index b4a61a8..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_system/sat_tax_system.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "actions": [], - "autoname": "field:key", - "default_view": "List", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "enabled", - "section_break", - "key", - "key_name", - "column_break", - "description" - ], - "fields": [ - { - "default": "1", - "fieldname": "enabled", - "fieldtype": "Check", - "label": "Enabled" - }, - { - "fieldname": "section_break", - "fieldtype": "Section Break" - }, - { - "fieldname": "key_name", - "fieldtype": "Data", - "label": "Key Name", - "read_only": 1 - }, - { - "fieldname": "key", - "fieldtype": "Data", - "label": "Key", - "length": 3, - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "column_break", - "fieldtype": "Column Break" - }, - { - "fieldname": "description", - "fieldtype": "Data", - "label": "Description", - "reqd": 1 - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "SAT Tax System", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - }, - { - "create": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "share": 1, - "write": 1 - } - ], - "quick_entry": 1, - "show_title_field_in_link": 1, - "sort_field": "key_name", - "sort_order": "ASC", - "states": [], - "title_field": "key_name" -} diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json index bd5fd26..cc23b10 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json @@ -1,6 +1,6 @@ { "charts": [], - "content": "[{\"id\":\"I0YRNY96Kv\",\"type\":\"header\",\"data\":{\"text\":\"Mexico Compliance\",\"col\":12}},{\"id\":\"2_c8TjCfdY\",\"type\":\"card\",\"data\":{\"card_name\":\"Accounting\",\"col\":4}}]", + "content": "[{\"id\":\"I0YRNY96Kv\",\"type\":\"header\",\"data\":{\"text\":\"Mexico Compliance\",\"col\":12}},{\"id\":\"2_c8TjCfdY\",\"type\":\"card\",\"data\":{\"card_name\":\"Accounting\",\"col\":4}},{\"id\":\"U5q9et5tJ7\",\"type\":\"card\",\"data\":{\"card_name\":\"Settings\",\"col\":4}}]", "creation": "2024-06-25 23:20:44.180369", "custom_blocks": [], "docstatus": 0, @@ -13,12 +13,52 @@ "is_hidden": 0, "label": "Mexico Compliance", "links": [ + { + "hidden": 0, + "is_query_report": 0, + "label": "SAT Payment Option", + "link_count": 0, + "link_to": "SAT Payment Option", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "description": "Module settings", + "hidden": 0, + "is_query_report": 0, + "label": "Settings", + "link_count": 2, + "link_type": "DocType", + "onboard": 0, + "type": "Card Break" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "CFDI Stamping Settings", + "link_count": 0, + "link_to": "CFDI Stamping Settings", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Digital Signing Certificate", + "link_count": 0, + "link_to": "Digital Signing Certificate", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, { "description": "SAT Catalogs for accounting", "hidden": 0, "is_query_report": 0, "label": "Accounting", - "link_count": 5, + "link_count": 6, "link_type": "DocType", "onboard": 0, "type": "Card Break" @@ -46,9 +86,9 @@ { "hidden": 0, "is_query_report": 0, - "label": "SAT Tax System", + "label": "SAT Tax Regime", "link_count": 0, - "link_to": "SAT Tax System", + "link_to": "SAT Tax Regime", "link_type": "DocType", "onboard": 0, "type": "Link" @@ -84,7 +124,7 @@ "type": "Link" } ], - "modified": "2024-06-27 19:22:58.830059", + "modified": "2024-08-10 14:48:14.626153", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Mexico Compliance", diff --git a/erpnext_mexico_compliance/fixtures/sat_tax_system.json b/erpnext_mexico_compliance/fixtures/sat_tax_regime.json similarity index 85% rename from erpnext_mexico_compliance/fixtures/sat_tax_system.json rename to erpnext_mexico_compliance/fixtures/sat_tax_regime.json index 45b6fb2..a567f75 100644 --- a/erpnext_mexico_compliance/fixtures/sat_tax_system.json +++ b/erpnext_mexico_compliance/fixtures/sat_tax_regime.json @@ -1,7 +1,7 @@ [ { "description": "General de Ley Personas Morales", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "601", "key_name": "601 - General de Ley Personas Morales", @@ -9,7 +9,7 @@ }, { "description": "Personas Morales con Fines no Lucrativos", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "603", "key_name": "603 - Personas Morales con Fines no Lucrativos", @@ -17,7 +17,7 @@ }, { "description": "Sueldos y Salarios e Ingresos Asimilados a Salarios", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "605", "key_name": "605 - Sueldos y Salarios e Ingresos Asimilados a Salarios", @@ -25,7 +25,7 @@ }, { "description": "Arrendamiento", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "606", "key_name": "606 - Arrendamiento", @@ -33,7 +33,7 @@ }, { "description": "Régimen de Enajenación o Adquisición de Bienes", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "607", "key_name": "607 - Régimen de Enajenación o Adquisición de Bienes", @@ -41,7 +41,7 @@ }, { "description": "Demás ingresos", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "608", "key_name": "608 - Demás ingresos", @@ -49,7 +49,7 @@ }, { "description": "Residentes en el Extranjero sin Establecimiento Permanente en México", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "610", "key_name": "610 - Residentes en el Extranjero sin Establecimiento Permanente en México", @@ -57,7 +57,7 @@ }, { "description": "Ingresos por Dividendos (socios y accionistas)", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "611", "key_name": "611 - Ingresos por Dividendos (socios y accionistas)", @@ -65,7 +65,7 @@ }, { "description": "Personas Físicas con Actividades Empresariales y Profesionales", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "612", "key_name": "612 - Personas Físicas con Actividades Empresariales y Profesionales", @@ -73,7 +73,7 @@ }, { "description": "Ingresos por intereses", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "614", "key_name": "614 - Ingresos por intereses", @@ -81,7 +81,7 @@ }, { "description": "Régimen de los ingresos por obtención de premios", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "615", "key_name": "615 - Régimen de los ingresos por obtención de premios", @@ -89,7 +89,7 @@ }, { "description": "Sin obligaciones fiscales", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "616", "key_name": "616 - Sin obligaciones fiscales", @@ -97,7 +97,7 @@ }, { "description": "Sociedades Cooperativas de Producción que optan por diferir sus ingresos", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "620", "key_name": "620 - Sociedades Cooperativas de Producción que optan por diferir sus ingresos", @@ -105,7 +105,7 @@ }, { "description": "Incorporación Fiscal", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "621", "key_name": "621 - Incorporación Fiscal", @@ -113,7 +113,7 @@ }, { "description": "Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "622", "key_name": "622 - Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras", @@ -121,7 +121,7 @@ }, { "description": "Opcional para Grupos de Sociedades", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "623", "key_name": "623 - Opcional para Grupos de Sociedades", @@ -129,7 +129,7 @@ }, { "description": "Coordinados", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "624", "key_name": "624 - Coordinados", @@ -137,7 +137,7 @@ }, { "description": "Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "625", "key_name": "625 - Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas", @@ -145,10 +145,10 @@ }, { "description": "Régimen Simplificado de Confianza", - "doctype": "SAT Tax System", + "doctype": "SAT Tax Regime", "enabled": 1, "key": "626", "key_name": "626 - Régimen Simplificado de Confianza", "name": "626" } -] \ No newline at end of file +] diff --git a/erpnext_mexico_compliance/overrides/customer.py b/erpnext_mexico_compliance/overrides/customer.py index 808c816..2b38321 100644 --- a/erpnext_mexico_compliance/overrides/customer.py +++ b/erpnext_mexico_compliance/overrides/customer.py @@ -2,10 +2,12 @@ Copyright (c) 2022, TI Sin Problemas and contributors For license information, please see license.txt """ + import re + import frappe -from frappe import _ from erpnext.selling.doctype.customer.customer import Customer as ERPNextCustomer +from frappe import _ class Customer(ERPNextCustomer): @@ -21,7 +23,7 @@ def validate_mexican_tax_id(self): title=_("Invalid Tax Id"), ) - def get_customer_primary_address(self): + def get_primary_address(self): """Get customer primary address document""" return frappe.get_doc("Address", self.customer_primary_address) @@ -31,7 +33,7 @@ def is_mexican(self): if not self.customer_primary_address: return False - address = self.get_customer_primary_address() + address = self.get_primary_address() return address.country.upper().startswith("MEX") def validate(self): diff --git a/erpnext_mexico_compliance/translations/es-MX.csv b/erpnext_mexico_compliance/translations/es-MX.csv index 09c3d45..357a34c 100644 --- a/erpnext_mexico_compliance/translations/es-MX.csv +++ b/erpnext_mexico_compliance/translations/es-MX.csv @@ -9,7 +9,7 @@ SAT CFDI Use,Uso de CFDI SAT SAT Payment Option,Método de Pago SAT SAT Payment Method,Forma de Pago SAT SAT Product or Service Key,Clave SAT de Producto o Servicio -SAT Tax System,Régimen Fiscal SAT +SAT Tax Regime,Régimen Fiscal SAT SAT UOM Key,Clave SAT de UDM Tax Id does not comply with SAT specifications,El RFC cumple con las especificaciones del SAT Tax Type,Tipo de Impuesto diff --git a/erpnext_mexico_compliance/translations/es.csv b/erpnext_mexico_compliance/translations/es.csv index 09c3d45..357a34c 100644 --- a/erpnext_mexico_compliance/translations/es.csv +++ b/erpnext_mexico_compliance/translations/es.csv @@ -9,7 +9,7 @@ SAT CFDI Use,Uso de CFDI SAT SAT Payment Option,Método de Pago SAT SAT Payment Method,Forma de Pago SAT SAT Product or Service Key,Clave SAT de Producto o Servicio -SAT Tax System,Régimen Fiscal SAT +SAT Tax Regime,Régimen Fiscal SAT SAT UOM Key,Clave SAT de UDM Tax Id does not comply with SAT specifications,El RFC cumple con las especificaciones del SAT Tax Type,Tipo de Impuesto From 357bf0afd04d614ea129fb41c3535703c328d83a Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 10 Aug 2024 15:42:21 -0600 Subject: [PATCH 31/62] feat(company): add tax regime field --- .../custom/company.json | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/company.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/company.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/company.json new file mode 100644 index 0000000..5bd8536 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/company.json @@ -0,0 +1,72 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-10 02:01:55.589523", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Company", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_tax_regime", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 10, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_id", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Tax Regime", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-10 02:01:55.589523", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Company-mx_tax_regime", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Tax Regime", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Company", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} From c18a42d34cbcbaef94bca20568fca0e0895c28cf Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 10 Aug 2024 16:20:26 -0600 Subject: [PATCH 32/62] feat(csd): add get issuer method --- .../digital_signing_certificate.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py index 62cd4ce..eb81730 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py @@ -2,9 +2,11 @@ # For license information, please see license.txt import frappe +from erpnext.setup.doctype.company.company import Company from frappe import _ from frappe.model.document import Document from frappe.utils.file_manager import get_file +from satcfdi.create.cfd.cfdi40 import Emisor from satcfdi.exceptions import CFDIError from satcfdi.models import Signer @@ -116,3 +118,24 @@ def branch_name(self) -> str | None: the triad is not complete. """ return self.get_signer().branch_name if self.triad_is_complete else None + + def get_company_doc(self) -> Company: + """Retrieves the Company doctype associated with the current instance. + + Returns: + Company: The Company doctype. + """ + return frappe.get_doc("Company", self.company) + + def get_issuer(self) -> Emisor: + """Creates an Emisor object from the current instance. + + Returns: + Emisor: The issuer information, including RFC, name, and tax regime. + """ + company = self.get_company_doc() + if not company.mx_tax_regime: + frappe.throw(_("Company has no Tax regime")) + return Emisor( + rfc=self.rfc, nombre=self.legal_name, regimen_fiscal=company.mx_tax_regime + ) From 27641a69978031dfe13d815ce06b1de8b925f293 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sun, 11 Aug 2024 18:18:08 -0600 Subject: [PATCH 33/62] feat(sales invoice): add method to create a cfdi receiver --- .../custom/sales_invoice.json | 90 ++++++------ .../digital_signing_certificate.py | 4 +- .../overrides/sales_invoice.py | 133 +++++++++++++++++- 3 files changed, 178 insertions(+), 49 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json index c90d580..1b2a2fb 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json @@ -25,7 +25,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 210, + "idx": 209, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -95,7 +95,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "sat_cfdi_use", + "insert_after": "mx_cfdi_use", "is_system_generated": 0, "is_virtual": 0, "label": null, @@ -137,7 +137,7 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:47:46.258744", + "creation": "2024-06-27 19:09:41.529406", "default": null, "depends_on": null, "description": null, @@ -145,33 +145,33 @@ "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "mx_compliance_sat_payment_option", + "fieldname": "mode_of_payment", "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 210, + "idx": 213, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "cfdi_40", + "insert_after": "column_break_206", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT Payment Option", + "label": "Mode of Payment", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-06-27 19:53:20.792645", + "modified": "2022-12-19 16:24:16.564574", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_sat_payment_option", + "name": "Sales Invoice-mode_of_payment", "no_copy": 0, "non_negative": 0, - "options": "SAT Payment Option", + "options": "Mode of Payment", "owner": "Administrator", "permlevel": 0, "precision": "", @@ -179,7 +179,7 @@ "print_hide_if_no_value": 0, "print_width": null, "read_only": 0, - "read_only_depends_on": null, + "read_only_depends_on": "", "report_hide": 0, "reqd": 1, "search_index": 0, @@ -200,7 +200,7 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:41.529406", + "creation": "2024-06-27 19:09:42.668602", "default": null, "depends_on": null, "description": null, @@ -208,33 +208,33 @@ "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "mode_of_payment", + "fieldname": "mx_cfdi_use", "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 213, + "idx": 211, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "column_break_206", + "insert_after": "mx_payment_option", "is_system_generated": 0, "is_virtual": 0, - "label": "Mode of Payment", + "label": "SAT CFDI Use", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 16:24:16.564574", + "modified": "2024-06-27 19:53:20.818669", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-mode_of_payment", + "name": "Sales Invoice-mx_cfdi_use", "no_copy": 0, "non_negative": 0, - "options": "Mode of Payment", + "options": "SAT CFDI Use", "owner": "Administrator", "permlevel": 0, "precision": "", @@ -242,7 +242,7 @@ "print_hide_if_no_value": 0, "print_width": null, "read_only": 0, - "read_only_depends_on": "", + "read_only_depends_on": null, "report_hide": 0, "reqd": 1, "search_index": 0, @@ -263,51 +263,51 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:42.668602", + "creation": "2024-06-27 19:09:41.796187", "default": null, "depends_on": null, "description": null, "docstatus": 0, "dt": "Sales Invoice", - "fetch_from": null, + "fetch_from": "mode_of_payment.sat_payment_method", "fetch_if_empty": 0, - "fieldname": "sat_cfdi_use", - "fieldtype": "Link", + "fieldname": "mx_payment_mode", + "fieldtype": "Data", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 211, + "idx": 214, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "mx_compliance_sat_payment_option", + "insert_after": "mode_of_payment", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT CFDI Use", + "label": "SAT Payment Method", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-06-27 19:53:20.818669", + "modified": "2022-12-19 21:38:43.086168", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-sat_cfdi_use", + "name": "Sales Invoice-mx_payment_mode", "no_copy": 0, "non_negative": 0, - "options": "SAT CFDI Use", + "options": null, "owner": "Administrator", "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -326,51 +326,51 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "creation": "2024-06-27 19:09:41.796187", + "creation": "2024-06-27 19:47:46.258744", "default": null, "depends_on": null, "description": null, "docstatus": 0, "dt": "Sales Invoice", - "fetch_from": "mode_of_payment.sat_payment_method", + "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "sat_payment_mode", - "fieldtype": "Data", + "fieldname": "mx_payment_option", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 215, + "idx": 210, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "mode_of_payment", + "insert_after": "cfdi_40", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT Payment Method", + "label": "SAT Payment Option", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 21:38:43.086168", + "modified": "2024-06-27 19:53:20.792645", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-sat_payment_mode", + "name": "Sales Invoice-mx_payment_option", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "SAT Payment Option", "owner": "Administrator", "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "show_dashboard": 0, "sort_options": 0, @@ -384,4 +384,4 @@ "links": [], "property_setters": [], "sync_on_migrate": 1 -} \ No newline at end of file +} diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py index eb81730..09302c9 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py @@ -135,7 +135,9 @@ def get_issuer(self) -> Emisor: """ company = self.get_company_doc() if not company.mx_tax_regime: - frappe.throw(_("Company has no Tax regime")) + link = f'{company.name}' + msg = _("Company {0} has no tax regime").format(link) + frappe.throw(msg) return Emisor( rfc=self.rfc, nombre=self.legal_name, regimen_fiscal=company.mx_tax_regime ) diff --git a/erpnext_mexico_compliance/overrides/sales_invoice.py b/erpnext_mexico_compliance/overrides/sales_invoice.py index b937860..8791c7c 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice.py @@ -2,19 +2,146 @@ Copyright (c) 2022, TI Sin Problemas and contributors For license information, please see license.txt """ + +import frappe from erpnext.accounts.doctype.sales_invoice import sales_invoice +from erpnext.setup.doctype.company.company import Company, get_default_company_address from frappe import _ +from frappe.contacts.doctype.address.address import Address +from satcfdi.create.cfd import cfdi40 + +from .customer import Customer class SalesInvoice(sales_invoice.SalesInvoice): """ERPNext Sales Invoice override""" - def get_sat_payment_method(self): - """Returns SAT Payment method code""" - return self.sat_payment_method.split("-")[0].strip() + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + mx_payment_option: DF.Link + mode_of_payment: DF.Link + mx_cfdi_use: DF.Link + mx_payment_mode: DF.Data + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + if not self.company_address: + self.company_address = get_default_company_address(self.company) def get_invoice_service_dates(self) -> str: """Returns invoice dates as a formatted string""" start_date = _("From {}").format(self.from_date) if self.from_date else None end_date = _("To {}").format(self.to_date) if self.to_date else None return f"{start_date} {end_date}".strip() + + @property + def company_doc(self) -> Company: + """Company that created the invoice + + Returns: + Company: Company doctype + """ + return frappe.get_doc("Company", self.company) + + @property + def customer_doc(self) -> Customer: + """Customer of the invoice + + Returns: + Customer: Customer doctype + """ + return frappe.get_doc("Customer", self.customer) + + @property + def company_address_doc(self) -> Address: + """Address of the issuer company + + Returns: + Company: Company address doctype + """ + return frappe.get_doc("Address", self.company_address) + + @property + def customer_address_doc(self) -> Address: + """Address of the customer + + Returns: + Address: Customer address doctype + """ + return frappe.get_doc("Address", self.customer_address) + + def validate_company(self): + """Validates the company information on the invoice. + + This function checks if the company has an address and if it has a valid zip code. + If any issues are found, an error message is thrown with the list of issues. + + Raises: + frappe.ValidationError: If any issues were found. + """ + msgs = [] + if self.company_address: + address = self.company_address_doc + if not address.pincode: + link = f'{address.name}' + msgs.append(_("Address {0} has no zip code").format(link)) + else: + company = self.company_doc + link = f'{company.name}' + msgs.append(_("Company {0} has no address").format(link)) + + if len(msgs) > 0: + frappe.throw(msgs, as_list=True) + + def validate_customer(self): + """Validates the customer information on the invoice. + + This function checks if the customer has a tax ID, tax regime, and a valid billing address. + It also checks if the customer's address has a valid zip code. + If any issues are found, an error message is thrown with the list of issues. + + Raises: + frappe.ValidationError: If any issues were found. + """ + customer_link = ( + f'{self.customer_doc.name}' + ) + msgs = [] + if not self.customer_doc.tax_id: + msgs.append(_("Customer {0} has no tax ID").format(customer_link)) + + if not self.customer_doc.mx_tax_regime: + msgs.append(_("Customer {0} has no tax regime").format(customer_link)) + + if self.customer_address: + address = self.customer_address_doc + if not address.pincode: + link = f'{address.name}' + msgs.append(_("Customer address {0} has no zip code").format(link)) + else: + msgs.append(_("Invoice has no billing address")) + + if len(msgs) > 0: + frappe.throw(msgs, as_list=True) + + self.customer_doc.validate_mexican_tax_id() + + def get_cfdi_receiver(self) -> cfdi40.Receptor: + """Returns a `cfdi40.Receptor` object representing the receiver of the CFDI document for + this sales invoice. + + Returns: + cfdi40.Receptor: Required node to specify the information of the taxpayer receiving the + receipt. + """ + return cfdi40.Receptor( + rfc=self.customer_doc.tax_id, + nombre=self.customer_name.upper(), + domicilio_fiscal_receptor=self.customer_address_doc.pincode, + regimen_fiscal_receptor=self.customer_doc.mx_tax_regime, + uso_cfdi=self.mx_cfdi_use, + ) + From 83df643ea9b965dd79e13a84416cbef898b0393e Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Mon, 12 Aug 2024 02:58:03 -0600 Subject: [PATCH 34/62] feat(sales invoice): add all the methods to create a cfdi --- .../custom/item.json | 10 +- .../custom/sales_invoice_item.json | 18 +-- .../erpnext_mexico_compliance/custom/uom.json | 6 +- .../overrides/customer.py | 22 ++-- .../overrides/sales_invoice.py | 105 ++++++++++++------ .../overrides/sales_invoice_item.py | 92 +++++++++++++-- 6 files changed, 183 insertions(+), 70 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json index f0497e2..50e429c 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json @@ -19,7 +19,7 @@ "dt": "Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "cfdi_40", + "fieldname": "cfdi", "fieldtype": "Tab Break", "hidden": 0, "hide_border": 0, @@ -39,7 +39,7 @@ "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 15:51:31.690229", + "modified": "2024-08-11 19:46:06.465750", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Item-cfdi_40", @@ -82,7 +82,7 @@ "dt": "Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "sat_product_or_service_key", + "fieldname": "mx_product_service_key", "fieldtype": "Link", "hidden": 0, "hide_border": 0, @@ -95,14 +95,14 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "cfdi_40", + "insert_after": "cfdi", "is_system_generated": 0, "is_virtual": 0, "label": "SAT Product or Service Key", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 15:51:48.922472", + "modified": "2024-08-11 21:37:19.858147", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Item-sat_product_or_service_key", diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json index da611e2..4e33032 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json @@ -19,13 +19,13 @@ "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_cfdi", + "fieldname": "cfdi", "fieldtype": "Section Break", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 103, + "idx": 104, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -39,7 +39,7 @@ "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-07-30 00:21:39.107146", + "modified": "2024-08-11 21:15:30.639653", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Sales Invoice Item-custom_cfdi", @@ -80,29 +80,29 @@ "description": null, "docstatus": 0, "dt": "Sales Invoice Item", - "fetch_from": "item_code.sat_product_or_service_key", + "fetch_from": "item_code.mx_product_service_key", "fetch_if_empty": 1, - "fieldname": "sat_product_or_service_key", + "fieldname": "mx_product_service_key", "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 104, + "idx": 105, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_cfdi", + "insert_after": "cfdi", "is_system_generated": 0, "is_virtual": 0, "label": "SAT Product or Service Key", "length": 0, "link_filters": null, "mandatory_depends_on": "", - "modified": "2022-12-19 16:14:48.913990", + "modified": "2024-08-11 22:03:06.415334", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Sales Invoice Item-sat_product_or_service_key", @@ -132,4 +132,4 @@ "links": [], "property_setters": [], "sync_on_migrate": 1 -} \ No newline at end of file +} diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json index f54d105..ef1f37a 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json @@ -82,7 +82,7 @@ "dt": "UOM", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "sat_uom_key", + "fieldname": "mx_uom_key", "fieldtype": "Link", "hidden": 0, "hide_border": 0, @@ -102,7 +102,7 @@ "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-19 16:59:28.711146", + "modified": "2024-08-11 23:32:21.659300", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "UOM-sat_uom_key", @@ -132,4 +132,4 @@ "links": [], "property_setters": [], "sync_on_migrate": 1 -} \ No newline at end of file +} diff --git a/erpnext_mexico_compliance/overrides/customer.py b/erpnext_mexico_compliance/overrides/customer.py index 2b38321..47140e4 100644 --- a/erpnext_mexico_compliance/overrides/customer.py +++ b/erpnext_mexico_compliance/overrides/customer.py @@ -13,21 +13,25 @@ class Customer(ERPNextCustomer): """ERPNext Customer override""" + @property + def tax_id_is_rfc(self) -> bool: + """True if tax id complies with RFC format""" + exp = r"^([A-ZÑ]|\&){3,4}[0-9]{2}(0[1-9]|1[0-2])([12][0-9]|0[1-9]|3[01])[A-Z0-9]{3}$" + pattern = re.compile(exp) + return bool(re.match(pattern, self.tax_id)) + def validate_mexican_tax_id(self): """Validate customer name for SAT compliance""" - exp = "^[A-ZÑ&]{3,4}[0-9]{2}(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])(?:[A-Z\d]{3})$" - pattern = re.compile(exp) - if not re.match(pattern, self.tax_id): - frappe.throw( - _("Tax Id does not comply with SAT specifications"), - title=_("Invalid Tax Id"), - ) + if not self.tax_id_is_rfc: + msg = _("Tax Id does not comply with SAT specifications") + title = _("Invalid Tax Id") + frappe.throw(msg, title=title) def get_primary_address(self): """Get customer primary address document""" return frappe.get_doc("Address", self.customer_primary_address) - @frappe.whitelist() + @property def is_mexican(self): """Return True if primary address is in Mexico""" if not self.customer_primary_address: @@ -37,7 +41,7 @@ def is_mexican(self): return address.country.upper().startswith("MEX") def validate(self): - if self.tax_id and self.is_mexican(): + if self.is_mexican: self.tax_id = self.tax_id.upper() self.validate_mexican_tax_id() diff --git a/erpnext_mexico_compliance/overrides/sales_invoice.py b/erpnext_mexico_compliance/overrides/sales_invoice.py index 8791c7c..676fb7b 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice.py @@ -3,12 +3,15 @@ For license information, please see license.txt """ +from decimal import Decimal + import frappe from erpnext.accounts.doctype.sales_invoice import sales_invoice from erpnext.setup.doctype.company.company import Company, get_default_company_address from frappe import _ from frappe.contacts.doctype.address.address import Address -from satcfdi.create.cfd import cfdi40 +from frappe.model.naming import NamingSeries +from satcfdi.create.cfd import catalogos, cfdi40 from .customer import Customer @@ -31,48 +34,55 @@ def __init__(self, *args, **kwargs): if not self.company_address: self.company_address = get_default_company_address(self.company) - def get_invoice_service_dates(self) -> str: - """Returns invoice dates as a formatted string""" - start_date = _("From {}").format(self.from_date) if self.from_date else None - end_date = _("To {}").format(self.to_date) if self.to_date else None - return f"{start_date} {end_date}".strip() - @property - def company_doc(self) -> Company: - """Company that created the invoice + def subscription_duration_display(self) -> str: + """Returns a string displaying the service duration in a formatted manner. + + The service duration is displayed as a range between the start date and the end date, if + both are provided. If only one of them is provided, the string will display the start or + end date accordingly. If neither is provided, an empty string is returned. + + Examples: + - From `start_date` + - To `end_date` + - From `start_date` To `end_date` Returns: - Company: Company doctype + str: The formatted service duration string. """ + start_date = _("From {}").format(self.from_date) if self.from_date else "" + end_date = _("To {}").format(self.to_date) if self.to_date else "" + return f"{start_date} {end_date}".strip() + + @property + def company_doc(self) -> Company: + """Company DocType that created the invoice""" return frappe.get_doc("Company", self.company) @property def customer_doc(self) -> Customer: - """Customer of the invoice - - Returns: - Customer: Customer doctype - """ + """Customer DocType of the invoice""" return frappe.get_doc("Customer", self.customer) @property def company_address_doc(self) -> Address: - """Address of the issuer company - - Returns: - Company: Company address doctype - """ + """Address DocType of the issuer company""" return frappe.get_doc("Address", self.company_address) @property def customer_address_doc(self) -> Address: - """Address of the customer - - Returns: - Address: Customer address doctype - """ + """Address DocType of the customer""" return frappe.get_doc("Address", self.customer_address) + @property + def tax_accounts(self) -> list[dict]: + heads = [t.account_head for t in self.taxes] + return frappe.get_list( + "Account", + filters={"name": ["in", heads]}, + fields=["name", "tax_type", "tax_rate"], + ) + def validate_company(self): """Validates the company information on the invoice. @@ -129,14 +139,10 @@ def validate_customer(self): self.customer_doc.validate_mexican_tax_id() - def get_cfdi_receiver(self) -> cfdi40.Receptor: - """Returns a `cfdi40.Receptor` object representing the receiver of the CFDI document for - this sales invoice. - - Returns: - cfdi40.Receptor: Required node to specify the information of the taxpayer receiving the - receipt. - """ + @property + def cfdi_receiver(self) -> cfdi40.Receptor: + """`cfdi40.Receptor` object representing the receiver of the CFDI document for this sales + invoice.""" return cfdi40.Receptor( rfc=self.customer_doc.tax_id, nombre=self.customer_name.upper(), @@ -145,3 +151,36 @@ def get_cfdi_receiver(self) -> cfdi40.Receptor: uso_cfdi=self.mx_cfdi_use, ) + @property + def cfdi_items(self) -> list[cfdi40.Concepto]: + """Returns a list of `cfdi40.Concepto` objects representing the items of the CFDI document + for this sales invoice.""" + cfdi_items = [] + for item in self.items: + discount = Decimal(item.discount_amount) if item.discount_amount else None + cfdi_items.append( + cfdi40.Concepto( + clave_prod_serv=item.mx_product_service_key, + cantidad=Decimal(item.qty), + clave_unidad=item.uom_doc.mx_uom_key, + descripcion=item.cfdi_description, + valor_unitario=Decimal(item.rate), + no_identificacion=item.item_code, + descuento=discount, + impuestos=item.cfdi_taxes, + ) + ) + return cfdi_items + + @property + def cfdi_series(self) -> str: + """Series code for the CFDI document for this sales invoice.""" + prefix = str(NamingSeries(self.naming_series).get_prefix()) + return prefix if prefix[-1].isalnum() else prefix[:-1] + + @property + def cfdi_folio(self) -> str: + """Folio number for the CFDI document for this sales invoice.""" + prefix = str(NamingSeries(self.naming_series).get_prefix()) + return str(int(self.name.replace(prefix, ""))) + diff --git a/erpnext_mexico_compliance/overrides/sales_invoice_item.py b/erpnext_mexico_compliance/overrides/sales_invoice_item.py index e9921b9..b7af942 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice_item.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice_item.py @@ -2,29 +2,70 @@ Copyright (c) 2022, TI Sin Problemas and contributors For license information, please see license.txt """ + +from decimal import Decimal + import frappe +from erpnext.accounts.doctype.sales_invoice_item import sales_invoice_item +from erpnext.setup.doctype.uom.uom import UOM +from erpnext.stock.doctype.item.item import Item from frappe import _ from frappe.utils import strip_html -from erpnext.accounts.doctype.sales_invoice_item import sales_invoice_item +from satcfdi.create.cfd import catalogos, cfdi40 class SalesInvoiceItem(sales_invoice_item.SalesInvoiceItem): """ERPNext Sales Invoice Item override""" + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + mx_product_service_key: DF.Link + def before_validate(self): """Add missing fields before validation""" if self.item_code: item = frappe.get_doc("Item", self.item_code) - self.sat_product_or_service_key = item.sat_product_or_service_key + self.mx_product_service_key = item.mx_product_service_key - def get_item(self): - """Returns related Item DocType if any""" - if not self.item_code: - return None - return frappe.get_doc("Item", self.item_code) + @property + def item_doc(self) -> Item: + """Related Item DocType + + Returns: + Item: Item doctype + """ + if self.item_code: + return frappe.get_doc("Item", self.item_code) + return None - def get_service_duration(self): - """Returns a string with From and To dates of services""" + @property + def uom_doc(self) -> UOM: + """The UOM (Unit of Measure) DocType of the item. + + Returns: + UOM: UOM of the item + """ + return frappe.get_doc("UOM", self.uom) + + @property + def service_duration_display(self) -> str: + """Returns a string displaying the service duration in a formatted manner. + + The service duration is displayed as a range between the start date and the end date, if + both are provided. If only one of them is provided, the string will display the start or + end date accordingly. If neither is provided, an empty string is returned. + + Examples: + - From `start_date` + - To `end_date` + - From `start_date` To `end_date` + + Returns: + str: The formatted service duration string. + """ start_date = "" if self.service_start_date: start_date = _("From {}").format(self.service_start_date) @@ -35,15 +76,44 @@ def get_service_duration(self): return f"{start_date} {end_date}".strip() - def get_cfdi_description(self): + @property + def cfdi_description(self): """Returns description ready to stamp a CFDI""" cfdi_description = f"{self.item_name}" item_description = strip_html(self.description) if all([self.description, self.item_name != item_description]): cfdi_description += f" - {item_description}" - invoice_dates = self.parent_doc.get_invoice_service_dates() + invoice_dates = self.parent_doc.subscription_duration_display if invoice_dates: cfdi_description += f" ({invoice_dates})" return cfdi_description.strip() + + @property + def cfdi_taxes(self) -> cfdi40.Impuestos: + """The `cfdi40.Impuestos` object representing the taxes for this sales invoice item.""" + withholding_taxes = [] + transferred_taxes = [] + for account in self.parent_doc.tax_accounts: + tax_type = catalogos.Impuesto[account["tax_type"]] + tax_rate = account["tax_rate"] / 100 + + if tax_rate < 0: + withholding = cfdi40.Retencion( + impuesto=tax_type, + tipo_factor=catalogos.TipoFactor.TASA, + tasa_o_cuota=Decimal(tax_rate * -1), + ) + withholding_taxes.append(withholding) + else: + transferred = cfdi40.Traslado( + impuesto=tax_type, + tipo_factor=catalogos.TipoFactor.TASA, + tasa_o_cuota=Decimal(tax_rate), + ) + transferred_taxes.append(transferred) + + return cfdi40.Impuestos( + retenciones=withholding_taxes, traslados=transferred_taxes + ) From eca40695a5eee0872f85cb1220afb405b2a4afc2 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Mon, 12 Aug 2024 23:03:07 -0600 Subject: [PATCH 35/62] fix(sales invoice): tax decimals validation error --- erpnext_mexico_compliance/overrides/sales_invoice_item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext_mexico_compliance/overrides/sales_invoice_item.py b/erpnext_mexico_compliance/overrides/sales_invoice_item.py index b7af942..240a15f 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice_item.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice_item.py @@ -97,7 +97,7 @@ def cfdi_taxes(self) -> cfdi40.Impuestos: transferred_taxes = [] for account in self.parent_doc.tax_accounts: tax_type = catalogos.Impuesto[account["tax_type"]] - tax_rate = account["tax_rate"] / 100 + tax_rate = Decimal(account["tax_rate"]) / 100 if tax_rate < 0: withholding = cfdi40.Retencion( @@ -110,7 +110,7 @@ def cfdi_taxes(self) -> cfdi40.Impuestos: transferred = cfdi40.Traslado( impuesto=tax_type, tipo_factor=catalogos.TipoFactor.TASA, - tasa_o_cuota=Decimal(tax_rate), + tasa_o_cuota=tax_rate, ) transferred_taxes.append(transferred) From ea8425e6d4ca4b14709688f9c31d88647df84235 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Tue, 13 Aug 2024 23:52:45 -0600 Subject: [PATCH 36/62] fix(digital signing certificate): various errors when deleting --- .../digital_signing_certificate.json | 35 ++--------------- .../digital_signing_certificate.py | 38 +++++++++++++------ 2 files changed, 30 insertions(+), 43 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json index f025096..2b0cb1b 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json @@ -1,7 +1,7 @@ { "actions": [], "allow_rename": 1, - "autoname": "format:{company}-{###}", + "autoname": "format:{company}-{##}", "creation": "2024-08-09 21:12:07.021650", "description": "Company's Digital Signing Certificate to sign CFDI ", "doctype": "DocType", @@ -13,11 +13,7 @@ "column_break_ymzu", "certificate", "key", - "password", - "column_break_jted", - "legal_name", - "rfc", - "branch_name" + "password" ], "fields": [ { @@ -50,35 +46,10 @@ "label": "Password", "no_copy": 1 }, - { - "description": "Certificate's RFC", - "fieldname": "rfc", - "fieldtype": "Data", - "is_virtual": 1, - "label": "RFC" - }, { "fieldname": "column_break_ymzu", "fieldtype": "Column Break" }, - { - "description": "Certificate's legal name", - "fieldname": "legal_name", - "fieldtype": "Data", - "is_virtual": 1, - "label": "Legal Name" - }, - { - "description": "Certificate's branch name", - "fieldname": "branch_name", - "fieldtype": "Data", - "is_virtual": 1, - "label": "Branch Name" - }, - { - "fieldname": "column_break_jted", - "fieldtype": "Column Break" - }, { "fieldname": "company_section", "fieldtype": "Section Break", @@ -92,7 +63,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-08-10 01:32:36.071690", + "modified": "2024-08-13 18:41:10.791522", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Digital Signing Certificate", diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py index 09302c9..2d75592 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py @@ -20,13 +20,10 @@ class DigitalSigningCertificate(Document): if TYPE_CHECKING: from frappe.types import DF - branch_name: DF.Data | None certificate: DF.Attach | None company: DF.Link key: DF.Attach | None - legal_name: DF.Data | None password: DF.Password | None - rfc: DF.Data | None # end: auto-generated types def _get_file(self, field: str) -> bytes: @@ -52,13 +49,17 @@ def read_key(self) -> bytes: frappe.throw(_("Key file not configured")) return self._get_file("key") - def get_signer(self) -> Signer: + @property + def signer(self) -> Signer | None: """Returns a Signer object loaded with the certificate, key, and password of the current DigitalSigningCertificate instance. Returns: - Signer: CSD Signer + Signer | None: CSD Signer """ + if not self.triad_is_complete: + return None + certificate = self.read_certificate() key = self.read_key() password = self.get_password() @@ -73,9 +74,9 @@ def get_signer(self) -> Signer: def validate_certificate(self): """Validates the digital signing certificate by checking if the certificate files and password are correctly configured.""" - self.get_signer() - msg = _("Certificate files and password are valid") - frappe.msgprint(msg=msg, title=_("Success"), indicator="green") + if self.signer: + msg = _("Certificate files and password are valid") + frappe.msgprint(msg=msg, title=_("Success"), indicator="green") @property def triad_is_complete(self) -> bool: @@ -89,6 +90,21 @@ def triad_is_complete(self) -> bool: """ return all([self.certificate, self.key, self.password]) + def validate(self): + """Validates the digital signing certificate. + + This function checks if the digital signing certificate is valid by verifying if the + `signer` attribute is not None. If the `signer` is None, it means that the certificate + files and password are not valid, and a `frappe.ValidationError` is raised with the + message "Certificate files and password are not valid". + + Raises: + frappe.ValidationError: If the digital signing certificate is not valid. + """ + + if self.triad_is_complete and not self.signer: + frappe.throw(_("Certificate files and password are not valid")) + @property def legal_name(self) -> str | None: """Returns the legal name associated with the digital signing certificate. @@ -97,7 +113,7 @@ def legal_name(self) -> str | None: str | None: The legal name associated with the digital signing certificate, or None if the triad is not complete. """ - return self.get_signer().legal_name if self.triad_is_complete else None + return self.signer.legal_name if self.signer else None @property def rfc(self) -> str | None: @@ -107,7 +123,7 @@ def rfc(self) -> str | None: str | None: The RFC associated with the digital signing certificate, or None if the triad is not complete. """ - return self.get_signer().rfc if self.triad_is_complete else None + return self.signer.rfc if self.signer else None @property def branch_name(self) -> str | None: @@ -117,7 +133,7 @@ def branch_name(self) -> str | None: str | None: The branch name associated with the digital signing certificate, or None if the triad is not complete. """ - return self.get_signer().branch_name if self.triad_is_complete else None + return self.signer.branch_name if self.signer else None def get_company_doc(self) -> Company: """Retrieves the Company doctype associated with the current instance. From 387e0d5f4ead66b83d2ea5728bd66fbd1911207f Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 14 Aug 2024 00:39:42 -0600 Subject: [PATCH 37/62] feat: add webservice client module and settings --- .../cfdi_stamping_settings.js | 12 +-- .../cfdi_stamping_settings.json | 48 ++++++------ .../cfdi_stamping_settings.py | 75 +++++++------------ .../ws_client/__init__.py | 25 +++++++ erpnext_mexico_compliance/ws_client/client.py | 63 ++++++++++++++++ .../ws_client/exceptions.py | 6 ++ 6 files changed, 149 insertions(+), 80 deletions(-) create mode 100644 erpnext_mexico_compliance/ws_client/__init__.py create mode 100644 erpnext_mexico_compliance/ws_client/client.py create mode 100644 erpnext_mexico_compliance/ws_client/exceptions.py diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.js b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.js index d154670..1476785 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.js +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.js @@ -2,15 +2,5 @@ // For license information, please see license.txt frappe.ui.form.on("CFDI Stamping Settings", { - refresh(frm) { - if ( - frm.doc.signing_certificate && - frm.doc.signing_key && - frm.doc.signing_password - ) { - frm.add_custom_button(__("Validate Signing Certificate"), () => { - frm.call("validate_signing_certificate"); - }); - } - }, + // refresh(frm) {}, }); diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json index d2824aa..c835d7f 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json @@ -5,42 +5,46 @@ "doctype": "DocType", "engine": "InnoDB", "field_order": [ - "csd_column", - "signing_certificate", - "signing_key", - "signing_password" + "web_service_section", + "api_key", + "test_mode", + "column_break_zjrm", + "available_credits" ], "fields": [ { - "description": ".cer file of the Digital Signing Certificate", - "fieldname": "signing_certificate", - "fieldtype": "Attach", - "in_list_view": 1, - "label": "Certificate" + "fieldname": "web_service_section", + "fieldtype": "Section Break", + "label": "Web Service" }, { - "fieldname": "csd_column", - "fieldtype": "Column Break", - "label": "Digital Signing Certificate" + "fieldname": "api_key", + "fieldtype": "Password", + "label": "API Key" }, { - "description": ".key file of the Digital Signing Certificate", - "fieldname": "signing_key", - "fieldtype": "Attach", - "in_list_view": 1, - "label": "Certificate Key" + "default": "1", + "fieldname": "test_mode", + "fieldtype": "Check", + "label": "Test mode" }, { - "fieldname": "signing_password", - "fieldtype": "Password", - "in_list_view": 1, - "label": "Certificate Password" + "fieldname": "column_break_zjrm", + "fieldtype": "Column Break" + }, + { + "depends_on": "api_key", + "description": "Every time a CFDI gets stamped, 1 credit is consumed", + "fieldname": "available_credits", + "fieldtype": "Int", + "is_virtual": 1, + "label": "Available credits" } ], "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2024-08-09 16:45:34.677933", + "modified": "2024-08-13 01:44:43.369481", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "CFDI Stamping Settings", diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py index a4e255b..f5e561a 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py @@ -2,66 +2,47 @@ # For license information, please see license.txt import frappe +from erpnext_mexico_compliance import ws_client from frappe import _ from frappe.model.document import Document -from frappe.utils.file_manager import get_file -from frappe.utils.password import get_decrypted_password -from satcfdi.exceptions import CFDIError -from satcfdi.models import Signer class CFDIStampingSettings(Document): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. - def _get_file(self, field: str) -> tuple[str, bytes]: - return get_file(getattr(self, field)) + from typing import TYPE_CHECKING - def get_certificate(self) -> bytes: - """Returns the Digital Signing Certificate + if TYPE_CHECKING: + from frappe.types import DF - Returns: - bytes: Digital Signing Certificate - """ - if not self.signing_certificate: - frappe.throw(_("Signing Certificate not configured")) - return self._get_file("signing_certificate")[1] - - def get_key(self) -> bytes: - """Returns the Digital Signing Certificate Key - - Returns: - bytes: Digital Signing Certificate Key - """ - if not self.signing_key: - frappe.throw(_("Signing Key not configured")) - return self._get_file("signing_key")[1] + api_key: DF.Password | None + available_credits: DF.Int + test_mode: DF.Check + # end: auto-generated types - def get_certificate_password(self) -> str: - """Returns the Digital Signing Certificate Key Password + def get_api_key(self) -> str: + """Retrieves the API key from the CFDI Stamping Settings document. Returns: - str: Password for the Digital Signing Certificate key + str: The API key. """ - if not self.signing_password: - frappe.throw(_("Signing Password not configured")) - return get_decrypted_password(self.doctype, self.name, "signing_password") + return self.get_password("api_key") - def get_csd_signer(self) -> Signer: - """Returns Signer from the Digital Signing Certificate + @property + def available_credits(self) -> int: + """Retrieves the available credits from the CFDI Web Service. Returns: - Signer: CSD Signer + int: The number of available credits. """ - certificate = self.get_certificate() - key = self.get_key() - password = self.get_certificate_password() - try: - signer = Signer.load(certificate=certificate, key=key, password=password) - except (CFDIError, ValueError) as e: - frappe.throw(title="Invalid Signing Certificate", msg=str(e)) - - return signer - - @frappe.whitelist() - def validate_signing_certificate(self): - """Validate the CSD Signing Certificate""" - self.get_csd_signer() + if self.api_key: + client = ws_client.get_ws_client() + try: + available_credits = client.get_available_credits() + except ws_client.WSClientException as exception: + frappe.throw(str(exception), title=_("CFDI Web Service Error")) + else: + available_credits = 0 + + return available_credits diff --git a/erpnext_mexico_compliance/ws_client/__init__.py b/erpnext_mexico_compliance/ws_client/__init__.py new file mode 100644 index 0000000..f6b23ad --- /dev/null +++ b/erpnext_mexico_compliance/ws_client/__init__.py @@ -0,0 +1,25 @@ +"""Copyright (c) 2024, TI Sin Problemas and contributors +For license information, please see license.txt""" + +import frappe + +from . import client +from .exceptions import WSClientException + + +def get_ws_client() -> client.WSClient: + """Retrieves a WSClient instance based on the current CFDI Stamping Settings. + + Returns: + client.WSClient: A WSClient instance configured with the current API key and operation mode. + """ + settings = frappe.get_single("CFDI Stamping Settings") + api_key = settings.get_api_key() + mode_map = { + 0: client.WSClient.OperationMode.PROD, + 1: client.WSClient.OperationMode.TEST, + } + return client.WSClient(api_key, mode_map[settings.test_mode]) + + +__all__ = ["get_ws_client", "WSClientException"] diff --git a/erpnext_mexico_compliance/ws_client/client.py b/erpnext_mexico_compliance/ws_client/client.py new file mode 100644 index 0000000..ce27a61 --- /dev/null +++ b/erpnext_mexico_compliance/ws_client/client.py @@ -0,0 +1,63 @@ +from enum import Enum + +import frappe +from satcfdi.create.cfd.cfdi40 import CFDI +from zeep import Client +from zeep.cache import SqliteCache +from zeep.transports import Transport + +from .exceptions import WSClientException + + +class WSClient: + + class OperationMode(Enum): + PROD = "https://app.facturaloplus.com/ws/servicio.do?wsdl" + TEST = "https://dev.facturaloplus.com/ws/servicio.do?wsdl" + + def __init__(self, api_key: str, mode: OperationMode = OperationMode.TEST) -> None: + self.api_key = api_key + self.client = Client(mode.value, transport=Transport(cache=SqliteCache())) + self.logger = frappe.logger("erpnext_mexico_compliance.ws_client", True) + + def raise_from_code(self, code: str, message: str): + """Raises a WSClientException if the given code is not 200. + + Args: + code (str): The status code to check. + message (str): The error message to raise. + + Raises: + WSClientException: If the code is not 200. + """ + if code != "200": + self.logger.error({"code": code, "message": message}) + raise WSClientException(message, code) + + def stamp(self, cfdi: CFDI) -> tuple[str, str]: + """Stamps a CFDI using the provided client and API key. + + Args: + cfdi (CFDI): The CFDI to be stamped. + + Returns: + tuple[str, str]: A tuple containing the stamped CFDI data and the corresponding message. + + Raises: + WSClientException: If the stamping operation fails. + """ + xml_cfdi = cfdi.xml_bytes().decode("utf-8") + res = self.client.service.timbrar(apikey=self.api_key, xmlCFDI=xml_cfdi) + self.logger.debug({"action": "stamp", "data": xml_cfdi}) + self.raise_from_code(res.code, res.message) + return res.data, res.message + + def get_available_credits(self) -> int: + """Retrieves the available credits from the CFDI Web Service. + + Returns: + int: The number of available credits. + """ + res = self.client.service.consultarCreditosDisponibles(apikey=self.api_key) + self.raise_from_code(res.code, res.message) + return res.data diff --git a/erpnext_mexico_compliance/ws_client/exceptions.py b/erpnext_mexico_compliance/ws_client/exceptions.py new file mode 100644 index 0000000..1e4fd9b --- /dev/null +++ b/erpnext_mexico_compliance/ws_client/exceptions.py @@ -0,0 +1,6 @@ +class WSClientException(Exception): + + def __init__(self, message: str, code: str): + super().__init__(f"{code}: {message}") + self.message = message + self.code = code From 4bf9b706d6f8562f6f51eb273e4fa4f859fa050a Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 14 Aug 2024 20:12:20 -0600 Subject: [PATCH 38/62] feat(cfdi use): add tax regime child table --- .../doctype/sat_cfdi_use/sat_cfdi_use.json | 194 +- .../doctype/sat_cfdi_use/sat_cfdi_use.py | 15 + .../sat_cfdi_use_tax_regime/__init__.py | 0 .../sat_cfdi_use_tax_regime.json | 32 + .../sat_cfdi_use_tax_regime.py | 22 + .../sat_tax_regime/sat_tax_regime.json | 5 + .../doctype/sat_tax_regime/sat_tax_regime.py | 15 +- .../fixtures/sat_cfdi_use.json | 1602 ++++++++++++++++- 8 files changed, 1772 insertions(+), 113 deletions(-) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/__init__.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.py diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json index 82e32ba..355ecbe 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json @@ -1,89 +1,107 @@ { - "actions": [], - "autoname": "field:key", - "default_view": "List", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "enabled", - "section_break", - "key", - "key_name", - "column_break", - "description" - ], - "fields": [ - { - "default": "1", - "fieldname": "enabled", - "fieldtype": "Check", - "label": "Enabled" - }, - { - "fieldname": "section_break", - "fieldtype": "Section Break" - }, - { - "fieldname": "key_name", - "fieldtype": "Data", - "label": "Key Name", - "read_only": 1 - }, - { - "fieldname": "key", - "fieldtype": "Data", - "label": "Key", - "length": 4, - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "column_break", - "fieldtype": "Column Break" - }, - { - "fieldname": "description", - "fieldtype": "Data", - "label": "Description", - "reqd": 1 - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "SAT CFDI Use", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - }, - { - "create": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "share": 1, - "write": 1 - } - ], - "quick_entry": 1, - "show_title_field_in_link": 1, - "sort_field": "key_name", - "sort_order": "ASC", - "states": [], - "title_field": "key_name" -} + "actions": [], + "autoname": "field:key", + "creation": "2024-08-05 22:35:49.169695", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "enabled", + "section_break", + "key", + "key_name", + "column_break", + "description", + "customer_section", + "tax_regimes" + ], + "fields": [ + { + "default": "1", + "fieldname": "enabled", + "fieldtype": "Check", + "label": "Enabled" + }, + { + "fieldname": "section_break", + "fieldtype": "Section Break" + }, + { + "fieldname": "key_name", + "fieldtype": "Data", + "label": "Key Name", + "read_only": 1 + }, + { + "fieldname": "key", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Key", + "length": 4, + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "column_break", + "fieldtype": "Column Break" + }, + { + "fieldname": "description", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Description", + "reqd": 1 + }, + { + "fieldname": "customer_section", + "fieldtype": "Section Break", + "label": "Customer" + }, + { + "fieldname": "tax_regimes", + "fieldtype": "Table", + "label": "Tax regimes", + "options": "SAT CFDI Use Tax Regime" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-08-14 17:41:50.249931", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "SAT CFDI Use", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "show_title_field_in_link": 1, + "sort_field": "key_name", + "sort_order": "ASC", + "states": [], + "title_field": "key_name" +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.py index 4c28137..3032e57 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.py @@ -8,6 +8,21 @@ class SATCFDIUse(Document): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from erpnext_mexico_compliance.erpnext_mexico_compliance.doctype.sat_cfdi_use_tax_regime.sat_cfdi_use_tax_regime import SATCFDIUseTaxRegime + from frappe.types import DF + + description: DF.Data + enabled: DF.Check + key: DF.Data + key_name: DF.Data | None + tax_regimes: DF.Table[SATCFDIUseTaxRegime] + # end: auto-generated types """SAT's CFDI Use""" def before_save(self): diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/__init__.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json new file mode 100644 index 0000000..dcfc2a6 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json @@ -0,0 +1,32 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-08-14 16:51:26.535096", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "tax_regime" + ], + "fields": [ + { + "fieldname": "tax_regime", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Tax Regime", + "options": "SAT Tax Regime" + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2024-08-14 17:46:03.491710", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "SAT CFDI Use Tax Regime", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.py new file mode 100644 index 0000000..e7bfef0 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.py @@ -0,0 +1,22 @@ +# Copyright (c) 2024, TI Sin Problemas and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class SATCFDIUseTaxRegime(Document): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + parent: DF.Data + parentfield: DF.Data + parenttype: DF.Data + tax_regime: DF.Link | None + # end: auto-generated types + pass diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json index 965b368..51c5229 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json @@ -1,6 +1,7 @@ { "actions": [], "autoname": "field:key", + "creation": "2024-08-10 14:06:19.157418", "default_view": "List", "doctype": "DocType", "editable_grid": 1, @@ -33,6 +34,7 @@ { "fieldname": "key", "fieldtype": "Data", + "in_list_view": 1, "label": "Key", "length": 3, "reqd": 1, @@ -45,15 +47,18 @@ { "fieldname": "description", "fieldtype": "Data", + "in_list_view": 1, "label": "Description", "reqd": 1 } ], "index_web_pages_for_search": 1, "links": [], + "modified": "2024-08-14 16:36:37.232829", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "SAT Tax Regime", + "naming_rule": "By fieldname", "owner": "Administrator", "permissions": [ { diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.py index 8b1333a..638099c 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.py @@ -7,7 +7,20 @@ class SATTaxRegime(Document): - """SAT's Tax System""" + """SAT's Tax Regime""" + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + description: DF.Data + enabled: DF.Check + key: DF.Data + key_name: DF.Data | None + # end: auto-generated types def before_save(self): """Set DocType key name""" diff --git a/erpnext_mexico_compliance/fixtures/sat_cfdi_use.json b/erpnext_mexico_compliance/fixtures/sat_cfdi_use.json index 09e6ae1..4e6e51b 100644 --- a/erpnext_mexico_compliance/fixtures/sat_cfdi_use.json +++ b/erpnext_mexico_compliance/fixtures/sat_cfdi_use.json @@ -5,7 +5,75 @@ "enabled": 1, "key": "G01", "key_name": "G01 - Adquisición de mercancías.", - "name": "G01" + "name": "G01", + "tax_regimes": [ + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "G01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Devoluciones, descuentos o bonificaciones.", @@ -13,7 +81,81 @@ "enabled": 1, "key": "G02", "key_name": "G02 - Devoluciones, descuentos o bonificaciones.", - "name": "G02" + "name": "G02", + "tax_regimes": [ + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "616" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "G02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Gastos en general.", @@ -21,7 +163,75 @@ "enabled": 1, "key": "G03", "key_name": "G03 - Gastos en general.", - "name": "G03" + "name": "G03", + "tax_regimes": [ + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "G03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Construcciones.", @@ -29,7 +239,75 @@ "enabled": 1, "key": "I01", "key_name": "I01 - Construcciones.", - "name": "I01" + "name": "I01", + "tax_regimes": [ + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "I01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Mobiliario y equipo de oficina por inversiones.", @@ -37,7 +315,75 @@ "enabled": 1, "key": "I02", "key_name": "I02 - Mobiliario y equipo de oficina por inversiones.", - "name": "I02" + "name": "I02", + "tax_regimes": [ + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "I02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Equipo de transporte.", @@ -45,7 +391,75 @@ "enabled": 1, "key": "I03", "key_name": "I03 - Equipo de transporte.", - "name": "I03" + "name": "I03", + "tax_regimes": [ + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "I03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Equipo de computo y accesorios.", @@ -53,7 +467,75 @@ "enabled": 1, "key": "I04", "key_name": "I04 - Equipo de computo y accesorios.", - "name": "I04" + "name": "I04", + "tax_regimes": [ + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "I04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Dados, troqueles, moldes, matrices y herramental.", @@ -61,7 +543,75 @@ "enabled": 1, "key": "I05", "key_name": "I05 - Dados, troqueles, moldes, matrices y herramental.", - "name": "I05" + "name": "I05", + "tax_regimes": [ + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "I05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Comunicaciones telefónicas.", @@ -69,7 +619,75 @@ "enabled": 1, "key": "I06", "key_name": "I06 - Comunicaciones telefónicas.", - "name": "I06" + "name": "I06", + "tax_regimes": [ + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "I06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Comunicaciones satelitales.", @@ -77,7 +695,75 @@ "enabled": 1, "key": "I07", "key_name": "I07 - Comunicaciones satelitales.", - "name": "I07" + "name": "I07", + "tax_regimes": [ + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "I07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Otra maquinaria y equipo.", @@ -85,7 +771,75 @@ "enabled": 1, "key": "I08", "key_name": "I08 - Otra maquinaria y equipo.", - "name": "I08" + "name": "I08", + "tax_regimes": [ + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "I08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Honorarios médicos, dentales y gastos hospitalarios.", @@ -93,7 +847,63 @@ "enabled": 1, "key": "D01", "key_name": "D01 - Honorarios médicos, dentales y gastos hospitalarios.", - "name": "D01" + "name": "D01", + "tax_regimes": [ + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Gastos médicos por incapacidad o discapacidad.", @@ -101,7 +911,63 @@ "enabled": 1, "key": "D02", "key_name": "D02 - Gastos médicos por incapacidad o discapacidad.", - "name": "D02" + "name": "D02", + "tax_regimes": [ + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D02", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Gastos funerales.", @@ -109,7 +975,63 @@ "enabled": 1, "key": "D03", "key_name": "D03 - Gastos funerales.", - "name": "D03" + "name": "D03", + "tax_regimes": [ + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D03", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Donativos.", @@ -117,7 +1039,63 @@ "enabled": 1, "key": "D04", "key_name": "D04 - Donativos.", - "name": "D04" + "name": "D04", + "tax_regimes": [ + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D04", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Intereses reales efectivamente pagados por créditos hipotecarios (casa habitación).", @@ -125,7 +1103,63 @@ "enabled": 1, "key": "D05", "key_name": "D05 - Intereses reales efectivamente pagados por créditos hipotecarios (casa habitación).", - "name": "D05" + "name": "D05", + "tax_regimes": [ + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D05", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Aportaciones voluntarias al SAR.", @@ -133,7 +1167,63 @@ "enabled": 1, "key": "D06", "key_name": "D06 - Aportaciones voluntarias al SAR.", - "name": "D06" + "name": "D06", + "tax_regimes": [ + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D06", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Primas por seguros de gastos médicos.", @@ -141,7 +1231,63 @@ "enabled": 1, "key": "D07", "key_name": "D07 - Primas por seguros de gastos médicos.", - "name": "D07" + "name": "D07", + "tax_regimes": [ + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D07", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Gastos de transportación escolar obligatoria.", @@ -149,7 +1295,63 @@ "enabled": 1, "key": "D08", "key_name": "D08 - Gastos de transportación escolar obligatoria.", - "name": "D08" + "name": "D08", + "tax_regimes": [ + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D08", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Depósitos en cuentas para el ahorro, primas que tengan como base planes de pensiones.", @@ -157,7 +1359,63 @@ "enabled": 1, "key": "D09", "key_name": "D09 - Depósitos en cuentas para el ahorro, primas que tengan como base planes de pensiones.", - "name": "D09" + "name": "D09", + "tax_regimes": [ + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D09", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Pagos por servicios educativos (colegiaturas).", @@ -165,7 +1423,63 @@ "enabled": 1, "key": "D10", "key_name": "D10 - Pagos por servicios educativos (colegiaturas).", - "name": "D10" + "name": "D10", + "tax_regimes": [ + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "D10", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + } + ] }, { "description": "Sin efectos fiscales.", @@ -173,7 +1487,123 @@ "enabled": 1, "key": "S01", "key_name": "S01 - Sin efectos fiscales.", - "name": "S01" + "name": "S01", + "tax_regimes": [ + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "610" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "616" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "S01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Pagos", @@ -181,7 +1611,123 @@ "enabled": 1, "key": "CP01", "key_name": "CP01 - Pagos", - "name": "CP01" + "name": "CP01", + "tax_regimes": [ + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "601" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "603" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "606" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "608" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "610" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "611" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "612" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "614" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "616" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "620" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "621" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "622" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "623" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "624" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "607" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "615" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "625" + }, + { + "parent": "CP01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "626" + } + ] }, { "description": "Nómina", @@ -189,6 +1735,14 @@ "enabled": 1, "key": "CN01", "key_name": "CN01 - Nómina", - "name": "CN01" + "name": "CN01", + "tax_regimes": [ + { + "parent": "CN01", + "parentfield": "tax_regimes", + "parenttype": "SAT CFDI Use", + "tax_regime": "605" + } + ] } ] \ No newline at end of file From a1bede87272106ff97193ae2bdc66f97ea7a65f0 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 16 Aug 2024 00:34:39 -0600 Subject: [PATCH 39/62] feat(sales invoice): add customer filter to cfdi use field --- .../controllers/__init__.py | 0 .../controllers/queries.py | 38 +++++++++++++++++++ .../doctype/sat_cfdi_use/sat_cfdi_use.json | 3 +- .../public/js/sales_invoice.js | 13 +++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 erpnext_mexico_compliance/controllers/__init__.py create mode 100644 erpnext_mexico_compliance/controllers/queries.py create mode 100644 erpnext_mexico_compliance/public/js/sales_invoice.js diff --git a/erpnext_mexico_compliance/controllers/__init__.py b/erpnext_mexico_compliance/controllers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/erpnext_mexico_compliance/controllers/queries.py b/erpnext_mexico_compliance/controllers/queries.py new file mode 100644 index 0000000..81752b2 --- /dev/null +++ b/erpnext_mexico_compliance/controllers/queries.py @@ -0,0 +1,38 @@ +"""Copyright (c) 2024, TI Sin Problemas and contributors +For license information, please see license.txt""" + +import frappe +from erpnext.controllers.queries import get_fields +from frappe.desk.reportview import get_filters_cond + + +@frappe.whitelist() +@frappe.validate_and_sanitize_search_inputs +def cfdi_use_query(doctype, txt, searchfield, start, page_len, filters: dict): + doctype = "SAT CFDI Use" + customer = filters.pop("customer", None) + cfdi_use_table = "`tabSAT CFDI Use`" + tax_regime_table = "`tabSAT CFDI Use Tax Regime`" + + if customer: + customer = frappe.get_doc("Customer", customer) + filters.update({"tax_regime": customer.mx_tax_regime}) + + fields = [f"{cfdi_use_table}.{f}" for f in get_fields(doctype, [])] + filters_cond = get_filters_cond(doctype, filters, []) + + item_list = frappe.db.sql( + f"""select {", ".join(fields)} from {cfdi_use_table} + left join {tax_regime_table} on {tax_regime_table}.parent = {cfdi_use_table}.name + where + {cfdi_use_table}.enabled = 1 + and ( + {cfdi_use_table}.key_name like "%{txt}%" + or {cfdi_use_table}.{searchfield} like "%{txt}%" + ) + {filters_cond} + order by {cfdi_use_table}.{searchfield} asc + limit {page_len} offset {start} + """ + ) + return item_list diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json index 355ecbe..ba7b52b 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json @@ -61,13 +61,14 @@ { "fieldname": "tax_regimes", "fieldtype": "Table", + "in_filter": 1, "label": "Tax regimes", "options": "SAT CFDI Use Tax Regime" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-08-14 17:41:50.249931", + "modified": "2024-08-14 21:23:44.236421", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "SAT CFDI Use", diff --git a/erpnext_mexico_compliance/public/js/sales_invoice.js b/erpnext_mexico_compliance/public/js/sales_invoice.js new file mode 100644 index 0000000..a56baed --- /dev/null +++ b/erpnext_mexico_compliance/public/js/sales_invoice.js @@ -0,0 +1,13 @@ +// Copyright (c) 2024, TI Sin Problemas and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Sales Invoice", { + setup(frm) { + frm.set_query("mx_cfdi_use", (doc, docType, docName) => { + return { + query: "erpnext_mexico_compliance.controllers.queries.cfdi_use_query", + filters: { customer: doc.customer }, + }; + }); + }, +}); From f3a2074186ef7c233f9f6e987ac814ccd532f419 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 16 Aug 2024 16:46:02 -0600 Subject: [PATCH 40/62] fix(customer): tax id validation fails if empty --- erpnext_mexico_compliance/overrides/customer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext_mexico_compliance/overrides/customer.py b/erpnext_mexico_compliance/overrides/customer.py index 47140e4..bc3dcbf 100644 --- a/erpnext_mexico_compliance/overrides/customer.py +++ b/erpnext_mexico_compliance/overrides/customer.py @@ -41,7 +41,7 @@ def is_mexican(self): return address.country.upper().startswith("MEX") def validate(self): - if self.is_mexican: + if self.is_mexican and self.tax_id: self.tax_id = self.tax_id.upper() self.validate_mexican_tax_id() From b3b718d0e75f0a41e36146351fee45e72481f618 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 17 Aug 2024 00:09:35 -0600 Subject: [PATCH 41/62] feat(sales invoice): complete stamping process --- .../custom/sales_invoice.json | 126 +++++++++++++++++ .../digital_signing_certificate.py | 10 +- erpnext_mexico_compliance/hooks.py | 2 +- .../overrides/sales_invoice.py | 129 ++++++++++++++++++ .../public/js/sales_invoice.js | 98 +++++++++++-- .../ws_client/__init__.py | 4 +- erpnext_mexico_compliance/ws_client/client.py | 57 ++++++-- .../ws_client/exceptions.py | 9 ++ pyproject.toml | 2 +- 9 files changed, 411 insertions(+), 26 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json index 1b2a2fb..cd85ca1 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json @@ -126,6 +126,132 @@ "unique": 0, "width": null }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-16 17:01:12.646899", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_section_break_9ww80", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 214, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_payment_mode", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-16 17:01:12.646899", + "modified_by": "Administrator", + "module": null, + "name": "Sales Invoice-custom_section_break_9ww80", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-16 17:01:13.558411", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_stamped_xml", + "fieldtype": "HTML Editor", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 215, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_section_break_9ww80", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Stamped XML", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-16 17:05:22.837922", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_xml", + "no_copy": 1, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "_assign": null, "_comments": null, diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py index 2d75592..eedcdb9 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py @@ -75,8 +75,14 @@ def validate_certificate(self): """Validates the digital signing certificate by checking if the certificate files and password are correctly configured.""" if self.signer: - msg = _("Certificate files and password are valid") - frappe.msgprint(msg=msg, title=_("Success"), indicator="green") + title = _("Certificate files and password are valid") + msg = [ + _("Branch: {0}").format(self.branch_name), + _("Legal name: {0}").format(self.legal_name), + _("RFC: {0}").format(self.rfc), + ] + + frappe.msgprint(msg=msg, title=title, indicator="green", as_list=True) @property def triad_is_complete(self) -> bool: diff --git a/erpnext_mexico_compliance/hooks.py b/erpnext_mexico_compliance/hooks.py index a3c30d4..d0ab068 100644 --- a/erpnext_mexico_compliance/hooks.py +++ b/erpnext_mexico_compliance/hooks.py @@ -32,7 +32,7 @@ # page_js = {"page" : "public/js/file.js"} # include js in doctype views -# doctype_js = {"doctype" : "public/js/doctype.js"} +doctype_js = {"Sales Invoice": "public/js/sales_invoice.js"} # doctype_list_js = {"doctype" : "public/js/doctype_list.js"} # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} # doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} diff --git a/erpnext_mexico_compliance/overrides/sales_invoice.py b/erpnext_mexico_compliance/overrides/sales_invoice.py index 676fb7b..879c29a 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice.py @@ -3,18 +3,29 @@ For license information, please see license.txt """ +import sys +from datetime import datetime from decimal import Decimal import frappe from erpnext.accounts.doctype.sales_invoice import sales_invoice from erpnext.setup.doctype.company.company import Company, get_default_company_address from frappe import _ +from frappe.client import attach_file from frappe.contacts.doctype.address.address import Address +from frappe.model.document import Document from frappe.model.naming import NamingSeries +from frappe.utils import get_datetime from satcfdi.create.cfd import catalogos, cfdi40 +from satcfdi.exceptions import SchemaValidationError +from ..ws_client import WSClientException, WSExistingCfdiException, get_ws_client from .customer import Customer +# temporary hack until https://github.com/frappe/frappe/issues/27373 is fixed +if sys.path[0].rsplit("/", maxsplit=1)[-1] == "utils": + sys.path[0] = sys.path[0].replace("apps/frappe/frappe/utils", "sites") + class SalesInvoice(sales_invoice.SalesInvoice): """ERPNext Sales Invoice override""" @@ -28,6 +39,7 @@ class SalesInvoice(sales_invoice.SalesInvoice): mode_of_payment: DF.Link mx_cfdi_use: DF.Link mx_payment_mode: DF.Data + mx_stamped_xml: DF.HTMLEditor def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -76,6 +88,14 @@ def customer_address_doc(self) -> Address: @property def tax_accounts(self) -> list[dict]: + """Returns a list of dictionaries containing tax account information. + + The list includes the name, tax type, and tax rate of each account. + The accounts are filtered by the names of the account heads in the invoice's taxes. + + Returns: + list[dict]: A list of dictionaries containing tax account information. + """ heads = [t.account_head for t in self.taxes] return frappe.get_list( "Account", @@ -184,3 +204,112 @@ def cfdi_folio(self) -> str: prefix = str(NamingSeries(self.naming_series).get_prefix()) return str(int(self.name.replace(prefix, ""))) + @property + def posting_datetime(self) -> datetime: + """`datetime` object representing the posting date and time of the sales invoice.""" + return get_datetime(f"{self.posting_date}T{self.posting_time}") + + def sign_cfdi(self, certificate: str) -> cfdi40.CFDI: + """Create and sign the CFDI document for this sales invoice. + + Args: + certificate (str): The name of the Digital Signing Certificate to use for signing. + + Returns: + cfdi40.CFDI: Signed and processed CFDI document. + """ + csd = frappe.get_doc("Digital Signing Certificate", certificate) + voucher = cfdi40.Comprobante( + emisor=csd.get_issuer(), + lugar_expedicion=self.company_address_doc.pincode, + receptor=self.cfdi_receiver, + conceptos=self.cfdi_items, + moneda=self.currency, + tipo_de_comprobante=catalogos.TipoDeComprobante.INGRESO, + serie=self.cfdi_series, + folio=self.cfdi_folio, + forma_pago=self.mx_payment_mode, + tipo_cambio=( + Decimal(self.conversion_rate) if self.currency != "MXN" else None + ), + metodo_pago=self.mx_payment_option, + fecha=self.posting_datetime, + ) + voucher.sign(csd.signer) + return voucher.process() + + @frappe.whitelist() + def has_file(self, file_name: str) -> bool: + """Returns DocType name if the CFDI document for this sales invoice has a file named as + `file_name` attached.""" + return frappe.db.exists( + "File", + { + "attached_to_doctype": self.doctype, + "attached_to_name": self.name, + "file_name": file_name, + }, + ) + + @frappe.whitelist() + def attach_pdf(self) -> Document: + """Attaches the CFDI PDF to the current document. + + This method generates a PDF file from the CFDI XML and attaches it to the current document. + + Returns: + Document: The result of attaching the PDF file to the current document. + """ + from satcfdi import render # pylint: disable=import-outside-toplevel + + cfdi = cfdi40.CFDI.from_string(self.mx_stamped_xml.encode("utf-8")) + file_name = f"{self.name}_CFDI.pdf" + file_data = render.pdf_bytes(cfdi) + return attach_file(file_name, file_data, self.doctype, self.name, is_private=1) + + @frappe.whitelist() + def attach_xml(self) -> Document: + """Attaches the CFDI XML to the current document. + + This method generates an XML file from the CFDI XML and attaches it to the current document. + + Returns: + Document: The result of attaching the XML file to the current document. + """ + file_name = f"{self.name}_CFDI.xml" + xml = self.mx_stamped_xml + return attach_file(file_name, xml, self.doctype, self.name, is_private=1) + + @frappe.whitelist() + def stamp_cfdi(self, certificate: str): + """Stamps a CFDI document for the current sales invoice. + + Args: + certificate (str): The name of the Digital Signing Certificate to use for signing. + + Returns: + str: A message indicating the result of the stamping operation. + """ + + self.validate_company() + self.validate_customer() + + cfdi = self.sign_cfdi(certificate) + ws = get_ws_client() + try: + data, message = ws.stamp(cfdi) + except SchemaValidationError as e: + frappe.throw(str(e), title=_("Invalid CFDI")) + except WSExistingCfdiException as e: + data = e.data + message = e.message + except WSClientException as e: + frappe.throw(str(e), title=_("CFDI Web Service Error")) + + self.mx_stamped_xml = data + self.db_update() + + self.attach_pdf() + self.attach_xml() + + return message diff --git a/erpnext_mexico_compliance/public/js/sales_invoice.js b/erpnext_mexico_compliance/public/js/sales_invoice.js index a56baed..0e313ac 100644 --- a/erpnext_mexico_compliance/public/js/sales_invoice.js +++ b/erpnext_mexico_compliance/public/js/sales_invoice.js @@ -1,13 +1,95 @@ // Copyright (c) 2024, TI Sin Problemas and contributors // For license information, please see license.txt -frappe.ui.form.on("Sales Invoice", { - setup(frm) { - frm.set_query("mx_cfdi_use", (doc, docType, docName) => { - return { - query: "erpnext_mexico_compliance.controllers.queries.cfdi_use_query", - filters: { customer: doc.customer }, - }; +function stampCfdi() { + frappe.prompt( + [ + { + label: __("Digital Signing Certificate"), + fieldname: "certificate", + fieldtype: "Link", + options: "Digital Signing Certificate", + filters: { company: frm.doc.company }, + }, + ], + async ({ certificate }) => { + const { message } = await frm.call("stamp_cfdi", { certificate }); + frappe.show_alert({ message, indicator: "green" }); + }, + __("Select a Certificate to sign the CFDI") + ); +} + +async function attachFile(frm, ext) { + const functionMap = { pdf: "attach_pdf", xml: "attach_xml" }; + + try { + const { message } = await frm.call(functionMap[ext]); + const { file_name } = message; + frappe.show_alert({ + message: __("File {0} attached", [file_name]), + indicator: "green", }); - }, + frm.reload_doc(); + } catch (error) { + const { responseJSON } = error; + frappe.throw(responseJSON ? responseJSON.exception : error); + } +} + +const cfdiActionsGroup = __("CFDI Actions"); + +async function addAttachPdfButton(frm) { + const { message: hasFile } = await frm.call("has_file", { + file_name: `${frm.doc.name}_CFDI.pdf`, + }); + + if (!hasFile) { + frm.add_custom_button( + __("Attach PDF"), + async () => await attachFile(frm, "pdf"), + cfdiActionsGroup + ); + } +} + +async function addAttachXmlButton(frm) { + const { message: hasFile } = await frm.call("has_file", { + file_name: `${frm.doc.name}_CFDI.xml`, + }); + + if (!hasFile) { + frm.add_custom_button( + __("Attach XML"), + async () => await attachFile(frm, "xml"), + cfdiActionsGroup + ); + } +} + +async function refresh(frm) { + const { docstatus, mx_stamped_xml, name } = frm.doc; + + if (docstatus == 1 && !mx_stamped_xml) { + frm.add_custom_button(__("Stamp CFDI"), stampCfdi); + } + + if (mx_stamped_xml) { + await addAttachPdfButton(frm); + await addAttachXmlButton(frm); + } +} + +function setup(frm) { + frm.set_query("mx_cfdi_use", (doc, docType, docName) => { + return { + query: "erpnext_mexico_compliance.controllers.queries.cfdi_use_query", + filters: { customer: doc.customer }, + }; + }); +} + +frappe.ui.form.on("Sales Invoice", { + refresh, + setup, }); diff --git a/erpnext_mexico_compliance/ws_client/__init__.py b/erpnext_mexico_compliance/ws_client/__init__.py index f6b23ad..7f299c3 100644 --- a/erpnext_mexico_compliance/ws_client/__init__.py +++ b/erpnext_mexico_compliance/ws_client/__init__.py @@ -4,7 +4,7 @@ import frappe from . import client -from .exceptions import WSClientException +from .exceptions import WSClientException, WSExistingCfdiException def get_ws_client() -> client.WSClient: @@ -22,4 +22,4 @@ def get_ws_client() -> client.WSClient: return client.WSClient(api_key, mode_map[settings.test_mode]) -__all__ = ["get_ws_client", "WSClientException"] +__all__ = ["get_ws_client", "WSClientException", "WSExistingCfdiException"] diff --git a/erpnext_mexico_compliance/ws_client/client.py b/erpnext_mexico_compliance/ws_client/client.py index ce27a61..15d1223 100644 --- a/erpnext_mexico_compliance/ws_client/client.py +++ b/erpnext_mexico_compliance/ws_client/client.py @@ -1,17 +1,23 @@ from enum import Enum +from typing import Any import frappe -from satcfdi.create.cfd.cfdi40 import CFDI +from satcfdi.cfdi import CFDI from zeep import Client from zeep.cache import SqliteCache from zeep.transports import Transport -from .exceptions import WSClientException +from .exceptions import WSClientException, WSExistingCfdiException class WSClient: + """Represents a CFDI Web Service client.""" + + response: Any class OperationMode(Enum): + """Represents the operation mode of the CFDI Web Service.""" + PROD = "https://app.facturaloplus.com/ws/servicio.do?wsdl" TEST = "https://dev.facturaloplus.com/ws/servicio.do?wsdl" @@ -20,19 +26,39 @@ def __init__(self, api_key: str, mode: OperationMode = OperationMode.TEST) -> No self.client = Client(mode.value, transport=Transport(cache=SqliteCache())) self.logger = frappe.logger("erpnext_mexico_compliance.ws_client", True) - def raise_from_code(self, code: str, message: str): - """Raises a WSClientException if the given code is not 200. + def log_error(self, include_data: bool = False) -> None: + """Logs an error message with optional data. Args: - code (str): The status code to check. - message (str): The error message to raise. + include_data (bool, optional): Whether to include the response data in the error + message. Defaults to False. + + This function logs an error message using the logger object. The error message includes the + response code and message. If the `include_data` parameter is set to True, the response data + is also included in the error message. + """ + msg = {"code": self.response.code, "message": self.response.message} + if include_data: + msg["data"] = self.response.data + self.logger.error(msg) + + def raise_from_code(self): + """Raises a WSClientException if the given code is not 200. Raises: - WSClientException: If the code is not 200. + WSClientException: If the given code is not 200. + WSExistingCfdiException: If the given code is 307. """ - if code != "200": - self.logger.error({"code": code, "message": message}) - raise WSClientException(message, code) + res = self.response + match res.code: + case "200": + return + case "307": + self.logger.error({"code": res.code, "message": res.message}) + raise WSExistingCfdiException(res.message, res.code, res.data) + case _: + self.logger.error({"code": res.code, "message": res.message}) + raise WSClientException(res.message, res.code) def stamp(self, cfdi: CFDI) -> tuple[str, str]: """Stamps a CFDI using the provided client and API key. @@ -44,11 +70,17 @@ def stamp(self, cfdi: CFDI) -> tuple[str, str]: tuple[str, str]: A tuple containing the stamped CFDI data and the corresponding message. Raises: + WSExistingCfdiException: If the CFDI already exists. WSClientException: If the stamping operation fails. """ xml_cfdi = cfdi.xml_bytes().decode("utf-8") - res = self.client.service.timbrar(apikey=self.api_key, xmlCFDI=xml_cfdi) + self.response = self.client.service.timbrar( + apikey=self.api_key, xmlCFDI=xml_cfdi + ) self.logger.debug({"action": "stamp", "data": xml_cfdi}) + self.raise_from_code() + return self.response.data, self.response.message + self.raise_from_code(res.code, res.message) return res.data, res.message @@ -59,5 +91,6 @@ def get_available_credits(self) -> int: int: The number of available credits. """ res = self.client.service.consultarCreditosDisponibles(apikey=self.api_key) - self.raise_from_code(res.code, res.message) + self.response = res + self.raise_from_code() return res.data diff --git a/erpnext_mexico_compliance/ws_client/exceptions.py b/erpnext_mexico_compliance/ws_client/exceptions.py index 1e4fd9b..40a6dae 100644 --- a/erpnext_mexico_compliance/ws_client/exceptions.py +++ b/erpnext_mexico_compliance/ws_client/exceptions.py @@ -1,6 +1,15 @@ class WSClientException(Exception): + """Base class for exceptions raised by the CFDI Web Service.""" def __init__(self, message: str, code: str): super().__init__(f"{code}: {message}") self.message = message self.code = code + + +class WSExistingCfdiException(WSClientException): + """Raised when an existing CFDI is found in the CFDI Web Service.""" + + def __init__(self, message: str, code: str, data: str): + super().__init__(message, code) + self.data = data diff --git a/pyproject.toml b/pyproject.toml index 4020acc..495e6de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "ERPNext app to serve as base to comply with help with Mexican Rul requires-python = ">=3.10" readme = "README.md" dynamic = ["version"] -dependencies = ["zeep ≃4.2.1", "satcfdi ~=4.5.5"] +dependencies = ["zeep==4.2.1", "satcfdi==4.5.6"] [build-system] requires = ["flit_core"] build-backend = "flit_core.buildapi" From 246b96258fc19c3c26b41793c6c150c292f9956b Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 17 Aug 2024 18:40:41 -0600 Subject: [PATCH 42/62] feat(cancellation reson): add new DocType --- .../doctype/cancellation_reason/__init__.py | 0 .../cancellation_reason.js | 8 +++ .../cancellation_reason.json | 69 +++++++++++++++++++ .../cancellation_reason.py | 22 ++++++ .../test_cancellation_reason.py | 9 +++ .../fixtures/cancellation_reason.json | 34 +++++++++ 6 files changed, 142 insertions(+) create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/__init__.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.js create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.py create mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/test_cancellation_reason.py create mode 100644 erpnext_mexico_compliance/fixtures/cancellation_reason.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/__init__.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.js b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.js new file mode 100644 index 0000000..38a7a85 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.js @@ -0,0 +1,8 @@ +// Copyright (c) 2024, TI Sin Problemas and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Cancellation Reason", { +// refresh(frm) { + +// }, +// }); diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json new file mode 100644 index 0000000..bfd381d --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json @@ -0,0 +1,69 @@ +{ + "actions": [], + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:code", + "creation": "2024-08-17 16:16:03.891107", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "code", + "description", + "requires_relationship" + ], + "fields": [ + { + "allow_in_quick_entry": 1, + "fieldname": "code", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Code", + "length": 2, + "reqd": 1, + "unique": 1 + }, + { + "allow_in_quick_entry": 1, + "fieldname": "description", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Description", + "reqd": 1 + }, + { + "default": "0", + "description": "Check this field if the cancelled invoice needs to have another related invoice", + "fieldname": "requires_relationship", + "fieldtype": "Check", + "label": "Requires relationship" + } + ], + "hide_toolbar": 1, + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-08-17 18:07:26.590842", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Cancellation Reason", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "show_title_field_in_link": 1, + "sort_field": "description", + "sort_order": "DESC", + "states": [], + "title_field": "description" +} \ No newline at end of file diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.py new file mode 100644 index 0000000..8dfeba8 --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.py @@ -0,0 +1,22 @@ +"""Copyright (c) 2024, TI Sin Problemas and contributors +For license information, please see license.txt""" + +# import frappe +from frappe.model.document import Document + + +class CancellationReason(Document): + """Invoice Cancellation Reason""" + + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + code: DF.Data + description: DF.Data + requires_relationship: DF.Check + # end: auto-generated types diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/test_cancellation_reason.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/test_cancellation_reason.py new file mode 100644 index 0000000..b49930b --- /dev/null +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cancellation_reason/test_cancellation_reason.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, TI Sin Problemas and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestCancellationReason(FrappeTestCase): + pass diff --git a/erpnext_mexico_compliance/fixtures/cancellation_reason.json b/erpnext_mexico_compliance/fixtures/cancellation_reason.json new file mode 100644 index 0000000..40522f6 --- /dev/null +++ b/erpnext_mexico_compliance/fixtures/cancellation_reason.json @@ -0,0 +1,34 @@ +[ + { + "code": "01", + "description": "Comprobante emitido con errores con relación", + "docstatus": 0, + "doctype": "Cancellation Reason", + "name": "01", + "requires_relationship": 1 + }, + { + "code": "02", + "description": "Comprobante emitido con errores sin relación", + "docstatus": 0, + "doctype": "Cancellation Reason", + "name": "02", + "requires_relationship": 0 + }, + { + "code": "03", + "description": "No se llevó a cabo la operación", + "docstatus": 0, + "doctype": "Cancellation Reason", + "name": "03", + "requires_relationship": 0 + }, + { + "code": "04", + "description": "Operación nominativa relacionada con una factura global", + "docstatus": 0, + "doctype": "Cancellation Reason", + "name": "04", + "requires_relationship": 0 + } +] From 761d5f5bafeab7eb77e76ca2d070896cf4c6aa4f Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 22 Aug 2024 02:22:56 -0600 Subject: [PATCH 43/62] feat(sales invoice): complete cancel process --- .../custom/sales_invoice.json | 325 +++++++++++++++++- .../digital_signing_certificate.py | 22 +- .../overrides/sales_invoice.py | 101 ++++++ .../public/js/sales_invoice.js | 68 +++- erpnext_mexico_compliance/ws_client/client.py | 56 ++- 5 files changed, 555 insertions(+), 17 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json index cd85ca1..c169271 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json @@ -137,6 +137,258 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, + "creation": "2024-08-17 18:46:22.380912", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_cancellation", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 215, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_payment_mode", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-17 18:57:09.032783", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_cancellation", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-22 01:17:09.959358", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cancellation_acknowledgement", + "fieldtype": "HTML Editor", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 220, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_stamped_xml", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation acknowledgement", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-22 01:17:52.961407", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_cancellation_acknowledgement", + "no_copy": 1, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-17 18:46:23.577670", + "default": null, + "depends_on": "eval:doc.docstatus in [1, 2]", + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cancellation_reason", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 216, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_cancellation", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation reason", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "eval:doc.docstatus == 1", + "modified": "2024-08-17 18:57:42.717062", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_cancellation_reason", + "no_copy": 1, + "non_negative": 0, + "options": "Cancellation Reason", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "eval:doc.docstatus != 1", + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-17 20:02:49.349104", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "requires_relationship", + "fieldtype": "Check", + "hidden": 1, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 216, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cancellation_reason", + "is_system_generated": 0, + "is_virtual": 1, + "label": "Requires Relationship", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-21 23:50:43.024068", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_requires_relationship", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": null, + "columns": 0, "creation": "2024-08-16 17:01:12.646899", "default": null, "depends_on": null, @@ -151,21 +403,21 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 214, + "idx": 218, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "mx_payment_mode", + "insert_after": "substitute_invoice", "is_system_generated": 0, "is_virtual": 0, - "label": "", + "label": "XML", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-08-16 17:01:12.646899", + "modified": "2024-08-17 20:04:01.572502", "modified_by": "Administrator", "module": null, "name": "Sales Invoice-custom_section_break_9ww80", @@ -189,6 +441,69 @@ "unique": 0, "width": null }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-21 23:37:07.142945", + "default": null, + "depends_on": "eval:doc.cancellation_reason == \"01\"", + "description": null, + "docstatus": 0, + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "substitute_invoice", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 217, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "requires_relationship", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Substitute invoice", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "eval:doc.cancellation_reason == \"01\"", + "modified": "2024-08-21 23:50:42.992235", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_substitute_invoice", + "no_copy": 1, + "non_negative": 0, + "options": "Sales Invoice", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "eval:doc.docstatus != 1", + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "_assign": null, "_comments": null, @@ -214,7 +529,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 215, + "idx": 220, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py index eedcdb9..b75d9e7 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py @@ -1,5 +1,7 @@ -# Copyright (c) 2024, TI Sin Problemas and contributors -# For license information, please see license.txt +"""Copyright (c) 2024, TI Sin Problemas and contributors +For license information, please see license.txt""" + +import base64 import frappe from erpnext.setup.doctype.company.company import Company @@ -163,3 +165,19 @@ def get_issuer(self) -> Emisor: return Emisor( rfc=self.rfc, nombre=self.legal_name, regimen_fiscal=company.mx_tax_regime ) + + def get_key_b64(self) -> str: + """Returns the key in Base64 format. + + Returns: + str: The key in Base64 format. + """ + return base64.b64encode(self.read_key()).decode("utf-8") + + def get_certificate_b64(self) -> str: + """Returns the certificate in Base64 format. + + Returns: + str: The certificate in Base64 format. + """ + return base64.b64encode(self.read_certificate()).decode("utf-8") diff --git a/erpnext_mexico_compliance/overrides/sales_invoice.py b/erpnext_mexico_compliance/overrides/sales_invoice.py index 879c29a..75d042b 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice.py @@ -40,6 +40,9 @@ class SalesInvoice(sales_invoice.SalesInvoice): mx_cfdi_use: DF.Link mx_payment_mode: DF.Data mx_stamped_xml: DF.HTMLEditor + cancellation_reason: DF.Link + substitute_invoice: DF.Link + cancellation_acknowledgement: DF.HTMLEditor def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -313,3 +316,101 @@ def stamp_cfdi(self, certificate: str): self.attach_xml() return message + + @property + def requires_relationship(self) -> int: + """This property determines whether a relationship with another sales invoice is required + for the current sales invoice. + + It checks if a cancellation reason is set, and if so, retrieves the corresponding + Cancellation Reason document. + + The function returns an integer indicating whether a relationship is required, based on the + requires_relationship field of the Cancellation Reason document. + + Returns: + int: 1 if a relationship is required, 0 otherwise. + """ + if not self.cancellation_reason: + return 0 + reason = frappe.get_doc("Cancellation Reason", self.cancellation_reason) + return reason.requires_relationship + + @property + def cfdi_uuid(self) -> str | None: + """Retrieves the CFDI UUID from the stamped XML. + + Returns: + str | None: The CFDI UUID if the stamped XML is available, otherwise None. + """ + if not self.mx_stamped_xml: + return None + cfdi = cfdi40.CFDI.from_string(self.mx_stamped_xml.encode("utf-8")) + return cfdi.get("Complemento", {}).get("TimbreFiscalDigital", {}).get("UUID") + + def validate_cancel_reason(self): + """Validates whether a cancellation reason is provided before cancelling a sales invoice. + + This function checks if a cancellation reason is set for the current sales invoice. + If no cancellation reason is found, it throws an error with a corresponding message. + """ + if not self.cancellation_reason: + msg = _("A Cancellation Reason is required to cancel this sales invoice.") + title = _("Invalid Cancellation Reason") + frappe.throw(msg, title=title) + + def validate_substitute_invoice(self): + """Validates whether a substitute invoice is provided for the cancellation reason. + + This function checks if the cancellation reason requires a substitute invoice and if the + substitute invoice is not provided. If both conditions are met, it throws an error with a + corresponding message. + """ + reason = frappe.get_doc("Cancellation Reason", self.cancellation_reason) + if reason.requires_relationship and not self.substitute_invoice: + msg = _("The reason of cancellation {} requires a substitute invoice") + msg = msg.format(self.cancellation_reason) + frappe.throw(msg) + + @frappe.whitelist() + def cancel_cfdi(self, certificate): + """Cancels a CFDI document. + + Args: + certificate (str): The name of the Digital Signing Certificate to use for cancellation. + + Returns: + str: A message indicating the result of the cancellation operation. + + Raises: + WSClientException: If an error occurs during the cancellation process. + """ + cfdi = cfdi40.CFDI.from_string(self.mx_stamped_xml.encode("utf-8")) + ws = get_ws_client() + + if self.substitute_invoice: + substitute_invoice = frappe.get_doc( + "Sales Invoice", self.substitute_invoice + ) + else: + substitute_invoice = None + + try: + acknowledgement, message = ws.cancel( + certificate, + cfdi, + self.cancellation_reason, + self.substitute_invoice.cfdi_uuid if substitute_invoice else None, + ) + except WSClientException as e: + frappe.throw(str(e), title=_("CFDI Web Service Error")) + + self.cancellation_acknowledgement = acknowledgement + self.db_update() + + return message + + def before_cancel(self): + if self.mx_stamped_xml: + self.validate_cancel_reason() + self.validate_substitute_invoice() diff --git a/erpnext_mexico_compliance/public/js/sales_invoice.js b/erpnext_mexico_compliance/public/js/sales_invoice.js index 0e313ac..2688b4f 100644 --- a/erpnext_mexico_compliance/public/js/sales_invoice.js +++ b/erpnext_mexico_compliance/public/js/sales_invoice.js @@ -67,26 +67,80 @@ async function addAttachXmlButton(frm) { } } -async function refresh(frm) { - const { docstatus, mx_stamped_xml, name } = frm.doc; +function cancel(frm) { + const { + mx_stamped_xml, + cancellation_reason, + requires_relationship, + cancellation_related_invoices, + } = frm.doc; - if (docstatus == 1 && !mx_stamped_xml) { - frm.add_custom_button(__("Stamp CFDI"), stampCfdi); + if (mx_stamped_xml) { + if (!cancellation_reason) { + const msg = __( + "A Cancellation Reason is required to cancel this sales invoice." + ); + frappe.throw(msg); + } + + if (requires_relationship && cancellation_related_invoices === 0) { + const msg = __("The Cancellation Reason requires a related invoice."); + frappe.throw(msg); + } + + frappe.prompt( + [ + { + label: __("Digital Signing Certificate"), + fieldname: "certificate", + fieldtype: "Link", + options: "Digital Signing Certificate", + filters: { company: frm.doc.company }, + }, + ], + async ({ certificate }) => { + const { message: cfdi_msg } = await frm.call("cancel_cfdi", { + certificate, + }); + frappe.show_alert({ message: cfdi_msg, indicator: "green" }); + const { message: cancelled } = await frm.call("cancel"); + frappe.show_alert({ message: cancelled, indicator: "green" }); + }, + __("Select a Certificate to sign the CFDI") + ); } +} + +function refresh(frm) { + const { mx_stamped_xml } = frm.doc; if (mx_stamped_xml) { - await addAttachPdfButton(frm); - await addAttachXmlButton(frm); + addAttachPdfButton(frm); + addAttachXmlButton(frm); + + if (frm.doc.docstatus === 1) { + frm.page.set_secondary_action("Cancel", () => cancel(frm)); + } } } function setup(frm) { - frm.set_query("mx_cfdi_use", (doc, docType, docName) => { + frm.set_query("mx_cfdi_use", (doc) => { return { query: "erpnext_mexico_compliance.controllers.queries.cfdi_use_query", filters: { customer: doc.customer }, }; }); + + frm.set_query("substitute_invoice", (doc) => { + return { + filters: [ + ["name", "!=", doc.name], + ["customer", "=", doc.customer], + ["mx_stamped_xml", "!=", ""], + ], + }; + }); } frappe.ui.form.on("Sales Invoice", { diff --git a/erpnext_mexico_compliance/ws_client/client.py b/erpnext_mexico_compliance/ws_client/client.py index 15d1223..24b3ad3 100644 --- a/erpnext_mexico_compliance/ws_client/client.py +++ b/erpnext_mexico_compliance/ws_client/client.py @@ -51,7 +51,7 @@ def raise_from_code(self): """ res = self.response match res.code: - case "200": + case "200" | "201": return case "307": self.logger.error({"code": res.code, "message": res.message}) @@ -81,8 +81,50 @@ def stamp(self, cfdi: CFDI) -> tuple[str, str]: self.raise_from_code() return self.response.data, self.response.message - self.raise_from_code(res.code, res.message) - return res.data, res.message + def cancel( + self, + signing_certificate: str, + cfdi: CFDI, + reason: str, + substitute_uuid: str = None, + ) -> tuple[str, str]: + """Cancels a CFDI using the provided signing certificate, CFDI, reason, and optional + substitute UUID. + + Args: + signing_certificate (str): The name of the Digital Signing Certificate DocType to use + for cancellation. + cfdi (CFDI): The CFDI to be cancelled. + reason (str): The reason for cancellation. + substitute_uuid (str, optional): The substitute UUID for cancellation. Defaults to None. + + Returns: + tuple[str, str]: A tuple containing the cancellation data and the corresponding message. + """ + csd = frappe.get_doc("Digital Signing Certificate", signing_certificate) + self.response = self.client.service.cancelar2( + apikey=self.api_key, + keyCSD=csd.get_key_b64(), + cerCSD=csd.get_certificate_b64(), + passCSD=csd.get_password(), + uuid=cfdi["Complemento"]["TimbreFiscalDigital"]["UUID"], + rfcEmisor=cfdi["Emisor"]["Rfc"], + rfcReceptor=cfdi["Receptor"]["Rfc"], + total=cfdi["Total"], + motivo=reason, + folioSustitucion=substitute_uuid or "", + ) + self.logger.debug( + { + "action": "cancel", + "signing_certificate": signing_certificate, + "cfdi": cfdi, + "reason": reason, + "substitute_uuid": substitute_uuid, + } + ) + self.raise_from_code() + return self.response.data, self.response.message def get_available_credits(self) -> int: """Retrieves the available credits from the CFDI Web Service. @@ -94,3 +136,11 @@ def get_available_credits(self) -> int: self.response = res self.raise_from_code() return res.data + + def validate(self, cfdi: CFDI) -> tuple[str, str]: + xml_cfdi = cfdi.xml_bytes().decode("utf-8") + res = self.client.service.validar(apikey=self.api_key, xmlCFDI=xml_cfdi) + self.response = res + self.logger.debug({"action": "validate", "data": xml_cfdi}) + self.raise_from_code() + return res.data, res.message From 7e67bca0f2c24c809d58b5b7b4b06769d3705331 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 22 Aug 2024 18:32:37 -0600 Subject: [PATCH 44/62] fix(sales invoice): stamp cfdi button disapeared --- .../custom/sales_invoice.json | 10 +++++----- .../public/js/sales_invoice.js | 18 +++++++++++++----- erpnext_mexico_compliance/ws_client/client.py | 19 +++++++++++++++++-- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json index c169271..6da1eda 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json @@ -214,7 +214,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 220, + "idx": 221, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -265,7 +265,7 @@ "columns": 0, "creation": "2024-08-17 18:46:23.577670", "default": null, - "depends_on": "eval:doc.docstatus in [1, 2]", + "depends_on": "eval:doc.mx_stamped_xml != null", "description": null, "docstatus": 0, "dt": "Sales Invoice", @@ -340,7 +340,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 216, + "idx": 217, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -403,7 +403,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 218, + "idx": 219, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -466,7 +466,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 217, + "idx": 218, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, diff --git a/erpnext_mexico_compliance/public/js/sales_invoice.js b/erpnext_mexico_compliance/public/js/sales_invoice.js index 2688b4f..45c8544 100644 --- a/erpnext_mexico_compliance/public/js/sales_invoice.js +++ b/erpnext_mexico_compliance/public/js/sales_invoice.js @@ -1,7 +1,7 @@ // Copyright (c) 2024, TI Sin Problemas and contributors // For license information, please see license.txt -function stampCfdi() { +function stampCfdi(frm) { frappe.prompt( [ { @@ -15,6 +15,7 @@ function stampCfdi() { async ({ certificate }) => { const { message } = await frm.call("stamp_cfdi", { certificate }); frappe.show_alert({ message, indicator: "green" }); + frm.reload_doc(); }, __("Select a Certificate to sign the CFDI") ); @@ -105,6 +106,7 @@ function cancel(frm) { frappe.show_alert({ message: cfdi_msg, indicator: "green" }); const { message: cancelled } = await frm.call("cancel"); frappe.show_alert({ message: cancelled, indicator: "green" }); + frm.reload_doc(); }, __("Select a Certificate to sign the CFDI") ); @@ -112,15 +114,21 @@ function cancel(frm) { } function refresh(frm) { - const { mx_stamped_xml } = frm.doc; + const { docstatus, mx_stamped_xml } = frm.doc; if (mx_stamped_xml) { addAttachPdfButton(frm); addAttachXmlButton(frm); + } - if (frm.doc.docstatus === 1) { - frm.page.set_secondary_action("Cancel", () => cancel(frm)); - } + switch (docstatus) { + case 1: + if (mx_stamped_xml) { + frm.page.set_secondary_action("Cancel", () => cancel(frm)); + } else { + frm.add_custom_button(__("Stamp CFDI"), () => stampCfdi(frm)); + } + break; } } diff --git a/erpnext_mexico_compliance/ws_client/client.py b/erpnext_mexico_compliance/ws_client/client.py index 24b3ad3..660d514 100644 --- a/erpnext_mexico_compliance/ws_client/client.py +++ b/erpnext_mexico_compliance/ws_client/client.py @@ -1,3 +1,9 @@ +""" +Copyright (c) 2022, TI Sin Problemas and contributors +For license information, please see license.txt +""" + +import json from enum import Enum from typing import Any @@ -137,10 +143,19 @@ def get_available_credits(self) -> int: self.raise_from_code() return res.data - def validate(self, cfdi: CFDI) -> tuple[str, str]: + def validate(self, cfdi: CFDI) -> tuple[dict, str]: + """Validate the structure and content of a given CFDI using the CFDI Web Service. + + Args: + cfdi (CFDI): The CFDI to be validated. + + Returns: + tuple[dict, str]: A tuple containing the validation data in JSON format and the + corresponding message. + """ xml_cfdi = cfdi.xml_bytes().decode("utf-8") res = self.client.service.validar(apikey=self.api_key, xmlCFDI=xml_cfdi) self.response = res self.logger.debug({"action": "validate", "data": xml_cfdi}) self.raise_from_code() - return res.data, res.message + return json.loads(res.data), res.message From 9342a46d2714c79762a428d818743f2f43dc01aa Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 24 Aug 2024 20:41:58 -0600 Subject: [PATCH 45/62] feat(common): create common controller --- .../controllers/common.py | 75 +++++++++++++++++++ .../overrides/sales_invoice.py | 49 ++++++------ 2 files changed, 97 insertions(+), 27 deletions(-) create mode 100644 erpnext_mexico_compliance/controllers/common.py diff --git a/erpnext_mexico_compliance/controllers/common.py b/erpnext_mexico_compliance/controllers/common.py new file mode 100644 index 0000000..a1e99f0 --- /dev/null +++ b/erpnext_mexico_compliance/controllers/common.py @@ -0,0 +1,75 @@ +""" +Copyright (c) 2024, TI Sin Problemas and contributors +For license information, please see license.txt +""" + +import abc + +import frappe +from frappe.model.naming import NamingSeries +from satcfdi.cfdi import CFDI +from satcfdi.create.cfd import cfdi40 + +from ..erpnext_mexico_compliance.doctype.digital_signing_certificate.digital_signing_certificate import ( + DigitalSigningCertificate, +) + + +class CommonController(abc.ABC): + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + name: DF.Data + naming_series: DF.Data + + @property + def cfdi_series(self) -> str: + """CFDI Series code""" + prefix = str(NamingSeries(self.naming_series).get_prefix()) + return prefix if prefix[-1].isalnum() else prefix[:-1] + + @property + def cfdi_folio(self) -> str: + """CFDI Folio number""" + prefix = str(NamingSeries(self.naming_series).get_prefix()) + return str(int(self.name.replace(prefix, ""))) + + @abc.abstractmethod + def get_cfdi_voucher(self, csd: DigitalSigningCertificate) -> cfdi40.Comprobante: + """Generates a CFDI voucher using the provided digital signing certificate. + + Args: + csd (DigitalSigningCertificate): The digital signing certificate. + + Returns: + cfdi40.Comprobante: The generated CFDI voucher. + """ + raise NotImplementedError("cfdi_voucher method is not implemented") + + def sign_cfdi(self, certificate: str) -> CFDI: + """Signs a CFDI document with the provided digital signing certificate. + + Args: + certificate (str): The name of the Digital Signing Certificate to use for signing. + + Returns: + CFDI: The signed and processed CFDI document. + """ + csd = frappe.get_doc("Digital Signing Certificate", certificate) + voucher = self.get_cfdi_voucher(csd) + voucher.sign(csd.signer) + return voucher.process() + + @abc.abstractmethod + def stamp_cfdi(self, certificate: str): + """Stamps a CFDI document with the provided digital signing certificate. + + Args: + certificate (str): The name of the Digital Signing Certificate to use for signing. + + Returns: + CFDI: A message indicating the result of the stamping operation. + """ + raise NotImplementedError("stamp_cfdi method is not implemented") diff --git a/erpnext_mexico_compliance/overrides/sales_invoice.py b/erpnext_mexico_compliance/overrides/sales_invoice.py index 75d042b..47caa07 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice.py @@ -14,11 +14,11 @@ from frappe.client import attach_file from frappe.contacts.doctype.address.address import Address from frappe.model.document import Document -from frappe.model.naming import NamingSeries from frappe.utils import get_datetime from satcfdi.create.cfd import catalogos, cfdi40 from satcfdi.exceptions import SchemaValidationError +from ..controllers.common import CommonController from ..ws_client import WSClientException, WSExistingCfdiException, get_ws_client from .customer import Customer @@ -27,7 +27,7 @@ sys.path[0] = sys.path[0].replace("apps/frappe/frappe/utils", "sites") -class SalesInvoice(sales_invoice.SalesInvoice): +class SalesInvoice(CommonController, sales_invoice.SalesInvoice): """ERPNext Sales Invoice override""" from typing import TYPE_CHECKING @@ -195,34 +195,13 @@ def cfdi_items(self) -> list[cfdi40.Concepto]: ) return cfdi_items - @property - def cfdi_series(self) -> str: - """Series code for the CFDI document for this sales invoice.""" - prefix = str(NamingSeries(self.naming_series).get_prefix()) - return prefix if prefix[-1].isalnum() else prefix[:-1] - - @property - def cfdi_folio(self) -> str: - """Folio number for the CFDI document for this sales invoice.""" - prefix = str(NamingSeries(self.naming_series).get_prefix()) - return str(int(self.name.replace(prefix, ""))) - @property def posting_datetime(self) -> datetime: """`datetime` object representing the posting date and time of the sales invoice.""" return get_datetime(f"{self.posting_date}T{self.posting_time}") - def sign_cfdi(self, certificate: str) -> cfdi40.CFDI: - """Create and sign the CFDI document for this sales invoice. - - Args: - certificate (str): The name of the Digital Signing Certificate to use for signing. - - Returns: - cfdi40.CFDI: Signed and processed CFDI document. - """ - csd = frappe.get_doc("Digital Signing Certificate", certificate) - voucher = cfdi40.Comprobante( + def get_cfdi_voucher(self, csd) -> cfdi40.Comprobante: + return cfdi40.Comprobante( emisor=csd.get_issuer(), lugar_expedicion=self.company_address_doc.pincode, receptor=self.cfdi_receiver, @@ -238,8 +217,6 @@ def sign_cfdi(self, certificate: str) -> cfdi40.CFDI: metodo_pago=self.mx_payment_option, fecha=self.posting_datetime, ) - voucher.sign(csd.signer) - return voucher.process() @frappe.whitelist() def has_file(self, file_name: str) -> bool: @@ -414,3 +391,21 @@ def before_cancel(self): if self.mx_stamped_xml: self.validate_cancel_reason() self.validate_substitute_invoice() + + @property + def payment_entries(self) -> list[frappe._dict]: + """List of Payment Entries associated with the current Sales Invoice.""" + references = frappe.get_all( + "Payment Entry Reference", + filters={ + "reference_doctype": self.doctype, + "reference_name": self.name, + }, + fields=["parent"], + ) + return frappe.get_all( + "Payment Entry", + filters={"name": ["in", [r.parent for r in references]]}, + fields=["name", "posting_date"], + order_by="posting_date asc", + ) From ca515a3cc308949f3ea1978d7112e342c4234c91 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 24 Aug 2024 21:57:31 -0600 Subject: [PATCH 46/62] feat(payment entry): add payment entry override --- .../custom/payment_entry.json | 136 +++++++++++++- erpnext_mexico_compliance/hooks.py | 1 + .../overrides/payment_entry.py | 177 ++++++++++++++++++ .../overrides/sales_invoice.py | 18 +- 4 files changed, 314 insertions(+), 18 deletions(-) create mode 100644 erpnext_mexico_compliance/overrides/payment_entry.py diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json index 8138724..6196f12 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json @@ -1,5 +1,131 @@ { "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-24 21:44:20.141844", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Payment Entry", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_cfdi", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 95, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "title", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-24 21:55:08.616720", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-custom_cfdi", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-24 21:44:42.450992", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Payment Entry", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_stamped_xml", + "fieldtype": "HTML Editor", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 96, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_cfdi", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Stamped XML", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-24 21:55:08.668065", + "modified_by": "Administrator", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-custom_stamped_xml", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "_assign": null, "_comments": null, @@ -17,15 +143,15 @@ "description": null, "docstatus": 0, "dt": "Payment Entry", - "fetch_from": "mode_of_payment.sat_payment_mode", + "fetch_from": "mode_of_payment.sat_payment_method", "fetch_if_empty": 0, - "fieldname": "sat_payment_mode", + "fieldname": "mx_payment_mode", "fieldtype": "Data", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 8, + "idx": 9, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -39,7 +165,7 @@ "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2022-12-20 16:53:50.909607", + "modified": "2024-08-22 18:41:43.820068", "modified_by": "Administrator", "module": "ERPNext Mexico Compliance", "name": "Payment Entry-sat_payment_mode", @@ -69,4 +195,4 @@ "links": [], "property_setters": [], "sync_on_migrate": 1 -} \ No newline at end of file +} diff --git a/erpnext_mexico_compliance/hooks.py b/erpnext_mexico_compliance/hooks.py index d0ab068..cccfd9a 100644 --- a/erpnext_mexico_compliance/hooks.py +++ b/erpnext_mexico_compliance/hooks.py @@ -127,6 +127,7 @@ override_doctype_class = { "Customer": "erpnext_mexico_compliance.overrides.customer.Customer", + "Payment Entry": "erpnext_mexico_compliance.overrides.payment_entry.PaymentEntry", "Sales Invoice": "erpnext_mexico_compliance.overrides.sales_invoice.SalesInvoice", "Sales Invoice Item": "erpnext_mexico_compliance.overrides.sales_invoice_item.SalesInvoiceItem", } diff --git a/erpnext_mexico_compliance/overrides/payment_entry.py b/erpnext_mexico_compliance/overrides/payment_entry.py new file mode 100644 index 0000000..93324d0 --- /dev/null +++ b/erpnext_mexico_compliance/overrides/payment_entry.py @@ -0,0 +1,177 @@ +""" +Copyright (c) 2024, TI Sin Problemas and contributors +For license information, please see license.txt +""" + +import frappe +from erpnext.accounts.doctype.payment_entry import payment_entry +from erpnext.setup.doctype.company.company import get_default_company_address +from frappe import _ +from satcfdi.create.cfd import cfdi40, pago20 +from satcfdi.exceptions import SchemaValidationError + +from ..controllers.common import CommonController +from ..erpnext_mexico_compliance.doctype.digital_signing_certificate.digital_signing_certificate import ( + DigitalSigningCertificate, +) +from ..ws_client import WSClientException, WSExistingCfdiException, get_ws_client + + +class PaymentEntry(CommonController, payment_entry.PaymentEntry): + """ERPNext Payment Entry override""" + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + mx_payment_mode: DF.Data + mx_stamped_xml: DF.HTMLEditor + + @property + def company_address(self) -> str: + """Name of the default address of the Company associated with the current payment entry.""" + return get_default_company_address(self.company) + + @property + def cfdi_receiver(self) -> cfdi40.Receptor: + """`cfdi40.Receptor` object representing the receiver of the CFDI document for this payment + entry.""" + customer = frappe.get_doc(self.party_type, self.party) + address = frappe.get_doc("Address", customer.customer_primary_address) + return cfdi40.Receptor( + rfc=customer.tax_id, + nombre=customer.customer_name.upper(), + domicilio_fiscal_receptor=address.pincode, + regimen_fiscal_receptor=customer.mx_tax_regime, + uso_cfdi="CP01", + ) + + @property + def cfdi_related_documents(self) -> list[pago20.DoctoRelacionado]: + """List of `pago20.DoctoRelacionado` objects, each representing a related document for the + current payment entry.""" + result = [] + for pe_ref in self.references: + ref = frappe.get_doc(pe_ref.reference_doctype, pe_ref.reference_name) + last_balance = pe_ref.allocated_amount + pe_ref.outstanding_amount + result.append( + pago20.DoctoRelacionado( + id_documento=ref.cfdi_uuid, + moneda_dr=ref.currency, + num_parcialidad=get_installment_number( + ref.doctype, ref.name, self.name + ), + imp_saldo_ant=last_balance, + imp_pagado=pe_ref.allocated_amount, + objeto_imp_dr="01", + ) + ) + + return result + + def get_cfdi_voucher(self, csd: DigitalSigningCertificate) -> cfdi40.Comprobante: + address = frappe.get_doc("Address", self.company_address) + + if not address.pincode: + frappe.throw(_("Address {0} has no zip code").format(address.name)) + + return cfdi40.Comprobante.pago( + emisor=csd.get_issuer(), + lugar_expedicion=address.pincode, + receptor=self.cfdi_receiver, + complemento_pago=pago20.Pagos( + pago=pago20.Pago( + fecha_pago=self.reference_date, + forma_de_pago_p=self.mx_payment_mode, + moneda_p=self.currency, + docto_relacionado=self.cfdi_related_documents, + tipo_cambio_p=self.conversion_rate, + ) + ), + serie=self.cfdi_series, + folio=self.cfdi_folio, + fecha=self.posting_date, + ) + + def validate_company(self): + """ + Validates the company information associated with the current payment entry. + + This function checks if the company has an address and if it has a valid zip code. + If any issues are found, an error message is thrown with the list of issues. + + Raises: + frappe.ValidationError: If any issues were found. + """ + if self.company_address: + address = frappe.get_doc("Address", self.company_address) + if not address.pincode: + link = f'{address.name}' + frappe.throw(_("Address {0} has no zip code").format(link)) + else: + company = frappe.get_doc("Company", self.company) + link = f'{company.name}' + frappe.throw(_("Company {0} has no address").format(link)) + + def validate_references(self): + """Validates the references in the payment entry. + + Iterates through each reference in the payment entry and checks if the referenced document + has been stamped. + + Throws: + frappe.ValidationError: If any of the references have not been stamped. + """ + msgs = [] + for pe_ref in self.references: + ref = frappe.get_doc(pe_ref.reference_doctype, pe_ref.reference_name) + if not ref.mx_stamped_xml: + anchor = f'{ref.name}' + msgs.append(_("Reference {0} has not being stamped").format(anchor)) + + if len(msgs) > 0: + frappe.throw(msgs, as_list=True) + + @frappe.whitelist() + def stamp_cfdi(self, certificate: str): + self.validate_company() + self.validate_references() + + cfdi = self.sign_cfdi(certificate) + ws = get_ws_client() + try: + data, message = ws.stamp(cfdi) + except SchemaValidationError as e: + frappe.throw(str(e), title=_("Invalid CFDI")) + except WSExistingCfdiException as e: + data = e.data + message = e.message + except WSClientException as e: + frappe.throw(str(e), title=_("CFDI Web Service Error")) + + self.mx_stamped_xml = data + self.save() + return message + + +def get_installment_number(doctype: str, docname: str, payment_entry_name: str) -> int: + """Returns the installment number of a payment entry in a sales invoice. + + Args: + doctype (str): The type of document. + docname (str): The name of the document. + payment_entry_name (str): The name of the payment entry. + + Returns: + int: The installment number of the payment entry. + + Raises: + frappe.ValidationError: If the document type is not "Sales Invoice". + """ + if doctype != "Sales Invoice": + raise frappe.ValidationError(_("Invalid Document Type")) + doc = frappe.get_doc(doctype, docname) + for idx, entry in enumerate(doc.payment_entries, 1): + if entry.name == payment_entry_name: + return idx diff --git a/erpnext_mexico_compliance/overrides/sales_invoice.py b/erpnext_mexico_compliance/overrides/sales_invoice.py index 47caa07..5055e2e 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice.py @@ -79,11 +79,6 @@ def customer_doc(self) -> Customer: """Customer DocType of the invoice""" return frappe.get_doc("Customer", self.customer) - @property - def company_address_doc(self) -> Address: - """Address DocType of the issuer company""" - return frappe.get_doc("Address", self.company_address) - @property def customer_address_doc(self) -> Address: """Address DocType of the customer""" @@ -115,19 +110,15 @@ def validate_company(self): Raises: frappe.ValidationError: If any issues were found. """ - msgs = [] if self.company_address: - address = self.company_address_doc + address = frappe.get_doc("Address", self.company_address) if not address.pincode: link = f'{address.name}' - msgs.append(_("Address {0} has no zip code").format(link)) + frappe.throw(_("Address {0} has no zip code").format(link)) else: company = self.company_doc link = f'{company.name}' - msgs.append(_("Company {0} has no address").format(link)) - - if len(msgs) > 0: - frappe.throw(msgs, as_list=True) + frappe.throw(_("Company {0} has no address").format(link)) def validate_customer(self): """Validates the customer information on the invoice. @@ -201,9 +192,10 @@ def posting_datetime(self) -> datetime: return get_datetime(f"{self.posting_date}T{self.posting_time}") def get_cfdi_voucher(self, csd) -> cfdi40.Comprobante: + address = frappe.get_doc("Address", self.company_address) return cfdi40.Comprobante( emisor=csd.get_issuer(), - lugar_expedicion=self.company_address_doc.pincode, + lugar_expedicion=address.pincode, receptor=self.cfdi_receiver, conceptos=self.cfdi_items, moneda=self.currency, From 92d921743e9696a8b751b72af4ddf0fd2e5be802 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Mon, 26 Aug 2024 23:57:49 -0600 Subject: [PATCH 47/62] feat(payment entry): add stamp cfdi button --- .../custom/payment_entry.json | 6 ++-- erpnext_mexico_compliance/hooks.py | 5 ++- .../overrides/payment_entry.py | 35 +++++++++++++------ .../public/js/payment_entry.js | 35 +++++++++++++++++++ .../public/js/sales_invoice.js | 2 +- 5 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 erpnext_mexico_compliance/public/js/payment_entry.js diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json index 6196f12..4659c73 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json @@ -25,7 +25,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 95, + "idx": 96, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -88,9 +88,9 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 96, + "idx": 97, "ignore_user_permissions": 0, - "ignore_xss_filter": 0, + "ignore_xss_filter": 1, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, diff --git a/erpnext_mexico_compliance/hooks.py b/erpnext_mexico_compliance/hooks.py index cccfd9a..7a602b5 100644 --- a/erpnext_mexico_compliance/hooks.py +++ b/erpnext_mexico_compliance/hooks.py @@ -32,7 +32,10 @@ # page_js = {"page" : "public/js/file.js"} # include js in doctype views -doctype_js = {"Sales Invoice": "public/js/sales_invoice.js"} +doctype_js = { + "Sales Invoice": "public/js/sales_invoice.js", + "Payment Entry": "public/js/payment_entry.js", +} # doctype_list_js = {"doctype" : "public/js/doctype_list.js"} # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} # doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} diff --git a/erpnext_mexico_compliance/overrides/payment_entry.py b/erpnext_mexico_compliance/overrides/payment_entry.py index 93324d0..47e13b4 100644 --- a/erpnext_mexico_compliance/overrides/payment_entry.py +++ b/erpnext_mexico_compliance/overrides/payment_entry.py @@ -7,6 +7,7 @@ from erpnext.accounts.doctype.payment_entry import payment_entry from erpnext.setup.doctype.company.company import get_default_company_address from frappe import _ +from frappe.utils.data import get_datetime from satcfdi.create.cfd import cfdi40, pago20 from satcfdi.exceptions import SchemaValidationError @@ -76,22 +77,30 @@ def get_cfdi_voucher(self, csd: DigitalSigningCertificate) -> cfdi40.Comprobante if not address.pincode: frappe.throw(_("Address {0} has no zip code").format(address.name)) + reference_date = self.reference_date + if isinstance(reference_date, str): + reference_date = get_datetime(reference_date) + + payment = pago20.Pago( + fecha_pago=reference_date, + forma_de_pago_p=self.mx_payment_mode, + moneda_p=self.paid_from_account_currency, + docto_relacionado=self.cfdi_related_documents, + tipo_cambio_p=self.source_exchange_rate, + ) + + posting_date = self.posting_date + if isinstance(posting_date, str): + posting_date = get_datetime(posting_date) + return cfdi40.Comprobante.pago( emisor=csd.get_issuer(), lugar_expedicion=address.pincode, receptor=self.cfdi_receiver, - complemento_pago=pago20.Pagos( - pago=pago20.Pago( - fecha_pago=self.reference_date, - forma_de_pago_p=self.mx_payment_mode, - moneda_p=self.currency, - docto_relacionado=self.cfdi_related_documents, - tipo_cambio_p=self.conversion_rate, - ) - ), + complemento_pago=pago20.Pagos(pago=payment), serie=self.cfdi_series, folio=self.cfdi_folio, - fecha=self.posting_date, + fecha=posting_date, ) def validate_company(self): @@ -155,7 +164,9 @@ def stamp_cfdi(self, certificate: str): return message -def get_installment_number(doctype: str, docname: str, payment_entry_name: str) -> int: +def get_installment_number( + doctype: str, docname: str, payment_entry_name: str +) -> int | None: """Returns the installment number of a payment entry in a sales invoice. Args: @@ -175,3 +186,5 @@ def get_installment_number(doctype: str, docname: str, payment_entry_name: str) for idx, entry in enumerate(doc.payment_entries, 1): if entry.name == payment_entry_name: return idx + + return None diff --git a/erpnext_mexico_compliance/public/js/payment_entry.js b/erpnext_mexico_compliance/public/js/payment_entry.js new file mode 100644 index 0000000..f47ab18 --- /dev/null +++ b/erpnext_mexico_compliance/public/js/payment_entry.js @@ -0,0 +1,35 @@ +// Copyright (c) 2024, TI Sin Problemas and contributors +// For license information, please see license.txt + +function stampCfdi(frm) { + frappe.prompt( + [ + { + label: __("Digital Signing Certificate"), + fieldname: "certificate", + fieldtype: "Link", + options: "Digital Signing Certificate", + filters: { company: frm.doc.company }, + }, + ], + async ({ certificate }) => { + const { message } = await frm.call("stamp_cfdi", { certificate }); + frappe.show_alert({ message, indicator: "green" }); + frm.reload_doc(); + }, + __("Select a Certificate to sign the CFDI") + ); +} + +function refresh(frm) { + const { docstatus } = frm.doc; + switch (docstatus) { + case 1: + frm.add_custom_button(__("Stamp CFDI"), () => stampCfdi(frm)); + break; + } +} + +frappe.ui.form.on("Payment Entry", { + refresh, +}); diff --git a/erpnext_mexico_compliance/public/js/sales_invoice.js b/erpnext_mexico_compliance/public/js/sales_invoice.js index 45c8544..c6dc9d9 100644 --- a/erpnext_mexico_compliance/public/js/sales_invoice.js +++ b/erpnext_mexico_compliance/public/js/sales_invoice.js @@ -124,7 +124,7 @@ function refresh(frm) { switch (docstatus) { case 1: if (mx_stamped_xml) { - frm.page.set_secondary_action("Cancel", () => cancel(frm)); + frm.page.set_secondary_action(__("Cancel"), () => cancel(frm)); } else { frm.add_custom_button(__("Stamp CFDI"), () => stampCfdi(frm)); } From 6096002f589e7bb6778df17d39af289ef269d735 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Tue, 27 Aug 2024 00:43:21 -0600 Subject: [PATCH 48/62] feat(payment entry): add file attachment buttons --- .../overrides/payment_entry.py | 52 ++++++++++++++++ .../public/js/payment_entry.js | 59 ++++++++++++++++++- 2 files changed, 109 insertions(+), 2 deletions(-) diff --git a/erpnext_mexico_compliance/overrides/payment_entry.py b/erpnext_mexico_compliance/overrides/payment_entry.py index 47e13b4..5dc99c5 100644 --- a/erpnext_mexico_compliance/overrides/payment_entry.py +++ b/erpnext_mexico_compliance/overrides/payment_entry.py @@ -3,10 +3,14 @@ For license information, please see license.txt """ +import sys + import frappe from erpnext.accounts.doctype.payment_entry import payment_entry from erpnext.setup.doctype.company.company import get_default_company_address from frappe import _ +from frappe.client import attach_file +from frappe.model.document import Document from frappe.utils.data import get_datetime from satcfdi.create.cfd import cfdi40, pago20 from satcfdi.exceptions import SchemaValidationError @@ -17,6 +21,10 @@ ) from ..ws_client import WSClientException, WSExistingCfdiException, get_ws_client +# temporary hack until https://github.com/frappe/frappe/issues/27373 is fixed +if sys.path[0].rsplit("/", maxsplit=1)[-1] == "utils": + sys.path[0] = sys.path[0].replace("apps/frappe/frappe/utils", "sites") + class PaymentEntry(CommonController, payment_entry.PaymentEntry): """ERPNext Payment Entry override""" @@ -66,6 +74,8 @@ def cfdi_related_documents(self) -> list[pago20.DoctoRelacionado]: imp_saldo_ant=last_balance, imp_pagado=pe_ref.allocated_amount, objeto_imp_dr="01", + serie=ref.cfdi_series, + folio=ref.cfdi_folio, ) ) @@ -163,6 +173,48 @@ def stamp_cfdi(self, certificate: str): self.save() return message + @frappe.whitelist() + def has_file(self, file_name: str) -> bool: + """Returns DocType name if the CFDI document for this sales invoice has a file named as + `file_name` attached.""" + return frappe.db.exists( + "File", + { + "attached_to_doctype": self.doctype, + "attached_to_name": self.name, + "file_name": file_name, + }, + ) + + @frappe.whitelist() + def attach_pdf(self) -> Document: + """Attaches the CFDI PDF to the current document. + + This method generates a PDF file from the CFDI XML and attaches it to the current document. + + Returns: + Document: The result of attaching the PDF file to the current document. + """ + from satcfdi import render # pylint: disable=import-outside-toplevel + + cfdi = cfdi40.CFDI.from_string(self.mx_stamped_xml.encode("utf-8")) + file_name = f"{self.name}_CFDI.pdf" + file_data = render.pdf_bytes(cfdi) + return attach_file(file_name, file_data, self.doctype, self.name, is_private=1) + + @frappe.whitelist() + def attach_xml(self) -> Document: + """Attaches the CFDI XML to the current document. + + This method generates an XML file from the CFDI XML and attaches it to the current document. + + Returns: + Document: The result of attaching the XML file to the current document. + """ + file_name = f"{self.name}_CFDI.xml" + xml = self.mx_stamped_xml + return attach_file(file_name, xml, self.doctype, self.name, is_private=1) + def get_installment_number( doctype: str, docname: str, payment_entry_name: str diff --git a/erpnext_mexico_compliance/public/js/payment_entry.js b/erpnext_mexico_compliance/public/js/payment_entry.js index f47ab18..cb8d8af 100644 --- a/erpnext_mexico_compliance/public/js/payment_entry.js +++ b/erpnext_mexico_compliance/public/js/payment_entry.js @@ -21,11 +21,66 @@ function stampCfdi(frm) { ); } +async function attachFile(frm, ext) { + const functionMap = { pdf: "attach_pdf", xml: "attach_xml" }; + + try { + const { message } = await frm.call(functionMap[ext]); + const { file_name } = message; + frappe.show_alert({ + message: __("File {0} attached", [file_name]), + indicator: "green", + }); + frm.reload_doc(); + } catch (error) { + const { responseJSON } = error; + frappe.throw(responseJSON ? responseJSON.exception : error); + } +} + +const cfdiActionsGroup = __("CFDI Actions"); + +async function addAttachPdfButton(frm) { + const { message: hasFile } = await frm.call("has_file", { + file_name: `${frm.doc.name}_CFDI.pdf`, + }); + + if (!hasFile) { + frm.add_custom_button( + __("Attach PDF"), + async () => await attachFile(frm, "pdf"), + cfdiActionsGroup + ); + } +} + +async function addAttachXmlButton(frm) { + const { message: hasFile } = await frm.call("has_file", { + file_name: `${frm.doc.name}_CFDI.xml`, + }); + + if (!hasFile) { + frm.add_custom_button( + __("Attach XML"), + async () => await attachFile(frm, "xml"), + cfdiActionsGroup + ); + } +} + function refresh(frm) { - const { docstatus } = frm.doc; + const { docstatus, mx_stamped_xml } = frm.doc; + + if (mx_stamped_xml) { + addAttachPdfButton(frm); + addAttachXmlButton(frm); + } + switch (docstatus) { case 1: - frm.add_custom_button(__("Stamp CFDI"), () => stampCfdi(frm)); + if (!mx_stamped_xml) { + frm.add_custom_button(__("Stamp CFDI"), () => stampCfdi(frm)); + } break; } } From 14d8d648c02a108b4b89a9fe61a4cada6e55698b Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 28 Aug 2024 19:51:40 -0600 Subject: [PATCH 49/62] feat(fixtures): migrate account custom fields to fixtures --- .../custom/account.json | 72 ------------------- .../fixtures/custom_field.json | 58 +++++++++++++++ 2 files changed, 58 insertions(+), 72 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/account.json create mode 100644 erpnext_mexico_compliance/fixtures/custom_field.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/account.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/account.json deleted file mode 100644 index 4e5068a..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/account.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-02 15:50:05.826417", - "default": null, - "depends_on": "eval:doc.account_type == 'Tax'", - "description": null, - "docstatus": 0, - "dt": "Account", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "tax_type", - "fieldtype": "Select", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 14, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "tax_rate", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Tax Type", - "length": 0, - "link_filters": null, - "mandatory_depends_on": "eval:doc.account_type == 'Tax'", - "modified": "2022-12-19 15:45:47.468341", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Account-tax_type", - "no_copy": 0, - "non_negative": 0, - "options": "\nIVA\nISR\nIEPS", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Account", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json new file mode 100644 index 0000000..11cde67 --- /dev/null +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -0,0 +1,58 @@ +[ + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval:doc.account_type == 'Tax'", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Account", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "tax_type", + "fieldtype": "Select", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_rate", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Tax Type", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "eval:doc.account_type == 'Tax'", + "modified": "2022-12-19 15:45:47.468341", + "module": "ERPNext Mexico Compliance", + "name": "Account-tax_type", + "no_copy": 0, + "non_negative": 0, + "options": "\nIVA\nISR\nIEPS", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, +] \ No newline at end of file From 876e061f6d8b3d4d47c038e9f48d431e5ce49592 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 28 Aug 2024 19:55:50 -0600 Subject: [PATCH 50/62] feat(fixtures): migrate bank account custom fields to fixtures --- .../custom/bank_account.json | 72 ------------------- .../fixtures/custom_field.json | 56 +++++++++++++++ 2 files changed, 56 insertions(+), 72 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/bank_account.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/bank_account.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/bank_account.json deleted file mode 100644 index c006872..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/bank_account.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-02 15:50:06.020394", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Bank Account", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "clabe", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 16, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "iban", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CLABE", - "length": 18, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2023-06-12 22:33:46.005100", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Bank Account-clabe", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 1, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Bank Account", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 11cde67..38435be 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -55,4 +55,60 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Bank Account", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "clabe", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "iban", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CLABE", + "length": 18, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2023-06-12 22:33:46.005100", + "module": "ERPNext Mexico Compliance", + "name": "Bank Account-clabe", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + }, ] \ No newline at end of file From 009e8b19d8a61b57de670f8e0c6ac45801835a32 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 28 Aug 2024 19:58:49 -0600 Subject: [PATCH 51/62] feat(fixtures): migrate company custom fields to fixtures --- .../custom/company.json | 72 ------------------- .../fixtures/custom_field.json | 56 +++++++++++++++ 2 files changed, 56 insertions(+), 72 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/company.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/company.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/company.json deleted file mode 100644 index 5bd8536..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/company.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-10 02:01:55.589523", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Company", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_tax_regime", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 10, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "tax_id", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Tax Regime", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-10 02:01:55.589523", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Company-mx_tax_regime", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Tax Regime", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Company", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 38435be..b1fc6f9 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1,4 +1,60 @@ [ + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Company", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_tax_regime", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_id", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Tax Regime", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-10 02:01:55.589523", + "module": "ERPNext Mexico Compliance", + "name": "Company-mx_tax_regime", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Tax Regime", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, From e328dbe7aa677410cb7981c6d4209bfedafd91aa Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 28 Aug 2024 20:07:43 -0600 Subject: [PATCH 52/62] feat(fixtures): migrate customer custom fields to fixtures --- .../custom/customer.json | 96 ------------------- .../fixtures/custom_field.json | 56 +++++++++++ .../fixtures/property_setter.json | 18 ++++ 3 files changed, 74 insertions(+), 96 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json create mode 100644 erpnext_mexico_compliance/fixtures/property_setter.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json deleted file mode 100644 index 76ac910..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/customer.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-02 15:50:06.166937", - "default": null, - "depends_on": "", - "description": null, - "docstatus": 0, - "dt": "Customer", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_tax_regime", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 49, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "tax_id", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Tax Regime", - "length": 0, - "link_filters": null, - "mandatory_depends_on": "", - "modified": "2022-12-19 15:47:09.539300", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Customer-mx_tax_regime", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Tax Regime", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Customer", - "links": [], - "property_setters": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2024-08-02 15:49:16.756830", - "default_value": null, - "doc_type": "Customer", - "docstatus": 0, - "doctype_or_field": "DocField", - "field_name": "tax_id", - "idx": 0, - "is_system_generated": 0, - "modified": "2024-08-10 11:44:44.962389", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Customer-tax_id-allow_in_quick_entry", - "owner": "Administrator", - "property": "allow_in_quick_entry", - "property_type": "Check", - "row_name": null, - "value": "1" - } - ], - "sync_on_migrate": 1 -} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index b1fc6f9..c4fbf67 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -167,4 +167,60 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_tax_regime", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_id", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Tax Regime", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "", + "modified": "2022-12-19 15:47:09.539300", + "module": "ERPNext Mexico Compliance", + "name": "Customer-mx_tax_regime", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Tax Regime", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, ] \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/property_setter.json b/erpnext_mexico_compliance/fixtures/property_setter.json new file mode 100644 index 0000000..f2ff952 --- /dev/null +++ b/erpnext_mexico_compliance/fixtures/property_setter.json @@ -0,0 +1,18 @@ +[ + { + "default_value": null, + "doc_type": "Customer", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "tax_id", + "is_system_generated": 0, + "modified": "2024-08-28 18:24:27.487429", + "module": "ERPNext Mexico Compliance", + "name": "Customer-tax_id-allow_in_quick_entry", + "property": "allow_in_quick_entry", + "property_type": "Check", + "row_name": null, + "value": "1" + } +] \ No newline at end of file From 54c48145212c6456007a37720ea1f1d725eb0996 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 28 Aug 2024 20:36:28 -0600 Subject: [PATCH 53/62] feat(fixtures): migrate item custom fields to fixtures --- .../custom/item.json | 135 ------------------ .../fixtures/custom_field.json | 124 ++++++++++++++++ 2 files changed, 124 insertions(+), 135 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json deleted file mode 100644 index 50e429c..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/item.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-02 15:50:06.379210", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Item", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi", - "fieldtype": "Tab Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 108, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "total_projected_qty", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-11 19:46:06.465750", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Item-cfdi_40", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-02 15:50:06.628836", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Item", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_product_service_key", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 109, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cfdi", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Product or Service Key", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-11 21:37:19.858147", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Item-sat_product_or_service_key", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Product or Service Key", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Item", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index c4fbf67..ba513a1 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -223,4 +223,128 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi", + "fieldtype": "Tab Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "total_projected_qty", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-11 19:46:06.465750", + "module": "ERPNext Mexico Compliance", + "name": "Item-cfdi_40", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_product_service_key", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Product or Service Key", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-11 21:37:19.858147", + "module": "ERPNext Mexico Compliance", + "name": "Item-sat_product_or_service_key", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Product or Service Key", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, ] \ No newline at end of file From 42210a9a0f191424f2b74b5915df71431e8f8968 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 28 Aug 2024 20:49:19 -0600 Subject: [PATCH 54/62] feat(fixtures): migrate mode of payment custom fields to fixtures --- .../custom/mode_of_payment.json | 135 ------------------ .../fixtures/custom_field.json | 112 +++++++++++++++ 2 files changed, 112 insertions(+), 135 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json deleted file mode 100644 index 75b1a1e..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/mode_of_payment.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 1, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-26 23:30:54.165903", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Mode of Payment", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 5, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "accounts", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:11:37.701411", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Mode of Payment-cfdi", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 1, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-26 23:30:54.238538", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Mode of Payment", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "sat_payment_method", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 6, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cfdi", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Payment Method", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2022-12-19 15:58:19.773242", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Mode of Payment-sat_payment_method", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Payment Method", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Mode of Payment", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} \ No newline at end of file diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index ba513a1..0f92e94 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1,5 +1,117 @@ [ { + "allow_in_quick_entry": 1, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Mode of Payment", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "accounts", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:11:37.701411", + "module": "ERPNext Mexico Compliance", + "name": "Mode of Payment-cfdi", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + { + "allow_in_quick_entry": 1, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Mode of Payment", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "sat_payment_method", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Payment Method", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 15:58:19.773242", + "module": "ERPNext Mexico Compliance", + "name": "Mode of Payment-sat_payment_method", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Payment Method", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, From 9f496c2b40f31e6011b24eea2fc1e6daed4cbeaf Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 28 Aug 2024 22:03:06 -0600 Subject: [PATCH 55/62] feat(fixtures): migrate sales invoice item custom fields to fixtures --- .../custom/sales_invoice_item.json | 135 ------------------ .../fixtures/custom_field.json | 104 ++++++++++++++ 2 files changed, 104 insertions(+), 135 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json deleted file mode 100644 index 4e33032..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice_item.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-07-30 00:21:39.107146", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice Item", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 104, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "project", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-11 21:15:30.639653", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice Item-custom_cfdi", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-27 19:09:40.594044", - "default": null, - "depends_on": "", - "description": null, - "docstatus": 0, - "dt": "Sales Invoice Item", - "fetch_from": "item_code.mx_product_service_key", - "fetch_if_empty": 1, - "fieldname": "mx_product_service_key", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 105, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cfdi", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Product or Service Key", - "length": 0, - "link_filters": null, - "mandatory_depends_on": "", - "modified": "2024-08-11 22:03:06.415334", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice Item-sat_product_or_service_key", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Product or Service Key", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": "eval: doc.item_code", - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Sales Invoice Item", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 0f92e94..d0ccdf9 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -347,6 +347,62 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "project", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-11 21:15:30.639653", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice Item-cfdi_section", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, @@ -355,6 +411,54 @@ "collapsible_depends_on": null, "columns": 0, "default": null, + "depends_on": "", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice Item", + "fetch_from": "item_code.mx_product_service_key", + "fetch_if_empty": 1, + "fieldname": "mx_product_service_key", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Product or Service Key", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "", + "modified": "2024-08-11 22:03:06.415334", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice Item-sat_product_or_service_key", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Product or Service Key", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "eval: doc.item_code", + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, "depends_on": null, "description": null, "docstatus": 0, From 1301f38f8fc65d1cddb7063a821a6ad63ffc8830 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Wed, 28 Aug 2024 23:33:29 -0600 Subject: [PATCH 56/62] feat(fixtures): migrate sales invoice custom fields to fixtures --- .../custom/sales_invoice.json | 828 ------------------ .../fixtures/custom_field.json | 611 +++++++++++++ 2 files changed, 611 insertions(+), 828 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json deleted file mode 100644 index 6da1eda..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/sales_invoice.json +++ /dev/null @@ -1,828 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-27 19:09:41.283106", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cfdi_40", - "fieldtype": "Tab Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 209, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "connections_tab", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:54:24.912637", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-cfdi_40", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-27 19:09:42.072016", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "column_break_206", - "fieldtype": "Column Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 212, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mx_cfdi_use", - "is_system_generated": 0, - "is_virtual": 0, - "label": null, - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:53:24.995485", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-column_break_206", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-17 18:46:22.380912", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "custom_cancellation", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 215, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mx_payment_mode", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Cancellation", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-17 18:57:09.032783", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_cancellation", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-22 01:17:09.959358", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cancellation_acknowledgement", - "fieldtype": "HTML Editor", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 221, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mx_stamped_xml", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Cancellation acknowledgement", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-22 01:17:52.961407", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_cancellation_acknowledgement", - "no_copy": 1, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-17 18:46:23.577670", - "default": null, - "depends_on": "eval:doc.mx_stamped_xml != null", - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "cancellation_reason", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 216, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "custom_cancellation", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Cancellation reason", - "length": 0, - "link_filters": null, - "mandatory_depends_on": "eval:doc.docstatus == 1", - "modified": "2024-08-17 18:57:42.717062", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_cancellation_reason", - "no_copy": 1, - "non_negative": 0, - "options": "Cancellation Reason", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": "eval:doc.docstatus != 1", - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-17 20:02:49.349104", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "requires_relationship", - "fieldtype": "Check", - "hidden": 1, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 217, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cancellation_reason", - "is_system_generated": 0, - "is_virtual": 1, - "label": "Requires Relationship", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-21 23:50:43.024068", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_requires_relationship", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-16 17:01:12.646899", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "custom_section_break_9ww80", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 219, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "substitute_invoice", - "is_system_generated": 0, - "is_virtual": 0, - "label": "XML", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-17 20:04:01.572502", - "modified_by": "Administrator", - "module": null, - "name": "Sales Invoice-custom_section_break_9ww80", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-21 23:37:07.142945", - "default": null, - "depends_on": "eval:doc.cancellation_reason == \"01\"", - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "substitute_invoice", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 218, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "requires_relationship", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Substitute invoice", - "length": 0, - "link_filters": null, - "mandatory_depends_on": "eval:doc.cancellation_reason == \"01\"", - "modified": "2024-08-21 23:50:42.992235", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_substitute_invoice", - "no_copy": 1, - "non_negative": 0, - "options": "Sales Invoice", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": "eval:doc.docstatus != 1", - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-16 17:01:13.558411", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_stamped_xml", - "fieldtype": "HTML Editor", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 220, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "custom_section_break_9ww80", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Stamped XML", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-16 17:05:22.837922", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_xml", - "no_copy": 1, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-27 19:09:41.529406", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 213, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "column_break_206", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Mode of Payment", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2022-12-19 16:24:16.564574", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-mode_of_payment", - "no_copy": 0, - "non_negative": 0, - "options": "Mode of Payment", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": "", - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-27 19:09:42.668602", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_cfdi_use", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 211, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mx_payment_option", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT CFDI Use", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-06-27 19:53:20.818669", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-mx_cfdi_use", - "no_copy": 0, - "non_negative": 0, - "options": "SAT CFDI Use", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-27 19:09:41.796187", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": "mode_of_payment.sat_payment_method", - "fetch_if_empty": 0, - "fieldname": "mx_payment_mode", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 214, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mode_of_payment", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Payment Method", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2022-12-19 21:38:43.086168", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-mx_payment_mode", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-06-27 19:47:46.258744", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Sales Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_payment_option", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 210, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "cfdi_40", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Payment Option", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-06-27 19:53:20.792645", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-mx_payment_option", - "no_copy": 0, - "non_negative": 0, - "options": "SAT Payment Option", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Sales Invoice", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index d0ccdf9..3e681c1 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -563,4 +563,615 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi_40", + "fieldtype": "Tab Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "connections_tab", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:54:24.912637", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-cfdi_40", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_payment_option", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi_40", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Payment Option", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-06-27 19:53:20.792645", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-mx_payment_option", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Payment Option", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_cfdi_use", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_payment_option", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT CFDI Use", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-06-27 19:53:20.818669", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-mx_cfdi_use", + "no_copy": 0, + "non_negative": 0, + "options": "SAT CFDI Use", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "column_break_206", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_cfdi_use", + "is_system_generated": 0, + "is_virtual": 0, + "label": null, + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:53:24.995485", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-column_break_206", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "column_break_206", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Mode of Payment", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 16:24:16.564574", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-mode_of_payment", + "no_copy": 0, + "non_negative": 0, + "options": "Mode of Payment", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "", + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": "mode_of_payment.sat_payment_method", + "fetch_if_empty": 0, + "fieldname": "mx_payment_mode", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mode_of_payment", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Payment Method", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2022-12-19 21:38:43.086168", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-mx_payment_mode", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_cancellation", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_payment_mode", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-17 18:57:09.032783", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-cancellation_section", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval:doc.mx_stamped_xml != null", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cancellation_reason", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_cancellation", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation reason", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "eval:doc.docstatus == 1", + "modified": "2024-08-17 18:57:42.717062", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-cancellation_reason", + "no_copy": 1, + "non_negative": 0, + "options": "Cancellation Reason", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "eval:doc.docstatus != 1", + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "requires_relationship", + "fieldtype": "Check", + "hidden": 1, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cancellation_reason", + "is_system_generated": 0, + "is_virtual": 1, + "label": "Requires Relationship", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-21 23:50:43.024068", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_requires_relationship", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval:doc.cancellation_reason == \"01\"", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "substitute_invoice", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "requires_relationship", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Substitute invoice", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "eval:doc.cancellation_reason == \"01\"", + "modified": "2024-08-21 23:50:42.992235", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-substitute_invoice", + "no_copy": 1, + "non_negative": 0, + "options": "Sales Invoice", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "eval:doc.docstatus != 1", + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_stamped_xml", + "fieldtype": "HTML Editor", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_section_break_9ww80", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Stamped XML", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-16 17:05:22.837922", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-mx_stamped_xml", + "no_copy": 1, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, ] \ No newline at end of file From c1ef712e1481e01fa6419004c737a1373b522470 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 29 Aug 2024 00:00:38 -0600 Subject: [PATCH 57/62] feat(fixtures): migrate unit of measure custom fields to fixtures --- .../erpnext_mexico_compliance/custom/uom.json | 135 ------------------ .../fixtures/custom_field.json | 111 ++++++++++++++ 2 files changed, 111 insertions(+), 135 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json deleted file mode 100644 index ef1f37a..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/uom.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 1, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-07-25 00:18:06.817491", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "UOM", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "custom_cfdi", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 4, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "must_be_whole_number", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-07-25 00:18:06.817491", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "UOM-custom_cfdi", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 1, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-07-24 23:36:45.800248", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "UOM", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_uom_key", - "fieldtype": "Link", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 5, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_preview": 0, - "in_standard_filter": 1, - "insert_after": "custom_cfdi", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT UOM Key", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-11 23:32:21.659300", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "UOM-sat_uom_key", - "no_copy": 0, - "non_negative": 0, - "options": "SAT UOM Key", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "UOM", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 3e681c1..6e321f5 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1,4 +1,60 @@ [ + { + "allow_in_quick_entry": 1, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "UOM", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi_section", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "must_be_whole_number", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-25 00:18:06.817491", + "module": "ERPNext Mexico Compliance", + "name": "UOM-custom_cfdi", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "allow_in_quick_entry": 1, "allow_on_submit": 0, @@ -56,6 +112,61 @@ "width": null }, { + "allow_in_quick_entry": 1, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "UOM", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_uom_key", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_preview": 0, + "in_standard_filter": 1, + "insert_after": "cfdi_section", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT UOM Key", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-11 23:32:21.659300", + "module": "ERPNext Mexico Compliance", + "name": "UOM-sat_uom_key", + "no_copy": 0, + "non_negative": 0, + "options": "SAT UOM Key", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "allow_in_quick_entry": 1, "allow_on_submit": 0, From 3f0a8b4750ee1b82fb1ee0d651b7b38bba85371c Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 29 Aug 2024 00:58:20 -0600 Subject: [PATCH 58/62] feat(fixtures): migrate payment entry custom fields to fixtures --- .../custom/payment_entry.json | 198 ----- .../fixtures/custom_field.json | 770 ++++++++++++++++-- 2 files changed, 722 insertions(+), 246 deletions(-) delete mode 100644 erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json deleted file mode 100644 index 4659c73..0000000 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/custom/payment_entry.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-24 21:44:20.141844", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Payment Entry", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_cfdi", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 96, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "title", - "is_system_generated": 0, - "is_virtual": 0, - "label": "CFDI", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-24 21:55:08.616720", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-custom_cfdi", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-24 21:44:42.450992", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Payment Entry", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "mx_stamped_xml", - "fieldtype": "HTML Editor", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 97, - "ignore_user_permissions": 0, - "ignore_xss_filter": 1, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mx_cfdi", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Stamped XML", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-24 21:55:08.668065", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-custom_stamped_xml", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2024-08-02 15:50:05.598146", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Payment Entry", - "fetch_from": "mode_of_payment.sat_payment_method", - "fetch_if_empty": 0, - "fieldname": "mx_payment_mode", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 9, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "mode_of_payment", - "is_system_generated": 0, - "is_virtual": 0, - "label": "SAT Payment Mode", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-22 18:41:43.820068", - "modified_by": "Administrator", - "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-sat_payment_mode", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Payment Entry", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 -} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 6e321f5..8726987 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -35,7 +35,7 @@ "mandatory_depends_on": null, "modified": "2024-07-25 00:18:06.817491", "module": "ERPNext Mexico Compliance", - "name": "UOM-custom_cfdi", + "name": "UOM-cfdi_section", "no_copy": 0, "non_negative": 0, "options": null, @@ -223,8 +223,513 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 1, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Employee", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_second_last_name", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "last_name", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Second Last Name", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-06 17:44:51.766484", + "module": "ERPNext Mexico Compliance", + "name": "Employee-custom_second_last_name", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Payment Entry", + "fetch_from": "mode_of_payment.sat_payment_method", + "fetch_if_empty": 0, + "fieldname": "mx_payment_mode", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mode_of_payment", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Payment Mode", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-22 18:41:43.820068", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-sat_payment_mode", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Company", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_tax_regime", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_id", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Tax Regime", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-10 02:01:55.589523", + "module": "ERPNext Mexico Compliance", + "name": "Company-mx_tax_regime", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Tax Regime", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval:doc.account_type == 'Tax'", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Account", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "tax_type", + "fieldtype": "Select", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_rate", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Tax Type", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "eval:doc.account_type == 'Tax'", + "modified": "2022-12-19 15:45:47.468341", + "module": "ERPNext Mexico Compliance", + "name": "Account-tax_type", + "no_copy": 0, + "non_negative": 0, + "options": "\nIVA\nISR\nIEPS", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Bank Account", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "clabe", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "iban", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CLABE", + "length": 18, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2023-06-12 22:33:46.005100", + "module": "ERPNext Mexico Compliance", + "name": "Bank Account-clabe", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Customer", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_tax_regime", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "tax_id", + "is_system_generated": 0, + "is_virtual": 0, + "label": "SAT Tax Regime", + "length": 0, + "link_filters": null, + "mandatory_depends_on": "", + "modified": "2022-12-19 15:47:09.539300", + "module": "ERPNext Mexico Compliance", + "name": "Customer-mx_tax_regime", + "no_copy": 0, + "non_negative": 0, + "options": "SAT Tax Regime", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Payment Entry", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cfdi_tab", + "fieldtype": "Tab Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "title", + "is_system_generated": 0, + "is_virtual": 0, + "label": "CFDI", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-27 01:34:55.810734", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-cfdi_tab", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Payment Entry", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mx_cancellation_section", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cfdi_tab", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-27 01:34:39.111761", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-mx_cancellation_section", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval:doc.mx_stamped_xml != null", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Payment Entry", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cancellation_reason", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_cancellation_section", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation reason", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-27 01:33:02.504195", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-custom_cancellation_reason", + "no_copy": 1, + "non_negative": 0, + "options": "Cancellation Reason", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": "eval:doc.docstatus != 1", + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { "allow_in_quick_entry": 0, - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "collapsible_depends_on": null, @@ -234,10 +739,10 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Company", + "dt": "Payment Entry", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "mx_tax_regime", + "fieldname": "substitute_payment_entry", "fieldtype": "Link", "hidden": 0, "hide_border": 0, @@ -249,19 +754,19 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "tax_id", + "insert_after": "cancellation_reason", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT Tax Regime", + "label": "Substitute payment entry", "length": 0, "link_filters": null, - "mandatory_depends_on": null, - "modified": "2024-08-10 02:01:55.589523", + "mandatory_depends_on": "eval:doc.cancellation_reason == \"01\"", + "modified": "2024-08-27 01:15:39.970278", "module": "ERPNext Mexico Compliance", - "name": "Company-mx_tax_regime", - "no_copy": 0, + "name": "Payment Entry-custom_substitute_payment_entry", + "no_copy": 1, "non_negative": 0, - "options": "SAT Tax Regime", + "options": "Payment Entry", "permlevel": 0, "precision": "", "print_hide": 0, @@ -282,19 +787,19 @@ "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, - "collapsible": 0, + "collapsible": 1, "collapsible_depends_on": null, "columns": 0, "default": null, - "depends_on": "eval:doc.account_type == 'Tax'", + "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Account", + "dt": "Payment Entry", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "tax_type", - "fieldtype": "Select", + "fieldname": "stamped_xml", + "fieldtype": "Section Break", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -305,19 +810,19 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "tax_rate", + "insert_after": "substitute_payment_entry", "is_system_generated": 0, "is_virtual": 0, - "label": "Tax Type", + "label": "XML", "length": 0, "link_filters": null, - "mandatory_depends_on": "eval:doc.account_type == 'Tax'", - "modified": "2022-12-19 15:45:47.468341", + "mandatory_depends_on": null, + "modified": "2024-08-27 01:58:55.441725", "module": "ERPNext Mexico Compliance", - "name": "Account-tax_type", + "name": "Payment Entry-stamped_xml", "no_copy": 0, "non_negative": 0, - "options": "\nIVA\nISR\nIEPS", + "options": null, "permlevel": 0, "precision": "", "print_hide": 0, @@ -346,11 +851,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Bank Account", + "dt": "Payment Entry", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "clabe", - "fieldtype": "Data", + "fieldname": "custom_column_break_vv65n", + "fieldtype": "Column Break", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -361,16 +866,16 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "iban", + "insert_after": "stamped_xml", "is_system_generated": 0, "is_virtual": 0, - "label": "CLABE", - "length": 18, + "label": "", + "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2023-06-12 22:33:46.005100", + "modified": "2024-08-27 01:49:05.618820", "module": "ERPNext Mexico Compliance", - "name": "Bank Account-clabe", + "name": "Payment Entry-custom_column_break_vv65n", "no_copy": 0, "non_negative": 0, "options": null, @@ -386,56 +891,56 @@ "search_index": 0, "show_dashboard": 0, "sort_options": 0, - "translatable": 1, + "translatable": 0, "unique": 0, "width": null }, { "allow_in_quick_entry": 0, - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "collapsible_depends_on": null, "columns": 0, "default": null, - "depends_on": "", + "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Customer", + "dt": "Payment Entry", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "mx_tax_regime", - "fieldtype": "Link", + "fieldname": "mx_stamped_xml", + "fieldtype": "HTML Editor", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, "ignore_user_permissions": 0, - "ignore_xss_filter": 0, + "ignore_xss_filter": 1, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "tax_id", + "insert_after": "custom_column_break_vv65n", "is_system_generated": 0, "is_virtual": 0, - "label": "SAT Tax Regime", + "label": "Stamped XML", "length": 0, "link_filters": null, - "mandatory_depends_on": "", - "modified": "2022-12-19 15:47:09.539300", + "mandatory_depends_on": null, + "modified": "2024-08-27 01:15:40.009641", "module": "ERPNext Mexico Compliance", - "name": "Customer-mx_tax_regime", - "no_copy": 0, + "name": "Payment Entry-custom_stamped_xml", + "no_copy": 1, "non_negative": 0, - "options": "SAT Tax Regime", + "options": null, "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -448,7 +953,7 @@ }, { "allow_in_quick_entry": 0, - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "collapsible_depends_on": null, @@ -458,6 +963,50 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", + "dt": "Payment Entry", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cancellation_acknowledgement", + "fieldtype": "HTML Editor", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 1, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_stamped_xml", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation acknowledgement", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-27 01:23:45.661672", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-cancellation_acknowledgement", + "no_copy": 1, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, @@ -570,6 +1119,14 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, "depends_on": null, "description": null, "docstatus": 0, @@ -1010,6 +1567,19 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, "fieldname": "custom_cancellation", @@ -1089,7 +1659,7 @@ "mandatory_depends_on": "eval:doc.docstatus == 1", "modified": "2024-08-17 18:57:42.717062", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-cancellation_reason", + "name": "Sales Invoice-custom_cancellation_reason", "no_copy": 1, "non_negative": 0, "options": "Cancellation Reason", @@ -1221,6 +1791,43 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_section_break_9ww80", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "substitute_invoice", + "is_system_generated": 0, + "is_virtual": 0, + "label": "XML", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-28 23:24:24.344099", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_section_break_9ww80", "no_copy": 0, "non_negative": 0, "options": null, @@ -1229,6 +1836,17 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, @@ -1285,4 +1903,60 @@ "unique": 0, "width": null }, -] \ No newline at end of file + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cancellation_acknowledgement", + "fieldtype": "HTML Editor", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "mx_stamped_xml", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cancellation acknowledgement", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-22 01:17:52.961407", + "module": "ERPNext Mexico Compliance", + "name": "Sales Invoice-custom_cancellation_acknowledgement", + "no_copy": 1, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } +] From 043fdaf37bcdbce3f4402b4c1842ed113f137276 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Thu, 29 Aug 2024 16:06:33 -0600 Subject: [PATCH 59/62] feat(fixtures): rename payment entry & sales invoice custom fields --- .../fixtures/custom_field.json | 136 ++++++++++++------ 1 file changed, 96 insertions(+), 40 deletions(-) diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 8726987..c0dfd90 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -707,7 +707,7 @@ "mandatory_depends_on": null, "modified": "2024-08-27 01:33:02.504195", "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-custom_cancellation_reason", + "name": "Payment Entry-cancellation_reason", "no_copy": 1, "non_negative": 0, "options": "Cancellation Reason", @@ -729,7 +729,7 @@ }, { "allow_in_quick_entry": 0, - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "collapsible_depends_on": null, @@ -742,6 +742,62 @@ "dt": "Payment Entry", "fetch_from": null, "fetch_if_empty": 0, + "fieldname": "requires_relationship", + "fieldtype": "Check", + "hidden": 1, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "cancellation_reason", + "is_system_generated": 0, + "is_virtual": 1, + "label": "Requires relationship", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-29 13:20:00.851548", + "module": "ERPNext Mexico Compliance", + "name": "Payment Entry-requires_relationship", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval:doc.cancellation_reason == \"01\"", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Payment Entry", + "fetch_from": null, + "fetch_if_empty": 0, "fieldname": "substitute_payment_entry", "fieldtype": "Link", "hidden": 0, @@ -754,7 +810,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "cancellation_reason", + "insert_after": "requires_relationship", "is_system_generated": 0, "is_virtual": 0, "label": "Substitute payment entry", @@ -763,7 +819,7 @@ "mandatory_depends_on": "eval:doc.cancellation_reason == \"01\"", "modified": "2024-08-27 01:15:39.970278", "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-custom_substitute_payment_entry", + "name": "Payment Entry-substitute_payment_entry", "no_copy": 1, "non_negative": 0, "options": "Payment Entry", @@ -854,7 +910,7 @@ "dt": "Payment Entry", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_column_break_vv65n", + "fieldname": "column_break_vv65n", "fieldtype": "Column Break", "hidden": 0, "hide_border": 0, @@ -875,7 +931,7 @@ "mandatory_depends_on": null, "modified": "2024-08-27 01:49:05.618820", "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-custom_column_break_vv65n", + "name": "Payment Entry-column_break_vv65n", "no_copy": 0, "non_negative": 0, "options": null, @@ -922,7 +978,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_column_break_vv65n", + "insert_after": "column_break_vv65n", "is_system_generated": 0, "is_virtual": 0, "label": "Stamped XML", @@ -931,7 +987,7 @@ "mandatory_depends_on": null, "modified": "2024-08-27 01:15:40.009641", "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-custom_stamped_xml", + "name": "Payment Entry-mx_stamped_xml", "no_copy": 1, "non_negative": 0, "options": null, @@ -953,9 +1009,9 @@ }, { "allow_in_quick_entry": 0, - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, - "collapsible": 0, + "collapsible": 1, "collapsible_depends_on": null, "columns": 0, "default": null, @@ -963,32 +1019,32 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Payment Entry", + "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "cancellation_acknowledgement", - "fieldtype": "HTML Editor", + "fieldname": "cfdi", + "fieldtype": "Section Break", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, "ignore_user_permissions": 0, - "ignore_xss_filter": 1, + "ignore_xss_filter": 0, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "mx_stamped_xml", + "insert_after": "project", "is_system_generated": 0, "is_virtual": 0, - "label": "Cancellation acknowledgement", + "label": "CFDI", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-08-27 01:23:45.661672", + "modified": "2024-08-11 21:15:30.639653", "module": "ERPNext Mexico Compliance", - "name": "Payment Entry-cancellation_acknowledgement", - "no_copy": 1, + "name": "Sales Invoice Item-cfdi_section", + "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, @@ -996,7 +1052,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -1009,9 +1065,9 @@ }, { "allow_in_quick_entry": 0, - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, - "collapsible": 1, + "collapsible": 0, "collapsible_depends_on": null, "columns": 0, "default": null, @@ -1019,32 +1075,32 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice Item", + "dt": "Payment Entry", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "cfdi", - "fieldtype": "Section Break", + "fieldname": "cancellation_acknowledgement", + "fieldtype": "HTML Editor", "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, "ignore_user_permissions": 0, - "ignore_xss_filter": 0, + "ignore_xss_filter": 1, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "project", + "insert_after": "mx_stamped_xml", "is_system_generated": 0, "is_virtual": 0, - "label": "CFDI", + "label": "Cancellation acknowledgement", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-08-11 21:15:30.639653", + "modified": "2024-08-27 01:23:45.661672", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice Item-cfdi_section", - "no_copy": 0, + "name": "Payment Entry-cancellation_acknowledgement", + "no_copy": 1, "non_negative": 0, "options": null, "permlevel": 0, @@ -1052,7 +1108,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -1582,7 +1638,7 @@ "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_cancellation", + "fieldname": "cancellation_section", "fieldtype": "Section Break", "hidden": 0, "hide_border": 0, @@ -1650,7 +1706,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_cancellation", + "insert_after": "cancellation_section", "is_system_generated": 0, "is_virtual": 0, "label": "Cancellation reason", @@ -1659,7 +1715,7 @@ "mandatory_depends_on": "eval:doc.docstatus == 1", "modified": "2024-08-17 18:57:42.717062", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_cancellation_reason", + "name": "Sales Invoice-cancellation_reason", "no_copy": 1, "non_negative": 0, "options": "Cancellation Reason", @@ -1715,7 +1771,7 @@ "mandatory_depends_on": null, "modified": "2024-08-21 23:50:43.024068", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_requires_relationship", + "name": "Sales Invoice-requires_relationship", "no_copy": 0, "non_negative": 0, "options": null, @@ -1806,7 +1862,7 @@ "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_section_break_9ww80", + "fieldname": "section_break_9ww80", "fieldtype": "Section Break", "hidden": 0, "hide_border": 0, @@ -1827,7 +1883,7 @@ "mandatory_depends_on": null, "modified": "2024-08-28 23:24:24.344099", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_section_break_9ww80", + "name": "Sales Invoice-section_break_9ww80", "no_copy": 0, "non_negative": 0, "options": null, @@ -1874,7 +1930,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_section_break_9ww80", + "insert_after": "section_break_9ww80", "is_system_generated": 0, "is_virtual": 0, "label": "Stamped XML", @@ -1939,7 +1995,7 @@ "mandatory_depends_on": null, "modified": "2024-08-22 01:17:52.961407", "module": "ERPNext Mexico Compliance", - "name": "Sales Invoice-custom_cancellation_acknowledgement", + "name": "Sales Invoice-cancellation_acknowledgement", "no_copy": 1, "non_negative": 0, "options": null, From ea0f4c9ec3ae4781e22683cab1434aed6dd80c12 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 30 Aug 2024 12:17:37 -0600 Subject: [PATCH 60/62] feat(payment entry): add cancel cfdi flow --- .../fixtures/custom_field.json | 12 +-- .../overrides/payment_entry.py | 98 +++++++++++++++++++ .../overrides/sales_invoice.py | 14 +-- .../public/js/payment_entry.js | 55 ++++++++++- .../public/js/sales_invoice.js | 10 +- 5 files changed, 168 insertions(+), 21 deletions(-) diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index c0dfd90..3429d0d 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1712,7 +1712,7 @@ "label": "Cancellation reason", "length": 0, "link_filters": null, - "mandatory_depends_on": "eval:doc.docstatus == 1", + "mandatory_depends_on": "", "modified": "2024-08-17 18:57:42.717062", "module": "ERPNext Mexico Compliance", "name": "Sales Invoice-cancellation_reason", @@ -1905,7 +1905,7 @@ }, { "allow_in_quick_entry": 0, - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "collapsible_depends_on": null, @@ -1925,7 +1925,7 @@ "hide_days": 0, "hide_seconds": 0, "ignore_user_permissions": 0, - "ignore_xss_filter": 0, + "ignore_xss_filter": 1, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, @@ -1961,7 +1961,7 @@ }, { "allow_in_quick_entry": 0, - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "collapsible_depends_on": null, @@ -1981,7 +1981,7 @@ "hide_days": 0, "hide_seconds": 0, "ignore_user_permissions": 0, - "ignore_xss_filter": 0, + "ignore_xss_filter": 1, "in_global_search": 0, "in_list_view": 0, "in_preview": 0, @@ -2015,4 +2015,4 @@ "unique": 0, "width": null } -] +] \ No newline at end of file diff --git a/erpnext_mexico_compliance/overrides/payment_entry.py b/erpnext_mexico_compliance/overrides/payment_entry.py index 5dc99c5..f3b92be 100644 --- a/erpnext_mexico_compliance/overrides/payment_entry.py +++ b/erpnext_mexico_compliance/overrides/payment_entry.py @@ -36,6 +36,9 @@ class PaymentEntry(CommonController, payment_entry.PaymentEntry): mx_payment_mode: DF.Data mx_stamped_xml: DF.HTMLEditor + cancellation_reason: DF.Link + substitute_payment_entry: DF.Link + cancellation_acknowledgement: DF.HTMLEditor @property def company_address(self) -> str: @@ -171,6 +174,10 @@ def stamp_cfdi(self, certificate: str): self.mx_stamped_xml = data self.save() + + self.attach_pdf() + self.attach_xml() + return message @frappe.whitelist() @@ -215,6 +222,97 @@ def attach_xml(self) -> Document: xml = self.mx_stamped_xml return attach_file(file_name, xml, self.doctype, self.name, is_private=1) + @property + def requires_relationship(self) -> int: + """Indicates whether a relationship with another payment entry is required for the + cancellation reason. + + Returns: + int: 1 if a relationship is required, 0 otherwise. + """ + if not self.cancellation_reason: + return 0 + reason = frappe.get_doc("Cancellation Reason", self.cancellation_reason) + return reason.requires_relationship + + @property + def cfdi_uuid(self) -> str | None: + """CFDI UUID from the stamped XML. + + Returns: + str | None: The CFDI UUID if the stamped XML is available, otherwise None. + """ + if not self.mx_stamped_xml: + return None + cfdi = cfdi40.CFDI.from_string(self.mx_stamped_xml.encode("utf-8")) + return cfdi.get("Complemento", {}).get("TimbreFiscalDigital", {}).get("UUID") + + def validate_cancel_reason(self): + """Validates whether a cancellation reason is provided before cancelling a payment entry. + + This function checks if a cancellation reason is set for the current payment entry. + If no cancellation reason is found, it throws an error with a corresponding message. + """ + if not self.cancellation_reason: + msg = _("A Cancellation Reason is required.") + title = _("Invalid Cancellation Reason") + frappe.throw(msg, title=title) + + def validate_substitute_payment_entry(self): + """Validates whether a substitute payment entry is required before cancelling a payment + entry. + + This function checks if a substitute payment entry is set for the current payment entry, + and if the cancellation reason requires a substitute payment entry. + If no substitute payment entry is found when required, it throws an error with a + corresponding message. + """ + reason = frappe.get_doc("Cancellation Reason", self.cancellation_reason) + if reason.requires_relationship and not self.substitute_payment_entry: + msg = _("The reason of cancellation {} requires a substitute invoice") + msg = msg.format(self.cancellation_reason) + frappe.throw(msg) + + @frappe.whitelist() + def cancel_cfdi(self, certificate: str): + """Cancels the CFDI document of this payment entry. + + Args: + certificate (str): The name of the Digital Signing Certificate to use for cancellation. + + Raises: + WSClientException: If an error occurs during the cancellation process. + + Returns: + str: A message indicating the result of the cancellation operation. + """ + self.validate_cancel_reason() + self.validate_substitute_payment_entry() + + cfdi = cfdi40.CFDI.from_string(self.mx_stamped_xml.encode("utf-8")) + ws = get_ws_client() + + substitute = ( + frappe.get_doc("Payment Entry", self.substitute_payment_entry) + if self.substitute_payment_entry + else None + ) + + try: + ack, message = ws.cancel( + certificate, + cfdi, + self.cancellation_reason, + substitute.cfdi_uuid if substitute else None, + ) + except WSClientException as e: + frappe.throw(str(e), title=_("CFDI Web Service Error")) + + self.cancellation_acknowledgement = ack + self.save() + + return message + def get_installment_number( doctype: str, docname: str, payment_entry_name: str diff --git a/erpnext_mexico_compliance/overrides/sales_invoice.py b/erpnext_mexico_compliance/overrides/sales_invoice.py index 5055e2e..3ed2f57 100644 --- a/erpnext_mexico_compliance/overrides/sales_invoice.py +++ b/erpnext_mexico_compliance/overrides/sales_invoice.py @@ -279,7 +279,7 @@ def stamp_cfdi(self, certificate: str): frappe.throw(str(e), title=_("CFDI Web Service Error")) self.mx_stamped_xml = data - self.db_update() + self.save() self.attach_pdf() self.attach_xml() @@ -307,7 +307,7 @@ def requires_relationship(self) -> int: @property def cfdi_uuid(self) -> str | None: - """Retrieves the CFDI UUID from the stamped XML. + """CFDI UUID from the stamped XML. Returns: str | None: The CFDI UUID if the stamped XML is available, otherwise None. @@ -324,7 +324,7 @@ def validate_cancel_reason(self): If no cancellation reason is found, it throws an error with a corresponding message. """ if not self.cancellation_reason: - msg = _("A Cancellation Reason is required to cancel this sales invoice.") + msg = _("A Cancellation Reason is required.") title = _("Invalid Cancellation Reason") frappe.throw(msg, title=title) @@ -342,8 +342,8 @@ def validate_substitute_invoice(self): frappe.throw(msg) @frappe.whitelist() - def cancel_cfdi(self, certificate): - """Cancels a CFDI document. + def cancel_cfdi(self, certificate: str): + """Cancels the CFDI document. Args: certificate (str): The name of the Digital Signing Certificate to use for cancellation. @@ -369,13 +369,13 @@ def cancel_cfdi(self, certificate): certificate, cfdi, self.cancellation_reason, - self.substitute_invoice.cfdi_uuid if substitute_invoice else None, + substitute_invoice.cfdi_uuid if substitute_invoice else None, ) except WSClientException as e: frappe.throw(str(e), title=_("CFDI Web Service Error")) self.cancellation_acknowledgement = acknowledgement - self.db_update() + self.save() return message diff --git a/erpnext_mexico_compliance/public/js/payment_entry.js b/erpnext_mexico_compliance/public/js/payment_entry.js index cb8d8af..0bed685 100644 --- a/erpnext_mexico_compliance/public/js/payment_entry.js +++ b/erpnext_mexico_compliance/public/js/payment_entry.js @@ -33,8 +33,8 @@ async function attachFile(frm, ext) { }); frm.reload_doc(); } catch (error) { - const { responseJSON } = error; - frappe.throw(responseJSON ? responseJSON.exception : error); + const { message } = error; + frappe.throw(message ? message : error); } } @@ -68,6 +68,53 @@ async function addAttachXmlButton(frm) { } } +function cancel(frm) { + const { + mx_stamped_xml, + cancellation_reason, + requires_relationship, + substitute_payment_entry, + } = frm.doc; + + if (mx_stamped_xml) { + if (!cancellation_reason) { + const msg = __( + "A Cancellation Reason is required to cancel this sales invoice." + ); + frappe.throw(msg); + } + } + + if (requires_relationship && !substitute_payment_entry) { + const msg = __( + "The Cancellation Reason requires a substitute payment entry." + ); + frappe.throw(msg); + } + + frappe.prompt( + [ + { + label: __("Digital Signing Certificate"), + fieldname: "certificate", + fieldtype: "Link", + options: "Digital Signing Certificate", + filters: { company: frm.doc.company }, + }, + ], + async ({ certificate }) => { + const { message: cfdi_msg } = await frm.call("cancel_cfdi", { + certificate, + }); + frappe.show_alert({ message: cfdi_msg, indicator: "green" }); + const { message: cancelled } = await frm.call("cancel"); + frappe.show_alert({ message: cancelled, indicator: "green" }); + frm.reload_doc(); + }, + __("Select a Certificate to sign the CFDI") + ); +} + function refresh(frm) { const { docstatus, mx_stamped_xml } = frm.doc; @@ -78,7 +125,9 @@ function refresh(frm) { switch (docstatus) { case 1: - if (!mx_stamped_xml) { + if (mx_stamped_xml) { + frm.page.set_secondary_action(__("Cancel"), () => cancel(frm)); + } else { frm.add_custom_button(__("Stamp CFDI"), () => stampCfdi(frm)); } break; diff --git a/erpnext_mexico_compliance/public/js/sales_invoice.js b/erpnext_mexico_compliance/public/js/sales_invoice.js index c6dc9d9..2b1989b 100644 --- a/erpnext_mexico_compliance/public/js/sales_invoice.js +++ b/erpnext_mexico_compliance/public/js/sales_invoice.js @@ -33,8 +33,8 @@ async function attachFile(frm, ext) { }); frm.reload_doc(); } catch (error) { - const { responseJSON } = error; - frappe.throw(responseJSON ? responseJSON.exception : error); + const { message } = error; + frappe.throw(message ? message : error); } } @@ -73,7 +73,7 @@ function cancel(frm) { mx_stamped_xml, cancellation_reason, requires_relationship, - cancellation_related_invoices, + substitute_invoice, } = frm.doc; if (mx_stamped_xml) { @@ -84,8 +84,8 @@ function cancel(frm) { frappe.throw(msg); } - if (requires_relationship && cancellation_related_invoices === 0) { - const msg = __("The Cancellation Reason requires a related invoice."); + if (requires_relationship && !substitute_invoice) { + const msg = __("The Cancellation Reason requires a substitute invoice."); frappe.throw(msg); } From 2a01291d5a8c8d208302e9b213878218d3123e82 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 30 Aug 2024 15:45:02 -0600 Subject: [PATCH 61/62] chore(deps): bump python 3.11 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 495e6de..3cbf183 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "erpnext_mexico_compliance" authors = [{ name = "TI Sin Problemas", email = "info@tisinproblemas.com" }] description = "ERPNext app to serve as base to comply with help with Mexican Rules and Regulations" -requires-python = ">=3.10" +requires-python = ">=3.11" readme = "README.md" dynamic = ["version"] dependencies = ["zeep==4.2.1", "satcfdi==4.5.6"] From 43339c4bedea63e25a4a9eddb4184cdda6ef12f6 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Fri, 30 Aug 2024 16:48:34 -0600 Subject: [PATCH 62/62] feat(translations): add & improve translations --- .../cfdi_stamping_settings.json | 4 +- .../digital_signing_certificate.py | 2 +- .../sat_payment_method.json | 12 +- .../sat_payment_option.json | 4 +- .../fixtures/custom_field.json | 4 +- erpnext_mexico_compliance/locale/es.po | 508 ++++++++++++++++++ erpnext_mexico_compliance/locale/es_MX.po | 508 ++++++++++++++++++ erpnext_mexico_compliance/locale/main.pot | 508 ++++++++++++++++++ .../public/js/payment_entry.js | 2 +- .../translations/es-MX.csv | 94 +++- erpnext_mexico_compliance/translations/es.csv | 94 +++- 11 files changed, 1691 insertions(+), 49 deletions(-) create mode 100644 erpnext_mexico_compliance/locale/es.po create mode 100644 erpnext_mexico_compliance/locale/es_MX.po create mode 100644 erpnext_mexico_compliance/locale/main.pot diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json index c835d7f..fb50153 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json @@ -34,7 +34,7 @@ }, { "depends_on": "api_key", - "description": "Every time a CFDI gets stamped, 1 credit is consumed", + "description": "1 credit is consumed every time a CFDI gets stamped", "fieldname": "available_credits", "fieldtype": "Int", "is_virtual": 1, @@ -64,4 +64,4 @@ "sort_field": "modified", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py index b75d9e7..f2d7f1b 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py @@ -79,7 +79,7 @@ def validate_certificate(self): if self.signer: title = _("Certificate files and password are valid") msg = [ - _("Branch: {0}").format(self.branch_name), + _("Branch: {0}", context="Company branch").format(self.branch_name), _("Legal name: {0}").format(self.legal_name), _("RFC: {0}").format(self.rfc), ] diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json index 1ee6cdd..1bfe184 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json @@ -3,17 +3,11 @@ "autoname": "field:key", "creation": "2022-12-19 10:40:09.916493", "default_view": "List", - "description": "Indicates the form in which a payment was made, in accordance with the catalog of forms of payment", + "description": "Indicates the form in which a payment was made, in accordance with the SAT catalog of forms of payment", "doctype": "DocType", "editable_grid": 1, "engine": "InnoDB", - "field_order": [ - "section_break", - "enabled", - "key", - "key_name", - "description" - ], + "field_order": ["section_break", "enabled", "key", "key_name", "description"], "fields": [ { "default": "1", @@ -88,4 +82,4 @@ "sort_order": "ASC", "states": [], "title_field": "key_name" -} \ No newline at end of file +} diff --git a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json index 4cf7c17..edea8a2 100644 --- a/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +++ b/erpnext_mexico_compliance/erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json @@ -3,7 +3,7 @@ "autoname": "field:key", "creation": "2024-06-27 01:29:40.855867", "default_view": "List", - "description": "Indicates when the payment of the operation was made, in accordance with the SAT catalog of payment methods", + "description": "Indicates the method used to make a payment, in accordance with the SAT catalog of payment methods", "doctype": "DocType", "engine": "InnoDB", "field_order": [ @@ -87,4 +87,4 @@ "sort_order": "ASC", "states": [], "title_field": "key_name" -} \ No newline at end of file +} diff --git a/erpnext_mexico_compliance/fixtures/custom_field.json b/erpnext_mexico_compliance/fixtures/custom_field.json index 3429d0d..b4dca7e 100644 --- a/erpnext_mexico_compliance/fixtures/custom_field.json +++ b/erpnext_mexico_compliance/fixtures/custom_field.json @@ -1765,7 +1765,7 @@ "insert_after": "cancellation_reason", "is_system_generated": 0, "is_virtual": 1, - "label": "Requires Relationship", + "label": "Requires relationship", "length": 0, "link_filters": null, "mandatory_depends_on": null, @@ -2015,4 +2015,4 @@ "unique": 0, "width": null } -] \ No newline at end of file +] diff --git a/erpnext_mexico_compliance/locale/es.po b/erpnext_mexico_compliance/locale/es.po new file mode 100644 index 0000000..8d07be1 --- /dev/null +++ b/erpnext_mexico_compliance/locale/es.po @@ -0,0 +1,508 @@ +# Translations template for ERPNext Mexico Compliance. +# Copyright (C) 2024 TI Sin Problemas +# This file is distributed under the same license as the ERPNext Mexico Compliance project. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: ERPNext Mexico Compliance VERSION\n" +"Report-Msgid-Bugs-To: info@tisinproblemas.com\n" +"POT-Creation-Date: 2024-08-30 22:42+0000\n" +"PO-Revision-Date: 2024-08-30 22:42+0000\n" +"Last-Translator: info@tisinproblemas.com\n" +"Language-Team: info@tisinproblemas.com\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.13.1\n" + +#. Description of the 'Available credits' (Int) field in DocType 'CFDI Stamping +#. Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "1 credit is consumed every time a CFDI gets stamped" +msgstr "1 crédito es consumido cada vez que se timbra un CFDI" + +#. Header text in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Mexico Compliance" +msgstr "" + +#: public/js/payment_entry.js:81 +msgid "A Cancellation Reason is required to cancel this payment entry." +msgstr "Un Motivo de Cancelación es necesario para cancelar este pago." + +#: public/js/sales_invoice.js:81 +msgid "A Cancellation Reason is required to cancel this sales invoice." +msgstr "Un Motivo de Cancelación es necesario para cancelar esta factura de venta." + +#: overrides/payment_entry.py:257 overrides/sales_invoice.py:327 +msgid "A Cancellation Reason is required." +msgstr "Un Motivo de Cancelación es necesario." + +#. Label of a Password field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "API Key" +msgstr "" + +#. Label of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Accounting" +msgstr "" + +#. Name of a role +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Accounts Manager" +msgstr "" + +#: overrides/payment_entry.py:91 overrides/payment_entry.py:133 +#: overrides/sales_invoice.py:117 +msgid "Address {0} has no zip code" +msgstr "La dirección {0} no tiene código postal" + +#: public/js/payment_entry.js:50 public/js/sales_invoice.js:50 +msgid "Attach PDF" +msgstr "Adjuntar PDF" + +#: public/js/payment_entry.js:64 public/js/sales_invoice.js:64 +msgid "Attach XML" +msgstr "Adjuntar XML" + +#. Label of a Int field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Available credits" +msgstr "Créditos disponibles" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:82 +msgctxt "Company branch" +msgid "Branch: {0}" +msgstr "Sucursal: {0}" + +#: public/js/payment_entry.js:41 public/js/sales_invoice.js:41 +msgid "CFDI Actions" +msgstr "Acciones de CFDI" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "CFDI Stamping Settings" +msgstr "Configuración de Timbrado de CFDI" + +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py:44 +#: overrides/payment_entry.py:173 overrides/payment_entry.py:309 +#: overrides/sales_invoice.py:279 overrides/sales_invoice.py:375 +msgid "CFDI Web Service Error" +msgstr "Error del Web Service de CFDI" + +#: public/js/payment_entry.js:129 public/js/sales_invoice.js:127 +msgid "Cancel" +msgstr "" + +#. Name of a DocType +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Cancellation Reason" +msgstr "Motivo de Cancelación" + +#. Label of a Attach field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate" +msgstr "" + +#. Description of the 'Certificate' (Attach) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate file (.cer)" +msgstr "Archivo de certificado (.cer)" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:41 +msgid "Certificate file not configured" +msgstr "Archivo de certificado no configurado" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:114 +msgid "Certificate files and password are not valid" +msgstr "Los archivos de certificado y contraseña no son válidos" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:80 +msgid "Certificate files and password are valid" +msgstr "Los archivos de certificado y contraseña son válidos" + +#. Description of the 'Key' (Attach) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate key file (.key)" +msgstr "Archivo de clave de certificado (.key)" + +#. Description of the 'Requires relationship' (Check) field in DocType +#. 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Check this field if the cancelled invoice needs to have another related invoice" +msgstr "Marca este campo si la factura cancelada necesita tener otra factura relacionada" + +#. Label of a Data field in DocType 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Code" +msgstr "" + +#. Label of a Link field in DocType 'Digital Signing Certificate' +#. Label of a Section Break field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company" +msgstr "" + +#. Description of the 'Company' (Link) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company for which this certificate will be used to sign CFDI" +msgstr "Compañía para la cual este certificado será usado para firmar CFDI" + +#: overrides/payment_entry.py:137 overrides/sales_invoice.py:121 +msgid "Company {0} has no address" +msgstr "La compañía {0} no tiene dirección" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:163 +msgid "Company {0} has no tax regime" +msgstr "La compañía {0} no tiene régimen fiscal" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company's Digital Signing Certificate to sign CFDI " +msgstr "" + +#. Label of a Section Break field in DocType 'SAT CFDI Use' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +msgid "Customer" +msgstr "" + +#: overrides/sales_invoice.py:147 +msgid "Customer address {0} has no zip code" +msgstr "La dirección del cliente {0} no tiene código postal" + +#: overrides/sales_invoice.py:138 +msgid "Customer {0} has no tax ID" +msgstr "El cliente {0} no tiene RFC" + +#: overrides/sales_invoice.py:141 +msgid "Customer {0} has no tax regime" +msgstr "El cliente {0} no tiene régimen fiscal" + +#. Label of a Data field in DocType 'Cancellation Reason' +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Small Text field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Description" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +#: public/js/payment_entry.js:8 public/js/payment_entry.js:98 +#: public/js/sales_invoice.js:8 public/js/sales_invoice.js:95 +msgid "Digital Signing Certificate" +msgstr "Certificado de Sello Digital" + +#: config/desktop.py:8 +msgid "ERPNext Mexico Compliance" +msgstr "ERPNext Cumplimiento para México" + +#. Label of a Check field in DocType 'SAT CFDI Use' +#. Label of a Check field in DocType 'SAT Payment Method' +#. Label of a Check field in DocType 'SAT Payment Option' +#. Label of a Check field in DocType 'SAT Product or Service Key' +#. Label of a Check field in DocType 'SAT Tax Regime' +#. Label of a Check field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Enabled" +msgstr "" + +#: public/js/payment_entry.js:31 public/js/sales_invoice.js:31 +msgid "File {0} attached" +msgstr "" + +#. Label of a Section Break field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Files" +msgstr "" + +#: overrides/sales_invoice.py:68 overrides/sales_invoice_item.py:71 +msgid "From {}" +msgstr "De {}" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +msgid "Indicates the form in which a payment was made, in accordance with the SAT catalog of forms of payment" +msgstr "Indica la forma en la que se realiza un pago, de acuerdo al catálogo de formas de pago del SAT" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +msgid "Indicates the method used to make a payment, in accordance with the SAT catalog of payment methods" +msgstr "Indica el método usado para realizar un pago, de acuerdo al catálogo de métodos de pago del SAT" + +#: overrides/payment_entry.py:168 overrides/sales_invoice.py:274 +msgid "Invalid CFDI" +msgstr "CFDI Inválido" + +#: overrides/payment_entry.py:258 overrides/sales_invoice.py:328 +msgid "Invalid Cancellation Reason" +msgstr "Motivo de Cancelación inválido" + +#: overrides/payment_entry.py:334 +msgid "Invalid Document Type" +msgstr "Tipo de Documento inválido" + +#: overrides/customer.py:27 +msgid "Invalid Tax Id" +msgstr "RFC Inválido" + +#: overrides/sales_invoice.py:149 +msgid "Invoice has no billing address" +msgstr "La factura no tiene dirección de facturación" + +#. Label of a Check field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Is Group" +msgstr "" + +#. Label of a Attach field in DocType 'Digital Signing Certificate' +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Key" +msgstr "Clave" + +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Key Name" +msgstr "Clave Nombre" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:51 +msgid "Key file not configured" +msgstr "Archivo de llave no configurado" + +#. Label of a Int field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Left" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:83 +msgid "Legal name: {0}" +msgstr "Razón social: {0}" + +#. Name of a Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Mexico Compliance" +msgstr "Cumplimiento para México" + +#. Description of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Module settings" +msgstr "" + +#. Label of a Link field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Old Parent" +msgstr "" + +#. Label of a Link field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Parent SAT Product or Service Key" +msgstr "Clave de Producto o Servicio del SAT padre" + +#. Label of a Password field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Password" +msgstr "" + +#. Description of the 'Password' (Password) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Password for the certificate key" +msgstr "Contraseña para la llave del certificado" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:84 +msgid "RFC: {0}" +msgstr "RFC: {0}" + +#: overrides/payment_entry.py:153 +msgid "Reference {0} has not being stamped" +msgstr "La referencia {0} no ha sido timbrada" + +#. Label of a Check field in DocType 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Requires relationship" +msgstr "Requiere relación" + +#. Label of a Int field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Right" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT CFDI Use" +msgstr "Uso de CFDI SAT" + +#. Name of a DocType +#: erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json +msgid "SAT CFDI Use Tax Regime" +msgstr "Régimen Fiscal del Uso de CFDI SAT" + +#. Description of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Catalogs for accounting" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Payment Method" +msgstr "Forma de Pago SAT" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Payment Option" +msgstr "Método de Pago SAT" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Product or Service Key" +msgstr "Clave SAT de Producto o Servicio" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Tax Regime" +msgstr "Régimen Fiscal SAT" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT UOM Key" +msgstr "Clave SAT de UDM" + +#: public/js/payment_entry.js:20 public/js/payment_entry.js:114 +#: public/js/sales_invoice.js:20 public/js/sales_invoice.js:111 +msgid "Select a Certificate to sign the CFDI" +msgstr "Selecciona un Certificado para firmar el CFDI" + +#. Label of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Settings" +msgstr "" + +#: public/js/payment_entry.js:131 public/js/sales_invoice.js:129 +msgid "Stamp CFDI" +msgstr "Timbrar CFDI" + +#. Name of a role +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "System Manager" +msgstr "" + +#: overrides/customer.py:26 +msgid "Tax Id does not comply with SAT specifications" +msgstr "El RFC cumple con las especificaciones del SAT" + +#. Label of a Link field in DocType 'SAT CFDI Use Tax Regime' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json +msgid "Tax Regime" +msgstr "Régimen Fiscal" + +#. Label of a Table field in DocType 'SAT CFDI Use' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +msgid "Tax regimes" +msgstr "Regímenes fiscales" + +#. Label of a Check field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Test mode" +msgstr "Modo de pruebas" + +#: public/js/sales_invoice.js:88 +msgid "The Cancellation Reason requires a substitute invoice." +msgstr "El motivo de cancelación requiere una factura sustituta" + +#: public/js/payment_entry.js:89 +msgid "The Cancellation Reason requires a substitute payment entry." +msgstr "El motivo de cancelación requiere una entrada de pago sustituta" + +#: overrides/payment_entry.py:272 overrides/sales_invoice.py:340 +msgid "The reason of cancellation {} requires a substitute invoice" +msgstr "El motivo de cancelación {} requiere una factura sustituta" + +#: overrides/sales_invoice.py:69 overrides/sales_invoice_item.py:75 +msgid "To {}" +msgstr "A {}" + +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "UOM Name" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.js:7 +msgid "Validate Certificate" +msgstr "Validar Certificado" + +#. Label of a Section Break field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Web Service" +msgstr "Web Service" + diff --git a/erpnext_mexico_compliance/locale/es_MX.po b/erpnext_mexico_compliance/locale/es_MX.po new file mode 100644 index 0000000..8d07be1 --- /dev/null +++ b/erpnext_mexico_compliance/locale/es_MX.po @@ -0,0 +1,508 @@ +# Translations template for ERPNext Mexico Compliance. +# Copyright (C) 2024 TI Sin Problemas +# This file is distributed under the same license as the ERPNext Mexico Compliance project. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: ERPNext Mexico Compliance VERSION\n" +"Report-Msgid-Bugs-To: info@tisinproblemas.com\n" +"POT-Creation-Date: 2024-08-30 22:42+0000\n" +"PO-Revision-Date: 2024-08-30 22:42+0000\n" +"Last-Translator: info@tisinproblemas.com\n" +"Language-Team: info@tisinproblemas.com\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.13.1\n" + +#. Description of the 'Available credits' (Int) field in DocType 'CFDI Stamping +#. Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "1 credit is consumed every time a CFDI gets stamped" +msgstr "1 crédito es consumido cada vez que se timbra un CFDI" + +#. Header text in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Mexico Compliance" +msgstr "" + +#: public/js/payment_entry.js:81 +msgid "A Cancellation Reason is required to cancel this payment entry." +msgstr "Un Motivo de Cancelación es necesario para cancelar este pago." + +#: public/js/sales_invoice.js:81 +msgid "A Cancellation Reason is required to cancel this sales invoice." +msgstr "Un Motivo de Cancelación es necesario para cancelar esta factura de venta." + +#: overrides/payment_entry.py:257 overrides/sales_invoice.py:327 +msgid "A Cancellation Reason is required." +msgstr "Un Motivo de Cancelación es necesario." + +#. Label of a Password field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "API Key" +msgstr "" + +#. Label of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Accounting" +msgstr "" + +#. Name of a role +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Accounts Manager" +msgstr "" + +#: overrides/payment_entry.py:91 overrides/payment_entry.py:133 +#: overrides/sales_invoice.py:117 +msgid "Address {0} has no zip code" +msgstr "La dirección {0} no tiene código postal" + +#: public/js/payment_entry.js:50 public/js/sales_invoice.js:50 +msgid "Attach PDF" +msgstr "Adjuntar PDF" + +#: public/js/payment_entry.js:64 public/js/sales_invoice.js:64 +msgid "Attach XML" +msgstr "Adjuntar XML" + +#. Label of a Int field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Available credits" +msgstr "Créditos disponibles" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:82 +msgctxt "Company branch" +msgid "Branch: {0}" +msgstr "Sucursal: {0}" + +#: public/js/payment_entry.js:41 public/js/sales_invoice.js:41 +msgid "CFDI Actions" +msgstr "Acciones de CFDI" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "CFDI Stamping Settings" +msgstr "Configuración de Timbrado de CFDI" + +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py:44 +#: overrides/payment_entry.py:173 overrides/payment_entry.py:309 +#: overrides/sales_invoice.py:279 overrides/sales_invoice.py:375 +msgid "CFDI Web Service Error" +msgstr "Error del Web Service de CFDI" + +#: public/js/payment_entry.js:129 public/js/sales_invoice.js:127 +msgid "Cancel" +msgstr "" + +#. Name of a DocType +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Cancellation Reason" +msgstr "Motivo de Cancelación" + +#. Label of a Attach field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate" +msgstr "" + +#. Description of the 'Certificate' (Attach) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate file (.cer)" +msgstr "Archivo de certificado (.cer)" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:41 +msgid "Certificate file not configured" +msgstr "Archivo de certificado no configurado" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:114 +msgid "Certificate files and password are not valid" +msgstr "Los archivos de certificado y contraseña no son válidos" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:80 +msgid "Certificate files and password are valid" +msgstr "Los archivos de certificado y contraseña son válidos" + +#. Description of the 'Key' (Attach) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate key file (.key)" +msgstr "Archivo de clave de certificado (.key)" + +#. Description of the 'Requires relationship' (Check) field in DocType +#. 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Check this field if the cancelled invoice needs to have another related invoice" +msgstr "Marca este campo si la factura cancelada necesita tener otra factura relacionada" + +#. Label of a Data field in DocType 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Code" +msgstr "" + +#. Label of a Link field in DocType 'Digital Signing Certificate' +#. Label of a Section Break field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company" +msgstr "" + +#. Description of the 'Company' (Link) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company for which this certificate will be used to sign CFDI" +msgstr "Compañía para la cual este certificado será usado para firmar CFDI" + +#: overrides/payment_entry.py:137 overrides/sales_invoice.py:121 +msgid "Company {0} has no address" +msgstr "La compañía {0} no tiene dirección" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:163 +msgid "Company {0} has no tax regime" +msgstr "La compañía {0} no tiene régimen fiscal" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company's Digital Signing Certificate to sign CFDI " +msgstr "" + +#. Label of a Section Break field in DocType 'SAT CFDI Use' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +msgid "Customer" +msgstr "" + +#: overrides/sales_invoice.py:147 +msgid "Customer address {0} has no zip code" +msgstr "La dirección del cliente {0} no tiene código postal" + +#: overrides/sales_invoice.py:138 +msgid "Customer {0} has no tax ID" +msgstr "El cliente {0} no tiene RFC" + +#: overrides/sales_invoice.py:141 +msgid "Customer {0} has no tax regime" +msgstr "El cliente {0} no tiene régimen fiscal" + +#. Label of a Data field in DocType 'Cancellation Reason' +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Small Text field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Description" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +#: public/js/payment_entry.js:8 public/js/payment_entry.js:98 +#: public/js/sales_invoice.js:8 public/js/sales_invoice.js:95 +msgid "Digital Signing Certificate" +msgstr "Certificado de Sello Digital" + +#: config/desktop.py:8 +msgid "ERPNext Mexico Compliance" +msgstr "ERPNext Cumplimiento para México" + +#. Label of a Check field in DocType 'SAT CFDI Use' +#. Label of a Check field in DocType 'SAT Payment Method' +#. Label of a Check field in DocType 'SAT Payment Option' +#. Label of a Check field in DocType 'SAT Product or Service Key' +#. Label of a Check field in DocType 'SAT Tax Regime' +#. Label of a Check field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Enabled" +msgstr "" + +#: public/js/payment_entry.js:31 public/js/sales_invoice.js:31 +msgid "File {0} attached" +msgstr "" + +#. Label of a Section Break field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Files" +msgstr "" + +#: overrides/sales_invoice.py:68 overrides/sales_invoice_item.py:71 +msgid "From {}" +msgstr "De {}" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +msgid "Indicates the form in which a payment was made, in accordance with the SAT catalog of forms of payment" +msgstr "Indica la forma en la que se realiza un pago, de acuerdo al catálogo de formas de pago del SAT" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +msgid "Indicates the method used to make a payment, in accordance with the SAT catalog of payment methods" +msgstr "Indica el método usado para realizar un pago, de acuerdo al catálogo de métodos de pago del SAT" + +#: overrides/payment_entry.py:168 overrides/sales_invoice.py:274 +msgid "Invalid CFDI" +msgstr "CFDI Inválido" + +#: overrides/payment_entry.py:258 overrides/sales_invoice.py:328 +msgid "Invalid Cancellation Reason" +msgstr "Motivo de Cancelación inválido" + +#: overrides/payment_entry.py:334 +msgid "Invalid Document Type" +msgstr "Tipo de Documento inválido" + +#: overrides/customer.py:27 +msgid "Invalid Tax Id" +msgstr "RFC Inválido" + +#: overrides/sales_invoice.py:149 +msgid "Invoice has no billing address" +msgstr "La factura no tiene dirección de facturación" + +#. Label of a Check field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Is Group" +msgstr "" + +#. Label of a Attach field in DocType 'Digital Signing Certificate' +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Key" +msgstr "Clave" + +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Key Name" +msgstr "Clave Nombre" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:51 +msgid "Key file not configured" +msgstr "Archivo de llave no configurado" + +#. Label of a Int field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Left" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:83 +msgid "Legal name: {0}" +msgstr "Razón social: {0}" + +#. Name of a Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Mexico Compliance" +msgstr "Cumplimiento para México" + +#. Description of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Module settings" +msgstr "" + +#. Label of a Link field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Old Parent" +msgstr "" + +#. Label of a Link field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Parent SAT Product or Service Key" +msgstr "Clave de Producto o Servicio del SAT padre" + +#. Label of a Password field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Password" +msgstr "" + +#. Description of the 'Password' (Password) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Password for the certificate key" +msgstr "Contraseña para la llave del certificado" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:84 +msgid "RFC: {0}" +msgstr "RFC: {0}" + +#: overrides/payment_entry.py:153 +msgid "Reference {0} has not being stamped" +msgstr "La referencia {0} no ha sido timbrada" + +#. Label of a Check field in DocType 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Requires relationship" +msgstr "Requiere relación" + +#. Label of a Int field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Right" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT CFDI Use" +msgstr "Uso de CFDI SAT" + +#. Name of a DocType +#: erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json +msgid "SAT CFDI Use Tax Regime" +msgstr "Régimen Fiscal del Uso de CFDI SAT" + +#. Description of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Catalogs for accounting" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Payment Method" +msgstr "Forma de Pago SAT" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Payment Option" +msgstr "Método de Pago SAT" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Product or Service Key" +msgstr "Clave SAT de Producto o Servicio" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Tax Regime" +msgstr "Régimen Fiscal SAT" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT UOM Key" +msgstr "Clave SAT de UDM" + +#: public/js/payment_entry.js:20 public/js/payment_entry.js:114 +#: public/js/sales_invoice.js:20 public/js/sales_invoice.js:111 +msgid "Select a Certificate to sign the CFDI" +msgstr "Selecciona un Certificado para firmar el CFDI" + +#. Label of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Settings" +msgstr "" + +#: public/js/payment_entry.js:131 public/js/sales_invoice.js:129 +msgid "Stamp CFDI" +msgstr "Timbrar CFDI" + +#. Name of a role +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "System Manager" +msgstr "" + +#: overrides/customer.py:26 +msgid "Tax Id does not comply with SAT specifications" +msgstr "El RFC cumple con las especificaciones del SAT" + +#. Label of a Link field in DocType 'SAT CFDI Use Tax Regime' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json +msgid "Tax Regime" +msgstr "Régimen Fiscal" + +#. Label of a Table field in DocType 'SAT CFDI Use' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +msgid "Tax regimes" +msgstr "Regímenes fiscales" + +#. Label of a Check field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Test mode" +msgstr "Modo de pruebas" + +#: public/js/sales_invoice.js:88 +msgid "The Cancellation Reason requires a substitute invoice." +msgstr "El motivo de cancelación requiere una factura sustituta" + +#: public/js/payment_entry.js:89 +msgid "The Cancellation Reason requires a substitute payment entry." +msgstr "El motivo de cancelación requiere una entrada de pago sustituta" + +#: overrides/payment_entry.py:272 overrides/sales_invoice.py:340 +msgid "The reason of cancellation {} requires a substitute invoice" +msgstr "El motivo de cancelación {} requiere una factura sustituta" + +#: overrides/sales_invoice.py:69 overrides/sales_invoice_item.py:75 +msgid "To {}" +msgstr "A {}" + +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "UOM Name" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.js:7 +msgid "Validate Certificate" +msgstr "Validar Certificado" + +#. Label of a Section Break field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Web Service" +msgstr "Web Service" + diff --git a/erpnext_mexico_compliance/locale/main.pot b/erpnext_mexico_compliance/locale/main.pot new file mode 100644 index 0000000..54b2611 --- /dev/null +++ b/erpnext_mexico_compliance/locale/main.pot @@ -0,0 +1,508 @@ +# Translations template for ERPNext Mexico Compliance. +# Copyright (C) 2024 TI Sin Problemas +# This file is distributed under the same license as the ERPNext Mexico Compliance project. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: ERPNext Mexico Compliance VERSION\n" +"Report-Msgid-Bugs-To: info@tisinproblemas.com\n" +"POT-Creation-Date: 2024-08-30 22:42+0000\n" +"PO-Revision-Date: 2024-08-30 22:42+0000\n" +"Last-Translator: info@tisinproblemas.com\n" +"Language-Team: info@tisinproblemas.com\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.13.1\n" + +#. Description of the 'Available credits' (Int) field in DocType 'CFDI Stamping +#. Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "1 credit is consumed every time a CFDI gets stamped" +msgstr "" + +#. Header text in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Mexico Compliance" +msgstr "" + +#: public/js/payment_entry.js:81 +msgid "A Cancellation Reason is required to cancel this payment entry." +msgstr "" + +#: public/js/sales_invoice.js:81 +msgid "A Cancellation Reason is required to cancel this sales invoice." +msgstr "" + +#: overrides/payment_entry.py:257 overrides/sales_invoice.py:327 +msgid "A Cancellation Reason is required." +msgstr "" + +#. Label of a Password field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "API Key" +msgstr "" + +#. Label of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Accounting" +msgstr "" + +#. Name of a role +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Accounts Manager" +msgstr "" + +#: overrides/payment_entry.py:91 overrides/payment_entry.py:133 +#: overrides/sales_invoice.py:117 +msgid "Address {0} has no zip code" +msgstr "" + +#: public/js/payment_entry.js:50 public/js/sales_invoice.js:50 +msgid "Attach PDF" +msgstr "" + +#: public/js/payment_entry.js:64 public/js/sales_invoice.js:64 +msgid "Attach XML" +msgstr "" + +#. Label of a Int field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Available credits" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:82 +msgctxt "Company branch" +msgid "Branch: {0}" +msgstr "" + +#: public/js/payment_entry.js:41 public/js/sales_invoice.js:41 +msgid "CFDI Actions" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "CFDI Stamping Settings" +msgstr "" + +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.py:44 +#: overrides/payment_entry.py:173 overrides/payment_entry.py:309 +#: overrides/sales_invoice.py:279 overrides/sales_invoice.py:375 +msgid "CFDI Web Service Error" +msgstr "" + +#: public/js/payment_entry.js:129 public/js/sales_invoice.js:127 +msgid "Cancel" +msgstr "" + +#. Name of a DocType +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Cancellation Reason" +msgstr "" + +#. Label of a Attach field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate" +msgstr "" + +#. Description of the 'Certificate' (Attach) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate file (.cer)" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:41 +msgid "Certificate file not configured" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:114 +msgid "Certificate files and password are not valid" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:80 +msgid "Certificate files and password are valid" +msgstr "" + +#. Description of the 'Key' (Attach) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Certificate key file (.key)" +msgstr "" + +#. Description of the 'Requires relationship' (Check) field in DocType +#. 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Check this field if the cancelled invoice needs to have another related invoice" +msgstr "" + +#. Label of a Data field in DocType 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Code" +msgstr "" + +#. Label of a Link field in DocType 'Digital Signing Certificate' +#. Label of a Section Break field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company" +msgstr "" + +#. Description of the 'Company' (Link) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company for which this certificate will be used to sign CFDI" +msgstr "" + +#: overrides/payment_entry.py:137 overrides/sales_invoice.py:121 +msgid "Company {0} has no address" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:163 +msgid "Company {0} has no tax regime" +msgstr "" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Company's Digital Signing Certificate to sign CFDI " +msgstr "" + +#. Label of a Section Break field in DocType 'SAT CFDI Use' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +msgid "Customer" +msgstr "" + +#: overrides/sales_invoice.py:147 +msgid "Customer address {0} has no zip code" +msgstr "" + +#: overrides/sales_invoice.py:138 +msgid "Customer {0} has no tax ID" +msgstr "" + +#: overrides/sales_invoice.py:141 +msgid "Customer {0} has no tax regime" +msgstr "" + +#. Label of a Data field in DocType 'Cancellation Reason' +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Small Text field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Description" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +#: public/js/payment_entry.js:8 public/js/payment_entry.js:98 +#: public/js/sales_invoice.js:8 public/js/sales_invoice.js:95 +msgid "Digital Signing Certificate" +msgstr "" + +#: config/desktop.py:8 +msgid "ERPNext Mexico Compliance" +msgstr "" + +#. Label of a Check field in DocType 'SAT CFDI Use' +#. Label of a Check field in DocType 'SAT Payment Method' +#. Label of a Check field in DocType 'SAT Payment Option' +#. Label of a Check field in DocType 'SAT Product or Service Key' +#. Label of a Check field in DocType 'SAT Tax Regime' +#. Label of a Check field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Enabled" +msgstr "" + +#: public/js/payment_entry.js:31 public/js/sales_invoice.js:31 +msgid "File {0} attached" +msgstr "" + +#. Label of a Section Break field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Files" +msgstr "" + +#: overrides/sales_invoice.py:68 overrides/sales_invoice_item.py:71 +msgid "From {}" +msgstr "" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +msgid "Indicates the form in which a payment was made, in accordance with the SAT catalog of forms of payment" +msgstr "" + +#. Description of a DocType +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +msgid "Indicates the method used to make a payment, in accordance with the SAT catalog of payment methods" +msgstr "" + +#: overrides/payment_entry.py:168 overrides/sales_invoice.py:274 +msgid "Invalid CFDI" +msgstr "" + +#: overrides/payment_entry.py:258 overrides/sales_invoice.py:328 +msgid "Invalid Cancellation Reason" +msgstr "" + +#: overrides/payment_entry.py:334 +msgid "Invalid Document Type" +msgstr "" + +#: overrides/customer.py:27 +msgid "Invalid Tax Id" +msgstr "" + +#: overrides/sales_invoice.py:149 +msgid "Invoice has no billing address" +msgstr "" + +#. Label of a Check field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Is Group" +msgstr "" + +#. Label of a Attach field in DocType 'Digital Signing Certificate' +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Key" +msgstr "" + +#. Label of a Data field in DocType 'SAT CFDI Use' +#. Label of a Data field in DocType 'SAT Payment Method' +#. Label of a Data field in DocType 'SAT Payment Option' +#. Label of a Data field in DocType 'SAT Product or Service Key' +#. Label of a Data field in DocType 'SAT Tax Regime' +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "Key Name" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:51 +msgid "Key file not configured" +msgstr "" + +#. Label of a Int field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Left" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:83 +msgid "Legal name: {0}" +msgstr "" + +#. Name of a Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Mexico Compliance" +msgstr "" + +#. Description of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Module settings" +msgstr "" + +#. Label of a Link field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Old Parent" +msgstr "" + +#. Label of a Link field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Parent SAT Product or Service Key" +msgstr "" + +#. Label of a Password field in DocType 'Digital Signing Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Password" +msgstr "" + +#. Description of the 'Password' (Password) field in DocType 'Digital Signing +#. Certificate' +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +msgid "Password for the certificate key" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.py:84 +msgid "RFC: {0}" +msgstr "" + +#: overrides/payment_entry.py:153 +msgid "Reference {0} has not being stamped" +msgstr "" + +#. Label of a Check field in DocType 'Cancellation Reason' +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +msgid "Requires relationship" +msgstr "" + +#. Label of a Int field in DocType 'SAT Product or Service Key' +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +msgid "Right" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT CFDI Use" +msgstr "" + +#. Name of a DocType +#: erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json +msgid "SAT CFDI Use Tax Regime" +msgstr "" + +#. Description of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Catalogs for accounting" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Payment Method" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Payment Option" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Product or Service Key" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT Tax Regime" +msgstr "" + +#. Name of a DocType +#. Label of a Link in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "SAT UOM Key" +msgstr "" + +#: public/js/payment_entry.js:20 public/js/payment_entry.js:114 +#: public/js/sales_invoice.js:20 public/js/sales_invoice.js:111 +msgid "Select a Certificate to sign the CFDI" +msgstr "" + +#. Label of a Card Break in the Mexico Compliance Workspace +#: erpnext_mexico_compliance/workspace/mexico_compliance/mexico_compliance.json +msgid "Settings" +msgstr "" + +#: public/js/payment_entry.js:131 public/js/sales_invoice.js:129 +msgid "Stamp CFDI" +msgstr "" + +#. Name of a role +#: erpnext_mexico_compliance/doctype/cancellation_reason/cancellation_reason.json +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.json +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +#: erpnext_mexico_compliance/doctype/sat_payment_method/sat_payment_method.json +#: erpnext_mexico_compliance/doctype/sat_payment_option/sat_payment_option.json +#: erpnext_mexico_compliance/doctype/sat_product_or_service_key/sat_product_or_service_key.json +#: erpnext_mexico_compliance/doctype/sat_tax_regime/sat_tax_regime.json +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "System Manager" +msgstr "" + +#: overrides/customer.py:26 +msgid "Tax Id does not comply with SAT specifications" +msgstr "" + +#. Label of a Link field in DocType 'SAT CFDI Use Tax Regime' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use_tax_regime/sat_cfdi_use_tax_regime.json +msgid "Tax Regime" +msgstr "" + +#. Label of a Table field in DocType 'SAT CFDI Use' +#: erpnext_mexico_compliance/doctype/sat_cfdi_use/sat_cfdi_use.json +msgid "Tax regimes" +msgstr "" + +#. Label of a Check field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Test mode" +msgstr "" + +#: public/js/sales_invoice.js:88 +msgid "The Cancellation Reason requires a substitute invoice." +msgstr "" + +#: public/js/payment_entry.js:89 +msgid "The Cancellation Reason requires a substitute payment entry." +msgstr "" + +#: overrides/payment_entry.py:272 overrides/sales_invoice.py:340 +msgid "The reason of cancellation {} requires a substitute invoice" +msgstr "" + +#: overrides/sales_invoice.py:69 overrides/sales_invoice_item.py:75 +msgid "To {}" +msgstr "" + +#. Label of a Data field in DocType 'SAT UOM Key' +#: erpnext_mexico_compliance/doctype/sat_uom_key/sat_uom_key.json +msgid "UOM Name" +msgstr "" + +#: erpnext_mexico_compliance/doctype/digital_signing_certificate/digital_signing_certificate.js:7 +msgid "Validate Certificate" +msgstr "" + +#. Label of a Section Break field in DocType 'CFDI Stamping Settings' +#: erpnext_mexico_compliance/doctype/cfdi_stamping_settings/cfdi_stamping_settings.json +msgid "Web Service" +msgstr "" + diff --git a/erpnext_mexico_compliance/public/js/payment_entry.js b/erpnext_mexico_compliance/public/js/payment_entry.js index 0bed685..f60deb2 100644 --- a/erpnext_mexico_compliance/public/js/payment_entry.js +++ b/erpnext_mexico_compliance/public/js/payment_entry.js @@ -79,7 +79,7 @@ function cancel(frm) { if (mx_stamped_xml) { if (!cancellation_reason) { const msg = __( - "A Cancellation Reason is required to cancel this sales invoice." + "A Cancellation Reason is required to cancel this payment entry." ); frappe.throw(msg); } diff --git a/erpnext_mexico_compliance/translations/es-MX.csv b/erpnext_mexico_compliance/translations/es-MX.csv index 357a34c..23f1289 100644 --- a/erpnext_mexico_compliance/translations/es-MX.csv +++ b/erpnext_mexico_compliance/translations/es-MX.csv @@ -1,16 +1,78 @@ -CFDI 4.0,CFDI 4.0 -From {},De {} -Invalid Tax Id,RFC Inválido -Key,Clave -Key Name,Clave Nombre -Mexico Compliance,Cumplimiento Mexicano -SAT Catalogs,Catálogos del SAT -SAT CFDI Use,Uso de CFDI SAT -SAT Payment Option,Método de Pago SAT -SAT Payment Method,Forma de Pago SAT -SAT Product or Service Key,Clave SAT de Producto o Servicio -SAT Tax Regime,Régimen Fiscal SAT -SAT UOM Key,Clave SAT de UDM -Tax Id does not comply with SAT specifications,El RFC cumple con las especificaciones del SAT -Tax Type,Tipo de Impuesto -To {},A {} +1 credit is consumed every time a CFDI gets stamped,1 crédito es consumido cada vez que se timbra un CFDI, +A Cancellation Reason is required to cancel this payment entry.,Un Motivo de Cancelación es necesario para cancelar este pago., +A Cancellation Reason is required to cancel this sales invoice.,Un Motivo de Cancelación es necesario para cancelar esta factura de venta., +A Cancellation Reason is required.,Un Motivo de Cancelación es necesario., +Address {0} has no zip code,La dirección {0} no tiene código postal, +Attach PDF,Adjuntar PDF, +Attach XML,Adjuntar XML, +Available credits,Créditos disponibles, +Branch: {0},Sucursal: {0}, +Cancellation,Cancelación, +Cancellation acknowledgement,Acuse de cancelación, +Cancellation reason,Motivo de cancelación, +Cancellation Reason,Motivo de Cancelación, +Certificate file (.cer),Archivo de certificado (.cer), +Certificate file not configured,Archivo de certificado no configurado, +Certificate files and password are not valid,Los archivos de certificado y contraseña no son válidos, +Certificate files and password are valid,Los archivos de certificado y contraseña son válidos, +Certificate key file (.key),Archivo de clave de certificado (.key), +CFDI,CFDI, +CFDI Actions,Acciones de CFDI, +CFDI Stamping Settings,Configuración de Timbrado de CFDI, +CFDI Web Service Error,Error del Web Service de CFDI, +Check this field if the cancelled invoice needs to have another related invoice,Marca este campo si la factura cancelada necesita tener otra factura relacionada, +CLABE,CLABE, +Company for which this certificate will be used to sign CFDI,Compañía para la cual este certificado será usado para firmar CFDI, +Company {0} has no address,La compañía {0} no tiene dirección, +Company {0} has no tax regime,La compañía {0} no tiene régimen fiscal, +Company's Digital Signing Certificate to sign CFDI,Certificado de Sello Digital de la empresa para firmar CFDI, +Customer address {0} has no zip code,La dirección del cliente {0} no tiene código postal, +Customer {0} has no tax ID,El cliente {0} no tiene RFC, +Customer {0} has no tax regime,El cliente {0} no tiene régimen fiscal, +Digital Signing Certificate,Certificado de Sello Digital, +ERPNext Mexico Compliance,ERPNext Cumplimiento para México, +File {0} attached,, +From {},De {}, +"Indicates the form in which a payment was made, in accordance with the SAT catalog of forms of payment","Indica la forma en la que se realiza un pago, de acuerdo al catálogo de formas de pago del SAT", +"Indicates the method used to make a payment, in accordance with the SAT catalog of payment methods","Indica el método usado para realizar un pago, de acuerdo al catálogo de métodos de pago del SAT", +Invalid Cancellation Reason,Motivo de Cancelación inválido, +Invalid CFDI,CFDI Inválido, +Invalid Document Type,Tipo de Documento inválido, +Invalid Tax Id,RFC Inválido, +Invoice has no billing address,La factura no tiene dirección de facturación, +Key,Clave, +Key file not configured,Archivo de llave no configurado, +Key Name,Clave Nombre, +Legal name: {0},Razón social: {0}, +Mexico Compliance,Cumplimiento para México, +Parent SAT Product or Service Key,Clave de Producto o Servicio del SAT padre, +Password for the certificate key,Contraseña para la llave del certificado, +Reference {0} has not being stamped,La referencia {0} no ha sido timbrada, +Requires relationship,Requiere relación, +RFC: {0},RFC: {0}, +SAT Catalogs,Catálogos del SAT, +SAT CFDI Use,Uso de CFDI SAT, +SAT CFDI Use Tax Regime,Régimen Fiscal del Uso de CFDI SAT, +SAT Payment Method,Forma de Pago SAT, +SAT Payment Mode,Forma de Pago SAT, +SAT Payment Option,Método de Pago SAT, +SAT Product or Service Key,Clave SAT de Producto o Servicio, +SAT Tax Regime,Régimen Fiscal SAT, +SAT UOM Key,Clave SAT de UDM, +Select a Certificate to sign the CFDI,Selecciona un Certificado para firmar el CFDI, +Stamp CFDI,Timbrar CFDI, +Stamped XML,XML timbrado, +Substitute invoice,Factura sustituta, +Substitute payment entry,Entrada de pago sustituta, +Tax Id does not comply with SAT specifications,El RFC cumple con las especificaciones del SAT, +Tax Regime,Régimen Fiscal, +Tax regimes,Regímenes fiscales, +Tax Type,Tipo de Impuesto, +Test mode,Modo de pruebas, +The Cancellation Reason requires a substitute invoice.,El motivo de cancelación requiere una factura sustituta, +The Cancellation Reason requires a substitute payment entry.,El motivo de cancelación requiere una entrada de pago sustituta, +The reason of cancellation {} requires a substitute invoice,El motivo de cancelación {} requiere una factura sustituta, +To {},A {}, +Validate Certificate,Validar Certificado, +Web Service,Web Service, +XML,XML, diff --git a/erpnext_mexico_compliance/translations/es.csv b/erpnext_mexico_compliance/translations/es.csv index 357a34c..23f1289 100644 --- a/erpnext_mexico_compliance/translations/es.csv +++ b/erpnext_mexico_compliance/translations/es.csv @@ -1,16 +1,78 @@ -CFDI 4.0,CFDI 4.0 -From {},De {} -Invalid Tax Id,RFC Inválido -Key,Clave -Key Name,Clave Nombre -Mexico Compliance,Cumplimiento Mexicano -SAT Catalogs,Catálogos del SAT -SAT CFDI Use,Uso de CFDI SAT -SAT Payment Option,Método de Pago SAT -SAT Payment Method,Forma de Pago SAT -SAT Product or Service Key,Clave SAT de Producto o Servicio -SAT Tax Regime,Régimen Fiscal SAT -SAT UOM Key,Clave SAT de UDM -Tax Id does not comply with SAT specifications,El RFC cumple con las especificaciones del SAT -Tax Type,Tipo de Impuesto -To {},A {} +1 credit is consumed every time a CFDI gets stamped,1 crédito es consumido cada vez que se timbra un CFDI, +A Cancellation Reason is required to cancel this payment entry.,Un Motivo de Cancelación es necesario para cancelar este pago., +A Cancellation Reason is required to cancel this sales invoice.,Un Motivo de Cancelación es necesario para cancelar esta factura de venta., +A Cancellation Reason is required.,Un Motivo de Cancelación es necesario., +Address {0} has no zip code,La dirección {0} no tiene código postal, +Attach PDF,Adjuntar PDF, +Attach XML,Adjuntar XML, +Available credits,Créditos disponibles, +Branch: {0},Sucursal: {0}, +Cancellation,Cancelación, +Cancellation acknowledgement,Acuse de cancelación, +Cancellation reason,Motivo de cancelación, +Cancellation Reason,Motivo de Cancelación, +Certificate file (.cer),Archivo de certificado (.cer), +Certificate file not configured,Archivo de certificado no configurado, +Certificate files and password are not valid,Los archivos de certificado y contraseña no son válidos, +Certificate files and password are valid,Los archivos de certificado y contraseña son válidos, +Certificate key file (.key),Archivo de clave de certificado (.key), +CFDI,CFDI, +CFDI Actions,Acciones de CFDI, +CFDI Stamping Settings,Configuración de Timbrado de CFDI, +CFDI Web Service Error,Error del Web Service de CFDI, +Check this field if the cancelled invoice needs to have another related invoice,Marca este campo si la factura cancelada necesita tener otra factura relacionada, +CLABE,CLABE, +Company for which this certificate will be used to sign CFDI,Compañía para la cual este certificado será usado para firmar CFDI, +Company {0} has no address,La compañía {0} no tiene dirección, +Company {0} has no tax regime,La compañía {0} no tiene régimen fiscal, +Company's Digital Signing Certificate to sign CFDI,Certificado de Sello Digital de la empresa para firmar CFDI, +Customer address {0} has no zip code,La dirección del cliente {0} no tiene código postal, +Customer {0} has no tax ID,El cliente {0} no tiene RFC, +Customer {0} has no tax regime,El cliente {0} no tiene régimen fiscal, +Digital Signing Certificate,Certificado de Sello Digital, +ERPNext Mexico Compliance,ERPNext Cumplimiento para México, +File {0} attached,, +From {},De {}, +"Indicates the form in which a payment was made, in accordance with the SAT catalog of forms of payment","Indica la forma en la que se realiza un pago, de acuerdo al catálogo de formas de pago del SAT", +"Indicates the method used to make a payment, in accordance with the SAT catalog of payment methods","Indica el método usado para realizar un pago, de acuerdo al catálogo de métodos de pago del SAT", +Invalid Cancellation Reason,Motivo de Cancelación inválido, +Invalid CFDI,CFDI Inválido, +Invalid Document Type,Tipo de Documento inválido, +Invalid Tax Id,RFC Inválido, +Invoice has no billing address,La factura no tiene dirección de facturación, +Key,Clave, +Key file not configured,Archivo de llave no configurado, +Key Name,Clave Nombre, +Legal name: {0},Razón social: {0}, +Mexico Compliance,Cumplimiento para México, +Parent SAT Product or Service Key,Clave de Producto o Servicio del SAT padre, +Password for the certificate key,Contraseña para la llave del certificado, +Reference {0} has not being stamped,La referencia {0} no ha sido timbrada, +Requires relationship,Requiere relación, +RFC: {0},RFC: {0}, +SAT Catalogs,Catálogos del SAT, +SAT CFDI Use,Uso de CFDI SAT, +SAT CFDI Use Tax Regime,Régimen Fiscal del Uso de CFDI SAT, +SAT Payment Method,Forma de Pago SAT, +SAT Payment Mode,Forma de Pago SAT, +SAT Payment Option,Método de Pago SAT, +SAT Product or Service Key,Clave SAT de Producto o Servicio, +SAT Tax Regime,Régimen Fiscal SAT, +SAT UOM Key,Clave SAT de UDM, +Select a Certificate to sign the CFDI,Selecciona un Certificado para firmar el CFDI, +Stamp CFDI,Timbrar CFDI, +Stamped XML,XML timbrado, +Substitute invoice,Factura sustituta, +Substitute payment entry,Entrada de pago sustituta, +Tax Id does not comply with SAT specifications,El RFC cumple con las especificaciones del SAT, +Tax Regime,Régimen Fiscal, +Tax regimes,Regímenes fiscales, +Tax Type,Tipo de Impuesto, +Test mode,Modo de pruebas, +The Cancellation Reason requires a substitute invoice.,El motivo de cancelación requiere una factura sustituta, +The Cancellation Reason requires a substitute payment entry.,El motivo de cancelación requiere una entrada de pago sustituta, +The reason of cancellation {} requires a substitute invoice,El motivo de cancelación {} requiere una factura sustituta, +To {},A {}, +Validate Certificate,Validar Certificado, +Web Service,Web Service, +XML,XML,