Exemplo n.º 1
0
    elif d["Status"] == "Transferred Out":
        m = asm.Movement()
        m.AnimalID = a.ID
        m.OwnerID = uo.ID
        m.MovementType = 3
        m.MovementDate = a.DateBroughtIn
        m.Comments = description
        a.Archived = 1
        a.ActiveMovementDate = m.MovementDate
        a.ActiveMovementID = m.ID
        a.ActiveMovementType = 3
        a.LastChangedDate = m.MovementDate
        movements.append(m)

# Get the current image for this animal from PetFinder if it is on shelter
if a.Archived == 0 and PETFINDER_ID != "" and pf != "":
    asm.petfinder_image(pf, a.ID, a.AnimalName)

# Now that everything else is done, output stored records
for a in animals:
    print(a)
for o in owners:
    print(o)
for m in movements:
    print(m)

asm.stderr_summary(animals=animals, owners=owners, movements=movements)

print("DELETE FROM configuration WHERE ItemName LIKE 'DBView%';")
print("COMMIT;")
Exemplo n.º 2
0
    a.ActiveMovementType = 1
    a.LastChangedDate = m.MovementDate
    movements.append(m)
    if d["AdoptionFeePd"] == "1":
        od = asm.OwnerDonation()
        ownerdonations.append(od)
        od.OwnerID = o.ID
        od.AnimalID = a.ID
        od.MovementID = m.ID
        od.Date = m.MovementDate
        od.Donation = asm.get_currency(d["AdoptionFeeAmount"])
        od.DonationTypeID = 2 # Adoption Fee

    # Get the current image for this animal from PetFinder if it is on shelter
    if a.Archived == 0 and PETFINDER_ID != "" and pf != "":
        asm.petfinder_image(pf, a.ID, a.AnimalName)

for d in creceipts:
    if not owners.has_key(d["PerID"]): continue
    o = owners[d["PerID"]]
    od = asm.OwnerDonation()
    ownerdonations.append(od)
    od.OwnerID = o.ID
    od.AnimalID = 0
    od.MovementID = 0
    od.Date = asm.getdate_mmddyy(d["Date"])
    od.Donation = asm.get_currency(d["Donation$"])
    comments = ""
    if d["InMemoryOf"] != "": comments += "memory: %s" % d["InMemoryOf"]
    if d["DonationFrom"] != "": comments += "\nfrom: %s" % d["DonationFrom"]
    if d["DonatedGoods"] != "": comments += "\ngoods: %s" % d["DonatedGoods"]