Philadelphia's sloppy handling of a federal grant to provide security at the 2016 Democratic National Convention is yet another example of the city's troubling pattern of behavior with money.

The city managed more than 50,000 visitors  including hundreds of protesters. It not only kept them and the region safe but showed the world that Philadelphia is an excellent host city.

Then, it shot itself in the foot with how it handled the money. In a report last week, the Department of Justice's Inspector General questioned how the city spent $15 million of a $46 million federal security grant. Most of the criticisms come down to an incapacity to handle grants.

The inspector general also rightly dinged the Justice Department for failing to do a better job overseeing how Philadelphia was spending the money.

The city has resolved most of the report's findings by promising to do a better job adhering to the rules, and it is disputing other findings.

Washington's criticism raises a historical problem with how the city handles taxpayer dollars.

In recent years, the city had five different water billing systems. In June, a controller's report found that sloppy bookkeeping led to $924 million in mistakes.

These issues are by no means limited to a single administration.  Instances of lax financial oversight and less-than-rigorous accounting could be considered a through line in the city's history. For example,  the city overspent its overtime budget this year by $40 million, according to an August report from the city's budget oversight board, the Pennsylvania Intergovernmental Cooperation Authority.  It's the eighth year in a row for this overspending.

There are lots of reasons for the city's troubles. For years, city departments have used computer systems that were about as sophisticated as an abacus. Different departments used different systems and they barely communicated with each other. City Hall also had trouble with oversight, exacerbated by recession-era staff cuts in finance agencies, which watch how our money is raised and spent.

The city acknowledges that it has problems, but it believes that a new budget system called One Philly can help it dig itself out of some of them. It would allow departments to see whether they are overspending on overtime or if absenteeism is spiking. All departments, from police to health, would be using the same system so watchdogs could quickly identify outliers and help them get back on course.  The city hopes to have its new system on line in January and says that it's putting employees through a rigorous training program to implement it.   Finance Director Rob Dubow says the system is "long overdue."

So, too, is the notion of zero-based budgeting, a concept championed by Mayors Nutter and Kenney,  but so far remains on the shelf. It's not a panacea, but it could make spending more efficient.

If Philadelphia wants to achieve the grand vision of becoming the 21st century city it longs to be — the one that successfully hosted the Democratic convention — it has to fundamentally change how it approaches controlling and spending the dollars taxpayers send to Broad and Market Streets.