mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 12:39:18 +00:00
Merge pull request #54962 from rohitwaghchaure/fixed-legacy-serial-no
fix: incoming rate for legacy serial no
This commit is contained in:
@@ -48,9 +48,18 @@ class DeprecatedSerialNoValuation:
|
|||||||
if not posting_datetime and self.sle.posting_date:
|
if not posting_datetime and self.sle.posting_date:
|
||||||
posting_datetime = get_combine_datetime(self.sle.posting_date, self.sle.posting_time)
|
posting_datetime = get_combine_datetime(self.sle.posting_date, self.sle.posting_time)
|
||||||
|
|
||||||
|
do_not_fetch_rate = frappe.db.get_single_value(
|
||||||
|
"Stock Reposting Settings", "do_not_fetch_incoming_rate_from_serial_no"
|
||||||
|
)
|
||||||
|
|
||||||
for serial_no in serial_nos:
|
for serial_no in serial_nos:
|
||||||
sn_details = frappe.db.get_value("Serial No", serial_no, ["purchase_rate", "company"], as_dict=1)
|
sn_details = frappe.db.get_value("Serial No", serial_no, ["purchase_rate", "company"], as_dict=1)
|
||||||
if sn_details and sn_details.purchase_rate and sn_details.company == self.sle.company:
|
if (
|
||||||
|
sn_details
|
||||||
|
and sn_details.purchase_rate
|
||||||
|
and sn_details.company == self.sle.company
|
||||||
|
and (not frappe.flags.through_repost_item_valuation or not do_not_fetch_rate)
|
||||||
|
):
|
||||||
self.serial_no_incoming_rate[serial_no] += flt(sn_details.purchase_rate)
|
self.serial_no_incoming_rate[serial_no] += flt(sn_details.purchase_rate)
|
||||||
incoming_values += self.serial_no_incoming_rate[serial_no]
|
incoming_values += self.serial_no_incoming_rate[serial_no]
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
|
"allow_bulk_edit": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"beta": 1,
|
"beta": 1,
|
||||||
"creation": "2021-10-01 10:56:30.814787",
|
"creation": "2021-10-01 10:56:30.814787",
|
||||||
@@ -13,6 +14,8 @@
|
|||||||
"end_time",
|
"end_time",
|
||||||
"limits_dont_apply_on",
|
"limits_dont_apply_on",
|
||||||
"item_based_reposting",
|
"item_based_reposting",
|
||||||
|
"column_break_mavd",
|
||||||
|
"do_not_fetch_incoming_rate_from_serial_no",
|
||||||
"section_break_dxuf",
|
"section_break_dxuf",
|
||||||
"enable_parallel_reposting",
|
"enable_parallel_reposting",
|
||||||
"no_of_parallel_reposting",
|
"no_of_parallel_reposting",
|
||||||
@@ -99,13 +102,23 @@
|
|||||||
"fieldname": "enable_separate_reposting_for_gl",
|
"fieldname": "enable_separate_reposting_for_gl",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Enable Separate Reposting for GL"
|
"label": "Enable Separate Reposting for GL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_mavd",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"description": "For legacy serial nos, do not fetch incoming rate from serial no and calculate it based on the inward transaction",
|
||||||
|
"fieldname": "do_not_fetch_incoming_rate_from_serial_no",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Do not fetch incoming rate from Serial No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_toolbar": 0,
|
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2026-03-16 13:28:20.978007",
|
"modified": "2026-05-15 12:59:34.392491",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Reposting Settings",
|
"name": "Stock Reposting Settings",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class StockRepostingSettings(Document):
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from frappe.types import DF
|
from frappe.types import DF
|
||||||
|
|
||||||
|
do_not_fetch_incoming_rate_from_serial_no: DF.Check
|
||||||
enable_parallel_reposting: DF.Check
|
enable_parallel_reposting: DF.Check
|
||||||
enable_separate_reposting_for_gl: DF.Check
|
enable_separate_reposting_for_gl: DF.Check
|
||||||
end_time: DF.Time | None
|
end_time: DF.Time | None
|
||||||
|
|||||||
Reference in New Issue
Block a user