mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
fix: list view and form status not same for purchase order (#43690)
This commit is contained in:
@@ -382,7 +382,7 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends (
|
|||||||
}
|
}
|
||||||
if (doc.status != "Closed") {
|
if (doc.status != "Closed") {
|
||||||
if (doc.status != "On Hold") {
|
if (doc.status != "On Hold") {
|
||||||
if (flt(doc.per_received, 2) < 100 && allow_receipt) {
|
if (flt(doc.per_received) < 100 && allow_receipt) {
|
||||||
this.frm.add_custom_button(
|
this.frm.add_custom_button(
|
||||||
__("Purchase Receipt"),
|
__("Purchase Receipt"),
|
||||||
() => {
|
() => {
|
||||||
@@ -412,7 +412,8 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flt(doc.per_billed, 2) < 100)
|
// Please do not add precision in the below flt function
|
||||||
|
if (flt(doc.per_billed) < 100)
|
||||||
this.frm.add_custom_button(
|
this.frm.add_custom_button(
|
||||||
__("Purchase Invoice"),
|
__("Purchase Invoice"),
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ frappe.listview_settings["Purchase Order"] = {
|
|||||||
"advance_payment_status",
|
"advance_payment_status",
|
||||||
],
|
],
|
||||||
get_indicator: function (doc) {
|
get_indicator: function (doc) {
|
||||||
|
// Please do not add precision in the flt function
|
||||||
if (doc.status === "Closed") {
|
if (doc.status === "Closed") {
|
||||||
return [__("Closed"), "green", "status,=,Closed"];
|
return [__("Closed"), "green", "status,=,Closed"];
|
||||||
} else if (doc.status === "On Hold") {
|
} else if (doc.status === "On Hold") {
|
||||||
@@ -19,8 +20,8 @@ frappe.listview_settings["Purchase Order"] = {
|
|||||||
return [__("Delivered"), "green", "status,=,Closed"];
|
return [__("Delivered"), "green", "status,=,Closed"];
|
||||||
} else if (doc.advance_payment_status == "Initiated") {
|
} else if (doc.advance_payment_status == "Initiated") {
|
||||||
return [__("To Pay"), "gray", "advance_payment_status,=,Initiated"];
|
return [__("To Pay"), "gray", "advance_payment_status,=,Initiated"];
|
||||||
} else if (flt(doc.per_received, 2) < 100 && doc.status !== "Closed") {
|
} else if (flt(doc.per_received) < 100 && doc.status !== "Closed") {
|
||||||
if (flt(doc.per_billed, 2) < 100) {
|
if (flt(doc.per_billed) < 100) {
|
||||||
return [
|
return [
|
||||||
__("To Receive and Bill"),
|
__("To Receive and Bill"),
|
||||||
"orange",
|
"orange",
|
||||||
@@ -29,17 +30,9 @@ frappe.listview_settings["Purchase Order"] = {
|
|||||||
} else {
|
} else {
|
||||||
return [__("To Receive"), "orange", "per_received,<,100|per_billed,=,100|status,!=,Closed"];
|
return [__("To Receive"), "orange", "per_received,<,100|per_billed,=,100|status,!=,Closed"];
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (flt(doc.per_received) >= 100 && flt(doc.per_billed) < 100 && doc.status !== "Closed") {
|
||||||
flt(doc.per_received, 2) >= 100 &&
|
|
||||||
flt(doc.per_billed, 2) < 100 &&
|
|
||||||
doc.status !== "Closed"
|
|
||||||
) {
|
|
||||||
return [__("To Bill"), "orange", "per_received,=,100|per_billed,<,100|status,!=,Closed"];
|
return [__("To Bill"), "orange", "per_received,=,100|per_billed,<,100|status,!=,Closed"];
|
||||||
} else if (
|
} else if (flt(doc.per_received) >= 100 && flt(doc.per_billed) == 100 && doc.status !== "Closed") {
|
||||||
flt(doc.per_received, 2) >= 100 &&
|
|
||||||
flt(doc.per_billed, 2) == 100 &&
|
|
||||||
doc.status !== "Closed"
|
|
||||||
) {
|
|
||||||
return [__("Completed"), "green", "per_received,=,100|per_billed,=,100|status,!=,Closed"];
|
return [__("Completed"), "green", "per_received,=,100|per_billed,=,100|status,!=,Closed"];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user