fix: validate only if service stop date

This commit is contained in:
Nabin Hait
2018-09-03 12:17:57 +05:30
parent 3921660747
commit 13109aef9d

View File

@@ -546,6 +546,7 @@ class SalesInvoice(SellingController):
for item in self.items: for item in self.items:
if item.enable_deferred_revenue: if item.enable_deferred_revenue:
if item.service_stop_date:
if date_diff(item.service_stop_date, item.service_start_date) < 0: if date_diff(item.service_stop_date, item.service_start_date) < 0:
frappe.throw(_("Service Stop Date cannot be before Service Start Date")) frappe.throw(_("Service Stop Date cannot be before Service Start Date"))