Fixed patch: erpnext/patches/v4_1/fix_delivery_and_billing_status.py
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 1c2112d..b7fc5e7 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -67,4 +67,4 @@
 erpnext.patches.v4_1.set_outgoing_email_footer
 erpnext.patches.v4_1.fix_jv_remarks
 erpnext.patches.v4_1.fix_sales_order_delivered_status
-erpnext.patches.v4_1.fix_delivery_and_billing_status_for_draft_so
\ No newline at end of file
+erpnext.patches.v4_1.fix_delivery_and_billing_status
diff --git a/erpnext/patches/v4_1/fix_delivery_and_billing_status_for_draft_so.py b/erpnext/patches/v4_1/fix_delivery_and_billing_status.py
similarity index 79%
rename from erpnext/patches/v4_1/fix_delivery_and_billing_status_for_draft_so.py
rename to erpnext/patches/v4_1/fix_delivery_and_billing_status.py
index 8d38338..2dbc825 100644
--- a/erpnext/patches/v4_1/fix_delivery_and_billing_status_for_draft_so.py
+++ b/erpnext/patches/v4_1/fix_delivery_and_billing_status.py
@@ -5,8 +5,8 @@
 import frappe
 
 def execute():
-	frappe.db.sql("""update `tabSales Order` set delivery_status = 'Not Delivered' 
-		where delivery_status = 'Delivered' and ifnull(per_delivered, 0) = 0 and docstatus = 0""")
+	frappe.db.sql("""update `tabSales Order` set delivery_status = 'Not Delivered'
+		where delivery_status = 'Delivered' and ifnull(per_delivered, 0) = 0 and ifnull(docstatus, 0) in (0, 1)""")
 
-	frappe.db.sql("""update `tabSales Order` set billing_status = 'Not Billed' 
-		where billing_status = 'Billed' and ifnull(per_billed, 0) = 0 and docstatus = 0""")
\ No newline at end of file
+	frappe.db.sql("""update `tabSales Order` set billing_status = 'Not Billed'
+		where billing_status = 'Billed' and ifnull(per_billed, 0) = 0 and ifnull(docstatus, 0) in (0, 1)""")