Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(regional): removed payment schedule validation in sales invoice for italy #45852

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

ljain112
Copy link
Collaborator

@ljain112 ljain112 commented Feb 11, 2025

Issue: Payment Details are not mandatory for Italy e-Invoicing.

If Sales Return is created, the system automatically removes Payment Schedule rows causing the error.
image

Traceback
Traceback (most recent call last):

File "apps/frappe/frappe/[app.py](http://app.py/)", line 114, in application

response = frappe.api.handle(request)

^^^^^^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/api/__init__.py", line 49, in handle

data = endpoint(**arguments)

^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/api/[v1.py](http://v1.py/)", line 36, in handle_rpc_call

return frappe.handler.handle()

^^^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/[handler.py](http://handler.py/)", line 50, in handle

data = execute_cmd(cmd)

^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/[handler.py](http://handler.py/)", line 86, in execute_cmd

return [frappe.call](http://frappe.call/)(method, **frappe.form_dict)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/__init__.py", line 1726, in call

return fn(*args, **newargs)

^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/utils/typing_[validations.py](http://validations.py/)", line 31, in wrapper

return func(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/desk/form/[save.py](http://save.py/)", line 37, in savedocs

doc.submit()

File "apps/frappe/frappe/utils/typing_[validations.py](http://validations.py/)", line 31, in wrapper

return func(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/model/[document.py](http://document.py/)", line 1060, in submit

return self._submit()

^^^^^^^^^^^^^^

File "apps/frappe/frappe/model/[document.py](http://document.py/)", line 1043, in _submit

return [self.save](http://self.save/)()

^^^^^^^^^^^

File "apps/frappe/frappe/model/[document.py](http://document.py/)", line 342, in save

return self._save(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/model/[document.py](http://document.py/)", line 395, in _save

[self.run](http://self.run/)_post_save_methods()

File "apps/frappe/frappe/model/[document.py](http://document.py/)", line 1143, in run_post_save_methods

[self.run](http://self.run/)_method("on_submit")

File "apps/frappe/frappe/model/[document.py](http://document.py/)", line 974, in run_method

out = Document.hook(fn)(self, args, *kwargs)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/model/[document.py](http://document.py/)", line 1334, in composer

return composed(self, method, args, *kwargs)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "apps/frappe/frappe/model/[document.py](http://document.py/)", line 1318, in runner

add_to_return_value(self, f(self, method, args, *kwargs))

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "apps/erpnext/erpnext/regional/italy/[utils.py](http://utils.py/)", line 335, in sales_invoice_on_submit

frappe.throw(_("Please set the Payment Schedule"), title=_("E-Invoicing Information Missing"))

File "apps/frappe/frappe/__init__.py", line 603, in throw

msgprint(

File "apps/frappe/frappe/__init__.py", line 568, in msgprint

raiseexception()

File "apps/frappe/frappe/__init__.py", line 519, in raiseexception

raise exc

frappe.exceptions.ValidationError: Please set the Payment Schedule

We are modifiying "DatiPagamento" in xml.
Documentation: https://www.fatturapa.gov.it/export/documenti/Specifiche_tecniche_del_formato_FatturaPA_V1.3.2.pdf
image

Closes: #44658
Frappe Support Issue: https://support.frappe.io/helpdesk/tickets/29505

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Feb 11, 2025
@ljain112 ljain112 changed the title fix: removed payment schedule validation in sales invoice for italy regional fix (regional): removed payment schedule validation in sales invoice for italy Feb 11, 2025
@ljain112 ljain112 changed the title fix (regional): removed payment schedule validation in sales invoice for italy fix(regional): removed payment schedule validation in sales invoice for italy Feb 11, 2025
@nabinhait nabinhait merged commit 4943102 into frappe:develop Feb 11, 2025
13 checks passed
mergify bot pushed a commit that referenced this pull request Feb 11, 2025
mergify bot pushed a commit that referenced this pull request Feb 11, 2025
nabinhait pushed a commit that referenced this pull request Feb 11, 2025
…or italy (backport #45852) (#45854)

fix(regional): removed payment schedule validation in sales invoice for italy (#45852)

(cherry picked from commit 4943102)

Co-authored-by: Lakshit Jain <[email protected]>
nabinhait pushed a commit that referenced this pull request Feb 11, 2025
…or italy (backport #45852) (#45853)

fix(regional): removed payment schedule validation in sales invoice for italy (#45852)

(cherry picked from commit 4943102)

Co-authored-by: Lakshit Jain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport version-14-hotfix backport to version 14 backport version-15-hotfix needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Payment Schedule rows removed when creating a Credit Note from an Invoice - Missing E-Invoicing data
2 participants