mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 01:34:10 +00:00
Merge pull request #50512 from aerele/support-53201
fix: add return status for purchase receipt
This commit is contained in:
@@ -101,6 +101,7 @@ status_map = {
|
||||
["Draft", None],
|
||||
["To Bill", "eval:self.per_billed == 0 and self.docstatus == 1"],
|
||||
["Partly Billed", "eval:self.per_billed > 0 and self.per_billed < 100 and self.docstatus == 1"],
|
||||
["Return", "eval:self.is_return == 1 and self.per_billed == 0 and self.docstatus == 1"],
|
||||
["Return Issued", "eval:self.per_returned == 100 and self.docstatus == 1"],
|
||||
[
|
||||
"Completed",
|
||||
|
||||
@@ -894,7 +894,7 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "status",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nDraft\nPartly Billed\nTo Bill\nCompleted\nReturn Issued\nCancelled\nClosed",
|
||||
"options": "\nDraft\nPartly Billed\nTo Bill\nCompleted\nReturn\nReturn Issued\nCancelled\nClosed",
|
||||
"print_hide": 1,
|
||||
"print_width": "150px",
|
||||
"read_only": 1,
|
||||
@@ -1309,7 +1309,7 @@
|
||||
"idx": 261,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2025-08-06 16:41:02.690658",
|
||||
"modified": "2025-11-12 19:53:48.173096",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Purchase Receipt",
|
||||
|
||||
@@ -120,7 +120,15 @@ class PurchaseReceipt(BuyingController):
|
||||
shipping_address_display: DF.TextEditor | None
|
||||
shipping_rule: DF.Link | None
|
||||
status: DF.Literal[
|
||||
"", "Draft", "Partly Billed", "To Bill", "Completed", "Return Issued", "Cancelled", "Closed"
|
||||
"",
|
||||
"Draft",
|
||||
"Partly Billed",
|
||||
"To Bill",
|
||||
"Completed",
|
||||
"Return",
|
||||
"Return Issued",
|
||||
"Cancelled",
|
||||
"Closed",
|
||||
]
|
||||
subcontracting_receipt: DF.Link | None
|
||||
supplied_items: DF.Table[PurchaseReceiptItemSupplied]
|
||||
|
||||
@@ -11,7 +11,7 @@ frappe.listview_settings["Purchase Receipt"] = {
|
||||
"currency",
|
||||
],
|
||||
get_indicator: function (doc) {
|
||||
if (cint(doc.is_return) == 1) {
|
||||
if (cint(doc.is_return) == 1 && doc.status == "Return") {
|
||||
return [__("Return"), "gray", "is_return,=,Yes"];
|
||||
} else if (doc.status === "Closed") {
|
||||
return [__("Closed"), "green", "status,=,Closed"];
|
||||
|
||||
@@ -454,6 +454,7 @@ class TestPurchaseReceipt(IntegrationTestCase):
|
||||
# Check if Original PR updated
|
||||
self.assertEqual(pr.items[0].returned_qty, 2)
|
||||
self.assertEqual(pr.per_returned, 40)
|
||||
self.assertEqual(returned.status, "Return")
|
||||
|
||||
from erpnext.controllers.sales_and_purchase_return import make_return_doc
|
||||
|
||||
@@ -2149,7 +2150,7 @@ class TestPurchaseReceipt(IntegrationTestCase):
|
||||
return_pr.items[0].stock_qty = 0.0
|
||||
return_pr.submit()
|
||||
|
||||
self.assertEqual(return_pr.status, "To Bill")
|
||||
self.assertEqual(return_pr.status, "Return")
|
||||
|
||||
pi = make_purchase_invoice(return_pr.name)
|
||||
pi.submit()
|
||||
|
||||
Reference in New Issue
Block a user