date issue fixed serial no
This commit is contained in:
parent
8f5b8c658a
commit
d1a64d89be
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
from frappe.utils import cint, cstr, flt, add_days, nowdate
|
from frappe.utils import cint, cstr, flt, add_days, nowdate, getdate
|
||||||
from frappe import _, ValidationError
|
from frappe import _, ValidationError
|
||||||
|
|
||||||
from erpnext.controllers.stock_controller import StockController
|
from erpnext.controllers.stock_controller import StockController
|
||||||
@ -38,16 +38,16 @@ class SerialNo(StockController):
|
|||||||
if not self.warranty_expiry_date and not self.amc_expiry_date:
|
if not self.warranty_expiry_date and not self.amc_expiry_date:
|
||||||
self.maintenance_status = None
|
self.maintenance_status = None
|
||||||
|
|
||||||
if self.warranty_expiry_date and self.warranty_expiry_date < nowdate():
|
if self.warranty_expiry_date and getdate(self.warranty_expiry_date) < getdate(nowdate()):
|
||||||
self.maintenance_status = "Out of Warranty"
|
self.maintenance_status = "Out of Warranty"
|
||||||
|
|
||||||
if self.amc_expiry_date and self.amc_expiry_date < nowdate():
|
if self.amc_expiry_date and getdate(self.amc_expiry_date) < getdate(nowdate()):
|
||||||
self.maintenance_status = "Out of AMC"
|
self.maintenance_status = "Out of AMC"
|
||||||
|
|
||||||
if self.amc_expiry_date and self.amc_expiry_date >= nowdate():
|
if self.amc_expiry_date and getdate(self.amc_expiry_date) >= getdate(nowdate()):
|
||||||
self.maintenance_status = "Under AMC"
|
self.maintenance_status = "Under AMC"
|
||||||
|
|
||||||
if self.warranty_expiry_date and self.warranty_expiry_date >= nowdate():
|
if self.warranty_expiry_date and getdate(self.warranty_expiry_date) >= getdate(nowdate()):
|
||||||
self.maintenance_status = "Under Warranty"
|
self.maintenance_status = "Under Warranty"
|
||||||
|
|
||||||
def validate_warehouse(self):
|
def validate_warehouse(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user