mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 07:20:26 +00:00
fix: list view and form status not same for purchase order (#43690)
(cherry picked from commit a671fe13d4)
# Conflicts:
# erpnext/buying/doctype/purchase_order/purchase_order.js
# erpnext/buying/doctype/purchase_order/purchase_order_list.js
This commit is contained in:
@@ -218,8 +218,19 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends e
|
||||
}
|
||||
if(doc.status != "Closed") {
|
||||
if (doc.status != "On Hold") {
|
||||
<<<<<<< HEAD
|
||||
if(flt(doc.per_received) < 100 && allow_receipt) {
|
||||
cur_frm.add_custom_button(__('Purchase Receipt'), this.make_purchase_receipt, __('Create'));
|
||||
=======
|
||||
if (flt(doc.per_received) < 100 && allow_receipt) {
|
||||
this.frm.add_custom_button(
|
||||
__("Purchase Receipt"),
|
||||
() => {
|
||||
me.make_purchase_receipt();
|
||||
},
|
||||
__("Create")
|
||||
);
|
||||
>>>>>>> a671fe13d4 (fix: list view and form status not same for purchase order (#43690))
|
||||
if (doc.is_subcontracted) {
|
||||
if (doc.is_old_subcontracting_flow) {
|
||||
if (me.has_unsupplied_items()) {
|
||||
@@ -231,9 +242,21 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends e
|
||||
}
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
if(flt(doc.per_billed) < 100)
|
||||
cur_frm.add_custom_button(__('Purchase Invoice'),
|
||||
this.make_purchase_invoice, __('Create'));
|
||||
=======
|
||||
// Please do not add precision in the below flt function
|
||||
if (flt(doc.per_billed) < 100)
|
||||
this.frm.add_custom_button(
|
||||
__("Purchase Invoice"),
|
||||
() => {
|
||||
me.make_purchase_invoice();
|
||||
},
|
||||
__("Create")
|
||||
);
|
||||
>>>>>>> a671fe13d4 (fix: list view and form status not same for purchase order (#43690))
|
||||
|
||||
if(flt(doc.per_billed) < 100 && doc.status != "Delivered") {
|
||||
this.frm.add_custom_button(
|
||||
|
||||
@@ -10,14 +10,22 @@ frappe.listview_settings["Purchase Order"] = {
|
||||
"status",
|
||||
],
|
||||
get_indicator: function (doc) {
|
||||
// Please do not add precision in the flt function
|
||||
if (doc.status === "Closed") {
|
||||
return [__("Closed"), "green", "status,=,Closed"];
|
||||
} else if (doc.status === "On Hold") {
|
||||
return [__("On Hold"), "orange", "status,=,On Hold"];
|
||||
} else if (doc.status === "Delivered") {
|
||||
return [__("Delivered"), "green", "status,=,Closed"];
|
||||
<<<<<<< HEAD
|
||||
} else if (flt(doc.per_received, 2) < 100 && doc.status !== "Closed") {
|
||||
if (flt(doc.per_billed, 2) < 100) {
|
||||
=======
|
||||
} else if (doc.advance_payment_status == "Initiated") {
|
||||
return [__("To Pay"), "gray", "advance_payment_status,=,Initiated"];
|
||||
} else if (flt(doc.per_received) < 100 && doc.status !== "Closed") {
|
||||
if (flt(doc.per_billed) < 100) {
|
||||
>>>>>>> a671fe13d4 (fix: list view and form status not same for purchase order (#43690))
|
||||
return [
|
||||
__("To Receive and Bill"),
|
||||
"orange",
|
||||
@@ -26,17 +34,9 @@ frappe.listview_settings["Purchase Order"] = {
|
||||
} else {
|
||||
return [__("To Receive"), "orange", "per_received,<,100|per_billed,=,100|status,!=,Closed"];
|
||||
}
|
||||
} else if (
|
||||
flt(doc.per_received, 2) >= 100 &&
|
||||
flt(doc.per_billed, 2) < 100 &&
|
||||
doc.status !== "Closed"
|
||||
) {
|
||||
} else if (flt(doc.per_received) >= 100 && flt(doc.per_billed) < 100 && doc.status !== "Closed") {
|
||||
return [__("To Bill"), "orange", "per_received,=,100|per_billed,<,100|status,!=,Closed"];
|
||||
} else if (
|
||||
flt(doc.per_received, 2) >= 100 &&
|
||||
flt(doc.per_billed, 2) == 100 &&
|
||||
doc.status !== "Closed"
|
||||
) {
|
||||
} else if (flt(doc.per_received) >= 100 && flt(doc.per_billed) == 100 && doc.status !== "Closed") {
|
||||
return [__("Completed"), "green", "per_received,=,100|per_billed,=,100|status,!=,Closed"];
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user