Merge pull request #33219 from deepeshgarg007/internal_transfer_editable_rate
fix: Allow item rate updates for non-stock invoices
This commit is contained in:
commit
921f8edde8
@ -231,7 +231,9 @@ class PurchaseInvoice(BuyingController):
|
||||
)
|
||||
|
||||
if (
|
||||
cint(frappe.db.get_single_value("Buying Settings", "maintain_same_rate")) and not self.is_return
|
||||
cint(frappe.db.get_single_value("Buying Settings", "maintain_same_rate"))
|
||||
and not self.is_return
|
||||
and not self.is_internal_supplier
|
||||
):
|
||||
self.validate_rate_with_reference_doc(
|
||||
[
|
||||
|
@ -322,6 +322,7 @@ class BuyingController(SubcontractingController):
|
||||
)
|
||||
|
||||
if self.is_internal_transfer():
|
||||
if self.doctype == "Purchase Receipt" or self.get("update_stock"):
|
||||
if rate != d.rate:
|
||||
d.rate = rate
|
||||
frappe.msgprint(
|
||||
|
@ -442,6 +442,7 @@ class SellingController(StockController):
|
||||
|
||||
# For internal transfers use incoming rate as the valuation rate
|
||||
if self.is_internal_transfer():
|
||||
if self.doctype == "Delivery Note" or self.get("update_stock"):
|
||||
if d.doctype == "Packed Item":
|
||||
incoming_rate = flt(
|
||||
flt(d.incoming_rate, d.precision("incoming_rate")) * d.conversion_factor,
|
||||
|
@ -173,7 +173,9 @@ class PurchaseReceipt(BuyingController):
|
||||
)
|
||||
|
||||
if (
|
||||
cint(frappe.db.get_single_value("Buying Settings", "maintain_same_rate")) and not self.is_return
|
||||
cint(frappe.db.get_single_value("Buying Settings", "maintain_same_rate"))
|
||||
and not self.is_return
|
||||
and not self.is_internal_supplier
|
||||
):
|
||||
self.validate_rate_with_reference_doc(
|
||||
[["Purchase Order", "purchase_order", "purchase_order_item"]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user