It should be allocated based on the percentage of stock ownership and for how long during the year. So, if you bought all the shares from a single owner on 7/1, then you would split the year's reporting between the prior owner and you 50/50.
Per IRS Instructions for Form 1120-S:
Items of income, gain, loss, deduction, or credit are allocated to a shareholder on a daily basis, according to the number of shares of stock held by the shareholder on each day of the corporation's tax year.
For more specifics about splitting the ownership look at "Shareholder's Pro Rata Share Items" on Instructions for Form 1120-S.