예제 #1
0
 def __init__(self, store, branch: Branch, **kwargs):
     kwargs['invoice'] = Invoice(store=store,
                                 invoice_type=Invoice.TYPE_IN,
                                 branch=branch)
     super(ReturnedSale, self).__init__(store=store,
                                        branch=branch,
                                        **kwargs)
예제 #2
0
파일: transfer.py 프로젝트: 5l1v3r1/stoq-1
 def __init__(self, store, branch: Branch, **kwargs):
     kwargs['invoice'] = Invoice(store=store,
                                 invoice_type=Invoice.TYPE_OUT,
                                 branch=branch)
     super(TransferOrder, self).__init__(store=store,
                                         branch=branch,
                                         **kwargs)
예제 #3
0
 def __init__(self, store, branch: Branch, **kwargs):
     kwargs['invoice'] = Invoice(store=store,
                                 branch=branch,
                                 invoice_type=Invoice.TYPE_OUT)
     super(StockDecrease, self).__init__(store=store,
                                         branch=branch,
                                         **kwargs)
예제 #4
0
    def test_sale_return_invoice_step(self):
        main_branch = get_current_branch(self.store)
        sale = self.create_sale(branch=main_branch)
        self.add_product(sale)
        self.add_product(sale, quantity=2)
        self.add_payments(sale)
        sale.order()
        sale.confirm()
        returned_sale = sale.create_sale_return_adapter()
        wizard = SaleReturnWizard(self.store, returned_sale)
        self.click(wizard.next_button)
        step = wizard.get_current_step()

        self.check_wizard(wizard, 'wizard-sale-return-invoice-step')
        self.assertNotSensitive(wizard, ['next_button'])

        self.assertInvalid(step, ['reason'])
        step.reason.update(
            "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed\n"
            "do eiusmod tempor incididunt ut labore et dolore magna aliqua.")
        self.assertValid(step, ['reason'])

        # XXX: changed because invoice_number is no longer mandatory
        self.assertSensitive(wizard, ['next_button'])

        step.invoice_number.update(0)
        self.assertInvalid(step, ['invoice_number'])
        step.invoice_number.update(1000000000)
        self.assertInvalid(step, ['invoice_number'])
        self.assertNotSensitive(wizard, ['next_button'])

        # Check if the invoice number already exists in Invoice table
        invoice = Invoice(invoice_type=Invoice.TYPE_OUT, branch=main_branch)
        invoice.invoice_number = 123
        step.invoice_number.update(123)
        self.assertInvalid(step, ['invoice_number'])
        self.assertNotSensitive(wizard, ['next_button'])

        step.invoice_number.update(1)
        self.assertValid(step, ['invoice_number'])
        invoice.branch = self.create_branch()
        step.invoice_number.update(123)
        self.assertValid(step, ['invoice_number'])
        self.assertSensitive(wizard, ['next_button'])
예제 #5
0
파일: transfer.py 프로젝트: esosaja/stoq
 def __init__(self, store=None, **kwargs):
     kwargs['invoice'] = Invoice(store=store, invoice_type=Invoice.TYPE_OUT)
     super(TransferOrder, self).__init__(store=store, **kwargs)
예제 #6
0
 def __init__(self, store=None, **kwargs):
     kwargs['invoice'] = Invoice(store=store, invoice_type=Invoice.TYPE_IN)
     super(ReturnedSale, self).__init__(store=store, **kwargs)
예제 #7
0
 def __init__(self, store, branch, **kwargs):
     kwargs['invoice'] = Invoice(store=store,
                                 branch=branch,
                                 invoice_type=Invoice.TYPE_OUT)
     super(Loan, self).__init__(store=store, branch=branch, **kwargs)