Open cdiethelm opened 2 years ago
@estackhub please assess this issue.
@wojosc invoices.against_singles always returns empty [ ]. Looking into the return structure and length of "invoices.against_singles"
Thank you @estackhub . There is something else we need to look at here first I think.
@cdiethelm you would like to reflect "EUSt" right? ERPNext is set to cover this in the Taxes and Charges Table rather than doing this via an item. Is this known to you?
@wojosc Yes, that is known to me. Our issue is that we cannot have different tax codes in the invoice. Example: For the "EUSt", we need tax code 115, for regular taxes 140. There should be a field in the table "purchase taxes and charges" to set an individual account. Right now, this is handled via "Purchase taxes and charges template". We cannot choose multiple templates.
Hi @cdiethelm from a user persepective...would it be sufficient to have a field "Tax Code" inside the Taxes and Charges Table?
Hello @wojosc, Yes, that would fit our use case. Since the user already has to put in the tax value, he could also put in the tax code.
@cdiethelm I have added the field on the staging platform. Please have a look.
It won't be available in the Abacus Export yet but you'll be able to check if you can pull all the information over a custom report I have created:
The amounts in the columns between 4 and 5 are the amount of the items and the amount of the tax.
Hello @wojosc , account 115 is present in the view, so that is correct.
The other content would have tax code 131 from the template.
@wojosc Please note, that we need that for Purchase Invoice, not Sales invoice.
@wojosc Are there any news on this subject? Anything I could help?
@cdiethelm as just discussed:
The field for the Swiss Tax Code on the UI will be called "Steuerziffer CH" and carry the technical fieldname steuerziffer_ch to avoid conflict with other tax related fields coming from frappe or third party apps.
We have quickly discussed and tested the use of Accounting Dimensions to quickly employ the field on all accounting relevant transactions documents which are, but not limit to
With implementing the field via the UI the requirement to be able to input and document the "Steuerziffer (Tax Code)" is fulfilled.
Further we will need to map (and remap due to the field name change) the field "steuerziffer_ch" to the Abacus Field
The mapping needs to be done on
Item Level and Sales Taxes and Charges Level. Both on Sales Invoice and Purchase Invoice. Although the Purchase Invoice has the higher priority
Tasks
@cdiethelm please quickly let me know if there are further steps to take befor we start with this. Thank you.
@estackhub fyi
@wojosc I think its all clear now. Looks good to me. 👍
@wojosc We have an error with the export. Should that be an optional value?
{
"erpnext": "14.0.0-dev",
"frappe": "14.0.0-dev",
"swiss_accounting_integration": "0.0.6",
"wiki": "0.0.1"
}
Form/Abacus Export/jan
Traceback (most recent call last):
File "apps/frappe/frappe/desk/form/save.py", line 21, in savedocs
doc.submit()
File "apps/frappe/frappe/model/document.py", line 997, in submit
return self._submit()
File "apps/frappe/frappe/model/document.py", line 986, in _submit
return self.save()
File "apps/frappe/frappe/model/document.py", line 295, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 346, in _save
self.run_post_save_methods()
File "apps/frappe/frappe/model/document.py", line 1065, in run_post_save_methods
self.run_method("on_submit")
File "apps/frappe/frappe/model/document.py", line 920, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1242, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1226, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File "apps/swiss_accounting_integration/swiss_accounting_integration/__init__.py", line 167, in attach_xml
attach(doc.company, doc.start_date, doc.end_date, doc.doctype, doc.name)
File "apps/swiss_accounting_integration/swiss_accounting_integration/__init__.py", line 159, in attach
gl_xml = gl(company, start_date, end_date)
File "apps/swiss_accounting_integration/swiss_accounting_integration/__init__.py", line 92, in gl
inv_amt(item, item.expense_account, inv.currency,
File "apps/swiss_accounting_integration/swiss_accounting_integration/utils.py", line 174, in amount
'tax_code': item.tax_code or "312",
AttributeError: 'PurchaseInvoiceItem' object has no attribute 'tax_code'
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 67, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 38, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 76, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1493, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/form/save.py", line 21, in savedocs
doc.submit()
File "apps/frappe/frappe/model/document.py", line 997, in submit
return self._submit()
File "apps/frappe/frappe/model/document.py", line 986, in _submit
return self.save()
File "apps/frappe/frappe/model/document.py", line 295, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 346, in _save
self.run_post_save_methods()
File "apps/frappe/frappe/model/document.py", line 1065, in run_post_save_methods
self.run_method("on_submit")
File "apps/frappe/frappe/model/document.py", line 920, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1242, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1226, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File "apps/swiss_accounting_integration/swiss_accounting_integration/__init__.py", line 167, in attach_xml
attach(doc.company, doc.start_date, doc.end_date, doc.doctype, doc.name)
File "apps/swiss_accounting_integration/swiss_accounting_integration/__init__.py", line 159, in attach
gl_xml = gl(company, start_date, end_date)
File "apps/swiss_accounting_integration/swiss_accounting_integration/__init__.py", line 92, in gl
inv_amt(item, item.expense_account, inv.currency,
File "apps/swiss_accounting_integration/swiss_accounting_integration/utils.py", line 174, in amount
'tax_code': item.tax_code or "312",
AttributeError: 'PurchaseInvoiceItem' object has no attribute 'tax_code'
{
"type": "POST",
"args": {
"doc": "{,\"doctype\":\"Abacus Export\"}",
"action": "Submit"
},
"btn": {
"jQuery3600018627082573897671": {
"events": {
"click": [
{
"type": "click",
"origType": "click",
"guid": 884,
"namespace": ""
}
]
}
}
},
"freeze": true,
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.form.save.savedocs"
}
{
"exception": "AttributeError: 'PurchaseInvoiceItem' object has no attribute 'tax_code'"
}
@cdiethelm the change was only implemented for the Sales Invoice for the moment. We should test that first.
For now, try adding a field tax_code to your Purchase Invoice Item to solve your error. If you need help, please call. Thank you.
Hello,
Here is our situation: There are completely deductable positions on invoices which have a separate tax code. The taxrate for these items is 100% included in the item price.
Example: Item 1 - 14.90 CHF Total invoice cost - 14.90 CHF
This is an example file from our old ERP System:
This is an example from ERPNext with the Swiss Accounting integration:
Notice that the tax information is not stored in TaxData. This returns the following error in Abacus: