Open Yazan01H opened 2 days ago
The sales invoice generated doesn't have any taxes in the "Sales Taxes and Charges" table. This usually indicates a missing default "Sales Taxes and Charges Template" for the company in question.
This indicates compliance wasn't performed successfully or at all. Did compliance run and succeed?
Traceback with variables (most recent call last): File "apps/ksa_compliance/ksa_compliance/compliance_checks.py", line 107, in _perform_compliance_checks simplified_result = _perform_compliance_for_invoice_type(progress, progress_per_step, ft('Simplified'), business_settings_id = 'iValue KSA-Saudi Arabia-SAR' simplified_customer_id = 'الشركة الوطنية للإسكان' standard_customer_id = 'شركة علم' item_id = '1041' tax_category_id = 'VAT' num_steps = 18 progress_per_step = 5.555555555555555 progress = 0.0 has_error = True settings =
simplified_result = None
standard_result = None
e = ValidationError('Please include tax rate in Sales Taxes and Charges Table')
File "apps/ksa_compliance/ksa_compliance/compliance_checks.py", line 148, in _perform_compliance_for_invoice_type
invoice = _make_invoice(settings.company, customer_id, item_id, tax_category_id)
progress = 0.0
progress_per_step = 5.555555555555555
invoice_type = 'Simplified'
customer_id = 'الشركة الوطنية للإسكان'
settings =
item_id = '1041'
tax_category_id = 'VAT'
File "apps/ksa_compliance/ksa_compliance/compliance_checks.py", line 226, in _make_invoice
invoice.save()
company = 'iValue KSA'
customer = 'الشركة الوطنية للإسكان'
item = '1041'
tax_category_id = 'VAT'
invoice =
File "apps/frappe/frappe/model/document.py", line 337, in save
return self._save(*args, kwargs)
self =
args = ()
kwargs = {}
File "apps/frappe/frappe/model/document.py", line 359, in _save
return self.insert()
self =
ignore_permissions = None
ignore_version = None
File "apps/frappe/frappe/model/document.py", line 291, in insert
self.run_before_save_methods()
self =
ignore_permissions = None
ignore_links = None
ignore_if_duplicate = False
ignore_mandatory = None
set_name = None
set_child_names = True
File "apps/frappe/frappe/model/document.py", line 1091, in run_before_save_methods
self.run_method("validate")
self =
File "apps/frappe/frappe/model/document.py", line 962, in run_method
out = Document.hook(fn)(self, *args, *kwargs)
self =
args = ()
kwargs = {}
fn = <function Document.run_method..fn at 0x7fb85b156ef0>
method = 'validate'
File "apps/frappe/frappe/model/document.py", line 1322, in composer
return composed(self, method, args, kwargs)
self =
args = ()
kwargs = {}
hooks = [<function validate_accounting_period_on_doc_save at 0x7fb86008ef80>, <function validate_sales_invoice at 0x7fb85b267520>, <function apply at 0x7fb85ad85090>, <function check_for_running_deletion_job at 0x7fb85ad86c20>]
method = 'validate'
doc_events = {'': {'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply'], 'on_trash': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions'], 'on_update_after_submit': ['frappe.workflow.doctype.workflow_action.workflow_action.process_w...
handler = 'erpnext.setup.doctype.transaction_deletion_record.transaction_deletion_record.check_for_running_deletion_job'
composed = <function Document.hook..compose..runner at 0x7fb85af46200>
compose = <function Document.hook..compose at 0x7fb85af460e0>
f = <function Document.run_method..fn at 0x7fb85b156ef0>
File "apps/frappe/frappe/model/document.py", line 1306, in runner
add_to_return_value(self, f(self, method, args, **kwargs))
self =
method = 'validate'
args = ()
kwargs = {}
f = <function validate_sales_invoice at 0x7fb85b267520>
add_to_return_value = <function Document.hook..add_to_return_value at 0x7fb85af45f30>
fn = <function Document.run_method..fn at 0x7fb85b156ef0>
hooks = (<function validate_accounting_period_on_doc_save at 0x7fb86008ef80>, <function validate_sales_invoice at 0x7fb85b267520>, <function apply at 0x7fb85ad85090>, <function check_for_running_deletion_job at 0x7fb85ad86c20>)
File "apps/ksa_compliance/ksa_compliance/standard_doctypes/sales_invoice.py", line 129, in validate_sales_invoice
raise frappe.ValidationError(error_messages)
self =
method = 'validate'
valid = False
is_phase_2_enabled_for_company = True
settings =
message_log = [{'message': 'Please include tax rate in Sales Taxes and Charges Table', 'title': 'Validation Error', 'indicator': 'red'}]
error_messages = 'Please include tax rate in Sales Taxes and Charges Table'
frappe.exceptions.ValidationError: Please include tax rate in Sales Taxes and Charges Table