mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
Merge pull request #30456 from frappe/version-12-hotfix
chore: Release for v12.27.0
This commit is contained in:
@@ -696,7 +696,7 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
# apply rounding
|
# apply rounding
|
||||||
if frappe.get_cached_value("Salary Component", row.salary_component, "round_to_the_nearest_integer"):
|
if frappe.get_cached_value("Salary Component", row.salary_component, "round_to_the_nearest_integer"):
|
||||||
amount, additional_amount = rounded(amount), rounded(additional_amount)
|
amount, additional_amount = rounded(amount or 0), rounded(additional_amount or 0)
|
||||||
|
|
||||||
return amount, additional_amount
|
return amount, additional_amount
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
"section_break_2",
|
"section_break_2",
|
||||||
"sandbox_mode",
|
"sandbox_mode",
|
||||||
"credentials",
|
"credentials",
|
||||||
|
"advanced_settings_section",
|
||||||
|
"client_id",
|
||||||
|
"column_break_8",
|
||||||
|
"client_secret",
|
||||||
"auth_token",
|
"auth_token",
|
||||||
"token_expiry"
|
"token_expiry"
|
||||||
],
|
],
|
||||||
@@ -48,12 +52,32 @@
|
|||||||
"fieldname": "sandbox_mode",
|
"fieldname": "sandbox_mode",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Sandbox Mode"
|
"label": "Sandbox Mode"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"collapsible": 1,
|
||||||
|
"fieldname": "advanced_settings_section",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Advanced Settings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "client_id",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Client ID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "client_secret",
|
||||||
|
"fieldtype": "Password",
|
||||||
|
"label": "Client Secret"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_8",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-01-13 12:04:49.449199",
|
"modified": "2021-11-16 19:50:28.029517",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Regional",
|
"module": "Regional",
|
||||||
"name": "E Invoice Settings",
|
"name": "E Invoice Settings",
|
||||||
|
|||||||
@@ -23,9 +23,5 @@
|
|||||||
"StateCesAmt": "{item.state_cess_amount}",
|
"StateCesAmt": "{item.state_cess_amount}",
|
||||||
"StateCesNonAdvlAmt": "{item.state_cess_nadv_amount}",
|
"StateCesNonAdvlAmt": "{item.state_cess_nadv_amount}",
|
||||||
"OthChrg": "{item.other_charges}",
|
"OthChrg": "{item.other_charges}",
|
||||||
"TotItemVal": "{item.total_value}",
|
"TotItemVal": "{item.total_value}"
|
||||||
"BchDtls": {{
|
|
||||||
"Nm": "{item.batch_no}",
|
|
||||||
"ExpDt": "{item.batch_expiry_date}"
|
|
||||||
}}
|
|
||||||
}}
|
}}
|
||||||
@@ -200,8 +200,6 @@ def get_item_list(invoice):
|
|||||||
item.taxable_value = abs(item.taxable_value)
|
item.taxable_value = abs(item.taxable_value)
|
||||||
item.discount_amount = 0
|
item.discount_amount = 0
|
||||||
|
|
||||||
item.batch_expiry_date = frappe.db.get_value('Batch', d.batch_no, 'expiry_date') if d.batch_no else None
|
|
||||||
item.batch_expiry_date = format_date(item.batch_expiry_date, 'dd/mm/yyyy') if item.batch_expiry_date else None
|
|
||||||
item.is_service_item = 'Y' if item.gst_hsn_code and item.gst_hsn_code[:2] == "99" else 'N'
|
item.is_service_item = 'Y' if item.gst_hsn_code and item.gst_hsn_code[:2] == "99" else 'N'
|
||||||
item.serial_no = ""
|
item.serial_no = ""
|
||||||
|
|
||||||
@@ -462,7 +460,11 @@ def make_einvoice(invoice):
|
|||||||
except Exception:
|
except Exception:
|
||||||
show_link_to_error_log(invoice, einvoice)
|
show_link_to_error_log(invoice, einvoice)
|
||||||
|
|
||||||
validate_totals(einvoice)
|
try:
|
||||||
|
validate_totals(einvoice)
|
||||||
|
except Exception:
|
||||||
|
log_error(einvoice)
|
||||||
|
raise
|
||||||
|
|
||||||
return einvoice
|
return einvoice
|
||||||
|
|
||||||
@@ -611,10 +613,17 @@ class GSPConnector():
|
|||||||
request_log.save(ignore_permissions=True)
|
request_log.save(ignore_permissions=True)
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
|
def get_client_credentials(self):
|
||||||
|
if self.e_invoice_settings.client_id and self.e_invoice_settings.client_secret:
|
||||||
|
return self.e_invoice_settings.client_id, self.e_invoice_settings.get_password('client_secret')
|
||||||
|
|
||||||
|
return frappe.conf.einvoice_client_id, frappe.conf.einvoice_client_secret
|
||||||
|
|
||||||
def fetch_auth_token(self):
|
def fetch_auth_token(self):
|
||||||
|
client_id, client_secret = self.get_client_credentials()
|
||||||
headers = {
|
headers = {
|
||||||
'gspappid': frappe.conf.einvoice_client_id,
|
'gspappid': client_id,
|
||||||
'gspappsecret': frappe.conf.einvoice_client_secret
|
'gspappsecret': client_secret
|
||||||
}
|
}
|
||||||
res = {}
|
res = {}
|
||||||
try:
|
try:
|
||||||
@@ -854,7 +863,7 @@ class GSPConnector():
|
|||||||
if errors:
|
if errors:
|
||||||
throw_error_list(errors, title)
|
throw_error_list(errors, title)
|
||||||
else:
|
else:
|
||||||
link_to_error_list = '<a href="desk#List/Error Log/List?method=E Invoice Request Failed">Error Log</a>'
|
link_to_error_list = '<a href="desk#List/Error Log/List?method=E Invoice Request Failed" target="_blank">Error Log</a>'
|
||||||
frappe.msgprint(
|
frappe.msgprint(
|
||||||
_('An error occurred while making e-invoicing request. Please check {} for more information.').format(link_to_error_list),
|
_('An error occurred while making e-invoicing request. Please check {} for more information.').format(link_to_error_list),
|
||||||
title=title,
|
title=title,
|
||||||
|
|||||||
Reference in New Issue
Block a user