Exemple #1
0
    od.DonationTypeID = 1
    pm = getsbpaymentmethod(row["paymentmethod"])
    od.DonationPaymentID = 1
    if pm.find("Check") != -1: od.DonationPaymentID = 2
    if pm.find("Credit Card") != -1: od.DonationPaymentID = 3
    if pm.find("Debit Card") != -1: od.DonationPaymentID = 4
    od.Date = getdate(row["receiptdate"])
    od.OwnerID = findowner(row["recnum"]).ID
    od.Donation = asm.get_currency(row["Amount"])
    comments = "Check No: " + row["chequeno"]
    comments += "\nMethod: " + pm
    comments += "\n" + row["NotesToPrint"]
    od.Comments = comments
    print od

# Now that everything else is done, output stored records
print "DELETE FROM primarykey;"
print "DELETE FROM configuration WHERE ItemName Like 'VariableAnimalDataUpdated';"
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;"

Exemple #2
0
for k, v in asm.locations.iteritems():
    print v
for a in animals:
    print a
for am in animalmedicals:
    print am
for at in animaltests:
    print at
for av in animalvaccinations:
    print av
for o in owners:
    print o
for o in ownerdonations:
    print o
for m in movements:
    print m
for l in logs:
    print l

asm.stderr_summary(animals=animals,
                   animaltests=animaltests,
                   animalmedicals=animalmedicals,
                   animalvaccinations=animalvaccinations,
                   logs=logs,
                   owners=owners,
                   ownerdonations=ownerdonations,
                   movements=movements)

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"
Exemple #3
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;")
        m = asm.Movement()
        m.AnimalID = a.ID
        m.OwnerID = uo.ID
        m.MovementType = 1
        m.MovementDate = a.DateBroughtIn
        a.Archived = 1
        a.ActiveMovementID = m.ID
        a.ActiveMovementDate = a.DateBroughtIn
        a.ActiveMovementType = 1
        movements.append(m)

# Now that everything else is done, output stored records
for k, v in asm.locations.iteritems():
    print v
for a in animals:
    print a
for av in animalvaccinations:
    print av
for o in owners:
    print o
for m in movements:
    print m

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

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"
Exemple #5
0
    print v
if len(asm.jurisdictions.keys()) > 0:
    print "DELETE FROM jurisdiction;"
    for k, v in asm.jurisdictions.iteritems():
        print v
for a in animals:
    print a
for at in animaltests:
    print at
for av in animalvaccinations:
    print av
for o in owners:
    print o
for m in movements:
    print m
for l in logs:
    print l
for ac in animalcontrol:
    print ac

asm.stderr_summary(animals=animals,
                   animalcontrol=animalcontrol,
                   animaltests=animaltests,
                   animalvaccinations=animalvaccinations,
                   logs=logs,
                   owners=owners,
                   movements=movements)

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"
Exemple #6
0
    comments = asm.nulltostr(c["BITEMEMO"])
    comments += "\nReport By: %s" % c["REPORTBY"]
    comments += "\nOfficer: %s" % c["OFFICER"]
    comments += "\nSeverity: %s" % c["SEVERITY"]
    comments += "\nOwner Statement: %s" % c["OWNERSTMT"]
    if type(comments) == unicode: comments = comments.encode("ascii", "xmlcharrefreplace")
    ac.CallNotes = comments
    if c["ANIMALNO"] != "Unspecified" and ppa.has_key(c["ANIMALNO"]):
        animalcontrolanimal.append("INSERT INTO animalcontrolanimal (AnimalID, AnimalControlID) VALUES (%d, %d);" % (ppa[c["ANIMALNO"]].ID, ac.ID))

for a in animals:
    print a
for o in owners:
    print o
#for m in movements:
#    print m
for od in ownerdonation:
    print od
for ol in ownerlicence:
    print ol
for ac in animalcontrol:
    print ac
for aca in animalcontrolanimal:
    print aca

asm.stderr_summary(animals=animals, owners=owners, animalcontrol=animalcontrol, ownerlicences=ownerlicence, ownerdonations=ownerdonation)

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"

Exemple #7
0
    if c["FOLLOW_UP"] != "": comments += "\nFollowup: %s" % c["FOLLOW_UP"]
    if c["OFFICER_ID"] != "": comments += "\nOfficer: %s" % c["OFFICER_ID"]
    if c["CITATION"] != "": comments += "\nCitation: %s" % c["CITATION"]
    if c["CMPL_TEXT"] != "": comments += "\nCompleted: %s" % c["CMPL_TEXT"]
    if type(comments) == unicode:
        comments = comments.encode("ascii", "xmlcharrefreplace")
    ac.CallNotes = comments

for a in animals:
    print a
for o in owners:
    print o
for m in movements:
    print m
for od in ownerdonations:
    print od
for ol in ownerlicences:
    print ol
for ac in animalcontrol:
    print ac

asm.stderr_summary(animals=animals,
                   owners=owners,
                   movements=movements,
                   ownerlicences=ownerlicences,
                   ownerdonations=ownerdonations,
                   animalcontrol=animalcontrol)

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"
Exemple #8
0
        if asm.getdate_yyyymmdd(row["LICENSEEFF"]) is None:
            continue
        ol = asm.OwnerLicence()
        ownerlicences.append(ol)
        ol.AnimalID = a.ID
        ol.OwnerID = o.ID
        ol.IssueDate = asm.getdate_yyyymmdd(row["LICENSEEFF"])
        ol.ExpiryDate = asm.getdate_yyyymmdd(row["LICENSEEXP"])
        ol.LicenceNumber = asm.fw(row["LICENSE"])
        ol.LicenceTypeID = 2 # Unaltered dog
        if row["LICENSEFIX"] == "1":
            ol.LicenceTypeID = 1 # Altered dog

# Now that everything else is done, output stored records
for a in animals:
    print a
for av in animalvaccinations:
    print av
for o in owners:
    print o
for m in movements:
    print m
for ol in ownerlicences:
    print ol

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

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"

Exemple #9
0
    if arkspecies.has_key(c["C_SPECIES"]):
        ac.SpeciesID = arkspecies[c["C_SPECIES"]]
    ac.Sex = asm.getsex_mf(c["C_SEX"])
    comments = ""
    comments = "Problem: %s" % c["PROBLEM"]
    if c["FOLLOW_UP"] != "": comments += "\nFollowup: %s" % c["FOLLOW_UP"]
    if c["OFFICER_ID"] != "": comments += "\nOfficer: %s" % c["OFFICER_ID"]
    if c["CITATION"] != "": comments += "\nCitation: %s" % c["CITATION"]
    if c["CMPL_TEXT"] != "": comments += "\nCompleted: %s" % c["CMPL_TEXT"]
    if type(comments) == unicode: comments = comments.encode("ascii", "xmlcharrefreplace")
    ac.CallNotes = comments

for a in animals:
    print a
for o in owners:
    print o
for m in movements:
    print m
for od in ownerdonations:
    print od
for ol in ownerlicences:
    print ol
for ac in animalcontrol:
    print ac

asm.stderr_summary(animals=animals, owners=owners, movements=movements, ownerlicences=ownerlicences, ownerdonations=ownerdonations, animalcontrol=animalcontrol)

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"

Exemple #10
0
        od = asm.OwnerDonation()
        ownerdonations.append(od)
        od.OwnerID = o.ID
        od.Donation = int(d.donation_value * 100)
        od.Date = d.date_from
        od.DonationTypeID = 10  # RGT
        od.DonationPaymentID = 1  # Cash

# Now that everything else is done, output stored records
for k, v in asm.locations.iteritems():
    print v
for a in animals:
    print a
for o in owners:
    print o
for od in ownerdonations:
    print od
for m in movements:
    print m
for l in logs:
    print l

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

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"
Exemple #11
0
    ac.DispatchTown = d["City"]
    ac.DispatchCounty = d["State"]
    ac.DispatchPostcode = d["Zip Code"]
    ac.DispatchedACO = d["ACO Assigned"]
    comments = "Case Number: %s" % d["Case Number"]
    comments += "\nSubject: %s" % d["Subject of Call"]
    comments += "\nACO: %s" % d["ACO Assigned"]
    comments += "\nPriority: %s" % d["Priority"]
    comments += "\nEnding Status: %s" % d["Ending Status"]
    comments += "\nDispatcher: %s" % d["Dispatcher"]
    comments += "\nLocation Notes: %s" % d["Location Notes"]
    comments += "\nDispatch Notes: %s" % d["Dispatch Notes"]
    ac.CallNotes = comments

for a in animals:
    print(a)
for o in owners:
    print(o)
for ol in ownerlicence:
    print(ol)
for ac in animalcontrol:
    print(ac)

asm.stderr_summary(animals=animals,
                   owners=owners,
                   animalcontrol=animalcontrol,
                   ownerlicences=ownerlicence)

print("DELETE FROM configuration WHERE ItemName LIKE 'DBView%';")
print("COMMIT;")
Exemple #12
0
for a in animals:
    print a
for am in animalmedicals:
    print am
for av in animalvaccinations:
    print av
for l in logs:
    print l
for o in owners:
    print o
for m in movements:
    print m
for ol in ownerlicences:
    print ol
for ac in animalcontrol:
    print ac
for ac in animalcontrolanimals:
    print ac

asm.stderr_summary(animals=animals,
                   animalmedicals=animalmedicals,
                   animalvaccinations=animalvaccinations,
                   logs=logs,
                   owners=owners,
                   movements=movements,
                   ownerlicences=ownerlicences,
                   animalcontrol=animalcontrol)

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"
Exemple #13
0
        if tperformed:
            at = asm.AnimalTest()
            animaltests.append(at)
            at.AnimalID = a.ID
            at.DateRequired = tperformed
            at.DateOfTest = tperformed
            at.TestTypeID = "COALESCE((SELECT ID FROM testtype WHERE TestName LIKE '%%%s%%' LIMIT 1), 1)" % ttype
            asmresult = 0
            if tresult == "Negative": asmresult = 1
            if tresult == "Positive": asmresult = 2
            at.TestResultID = asmresult + 1
            at.Comments = tcomments

# Now that everything else is done, output stored records
for a in animals:
    print a
for at in animaltests:
    print at
for av in animalvaccinations:
    print av
for m in movements:
    print m

asm.stderr_summary(animals=animals,
                   animaltests=animaltests,
                   animalvaccinations=animalvaccinations,
                   movements=movements)

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"
    ol.OwnerID = o.ID
    ol.AnimalID = a.ID
    ol.LicenceTypeID = asm.licencetype_from_db(lt)
    licnum = "%s%s-%s" % (lt[0:3].upper(), lt[len(lt) - 2:],
                          row["Licence Number"])
    if numused.has_key(licnum):
        licnum = licnum + "-2"
    if numused.has_key(licnum) and licnum.endswith("-2"):
        licnum = licnum[0:len(licnum) - 2] + "-3"
    ol.LicenceNumber = licnum
    numused[licnum] = "X"
    ol.LicenceFee = asm.get_currency(row["Fee"])
    ol.IssueDate = asm.getdate_ddmmyyyy(row["Issued"])
    ol.ExpiryDate = asm.getdate_ddmmyyyy(row["Expired"])
    if ol.IssueDate is None: ol.IssueDate = asm.today()
    if ol.ExpiryDate is None: ol.ExpiryDate = asm.today()
    ol.Comments = row["Comments"]

# Now that everything else is done, output stored records
for a in animals:
    print a
for o in owners:
    print o
for ol in ownerlicences:
    print ol

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

print "DELETE FROM configuration WHERE ItemName LIKE 'DBView%';"
print "COMMIT;"