functions already added in delivery_triip.py (#6027)

This commit is contained in:
Zarrar 2018-08-29 16:05:47 +05:30 committed by Rushabh Mehta
parent 6b508cf809
commit 41d1446c04

View file

@ -24,18 +24,3 @@ class GoogleMapsSettings(Document):
frappe.throw(e.message)
return client
def round_timedelta(td, period):
"""Round timedelta"""
period_seconds = period.total_seconds()
half_period_seconds = period_seconds / 2
remainder = td.total_seconds() % period_seconds
if remainder >= half_period_seconds:
return datetime.timedelta(seconds=td.total_seconds() + (period_seconds - remainder))
else:
return datetime.timedelta(seconds=td.total_seconds() - remainder)
def format_address(address):
"""Customer Address format """
address = frappe.get_doc('Address', address)
return '{}, {}, {}, {}'.format(address.address_line1, address.city, address.pincode, address.country)