Skip to content

Commit 6f98fe1

Browse files
Merge pull request #43706 from frappe/mergify/bp/version-15/pr-43692
fix: list view and form status not same for purchase order (backport #43690) (backport #43692)
2 parents 99ead94 + 752d175 commit 6f98fe1

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

erpnext/buying/doctype/purchase_order/purchase_order.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends (
382382
}
383383
if (doc.status != "Closed") {
384384
if (doc.status != "On Hold") {
385-
if (flt(doc.per_received, 2) < 100 && allow_receipt) {
385+
if (flt(doc.per_received) < 100 && allow_receipt) {
386386
cur_frm.add_custom_button(
387387
__("Purchase Receipt"),
388388
this.make_purchase_receipt,
@@ -408,7 +408,7 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends (
408408
}
409409
}
410410
}
411-
if (flt(doc.per_billed, 2) < 100)
411+
if (flt(doc.per_billed) < 100)
412412
cur_frm.add_custom_button(
413413
__("Purchase Invoice"),
414414
this.make_purchase_invoice,

erpnext/buying/doctype/purchase_order/purchase_order_list.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ frappe.listview_settings["Purchase Order"] = {
1010
"status",
1111
],
1212
get_indicator: function (doc) {
13+
// Please do not add precision in the flt function
1314
if (doc.status === "Closed") {
1415
return [__("Closed"), "green", "status,=,Closed"];
1516
} else if (doc.status === "On Hold") {
1617
return [__("On Hold"), "orange", "status,=,On Hold"];
1718
} else if (doc.status === "Delivered") {
1819
return [__("Delivered"), "green", "status,=,Closed"];
19-
} else if (flt(doc.per_received, 2) < 100 && doc.status !== "Closed") {
20-
if (flt(doc.per_billed, 2) < 100) {
20+
} else if (flt(doc.per_received) < 100 && doc.status !== "Closed") {
21+
if (flt(doc.per_billed) < 100) {
2122
return [
2223
__("To Receive and Bill"),
2324
"orange",
@@ -26,17 +27,9 @@ frappe.listview_settings["Purchase Order"] = {
2627
} else {
2728
return [__("To Receive"), "orange", "per_received,<,100|per_billed,=,100|status,!=,Closed"];
2829
}
29-
} else if (
30-
flt(doc.per_received, 2) >= 100 &&
31-
flt(doc.per_billed, 2) < 100 &&
32-
doc.status !== "Closed"
33-
) {
30+
} else if (flt(doc.per_received) >= 100 && flt(doc.per_billed) < 100 && doc.status !== "Closed") {
3431
return [__("To Bill"), "orange", "per_received,=,100|per_billed,<,100|status,!=,Closed"];
35-
} else if (
36-
flt(doc.per_received, 2) >= 100 &&
37-
flt(doc.per_billed, 2) == 100 &&
38-
doc.status !== "Closed"
39-
) {
32+
} else if (flt(doc.per_received) >= 100 && flt(doc.per_billed) == 100 && doc.status !== "Closed") {
4033
return [__("Completed"), "green", "per_received,=,100|per_billed,=,100|status,!=,Closed"];
4134
}
4235
},

0 commit comments

Comments
 (0)