def confirm(self): for item in self.get_items(): item.add_stock_items() FiscalBookEntry.create_product_entry(self.store, self.purchase.group, self.cfop, self.invoice_number, self.icms_total, self.ipi_total) self.invoice_total = self.get_total() if self.purchase.can_close(): self.purchase.close()
def confirm(self): for item in self.get_items(): item.add_stock_items() FiscalBookEntry.create_product_entry( self.store, self.purchase.group, self.cfop, self.invoice_number, self.icms_total, self.ipi_total ) self.invoice_total = self.get_total() if self.purchase.can_close(): self.purchase.close()
def confirm(self): self.invoice_total = self.total if self.group: self.group.confirm() for receiving in self.receiving_orders: receiving.invoice_number = self.invoice_number # XXX: Maybe FiscalBookEntry should not reference the payment group, but # lets keep this way for now until we refactor the fiscal book related # code, since it will pretty soon need a lot of changes. group = self.group or self.get_purchase_orders().pop().group FiscalBookEntry.create_product_entry( self.store, group, receiving.cfop, self.invoice_number, self.icms_total, self.ipi_total)
def confirm(self): self.invoice_total = self.total if self.group: self.group.confirm() for receiving in self.receiving_orders: receiving.invoice_number = self.invoice_number # XXX: Maybe FiscalBookEntry should not reference the payment group, but # lets keep this way for now until we refactor the fiscal book related # code, since it will pretty soon need a lot of changes. group = self.group or self.get_purchase_orders().pop().group FiscalBookEntry.create_product_entry(self.store, group, receiving.cfop, self.invoice_number, self.icms_total, self.ipi_total)
def testCreateProductEntry(self): sale = self.create_sale() sale.add_sellable(self.create_sellable(), price=150) book_entry = FiscalBookEntry.create_product_entry( self.store, sale.group, sale.cfop, sale.coupon_id, 123) self.failUnless(book_entry) self.assertEquals(book_entry.icms_value, 123) self.assertEquals(book_entry.entry_type, FiscalBookEntry.TYPE_PRODUCT)
def confirm(self): for item in self.get_items(): item.add_stock_items() purchases = list(self.purchase_orders) # XXX: Maybe FiscalBookEntry should not reference the payment group, but # lets keep this way for now until we refactor the fiscal book related # code, since it will pretty soon need a lot of changes. group = purchases[0].group FiscalBookEntry.create_product_entry(self.store, group, self.cfop, self.invoice_number, self.icms_total, self.ipi_total) self.invoice_total = self.total for purchase in purchases: if purchase.can_close(): purchase.close()
def test_create_product_entry(self): sale = self.create_sale() sale.add_sellable(self.create_sellable(), price=150) book_entry = FiscalBookEntry.create_product_entry( self.store, self.current_branch, self.current_user, sale.group, sale.cfop, sale.coupon_id, 123) self.assertTrue(book_entry) self.assertEqual(book_entry.icms_value, 123) self.assertEqual(book_entry.entry_type, FiscalBookEntry.TYPE_PRODUCT)
def confirm(self): for item in self.get_items(): item.add_stock_items() purchases = list(self.purchase_orders) # XXX: Maybe FiscalBookEntry should not reference the payment group, but # lets keep this way for now until we refactor the fiscal book related # code, since it will pretty soon need a lot of changes. group = purchases[0].group FiscalBookEntry.create_product_entry( self.store, group, self.cfop, self.invoice_number, self.icms_total, self.ipi_total ) self.invoice_total = self.total for purchase in purchases: if purchase.can_close(): purchase.close()
def test_create_product_entry(self): sale = self.create_sale() sale.add_sellable(self.create_sellable(), price=150) book_entry = FiscalBookEntry.create_product_entry( self.store, sale.group, sale.cfop, sale.coupon_id, 123) self.assertTrue(book_entry) self.assertEqual(book_entry.icms_value, 123) self.assertEqual(book_entry.entry_type, FiscalBookEntry.TYPE_PRODUCT)