当前位置: 首页>>代码示例>>Python>>正文


Python Till.add_entry方法代码示例

本文整理汇总了Python中stoqlib.domain.till.Till.add_entry方法的典型用法代码示例。如果您正苦于以下问题:Python Till.add_entry方法的具体用法?Python Till.add_entry怎么用?Python Till.add_entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stoqlib.domain.till.Till的用法示例。


在下文中一共展示了Till.add_entry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testGetCashAmount

# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import add_entry [as 别名]
    def testGetCashAmount(self):
        till = Till(store=self.store,
                    station=self.create_station())
        till.open_till()

        old = till.get_cash_amount()
        # money operations
        till.add_credit_entry(currency(10), u"")
        self.assertEqual(till.get_cash_amount(), old + 10)
        till.add_debit_entry(currency(5), u"")
        self.assertEqual(till.get_cash_amount(), old + 5)
        # non-money operations
        payment1 = self._create_inpayment()
        till.add_entry(payment1)
        self.assertEqual(till.get_cash_amount(), old + 5)
        payment2 = self._create_outpayment()
        till.add_entry(payment2)
        self.assertEqual(till.get_cash_amount(), old + 5)
        # money payment method operation
        payment = self.create_payment()
        payment.due_date = till.opening_date
        payment.till = till
        payment.set_pending()
        TillEntry(description=u'test', value=payment.value, till=till,
                  branch=till.station.branch, payment=payment, store=self.store)
        payment.pay()
        self.assertEqual(till.get_cash_amount(), old + 5 + payment.value)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:29,代码来源:test_till.py

示例2: test_add_entry_out_payment

# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import add_entry [as 别名]
    def test_add_entry_out_payment(self):
        till = Till(store=self.store, station=self.create_station())
        till.open_till()

        payment = self._create_outpayment()
        self.assertEqual(till.get_balance(), 0)
        till.add_entry(payment)
        self.assertEqual(till.get_balance(), -10)
开发者ID:rg3915,项目名称:stoq,代码行数:10,代码来源:test_till.py

示例3: testAddEntryInPayment

# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import add_entry [as 别名]
    def testAddEntryInPayment(self):
        till = Till(store=self.store,
                    station=self.create_station())
        till.open_till()

        payment = self._create_inpayment()
        self.assertEqual(till.get_balance(), 0)
        till.add_entry(payment)
        self.assertEqual(till.get_balance(), 10)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:11,代码来源:test_till.py


注:本文中的stoqlib.domain.till.Till.add_entry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。