本文整理汇总了Python中stoqlib.domain.till.Till.get_last方法的典型用法代码示例。如果您正苦于以下问题:Python Till.get_last方法的具体用法?Python Till.get_last怎么用?Python Till.get_last使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.domain.till.Till
的用法示例。
在下文中一共展示了Till.get_last方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: needs_closing
# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import get_last [as 别名]
def needs_closing(self):
"""Checks if the last opened till was closed and asks the
user if he wants to close it
:returns:
- CLOSE_TILL_BOTH if both DB and ECF needs closing.
- CLOSE_TILL_DB if only DB needs closing.
- CLOSE_TILL_ECF if only ECF needs closing.
- CLOSE_TILL_NONE if both ECF and DB are consistent (they may be
closed, or open for the current day)
"""
ecf_needs_closing = HasPendingReduceZ.emit()
last_till = Till.get_last(self.store)
if last_till:
db_needs_closing = last_till.needs_closing()
else:
db_needs_closing = False
if db_needs_closing and ecf_needs_closing:
return CLOSE_TILL_BOTH
elif db_needs_closing and not ecf_needs_closing:
return CLOSE_TILL_DB
elif ecf_needs_closing and not db_needs_closing:
return CLOSE_TILL_ECF
else:
return CLOSE_TILL_NONE
示例2: testGetLast
# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import get_last [as 别名]
def testGetLast(self):
till = Till(store=self.store,
station=get_current_station(self.store))
till.open_till()
self.assertEquals(Till.get_last(self.store), till)