First, our second quarter revenue of $372 million was down 27% from a year ago, which was in line to slightly better than my expectations.
Our GAAP earnings per share for the quarter was $0.12 compared to an adjusted earnings per share for the quarter of $0.15, which includes a $0.03 adjustment primarily from the loss on extinguishment of our partially owned subsidiaries debt.
In the quarter, cash flow from operations totaled $265 million, and free cash flow or excess cash after all investments and dividends was $269 million.
First, as you know, consumer confidence is very strong, and that activity has begun to ripple into our markets as we are seeing increasing railcar loads which are now running roughly 8% above 2020.
Railcars and storage declined 5% compared to a quarter ago, which has also been aided by strong scrapping market I mentioned.
As a result, our future lease rate differential or FLRD metric, which is the average of the rates transacted in the current quarter as compared to the average of the next 12 months expiring rates improved to a minus 2.5% compared to last quarter's minus 14.8%, continuing the recovery that we believe began in the third quarter of last year.
Lastly, the demand is beginning to show up in orders, which were up 224% compared to last quarter.
Over the last few years, our service capacity has increased from roughly 1/3 to over half of our maintenance events, achieving a target we set out at the end of 2018.
With our current footprint, we have the ability to get to 70%, which will continue to reduce the effective maintenance cost of our fleet and improve our railcar serviceability for our customers.
As a good indicator of our progress, year-to-date 2021, over 60% of our fleet maintenance spend was internal.
What is most exciting is what we are seeing in our orders, which totaled 4,570 in the quarter, up 224% compared to last quarter.
In total, Trinity has issued and refinanced approximately $2.3 billion of debt since the onset of the pandemic, including our partially owned subsidiaries.
In aggregate, we have lowered the company's borrowing cost by 100 basis points over that time.
In the quarter, Trinity repurchased $68 million of stock in the open market and also completed a $223 million block purchase from ValueAct as they monetized a portion of their investment.
These repurchases accounted for just under 10% of the company's shares.
Over the quarter, trading was active in the secondary markets and booked gains on lease portfolio sales of $11 million.
Our second quarter consolidated revenue totaled $372 million, which was down 27% compared to a year ago.
Specifically, over 64% of deliveries in the quarter were for our lease portfolio compared to 41% in Q2 2020.
Overall, our adjusted earnings improved sequentially to $0.15 from $0.07, driven by a combination of better fundamentals, gains on lease portfolio sales and our share repurchase activity.
Our second quarter earnings and included an $11 million gain on lease portfolio sales, consistent with our ongoing lease fleet optimization efforts aided by the broadening secondary market.
We did incur an expense of $11.7 million related to the early extinguishment of debt in our partially owned leasing entities.
In regards to cash flow, year-to-date cash flow from operations totaled $335 million.
Cash flow from operations in the second quarter was $265 million, which reflects the collection of $207 million of our income tax receivable during the second quarter.
As a result of these factors, we are revising our cash flow from operations range to $600 million to $650 million, which was previously $625 million to $675 million.
Our net investment for leasing in the quarter was approximately $72 million, consisting of $144 million of additions and betterments, reduced by portfolio sales of $72 million.
Our manufacturing capex was $9 million for the second quarter.
For the year, our expectations for net leasing and manufacturing capex is $200 million to $250 million and $45 million to $55 million, respectively.
Our range for net leasing capex for the year was reduced $100 million, primarily to a shift in deliveries from the lease portfolio to direct sale.
Total free cash flow after investments and dividends totaled $269 million in the second quarter.
Additionally, free cash flow was aided by the debt financing accomplished in the quarter, which increased the loan to value on our wholly owned lease fleet to 62.5%.
Trinity remains in a strong financial position and our liquidity at the end of the second quarter was $918 million.
Over the past quarter, Trinity access to debt markets for approximately $1.6 billion, which included refinancing over $1.25 billion of debt for our partially owned leasing entities and issuance of $325 million of green asset-backed securities at a rate of 2.31% and anticipated seven-year life.
The aggregate effect of our financing activities over the past 12 months has lowered trades borrowing costs approximately 100 basis points.
We sold 700 railcars, yielding the gain I mentioned earlier.
We also purchased 155 railcars, which we were able to deploy at attractive returns immediately.
As highlighted in our release, Trinity purchased 10.5 million shares at a cost of $291 million in the quarter, which includes a direct purchase from our largest shareholder.
Additionally, our dividend in the quarter totaled $24 million, bringing the total year-to-date capital return to shareholders to $375 million.

Summary:
Our GAAP earnings per share for the quarter was $0.12 compared to an adjusted earnings per share for the quarter of $0.15, which includes a $0.03 adjustment primarily from the loss on extinguishment of our partially owned subsidiaries debt.
Our second quarter consolidated revenue totaled $372 million, which was down 27% compared to a year ago.