Distribution of Monthly Lease Payment

We have a monthly lease payment that is distributed to all of our current jobs.  It's based on the total monthly lease divided by our total monthly sales times our monthly billing per job.  Is there a way to set this up so the system can automatically calculate the distribution of the monthly lease?