Exemple #1
0
 def setUpTestData(cls):
     create_test_user(cls)
     create_account_models(cls)
     create_test_inventory_models(cls)
     create_test_common_entities(cls)
     cls.end = datetime.date.today()
     cls.start = cls.end - datetime.timedelta(days=30)
Exemple #2
0
 def setUpTestData(cls):
     create_test_common_entities(cls)
     create_test_user(cls)
     create_account_models(cls)
     create_test_inventory_models(cls)
     cls.PAYMENT_DATA = {
            'date':TODAY,
            'paid_to': cls.supplier.pk,
            'account_paid_from': cls.account_c.pk,
            'method': 'cash',
            'amount': 100,
            'reference': 'DPMT',
            'notes': 'Some Note'
         }
     cls.tax = Tax.objects.create(
         name="TEst",
         rate=10
     )
     cls.currency = Currency.objects.create(
         name='Test',
         symbol='$'
     )
     cls.currency_table = CurrencyConversionTable.objects.create(
         name='Base',
         reference_currency=cls.currency
     )
Exemple #3
0
    def setUpTestData(cls):
        create_test_common_entities(cls)
        create_test_user(cls)
        create_account_models(cls)
        create_test_inventory_models(cls)

        cls.employee = Employee.objects.create(first_name='first',
                                               last_name='last',
                                               user=cls.user)
Exemple #4
0
 def setUpTestData(cls):
     create_account_models(cls)
     cls.recurring_entry = RecurringExpense.objects.create(
         cycle=7,
         expiration_date=TODAY + datetime.timedelta(days=10),
         start_date=TODAY,
         description = 'Test Description',
         category=0,
         amount=100,
         debit_account=cls.account_d)
Exemple #5
0
 def setUpTestData(cls):
     create_account_models(cls)
     create_test_user(cls)
     create_test_inventory_models(cls)
     create_test_common_entities(cls)
     InventoryModelCreator(cls).create_inventory_controller()
     UserProfile.objects.create(
         user=User.objects.get(username='******'),
         email_address="*****@*****.**",
         email_password='******',
     )
Exemple #6
0
 def setUpTestData(cls):
     cls.user = User.objects.create_superuser('Testuser', '*****@*****.**', '123')
     create_account_models(cls)
     cls.recurring = RecurringExpense.objects.create(
         cycle=7,
         expiration_date=datetime.date.today(),
         start_date=datetime.date.today(),
         description = 'Test Description',
         category=0,
         amount=100,
         debit_account=cls.account_d
     )
Exemple #7
0
    def setUpTestData(cls):
        create_account_models(cls)
        create_test_user(cls)
        create_test_inventory_models(cls)
        create_test_common_entities(cls)

        cls.sup_ind = models.Supplier.objects.create(
            individual=cls.individual, )

        cls.SUPPLIER_DATA = {
            'vendor_type': 'individual',
            'name': 'test supplier'
        }
Exemple #8
0
 def setUpTestData(cls):
     create_account_models(cls)
     PAST = TODAY - datetime.timedelta(days=732)
     cls.old_asset = Asset.objects.create(
         name='Test Asset',
         description='Test description',
         category = 0,
         initial_value = 100,
         credit_account = cls.account_d,
         depreciation_period = 5,
         init_date = PAST,
         depreciation_method = 0,
         salvage_value = 20,
     )
Exemple #9
0
 def setUpTestData(cls):
     create_account_models(cls)
     cls.interest_account = InterestBearingAccount.objects.create(
         name='Test Interest Account',
         balance=100,
         type='asset',
         description='Some description',
         interest_rate=5,
         interest_interval=1,
         interest_method=0)
     cls.basic_account = Account.objects.create(
         name='Test Account',
         balance=100,
         type='asset',
         description='Some description')
Exemple #10
0
    def setUpTestData(cls):
        create_test_user(cls)
        create_account_models(cls)
        create_test_inventory_models(cls)
        create_test_common_entities(cls)
    
        cls.ACCOUNT_DATA = {
                'name': 'Other Test Account',
                'balance': 100,
                'type': 'asset',
                'description': 'Test Description',
                'balance_sheet_category': 'expense'
            }

        cls.end = datetime.date.today()
        cls.start = cls.end - datetime.timedelta(days=30)
Exemple #11
0
    def setUpTestData(cls):
        cls.user = User.objects.create_superuser('Testuser', '*****@*****.**',
                                                 '123')
        Employee.objects.create(first_name='first', last_name='last')
        create_account_models(cls)
        create_test_inventory_models(cls)

        cls.bill = Bill.objects.create(vendor=cls.supplier,
                                       date=datetime.date.today(),
                                       due=datetime.date.today())
        cls.billine = BillLine.objects.create(bill=cls.bill,
                                              expense=cls.expense)

        cls.bill_payment = BillPayment.objects.create(
            date=datetime.date.today(),
            account=Account.objects.get(pk=1000),
            bill=cls.bill,
            amount=100)
Exemple #12
0
    def setUpTestData(cls):
        employee_models.Employee.objects.create(first_name='first',
                                                last_name='last')
        create_account_models(cls)
        create_test_inventory_models(cls)

        cls.bill = Bill.objects.create(vendor=cls.supplier,
                                       date=datetime.date.today(),
                                       due=datetime.date.today())

        cls.billline = BillLine.objects.create(bill=cls.bill,
                                               expense=cls.expense)

        cls.bill_payment = BillPayment.objects.create(
            date=datetime.date.today(),
            account=Account.objects.get(pk=1000),
            bill=cls.bill,
            amount=100)
Exemple #13
0
 def setUpTestData(cls):
     create_test_user(cls)
     create_account_models(cls)
     create_test_inventory_models(cls)
     create_test_common_entities(cls)
 
     cls.ENTRY_DATA = {
         'reference': 'some test ref',
         'memo':'record of test entry',
         'date':TODAY,
         'journal' :cls.journal.pk,
         'amount': 100,
         'debit': cls.account_d.pk,
         'credit': cls.account_c.pk,
         'created_by': cls.user.pk
     }
     cls.JOURNAL_DATA = {
             'name': 'Other Test Journal',
             'start_period': TODAY,
             'end_period': TODAY + datetime.timedelta(days=30),
             'description': 'some test description'
         }
Exemple #14
0
 def setUpTestData(cls):
     create_account_models(cls)
     create_test_user(cls)
     create_test_inventory_models(cls)
     create_test_common_entities(cls)
     InventoryModelCreator(cls).create_inventory_controller()
Exemple #15
0
 def setUpTestData(cls):
     create_account_models(cls)
Exemple #16
0
 def setUpTestData(cls):
     create_account_models(cls)
     cls.usr = User.objects.create(username = "******")
Exemple #17
0
 def setUpTestData(cls):
     create_account_models(cls)
     create_test_user(cls)
     create_test_inventory_models(cls)
     create_test_common_entities(cls)
     EmployeeModelCreator(cls).create_employee()
Exemple #18
0
 def setUpTestData(cls):
     create_account_models(cls)
     create_test_user(cls)
     create_test_inventory_models(cls)
     create_test_common_entities(cls)
Exemple #19
0
def create_test_inventory_models(cls):
    create_account_models(cls)
    if User.objects.all().count() == 0:
        User.objects.create_user(username='******')

    if not hasattr(cls, 'organization'):
        cls.organization = Organization.objects.create(
            legal_name='test business'
        )

    cls.supplier = models.Supplier.objects.create(
        organization=cls.organization,
        account=cls.account_c
    )

    InventoryModelCreator(cls).create_inventory_controller()
    cls.unit = models.UnitOfMeasure.objects.create(
        name='Test Unit',
        description='Test description'
    )
    cls.category = models.Category.objects.create(
        name='Test Category',
        description='Test description'
    )

    pc = models.ProductComponent.objects.create(
        pricing_method=0,  # KISS direct pricing
        direct_price=10,
        margin=0.5,
    )

    cls.product = models.InventoryItem.objects.create(
        name='test name',
        unit=cls.unit,
        type=0,
        unit_purchase_price=10,
        description='Test Description',
        supplier=cls.supplier,
        minimum_order_level=0,
        maximum_stock_level=20,
        category=cls.category,
        product_component=pc
    )

    ec = models.EquipmentComponent.objects.create(
        condition="excellent",
        asset_data=cls.asset
    )

    cls.equipment = models.InventoryItem.objects.create(
        name='test equipment',
        unit=cls.unit,
        type=1,
        unit_purchase_price=10,
        description='Test Description',
        supplier=cls.supplier,
        category=cls.category,
        equipment_component=ec
    )

    cls.consumable = models.InventoryItem.objects.create(
        name='test comsumable',
        unit=cls.unit,
        unit_purchase_price=10,
        type=2,
        description='Test Description',
        supplier=cls.supplier,
        minimum_order_level=0,
        maximum_stock_level=20,
        category=cls.category
    )

    cls.warehouse = models.WareHouse.objects.create(
        name='Test Location',
        address='Test Address'
    )
    cls.medium = models.StorageMedia.objects.create(
        name="Test Medium",
        warehouse=cls.warehouse,
        description="shelves",
    )
    cls.warehouse_item = models.WareHouseItem.objects.create(
        item=cls.product,
        quantity=10,
        warehouse=cls.warehouse,
        location=cls.medium
    )
    cls.order = models.Order.objects.create(
        expected_receipt_date=TODAY,
        date=TODAY,
        tax=Tax.objects.first(),  # 10%
        supplier=cls.supplier,
        bill_to='Test Bill to',
        ship_to=cls.warehouse,
        tracking_number='34234',
        notes='Test Note',
        status='draft',
        issuing_inventory_controller=cls.controller
    )
    cls.order_item = models.OrderItem.objects.create(
        order=cls.order,
        item=cls.product,
        quantity=1,
        order_price=10,
    )
    cls.stock_receipt = models.StockReceipt.objects.create(
        order=cls.order,
        receive_date=TODAY,
        note='Test Note',
        fully_received=True,
    )

    cls.check = models.InventoryCheck.objects.create(
        date=TODAY,
        adjusted_by=cls.controller,
        warehouse=cls.warehouse,
        comments="Nothing new"
    )

    cls.adjustment = models.StockAdjustment.objects.create(
        warehouse_item=cls.warehouse_item,
        adjustment=1.0,
        note="Too many",
        inventory_check=cls.check
    )

    cls.transfer = models.TransferOrder.objects.create(
        date=TODAY,
        expected_completion_date=TODAY,
        issuing_inventory_controller=cls.controller,
        receiving_inventory_controller=cls.controller,
        actual_completion_date=TODAY,
        source_warehouse=cls.warehouse,
        receiving_warehouse=cls.warehouse,
    )
    cls.transfer_line = models.TransferOrderLine.objects.create(
        item=cls.product,
        quantity=1,
        transfer_order=cls.transfer
    )
    cls.scrap = models.InventoryScrappingRecord.objects.create(
        date=TODAY,
        controller=cls.controller,
        warehouse=cls.warehouse
    )
    cls.scrap_line = models.InventoryScrappingRecordLine.objects.create(
        item=cls.product,
        quantity=1,
        scrapping_record=cls.scrap
    )

    cls.note = models.DebitNote.objects.create(
        date=datetime.date.today(),
        order=cls.order,
        comments="comment"
    )