mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 15:25:19 +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
|
||||
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
|
||||
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
"section_break_2",
|
||||
"sandbox_mode",
|
||||
"credentials",
|
||||
"advanced_settings_section",
|
||||
"client_id",
|
||||
"column_break_8",
|
||||
"client_secret",
|
||||
"auth_token",
|
||||
"token_expiry"
|
||||
],
|
||||
@@ -48,12 +52,32 @@
|
||||
"fieldname": "sandbox_mode",
|
||||
"fieldtype": "Check",
|
||||
"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,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2021-01-13 12:04:49.449199",
|
||||
"modified": "2021-11-16 19:50:28.029517",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Regional",
|
||||
"name": "E Invoice Settings",
|
||||
|
||||
@@ -23,9 +23,5 @@
|
||||
"StateCesAmt": "{item.state_cess_amount}",
|
||||
"StateCesNonAdvlAmt": "{item.state_cess_nadv_amount}",
|
||||
"OthChrg": "{item.other_charges}",
|
||||
"TotItemVal": "{item.total_value}",
|
||||
"BchDtls": {{
|
||||
"Nm": "{item.batch_no}",
|
||||
"ExpDt": "{item.batch_expiry_date}"
|
||||
}}
|
||||
"TotItemVal": "{item.total_value}"
|
||||
}}
|
||||
@@ -200,8 +200,6 @@ def get_item_list(invoice):
|
||||
item.taxable_value = abs(item.taxable_value)
|
||||
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.serial_no = ""
|
||||
|
||||
@@ -462,7 +460,11 @@ def make_einvoice(invoice):
|
||||
except Exception:
|
||||
show_link_to_error_log(invoice, einvoice)
|
||||
|
||||
validate_totals(einvoice)
|
||||
try:
|
||||
validate_totals(einvoice)
|
||||
except Exception:
|
||||
log_error(einvoice)
|
||||
raise
|
||||
|
||||
return einvoice
|
||||
|
||||
@@ -611,10 +613,17 @@ class GSPConnector():
|
||||
request_log.save(ignore_permissions=True)
|
||||
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):
|
||||
client_id, client_secret = self.get_client_credentials()
|
||||
headers = {
|
||||
'gspappid': frappe.conf.einvoice_client_id,
|
||||
'gspappsecret': frappe.conf.einvoice_client_secret
|
||||
'gspappid': client_id,
|
||||
'gspappsecret': client_secret
|
||||
}
|
||||
res = {}
|
||||
try:
|
||||
@@ -854,7 +863,7 @@ class GSPConnector():
|
||||
if errors:
|
||||
throw_error_list(errors, title)
|
||||
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(
|
||||
_('An error occurred while making e-invoicing request. Please check {} for more information.').format(link_to_error_list),
|
||||
title=title,
|
||||
|
||||
Reference in New Issue
Block a user