fix: sql error on saving sales invoice without a sales order
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index 17f3ae5..ad06f97 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -81,6 +81,7 @@
 			party_details = _get_party_details(customer,
 				ignore_permissions=self.flags.ignore_permissions,
 				doctype=self.doctype, company=self.company,
+				posting_date=self.posting_date if hasattr(self, 'posting_date') else None,
 				fetch_payment_terms_template=fetch_payment_terms_template,
 				party_address=self.customer_address, shipping_address=self.shipping_address_name)
 			if not self.meta.get_field("sales_team"):