當前位置: 首頁>>代碼示例>>Python>>正文


Python Inventory.close方法代碼示例

本文整理匯總了Python中stoqlib.domain.inventory.Inventory.close方法的典型用法代碼示例。如果您正苦於以下問題:Python Inventory.close方法的具體用法?Python Inventory.close怎麽用?Python Inventory.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在stoqlib.domain.inventory.Inventory的用法示例。


在下文中一共展示了Inventory.close方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testRegisters

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import close [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.close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。