mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
fix(accounts): ask for incoming rate on standalone POS returns
A standalone POS return had no field for the incoming rate. Without stock history in the warehouse, the consolidated credit note could not get a rate and the POS Closing Entry failed. POS Invoice Item now has the field, the rate is checked when the return is saved, and consolidation carries it over.
This commit is contained in:
@@ -84,6 +84,7 @@
|
||||
"serial_and_batch_bundle",
|
||||
"use_serial_batch_fields",
|
||||
"col_break5",
|
||||
"incoming_rate",
|
||||
"allow_zero_valuation_rate",
|
||||
"item_tax_rate",
|
||||
"actual_batch_qty",
|
||||
@@ -644,6 +645,16 @@
|
||||
"fieldname": "col_break5",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:parent.is_return && !parent.return_against",
|
||||
"fieldname": "incoming_rate",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Incoming Rate (Costing)",
|
||||
"no_copy": 1,
|
||||
"non_negative": 1,
|
||||
"options": "Company:company:default_currency",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "allow_zero_valuation_rate",
|
||||
@@ -871,7 +882,7 @@
|
||||
],
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2026-04-20 16:16:12.322024",
|
||||
"modified": "2026-10-28 12:00:00.000000",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "POS Invoice Item",
|
||||
|
||||
@@ -48,6 +48,7 @@ class POSInvoiceItem(Document):
|
||||
has_item_scanned: DF.Check
|
||||
image: DF.Attach | None
|
||||
income_account: DF.Link
|
||||
incoming_rate: DF.Currency
|
||||
is_fixed_asset: DF.Check
|
||||
is_free_item: DF.Check
|
||||
item_code: DF.Link | None
|
||||
|
||||
@@ -237,7 +237,11 @@ class POSInvoiceMergeLog(Document):
|
||||
item.amount = item.net_amount
|
||||
item.base_amount = item.base_net_amount
|
||||
item.price_list_rate = 0
|
||||
si_item = map_child_doc(item, invoice, {"doctype": "Sales Invoice Item"})
|
||||
si_item = map_child_doc(
|
||||
item,
|
||||
invoice,
|
||||
{"doctype": "Sales Invoice Item", "field_map": {"incoming_rate": "incoming_rate"}},
|
||||
)
|
||||
si_item.pos_invoice = doc.name
|
||||
si_item.pos_invoice_item = item.name
|
||||
if doc.is_return:
|
||||
|
||||
@@ -511,7 +511,11 @@ class SellingController(StockController):
|
||||
):
|
||||
d.incoming_rate = 0
|
||||
|
||||
if self.doctype not in ("Delivery Note", "Sales Invoice"):
|
||||
is_standalone = self.get("is_return") and not self.get("return_against")
|
||||
|
||||
if self.doctype not in ("Delivery Note", "Sales Invoice") and not (
|
||||
self.doctype == "POS Invoice" and is_standalone
|
||||
):
|
||||
return
|
||||
|
||||
if self.doctype == "Sales Invoice" and not self.update_stock and not self.is_internal_transfer():
|
||||
@@ -526,8 +530,6 @@ class SellingController(StockController):
|
||||
"Selling Settings", "set_zero_rate_for_expired_batch"
|
||||
)
|
||||
|
||||
is_standalone = self.is_return and not self.return_against
|
||||
|
||||
old_doc = self.get_doc_before_save()
|
||||
items = self.get("items") + (self.get("packed_items") or [])
|
||||
for d in items:
|
||||
|
||||
Reference in New Issue
Block a user