functions already added in delivery_triip.py (#6027)
This commit is contained in:
parent
6b508cf809
commit
41d1446c04
1 changed files with 0 additions and 15 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue