mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34627
This commit is contained in:
@@ -325,14 +325,14 @@ def get_template(template_type):
|
|||||||
|
|
||||||
if template_type == "Blank Template":
|
if template_type == "Blank Template":
|
||||||
for root_type in get_root_types():
|
for root_type in get_root_types():
|
||||||
writer.writerow(["", "", "", 1, "", root_type])
|
writer.writerow(["", "", "", "", 1, "", root_type])
|
||||||
|
|
||||||
for account in get_mandatory_group_accounts():
|
for account in get_mandatory_group_accounts():
|
||||||
writer.writerow(["", "", "", 1, account, "Asset"])
|
writer.writerow(["", "", "", "", 1, account, "Asset"])
|
||||||
|
|
||||||
for account_type in get_mandatory_account_types():
|
for account_type in get_mandatory_account_types():
|
||||||
writer.writerow(
|
writer.writerow(
|
||||||
["", "", "", 0, account_type.get("account_type"), account_type.get("root_type")]
|
["", "", "", "", 0, account_type.get("account_type"), account_type.get("root_type")]
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
writer = get_sample_template(writer)
|
writer = get_sample_template(writer)
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class JournalEntry(AccountsController):
|
|||||||
self.validate_multi_currency()
|
self.validate_multi_currency()
|
||||||
self.set_amounts_in_company_currency()
|
self.set_amounts_in_company_currency()
|
||||||
self.validate_debit_credit_amount()
|
self.validate_debit_credit_amount()
|
||||||
|
self.set_total_debit_credit()
|
||||||
# Do not validate while importing via data import
|
# Do not validate while importing via data import
|
||||||
if not frappe.flags.in_import:
|
if not frappe.flags.in_import:
|
||||||
self.validate_total_debit_and_credit()
|
self.validate_total_debit_and_credit()
|
||||||
@@ -659,7 +659,6 @@ class JournalEntry(AccountsController):
|
|||||||
frappe.throw(_("Row {0}: Both Debit and Credit values cannot be zero").format(d.idx))
|
frappe.throw(_("Row {0}: Both Debit and Credit values cannot be zero").format(d.idx))
|
||||||
|
|
||||||
def validate_total_debit_and_credit(self):
|
def validate_total_debit_and_credit(self):
|
||||||
self.set_total_debit_credit()
|
|
||||||
if not (self.voucher_type == "Exchange Gain Or Loss" and self.multi_currency):
|
if not (self.voucher_type == "Exchange Gain Or Loss" and self.multi_currency):
|
||||||
if self.difference:
|
if self.difference:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
|
|||||||
@@ -469,6 +469,9 @@ frappe.ui.form.on('Asset', {
|
|||||||
} else {
|
} else {
|
||||||
frm.set_value('purchase_date', purchase_doc.posting_date);
|
frm.set_value('purchase_date', purchase_doc.posting_date);
|
||||||
}
|
}
|
||||||
|
if (!frm.doc.is_existing_asset && !frm.doc.available_for_use_date) {
|
||||||
|
frm.set_value('available_for_use_date', frm.doc.purchase_date);
|
||||||
|
}
|
||||||
const item = purchase_doc.items.find(item => item.item_code === frm.doc.item_code);
|
const item = purchase_doc.items.find(item => item.item_code === frm.doc.item_code);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
doctype_field = frappe.scrub(doctype)
|
doctype_field = frappe.scrub(doctype)
|
||||||
|
|||||||
@@ -81,6 +81,9 @@
|
|||||||
"options": "ACC-ASS-.YYYY.-"
|
"options": "ACC-ASS-.YYYY.-"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "item_code",
|
||||||
|
"fetch_from": "item_code.item_name",
|
||||||
|
"fetch_if_empty": 1,
|
||||||
"fieldname": "asset_name",
|
"fieldname": "asset_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
@@ -527,7 +530,7 @@
|
|||||||
"table_fieldname": "accounts"
|
"table_fieldname": "accounts"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2023-01-25 17:45:48.649543",
|
"modified": "2023-03-30 15:07:41.542374",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset",
|
"name": "Asset",
|
||||||
|
|||||||
@@ -218,10 +218,16 @@ def notify_depr_entry_posting_error(failed_asset_names):
|
|||||||
asset_links = get_comma_separated_asset_links(failed_asset_names)
|
asset_links = get_comma_separated_asset_links(failed_asset_names)
|
||||||
|
|
||||||
message = (
|
message = (
|
||||||
_("Hi,")
|
_("Hello,")
|
||||||
+ "<br>"
|
+ "<br><br>"
|
||||||
+ _("The following assets have failed to post depreciation entries: {0}").format(asset_links)
|
+ _("The following assets have failed to automatically post depreciation entries: {0}").format(
|
||||||
|
asset_links
|
||||||
|
)
|
||||||
+ "."
|
+ "."
|
||||||
|
+ "<br><br>"
|
||||||
|
+ _(
|
||||||
|
"Please raise a support ticket and share this email, or forward this email to your development team so that they can find the issue in the developer console by manually creating the depreciation entry via the asset's depreciation schedule table."
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
frappe.sendmail(recipients=recipients, subject=subject, message=message)
|
frappe.sendmail(recipients=recipients, subject=subject, message=message)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ frappe.ui.form.on('Asset Value Adjustment', {
|
|||||||
frm.call({
|
frm.call({
|
||||||
method: "erpnext.assets.doctype.asset.asset.get_asset_value_after_depreciation",
|
method: "erpnext.assets.doctype.asset.asset.get_asset_value_after_depreciation",
|
||||||
args: {
|
args: {
|
||||||
asset: frm.doc.asset,
|
asset_name: frm.doc.asset,
|
||||||
finance_book: frm.doc.finance_book
|
finance_book: frm.doc.finance_book
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ def get_transactions(bank, bank_account=None, start_date=None, end_date=None):
|
|||||||
if e.code == "ITEM_LOGIN_REQUIRED":
|
if e.code == "ITEM_LOGIN_REQUIRED":
|
||||||
msg = _("There was an error syncing transactions.") + " "
|
msg = _("There was an error syncing transactions.") + " "
|
||||||
msg += _("Please refresh or reset the Plaid linking of the Bank {}.").format(bank) + " "
|
msg += _("Please refresh or reset the Plaid linking of the Bank {}.").format(bank) + " "
|
||||||
frappe.log_error(msg, title=_("Plaid Link Refresh Required"))
|
frappe.log_error(message=msg, title=_("Plaid Link Refresh Required"))
|
||||||
|
|
||||||
return transactions
|
return transactions
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import frappe
|
|||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.model.naming import make_autoname, revert_series_if_last
|
from frappe.model.naming import make_autoname, revert_series_if_last
|
||||||
from frappe.utils import cint, flt, get_link_to_form
|
from frappe.utils import cint, flt, get_link_to_form, nowtime
|
||||||
from frappe.utils.data import add_days
|
from frappe.utils.data import add_days
|
||||||
from frappe.utils.jinja import render_template
|
from frappe.utils.jinja import render_template
|
||||||
|
|
||||||
@@ -179,7 +179,11 @@ def get_batch_qty(
|
|||||||
out = 0
|
out = 0
|
||||||
if batch_no and warehouse:
|
if batch_no and warehouse:
|
||||||
cond = ""
|
cond = ""
|
||||||
if posting_date and posting_time:
|
|
||||||
|
if posting_date:
|
||||||
|
if posting_time is None:
|
||||||
|
posting_time = nowtime()
|
||||||
|
|
||||||
cond = " and timestamp(posting_date, posting_time) <= timestamp('{0}', '{1}')".format(
|
cond = " and timestamp(posting_date, posting_time) <= timestamp('{0}', '{1}')".format(
|
||||||
posting_date, posting_time
|
posting_date, posting_time
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _, msgprint
|
from frappe import _, bold, msgprint
|
||||||
from frappe.utils import cint, cstr, flt
|
from frappe.utils import cint, cstr, flt
|
||||||
|
|
||||||
import erpnext
|
import erpnext
|
||||||
@@ -89,7 +89,7 @@ class StockReconciliation(StockController):
|
|||||||
|
|
||||||
if item_dict.get("serial_nos"):
|
if item_dict.get("serial_nos"):
|
||||||
item.current_serial_no = item_dict.get("serial_nos")
|
item.current_serial_no = item_dict.get("serial_nos")
|
||||||
if self.purpose == "Stock Reconciliation" and not item.serial_no:
|
if self.purpose == "Stock Reconciliation" and not item.serial_no and item.qty:
|
||||||
item.serial_no = item.current_serial_no
|
item.serial_no = item.current_serial_no
|
||||||
|
|
||||||
item.current_qty = item_dict.get("qty")
|
item.current_qty = item_dict.get("qty")
|
||||||
@@ -140,6 +140,14 @@ class StockReconciliation(StockController):
|
|||||||
|
|
||||||
self.validate_item(row.item_code, row)
|
self.validate_item(row.item_code, row)
|
||||||
|
|
||||||
|
if row.serial_no and not row.qty:
|
||||||
|
self.validation_messages.append(
|
||||||
|
_get_msg(
|
||||||
|
row_num,
|
||||||
|
f"Quantity should not be zero for the {bold(row.item_code)} since serial nos are specified",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# validate warehouse
|
# validate warehouse
|
||||||
if not frappe.db.get_value("Warehouse", row.warehouse):
|
if not frappe.db.get_value("Warehouse", row.warehouse):
|
||||||
self.validation_messages.append(_get_msg(row_num, _("Warehouse not found in the system")))
|
self.validation_messages.append(_get_msg(row_num, _("Warehouse not found in the system")))
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ def execute(filters=None):
|
|||||||
conversion_factors.append(0)
|
conversion_factors.append(0)
|
||||||
|
|
||||||
actual_qty = stock_value = 0
|
actual_qty = stock_value = 0
|
||||||
|
if opening_row:
|
||||||
|
actual_qty = opening_row.get("qty_after_transaction")
|
||||||
|
stock_value = opening_row.get("stock_value")
|
||||||
|
|
||||||
available_serial_nos = {}
|
available_serial_nos = {}
|
||||||
inventory_dimension_filters_applied = check_inventory_dimension_filters_applied(filters)
|
inventory_dimension_filters_applied = check_inventory_dimension_filters_applied(filters)
|
||||||
|
|||||||
Reference in New Issue
Block a user