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


Python Inventory.open_date方法代码示例

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


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

示例1: testRegisters

# 需要导入模块: from stoqlib.domain.inventory import Inventory [as 别名]
# 或者: from stoqlib.domain.inventory.Inventory import open_date [as 别名]
    def testRegisters(self):
        order = self.create_receiving_order()
        order.receival_date = localdate(2007, 6, 1).date()
        order.discount_value = 10
        # order.purchase.discount_value = 5
        # order.purchase.surcharge_value = 8
        # order.surcharge_value = 15
        order.ipi_total = 10
        order.freight_total = 6
        order.secure_value = 6
        order.expense_value = 12
        supplier = self.create_supplier()
        company = supplier.person.has_individual_or_company_facets()
        company.state_registry = u'103238426117'
        order.supplier = supplier
        employee = self.create_employee()
        branch = get_current_branch(self.store)
        branch.manager = employee

        order.purchase.status = order.purchase.ORDER_PENDING

        sellable = self.create_sellable()
        sellable.tax_constant = SellableTaxConstant(
            description=u"18",
            tax_type=int(TaxType.CUSTOM),
            tax_value=18,
            store=self.store)
        self.create_receiving_order_item(order, sellable=sellable)

        sellable2 = self.create_sellable()
        sellable2.tax_constant = SellableTaxConstant(
            description=u"6",
            tax_type=int(TaxType.CUSTOM),
            tax_value=6,
            store=self.store)
        self.create_receiving_order_item(order, sellable=sellable2)

        order.purchase.confirm()
        order.confirm()

        sellable.code = u'9999'
        sellable2.code = u'10000'

        sale = self.create_sale()
        sale.open_date = localdate(2007, 6, 10).date()

        sellable3 = self.create_sellable()
        product = sellable3.product
        sellable.tax_constant = SellableTaxConstant(
            description=u"18",
            tax_type=int(TaxType.CUSTOM),
            tax_value=18,
            store=self.store)

        sale.add_sellable(sellable3, quantity=1)

        self.create_storable(product, get_current_branch(self.store), stock=100)

        sale.order()

        method = PaymentMethod.get_by_name(self.store, u'money')
        method.create_payment(Payment.TYPE_IN, sale.group, sale.branch,
                              sale.get_sale_subtotal())

        sale.confirm()
        sale.group.pay()
        sale.close_date = localdate(2007, 6, 10).date()
        sale.confirm_date = localdate(2007, 6, 10).date()
        sellable3.code = u'09999'

        inventory = Inventory(branch=branch, store=self.store)
        inventory.open_date = localdate(2007, 6, 15).date()

        # product came from sellable3
        inventory_item = InventoryItem(product=product,
                                       product_cost=product.sellable.cost,
                                       inventory=inventory,
                                       recorded_quantity=99,
                                       store=self.store)
        inventory_item.cfop_data = self.store.get(CfopData, 1)
        inventory_item.reason = u'Test'
        inventory_item.actual_quantity = 99
        inventory_item.adjust(invoice_number=999)
        inventory.close(close_date=localdate(2007, 6, 15).date())

        generator = StoqlibSintegraGenerator(self.store,
                                             localdate(2007, 6, 1).date(),
                                             localdate(2007, 6, 30).date())

        try:
            compare_sintegra_file(generator.sintegra, 'sintegra-receival')
        except AssertionError as e:
            self.fail(e)
开发者ID:marianaanselmo,项目名称:stoq,代码行数:95,代码来源:test_sintegragenerator.py


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