Exemplo n.º 1
0
def allocate_D25025_OBL():
    item = ControlPointLineItem.objects.get(ien='95877740')

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('1236.80')
    alloc.cost = alloc.amount
    alloc.account_id = 1
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('6184')
    alloc.cost = alloc.amount
    alloc.account_id = 2
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('3092')
    alloc.cost = alloc.amount
    alloc.account_id = 3
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)
Exemplo n.º 2
0
def allocate_D25011_all():
    item = ControlPointLineItem.objects.get(ien='95958457')

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('186.67')
    alloc.cost = alloc.amount
    alloc.account_id = 1
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('186.67')
    alloc.cost = alloc.amount
    alloc.account_id = 2
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('186.66')
    alloc.cost = alloc.amount
    alloc.account_id = 3
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    item = ControlPointLineItem.objects.get(ien='95876936')

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('-13.34')
    alloc.cost = Decimal('173.33')
    alloc.account_id = 1
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('-13.33')
    alloc.cost = Decimal('173.34')
    alloc.account_id = 2
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('-13.33')
    alloc.cost = Decimal('173.33')
    alloc.account_id = 3
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    item = ControlPointLineItem.objects.get(ien='95873815')

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('-80')
    alloc.cost = Decimal('93.33')
    alloc.account_id = 1
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('-80')
    alloc.cost = Decimal('93.34')
    alloc.account_id = 2
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)

    alloc = ProjectAccountLineItem()
    alloc.ien = item.ien
    alloc.fyqseq = item.fyqseq
    alloc.type = item.txn_type
    alloc.date = item.obl_date
    alloc.po_nbr = item.obl_nbr
    alloc.description = item.description
    alloc.amount = Decimal('-80')
    alloc.cost = Decimal('93.33')
    alloc.account_id = 3
    alloc.control_point_line_item_id = item.id
    item.allocations.add(alloc)