OUCH! Then-Comptroller Alan Hevesi (pictured) prepared this $63 million estimate in 1996 for a computer system that has now cost $722 million in a deal KO'd by current Comptroller John Liu.James Messerschmidt

John Liu

(
)

City officials overseeing the scandal-scarred CityTime payroll project made a mind-boggling decision in 2003 — they agreed to pay the company building the massive system on an hourly basis without having any idea how many hours it would actually take to complete.

Seven years and tens of thousands of man-hours later — with the bill reaching an astonishing $722 million — the open-ended deal is finally over.

But questions are just beginning about how a small group of contractors was allegedly able to embezzle $80 million over five years without anyone in the government noticing.

The biggest scandal of Mayor Bloomberg’s tenure has its roots in the Giuliani administration, which made the original decision to build a computerized timekeeping system that could track all schedules for some 165,000 employees in more than 5,000 civil-service titles.

A document prepared by then-Comptroller Alan Hevesi in 1996 estimated the project would take two to three years.

The cost was put at $63 million.

By 2003, as more and more applications were added, lead contractor Science Applications International Corp. (SAIC) realized the task was becoming so enormous that it balked at going ahead, even at a higher rate of $114 million.

A consultant hired by SAIC, Ariel Partners LLC, concluded that the technology the city had signed up for was too “fragile” to meet its needs, according to an audit issued last September.

SAIC agreed to design an entirely new system at “no cost.” But there was one condition: SAIC wanted to be paid based on the hours its employees logged rather than on “fixed deliverables,” a flat rate for meeting each target.

The Office of Payroll Administration, which is overseen by the mayor and comptroller and was administering the contract, went along.

“They couldn’t put a fixed price on it,” said one official. “They didn’t know how much work needed to be done. No one understood the level of complexity.”

The new deal constituted something of a blank check for all the contractors, which included quality-assurance consultant Spherion, which was suspended last week after prosecutors accused its subcontractors of pulling off one of the biggest heists in city history.

This year, under pressure from Comptroller John Liu, Bloomberg finally ended the hourly arrangement with SAIC.

The mayor announced that all future payments would be withheld until it delivers a completed product in six months — 11 years after the start date.

One SAIC rival told The Post that he’d been warning the city for years that “something is wrong.”

“This is a contract we shared [discussions about] with both the Comptroller’s Office [under Bill Thompson] and the Mayor’s Office,” said the rival vendor. “This is a contract any other vendor could have done in a five-year period.”