Cur_frm.doc.close() not working in custom script for Purchase Order

Hi All,
when i was trying to do actions(insert,save,cancel…) for Purchase Order doc is working fine but i’m not able to perform close() action.
Any suggestions?

what you want to close??

I am trying to change the status as Closed. Please find attached one

check below code

 frappe.ui.form.on("Branding Requisition", {
    	"refresh": function(frm) {
    		if(frm.doc.status!=="Closed") {
    			frm.add_custom_button(__("Close"), function() {
    				frm.set_value("status", "Closed");;
    		} else {
    			frm.add_custom_button(__("Reopen"), function() {
    				frm.set_value("status", "Open");;

Hii @Maheshwari_Bhavesh
I tried with below lines:
frm.set_value(“status”, “Closed”);;

I’m getting below error:
DocstatusTransitionError: Cannot change docstatus from 1 to 0

Did you get solution for this case ?